PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Poll
Worthwhile?
Yes
100%
 100%  [ 17 ]
No
0%
 0%  [ 0 ]
Total Votes : 17


Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Fri Oct 31, 2003 10:24 pm Reply with quote Back to top

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!";
?>
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Roy_Shiker
Hangin' Around


Joined: Dec 27, 2003
Posts: 45

PostPosted: Sat Dec 27, 2003 7:33 pm Reply with quote Back to top

Good Script, Thanks !. Wink
View user's profile Send private message Send e-mail
Toph
New Member
New Member


Joined: Jan 31, 2004
Posts: 3

PostPosted: Sat Jan 31, 2004 8:34 am Reply with quote Back to top

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?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sat Jan 31, 2004 9:41 am Reply with quote Back to top

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_- .
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Toph
New Member
New Member


Joined: Jan 31, 2004
Posts: 3

PostPosted: Sat Jan 31, 2004 9:50 am Reply with quote Back to top

That must be it, I used brackets as the community members wear tags. Cheers Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sat Jan 31, 2004 10:21 am Reply with quote Back to top

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 line
Code:
if (ereg("[^a-zA-Z0-9_-]",trim($aid)))
to
Code:
if (ereg("[^a-zA-Z0-9_-\[\]]",trim($aid)))


Then in modules/Your_Account/index.php modify this line
Code:
if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-]",$username)))
to
Code:
if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-\[\]]",$username)))


If you come across any other name checks, just modify them the same way.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Fri Aug 12, 2005 7:53 pm Reply with quote Back to top

This is just a reminder for the new people and the old ones that can't remember ROTFL
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
cyptc
New Member
New Member


Joined: Aug 16, 2005
Posts: 6

PostPosted: Tue Aug 16, 2005 11:38 am Reply with quote Back to top

Topic edited as has no relevance


Last edited by cyptc on Mon May 17, 2010 10:18 pm; edited 1 time in total
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Tue Aug 16, 2005 12:48 pm Reply with quote Back to top

There is no redirection. You save the file and load/ftp that file up and then point your browser to it. Follow the prompts.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
cyptc
New Member
New Member


Joined: Aug 16, 2005
Posts: 6

PostPosted: Tue Aug 16, 2005 1:38 pm Reply with quote Back to top

Topic edited as has no relevance


Last edited by cyptc on Mon May 17, 2010 10:18 pm; edited 1 time in total
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Tue Aug 16, 2005 2:36 pm Reply with quote Back to top

Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
infinity8x3
New Member
New Member


Joined: Jul 28, 2006
Posts: 1

PostPosted: Fri Jul 28, 2006 8:27 am Reply with quote Back to top

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
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Fri Jul 28, 2006 8:48 am Reply with quote Back to top

RavensScripts
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
bugsTHoR
Involved
Involved


Joined: Apr 05, 2006
Posts: 252

PostPosted: Fri Apr 27, 2007 5:11 pm Reply with quote Back to top

thx Amigo, i luv your search box lol
View user's profile Send private message Visit poster's website
nagahosting
Regular
Regular


Joined: Nov 03, 2007
Posts: 52
Location: Nagalim

PostPosted: Thu Jan 24, 2008 1:06 pm Reply with quote Back to top

Very handy thanks Raven Smile


RavensScripts
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Thu Jan 24, 2008 1:09 pm Reply with quote Back to top

You're welcome Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum