Re: [Phplib-users] (no subject)
Brought to you by:
nhruby,
richardarcher
From: Tarique S. <ta...@sa...> - 2002-04-25 05:06:32
|
On Wed, 24 Apr 2002 pe...@kr... wrote: Hello Peter, Plan B is the correct way to go about it. Cheers Tarique > B. > Write an auth_preauth something like this: > function auth_preauth() { > //Very basic check to prove the concept > global $HTTP_COOKIE_VARS; > $uid = $HTTP_COOKIE_VARS['ckUser']; > > if (empty($uid)) { > > return false; > > } else { > > $this->db->query(sprintf("select username,perms,password from %s where user_id = '%s'", > $this->database_table, $uid)); > > while($this->db->next_record()) { > $username = $this->db->f("username"); > $perm = $this->db->f("perms"); > } > > if (empty($username)) { > return false; > } else { > $this->auth["uname"] = $username; > $this->auth["perm"] = $perm; > return $uid; > } > } -- ============================================================= PHP Applications for E-Biz: http://www.sanisoft.com Indian PHP User Group: http://groups.yahoo.com/group/in-phpug ============================================================= |