data = $data; if ($data["version"] <> "") $this->valid = true; else $this->valid = false; } // Access to member variables function getID() { return $this->data["id"]; } function getName() { return $this->data["name"]; } function getFlags() { return $this->data["flags"]; } function isValid() { return $this->valid; } } // Generic user lookup function with a provided query string function doLookupUserType($q) { global $db_server; global $db_username; global $db_password; global $authDB; mysql_pconnect($db_server, $db_username, $db_password); if (!mysql_select_db($authDB)) return new UserType(""); if (!($i = mysql_query($q))) return new UserType(""); $row = mysql_fetch_array($i); $ret = new UserType($row); mysql_free_result($i); return $ret; } // Lookup a user record by afsid function lookupUserType($id) { global $authUserTypes; return doLookupUserType("select * from $authUserTypes where id=$id"); } }