PHP Fatal Error Help
Posted: Thu Jun 04, 2009 2:51 pm
This is the error I'm getting
from this:
Can anyone see what could be causing the problem because I'm really stuck with this!
Thanks in advance for your help.
What it is a bridge between vbulletin and wordpress and I'm trying to use the resetvbbridge.php file to clear the settings so I can re-enter them. (I reconfigured Vbulletin and forgot that the db's were linked and now the plugin refuses to work).
I just need to clear the settings so I can get the plug-in reconfigured to work.
This is the code designed to clear the settings:
Code: Select all
Fatal error: Cannot redeclare get_userdatabylogin() (previously declared in /home/content/07/4395607/html/wp-includes/pluggable.php:166) in /home/content/07/4395607/html/wp-content/plugins/functions_vbbridge.php on line 33Code: Select all
<?php
function get_userdatabylogin($user_login) {
global $wpdb, $vbulletin;
$user_login = sanitize_user( $user_login );
if ( empty( $user_login ) )
return false;
$user_id = wp_cache_get($user_login, 'userlogins');
$user = false;
if ( false !== $user_id )
$user = wp_cache_get($user_id, 'users');
if ( false !== $user )
return $user;
if ( !$user_a = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string($user_login) . "'") )
return false;
foreach ($user_a as $key => $value) {
$user->$key = $value;
}
$user->user_login = $user->username;
# _fill_user($user);
return $user;
}
function wp_authenticate($username, $password) {
$username = sanitize_user($username);
if ( '' == $username )
return new WP_Error('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
if ( '' == $password )
return new WP_Error('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
$user = get_userdatabylogin($username);
if ( !$user || (strtolower($user->user_login) != strtolower($username)) ) {
do_action( 'wp_login_failed', $username );
return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
}
$user = apply_filters('wp_authenticate_user', $user, $password);
if ( is_wp_error($user) ) {
do_action( 'wp_login_failed', $username );
return $user;
}
if ( !wp_check_password($password, $user->user_login) ) {
do_action( 'wp_login_failed', $username );
return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.'));
}
return new WP_User($user->ID);
}
function wp_check_password($password, $user_name = '') {
global $vbulletin;
require_once(DIR . '/includes/functions_login.php');
return verify_authentication($user_name,$password,'','',true,true);
}
function wp_validate_auth_cookie($cookie = '', $scheme = '') {
global $vbulletin;
return $vbulletin->userinfo['userid'];
}
function wp_set_current_user($id, $name = '') {
global $current_user;
if ( isset($current_user) && ($id == $current_user->ID) )
return $current_user;
$current_user = new WP_User($id, $name);
setup_userdata($current_user->ID);
do_action('set_current_user');
return $current_user;
}
function get_userdata( $user_id ) {
global $wpdb, $vbulletin;
$user_id = absint($user_id);
if ( $user_id == 0 )
return false;
$user = wp_cache_get($user_id, 'users');
if ( $user )
return $user;
if ( !$user_a = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = '" . $vbulletin->db->escape_string($user_id) . "'") )
return false;
foreach ($user_a as $key => $value) {
$user->$key = $value;
}
$user->user_login = $user->username;
$user->wp_capabilities = array(strtolower(get_option('vbb_vbugroup_' . $vbulletin->userinfo[usergroupid])) => 1);
$user->rich_editing = true;
$user->ID = $user->userid;
$user->display_name = $user->username;
$user->user_nicename = sanitize_title($user->username);
# _fill_user($user);
return $user;
}
function auth_redirect() {
global $vbulletin;
if ($vbulletin->userinfo['userid'] <= 0) {
$login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( $redirect ), 'login' );
wp_redirect($login_url);
exit;
}
return;
}
function check_admin_referer($action = -1, $query_arg = '_wpnonce') {
global $vbulletin;
if ($vbulletin->userinfo['userid'] <= 0) {
$login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( $redirect ), 'login' );
wp_redirect($login_url);
exit;
}
return;
}
add_filter('user_has_cap', 'ff_give_user', 10, 3);
function ff_give_user($stuff, $caps, $a)
{
global $vbulletin,$wp_roles,$wpdb;
$role_key = $wpdb->prefix . 'user_roles';
$roles = get_option( $role_key );
$group = strtolower(get_option('vbb_vbugroup_' . $vbulletin->userinfo[usergroupid]));
$stuff = $roles[$group]['capabilities'];
return $stuff;
}
?>Thanks in advance for your help.
What it is a bridge between vbulletin and wordpress and I'm trying to use the resetvbbridge.php file to clear the settings so I can re-enter them. (I reconfigured Vbulletin and forgot that the db's were linked and now the plugin refuses to work).
I just need to clear the settings so I can get the plug-in reconfigured to work.
This is the code designed to clear the settings:
Code: Select all
<?php
require_once( dirname(__FILE__) . '/wp-load.php' );
update_option('vbb_VBION, 0);
echo "Vbbridge integration disabled!";
?>