[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/user/ -> lib.php (summary)

External user API

Copyright: 2009 Moodle Pty Ltd (http://moodle.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 881 lines (34 kb)
Included or required:0 times
Referenced: 12 times
Includes or requires: 0 files

Defines 12 functions

  user_create_user()
  user_update_user()
  user_delete_user()
  user_get_users_by_id()
  user_get_default_fields()
  user_get_user_details()
  user_get_user_details_courses()
  can_view_user_details_cap()
  user_page_type_list()
  user_count_login_failures()
  user_convert_text_to_menu_items()
  user_get_user_navigation_info()

Functions
Functions that are not part of a class:

user_create_user($user, $updatepassword = true, $triggerevent = true)   X-Ref
Creates a user

param: stdClass $user user to create
param: bool $updatepassword if true, authentication plugin will update password.
param: bool $triggerevent set false if user_created event should not be triggred.
return: int id of the newly created user

user_update_user($user, $updatepassword = true, $triggerevent = true)   X-Ref
Update a user with a user object (will compare against the ID)

param: stdClass $user the user to update
param: bool $updatepassword if true, authentication plugin will update password.
param: bool $triggerevent set false if user_updated event should not be triggred.

user_delete_user($user)   X-Ref
Marks user deleted in internal user database and notifies the auth plugin.
Also unenrols user from all roles and does other cleanup.

param: object $user Userobject before delete    (without system magic quotes)
return: boolean success

user_get_users_by_id($userids)   X-Ref
Get users by id

param: array $userids id of users to retrieve
return: array

user_get_default_fields()   X-Ref
Returns the list of default 'displayable' fields

Contains database field names but also names used to generate information, such as enrolledcourses

return: array of user fields

user_get_user_details($user, $course = null, array $userfields = array()   X-Ref
Give user record from mdl_user, build an array contains all user details.

Warning: description file urls are 'webservice/pluginfile.php' is use.
it can be changed with $CFG->moodlewstextformatlinkstoimagesfile

param: stdClass $user user record from mdl_user
param: stdClass $course moodle course
param: array $userfields required fields
return: array|null

user_get_user_details_courses($user)   X-Ref
Tries to obtain user details, either recurring directly to the user's system profile
or through one of the user's course enrollments (course profile).

param: stdClass $user The user.
return: array if unsuccessful or the allowed user details.

can_view_user_details_cap($user, $course = null)   X-Ref
Check if $USER have the necessary capabilities to obtain user details.

param: stdClass $user
param: stdClass $course if null then only consider system profile otherwise also consider the course's profile.
return: bool true if $USER can view user details.

user_page_type_list($pagetype, $parentcontext, $currentcontext)   X-Ref
Return a list of page types

param: string $pagetype current page type
param: stdClass $parentcontext Block's parent context
param: stdClass $currentcontext Current context of block
return: array

user_count_login_failures($user, $reset = true)   X-Ref
Count the number of failed login attempts for the given user, since last successful login.

param: int|stdclass $user user id or object.
param: bool $reset Resets failed login count, if set to true.
return: int number of failed login attempts since the last successful login.

user_convert_text_to_menu_items($text, $page)   X-Ref
Converts a string into a flat array of links, where each link is a
stdClass with fields url, title, pix, and imgsrc.

param: string $text the menu items definition
param: moodle_page $page the current page
return: array

user_get_user_navigation_info($user, $page)   X-Ref
Get a list of essential user navigation items.

param: stdclass $user user object.
param: moodle_page $page page object.
return: stdClass $returnobj navigation information object, where:



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1