📄 base.users.class.inc
字号:
<?php/** * @copyright Intermesh 2003 * @author Merijn Schering <mschering@intermesh.nl> * @version $Revision: 1.35 $ $Date: 2006/01/30 15:59:16 $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * MS TODO: Remove profiles.class.inc and integrate it into this class * Also remove all uneened sql code since that is handled by sql.users.class.inc * I think you should extend that class with this one and only redefine * funtions that require different handling for LDAP. * * CSV TODO: Wouldn't it be better if the functions update_profile and * add_user need only one parameter, which is the same array as we get as * result from the get_* functions? * * CSV TODO: There are some inconsistencies regarding the function-names. What * is the difference between get_user and get_profile? Or get_user_by_* and * get_profile_by_*? We should define a naming scheme for these functions. * * CSV TODO: To minimize double-writen code we should think about simplifying * the add_user function: This function only creates a basic user-entry, and * calls update_profile and update_preferences to set the additional info. * * This file is supposed to be empty. Only if common user functions for all * user managers come in the future they should be put in this file. * *//** * This is the base class of the user management files. * Don't use this class directly it should be extended by a user manager. * For example sql.users.class.inc. * * @package Framework * @author Merijn Schering <mschering@intermesh.nl> * @since Group-Office 2.05 * @access private */class base_users extends db { /** * Initializes the SQL database connection. * * @access public * @return void */ function base_users() { $this->db(); } function get_countries() { $sql = "SELECT * FROM countries ORDER BY name ASC"; $this->query($sql); return $this->num_rows(); } function get_country($country_id) { $sql = "SELECT * FROM countries WHERE id='$country_id'"; $this->query($sql); if($this->next_record()) { return $this->Record; } return false; } /** * This function returns an array of the fields that can be used as search * criterias for users. * * @access public * @param void * @return array */ function get_search_fields() { return false; } /** * This function searches for users with the given search field. * * @access public * * @param string $query The search query * @param string $field The field to search on. Leave empty for all fields * @param int $user_id The user_id used for permissions * @param int $start Return results starting from this row * @param int $offset Return this number of rows * * @return array */ function search($query, $field, $user_id, $start = 0, $offset = 0) { return false; } /** * This function authorizes a user to view another user when his authorization * request is accepted * * @access public * * @param int $requesting_user_id * @param string $authcode * @param int $accepting_user_id * * @return bool */ function authorize($requesting_user_id, $authcode, $accepting_user_id) { return false; } /** * This function retrieves all users from the database and returns their * number. After that you are able to process each user via next_record. * * @access public * * @param string $sort The field to sort on * @param string $direction The sort direction * @param int $start Return results starting from this row * @param int $offset Return this number of rows * * @return int The number of users */ function get_users($sort = "name", $direction = "ASC", $start = 0, $offset = 0) { return 0; } /** * This function retrieves all users that are visible to a user * * @access public * * @param string $sort The field to sort on * @param string $direction The sort direction * @param int $start Return results starting from this row * @param int $offset Return this number of rows * * @return int The number of users */ function get_authorized_users($user_id, $sort = "name", $direction = "ASC") { return 0; } /** * This function retrieves all userdata based on the users email address. * * @access public * * @param string $email The e-mail address of a user * * @return array */ function get_user_by_email($email) { return false; } /** * This function retrieves the ID of a user based on his email address. * * @access public * * @param string $email * * @return int function get_user_id_by_email( $email ) { return false; }*/ /** * This function checks if the password the user supplied is valid. * * @access public * * @param string $password * * @return bool */ function check_password($password) { return false; } /** * This function returns all userdata based on the users ID. * * @access public * * @param int $user_id * * @return array */ function get_user($user_id) { return false; } /** * This function updates all userdata based on the given parameters. * * @access public * * @param int $user_id * @param string $first_name * @param string $middle_name * @param string $last_name * @param string $initials * @param string $title * @param string $sex * @param string $birthday * @param string $email * @param string $work_phone * @param string $home_phone * @param string $fax * @param string $cellular * @param string $country * @param string $state * @param string $city * @param string $zip * @param string $address * @param string $company * @param string $work_country * @param string $work_state * @param string $work_city * @param string $work_zip * @param string $work_address * @param string $work_fax * @param string $homepage * @param string $department * @param $function * * @return bool True on success */ function update_profile($user_id, $first_name, $middle_name, $last_name, $initials, $title, $sex, $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company, $work_country, $work_state, $work_city, $work_zip, $work_address, $work_fax, $homepage, $department, $function) { return false; } /** * This function updates all userdata based on the given parameters. * * @access public * * @param string $user Array of all columns of table 'users' * @param string $user_groups The user groups the user will be member of * @param string $visible_user_groups The user groups where the user will be visible to * @param string $modules_read The modules the user will have read permissions for * @param string $modules_write The modules the user will have write permissions for * * @return bool True on success */ function update_user($user, $user_groups=array(), $visible_user_groups=array(), $modules_read=array(), $modules_write=array()) { return false; } /** * This function updates the user's password. * * @access public * * @param int $user_id * @param string $password * * @return bool True on success */ function update_password($user_id, $password) { return false; } /** * This function returns all userdata based on the user's name. * * @access public * * @param string $username * * @return array The user profile */ function get_user_by_username($username) { return false; } /** * This function checks, if there is already a user with the given email * address. *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -