Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   vBulletin Wordpress Bridge (http://www.lampwrights.com/forumdisplay.php?f=13)
-   -   You do not have sufficient permissions to access this page - after plugin activation (http://www.lampwrights.com/showthread.php?t=168)

maxaud 06-24-2011 05:39 PM

You do not have sufficient permissions to access this page - after plugin activation
 
I'm getting the "You do not have sufficient permissions to access this page." after activating the plugin and am trying to access any of the setting pages.

Note, this is before even adjusting a single setting.

I uploaded the plugin (kept /vbbridge/ directory intact).
I clicked activate in the WordPress plugin page.
I navigate to any of these pages and it gives me the error:
- Settings->Vbridge Settings
- Tools->Convert WordPress users
- Users->Vbridge User settings

The following line is still commented out in the file:
#define('USE_ADMINCP_BRIDGE', true);

Note:
This is in a subdirectory install:
domain.com/wordpress/wp-content/plugins/vbbridge/vbbridge.php
Fresh install of WordPress 3.1.3

maxaud 06-24-2011 06:15 PM

Tried it in a different WordPress install that is in the root of a different domain and I can get to the settings pages. It's using Wordpress 3.0.1

Summary | Seems to work with the following:
- Different WordPress version
- Not in a subdirectory install

maxaud 06-24-2011 09:14 PM

seems to be a wordpress issue..

The following code wont work as a new plugin for adding an admin page..

PHP Code:

<?php
/*
Plugin Name: Test Plugin
Plugin URI: http://testing.com
Description: Testing some things
Version: .1
Author: Test Author
Author URI: http://www.nodomain.com/
*/ 


add_action('admin_menu''my_plugin_menu');

function 
my_plugin_menu() {
    
add_options_page('My Plugin Options''My Plugin''manage_options''my-unique-identifier''my_plugin_options');
}

?>


maxaud 06-24-2011 09:43 PM

Ok, new issue. I figured out that something was using chdir() to change the working directory which was causing the permission issues.
Now when I activate the plugin it brings me back to the WordPress login page. No credentials work to log in, WordPress or vBulletin.
If I uncomment the USE_ADMINCP_BRIDGE line I can log in via vBulletin creds but it gives me a permission error.
Alternatively I can delete the plugin and get back into the WordPress backend.

maxaud 06-24-2011 10:45 PM

I added the following in the wp_set_current_user function and it allowed me to get into the admin panel with the plugin active. I can now edit the usergroup settings to map vb groups to wp user levels.

Note: usergroup 6 is the usergroup for admins on my vbulletin

PHP Code:

    if ( $current_user->data->usergroupid == ) {
        
$current_user->data->pages_capabilities['administrator'] = 1;
        
$current_user->caps['administrator'] = 1;
        
$current_user->pages_capabilities['administrator'] = 1;
        
$current_user->pages_user_level 10;
        
$current_user->user_level 10;
        
$current_user->roles[] = "administrator";
        
$current_user->allcaps['switch_themes'] = 1;
        
$current_user->allcaps['edit_themes'] = 1;
        
$current_user->allcaps['activate_plugins'] = 1;
        
$current_user->allcaps['edit_plugins'] = 1;
        
$current_user->allcaps['edit_users'] = 1;
        
$current_user->allcaps['edit_files'] = 1;
        
$current_user->allcaps['manage_options'] = 1;
        
$current_user->allcaps['moderate_comments'] = 1;
        
$current_user->allcaps['manage_categories'] = 1;
        
$current_user->allcaps['manage_links'] = 1;
        
$current_user->allcaps['upload_files'] = 1;
        
$current_user->allcaps['import'] = 1;
        
$current_user->allcaps['unfiltered_html'] = 1;
        
$current_user->allcaps['edit_posts'] = 1;
        
$current_user->allcaps['edit_others_posts'] = 1;
        
$current_user->allcaps['edit_published_posts'] = 1;
        
$current_user->allcaps['publish_posts'] = 1;
        
$current_user->allcaps['edit_pages'] = 1;
        
$current_user->allcaps['read'] = 1;
        
$current_user->allcaps['level_1;0'] = 1;
        
$current_user->allcaps['level_9'] = 1;
        
$current_user->allcaps['level_8'] = 1;
        
$current_user->allcaps['level_7'] = 1;
        
$current_user->allcaps['level_6'] = 1;
        
$current_user->allcaps['level_5'] = 1;
        
$current_user->allcaps['level_4'] = 1;
        
$current_user->allcaps['level_3'] = 1;
        
$current_user->allcaps['level_2'] = 1;
        
$current_user->allcaps['level_1;'] = 1;
        
$current_user->allcaps['level_0'] = 1;
        
$current_user->allcaps['edit_others_pages'] = 1;
        
$current_user->allcaps['edit_published_pages'] = 1;
        
$current_user->allcaps['publish_pages'] = 1;
        
$current_user->allcaps['delete_pages'] = 1;
        
$current_user->allcaps['delete_others_pages'] = 1;
        
$current_user->allcaps['delete_published_pages'] = 1;
        
$current_user->allcaps['delete_posts'] = 1;
        
$current_user->allcaps['delete_others_posts'] = 1;
        
$current_user->allcaps['delete_published_posts'] = 1;
        
$current_user->allcaps['delete_private_posts'] = 1;
        
$current_user->allcaps['edit_private_posts'] = 1;
        
$current_user->allcaps['read_private_posts'] = 1;
        
$current_user->allcaps['delete_private_pages'] = 1;
        
$current_user->allcaps['edit_private_pages'] = 1;
        
$current_user->allcaps['read_private_pages'] = 1;
        
$current_user->allcaps['delete_users'] = 1;
        
$current_user->allcaps['create_users'] = 1;
        
$current_user->allcaps['unfiltered_upload'] = 1;
        
$current_user->allcaps['edit_dashboard'] = 1;
        
$current_user->allcaps['update_plugins'] = 1;
        
$current_user->allcaps['delete_plugins'] = 1;
        
$current_user->allcaps['install_plugins'] = 1;
        
$current_user->allcaps['update_themes'] = 1;
        
$current_user->allcaps['install_themes'] = 1;
        
$current_user->allcaps['update_core'] = 1;
        
$current_user->allcaps['list_users'] = 1;
        
$current_user->allcaps['remove_users'] = 1;
        
$current_user->allcaps['add_users'] = 1;
        
$current_user->allcaps['promote_users'] = 1;
        
$current_user->allcaps['edit_theme_options'] = 1;
        
$current_user->allcaps['delete_themes'] = 1;
        
$current_user->allcaps['export'] = 1;
        
$current_user->allcaps['administrator'] = 1;
    } 


maxaud 06-25-2011 03:22 AM

Seems like I can log in with different users and I can change the vbb settings but I cannot change WordPress settings. Know why this may be?

maxaud 06-27-2011 07:22 PM

Looks to be a conflict with the database objects.

When WordPress is using $wpdb->get_results within "/wp-admin/options.php" it's trying to use the vBulletin database rather than the WordPress database. Seems to be only related to WordPress options..

maxaud 06-27-2011 07:38 PM

Copied the WordPress database to the vBulletin database and changed the database reference in wp-config.php and I can now adjust settings.

I see this as a temporary fix for now as I need these two databases separated.

How do I make sure it's not conflicting while having them separate?

Jeff 06-28-2011 08:21 AM

There really is no way for the $wpdb to somehow start using the vbulletin database. Not sure what modifications you have made but I think your assumption here is wrong.

maxaud 06-28-2011 12:47 PM

When I do a var_dump($wpdb) in admin notices section of the backend it tells me the last mysql error that was generated and it states that the "vbulletin_db.wp_options" table doesn't exist.

When I change WordPress to use the same database it starts to work so something is obviously getting confused.

Couldn't vBulletin have a similar variable name that could be conflicting?

Have you tried it from two separate databases before and tried modifying options?

Jeff 06-29-2011 05:38 AM

There is no conflicting variable. On almost every install I use this on, the db's are separate. Are you sure you do not have a plugin installed that is using the latest db connection instead of the $wpdb variable?

maxaud 06-29-2011 12:03 PM

It's the only plugin active. Weird.


All times are GMT -4. The time now is 06:11 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.