List:General Discussion« Previous MessageNext Message »
From:Harmony Date:April 11 1999 7:22am
Subject:Re: Different login forms for different users
View as plain text  
On Fri, 9 Apr 1999, Kristian Köhntopp wrote:

> 
> Harmony schrieb:
> > Before installing PHPLIB, authentication is made by
> > checking username/password suppied by users against
> > those in the corresponding table. i.e. Username/password
> > for visitors of areaA will be checking against table
> > usersA.
> 
> There is nothing in PHPLIB that requires you to authenticate
> against a specific table. Have a look at the code for Poe_Auth in
> local.inc and feel free to modify the Sql in there as you see fit
> for your problem.
> 

I have tried. 
Obviously it's not a trivial task for me. It doesn't work.

-------
// Since I have two user tables (or more) "usersA" and "usersB",
// should I put all the following things in a "if" loop?

  var $database_table = "auth_user";
  ...

    $this->db->query(sprintf("select uid, perms
                                     from %s
                                    where username = '%s'
                                      and password = '%s'",

                          $this->database_table,
                          addslashes($username),
                          addslashes($password)));

// My user tables contain "username", "password", "f_name", "l_name",
// "sex", "age", "phone"...etc, but no "uid" and "perms".
// - What should I output for "uid" then?  How? Or will you suggest me
//   add a field "uid" to my user tables? 
// - Since there's no "perms", should I remove the 3rd line below?

    while($this->db->next_record()) {
      $uid = $this->db->f("uid");
      $this->auth["perm"] = $this->db->f("perms");
    }
    return $uid;
-------

Thank you.


> All that is really required by you is that you return a valid
> $uid or false from the auth_validatelogin() function in there.
> 
> Also, you can easily change auth_loginform() to display all kind
> of login forms depending on what URL called that function. Just
> make the include() statement in there conditional, for example in
> a switch or a cascade of if() statements.
> 
> Kristian
> 
> -- 
> Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
> Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
> Using PHP3? See our web development library at
> http://phplib.shonline.de/ (GPL)
> 

Thread
Different login forms for different usersHarmony9 Apr
  • Re: Different login forms for different usersKristian K√∂hntopp9 Apr
    • Re: Different login forms for different usersHarmony11 Apr