|
zAuthBaseThis is the base class of zoglair These are the requirements expected from descendants:
A descendant of this class is instantiated as the globally available $zAuth object, based on the relevant authority setting.
void __construct(array $INFO) ⇧ Descendants should initialize session, here. At the time this is called $zDbms (global database manager) is already instantiated.
boolean authenticate() ⇧ HTTP authenticates a session, according to the relevant authority settings.
boolean can_user(string $action, array $ROW=NULL, object $Table=NULL) ⇧ A vital function for checking various, system-wide user privileges. If you want to know whether a user is allowed to do something, this is the place to ask.
mixed captcha(string $what, string $value='') ⇧ Generates and validates captchas, according to the relevant authority settings.
string generate_captcha_text(integer $len, string $chrs)static ⇧ Generates a random string of a given length and character set.
mixed get_cookie_domain()static ⇧ Returns the domain argument of a cookie value. If localhost, then FALSE is returned, otherwise subdomain is stripped (ie no 'www.').
mixed get_udf(string $info='', mixed $default='') ⇧ A zObject::get_info() wrapper, to return user defined session variables, saved under the 'z_row/udf' key, as mentioned in the class description.
See also set_udf(). mixed get_user(string $info='', mixed $default='') ⇧ A zObject::get_info() wrapper, to return column values from the active user record, saved under the 'z_row/user' key, as mentioned in the class description.
See also set_user(). integer get_user_id() ⇧ A shortcut for $zAuth->get_user('id').
array get_user_row(mixed $mixed=NULL)static ⇧ Loads a row (~record) from the User table and returns it as a map.
integer get_user_sevel(boolean $real=FALSE) ⇧ A wrapper of $zAuth->get_user('sevel'). It is HIGHLY recommended to use this function, instead of a direct access, because it takes care of properly adjusting for system maintenance and the user's run_as() level.
integer get_user_tzo(boolean $secs=TRUE) ⇧ A wrapper of $zAuth->get_user('tzo'). It is highly recommended to use this function, instead of a direct access, because it takes care of properly adjusting for negative TZOs.
boolean is_super_user() ⇧ Checks whether the active session belongs to the super user (the webmaster of the default domain).
boolean is_user() ⇧ Checks whether the active session belongs to a user or a guest.
boolean login(array $INFO) ⇧ Attempts to login a user by first finding an account with matching credentials, and then ensuring that the account is activated and not banned.
void logout() ⇧ Clears the active session, effectively logging the user out.
void run_as(integer $sevel) ⇧ Changes the security level of the active user. This is an invaluable tool for staff members that allows them to test various site features under the context of a less privileged user account. Notice: The new security level stays in effect until changed or the user session is invalidated.
void save_session(string $reason='') ⇧ This is called from zoglair.php, just before output. Descendants should store any changes (ie user preferences and selections) or simply update their timestamp, for keeping up with online status and session timeouts. Notice: This is a stub
void set_udf(string $info, mixed $value) ⇧ A zObject::set_info() wrapper, to set user defined session variables, saved under the 'z_row/udf' key, as mentioned in the class description.
See also get_udf(). void set_user(string $info, mixed $value) ⇧ A zObject::set_info() wrapper, to set column values in the active user record, saved under the 'z_row/user' key, as mentioned in the class description.
See also get_user(). |