PDA

View Full Version : Class 'vB_Router' not found


eleetoburrito
08-12-2015, 12:35 PM
I'm using this code from another thread

<?php

chdir("forum/core/"); // change to your core folder location
require_once("global.php");

function create_random_user(){
$dataman =& datamanager_init('User', $vbulletin);
$dataman->set('username', "user".rand());
$dataman->set('email', rand()."@domain.com");
$dataman->set('password', "leighf");
return $dataman->save();
}

function log_user_in($userid){
$user = fetch_userinfo($userid);
$auth = vB_User::verifyAuthentication($user['username'], "leighf", $user['password'], $user['password']);
$res = vB_User::processNewLogin($auth);
vbsetcookie('userid', $res['userid']);
vbsetcookie('password', $res['password']);
vbsetcookie('sessionhash', $res['sessionhash']);
}

// create random user
$userid = create_random_user();

// log them in
log_user_in($userid);

Everything works fine, but when I try to login a user from the existing database, if the password is bad and the auth doesn't work, this error shows up

Fatal error: Class 'vB_Router' not found in /home/public_html/forum/core/vb/exception/user.php on line 40

Why is that? How do I fix this?

Lynne
08-13-2015, 02:50 AM
What thread are you getting that code from? No vB3 or vB4 code will work in vB5.