FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Using FUDAPI to log in a user (Application integration: log in a user from another database)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Using FUDAPI to log in a user [message #36321] Sat, 17 March 2007 03:51 Go to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Hello all,

I am integrating fud into an existing application with its own user management. My plan is to keep the fud user table and my app's user table synchronized (login name and email address info) All registering and logging in will be done through my application.

I have successfully employed fudapi.inc.php and forum_login.php to log a user into the forums from my system. When a user logs into my system, they're logged into the forums. One problem though, if I access "[fudforum]/index.php?t=index&S=[sess_id]" where sess is a valid session id, I get a blank page and this error in the logs:



ERROR: argument of OR must be type boolean, not type integer<br />
Query:

SELECT
m.subject, m.id, m.post_stamp,
u.id, u.alias,
f.cat_id, f.forum_icon, f.id, f.last_post_id, f.moderators, f.name, f.descr, f.post_count, f.thread_count,
fr.last_view, mo.id, COALESCE(g2.group_cache_opt, g1.group_cache_opt) AS group_cache_opt,
c.cat_opt &amp; 4
FROM fud26_fc_view v
INNER JOIN fud26_cat c ON c.id=v.c
INNER JOIN fud26_forum f ON f.id=v.f
INNER JOIN fud26_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=f.id
LEFT JOIN fud26_msg m ON f.last_post_id=m.id
LEFT JOIN fud26_users u ON u.id=m.poster_id LEFT JOIN fud26_forum_read fr ON fr.forum_id=f.id AND fr.user_id=3 LEFT JOIN fud26_mod mo ON mo.user_id=3 AND mo.forum_id=f.id LEFT JOIN fud26_group_cache g2 ON g2.user_id=3 AND g2.resource_id=f.id WHERE (mo.id IS NOT NULL OR (COALESCE(g2.group_cache_opt, g1.group_cache_opt)) &amp; 1)&gt;0 ORDER BY v.id






I cannot tell what that is about. I believe I am using the api correctly. On login, I look up the user id by username and then call "external_fud_login($user_id);". When I access other pages like the search page, everything is rosy and I can see that I am logged in as the correct user. If I click home (with the same session id being passed) I get the error and blank page.



Also, I had to write a function to lookup the user id by user name. That's not in the api, correct?

Any ideas?
Re: Using FUDAPI to log in a user [message #36322 is a reply to message #36321] Sat, 17 March 2007 03:59 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Well I just saw this:

http://fudforum.org/forum/index.php?t=msg&goto=35461&&srch=user +login#msg_35461

(honestly, I did look before I posted!)

That's the same error, so I'll try that.

My question about the lookup user by name function in the api still is still posed.
Re: Using FUDAPI to log in a user [message #36323 is a reply to message #36321] Sat, 17 March 2007 04:18 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Hmmmm.... running the upgrade script from my forum root (where the GLOBALS file is) gives me mysql errors even though I am using postgres. That's a tough one.
Re: Using FUDAPI to log in a user [message #36324 is a reply to message #36321] Sat, 17 March 2007 04:19 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Notice: Undefined variable: MYSQL_TBL_PREFIX in [root]/upgrade.php on line 989

Notice: Undefined variable: MYSQL_SERVER in
[root]/upgrade.php on line 990

Notice: Undefined variable: MYSQL_LOGIN in
[root]/upgrade.php on line 991

Notice: Undefined variable: MYSQL_PASSWORD in
[root]/upgrade.php on line 992

Notice: Undefined variable: MYSQL_DB in
[root]/upgrade.php on line 993

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in [root]/upgrade.php on line 455
MySQL Error: #1045 (Access denied for user 'www-data'@'localhost' (using password: NO))
Re: Using FUDAPI to log in a user [message #36353 is a reply to message #36324] Sun, 18 March 2007 18:26 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What version of the forum are you upgrading?

FUDforum Core Developer
Re: Using FUDAPI to log in a user [message #36356 is a reply to message #36321] Mon, 19 March 2007 00:34 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
2.7.6 is my current version.

I would be willing to grab the files from cvs, but I cannot find cvs info. Also, using cvs would seem non-trivial because the data files are in a different location.

If I need a cvs copy for this bug fix, I will do it though.

[Updated on: Mon, 19 March 2007 00:35]

Report message to a moderator

Re: Using FUDAPI to log in a user [message #36374 is a reply to message #36321] Tue, 20 March 2007 00:45 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Any suggestions?
Re: Using FUDAPI to log in a user [message #36385 is a reply to message #36374] Tue, 20 March 2007 23:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can you try the CVS version?

FUDforum Core Developer
Re: Using FUDAPI to log in a user [message #36405 is a reply to message #36321] Wed, 21 March 2007 13:50 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Ok, what's the cvs root?
Re: Using FUDAPI to log in a user [message #36423 is a reply to message #36405] Thu, 22 March 2007 23:38 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
http://fudforum.org/forum/index.php?t=msg&th=547&start=0&

FUDforum Core Developer
Re: Using FUDAPI to log in a user [message #36428 is a reply to message #36321] Fri, 23 March 2007 00:06 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
The last message on that post says they can't access it. I connot either. I tried those cvsroots before and I assumed it was an old post and they were broken.

Am I doing something wrong or are they broken?

[Updated on: Fri, 23 March 2007 00:07]

Report message to a moderator

Re: Using FUDAPI to log in a user [message #36475 is a reply to message #36428] Sun, 25 March 2007 14:45 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Your DNS cache may have been old, it works fine as far as I can tell.

FUDforum Core Developer
Re: Using FUDAPI to log in a user [message #36481 is a reply to message #36321] Sun, 25 March 2007 16:29 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
I got 74.108.67.43 for asuka.prohost.org

CVS checkouts on other servers working fine for me. You're having no problems with asuka.prohost.org?

Is it using a standard port?
Re: Using FUDAPI to log in a user [message #36507 is a reply to message #36481] Tue, 27 March 2007 00:17 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I think there was an issue with the firewall, it should work now.

FUDforum Core Developer
Re: Using FUDAPI to log in a user [message #36515 is a reply to message #36321] Tue, 27 March 2007 01:35 Go to previous messageGo to next message
tog_benson is currently offline  tog_benson   United States
Messages: 10
Registered: March 2007
Karma: 0
Junior Member
Sweet. I got files. Thank you.

If I installed using "FUDforum_2-7-6.tar.gz" do I want to use the cvs root mentioned on the other post???? The repository mentioned was "/forum21". I tried guessing, but I cannot access a "/forum27". Do I use "/forum21" to get the most recent files?

Sorry about all the questions... I don't want to hose my install.
Re: Using FUDAPI to log in a user [message #36549 is a reply to message #36515] Fri, 30 March 2007 00:18 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
forum21 is the one containing the latest files.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problems with Internet Explorer 7
Next Topic: User permissions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 21:50:43 GMT 2024

Total time taken to generate the page: 0.02557 seconds