[ Index ]

PHP Cross Reference of Unnamed Project

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: 1184 lines (44 kb)
Included or required:0 times
Referenced: 18 times
Includes or requires: 0 files

Defines 19 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()
  user_add_password_history()
  user_is_previously_used_password()
  user_remove_user_device()
  user_list_view()
  user_mygrades_url()
  user_can_view_profile()
  user_get_tagged_users()

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 menu items, where each menu items is a
stdClass with fields type, 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, $options = array()   X-Ref
Get a list of essential user navigation items.

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

user_add_password_history($userid, $password)   X-Ref
Add password to the list of used hashes for this user.

This is supposed to be used from:
1/ change own password form
2/ password reset process
3/ user signup in auth plugins if password changing supported

param: int $userid user id
param: string $password plaintext password
return: void

user_is_previously_used_password($userid, $password)   X-Ref
Was this password used before on change or reset password page?

The $CFG->passwordreuselimit setting determines
how many times different password needs to be used
before allowing previously used password again.

param: int $userid user id
param: string $password plaintext password
return: bool true if password reused

user_remove_user_device($uuid, $appid = "")   X-Ref
Remove a user device from the Moodle database (for PUSH notifications usually).

param: string $uuid The device UUID.
param: string $appid The app id. If empty all the devices matching the UUID for the user will be removed.
return: bool true if removed, false if the device didn't exists in the database

user_list_view($course, $context)   X-Ref
Trigger user_list_viewed event.

param: stdClass  $course course  object
param: stdClass  $context course context object

user_mygrades_url($userid = null, $courseid = SITEID)   X-Ref
Returns the url to use for the "Grades" link in the user navigation.

param: int $userid The user's ID.
param: int $courseid The course ID if available.
return: mixed A URL to be directed to for "Grades".

user_can_view_profile($user, $course = null, $usercontext = null)   X-Ref
Check if a user has the permission to viewdetails in a shared course's context.

param: object $user The other user's details.
param: object $course Use this course to see if we have permission to see this user's profile.
param: context $usercontext The user context if available.
return: bool true for ability to view this user, else false.

user_get_tagged_users($tag, $exclusivemode = false, $fromctx = 0, $ctx = 0, $rec = 1, $page = 0)   X-Ref
Returns users tagged with a specified tag.

param: core_tag_tag $tag
param: bool $exclusivemode if set to true it means that no other entities tagged with this tag
param: int $fromctx context id where the link was displayed, may be used by callbacks
param: int $ctx context id where to search for records
param: bool $rec search in subcontexts as well
param: int $page 0-based number of page being displayed
return: \core_tag\output\tagindex



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1