PDA

View Full Version : UserID #1 email change



swepics
Mon 20th Oct '08, 7:10pm
I can't seem to change the email of the #1 UserID, it says something about the config file not letting me. But I forgot the password for this account and the email address I had no longer works so I can't reset the password that way.

How can I change the email address so that I can then ask it to send me my new password?

Nick
Mon 20th Oct '08, 7:27pm
You're probably not able to edit your profile because you have defined UserID:1 as one of the unalterable profiles.

You can remove your userid from this section in the config.php file, and you should be good to go:

// ****** UNDELETABLE / UNALTERABLE USERS ******
// The users specified here will not be deletable or alterable from the control panel by any users.
// To specify more than one user, separate userids with commas.
$config['SpecialUsers']['undeletableusers'] = '1';

SNN
Mon 20th Oct '08, 8:30pm
You could also just go into the database and change the password manually.


<?php
require_once('./global.php');
$u=$db->query_read("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=1");
$ui=$db->fetch_array($u);
$salt = $ui['salt'];
$password = ''; // SET YOUR PASSWORD HERE
$pass = md5( md5( $password ) . $salt );
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET password='" . $pass . "' WHERE userid=1");
echo "Changed password to " . $password;