Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/user/lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  moodlecore

Functions

 user_create_user ($user)
 user_update_user ($user)
 user_delete_user ($user)
 user_get_users_by_id ($userids)
 user_get_user_details ($user, $course=null, array $userfields=array())
 user_page_type_list ($pagetype, $parentcontext, $currentcontext)

Function Documentation

user_create_user ( user)

Creates a user

Parameters:
object$useruser to create
Returns:
int id of the newly created user

set the timecreate field to the current time

hash the password

insert the user into the database

trigger user_created event on the full database user row

create USER context for this user

Definition at line 33 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

user_delete_user ( user)

Marks user deleted in internal user database and notifies the auth plugin. Also unenrols user from all roles and does other cleanup.

Todo:
Decide if this transaction is really needed (look for internal TODO:)
Parameters:
object$userUserobject before delete (without system magic quotes)
Returns:
boolean success

Definition at line 94 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

user_get_user_details ( user,
course = null,
array userfields = array() 
)

Give user record from mdl_user, build an array conntains all user details

Parameters:
stdClass$useruser record from mdl_user
stdClass$contextcontext object
stdClass$coursemoodle course
array$userfieldsrequired fields
Returns:
array

Definition at line 119 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

user_get_users_by_id ( userids)

Get users by id

Parameters:
array$useridsid of users to retrieve

Definition at line 103 of file lib.php.

user_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

Definition at line 403 of file lib.php.

user_update_user ( user)

Update a user with a user object (will compare against the ID)

Parameters:
object$user- the user to update

set the timecreate field to the current time

hash the password

trigger user_updated event on the full database user row

Definition at line 65 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations