Recovering or Creating Joomla Administrator Account Password
Posted on September 29, 2009
Filed Under Code Snippets, Joomla CMS | Leave a Comment
I wrote a post about recovering your OpenRealty admin access permissions after having encountered a unique situation in trying to recover admin access to a project demo site. With a little foresight after scripting the version for OpenRealty, I thought that maybe a similar script to help people in the event of a Joomla password mishap would be worthy of creating to. So, I figured I’d put together this little snippet you can add to your snippet inventory just in case. Why would you need something like this? I’ll explain.
If you didn’t read the post regarding the similar OpenRealty script then this will help explain why something like this may be necessary. There are times people may install Joomla and then not use it for a period of time. Over time memory can fade and recovering your password using the normal process isn’t really an option because the email assigned to the account is no longer accessible. To make matters worse, there are actually hosting accounts that specialize in bulk hosting of Joomla or WordPress type sites that really don’t grant access to things like phpMyAdmin. What do you do? You use the script below to generate a temporary Super Administrators Account in order for you to reset or change your former account then you delete the file along with the temporary Super Administrators Account. Simply upload the script to your Joomla directory, navigate to it, and your done. It will create a super admin account called THEADMIN with the password of “password”. Its important to note that I set the number in the 9000 range because if you are not sure how many members you have this number is big enough to ensure you wont likely encounter an error. However, this number is so high that each and every new account created will follow this number so its something to consider changing if you want to keep the user ID lower.
But you might ask, why bother with creating a new account when we could simply reset the account to password? Well the very small script at the very bottom of this post will do just that providing the admin account hasn’t been renamed. Upload and access it the same way you would if you were creating the new account. Enjoy!
This one resets the existing super administrators account password to “password”
[snippet missing]
This one creates a new account and password.
<?php
/*
@ Copyright: (c)2007 - 2009 Jared Ritchey Design, All Rights Reserved.
@ Author URL: http://www.jaredritchey.com
@ Author Email: jared@jaredritchey.com
@ License: GNU/GPL Extended.
@ Config Notes: not knowing how many members are in your DB this has been set to create the account in the 9000 range.
*/
//////////////////////////////////////////////////////////////////////////////////////
// THIS SCRIPT IS USED TO CREATE AN ACCOUNT FOR THEADMIN WITH THE PASSWORD OF password
//////////////////////////////////////////////////////////////////////////////////////
require_once('configuration.php');
$link = mysql_connect($mosConfig_host, $mosConfig_user, $mosConfig_password) or die("Could not connect : " . mysql_error());
mysql_select_db($mosConfig_db) or die("Could not select database");
echo "Database Host: " .$mosConfig_host."<br />";
echo "Database User: " .$mosConfig_user."<br />";
echo "Database Password: " .$mosConfig_password."<br />";
echo "Database: " .$mosConfig_db."<br />";
$sql= "INSERT INTO jos_core_acl_aro VALUES(9001, 'users', '9491', 0, 'THEADMIN', 0)";
mysql_query($sql);
$sql= "INSERT INTO jos_core_acl_groups_aro_map VALUES(25, '', 9001)";
mysql_query($sql);
$sql= "INSERT INTO jos_users VALUES(9491, 'THEADMIN', 'THEADMIN', 'someone@somewhere.com', '7d83778ac1e89412de7bad3e3470dc21', 'Super Administrator', 0, 0, 25, '2007-03-06 11:55:23', '2009-08-11 15:32:15', '', 'editor=fckeditor\nexpired=\nexpired_time=')";
mysql_query($sql);
//echo "<br /><br />";
die("Your SUPER ADMINISTRATOR Account was added - be sure to make modifications prior to continuing and delete this file.");
?>
Comments
Leave a Comment
If you would like to make a comment, please fill out the form below.
Recently
- Open-Realty® Moves To Commercial Model
- Aged Domains For Sale
- Break Time Away From This Business.
- I am taking a break from freelance
- OpenRealty Paid Support
- XML Feed Templates Download
- OpenRealty Data Icon Tutorial
- Recovering or Creating Joomla Administrator Account Password
- Hide Null or Empty Value Fields
- WP Menu Creator for Theme Developers
Categories
- Adobe Dreamweaver
- Announcements
- Code Snippets
- Design
- General
- Joomla CMS
- Portfolio
- Products
- Products in Review
- Professionals In Review
- Real Estate News
- Real Estate Scripts
- Real Estate Websites
- Technical Resources
- Template Design Kit
- WordPress Wisdom
Archives
- June 2010
- April 2010
- March 2010
- January 2010
- September 2009
- August 2009
- July 2009
- June 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007