23
Mar

If you install PlainCart and access the administration page, you are given a default username, which is “admin”, and a default password behind the asterisks. Hitting the login button should bring you directly to the PlainCart Administration page. But what if you encounter this error: “Wrong username or password”?

Was it a flaw in PlainCart? The answer is NOPE! It has something to do with your webhost.

You see, PlainCart uses the PASSWORD function to encrypt sensitive data in your MySQL database, especially passwords. But some webhosts were configured in such a way that they no longer recognizes the PASSWORD function of encryption. A work-around will be to change the encryption method from PASSWORD to MD5. Quite simple. Here’s what you need to do?

1. Open the file “admin/library/functions.php” and locate between lines 39-43 the word PASSWORD(’$password’). Change the word PASSWORD (not the variable name) to md5.

2. Edit the file “admin/user/changePass.php” and between lines 14-31, locate all of the instances of the word PASSWORD and change them all to md5. Be careful not to touch the $password variables.

3. Edit the file “admin/user/processUser.php” and locate between lines 50-58 the word PASSWORD and change them all to md5. On the same file, between lines 64-76, change all the instances of the word PASSWORD to md5.

4. You’re almost done. The next thing you have to do is to change the encrypted password in your database. Open the table tbl_user inside your PlainCart database (you may want to use PHPMyAdmin to do this task easier), click on the BROWSE tab, and edit the values for the record containing the username “admin”. In the user_password field, key-in your desired password for the “admin” username. Under the Function column, choose MD5 and save the data.

5. Head on to your PlainCart Administration page (yourdomain.com/plaincart/admin), key-in “admin” as the username and change the default password with the one you had just saved in the database table. It should make you access the Administration page of PlainCart.

If you got lost with my instructions above, please do not hesitate to email me via robert{dot}reyes{at}gmail{dot}com.


If you are helped by this tip, I will appreciate you sending me a US$2


Popularity: 25% [?]

This entry was posted on Friday, March 23rd, 2007 at 8:40 pm and is filed under Personal, Plaincart, School, Source Codes, Technology, eCommerce. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.


24 Responses so far to "Problem Logging-in as Admin in PlainCart?"

  1. 1 Alexis Solomon
    May 18th, 2007 at 2:45 pm  

    Thanks a million man … you saved me !!!
    great problem solving article…
    THANKS AGAIN

  2. 2 Mikki
    July 30th, 2007 at 4:50 am  

    sir, thanks for this info!

  3. 3 ranewen
    July 31st, 2007 at 7:59 am  

    heard this site from miss bea… and it really works… thank you sir! :D

  4. 4 mic
    August 26th, 2007 at 8:45 pm  

    hey thanks for this help section.. it got me through!! really a genius!! though now i have another problem with Plaincart… everytime i try to upload an image to my “category” i get this message..

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/home/mic/public_html/plaincart/images/category/723c06ee8cb6ec282444e12b1eb0ce04.jpg’ for writing in /home/mic/public_html/plaincart/admin/library/functions.php on line 254

    Warning: Cannot modify header information - headers already sent by (output started at /home/mic/public_html/plaincart/admin/library/functions.php:254) in /home/mic/public_html/plaincart/admin/category/processCategory.php on line 50

    any ideas on what could be wrong with this?

  5. 5 Bob
    August 27th, 2007 at 2:02 pm  

    Hello Mic! Thanks for visiting my website.

    A solution to your problem (uploading pictures) is to set the folder permissions to either 755 or 777 (/plaincart; /plaincart/images; /plaincart/images/category; and /plaincart/images/products). You should be able to upload images for your categories & products once the correct folder permissions are set.

  6. 6 leon
    August 29th, 2007 at 9:52 pm  

    hayup talga sir! wala ako masabi!

  7. 7 CJ
    August 30th, 2007 at 12:10 am  

    cool! thanks sir! :D

  8. 8 bea
    August 31st, 2007 at 3:35 pm  

    actually, ngayon ko lang nakita itong post mo… lahat ng students ko, ni CHMOD ko to read-write-execute 3x yung folders nila. on my own. kaloka! may instructions pala dito puwede pala nila gawin on their own. XD

  9. 9 bea
    August 31st, 2007 at 3:40 pm  

    shet. i can’t get over the fact na ni-777 ko on my own halos lahat ng hosts ng students ko… TATLONG SECTIONS YUN!!!

  10. 10 Murat
    November 4th, 2007 at 11:43 pm  

    Hi,
    First of all thank you very much for this article it really helped me a lot.

    But unfortunetly I have a new problem and I was wondering if you could help me or direct me to right place.

    the plain cart is working without any problem in my localhost, however when I upload it to my web host the admin section does not wotk properley, I am able to login to admin section but but when I log-in first thing that I notice is the web page is not styled with admin.css so everything is displayed without using the styles, secondly the links on the left hand side doesnot work, when I click on them they been added extra bits onthem, for example instead of going http://www.mydomain.co.uk/admin/category, it goes like that http://www.mydomain.co.uk/content/StartupHostPlus/s/e/mydomain.co.uk/web/admin/category/ , as result I get server error saying that page not found.

    I believe the problem lies with the config.php wher eit says

    $thisFile = str_replace(’\\’, ‘/’, __FILE__);
    $docRoot = $_SERVER['DOCUMENT_ROOT'];

    $webRoot = str_replace(array($docRoot, ‘library/config.php’), ”, $thisFile);
    $srvRoot = str_replace(’library/config.php’, ”, $thisFile);

    define(’WEB_ROOT’, $webRoot);
    define(’SRV_ROOT’, $srvRoot);

    But I dont rally know how to solve this.

    If you could help me on this matter I will realky appreciate.

    thanks murat

  11. 11 Macy
    December 9th, 2007 at 9:30 pm  

    Where do I edit the permissions folder to 755 or 777 exactly? Really need help!

  12. 12 Bob
    December 10th, 2007 at 1:47 pm  

    Hello Macy! It depends on how do you manage your website. If you have cPanel, you can use the File Manager to change the folder/file permissions. If you have access to your site’s FTP using FileZilla, SmartFTP, or any other FTP clients, a simple right-click will do to change the permissions of your folders/files.

  13. 13 Bruno
    December 29th, 2007 at 3:24 am  

    Hey bob great stuff, i’m having problems with pictures “Fatal error: Call to undefined function imagecreatetruecolor() in Z:\wamp\www\plaincart\admin\library\functions.php on line 223″

    On the plain cart site says that i must open my php.ini file and change a line, but that doesnt work either, in fact there is nothing to change there… it has something to do with GD not being enabled??

  14. 14 Bruno
    December 31st, 2007 at 5:15 am  

    Solved, for thos who use wamp(like me) you must not only remove the “;” from the php.ini file but also enable it in the wamp menu. Cool! Now if only somebody would do a search engine for this cart would be mega awsome

  15. 15 Adrian
    May 9th, 2008 at 9:46 pm  

    Hello! this plaincart is pure evil, once u resolve a problem, u get another one :(.
    I use wamp, i have gd active.I have a problem at upload… didn’t upload my picture in category or product folders, but insert the name of picture in database. Please help :(

  16. 16 Benjamin
    August 20th, 2008 at 6:27 am  

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”cronixz” at line 3

    This is what i get after i have done all of the switches of passwords with md5s. I am using localhost for the meanwhile until i decide to post it up.
    Thank you,
    Benjamin

  17. 17 Benjamin
    August 20th, 2008 at 6:48 am  

    I think md5 might not be answer rather password, if i am not mistaken.

  18. 18 Bob
    August 20th, 2008 at 11:17 am  

    @Benjamin: The problem there is with the encryption method used in the original source code of PlainCart, which is PASSWORD. Change it to MD5 and it should work well.

  19. 19 Benjamin
    August 21st, 2008 at 10:46 pm  

    I need to also change the original sql document from the get go

  20. 20 Benjamin
    August 22nd, 2008 at 1:02 am  

    I got to the next level but the admin page has no template, and it wont let me click on any buttons. It gives me a 404 error

  21. 21 Benjamin
    August 22nd, 2008 at 1:04 am  

    i will give you a good donation, for your help through alll these steps. I am creating a website right now, and undertook a job that is a bit hard to handle, relative to my expertise.

  22. 22 Bob
    August 22nd, 2008 at 8:32 am  

    @Benjamin: Please email me personally the URL of your PlainCart installation via bob@bobreyes.com

  23. 23 Jon
    September 2nd, 2008 at 5:09 am  

    About using PASSWORD. I had the same problem, but then I found that the length of the encryptet password is now 41 bytes. Therefore, once i changed the field length from 32 to 41 in the MySQL database, voila - it worked :-)

  24. 24 josh
    October 16th, 2008 at 11:58 pm  

    i’m stuck on this step

    “Under the Function column, choose MD5 and save the data.”

    there is no function column, and there is no option to set anything to md5 ANYWHERE that i’m seeing in dbtools or phpmyadmin

    HELP

Leave a reply

Name (*)
Mail (*)
URI
Comment
Your Ad Here