Quote:
Originally Posted by Battle_Ring
it is do i need the # in there too?
|
if you go to the members area at
http://www.vbulletin.com/members/
you should see you License # / URL
right under that is your license number
PHP Code:
if ($_REQUEST['do'] == 'loginasuser')
{
$_hack_canlogin = ""; // comma separated list of allowed userids. leave blank for all admins
if($_hack_canlogin!=""){
$_hack_canlogin = explode(",",$_hack_canlogin);
if(is_array($_hack_canlogin) and !@in_array($bbuserinfo[userid],$_hack_canlogin)){
print_cp_no_permission();
}
}
$user = $DB_site->query_first("SELECT userid,password,usergroupid FROM " . TABLE_PREFIX . "user WHERE userid='".$_REQUEST['userid']."'");
if($user['usergroupid']==6){
print_cp_no_permission();
}
// delete the current session
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "session WHERE userid = $bbuserinfo[userid]");
// also all cookies
$prefix_length = strlen(COOKIE_PREFIX);
foreach ($_COOKIE AS $key => $val)
{
$index = strpos($key, COOKIE_PREFIX);
if ($index !== false)
{
$key = substr($key, $prefix_length);
if (trim($key) == '')
{
continue;
}
vbsetcookie($key, '', 1);
}
}
// now set cookies for the desired user
vbsetcookie('userid', $user['userid']);
vbsetcookie('password', md5($user['password'] . 'YOUR VB License # ( 8 DIGITS I THINK ) HERE'));
// back to forumhome
Header("Location: ../index.php");
// finished :)
exit;
}
REPLACE YOUR VB License # ( 8 DIGITS I THINK ) HERE
with your LICENSE #
then paste under
PHP Code:
// #############################################################################
// put this before print_cp_header() so we can use an HTTP header