Needs also to be mentioned that the phpBB's password hash is md5.A_Jelly_Doughnut wrote:You'd have to change it manually with an UPDATE sql query on the phpbb_users table.
It's not a straight MD5 hash, it's salted for one thing.3Di wrote:Needs also to be mentioned that the phpBB's password hash is md5.A_Jelly_Doughnut wrote:You'd have to change it manually with an UPDATE sql query on the phpbb_users table.
To get the user's id, you can use $user->data['user_id'] as long as the user class is declared as $user in your script.carled wrote:Yeah but I can just pass in the new password and use "phpbb_hash" before I save it, surely?
Please would someone point me towards a query or function that allows me to read the user ID using the username? Does this exist - a sort of "select user_ID from phpbb_users where username=<username>" query?
Code: Select all
<?php /** * * @package phpBB3 * @version $Id: index.php 9614 2009-06-18 11:04:54Z nickvergessen $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** */ /** * @ignore */ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup('viewforum');
Code: Select all
$sql = 'SELECT * FROM ' . USERS_TABLE . " WHERE username = '$username' "; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); //Now, $user_row['field_name'] contains the value of each of the fields in the database for the user you specify.
That's good to hear. Glad it works for you.carled wrote:Absolutely brilliant, thanks a million, have it working now!