First, I'd like to say, Piwigo is great! I enjoy using it. But, I've lost my admin password. The one I recorded doesn't work - please help me or advise me how I can recover it or create a new one.
My installation is on a Proxmox home server - it's a Debian VM.
Offline
Put this
<?php define('PHPWG_ROOT_PATH','/var/www/html/piwigo/'); include_once(PHPWG_ROOT_PATH.'include/config_default.inc.php'); include_once(PHPWG_ROOT_PATH.'local/config/config.inc.php'); include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); if (isset($conf['password_hash']) && !empty($conf['password_hash']) && function_exists($conf['password_hash'])) echo $conf['password_hash']('yournewpassword') . "\n"; else echo "\$conf['password_hash'] not set or function not available: '" . $conf['password_hash'] . "'\n"; ?>
(of course adapt the PHPWG_ROOT_PATH setting and yournewpassword ...) in a file, either to be invoked as
php filename.php
from the (ssh) command line, or reachable in your web server's document root, for example /var/www/html/mypassword.php
In the latter case point your browser to it, it'll display some $P$... string, copy that. Remove the file.
Open your Piwigo database using phpMyAdmin or whatever tool you have, in table piwigo_users locate your admin user (probably first record), edit that and paste the hash string into the password field.
Close database, remember password ;)
Note that putting the password into the PHP snippet file may be unsafe if malicious actors have access on file level, you may want to use a form then instead.
Also, this uses the configured $conf['password_hash'] method that is default defined to
$conf['password_hash'] = 'pwg_password_hash';
If you changed that in your Piwigo config it should still work fine. If you did something else then adapt.
Offline
Many thanks. Had not found this earlier. Now back into the system as admin user.
Much appreciated.
Offline