PHP Classes

not authorized

Recommend this page to a friend!

      AdminPro class  >  All threads  >  not authorized  >  (Un) Subscribe thread alerts  
Subject:not authorized
Summary:can't login
Date:2005-05-24 00:59:24
Update:2010-06-28 17:58:46

  1. not authorized   Reply   Report abuse  
Picture of thatsme thatsme - 2005-05-24 00:59:24
I installed all files as directed by readme.html. I inserted the correct info into the database. When I go to login.html and enter admin as the username and admin as the password I get the page "NOT AUTHORIZED". Any ideas as to why this could be happening?


  2. Re: not authorized   Reply   Report abuse  
Picture of Jon Slack Jon Slack - 2007-11-28 16:46:19 - In reply to message 1 from thatsme
It's because the script doesn't correctly add the default user. The errors are in the INSERT INTO line in the setup script. There are two errors as far as I can see:
1. The table (myuser) requires date in the 'lastLog' field. This is not provided by the script (an empty string is used).
2. The setup script does not encrypt the default 'admin' password, but the script checking login details assumes it is.

To fix this, I ran a temp.php script:

$pword = "admin";
$encrypted = md5($pword);
$sql = "UPDATE myuser SET userPass = '" . $encrypted . "' WHERE userName = 'admin'";
$db->query($sql); // As you can see, I use JV's ez_mysql class.

To sort the date, I replaced the '' in the setup script for the INSERT line with NOW().

  3. Re: not authorized   Reply   Report abuse  
Picture of William Humphrey William Humphrey - 2010-06-28 17:58:47 - In reply to message 2 from Jon Slack
I'm a newbie at this. Exactly where or how do I "run" your temp.php script. Right now I'm just testing this out on my Mac G5 OS 10.5.8 on "localhost."

Many thanks.