HOW TO: Integrate WordPress and Piwigo Gallery Logins
-
Hi,
I’m not sure if this is the right place to post this, but I thought it might be helpful.
In case anybody wants to get the Piwigo Gallery and WordPress logins to work together, it works pretty easily without any source code modifications to either of the scripts.
REQUIREMENTS: You will need to have PHP Version 5.5 or higher, and there is a WordPress plugin called Password bcrypt by Roots that is needed to convert the password hash to a stronger hash that we can also use to get Piwigo to work.
Step 1. Install both scripts and make sure they work independently.
Step 2. Install Password bcrypt plugin in WordPress. Logout of WordPress and log back in to make sure the password hash is updated in the database.
Step 3. Create a file called config.inc.php in the /local/config folder in your Piwigo install directory.
Step 4. Include the following code in the config.inc.php file:
// +———————————————————————–+
// | WordPress MODS |
// +———————————————————————–+$conf[‘insensitive_case_logon’] = true;
$conf[‘users_table’] = ‘wp_users’;
$conf[‘external_authentification’] = true;
$conf[‘user_fields’] = array(
‘id’ => ‘ID’,
‘username’ => ‘user_login’,
‘password’ => ‘user_pass’,
’email’ => ‘user_email’
);
$conf[‘password_hash’] = create_function(‘$s’, ‘return password_hash($s);’);
$conf[‘password_verify’] = ‘pwg_password_verify’;
$conf[‘guest_id’] = 2;
$conf[‘default_user_id’] = $conf[‘guest_id’];
$conf[‘browser_language’] = true;
$conf[‘webmaster_id’] = 1;
$conf[‘guest_access’] = true;Step 5. Clean the Piwigo db entries suggested in the config_default.inc.php:
DELETE FROM piwigo_user_access;
DELETE FROM piwigo_user_cache;
DELETE FROM piwigo_user_feed;
DELETE FROM piwigo_user_group;
DELETE FROM piwigo_sessions;
DELETE FROM piwigo_rate;
DELETE FROM piwigo_caddie;
DELETE FROM piwigo_favorites;UPDATE piwigo_images SET rating_score = NULL;
UPDATE piwigo_images SET added_by = 1;I tested this with a WordPress install running bbPress with over 30,000 users and over 200,000 posts from a import/conversion of phpBB3. Everything worked fine, including uploading and approving photos via the Piwigo Community plugin.
WordPress version: 4.6
Piwigo version: 2.8.2
PHP version: 5.5+ REQUIRED
- The topic ‘HOW TO: Integrate WordPress and Piwigo Gallery Logins’ is closed to new replies.