TurfSite Manila

Internet + Computer = Life! (version 3.20 build update 21012012)

Problem Logging-in as Admin in PlainCart?

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


  • Alexis Solomon says:

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

    18 May 2007 at 14:45
  • Mikki says:

    sir, thanks for this info!

    30 July 2007 at 04:50
  • ranewen says:

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

    31 July 2007 at 07:59
  • mic says:

    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?

    26 August 2007 at 20:45
  • Bob says:

    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.

    27 August 2007 at 14:02
  • leon says:

    hayup talga sir! wala ako masabi!

    29 August 2007 at 21:52
  • CJ says:

    cool! thanks sir! :D

    30 August 2007 at 00:10
  • bea says:

    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

    31 August 2007 at 15:35
  • bea says:

    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!!!

    31 August 2007 at 15:40
  • Murat says:

    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

    4 November 2007 at 23:43
  • Macy says:

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

    9 December 2007 at 21:30
  • Bob says:

    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.

    10 December 2007 at 13:47
  • Bruno says:

    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??

    29 December 2007 at 03:24
  • Bruno says:

    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

    31 December 2007 at 05:15
  • Adrian says:

    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 :(

    9 May 2008 at 21:46
  • Benjamin says:

    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

    20 August 2008 at 06:27
  • Benjamin says:

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

    20 August 2008 at 06:48
  • Bob says:

    @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.

    20 August 2008 at 11:17
  • Benjamin says:

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

    21 August 2008 at 22:46
  • Benjamin says:

    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

    22 August 2008 at 01:02
  • Benjamin says:

    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 August 2008 at 01:04
  • Jon says:

    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 :-)

    2 September 2008 at 05:09
  • josh says:

    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

    16 October 2008 at 23:58
  • Debs says:

    after doing these instructions Problem Logging-in as Admin in PlainCart? It still won’t let me login can you help me
    Thank you

    25 July 2009 at 11:08
  • Amar says:

    Thanks a lot…………hurray its done

    7 October 2009 at 17:20
  • Roy says:

    Thanks very much! I was on the right track with the PASSWORD() function and database needing changed but didn’t realize the function was in more than one file and that the user couldn’t be changed until after logging in as admin, why is that, user stored in a file somewhere? Now I have a problem with not being able to select category in add product.

    12 January 2010 at 14:51
  • Me says:

    Tks

    20 January 2010 at 02:44
  • mochomachetas says:

    THANKS!!!!!!!

    10 February 2010 at 03:11
  • ez says:

    i failed to logged in..help me

    18 February 2010 at 21:21
  • ez says:

    i already followed all the guidelines..but still failed to logged in.

    18 February 2010 at 21:25
  • YH says:

    I have the SQL problem :

    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 ‘Set, pd_name = ‘Dining Table’, pd_description = ‘Dining Table’, pd_image = pd_im’ at line 2

    Once I modify the product item , anyone can help ?

    11 March 2010 at 15:19
  • anurag says:

    hi,
    i am very new to php. and i am using plaincart first time.
    i have installed php 5.2 manually on xp.
    my problem is that when i login to admin panel .the page does not redirect to index.php ,it show same login page.while username and password is correct.

    10 August 2010 at 19:19
  • sarith says:

    Hi…
    I am sarith really don’t know the syntax of web_roo if you know pls help
    Best regards,

    12 August 2010 at 16:23
  • sarith says:

    I have problem with web_root also please tell the syntax to me.
    Thanks

    12 August 2010 at 16:27
  • Jackin says:

    Hello,
    I can not be able to add categories and products in my plaincart.there are no errors and when I click to add, nothing happens apart from the browser that generates this error : Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
    Timestamp: Thu, 12 Aug 2010 13:52:30 UTC

    Message: Object expected
    Line: 5
    Char: 3
    Code: 0
    URI: http://pixierallyteam.com/admin/library/category.js

    help!

    12 August 2010 at 21:52
  • Bruno Amorim says:

    Thank you so much…. you save me hours of work! :)

    10 September 2010 at 00:16
  • Gabby says:

    You da MAN that solve my problem now stuck with the
    $thisFile = str_replace(‘\\’, ‘/’, __FILE__);
    make link wrong.

    2 January 2011 at 00:41
  • Arif Majid says:

    how do i set it up in my localhost…

    i tried changin the config.php … but not working …

    the webroot and srvroot seems to be not assigned properly…

    ne advice on how to fix it ?

    9 April 2011 at 00:41
  • Beautiful Soul says:

    thanks so much. success! :)

    28 April 2011 at 21:17
  • JabberGabber says:

    Great stuff – Thanks a million – Just sent you $2.

    3 June 2011 at 04:52
  • Bob says:

    @JabberGabber thank you very much for your kindness! You’re always welcome.

    3 June 2011 at 07:46
  • rmani says:

    http://localhost/plaincart/plaincart/admin/user/index.php side buton is wnot working please help me

    26 July 2011 at 16:50
  • lusajo says:

    still I have problems in webroot because after i login no css take effect and links are not working well

    23 August 2011 at 13:59
  • Raju says:

    Dear all,
    Its works perfectly my localhost. but is not working properly on my server when i login admin page is not show correctly. help me please…

    25 August 2011 at 15:36
  • José says:

    Hi,
    i can enter admin ok but when doLogout and reenter the user and password fields are always with the last user and pass data.
    How can i clear the fields so that when i reenter have to insert user and pass?

    Help pls…
    Many thanks

    22 September 2011 at 21:39

Your email address will not be published. Required fields are marked *

*