Adrian Schneider
10-22-2005, 11:59 PM
Well, I have most of it set up, but I just realized only admins can login...
After playing around with it I added
case 'ClanCP':
$pagetitle = 'Clan Control Panel';
$showoptions = false;
$logintype = 'clancplogin';
to the VB_AREA switch in adminfunctions.php (replica)
and basically duplicated the block of code for modcp login in functions_login.php line 241 in the hook.
// Clan CP Login
if ($logintype === 'clancplogin')
{
require_once(DIR . '/includes/functions_clanman.php');
if (inclan)
{
$cpsession = $vbulletin->session->fetch_sessionhash();
/*insert query*/
$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
vbsetcookie('cpsession', $cpsession, 0);
if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
{
vbsetcookie('userid', $vbulletin->userinfo['userid'], 0);
vbsetcookie('password', md5($vbulletin->userinfo['password'] . 'L7652d0b'), 0);
}
}
}
what else do I have to do to have it login properly?
All my permission constants are defined in the functions_clanman.php file.
After playing around with it I added
case 'ClanCP':
$pagetitle = 'Clan Control Panel';
$showoptions = false;
$logintype = 'clancplogin';
to the VB_AREA switch in adminfunctions.php (replica)
and basically duplicated the block of code for modcp login in functions_login.php line 241 in the hook.
// Clan CP Login
if ($logintype === 'clancplogin')
{
require_once(DIR . '/includes/functions_clanman.php');
if (inclan)
{
$cpsession = $vbulletin->session->fetch_sessionhash();
/*insert query*/
$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
vbsetcookie('cpsession', $cpsession, 0);
if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
{
vbsetcookie('userid', $vbulletin->userinfo['userid'], 0);
vbsetcookie('password', md5($vbulletin->userinfo['password'] . 'L7652d0b'), 0);
}
}
}
what else do I have to do to have it login properly?
All my permission constants are defined in the functions_clanman.php file.