[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Source view] [Print] [Project Stats]
User class
Copyright: | 2013 Rajesh Taneja <[email protected]> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 241 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
core_user:: (7 methods):
get_user()
get_user_by_username()
get_dummy_user_record()
get_noreply_user()
get_support_user()
reset_internal_users()
is_real_user()
get_user($userid, $fields = '*', $strictness = IGNORE_MISSING) X-Ref |
Return user object from db or create noreply or support user, if userid matches corse_user::NOREPLY_USER or corse_user::SUPPORT_USER respectively. If userid is not found, then return false. param: int $userid user id param: string $fields A comma separated list of user fields to be returned, support and noreply user param: int $strictness IGNORE_MISSING means compatible mode, false returned if user not found, debug message if more found; return: stdClass|bool user record if found, else false. |
get_user_by_username($username, $fields = '*', $mnethostid = null, $strictness = IGNORE_MISSING) X-Ref |
Return user object from db based on their username. param: string $username The username of the user searched. param: string $fields A comma separated list of user fields to be returned, support and noreply user. param: int $mnethostid The id of the remote host. param: int $strictness IGNORE_MISSING means compatible mode, false returned if user not found, debug message if more found; return: stdClass|bool user record if found, else false. |
get_dummy_user_record() X-Ref |
Helper function to return dummy noreply user record. return: stdClass |
get_noreply_user() X-Ref |
Return noreply user record, this is currently used in messaging system only for sending messages from noreply email. It will return record of $CFG->noreplyuserid if set else return dummy user object with hard-coded $user->emailstop = 1 so noreply can be sent to user. return: stdClass user record. |
get_support_user() X-Ref |
Return support user record, this is currently used in messaging system only for sending messages to support email. $CFG->supportuserid is set then returns user record $CFG->supportemail is set then return dummy record with $CFG->supportemail else return admin user record with hard-coded $user->emailstop = 0, so user gets support message. return: stdClass user record. |
reset_internal_users() X-Ref |
Reset self::$noreplyuser and self::$supportuser. This is only used by phpunit, and there is no other use case for this function. Please don't use it outside phpunit. |
is_real_user($userid, $checkdb = false) X-Ref |
Return true is user id is greater than self::NOREPLY_USER and alternatively check db. param: int $userid user id. param: bool $checkdb if true userid will be checked in db. By default it's false, and return: bool true is real user else false. |
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |