Jump to content

[TOOL]New admin account.


Recommended Posts

Hello.
I see that many people have trouble creating a new admin-password, or have empty employee-table..

This script make a new admin-account so you can access "back office".

Remember to delete this script after you have used it. Just a emergncy-tool.
Upload it to your back-office folder..

Hope this can help anyone here.. :)

><?php

// This script add a new admin-account
// Delete this script from server after
// you have used it.
// Warning Very Big security-risk!!
// Upload it to your secret Back Office folder.
//
// Best regards KIH999



define('PS_ADMIN_DIR', getcwd());
include(PS_ADMIN_DIR.'/../config/config.inc.php');
include(PS_ADMIN_DIR.'/functions.php');

?>

<form name="formdata" action="newadmin.php">

Make a new admin account


Remember long password (min 8 char long)
   <input type="hidden" name="key" value="OK" />
</pre>
<table>FirstName:<input type="text" name="firstname" value="" size="30" /></td>
LastName:<input type="text" name="lastname" value="" size="30" /></td>
Email:<input type="text" name="email" value="" size="30" /></td>
Password:<input type="text" name="password" value="" size="30" /></td>
</table>
<br>   <input type="submit" value="Send" name="send" /><br><br>   </form><br><?php<br><br>if ($_GET['key']=="OK") {<br><br><br>$delim =' , ';<br>$query = 'INSERT INTO '._DB_PREFIX_.'employee (id_employee, lastname, firstname, email, passwd, last_passwd_gen, active, id_profile) VALUES';<br>$query.= ' (NULL'; //ID_emp<br>$query.=$delim;<br>$query.= '"'.pSQL($_GET['lastname']).'"'; //Last<br>$query.=$delim;<br>$query.= '"'.pSQL($_GET['firstname']).'"'; //First<br>$query.=$delim;<br>$query.= '"'.pSQL($_GET['email']).'"'; //Email<br>$query.=$delim;<br>$query.= '"'.md5(pSQL(_COOKIE_KEY_.$_GET['password'])).'"'; //Password<br>$query.=$delim;<br>$query.= '"'.date('Y-m-d h:i:s', strtotime('-360 minutes')).'"'; //Last_pass_gen<br>$query.=$delim;<br>$query.=' 1, 1)'; //active,id_profile<br>$dbInstance = Db::getInstance();<br>if(!$dbInstance->Execute($query))<br>$error['infosInsertSQL'] = '11';<br>unset($dbInstance);<br><br>}<br

newadmin.php

  • Like 1
Link to comment
Share on other sites

Well, it works here.
But can't say enough.. DELETE script after use!..

If empty employee -table, it will create a new admin accont #1
if you have a record in there, but can't log in for a reason (forgot password or something), it will add another valid account.
It uses the "_DB_PREFIX_" to get the correct tablename, and uses current "_COOKIE_KEY_" to generate password hash.

Have tested with accounts with 2 identical emails with different passwords both work.

Link to comment
Share on other sites

  • 2 months later...

Hi KIH999,

I did it, thanks a lot of time and work spares, i just was messing up the DB and your script did it, good job man, really appreciate. I was on a second clear install, messing DB, searching forums, exploring my hosting capabilities and compatibilities(ARUBA.it), long hours losted, before i did install oscommerce and it worked fine but the new version didn,t and so i landet in PS, hope for it.
I have a please at you, for my purpose is to do a secondhand car shop for a friend of mine, actually the guy who sold me my car and this is part of the deal, i need a system to make like a 40 or 50 cars place where my friend can update himself the page, and he knows very very little design, just where he could easily change or adds cars as it goes, can you please help me with this; like the shop needs brands, and there are like 99 or more and then different models and so on... The installation was hard buy now comes a rest! Or even if you could suggest me an very easy form based on php? just like a couple of scripts for the general view of the cars and then detailed pages for each of them, i can do myself with dreamweaver, and others but is for the guy who just dont. Hope not to bother you with all this, like my first attempt to ask for some help, thanks again and wait for your answer :) and a Prosperous New Year!!!

Happy New YeaHrrrr! :)

Link to comment
Share on other sites

I don't think PrestaShop is the right platform for selling and presenting used cars..
There are scripts that is targeted to used cars. Do a search with google and you will find many with PHP and MySql backend where you very easy can modify template and add/delete cars.

Link to comment
Share on other sites

KIH999 I thank you, you may be rigth, i,m exhausted did google already but not success, tried many WYSIWYG, CMS and Oscom... now PS, provisionally is on Wordpress but all still quite complicated for my friend so again if YOU can please suggest i,ll be pleased! http://www.sotocar2006.com/ is the actuall and the ideal would be just the 2 or 3 pages he could easily modify and the rest of the parafernaly i will do, my only prob then would still be the search(he deals with 20 to 40 cars), then maybe a google search form. I dont want to bother at all so if this is something you can or wan,t do is also ok, i just started asking for help, this may be less exhausting than trying all those things, and he also dont speaks english.... :)

Link to comment
Share on other sites

Hi KIH999,

I did it, thanks a lot of time and work spares, i just was messing up the DB and your script did it, good job man, really appreciate. I was on a second clear install, messing DB, searching forums, exploring my hosting capabilities and compatibilities(ARUBA.it), long hours losted, before i did install oscommerce and it worked fine but the new version didn,t and so i landet in PS, hope for it.
I have a please at you, for my purpose is to do a secondhand car shop for a friend of mine, actually the guy who sold me my car and this is part of the deal, i need a system to make like a 40 or 50 cars place where my friend can update himself the page, and he knows very very little design, just where he could easily change or adds cars as it goes, can you please help me with this; like the shop needs brands, and there are like 99 or more and then different models and so on... The installation was hard buy now comes a rest! Or even if you could suggest me an very easy form based on php? just like a couple of scripts for the general view of the cars and then detailed pages for each of them, i can do myself with dreamweaver, and others but is for the guy who just dont. Hope not to bother you with all this, like my first attempt to ask for some help, thanks again and wait for your answer :) and a Prosperous New Year!!!

Happy New YeaHrrrr! :)


Hi humano, have you checked the usual suspects: DRUPAL, JOOMLA, XOOMS, TYPO3 etc. these have module extensions which have the capabilities to showcase products, with or without the functionality of purchase which PS so nicely does.

V
Link to comment
Share on other sites

Hello, thanks for answering, i tried drupal, joomla, typo3, not sure with xooms??, no i havent try xooms and all that was another kind of wall then i had trouble with the aruba.it hosting were the site is, maybe because aruba.it does not have really open hands for those cms.s(and likely versions of these days, some prior versions may work, like drupal did, although i prefer the latest cause of the security, aruba is offten hacked by turkish kind of people).

At this time i,m dealing with some free and bit old scripts car-dealer-website, wich i even success to install myself due to the good quality of their simplicity, and explanations, but i,m afraid cause of it,s lack of security, is just an starting point, like water clear with its 4 tables mysq and its respectives html/php templates with no restriction at all, also not supported.

I just want to get the site fixed...

Thank you all again!

Link to comment
Share on other sites

  • 2 weeks later...
Hello.
I see that many people have trouble creating a new admin-password, or have empty employee-table..

This script make a new admin-account so you can access "back office".

Remember to delete this script after you have used it. Just a emergncy-tool.
Upload it to your back-office folder..



Can you give a detailed discription on how to install this to a newbie please? :)

I can log on to the first step but I did activate the second security feature which asked for an email and another password...that last security step is not working and giving error....Once I get back in I may just take that step out as when my host moved my site to a faster server this is when I started having problems logging into Prestashop back office.
Link to comment
Share on other sites

  • 2 weeks later...

Just FTP it up to your secret admin-folder. -Run it. -then Delete it..

Sample: h_t_t_p://yoursite.com/my_top_secret_adminxxxxfolder/newadmin.php

That should be it.

Remember this is just a script to insert a admin-account into your existing databasetable, nothing more..

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

I am sorry for doubting your script, there was another similar one that had to be copied directly in the root, and i just presumed this one works the same way. My mistake, it's functional once copied it to my admin folder. I figured the mistake was on my part since all these people said it works fine.

Link to comment
Share on other sites

  • 4 weeks later...

his is the error I get now.

Warning: include(/home/content/l/e/o/leorusso/html/catholic/../config/config.inc.php) [function.include]: failed to open stream: No such file or directory in /home/content/l/e/o/leorusso/html/catholic/newadmin.php on line 14

Warning: include() [function.include]: Failed opening '/home/content/l/e/o/leorusso/html/catholic/../config/config.inc.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/l/e/o/leorusso/html/catholic/newadmin.php on line 14

Warning: include(/home/content/l/e/o/leorusso/html/catholic/functions.php) [function.include]: failed to open stream: No such file or directory in /home/content/l/e/o/leorusso/html/catholic/newadmin.php on line 15

Warning: include() [function.include]: Failed opening '/home/content/l/e/o/leorusso/html/catholic/functions.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/l/e/o/leorusso/html/catholic/newadmin.php on line 15


Make a new admin account



Remember long password (min 8 char long)

FirstName:
LastName:
Email:
Password:

Link to comment
Share on other sites

Hi, i have the same problem with the newadmin.php. I´m using PS 1.3.1.1
I delele "employee" table and restore with a backup, delete cookies, and the same problem, i can´t login.
Any other thing i can do? some other table?....
thanks!

Link to comment
Share on other sites

Solved (in my case).
For some reason after i back up classes/cookie.php they work ok and i can login to my BO.
The only change i did to cookie. php was " (time() + 1728000);" to (time() + 7200);.
Hope this help someone.

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
Hello.
I see that many people have trouble creating a new admin-password, or have empty employee-table..

This script make a new admin-account so you can access “back office”.

Remember to delete this script after you have used it. Just a emergncy-tool.
Upload it to your back-office folder..

Hope this can help anyone here..


WOW...Many Thank's for KIH999...your script is helping me...

@MrMcQ
You…are…my…HERO! :D


AGREE with you...
Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

hello
am having problem with my back office
when i try to log in it says no employee or bad password
it was the same i was using on localhost and now when i put it on server i got this error
please help me
urgently

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 2 years later...

Nice its work :)
if you copy the script and paste to notepad don't forget to rename to "newadmin.php"
where we must upload ??
answer : if you use cPanel and login admin is yourwebsite.com/admin
you can upload to
public_html/admin
to run it you can open or access
yourwebsite.com/admin/adminlogin.php
have problem add my fb account satryo voltarian

i am not fluent use inglish language bicause my primary language is bahasa indonesia

i have 1 question how to delete that account ??

Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...