Author |
Message |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Oct 31, 2003 10:24 pm |
|
Here is a utility script to allow you to reset an Admin's password without using phpMyAdmin.Code:<?
/***********************************************************/
/* Just set $adminNameToReset to the admin name to reset */
/* and save this file. Call it anything you want, like */
/* ResetPassword.php. Then ftp it to the same folder where*/
/* mainfile.php is stored. Then point your browser to the */
/* file. The password for that admin will be changed to */
/* Password (note the capital P), by default. Then, */
/* immediately log in and change your password!!! You */
/* should then delete or rename this file!! */
/* You can also change the password to something other than*/
/* Password by changing $newAdminPassword */
/***********************************************************/
/* Author: Gaylen Fraley (Raven) 10/31/2003 */
/***********************************************************/
$adminNameToReset = '???';
$newAdminPassword = 'Password';
/***********************************************************/
/* You do not need to change anything below this line. */
/***********************************************************/
include("mainfile.php");
$sql = "Select aid from ".$user_prefix."_authors where aid='$adminNameToReset'";
$result = sql_query($sql,$dbi);
if (!sql_num_rows($result)) {
$mysqlError = mysql_error();
if (empty($mysqlError)) $mysqlError = "<b>$adminNameToReset</b> appears to be an invalid user name.<br /><br />No updates have been made.";
else $mysqlError = 'Unable to execute query.<br /><br />MySQL said <b>'.$mysqlError.'</b>.';
die($mysqlError);
}
$sql = "Update ".$user_prefix."_authors set pwd='".md5($newAdminPassword)."' where aid='$adminNameToReset'";
$result = sql_query($sql,$dbi);
echo "Update successful!<br /><br />Your password has been changed to <b>$newAdminPassword</b>.<br /><br />Log in and immediately change it to protect your site!<br /><br />Also, be sure to remove this file or rename it!";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Roy_Shiker
Hangin' Around
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Dec 27, 2003
Posts: 45
|
Posted:
Sat Dec 27, 2003 7:33 pm |
|
Good Script, Thanks !. ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Toph
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jan 31, 2004
Posts: 3
|
Posted:
Sat Jan 31, 2004 8:34 am |
|
I changed the admin password by hand but it didn't work. Excellent script you wrote, gonna come in handy, but - I still get the 'Begone' message.
Now, why is that? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jan 31, 2004 9:41 am |
|
When you change the password by hand, using phpMyAdmin for instance, you have to also select the MD5 option from the drop down box beside the password before you save it.
You are probably receiving that Begone message because the username is not matching a valid author name in the nuke_authors table. Usernames can only contain a-zA-Z0-9_- . |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Toph
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jan 31, 2004 9:50 am |
|
That must be it, I used brackets as the community members wear tags. Cheers ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jan 31, 2004 10:21 am |
|
That can easily be modified if you need to. In auth.php and modules/Your_Account/index.php the changes involve just 1 line. In auth.php modify this lineCode:if (ereg("[^a-zA-Z0-9_-]",trim($aid)))
| toCode:if (ereg("[^a-zA-Z0-9_-\[\]]",trim($aid)))
|
Then in modules/Your_Account/index.php modify this lineCode:if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-]",$username)))
| toCode:if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-\[\]]",$username)))
|
If you come across any other name checks, just modify them the same way. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Aug 12, 2005 7:53 pm |
|
This is just a reminder for the new people and the old ones that can't remember ![ROTFL](modules/Forums/images/smiles/rotfl.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
cyptc
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 16, 2005
Posts: 6
|
Posted:
Tue Aug 16, 2005 11:38 am |
|
Topic edited as has no relevance |
Last edited by cyptc on Mon May 17, 2010 10:18 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 16, 2005 12:48 pm |
|
There is no redirection. You save the file and load/ftp that file up and then point your browser to it. Follow the prompts. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
cyptc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 16, 2005 1:38 pm |
|
Topic edited as has no relevance |
Last edited by cyptc on Mon May 17, 2010 10:18 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 16, 2005 2:36 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
infinity8x3
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jul 28, 2006
Posts: 1
|
Posted:
Fri Jul 28, 2006 8:27 am |
|
wow Raven that pass script saved my but big time when i tryed to change the god account pass in edit admins it said info saved but then when i tryed to log in as admin my new pass or old pass didnt work i thought i was screwed and would have to delete the database table nuke_aurthers but this script tottaly worked right the first time your knowlage of php is great and thanks for being so important to the nuke comunity |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jul 28, 2006 8:48 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
bugsTHoR
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/568e5f374449c41c190ed.gif)
Joined: Apr 05, 2006
Posts: 263
|
Posted:
Fri Apr 27, 2007 5:11 pm |
|
thx Amigo, i luv your search box lol |
_________________ LUV RAVEN DISTROBUTION BEBE
Clanthemes.com are great (free advertisements for now until i get to 20,000 posts LoL) |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nagahosting
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/7aa2c4294738bb8da66a8.jpg)
Joined: Nov 03, 2007
Posts: 52
Location: Nagalim
|
Posted:
Thu Jan 24, 2008 1:06 pm |
|
Very handy thanks Raven
![RavensScripts](modules/Forums/images/smiles/ravensphpscripts.gif) |
_________________ Blessed Is He Who Comes In The Name Of The Lord |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jan 24, 2008 1:09 pm |
|
You're welcome ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|