KIH999 Posted October 25, 2009 Share Posted October 25, 2009 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 1 Link to comment Share on other sites More sharing options...
TropischBruin Posted October 25, 2009 Share Posted October 25, 2009 @KIH999, thanks!If someone could confirm that this is actualy working? Link to comment Share on other sites More sharing options...
KIH999 Posted October 25, 2009 Author Share Posted October 25, 2009 Well, it works here.But can't say enough.. DELETE script after use!..If empty employee -table, it will create a new admin accont #1if 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 More sharing options...
KIH999 Posted January 6, 2010 Author Share Posted January 6, 2010 Someone asked where this script should be upladed..As stated in comments in script, it must be uploaded to the renamed "adminfolder" and run from there...Good luck. Link to comment Share on other sites More sharing options...
humano Posted January 6, 2010 Share Posted January 6, 2010 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 More sharing options...
KIH999 Posted January 7, 2010 Author Share Posted January 7, 2010 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 More sharing options...
tekky Posted January 7, 2010 Share Posted January 7, 2010 Thanks for help Link to comment Share on other sites More sharing options...
humano Posted January 7, 2010 Share Posted January 7, 2010 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 More sharing options...
KIH999 Posted January 8, 2010 Author Share Posted January 8, 2010 Good luck Humano.. Prestashop is overkill and same time under-kill, just not the right script for that job. Link to comment Share on other sites More sharing options...
kennyh Posted January 8, 2010 Share Posted January 8, 2010 I import another db to get inside a ps with empty employee tables . this sure saves the hassle .thanks Link to comment Share on other sites More sharing options...
batevladi Posted January 8, 2010 Share Posted January 8, 2010 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 More sharing options...
humano Posted January 8, 2010 Share Posted January 8, 2010 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 More sharing options...
slipperysam Posted January 15, 2010 Share Posted January 15, 2010 Thanks so much.works a dream Link to comment Share on other sites More sharing options...
fiatlux Posted January 23, 2010 Share Posted January 23, 2010 Hi,I used the script, add new Admin user but when I log with ID/pass, it redirects me to the login.php page (server/adminlwslogin.php?redirect=index.php).My web site is hosted.Any idea?Regards,Ozzy Link to comment Share on other sites More sharing options...
nutbuster Posted January 24, 2010 Share Posted January 24, 2010 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 More sharing options...
KIH999 Posted February 2, 2010 Author Share Posted February 2, 2010 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.. 1 Link to comment Share on other sites More sharing options...
Scotch Posted April 27, 2010 Share Posted April 27, 2010 KIH999 спасибо, всё получилось!!!! Link to comment Share on other sites More sharing options...
KIH999 Posted April 28, 2010 Author Share Posted April 28, 2010 Nice Scotch !And... Again... remember to delete it! Link to comment Share on other sites More sharing options...
Scotch Posted April 28, 2010 Share Posted April 28, 2010 Всё уже удалено ;-) Link to comment Share on other sites More sharing options...
Abh Posted June 29, 2010 Share Posted June 29, 2010 Not working.Call to undefined function pSQL() Link to comment Share on other sites More sharing options...
KIH999 Posted June 29, 2010 Author Share Posted June 29, 2010 Have not tested this with Presta 1.3 Link to comment Share on other sites More sharing options...
Abh Posted June 29, 2010 Share Posted June 29, 2010 I was trying it on my 1.2.5.0 installation. Link to comment Share on other sites More sharing options...
KIH999 Posted June 29, 2010 Author Share Posted June 29, 2010 And uploaded to your secret admin-folder?Guess nothing can work in your backoffice if pSQL() is is not defined.Not the password to admin-account that is the problem. Link to comment Share on other sites More sharing options...
Abh Posted June 29, 2010 Share Posted June 29, 2010 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 More sharing options...
KIH999 Posted June 29, 2010 Author Share Posted June 29, 2010 NICE! Glad it worked for you :-) Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 I created a admin2 dir. How do I upload file? Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 I got it to open by /admin2/admin2.php but when I click on send it tell me page not found.Help Link to comment Share on other sites More sharing options...
KIH999 Posted July 23, 2010 Author Share Posted July 23, 2010 It must be in the same folder as your "back-office", wil not work in any other. Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 I don't understand. Whenyou say back-office what do you mean? Do you mean the password.php file? Link to comment Share on other sites More sharing options...
Abh Posted July 23, 2010 Share Posted July 23, 2010 You don't have to create a new admin dir, place it in your original one. Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 What do I name the file? Do I leave the name as newadmin.php? Link to comment Share on other sites More sharing options...
Abh Posted July 23, 2010 Share Posted July 23, 2010 doesn't matter, you only need to know the name so that you can acces it in the browser /newadmin.php Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 When I feel in the new info and click send it tell ma file not found. Link to comment Share on other sites More sharing options...
KIH999 Posted July 23, 2010 Author Share Posted July 23, 2010 It need to be named newadmin.php-The script uses this name in the submit-button to get values returned by you.. Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 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 14Warning: 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 14Warning: 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 15Warning: 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 15Make a new admin accountRemember long password (min 8 char long) FirstName: LastName: Email: Password: Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 Finally got it to work. Not using my head. Thanks Link to comment Share on other sites More sharing options...
KIH999 Posted July 23, 2010 Author Share Posted July 23, 2010 Seems like the file is not located in the folder where you access the back-office (admin panel)It must be in exactly that folder to work, or the paths to include-files will not work. Link to comment Share on other sites More sharing options...
KIH999 Posted July 23, 2010 Author Share Posted July 23, 2010 Finally got it to work. Not using my head. Thanks Nice! Now delete it! Link to comment Share on other sites More sharing options...
nuchie1 Posted July 23, 2010 Share Posted July 23, 2010 Already did.Thanks again. Link to comment Share on other sites More sharing options...
ngruy Posted July 26, 2010 Share Posted July 26, 2010 Hi, i have the same problem with the newadmin.php. I´m using PS 1.3.1.1I 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 More sharing options...
ngruy Posted July 26, 2010 Share Posted July 26, 2010 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 More sharing options...
designs by jacquelyn Posted October 23, 2010 Share Posted October 23, 2010 Thank you so much for this I thought I was going to have to start all over! Link to comment Share on other sites More sharing options...
MrMcQ Posted October 26, 2010 Share Posted October 26, 2010 You...are...my...HERO! Link to comment Share on other sites More sharing options...
reynov Posted November 13, 2010 Share Posted November 13, 2010 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! AGREE with you... Link to comment Share on other sites More sharing options...
KIH999 Posted February 8, 2011 Author Share Posted February 8, 2011 Ahh.. So cool that it helped you! Link to comment Share on other sites More sharing options...
anusha Posted March 8, 2011 Share Posted March 8, 2011 helloam having problem with my back officewhen i try to log in it says no employee or bad passwordit was the same i was using on localhost and now when i put it on server i got this errorplease help meurgently Link to comment Share on other sites More sharing options...
anatya Posted March 24, 2011 Share Posted March 24, 2011 helo KIH999....Your script is so great!!!it solved my problem, thank you so much :-) Link to comment Share on other sites More sharing options...
KIH999 Posted April 9, 2011 Author Share Posted April 9, 2011 :-) Another happy "customer" !NICE! Link to comment Share on other sites More sharing options...
voltarian Posted February 14, 2014 Share Posted February 14, 2014 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/adminyou can upload topublic_html/adminto run it you can open or accessyourwebsite.com/admin/adminlogin.phphave problem add my fb account satryo voltariani am not fluent use inglish language bicause my primary language is bahasa indonesiai have 1 question how to delete that account ?? Link to comment Share on other sites More sharing options...
tanzj Posted February 7, 2016 Share Posted February 7, 2016 Wonderfull a new man! Tested Ps 1.6.1.0 Thanks a lot! Link to comment Share on other sites More sharing options...
tanzj Posted February 7, 2016 Share Posted February 7, 2016 Wonderfull a new man! Tested Ps 1.6.1.0 Thanks a lot! Link to comment Share on other sites More sharing options...
sophia05 Posted February 28, 2019 Share Posted February 28, 2019 Bonjour est-ce que cette technique est toujours bonne ? pour prestashop 1.6 ? jai supprimer mon utilisateur principal apparemment et ne peut plus me connecter.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now