PHP Classes

login.php problem

Recommend this page to a friend!

      Access user Class  >  All threads  >  login.php problem  >  (Un) Subscribe thread alerts  
Subject:login.php problem
Summary:Login and/or password did not match to the database
Messages:18
Author:Martin-Rabaud
Date:2005-09-09 01:08:46
Update:2005-09-17 14:03:01
 
  1 - 10   11 - 18  

  11. Re: login.php problem   Reply   Report abuse  
Picture of greg scragg greg scragg - 2005-09-16 17:56:27 - In reply to message 10 from greg scragg
Trying again
At this point I am simply attempting the equival;ent of a "hello World" program: all files are as originally delivered except for the config file which I set to point to my data bases:

it works as far as:
users table created
register.php script loads and seems to work:
new user gets added to data base
letter gets mailed to user
link in letter specifies link: http://www.thedancegypsy.com/classes/access_user/admin_user.php?login_id=1
which takes new user to the "login.php"

but when user enters user ID and password, he gets the error message:
"Login and/or password did not match to the database."

Note: If I *manually* alter the data base, setting active to y, and user_level to 10, I can then login.

Now I am sure that I must be doing something very simple -- but wrong --or my environemnt does not support something needed by the script... b ut it just doesn't work.
I have tried several different users, have reloaded all files 3 times, have cleare3d and reloaded the data base; have used cut and paste to assure that passwords really are correct ... but still I can't see what can be wrong since you say it works in other enviromnets.

any help will be appreciated since this package appears to be exactly what I need, and I don't really want to strat over again with some alternate package

  12. Re: login.php problem   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-09-16 19:49:59 - In reply to message 11 from greg scragg
You missed something to tell:

that you changed this var:

var $auto_activation = true; (must be on false to work like you described)

If you use the class without auto activation you need an admin account first. Then the admin have to activate the new user account.

  13. Re: login.php problem   Reply   Report abuse  
Picture of greg scragg greg scragg - 2005-09-16 20:38:08 - In reply to message 12 from Olaf Lederer
olaf

thanx for the reply,
unfortunately, that does not seem to be the problem. I just checked the source on my server and what I see in access_user_class.php is:
...
var $deny_access_page;
var $auto_activation = true;
var $send_copy = false; // send a mail copy to the administrator (register only)
...

this appears to be exactly the same as in the code on your original ... in fact I didn't change any lines in any file other than config (to make sure, I reloaded all your originals)

is there some another file where this variable also gets set?

  14. a potential solution   Reply   Report abuse  
Picture of greg scragg greg scragg - 2005-09-17 02:34:02 - In reply to message 12 from Olaf Lederer
Olaf
I think I found a work-around for the problem ... but it seems very strange, so I thought I would let you know and see if it makes sense to you:

it appears that your line (in db_config.php):
define("ADMIN_MAIL", "[email protected]");
or my eqivalent line:
define("ADMIN_MAIL", "[email protected]");
needs to be either deleted or replaced with
define("ADMIN_MAIL", "");

The reason for this is

1. the 'register.php' script calls the method 'register_user'.
2. the register_user method calls send_mail() and
3 send_mail() uses the existance of 'this->admin_mail' (which was initialized to be: ADMIN_MAIL) as the criteria for sending a request msg to the administrator rather than a full full msg to the new user saying "you can login".
(this distinction does not seem to depend on the value of $auto_activation)

so far things seem to work with admin_mail deleted ... I can find no other refernces to this constant or the instance variable by the same name.

So, is this interpretation correct? will deleting that line cause me any problems further down the line?

Thanx again for any help.


  15. Re: login.php problem   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-09-17 07:31:40 - In reply to message 14 from greg scragg
NO The ADMIN_MAIL is the guy who have to activate the accounts.

Are you sure that you want use ths class like this? If you let the auto_activation = true the user account is activated without the ADMIN.

By the way, this is not a workarround, The only thing I have to do in the next version is to add an admin aacount to the example data and write this information to the documentation.

  16. Re: login.php problem   Reply   Report abuse  
Picture of greg scragg greg scragg - 2005-09-17 13:08:35 - In reply to message 15 from Olaf Lederer
Olaf

I'm still trying to understand this:

you said
"NO The ADMIN_MAIL is the guy who have to activate the accounts."

I assume that's *only* if "auto_activate" is not used.

you said:
"Are you sure that you want use ths class like this? If you let the auto_activation = true the user account is activated without the ADMIN."

No, I am not sure. I'd rather use it as intended. But I'm looking for some way to get this thing to work.

Unfortunately I *do* have auto_activation = true -- and I can't make it register even one user:
(1) The results don't work when I run it (it sends the user a msg for the administrator" (the not that includes the line "Click here to enter the admin page" *not* the one that says "to activate your request click" *and*
(2) if I trace the code, this is the result I would expect from the code -- because the code does not seem to check the value of auto_activate. Instead it decides which msg to send based on the existence of an admin email address (line 384 of the class file).
(3) Finally if I grep "auto_activation", I see no relevant references to it other than the line setting it true:

greg$ grep "auto_activation" *
access_user_class.php: var $auto_activation = true;
access_user_class.php: if ($this->auto_activation) {
access_user_doc.htm:<p>If you want to use disable the automatic feature use this variable inside the login script: <span class="code"><b>$my_access-&gt;auto_activation = false;</b></span><b> <span class="style1">// (true/false)</span></b></p>
access_user_profile_doc.htm: <li><b>$my_access-&gt;auto_activation = false; <span class="style1">// use this (true/false) to stop the automatic activation</span></b></li>
login.php: //$my_access->auto_activation = false; // use this (true/false) to stop the automatic activation

are these lines as they should be?
if you can tell me what to change, I'd be very happy. But something seems amiss.
Thanx again

  17. Re: login.php problem   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-09-17 13:40:12 - In reply to message 16 from greg scragg
hm... send me a short mail with the code you are using and tell me what you want exactly (automatic registration or not) don't forget to describe your directory structure.


  18. Re: login.php problem   Reply   Report abuse  
Picture of greg scragg greg scragg - 2005-09-17 14:03:01 - In reply to message 17 from Olaf Lederer
olaf
thanx ... I assume you are suggesting taking this offline ... so msg coming via regular old email...

 
  1 - 10   11 - 18