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

Home » FUDforum Development » Plugins and Code Hacks » Help Needed - fud_user_reg class
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Help Needed - fud_user_reg class [message #165041] Tue, 19 April 2011 11:27 Go to next message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Almost got my user integration complete but stumbling somewhere.

I am trying to use existing functions and to log the user in when they log into joomla, I have done the following (


if (!class_exists('fud_user_reg')) {
	fud_use('users_reg.inc');
}
$fudUser = new fud_user_reg;
//code to get get $fudforum_id and $cur_ses_id
$fudUser->user_login($fudforum_id, $cur_ses_id, true);


But I am getting the following error:
Call to undefined method fud_user_reg::user_login()


Yet I can see that the function exists in class fud_user which fud_user_reg extends.

Any ideas what's up?

As said, I can create a local copy of the function but better to use what is there in case db details change in future.

Thanks
Re: Help Needed - fud_user_reg class [message #165042 is a reply to message #165041] Tue, 19 April 2011 11:58 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
user_login() is in users_reg.inc, but it's not part of a class.
Re: Help Needed - fud_user_reg class [message #165044 is a reply to message #165042] Tue, 19 April 2011 12:04 Go to previous messageGo to next message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I see. Thanks
Re: Help Needed - fud_user_reg class [message #165045 is a reply to message #165044] Tue, 19 April 2011 12:19 Go to previous messageGo to next message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
OK. Got over that one but although not crashing, no log in either.

Here's the code
// get $fudforum_id. Confirmed to be valid
$cur_ses_id = get_cur_ses_id($fudforum_id);
user_login($fudforum_id, $cur_ses_id, true);
 
function get_cur_ses_id($id) {
	$fudSesId = $_COOKIE[$GLOBALS['COOKIE_NAME']] or 0;
	if (empty($fudSesId)) {
		$s = db_saq('SELECT ses_id, sys_id FROM '. $GLOBALS['DBHOST_TBL_PREFIX'] .'ses WHERE user_id = ' . $id);
		if (!empty($s)) {
			$fudSesId = $s[0];
		} else {
			$fudSesId = 0;
		}
	}
	return $fudSesId;
}


Any ideas?

Cheers.

[Updated on: Tue, 19 April 2011 12:20]

Report message to a moderator

Re: Help Needed - fud_user_reg class [message #165046 is a reply to message #165045] Tue, 19 April 2011 12:25 Go to previous messageGo to next message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Sorry. Looks like that's working.

Caching seems to be an issue.
Re: Help Needed - fud_user_reg class [message #165047 is a reply to message #165046] Tue, 19 April 2011 12:55 Go to previous message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Can't get the login working consistently unless I manually delete the session cookie and even then it only shows the user to be logged in after moving pages.

Need to figure out why. I'll make that a job for later.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Fudla! Plugin Core Code Changes
Next Topic: Function to send emails?
Goto Forum:
  

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

Current Time: Thu Oct 19 15:46:31 EDT 2017

Total time taken to generate the page: 0.00647 seconds