PDA

View Full Version : HackCP (Totally Custom)


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.

Adrian Schneider
10-24-2005, 03:06 AM
Bump

Adrian Schneider
10-26-2005, 04:01 AM
Bump, could anyone at least point me in the direction of hacks that have done this?

Adrian Schneider
12-19-2005, 08:26 PM
Bump...

Paul M
12-19-2005, 08:32 PM
Quick question - In the IF statement - should 'inclan' be '$inclan' ?

Adrian Schneider
12-19-2005, 08:47 PM
No, inclan is a constant.

Does the AdminCP nav in XML use constants? I forget the exact tag, but it was something like

<permission>candosomething</permission>

candosomething = constant, or something else?

Adrian Schneider
12-23-2005, 04:11 PM
<font size="7">YES</font>

I finally got it after probably 6 hours of pulling my hair out; the damn problem was in global.php.

$checkpwd is true when the user can view the ACP, which brings up the login screen again.