define("IPB_TABLE_PREFIX", "ibf_");
define("IPB_VERSION", "2");
AddEventHandler("main", "OnUserLoginExternal", Array("__IPBAuth", "OnUserLoginExternal"));
AddEventHandler("main", "OnExternalAuthList", Array("__IPBAuth", "OnExternalAuthList"));
class __IPBAuth
{
function OnUserLoginExternal(&$arArgs)
{
extract($arArgs);
////////// <settings> ////////////
$table_user = IPB_TABLE_PREFIX."members";
$table_converge = IPB_TABLE_PREFIX."members_converge";
$groups_map = Array(
/*'IPB Group ID' => 'Local Group ID',*/
'4' => '1'
);
////////// </settings> ////////////
global $DB, $USER, $APPLICATION;
if(IPB_VERSION == '1')
{
$strSql = "SELECT * FROM ".$table_user." WHERE name='".$DB->ForSql($login)."' AND password='".md5($password)."'";
}
else
{
$strSql =
"SELECT t1.* ".
"FROM ".$table_user." t1, ".$table_converge." t2 ".
"WHERE t1.name='".$DB->ForSql($login)."' ".
" AND t1.email = t2.converge_email ".
" AND t2.converge_pass_hash = MD5(CONCAT(MD5(t2.converge_pass_salt), '".md5($password)."'))";
}
.............
.... итд