[phplib] PREAUTH help please From: Lauren Daniel Stegman (lstegman <email protected>)
Date: 10/31/00

I am attempting to implement pre_auth functionality WITHOUT default
authentication.
Specifically, the page with the pre-authentication form does not call
page_open and no cookie is set. When the user clicks the submit button they
are taken to a page where page_open() is called. The problem is that
$username, $password, and $do_preauth in $HTTP_POST_VARS do not seem to be
available to the auth_preauth() function after page_open() is called, even
when I global everything.

Can someone help me with this problem?

My preauth function is included below:

function auth_preauth(){
    global $do_preauth;
    global $name;
    global $pass;
    $uid = false;
    if (isset($do_preauth))
    {
      $this->db->query(sprintf("select user_id, perms ".
                               " from %s ".
                               " where username = '%s' ".
                               " and password = '%s'",
                            $this->database_table,
                            $name,
                            $pass));
      while($this->db->next_record())
      {
        $uid = $this->db->f("user_id");
        $this->auth["perm"] = $this->db->f("perms");
        $this->auth["uname"] = $username;
      }
    }
    return $uid;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>