Joomla1.5 manually add admin user

Hi ,…
When we work with joomla site… we should have the back end access.. i.e.  super-admin access.

But we don’t have that…. may be client may forgot to give you or given wrong details…

So need to create new one.. or just change the password in database of joomla site.

We  faced the situation where client has given the correct FTP details… but wrong admin details.. & clinet want some urgent changes on the site.. .. so we have just created simple script in PHP .. which create new User for your joomla using PHP & mysql….


<title>Joomla1.5 User Creater</title>
<style type="text/css">
	margin:0 auto;
#user td{
<form name="joomadduser" method="POST">
	<table cellspacing="0" cellpadding="0"  id="user">
	/****Custom Username & Password*****/
	/********User Creation time********/
	$registerDate=@date('Y-m-d H:i:s');
	$con=mysql_connect($host,$dbuser,$dbpassword) or die(mysql_error().'Sql error , Connection failed');
		/***insert admin user in table ***/
		mysql_select_db($db) or die(mysql_error()."Not able to connect to Database");
		$sql="insert INTO ".$tbprefix."users (name,username,email,password,usertype,block,sendEmail,gid,registerDate,lastvisitDate,activation,params) "."values ('$username','$username','$email','$password','Super Administrator',0,1,25,'$registerDate','$registerDate','','')";	
		mysql_query($sql) or die(mysql_error()."Not able to create admin");
		/***insert admin user id  into usergroup section table ***/		
		$query="insert into ".$tbprefix."core_acl_aro (section_value,value,order_value,name,hidden) VALUES ('users','$adminid',0,'$username',0)";
		mysql_query($query) or die(mysql_error()."Not able to add in section");
		/***insert admin user id  into usergroup ***/
		$query="insert into ".$tbprefix."core_acl_groups_aro_map VALUES (25,'',$sectionid)";
		if(mysql_query($query)  or die(mysql_error()."Not able to add in group"))
			echo "<tr><td align='center'><h1>New User Created Succesfully.</h1><h2>Details As Below:</h2>";	
			echo "Username:-".$username."<br \>";	
			echo "Password:-".trim($_POST['dbpassword'])."</td></tr>";				

			<td colspan="2"><h1>Joomla1.5 manually add admin user</h1></td>			
			<td colspan="2" height="35"></td>
			<td colspan="2" height="35"><h2>Enter Database Details: </h2></td>			
			<td>Host Name</td>
			<td><input value="" name="hostname"></td>
			<td>Database Username</td>
			<td><input value="" name="dbusername" id="dbusername" value=""></td>
			<td>Database Password</td>
			<td><input type="text" name="dbpassword" value=""></td>
			<td>Database Name</td>
			<td><input value="" name="dbname" id="dbname" value=""></td>
			<td>Table Prefix</td>
			<td><input value="" name="tbprefix" value="jos_"></td>
			<td colspan="2"></td>			
			<td colspan="2" height="35"><h2>Enter User Details: </h2></td>			
			<td>New Joomla Username</td>
			<td><input value="" name="username" value=""></td>
			<td>New Joomla Password</td>
			<td><input type="text" name="password" value=""></td>
			<td>Email Id</td>
			<td><input type="text" name="email" value=""></td>
		<tr><td colspan="2"></td></tr>
			<td><input type="submit" name="submit" value="Submit"></td>

PHP Developer..

Tagged with: ,
Posted in Joomla 1.5, PHP
4 comments on “Joomla1.5 manually add admin user
  1. Hello there! This post couldn’t be written any better! Going through this article reminds me of my previous
    roommate! He continually kept talking about this.
    I am going to send this article to him. Fairly
    certain he’ll have a great read. Thanks for sharing!

  2. comzii says:

    It’s enormous that you are getting thoughts from this paragraph as well as from our discussion made here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: