WordPress.org

Ready to get started?Download WordPress

Forums

WP Db Abstraction
You do not have sufficient permission (3 posts)

  1. pepinho
    Member
    Posted 2 years ago #

    Hi guys.
    I have a big big problem!!!
    I have installed Abstraction 1.1.4 plugin in WordPress 3.3.1 (last version today)
    The installation procedure worked fine but after login with administrator profile, the blog return the error "You do not have sufficient permission to access on this page." or something like this!
    Somebody can help me, please ?

    http://wordpress.org/extend/plugins/wordpress-database-abstraction/

  2. pepinho
    Member
    Posted 2 years ago #

    Edit: the installation procedure worked fine only with my code previously modified...without this modify the installation return some errors (see screen link) -> http://www.imagehost.it/di/PU4E/screen.jpg

    Evidently my edit does not work ... but the plugin still does not work!

  3. pepinho
    Member
    Posted 2 years ago #

    I have modified in translations.php the function on_duplicate_key() as below:

    function on_duplicate_key($query){
    $query = str_replace('`', '', $query);
    if ( stripos($query, 'ON DUPLICATE KEY UPDATE') > 0 ) {
    $table = substr($query, 12, (strpos($query, ' ', 12) - 12));
    // currently just deal with wp_options table
    if (stristr($table, 'options') !== FALSE) {
    $start_pos = stripos($query, 'ON DUPLICATE KEY UPDATE');
    $query = substr_replace($query, '', $start_pos);
    $values_pos = stripos($query, 'VALUES');
    $first_paren = stripos($query, '(', $values_pos);
    $last_paren = $this->get_matching_paren($query, $first_paren + 1);
    $values = explode(',', substr($query, ($first_paren + 1),($last_paren-($first_paren + 1))));
    if (!isset($values[1])) {
    $values[1] = '';
    }
    if (!isset($values[2])) {
    $values[2] = 'no';
    }
    // change this to use mapped fields
    $update = 'UPDATE ' . $table . ' SET option_value = ' . $values[1] . ', autoload = ' . $values[2] .
    ' WHERE option_name = ' . $values[0];
    $update_new='IF NOT EXISTS (SELECT * FROM '.$table.' WHERE option_name='.$values[0].')
    INSERT INTO '.$table.' (option_name, option_value, autoload) VALUES ('.$values[0].','.$values[1].','.$values[2].')
    ELSE
    UPDATE '.$table.' SET option_value='.$values[1].', autoload='.$values[2].' WHERE option_name='.$values[0];
    $this->following_query = $update_new;
    return $update_new;

    }
    }

    return $query;
    }

    ...and now the installation procedure worked fine! The table "wp_options" has populated correctly (compared with previous table on MySql installation)...but the same error appears at the login with administrator profile:
    "You do not have sufficient permission to access on this page."

    ...can you help me please ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic