Possible solution to mambo bridge

Started by Ygriega, October 27, 2004, 02:26:26 PM

Previous topic - Next topic

Ygriega

Hi,

Integration went fine, but couldn't get integrated login working ok.

I have done some changes and now seems to work ok for me...

in MOS_SMF.php, function MOS_login:

at start:
   global $mainframe;

later:

$request = mysql_query( "SELECT id, gid, block, usertype FROM mos_users WHERE username='$username' AND password='$passwd'");
$row = mysql_fetch_array($request);
// fudge the group stuff
$grp = $acl->getAroGroup( $row['id'] );
$row['gid'] = 1;

if ($acl->is_group_child_of( $grp->name, 'Registered', 'ARO' ) ||
$acl->is_group_child_of( $grp->name, 'Administrator', 'ARO' )) {
// fudge Authors, Editors, Publishers and Super Administrators into the Special Group
$row['gid'] = 2;
}

$row['usertype'] = $grp->name;

$session =& $mainframe->_session;
$session->guest = 0;
$session->username = $username;
$session->userid = intval( $row['id'] );
$session->usertype = $row['usertype'];
$session->gid = intval( $row['gid'] );
$session->update();

$currentDate = date("Y-m-d\TH:i:s");
$query = "UPDATE mos_users SET lastvisitDate='$currentDate' where id='$session->userid'";
$sql = mysql_query($query);

if ($remember=="yes") {
$lifetime = time() + 32536000;
setcookie( "usercookie[username]", $username, $lifetime, "/" );
setcookie( "usercookie[password]", $passwd, $lifetime, "/" );
//setcookie ("sessioncookie","",-3600);
}
mosCache::cleanCache();

//mosCache::cleanCache('com_content');

}

mosRedirect("index.php");
// Just log you back out if it's in maintenace mode and you AREN'T an admin.
/* if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=mambo_login;sa=check;id=' . $ID_MEMBER);
else
redirectexit('action=logout;sesc=' . $sc);
*/


I bet it has mistakes, but seems to work for me... I think there is some bugs on actual version. I hope this can help.

Sorry for my english, I'm spanish  ;)

Ygriega.

pacolls

It is necessary to erase all the function and to leave single this?

Espanish (Yo tambien soy español)

¿Hay que borrar toda la funcion y dejar solo esto?


Member Of ClubDevelopersTeam

Ygriega

No, It's a replace...

Don't do it if you don't know the function (and php programming) a little.

Ygriega.

Advertisement: