Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
UserManagement Class Reference

Public Member Functions

 __construct ($user_id=false)
 
 __get ($attr)
 
 __set ($attr, $value)
 
 getFromDatabase ($user_id)
 
 generate_password ($length)
 
 createNewUser ($newuser)
 
 createPreliminaryUser ($newuser)
 
 changeUser ($newuser)
 
 setPassword ()
 
 deleteUser ($delete_documents=true, $delete_content_from_course=true, $delete_personal_documents=true, $delete_personal_content=true, $delete_names=true, $delete_memberships=true)
 
 changePassword ($password)
 

Static Public Member Functions

static getPwdHasher ()
 
static sendPasswordMail ($user, $new=false)
 

Data Fields

 $msg
 

Detailed Description

UserManagement.class.php

Management for the Stud.IP global users

Constructor & Destructor Documentation

__construct (   $user_id = false)

Constructor

Pass nothing to create a new user, or the user_id from an existing user to change or delete

Parameters
string$user_idthe user which should be retrieved

Member Function Documentation

__get (   $attr)
__set (   $attr,
  $value 
)
changePassword (   $password)

Change an existing user password

Parameters
string$password
Returns
bool change successful?
changeUser (   $newuser)

Change an existing studip user according to the given parameters

Parameters
arraystructure: array('string table_name.field_name'=>'string value')
Returns
bool Change successful?
createNewUser (   $newuser)

Create a new studip user with the given parameters

Parameters
arraystructure: array('string table_name.field_name'=>'string value')
Returns
bool Creation successful?
createPreliminaryUser (   $newuser)

Create a new preliminary studip user with the given parameters

Parameters
arraystructure: array('string table_name.field_name'=>'string value')
Returns
bool Creation successful?
deleteUser (   $delete_documents = true,
  $delete_content_from_course = true,
  $delete_personal_documents = true,
  $delete_personal_content = true,
  $delete_names = true,
  $delete_memberships = true 
)

Delete an existing user from the database and tidy up

Parameters
booldelete all documents in course context belonging to the user
booldelete all course content belonging to the user
booldelete all personal documents belonging to the user
booldelete all personal content belonging to the user
booldelete all names identifying the user
booldelete all memberships of the user
Returns
bool Removal successful?
generate_password (   $length)

generate a secure password of $length characters [a-z0-9]

Parameters
integer$lengthnumber of characters
Returns
string password
getFromDatabase (   $user_id)

load user data from database into internal array

Parameters
string$user_idthe user which should be retrieved
static getPwdHasher ( )
static
static sendPasswordMail (   $user,
  $new = false 
)
static

Send a mail to the user denoted by the passed user-object with a link to reset the password. For admin, root and non-standard-auth a notification is sent instead.

Parameters
User$user
Returns
void
setPassword ( )

Mail a password generation link to the user

Returns
bool Password change successful?

Field Documentation

$msg

The documentation for this class was generated from the following file: