ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjUser Class Reference
+ Inheritance diagram for ilObjUser:
+ Collaboration diagram for ilObjUser:

Public Member Functions

 ilObjUser ($a_user_id=0, $a_call_by_reference=false)
 Constructor public.
 read ()
 loads a record "user" from database private
 assignData ($a_data)
 loads a record "user" from array public
 saveAsNew ($a_from_formular=true)
 TODO: drop fields last_update & create_date.
 update ()
 updates a record "user" and write it into database public
 writeAccepted ()
 write accept date of user agreement to db
 _lookupEmail ($a_user_id)
 _lookupGender ($a_user_id)
 _lookupClientIP ($a_user_id)
 _lookupName ($a_user_id)
 lookup user name
 _lookupFields ($a_user_id)
 lookup user name
 _lookupLogin ($a_user_id)
 lookup login
 _lookupExternalAccount ($a_user_id)
 lookup external account for login and authmethod
 _lookupId ($a_user_str)
 lookup id by login
 _lookupLastLogin ($a_user_id)
 lookup last login
 refreshLogin ()
 updates the login data of a "user" // TODO set date with now() should be enough public
 replacePassword ($new_md5)
 replaces password with new md5 hash
 updatePassword ($a_old, $a_new1, $a_new2)
 updates password
 resetPassword ($a_new1, $a_new2)
 reset password
 _makeIlias2Password ($a_passwd)
 get encrypted Ilias 2 password (needed for imported ilias 2 users)
 _lookupHasIlias2Password ($a_user_login)
 check if user has ilias 2 password (imported user)
 _switchToIlias3Password ($a_user, $a_pw)
 updateLogin ($a_login)
 update login name
 writePref ($a_keyword, $a_value)
 write userpref to user table private
 deletePref ($a_keyword)
 Deletes a userpref value of the user from the database public.
 _writePref ($a_usr_id, $a_keyword, $a_value)
 writePrefs ()
 write all userprefs private
 getTimeZone ()
 get timezone of user
 getTimeFormat ()
 get time format
 setPref ($a_keyword, $a_value)
 set a user preference
 getPref ($a_keyword)
 get a user preference
 _lookupPref ($a_usr_id, $a_keyword)
 readPrefs ()
 get all user preferences private
 delete ()
 deletes a user public
 setFullname ($a_title="", $a_firstname="", $a_lastname="")
 builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname.
 getFullname ($a_max_strlen=0)
 get fullname public
 getLastVisitedLessons ()
 get read lessons, ordered by timestamp public
 getLessons ()
 get all lessons, unordered public
 hasAcceptedUserAgreement ()
 check wether user has accepted user agreement
 setLogin ($a_str)
 set login / username public
 getLogin ()
 get login / username public
 setPasswd ($a_str, $a_type=IL_PASSWD_PLAIN)
 set password public
 getPasswd ()
 get password
 getPasswdType ()
 get password type
 setGender ($a_str)
 set gender public
 getGender ()
 get gender public
 setUTitle ($a_str)
 set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets the user object's title) public
 getUTitle ()
 get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets the user object's title) public
 setFirstname ($a_str)
 set firstname public
 getFirstname ()
 get firstname public
 setLastname ($a_str)
 set lastame public
 getLastname ()
 get lastname public
 setInstitution ($a_str)
 set institution public
 getInstitution ()
 get institution public
 setDepartment ($a_str)
 set department public
 getDepartment ()
 get department public
 setStreet ($a_str)
 set street public
 getStreet ()
 get street public
 setCity ($a_str)
 set city public
 getCity ()
 get city public
 setZipcode ($a_str)
 set zipcode public
 getZipcode ()
 get zipcode public
 setCountry ($a_str)
 set country public
 getCountry ()
 get country public
 setPhoneOffice ($a_str)
 set office phone public
 getPhoneOffice ()
 get office phone public
 setPhoneHome ($a_str)
 set home phone public
 getPhoneHome ()
 get home phone public
 setPhoneMobile ($a_str)
 set mobile phone public
 getPhoneMobile ()
 get mobile phone public
 setFax ($a_str)
 set fax public
 getFax ()
 get fax public
 setClientIP ($a_str)
 set client ip number public
 getClientIP ()
 get client ip number public
 setMatriculation ($a_str)
 set matriculation number public
 getMatriculation ()
 get matriculation number public
 setEmail ($a_str)
 set email public
 getEmail ()
 get email address public
 setHobby ($a_str)
 set hobby public
 getHobby ()
 get hobby public
 setLanguage ($a_str)
 set user language public
 getLanguage ()
 returns a 2char-language-string public
 setLastPasswordChangeTS ($a_last_password_change_ts)
 getLastPasswordChangeTS ()
 _lookupLanguage ($a_usr_id)
 _checkPassword ($a_usr_id, $a_pw)
 _writeExternalAccount ($a_usr_id, $a_ext_id)
 _writeAuthMode ($a_usr_id, $a_auth_mode)
 getCurrentLanguage ()
 returns the current language (may differ from user's pref setting!)
 setLastLogin ($a_str)
 set user's last login public
 getLastLogin ()
 returns last login date public
 setLastUpdate ($a_str)
 set last update of user data set public
 getLastUpdate ()
 setComment ($a_str)
 set referral comment public
 getComment ()
 get referral comment public
 setApproveDate ($a_str)
 set date the user account was activated 0000-00-00 00:00:00 indicates that the user has not yet been activated public
 getApproveDate ()
 get the date when the user account was approved public
 getAgreeDate ()
 get the date when the user accepted the user agreement public
 setAgreeDate ($a_str)
 set date the user account was accepted by the user 0000-00-00 00:00:00 indicates that the user has not accepted his account public
 setActive ($a_active, $a_owner=6)
 set user active state and updates system fields appropriately public
 getActive ()
 get user active state public
 syncActive ()
 synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account public
 getStoredActive ($a_id)
 get user active state
 setSkin ($a_str)
 set user skin (template set) public
 setTimeLimitOwner ($a_owner)
 getTimeLimitOwner ()
 setTimeLimitFrom ($a_from)
 getTimeLimitFrom ()
 setTimeLimitUntil ($a_until)
 getTimeLimitUntil ()
 setTimeLimitUnlimited ($a_unlimited)
 getTimeLimitUnlimited ()
 setTimeLimitMessage ($a_time_limit_message)
 getTimeLimitMessage ()
 setLoginAttempts ($a_login_attempts)
 getLoginAttempts ()
 checkTimeLimit ()
 setProfileIncomplete ($a_prof_inc)
 getProfileIncomplete ()
 isPasswordChangeDemanded ()
 isPasswordExpired ()
 getPasswordAge ()
 setLastPasswordChangeToNow ()
 resetLastPasswordChange ()
 setLatitude ($a_latitude)
 Set Latitude.
 getLatitude ()
 Get Latitude.
 setLongitude ($a_longitude)
 Set Longitude.
 getLongitude ()
 Get Longitude.
 setLocationZoom ($a_locationzoom)
 Set Location Zoom.
 getLocationZoom ()
 Get Location Zoom.
getAppliedUsers ()
 isChild ($a_usr_id)
 __readAppliedUsers ($a_parent_id)
 checkUserId ()
 isCurrentUserActive ()
 getUserIdByLogin ($a_login)
 getLoginByUserId ($a_userid)
 getGroupMemberships ($a_user_id="")
 getCourseMemberships ($a_user_id="")
 _getNumberOfUsersForStyle ($a_skin, $a_style)
 skins and styles
 _getAllUserAssignedStyles ()
 skins and styles
 _moveUsersToStyle ($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
 skins and styles
 addDesktopItem ($a_item_id, $a_type, $a_par="")
 add an item to user's personal desktop
 setDesktopItemParameters ($a_item_id, $a_type, $a_par)
 set parameters of a desktop item entry
 dropDesktopItem ($a_item_id, $a_type)
 drop an item from user's personal desktop
 isDesktopItem ($a_item_id, $a_type)
 check wether an item is on the users desktop or not
 getDesktopItems ($a_types="")
 addObjectToClipboard ($a_item_id, $a_type, $a_title, $a_parent=0, $a_time=0, $a_order_nr=0)
 add an item to user's personal clipboard
 clipboardHasObjectsOfType ($a_type)
 Check whether clipboard has objects of a certain type.
 clipboardDeleteObjectsOfType ($a_type)
 Delete objects of type for user.
 getClipboardObjects ($a_type="", $a_top_nodes_only=false)
 get all clipboard objects of user and specified type
 getClipboardChilds ($a_parent, $a_insert_time)
 Get childs of an item.
 _getUsersForClipboadObject ($a_type, $a_id)
 get all users, that have a certain object within their clipboard
 removeObjectFromClipboard ($a_item_id, $a_type)
 remove object from user's personal clipboard
 _getImportedUserId ($i2_id)
 setAuthMode ($a_str)
 set auth mode public
 getAuthMode ($a_auth_key=false)
 get auth mode public
 setExternalAccount ($a_str)
 set external account
 getExternalAccount ()
 get external account
 _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode
 _getLocalAccountsForEmail ($a_email)
 check whether external account and authentication method matches with a user
 _uploadPersonalPicture ($tmp_file, $obj_id)
 Create a personal picture image file from a temporary image file.
 getPersonalPicturePath ($a_size="small", $a_force_pic=false)
 get path to personal picture
 _getPersonalPicturePath ($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
 get path to personal picture
 removeUserPicture ()
 Remove user picture.
 setUserDefinedData ($a_data)
 getUserDefinedData ()
 updateUserDefinedFields ()
 readUserDefinedFields ()
 addUserDefinedFieldEntry ()
 deleteUserDefinedFieldEntries ()
 getProfileAsString (&$a_language)
 Get formatted mail body text of user profile data.
 setInstantMessengerId ($a_im_type, $a_im_id)
 getInstantMessengerId ($a_im_type)
 setDelicious ($a_delicious)
 getDelicious ()
 _lookupFeedHash ($a_user_id, $a_create=false)
 Lookup news feed hash for user.
 _getFeedPass ($a_user_id)
 Lookup news feed password for user.
 _setFeedPass ($a_user_id, $a_password)
 Set news feed password for user.
 hasPublicProfile ()
 returns true if public is profile, false otherwise
 getPublicName ()
 returns firstname lastname and login if profile is public, login otherwise
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 read ($a_force_db=false)
 read object data from db into object
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 _lookupObjIdByImportId ($a_import_id)
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _getAllReferences ($a_id)
 get all reference ids of object
 _lookupTitle ($a_id)
 lookup object title
 _lookupDescription ($a_id)
 lookup object description
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _lookupObjId ($a_id)
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _lookupType ($a_id, $a_reference=false)
 lookup object type
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _lookupObjectId ($a_ref_id)
 lookup object id
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public
 createRoleFolder ()
 creates a local role folder
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts.
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone object permissions, put in tree ...
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies.
 cloneMetaData ($target_obj)
 Copy meta data.

Static Public Member Functions

static _hasAcceptedAgreement ($a_username)
 Check if user has accepted the agreement.
static lookupMatriculation ($a_usr_id)
 Lookup matriculation.
 _getUserIdsByEmail ($a_email)
 STATIC METHOD get all user_ids of an email address.
 getUserIdByEmail ($a_email)
 STATIC METHOD get the user_id of an email address.
 searchUsers ($a_search_str, $active=1, $a_return_ids_only=false, $filter_settings=FALSE)
 STATIC METHOD get the user_ids which correspond a search string.
 _search (&$a_search_obj, $active=1)
 STATIC METHOD search for user data.
 _getAllUserLogins (&$ilias)
 STATIC METHOD get all user logins.
static _readUsersProfileData ($a_user_ids)
 STATIC METHOD get user data of selected users.
 _getAllUserData ($a_fields=NULL, $active=-1)
 STATIC METHOD get all user data.
static _addDesktopItem ($a_usr_id, $a_item_id, $a_type, $a_par="")
 add an item to user's personal desktop
static _dropDesktopItem ($a_usr_id, $a_item_id, $a_type)
 drop an item from user's personal desktop
static _isDesktopItem ($a_usr_id, $a_item_id, $a_type)
 check wether an item is on the users desktop or not
static _lookupDesktopItems ($user_id, $a_types="")
 get all desktop items of user and specified type
static _getExternalAccountsByAuthMode ($a_auth_mode, $a_read_auth_default=false)
 Get list of external account by authentication method Note: If login == ext_account for two user with auth_mode 'default' and auth_mode 'ldap' The ldap auth mode chosen.
static _toggleActiveStatusOfUsers ($a_usr_ids, $a_status)
 Toggle active status of users.
static _lookupAuthMode ($a_usr_id)
 lookup auth mode
static _checkExternalAuthAccount ($a_auth, $a_account)
 check whether external account and authentication method matches with a user
static _loginExists ($a_login, $a_user_id=0)
 check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter public static
static _externalAccountExists ($a_external_account, $a_auth_mode)
 Check if an external account name already exists.
static _getUsersForRole ($role_id, $active=-1)
 return array of complete users which belong to a specific role
static _getUsersForFolder ($ref_id, $active)
 get users for a category or from system folder
static _getUsersForGroup ($a_mem_ids, $active=-1)
 return user data for group members
static _getUsersForIds ($a_mem_ids, $active=-1, $timelimitowner=-1)
 return user data for given user id
static _getUserData ($a_internalids)
 return user data for given user ids
static _getPreferences ($user_id)
 get preferences for user
static _resetLoginAttempts ($a_usr_id)
static _getLoginAttempts ($a_usr_id)
static _incrementLoginAttempts ($a_usr_id)
static _setUserInactive ($a_usr_id)
- Static Public Member Functions inherited from ilObject
static _getIdsForTitle ($title, $type= '')
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)

Data Fields

 $login
 all user related data in single vars public
 $passwd
 $passwd_type
 $gender
 $utitle
 $firstname
 $lastname
 $fullname
 $institution
 $department
 $street
 $city
 $zipcode
 $country
 $phone_office
 $phone_home
 $phone_mobile
 $fax
 $email
 $hobby
 $matriculation
 $referral_comment
 $approve_date
 $active
 $client_ip
 $auth_mode
 $im_icq
 $im_yahoo
 $im_msn
 $im_aim
 $im_skype
 $delicious
 $latitude
 $longitude
 $loc_zoom
 $last_password_change_ts
 $login_attempts
 $user_defined_data = array()
 $prefs
 $skin
 $default_role
 $ilias
- Data Fields inherited from ilObject
 $ilias
 $lng
 $id
 $ref_id
 $type
 $title
 $untranslatedTitle
 $desc
 $long_desc
 $owner
 $create_date
 $last_update
 $import_id
 $register = false
 $referenced
 $objectList
 $max_title
 $max_desc
 $add_dots
 $obj_data_record
 object_data record

Static Private Member Functions

static getLoginFromAuth ()
 Gets the username from $ilAuth, and converts it into an ILIAS login name.

Detailed Description

Definition at line 43 of file class.ilObjUser.php.

Member Function Documentation

ilObjUser::__readAppliedUsers (   $a_parent_id)

Definition at line 2397 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by getAppliedUsers(), and isChild().

{
global $ilDB;
$query = "SELECT usr_id FROM usr_data ".
"WHERE time_limit_owner = ".$ilDB->quote($a_parent_id);
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->applied_users[] = $row->usr_id;
// recursion
$this->__readAppliedUsers($row->usr_id);
}
return true;
}

+ Here is the caller graph for this function:

static ilObjUser::_addDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type,
  $a_par = "" 
)
static

add an item to user's personal desktop

Parameters
int$a_usr_idid of user object
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3070 of file class.ilObjUser.php.

References $d.

Referenced by ilParticipants\addDesktopItem(), addDesktopItem(), and ilUserImportParser\assignToRole().

{
global $ilDB;
$q = "SELECT * FROM desktop_item WHERE ".
"item_id = ".$ilDB->quote($a_item_id)." AND type = ".
$ilDB->quote($a_type)." AND user_id = ".
$ilDB->quote($a_usr_id);
$item_set = $ilDB->query($q);
// only insert if item is not already on desktop
if (!$d = $item_set->fetchRow())
{
$q = "INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES ".
" (".$ilDB->quote($a_item_id).",".
$ilDB->quote($a_type).",".
$ilDB->quote($a_usr_id).",".
$ilDB->quote($a_par).")";
$ilDB->query($q);
}
}

+ Here is the caller graph for this function:

static ilObjUser::_checkExternalAuthAccount (   $a_auth,
  $a_account 
)
static

check whether external account and authentication method matches with a user

Definition at line 3679 of file class.ilObjUser.php.

References $ilSetting, $res, ilAuthUtils\_getAuthModeName(), and DB_FETCHMODE_ASSOC.

Referenced by ilSoapAuthentication\__checkAgreement(), ilSoapAuthenticationCAS\authenticate(), ilAuthLDAP\extractUserName(), ilAuthContainerLDAP\extractUserName(), ShibAuth\generateLogin(), ilUserImportParser\importEndTag(), ilCASAuth\login(), ilAuthRadius\loginObserver(), ilAuthLDAP\loginObserver(), ilAuthContainerLDAP\loginObserver(), ilLDAPQuery\readUserData(), ilObjUserGUI\updateObjectOld(), ilAuthLDAP\updateRequired(), ilAuthContainerLDAP\updateRequired(), ilSOAPAuth\validateSOAPUser(), and ilUserImportParser\verifyEndTag().

{
global $ilDB,$ilSetting;
// Check directly with auth_mode
$r = $ilDB->query("SELECT * FROM usr_data WHERE ".
" ext_account = ".$ilDB->quote($a_account)." AND ".
" auth_mode = ".$ilDB->quote($a_auth));
if ($usr = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
return $usr["login"];
}
// For compatibility, check for login (no ext_account entry given)
$query = "SELECT login FROM usr_data ".
"WHERE login = ".$ilDB->quote($a_account)." ".
"AND auth_mode = ".$ilDB->quote($a_auth)." ";
$res = $ilDB->query($query);
if($res->numRows())
{
$usr = $res->fetchRow(DB_FETCHMODE_ASSOC);
return $usr['login'];
}
// If auth_default == $a_auth => check for login
if(ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode')) == $a_auth)
{
// First search for ext_account
$query = "SELECT login FROM usr_data ".
"WHERE ext_account = ".$ilDB->quote($a_account)." ".
"AND auth_mode = 'default'";
$res = $ilDB->query($query);
if ($usr = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
return $usr["login"];
}
// Search for login (no ext_account given)
$query = "SELECT login FROM usr_data ".
"WHERE (login =".$ilDB->quote($a_account)." AND ext_account = '') ".
"AND auth_mode = 'default'";
$res = $ilDB->query($query);
if ($usr = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
return $usr["login"];
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_checkPassword (   $a_usr_id,
  $a_pw 
)

Definition at line 1937 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilSOAPAuth\login().

{
global $ilDB;
$q = "SELECT passwd FROM usr_data ".
" WHERE usr_id = ".$ilDB->quote($a_usr_id);
$usr_set = $ilDB->query($q);
if($usr_rec = $usr_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($usr_rec["passwd"] == md5($a_pw))
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

static ilObjUser::_dropDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type 
)
static

drop an item from user's personal desktop

Parameters
int$a_usr_idid of user object
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3151 of file class.ilObjUser.php.

Referenced by ilParticipants\dropDesktopItem(), and dropDesktopItem().

{
global $ilDB;
$q = "DELETE FROM desktop_item WHERE ".
" item_id = ".$ilDB->quote($a_item_id)." AND ".
" type = ".$ilDB->quote($a_type)." AND ".
" user_id = ".$ilDB->quote($a_usr_id);
$ilDB->query($q);
}

+ Here is the caller graph for this function:

static ilObjUser::_externalAccountExists (   $a_external_account,
  $a_auth_mode 
)
static

Check if an external account name already exists.

public

Parameters
stringexternal account
stringauth mode

Definition at line 4296 of file class.ilObjUser.php.

References $res.

{
global $ilDB;
$query = "SELECT * FROM usr_data ".
"WHERE ext_account = ".$ilDB->quote($a_external_account)." ".
"AND auth_mode = ".$ilDB->quote($a_auth_mode);
$res = $ilDB->query($query);
return $res->numRows() ? true :false;
}
ilObjUser::_getAllUserAssignedStyles ( )

skins and styles

Definition at line 3018 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilObjStyleSettingsGUI\editSystemStylesObject(), and ilObjStyleSettingsGUI\saveStyleSettingsObject().

{
global $ilDB;
$q = "SELECT DISTINCT up1.value as style, up2.value as skin FROM usr_pref AS up1, usr_pref AS up2 ".
" WHERE up1.keyword= ".$ilDB->quote("style").
" AND up2.keyword= ".$ilDB->quote("skin").
" AND up1.usr_id = up2.usr_id ";
$sty_set = $ilDB->query($q);
$styles = array();
while($sty_rec = $sty_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$styles[] = $sty_rec["skin"].":".$sty_rec["style"];
}
return $styles;
}

+ Here is the caller graph for this function:

ilObjUser::_getAllUserData (   $a_fields = NULL,
  $active = -1 
)
static

STATIC METHOD get all user data.

Parameters
arraydesired columns
Returns
array of user data public

Definition at line 2890 of file class.ilObjUser.php.

References $_SESSION, $active, ilObject\$ref_id, and DB_FETCHMODE_ASSOC.

Referenced by ilObjUserFolderGUI\_addLearningProgressWorksheet(), ilLocalUser\_getUserData(), ilObjUserFolderGUI\learningProgressObject(), and ilObjUserFolderGUI\viewObject().

{
global $ilDB;
$result_arr = array();
if ($a_fields !== NULL and is_array($a_fields))
{
if (count($a_fields) == 0)
{
$select = "*";
}
else
{
if (($usr_id_field = array_search("usr_id",$a_fields)) !== false)
unset($a_fields[$usr_id_field]);
$select = implode(",",$a_fields).",usr_data.usr_id";
// online time
if(in_array('online_time',$a_fields))
{
$select .= ",ut_online.online_time ";
}
}
$q = "SELECT ".$select." FROM usr_data ";
// Add online_time if desired
// Need left join here to show users that never logged in
if(in_array('online_time',$a_fields))
{
$q .= "LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
}
switch ($active)
{
case 0:
case 1:
$q .= "WHERE active= ".$ilDB->quote($active);
break;
case 2:
$q .= "WHERE time_limit_unlimited='0'";
break;
case 3:
$qtemp = $q . ", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND object_data.title LIKE '%crs%' AND usr_data.usr_id = rbac_ua.usr_id";
$r = $ilDB->query($qtemp);
$course_users = array();
while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($course_users, $row["usr_id"]);
}
if (count($course_users))
{
$q .= " WHERE usr_data.usr_id NOT IN ('" . join($course_users, "','") . "')";
}
else
{
return $result_arr;
}
break;
case 4:
$date = strftime("%Y-%m-%d %H:%I:%S", mktime(0, 0, 0, $_SESSION["user_filter_data"]["m"], $_SESSION["user_filter_data"]["d"], $_SESSION["user_filter_data"]["y"]));
$q .= sprintf("WHERE last_login < %s", $ilDB->quote($date));
break;
case 5:
$ref_id = $_SESSION["user_filter_data"];
if ($ref_id)
{
$q .= " LEFT JOIN crs_members ON usr_data.usr_id = crs_members.usr_id WHERE crs_members.obj_id = (SELECT obj_id FROM object_reference WHERE ref_id = " .
$ilDB->quote($ref_id) . ")";
}
break;
case 6:
global $rbacreview;
$ref_id = $_SESSION["user_filter_data"];
if ($ref_id)
{
$rolf = $rbacreview->getRoleFolderOfObject($ref_id);
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
if (is_array($local_roles) && count($local_roles))
{
$role_ids = join("','", $local_roles);
$q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id IN ('" . $role_ids . "')";
}
}
break;
case 7:
$rol_id = $_SESSION["user_filter_data"];
if ($rol_id)
{
$q .= sprintf(" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = %s", $ilDB->quote($rol_id));;
}
break;
}
$r = $ilDB->query($q);
while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$result_arr[] = $row;
}
}
return $result_arr;
}

+ Here is the caller graph for this function:

ilObjUser::_getAllUserLogins ( $ilias)
static

STATIC METHOD get all user logins.

Parameters
iliasobject
Returns
array of logins public

Definition at line 2848 of file class.ilObjUser.php.

References $ilias, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilMail\__checkSystemRecipients().

{
$query = "SELECT login FROM usr_data ";
$res = $ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$logins[] = $row->login;
}
return $logins ? $logins : array();
}

+ Here is the caller graph for this function:

static ilObjUser::_getExternalAccountsByAuthMode (   $a_auth_mode,
  $a_read_auth_default = false 
)
static

Get list of external account by authentication method Note: If login == ext_account for two user with auth_mode 'default' and auth_mode 'ldap' The ldap auth mode chosen.

public

Parameters
stringauth_mode
boolalso get users with authentication method 'default'
Returns
array of external account names

Definition at line 3595 of file class.ilObjUser.php.

References $ilSetting, $res, ilAuthUtils\_getAuthModeName(), AUTH_LOCAL, and DB_FETCHMODE_OBJECT.

Referenced by ilLDAPCronSynchronization\deactivateUsers(), and ilLDAPRoleGroupMapping\initServers().

{
global $ilDB,$ilSetting;
include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
if($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode',AUTH_LOCAL)) == $a_auth_mode)
{
$or = "OR auth_mode = 'default' ";
}
else
{
$or = " ";
}
$query = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data ".
"WHERE auth_mode = ".$ilDB->quote($a_auth_mode)." ".
$or;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($row->auth_mode == 'default')
{
$accounts[$row->usr_id] = $row->login;
}
else
{
$accounts[$row->usr_id] = $row->ext_account;
}
}
return $accounts ? $accounts : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_getFeedPass (   $a_user_id)

Lookup news feed password for user.

Parameters
integeruser_id
Returns
string feed_password md5-encoded, or false

Definition at line 4210 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilPDNewsBlockGUI\editSettings().

{
global $ilDB;
if ($a_user_id > 0)
{
$query = "SELECT value from usr_pref WHERE usr_id = ".
$ilDB->quote($a_user_id) ." AND keyword=\"priv_feed_pass\"";
$set = $ilDB->query($query);
if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
return $rec["value"];
}
}
return false;
}

+ Here is the caller graph for this function:

ilObjUser::_getImportedUserId (   $i2_id)

Definition at line 3503 of file class.ilObjUser.php.

References ilObject\$id, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilGroupXMLParser\__parseId(), ilCourseXMLParser\__parseId(), ilForumImportParser\handlerBeginTag(), and ilMailImportParser\handlerBeginTag().

{
global $ilDB;
$query = "SELECT obj_id FROM object_data WHERE import_id = ".
$ilDB->quote($i2_id);
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$id = $row->obj_id;
}
return $id ? $id : 0;
}

+ Here is the caller graph for this function:

ilObjUser::_getLocalAccountsForEmail (   $a_email)

check whether external account and authentication method matches with a user

Definition at line 3754 of file class.ilObjUser.php.

References $ilSetting, and DB_FETCHMODE_ASSOC.

Referenced by ilSOAPAuth\login(), and ilStartUpGUI\showUserMappingSelection().

{
global $ilDB, $ilSetting;
// default set to local (1)?
$or_str = "";
if ($ilSetting->get("auth_mode") == 1)
{
$or_str = " OR auth_mode = ".$ilDB->quote("default");
}
$usr_set = $ilDB->query("SELECT * FROM usr_data WHERE ".
" email = ".$ilDB->quote($a_email)." AND ".
" (auth_mode = ".$ilDB->quote("local").$or_str.")");
$users = array();
while ($usr_rec = $usr_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$users[$usr_rec["usr_id"]] = $usr_rec["login"];
}
return $users;
}

+ Here is the caller graph for this function:

static ilObjUser::_getLoginAttempts (   $a_usr_id)
static

Definition at line 4512 of file class.ilObjUser.php.

References $login_attempts, and $result.

Referenced by ilInitialisation\initILIAS().

{
global $ilDB;
$query = "SELECT usr_data.login_attempts FROM usr_data WHERE usr_data.usr_id = ?";
$statement = $ilDB->prepare( $query, array('integer') );
$result = $ilDB->execute( $statement, array($a_usr_id) );
$record = $ilDB->fetchAssoc( $result );
$login_attempts = $record['login_attempts'];
}

+ Here is the caller graph for this function:

ilObjUser::_getNumberOfUsersForStyle (   $a_skin,
  $a_style 
)

skins and styles

Definition at line 2999 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilObjStyleSettingsGUI\editSystemStylesObject(), and ilObjStyleSettingsGUI\saveStyleSettingsObject().

{
global $ilDB;
$q = "SELECT count(*) as cnt FROM usr_pref AS up1, usr_pref AS up2 ".
" WHERE up1.keyword= ".$ilDB->quote("style")." AND up1.value= ".$ilDB->quote($a_style).
" AND up2.keyword= ".$ilDB->quote("skin")." AND up2.value= ".$ilDB->quote($a_skin).
" AND up1.usr_id = up2.usr_id ";
$cnt_set = $ilDB->query($q);
$cnt_rec = $cnt_set->fetchRow(DB_FETCHMODE_ASSOC);
return $cnt_rec["cnt"];
}

+ Here is the caller graph for this function:

ilObjUser::_getNumberOfUsersPerAuthMode ( )

get number of users per auth mode

Definition at line 3734 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilObjAuthSettingsGUI\authSettingsObject().

{
global $ilDB;
$r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data ".
"GROUP BY auth_mode");
$cnt_arr = array();
while($cnt = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$cnt_arr[$cnt["auth_mode"]] = $cnt["cnt"];
}
return $cnt_arr;
}

+ Here is the caller graph for this function:

ilObjUser::_getPersonalPicturePath (   $a_usr_id,
  $a_size = "small",
  $a_force_pic = false,
  $a_prevent_no_photo_image = false 
)

get path to personal picture

Parameters
stringsize "small", "xsmall" or "xxsmall" STATIC

Definition at line 3830 of file class.ilObjUser.php.

References $file, $res, DB_FETCHMODE_ASSOC, and ilUtil\getImagePath().

Referenced by ilLPListOfObjectsGUI\__showEditUser(), ilWikiRecentChangesTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilWikiContributorsTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilNoteGUI\getNoteListHTML(), getPersonalPicturePath(), ilObjUserGUI\initForm(), and ilLPUserItemListGUI\renderTypeImage().

{
global $ilDB;
// BEGIN DiskQuota: Fetch all user preferences in a single query
$query = "SELECT * FROM usr_pref WHERE ".
"keyword IN ('public_upload','public_profile') ".
"AND usr_id = ".$ilDB->quote($a_usr_id);
$res = $ilDB->query($query);
while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
switch ($row['keyword'])
{
case 'public_upload' :
$upload = $row['value'] == 'y';
break;
case 'public_profile' :
$profile = $row['value'] == 'y';
break;
}
}
// END DiskQuota: Fetch all user preferences in a single query
if(defined('ILIAS_MODULE'))
{
$webspace_dir = ('.'.$webspace_dir);
}
$webspace_dir .= ('./'.ilUtil::getWebspaceDir());
$image_dir = $webspace_dir."/usr_images";
// BEGIN DiskQuota: Support 'big' user images
if ($a_size == 'big')
{
$thumb_file = $image_dir."/usr_".$a_usr_id.".jpg";
}
else
{
$thumb_file = $image_dir."/usr_".$a_usr_id."_".$a_size.".jpg";
}
// END DiskQuota: Support 'big' user images
if((($upload && $profile) || $a_force_pic)
&& @is_file($thumb_file))
{
$file = $thumb_file."?t=".rand(1, 99999);
}
else
{
if (!$a_prevent_no_photo_image)
{
$file = ilUtil::getImagePath("no_photo_".$a_size.".jpg");
}
}
return $file;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjUser::_getPreferences (   $user_id)
static

get preferences for user

Parameters
int$user_id
Returns
array of keys (pref_keys) and values

Definition at line 4482 of file class.ilObjUser.php.

References $prefs, and DB_FETCHMODE_ASSOC.

Referenced by ilUserXMLWriter\__handleUser(), and readPrefs().

{
global $ilDB;
$prefs = array();
$q = "SELECT * FROM usr_pref WHERE usr_id = ".$ilDB->quote($user_id);
$r = $ilDB->query($q);
#echo $q;
while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$prefs[$row["keyword"]] = $row["value"];
} // while
return $prefs;
}

+ Here is the caller graph for this function:

static ilObjUser::_getUserData (   $a_internalids)
static

return user data for given user ids

Parameters
arrayof internal ids or numerics $a_internalids

Definition at line 4435 of file class.ilObjUser.php.

References $data, ilUtil\__extractId(), and DB_FETCHMODE_ASSOC.

Referenced by ilSoapUserAdministration\getUserXML().

{
global $ilDB;
$ids = array();
if (is_array($a_internalids)) {
foreach ($a_internalids as $internalid) {
if (is_numeric ($internalid))
{
$ids[] = $internalid;
}
else
{
$parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
if (is_numeric($parsedid) && $parsedid > 0)
{
$ids[] = $parsedid;
}
}
}
}
if (count($ids) == 0)
$ids [] = -1;
$query = "SELECT usr_data.*, usr_pref.value AS language
FROM usr_data
LEFT JOIN usr_pref
ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = 'language'
WHERE usr_data.usr_id IN (".join(",",$ids).")";
$query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
#echo $query;
$r = $ilDB->query($query);
$data = array();
while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$data[] = $row;
}
return $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_getUserIdsByEmail (   $a_email)
static

STATIC METHOD get all user_ids of an email address.

Parameters
stringemail of user
Returns
integer id of user public

Definition at line 2513 of file class.ilObjUser.php.

References $ilias, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

{
global $ilias, $ilDB;
$query = "SELECT login FROM usr_data ".
"WHERE email = ".$ilDB->quote($a_email)." and active=1";
$res = $ilias->db->query($query);
$ids = array ();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->login;
}
return $ids;
}

+ Here is the caller graph for this function:

ilObjUser::_getUsersForClipboadObject (   $a_type,
  $a_id 
)

get all users, that have a certain object within their clipboard

Parameters
string$a_typeobject type
string$a_typeobject type
Returns
array array of user IDs

Definition at line 3469 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilObjMediaObject\lookupUsages().

{
global $ilDB;
$q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE ".
"item_id = ".$ilDB->quote($a_id)." AND ".
"type = ".$ilDB->quote($a_type);
$user_set = $ilDB->query($q);
$users = array();
while ($user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$users[] = $user_rec["user_id"];
}
return $users;
}

+ Here is the caller graph for this function:

static ilObjUser::_getUsersForFolder (   $ref_id,
  $active 
)
static

get users for a category or from system folder

Parameters
$ref_idref id of object
$activecan be -1 (ignore), 1 = active, 0 = not active user

Definition at line 4352 of file class.ilObjUser.php.

References $active, $data, ilObject\$ref_id, $result, DB_FETCHMODE_ASSOC, and USER_FOLDER_ID.

Referenced by ilSoapUserAdministration\getUsersForContainer().

{
global $ilDB;
$data = array();
$query = "SELECT usr_data.*, usr_pref.value AS language FROM usr_data LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id and usr_pref.keyword = 'language' WHERE 1 ";
if (is_numeric($active) && $active > -1)
$query .= " AND usr_data.active = ".$ilDB->quote($active);
$query .= " AND usr_data.time_limit_owner = ".$ilDB->quote($ref_id);
$query .= " AND usr_data.usr_id != '".ANONYMOUS_USER_ID."'";
$query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
//echo $query;
$result = $ilDB->query($query);
$data = array();
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($data, $row);
}
return $data;
}

+ Here is the caller graph for this function:

static ilObjUser::_getUsersForGroup (   $a_mem_ids,
  $active = -1 
)
static

return user data for group members

Parameters
intarray of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

Definition at line 4383 of file class.ilObjUser.php.

References $active, and _getUsersForIds().

Referenced by ilSoapUserAdministration\getUsersForContainer().

{
return ilObjUser::_getUsersForIds($a_mem_ids, $active);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjUser::_getUsersForIds (   $a_mem_ids,
  $active = -1,
  $timelimitowner = -1 
)
static

return user data for given user id

Parameters
intarray of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

Definition at line 4394 of file class.ilObjUser.php.

References $active, DB_FETCHMODE_ASSOC, and USER_FOLDER_ID.

Referenced by _getUsersForGroup(), and ilSoapUserAdministration\getUsersForContainer().

{
global $rbacadmin, $rbacreview, $ilDB;
// quote all ids
$ids = array();
foreach ($a_mem_ids as $mem_id) {
$ids [] = $ilDB->quote($mem_id);
}
$query = "SELECT usr_data.*, usr_pref.value AS language
FROM usr_data
LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = 'language'
WHERE usr_data.usr_id IN (".implode(',',$ids).")
AND usr_data.usr_id != '".ANONYMOUS_USER_ID."'";
if (is_numeric($active) && $active > -1)
$query .= " AND active = '$active'";
if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1)
$query .= " AND usr_data.time_limit_owner = ".$ilDB->quote($timelimitowner);
$query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
$r = $ilDB->query($query);
while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$mem_arr[] = $row;
}
return $mem_arr ? $mem_arr : array();
}

+ Here is the caller graph for this function:

static ilObjUser::_getUsersForRole (   $role_id,
  $active = -1 
)
static

return array of complete users which belong to a specific role

Parameters
introle id
int$activeif -1, all users will be delivered, 0 only non active, 1 only active users

Definition at line 4314 of file class.ilObjUser.php.

References $active, $data, and DB_FETCHMODE_ASSOC.

Referenced by ilSoapUserAdministration\getUserForRole().

{
global $ilDB, $rbacreview;
$data = array();
$ids = $rbacreview->assignedUsers($role_id);
if (count ($ids) == 0)
$ids = array (-1);
$query = "SELECT usr_data.*, usr_pref.value AS language
FROM usr_data
LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = 'language'
WHERE usr_data.usr_id IN (".implode(',',$ids).")";
if (is_numeric($active) && $active > -1)
$query .= " AND usr_data.active = ".$ilDB->quote($active);
$query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
# echo $query;
$r = $ilDB->query($query);
$data = array();
while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$data[] = $row;
}
return $data;
}

+ Here is the caller graph for this function:

static ilObjUser::_hasAcceptedAgreement (   $a_username)
static

Check if user has accepted the agreement.

public

Parameters

Definition at line 1445 of file class.ilObjUser.php.

References $res.

Referenced by ilSoapAuthentication\__checkAgreement().

{
global $ilDB;
if($a_username == 'root')
{
return true;
}
$query = "SELECT usr_id FROM usr_data ".
"WHERE login = ".$ilDB->quote($a_username)." ".
"AND agree_date != '0000-00-00 00:00:00'";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

static ilObjUser::_incrementLoginAttempts (   $a_usr_id)
static

Definition at line 4525 of file class.ilObjUser.php.

Referenced by ilInitialisation\initILIAS().

{
global $ilDB;
$query = "UPDATE usr_data SET usr_data.login_attempts = (usr_data.login_attempts + 1) WHERE usr_data.usr_id = ?";
$statement = $ilDB->prepareManip( $query, array('integer') );
$affected = $ilDB->execute( $statement, array($a_usr_id) );
if($affected) return true;
else return false;
}

+ Here is the caller graph for this function:

static ilObjUser::_isDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type 
)
static

check wether an item is on the users desktop or not

Parameters
int$a_usr_idid of user object
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3191 of file class.ilObjUser.php.

References $d.

Referenced by ilParticipants\addDesktopItem(), ilParticipants\dropDesktopItem(), and isDesktopItem().

{
global $ilDB;
$q = "SELECT * FROM desktop_item WHERE ".
"item_id = ".$ilDB->quote($a_item_id)." AND type = ".
$ilDB->quote($a_type)." AND user_id = ".
$ilDB->quote($a_usr_id);
$item_set = $ilDB->query($q);
if ($d = $item_set->fetchRow())
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

static ilObjUser::_loginExists (   $a_login,
  $a_user_id = 0 
)
static

check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter public static

Parameters
stringlogin name
integeruser id of user to exclude (optional)
Returns
boolean

Definition at line 4262 of file class.ilObjUser.php.

Referenced by ilMail\__substituteRecipients(), ilSoapUserAdministration\__validateUserData(), ilUserLoginInputGUI\checkInput(), ilRegistrationGUI\saveForm(), and ilObjUserGUI\updateObjectOld().

{
global $ilDB;
if ($a_user_id == 0)
{
$clause = "";
}
else
{
$clause = "AND usr_id != ".$ilDB->quote($a_user_id)." ";
}
$q = "SELECT DISTINCT login FROM usr_data ".
"WHERE login = ".$ilDB->quote($a_login)." ".$clause;
$r = $ilDB->query($q);
if ($r->numRows() == 1)
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilObjUser::_lookupAuthMode (   $a_usr_id)
static

lookup auth mode

public

Parameters
intusr_id

Definition at line 3659 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilECSAppEventListener\handleEvent().

{
global $ilDB;
$query = "SELECT auth_mode FROM usr_data ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->auth_mode;
}
return '';
}

+ Here is the caller graph for this function:

ilObjUser::_lookupClientIP (   $a_user_id)

Definition at line 687 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilObjTest\inviteGroup(), and ilObjTest\inviteRole().

{
global $ilDB;
$query = "SELECT client_ip FROM usr_data WHERE usr_id = ".
$ilDB->quote((int) $a_user_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->client_ip;
}
return "";
}

+ Here is the caller graph for this function:

static ilObjUser::_lookupDesktopItems (   $user_id,
  $a_types = "" 
)
static

get all desktop items of user and specified type

note: the implementation of this method is not good style (directly reading tables object_data and object_reference), must be revised someday...

Definition at line 3250 of file class.ilObjUser.php.

References ilObject\$desc, ilObject\$title, ilObject\_lookupDescription(), ilObject\_lookupTitle(), and DB_FETCHMODE_ASSOC.

Referenced by ilNewsItem\_getNewsItemsOfUser(), getDesktopItems(), and ilCalendarCategories\readSelectedItemCalendars().

{
global $ilUser, $rbacsystem, $tree, $ilDB;
if ($a_types == "")
{
$q = "SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type ".
" FROM desktop_item AS it, object_reference AS oref ".
", object_data AS obj".
" WHERE ".
"it.item_id = oref.ref_id AND ".
"oref.obj_id = obj.obj_id AND ".
"it.user_id = ".$ilDB->quote($user_id);
$item_set = $ilDB->query($q);
$items = array();
while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($tree->isInTree($item_rec["ref_id"])
&& $item_rec["type"] != "rolf")
{
$parent_ref = $tree->getParentId($item_rec["ref_id"]);
$par_left = $tree->getLeftValue($parent_ref);
$par_left = sprintf("%010d", $par_left);
$title = ilObject::_lookupTitle($item_rec["obj_id"]);
$desc = ilObject::_lookupDescription($item_rec["obj_id"]);
$items[$par_left.$title.$item_rec["ref_id"]] =
array("ref_id" => $item_rec["ref_id"],
"obj_id" => $item_rec["obj_id"],
"type" => $item_rec["type"],
"title" => $title,
"description" => $desc,
"parent_ref" => $parent_ref);
}
}
ksort($items);
}
else
{
if (!is_array($a_types))
{
$a_types = array($a_types);
}
$items = array();
$foundsurveys = array();
foreach($a_types as $a_type)
{
$q = "SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item AS it, object_reference AS oref ".
", object_data AS obj WHERE ".
"it.item_id = oref.ref_id AND ".
"oref.obj_id = obj.obj_id AND ".
"it.type = ".$ilDB->quote($a_type)." AND ".
"it.user_id = ".$ilDB->quote($user_id)." ".
"ORDER BY title";
$item_set = $ilDB->query($q);
while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$title = ilObject::_lookupTitle($item_rec["obj_id"]);
$desc = ilObject::_lookupDescription($item_rec["obj_id"]);
$items[$title.$a_type.$item_rec["ref_id"]] =
array("ref_id" => $item_rec["ref_id"],
"obj_id" => $item_rec["obj_id"], "type" => $a_type,
"title" => $title, "description" => $desc);
}
}
ksort($items);
}
return $items;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_lookupEmail (   $a_user_id)

Definition at line 658 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilMail\distributeMail(), ilMailOptions\getOptions(), ilCronMailNotification\sendNotifications(), ilPersonalProfileGUI\showMailOptions(), ilMailOptionsGUI\showOptions(), and ilMailSearchGUI\showResults().

{
global $ilDB;
$query = "SELECT email FROM usr_data WHERE usr_id = ".$ilDB->quote((int) $a_user_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->email;
}
return false;
}

+ Here is the caller graph for this function:

ilObjUser::_lookupExternalAccount (   $a_user_id)

lookup external account for login and authmethod

Definition at line 751 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilUserImportParser\importEndTag(), and ilUserImportParser\verifyEndTag().

{
global $ilDB;
$q = "SELECT ext_account FROM usr_data".
" WHERE usr_id =".$ilDB->quote($a_user_id);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return $user_rec["ext_account"];
}

+ Here is the caller graph for this function:

ilObjUser::_lookupFeedHash (   $a_user_id,
  $a_create = false 
)

Lookup news feed hash for user.

If hash does not exist, create one.

Definition at line 4175 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilUserFeedWriter\ilUserFeedWriter().

{
global $ilDB;
if ($a_user_id > 0)
{
$query = "SELECT feed_hash from usr_data WHERE usr_id = ".
$ilDB->quote($a_user_id);
$set = $ilDB->query($query);
if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
if (strlen($rec["feed_hash"]) == 32)
{
return $rec["feed_hash"];
}
else if($a_create)
{
$hash = md5(rand(1,9999999) + str_replace(" ", "", (string) microtime()));
$query = "UPDATE usr_data SET feed_hash = ".
$ilDB->quote($hash).
" WHERE usr_id = ".$ilDB->quote($a_user_id);
$ilDB->query($query);
return $hash;
}
}
}
return false;
}

+ Here is the caller graph for this function:

ilObjUser::_lookupFields (   $a_user_id)

lookup user name

Definition at line 723 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilTestExport\exportToCSV(), ilTestExport\exportToExcel(), ilSpecialUsersTableGUI\fillRow(), ilTestCertificate\outCertificate(), and ilTestEvaluationGUI\outEvaluation().

{
global $ilDB;
$q = "SELECT * FROM usr_data".
" WHERE usr_id =".$ilDB->quote($a_user_id);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return $user_rec;
}

+ Here is the caller graph for this function:

ilObjUser::_lookupGender (   $a_user_id)

Definition at line 672 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT gender FROM usr_data WHERE usr_id = ".
$ilDB->quote((int) $a_user_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->gender;
}
return false;
}
ilObjUser::_lookupHasIlias2Password (   $a_user_login)

check if user has ilias 2 password (imported user)

Definition at line 948 of file class.ilObjUser.php.

References $ilias, and DB_FETCHMODE_ASSOC.

Referenced by ilInitialisation\initILIAS().

{
global $ilias, $ilDB;
$q = "SELECT i2passwd FROM usr_data ".
"WHERE login = ".$ilDB->quote($a_user_login)."";
$user_set = $ilias->db->query($q);
if ($user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($user_rec["i2passwd"] != "")
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

ilObjUser::_lookupId (   $a_user_str)

lookup id by login

Definition at line 765 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilSoapObjectAdministration\addObject(), ilPermissionGUI\changeOwner(), ilMailAddressbookGUI\checkInput(), ilMail\formatNamesForOutput(), ilObjectStatusGUI\ilObjectStatusGUI(), ilInitialisation\initILIAS(), ilStartUpGUI\migrateAccount(), ilSoapRBACAdministration\parseUserID(), ilRegistrationSettings\setApproveRecipientLogins(), ilMailSearchGUI\showResults(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

{
global $ilDB;
$q = "SELECT usr_id FROM usr_data".
" WHERE login =".$ilDB->quote($a_user_str);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return $user_rec["usr_id"];
}

+ Here is the caller graph for this function:

ilObjUser::_lookupLanguage (   $a_usr_id)

Definition at line 1921 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilRegistrationGUI\__distributeMails(), and ilForum\_getLanguageInstanceByUsrId().

{
global $ilDB;
$q = "SELECT value FROM usr_pref WHERE usr_id= ".
$ilDB->quote($a_usr_id)." AND keyword = 'language'";
$r = $ilDB->query($q);
while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
return $row['value'];
}
return 'en';
}

+ Here is the caller graph for this function:

ilObjUser::_lookupLastLogin (   $a_user_id)

lookup last login

Definition at line 779 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilLPItemListGUI\renderObjectInfoXML().

{
global $ilDB;
$q = "SELECT last_login FROM usr_data".
" WHERE usr_id =".$ilDB->quote($a_user_id);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return $user_rec["last_login"];
}

+ Here is the caller graph for this function:

ilObjUser::_lookupLogin (   $a_user_id)

lookup login

Definition at line 737 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilRegistrationGUI\__distributeMails(), ilCourseXMLParser\__parseId(), ilRegistrationSettings\__read(), ilGroupRegistrationGUI\add(), ilPaymentStatisticGUI\addStatisticWorksheet(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilObjGroupGUI\assignSubscribersObject(), ilLMStatistics\calcStats(), ilObjTestGUI\deleteSingleUserResultsObject(), ilObjSurvey\disinviteUser(), ilFileDataExercise\downloadAllDeliveredFiles(), ilObjUserGUI\editOldObject(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilWikiRecentChangesTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilHistoryGUI\getHistoryTable(), ilDAVServer\getLogin(), ilObjExercise\getMemberListData(), ilChatRecording\getModerator(), ilNoteGUI\getNoteListHTML(), ilObjForumListGUI\getProperties(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilTestServiceGUI\getResultsUserdata(), ilObjSCORM2004LearningModule\getTrackedUsers(), ilObjSurvey\getUserDataFromActiveId(), ilObjUserGUI\getValues(), ilObjSurvey\inviteGroup(), ilObjChatGUI\invitePDObject(), ilObjSurvey\inviteRole(), ilObjSurvey\inviteUser(), ilSessionOverviewGUI\listSessions(), ilSOAPAuth\login(), ilMailSearchGroupsGUI\mailMembers(), ilMailSearchCoursesGUI\mailMembers(), ilObjSurveyGUI\outUserGroupTable(), ilPermissionGUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilObjSessionGUI\printAttendanceListObject(), ilObjSessionGUI\printViewMembersObject(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilObjExerciseGUI\redirectFeedbackMailObject(), ilObjGroupGUI\refuseSubscribersObject(), ilLPItemListGUI\renderObjectInfoXML(), ilForum\sendForumNotifications(), ilCronForumNotification\sendMails(), ilObjCourseGUI\sendMailToSelectedUsersObject(), ilObjGroupGUI\sendMailToSelectedUsersObject(), ilForum\sendPostActivationNotification(), ilForum\sendThreadNotifications(), ilObjSurvey\setInvitation(), ilPaymentCouponGUI\showCoupons(), ilMailSearchCoursesGUI\showMembers(), ilPageObjectGUI\showPage(), ilMailSearchGUI\showResults(), ilPaymentStatisticGUI\showStatistics(), ilMailFolderGUI\showUser(), ilUsersOnlineBlockGUI\showUserProfile(), ilObjPaymentSettingsGUI\statisticObject(), and ilUserImportParser\verifyEndTag().

{
global $ilDB;
$q = "SELECT login FROM usr_data".
" WHERE usr_id =".$ilDB->quote($a_user_id);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return $user_rec["login"];
}

+ Here is the caller graph for this function:

ilObjUser::_lookupName (   $a_user_id)

lookup user name

Definition at line 706 of file class.ilObjUser.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilPDFPresentation\__addMain(), ilGroupXMLParser\__parseId(), ilObjExerciseGUI\__saveStatus(), ilObjTestAccess\_getParticipantData(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilObjTestGUI\deleteSingleUserResultsObject(), ilFileDataExercise\downloadAllDeliveredFiles(), ilExerciseMembers\downloadMultipleFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilWikiRecentChangesTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilObjUserTracking\getAccessPerUserDetail(), ilObjUserTracking\getAccessTotalPerUser(), ilHistoryGUI\getHistoryTable(), ilObjExercise\getMemberListData(), ilPageObject\getPageContributors(), ilPageObject\getParentObjectContributors(), ilObjSCORM2004LearningModule\getTrackedUsers(), ilHistoryGUI\getVersionsTable(), ilSessionOverviewGUI\listSessions(), ilObjAssessmentFolderGUI\logsObject(), ilCalendarSharedUserListTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilObjSessionGUI\printAttendanceListObject(), ilObjSessionGUI\printViewMembersObject(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilMailSearchCoursesGUI\showMembers(), ilPageObjectGUI\showPage(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), and ilObjTest\userLookupFullName().

{
global $ilDB;
$q = "SELECT firstname, lastname, title FROM usr_data".
" WHERE usr_id =".$ilDB->quote($a_user_id);
$user_set = $ilDB->query($q);
$user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC);
return array("user_id" => $a_user_id,
"firstname" => $user_rec["firstname"],
"lastname" => $user_rec["lastname"],
"title" => $user_rec["title"]);
}

+ Here is the caller graph for this function:

ilObjUser::_lookupPref (   $a_usr_id,
  $a_keyword 
)

Definition at line 1169 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilNewsItem\_getNewsItemsOfUser(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilPDMailBlockGUI\fillRow(), ilMail\formatNamesForOutput(), ilUsersOnlineBlockGUI\getListRowData(), ilPDMailGUI\getPDMailHTML(), ilObjForumListGUI\getProperties(), ilForum\getUserData(), ilMailFolderGUI\showFolder(), ilMailFolderGUI\showMail(), ilMailSearchGroupsGUI\showMembers(), ilMailSearchCoursesGUI\showMembers(), and ilMailSearchGUI\showResults().

{
global $ilDB;
$query = "SELECT * FROM usr_pref WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND keyword = ".$ilDB->quote($a_keyword);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->value;
}
return false;
}

+ Here is the caller graph for this function:

ilObjUser::_makeIlias2Password (   $a_passwd)

get encrypted Ilias 2 password (needed for imported ilias 2 users)

Definition at line 940 of file class.ilObjUser.php.

Referenced by _switchToIlias3Password(), and updatePassword().

{
return (crypt($a_passwd,substr($a_passwd,0,2)));
}

+ Here is the caller graph for this function:

ilObjUser::_moveUsersToStyle (   $a_from_skin,
  $a_from_style,
  $a_to_skin,
  $a_to_style 
)

skins and styles

Definition at line 3042 of file class.ilObjUser.php.

References _writePref(), and DB_FETCHMODE_ASSOC.

Referenced by ilObjStyleSettingsGUI\saveStyleSettingsObject().

{
global $ilDB;
$q = "SELECT up1.usr_id as usr_id FROM usr_pref AS up1, usr_pref AS up2 ".
" WHERE up1.keyword= ".$ilDB->quote("style")." AND up1.value= ".$ilDB->quote($a_from_style).
" AND up2.keyword= ".$ilDB->quote("skin")." AND up2.value= ".$ilDB->quote($a_from_skin).
" AND up1.usr_id = up2.usr_id ";
$usr_set = $ilDB->query($q);
while ($usr_rec = $usr_set->fetchRow(DB_FETCHMODE_ASSOC))
{
ilObjUser::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
ilObjUser::_writePref($usr_rec["usr_id"], "style", $a_to_style);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjUser::_readUsersProfileData (   $a_user_ids)
static

STATIC METHOD get user data of selected users.

Parameters
arraydesired user ids
Returns
array of user data public

Definition at line 2868 of file class.ilObjUser.php.

References $res, DB_FETCHMODE_ASSOC, and ilUtil\quoteArray().

Referenced by ilMemberExport\fetchUsers().

{
global $ilDB;
$where = ("WHERE usr_id IN(".implode(",",ilUtil::quoteArray($a_user_ids)).") ");
$query = "SELECT * FROM usr_data ".$where;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$user_data["$row[usr_id]"] = $row;
}
return $user_data ? $user_data : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjUser::_resetLoginAttempts (   $a_usr_id)
static

Definition at line 4500 of file class.ilObjUser.php.

Referenced by ilInitialisation\initILIAS(), and ilObjUserGUI\updateObject().

{
global $ilDB;
$query = "UPDATE usr_data SET usr_data.login_attempts = 0 WHERE usr_data.usr_id = ?";
$statement = $ilDB->prepareManip( $query, array('integer') );
$affected = $ilDB->execute( $statement, array($a_usr_id) );
if($affected) return true;
else return false;
}

+ Here is the caller graph for this function:

ilObjUser::_search ( $a_search_obj,
  $active = 1 
)
static

STATIC METHOD search for user data.

This method is called from class.ilSearch

Parameters
objectobject of search class public

Definition at line 2706 of file class.ilObjUser.php.

References $active, $ilBench, $in, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilSearch\performSearch().

{
global $ilBench, $ilDB;
// NO CLASS VARIABLES IN STATIC METHODS
// TODO: CHECK IF ITEMS ARE PUBLIC VISIBLE
$where_condition = $a_search_obj->getWhereCondition("like",array("login","firstname","lastname","title",
"email","institution","street","city",
"zipcode","country","phone_home","fax"));
$in = $a_search_obj->getInStatement("usr_data.usr_id");
$query = "SELECT DISTINCT(usr_data.usr_id) FROM usr_data ".
"LEFT JOIN usr_pref USING (usr_id) ".
$where_condition." ".
$in." ".
"AND usr_data.usr_id != '".ANONYMOUS_USER_ID."' ";
# "AND usr_pref.keyword = 'public_profile' ";
# "AND usr_pref.value = 'y'";
if (is_numeric($active) && $active > -1)
$query .= "AND active = ".$ilDB->quote($active);
$ilBench->start("Search", "ilObjUser_search");
$res = $a_search_obj->ilias->db->query($query);
$ilBench->stop("Search", "ilObjUser_search");
$counter = 0;
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$result_data[$counter++]["id"] = $row->usr_id;
}
return $result_data ? $result_data : array();
}

+ Here is the caller graph for this function:

ilObjUser::_setFeedPass (   $a_user_id,
  $a_password 
)

Set news feed password for user.

Parameters
integeruser_id
stringnew password

Definition at line 4233 of file class.ilObjUser.php.

References $data.

{
global $ilDB;
if ($a_user_id > 0 )
{
if ($a_password=="")
{
$statement = $ilDB->prepare("REPLACE INTO usr_pref (usr_id,keyword,value) VALUES (? ,? , ?)");
$data = array($a_user_id, "priv_feed_pass", "");
}
else
{
$statement = $ilDB->prepare("REPLACE INTO usr_pref (usr_id,keyword,value) VALUES (? ,? , ?)");
$data = array($a_user_id, "priv_feed_pass", md5($a_password));
}
$statement->execute($data);
}
}
static ilObjUser::_setUserInactive (   $a_usr_id)
static

Definition at line 4537 of file class.ilObjUser.php.

Referenced by ilInitialisation\initILIAS().

{
global $ilDB;
$query = "UPDATE usr_data SET usr_data.active = 0 WHERE usr_data.usr_id = ?";
$statement = $ilDB->prepareManip( $query, array('integer') );
$affected = $ilDB->execute( $statement, array($a_usr_id) );
if($affected) return true;
else return false;
}

+ Here is the caller graph for this function:

ilObjUser::_switchToIlias3Password (   $a_user,
  $a_pw 
)

Definition at line 967 of file class.ilObjUser.php.

References $ilias, _makeIlias2Password(), and DB_FETCHMODE_ASSOC.

Referenced by ilInitialisation\initILIAS().

{
global $ilias, $ilDB;
$q = "SELECT i2passwd FROM usr_data ".
"WHERE login = ".$ilDB->quote($a_user);
$user_set = $ilias->db->query($q);
if ($user_rec = $user_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($user_rec["i2passwd"] == ilObjUser::_makeIlias2Password($a_pw))
{
$q = "UPDATE usr_data SET passwd= ".$ilDB->quote(md5($a_pw)).", i2passwd=''".
"WHERE login = ".$ilDB->quote($a_user);
$ilias->db->query($q);
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjUser::_toggleActiveStatusOfUsers (   $a_usr_ids,
  $a_status 
)
static

Toggle active status of users.

public

Parameters

Definition at line 3634 of file class.ilObjUser.php.

References ilUtil\quoteArray().

Referenced by ilLDAPCronSynchronization\deactivateUsers().

{
global $ilDB;
if(!is_array($a_usr_ids))
{
return false;
}
$where = ("WHERE usr_id IN(".implode(",",ilUtil::quoteArray($a_usr_ids)).") ");
$query = "UPDATE usr_data SET active = ".$ilDB->quote($a_status ? 1 : 0)." ".
$where;
$ilDB->query($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_uploadPersonalPicture (   $tmp_file,
  $obj_id 
)

Create a personal picture image file from a temporary image file.

Parameters
string$tmp_fileComplete path to the temporary image file
int$obj_idThe object id of the related user account
Returns
returns TRUE on success, otherwise FALSE

Definition at line 3787 of file class.ilObjUser.php.

References _writePref(), ilUtil\getConvertCmd(), and ilUtil\getWebspaceDir().

Referenced by ilUserImportParser\importEndTag().

{
$webspace_dir = ilUtil::getWebspaceDir();
$image_dir = $webspace_dir."/usr_images";
$store_file = "usr_".$obj_id."."."jpg";
$target_file = $image_dir."/$store_file";
chmod($tmp_file, 0770);
// take quality 100 to avoid jpeg artefacts when uploading jpeg files
// taking only frame [0] to avoid problems with animated gifs
$show_file = "$image_dir/usr_".$obj_id.".jpg";
$thumb_file = "$image_dir/usr_".$obj_id."_small.jpg";
$xthumb_file = "$image_dir/usr_".$obj_id."_xsmall.jpg";
$xxthumb_file = "$image_dir/usr_".$obj_id."_xxsmall.jpg";
system(ilUtil::getConvertCmd()." $tmp_file" . "[0] -geometry 200x200 -quality 100 JPEG:$show_file");
system(ilUtil::getConvertCmd()." $tmp_file" . "[0] -geometry 100x100 -quality 100 JPEG:$thumb_file");
system(ilUtil::getConvertCmd()." $tmp_file" . "[0] -geometry 75x75 -quality 100 JPEG:$xthumb_file");
system(ilUtil::getConvertCmd()." $tmp_file" . "[0] -geometry 30x30 -quality 100 JPEG:$xxthumb_file");
// store filename
ilObjUser::_writePref($obj_id, "profile_image", $store_file);
return TRUE;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::_writeAuthMode (   $a_usr_id,
  $a_auth_mode 
)

Definition at line 1965 of file class.ilObjUser.php.

Referenced by ilSOAPAuth\login().

{
global $ilDB;
$q = "UPDATE usr_data ".
" SET auth_mode = ".$ilDB->quote($a_auth_mode).
" WHERE usr_id = ".$ilDB->quote($a_usr_id);
$usr_set = $ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjUser::_writeExternalAccount (   $a_usr_id,
  $a_ext_id 
)

Definition at line 1955 of file class.ilObjUser.php.

Referenced by ilSOAPAuth\login().

{
global $ilDB;
$q = "UPDATE usr_data ".
" SET ext_account = ".$ilDB->quote($a_ext_id).
" WHERE usr_id = ".$ilDB->quote($a_usr_id);
$usr_set = $ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjUser::_writePref (   $a_usr_id,
  $a_keyword,
  $a_value 
)

Definition at line 1050 of file class.ilObjUser.php.

Referenced by _moveUsersToStyle(), _uploadPersonalPicture(), ilContainerObjectiveGUI\initDetails(), ilCourseObjectivePresentationGUI\reset(), and writePref().

{
global $ilDB;
$query = "";
if (strlen($a_value))
{
$query = sprintf("REPLACE INTO usr_pref VALUES (%s, %s, %s)",
$ilDB->quote($a_usr_id),
$ilDB->quote($a_keyword),
$ilDB->quote($a_value)
);
}
else
{
$query = sprintf("DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s",
$ilDB->quote($a_usr_id),
$ilDB->quote($a_keyword)
);
}
$ilDB->query($query);
}

+ Here is the caller graph for this function:

ilObjUser::addDesktopItem (   $a_item_id,
  $a_type,
  $a_par = "" 
)

add an item to user's personal desktop

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3099 of file class.ilObjUser.php.

References _addDesktopItem(), and ilObject\getId().

{
ilObjUser::_addDesktopItem($this->getId(), $a_item_id, $a_type, $a_par);
/* global $ilDB;
$q = "SELECT * FROM desktop_item WHERE ".
"item_id = ".$ilDB->quote($a_item_id)." AND type = ".
$ilDB->quote($a_type)." AND user_id = ".
$ilDB->quote($this->getId());
$item_set = $this->ilias->db->query($q);
// only insert if item is not already on desktop
if (!$d = $item_set->fetchRow())
{
$q = "INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES ".
" (".$ilDB->quote($a_item_id).",".
$ilDB->quote($a_type).",".
$ilDB->quote($this->getId()).",".
$ilDB->quote($a_par).")";
$this->ilias->db->query($q);
}
*/ }

+ Here is the call graph for this function:

ilObjUser::addObjectToClipboard (   $a_item_id,
  $a_type,
  $a_title,
  $a_parent = 0,
  $a_time = 0,
  $a_order_nr = 0 
)

add an item to user's personal clipboard

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3331 of file class.ilObjUser.php.

References $d, and ilObject\getId().

{
global $ilDB;
if ($a_time == 0)
{
$a_time = date("Y-m-d H:i:s", time());
}
$st = $ilDB->prepare("SELECT * FROM personal_clipboard WHERE ".
"parent = ? AND item_id = ? AND type = ? AND user_id = ?",
array("integer", "integer", "text", "integer"));
$item_set = $ilDB->execute($st,
array(0, $a_item_id, $a_type, $this->getId()));
// only insert if item is not already in clipboard
if (!$d = $item_set->fetchRow())
{
$st = $ilDB->prepareManip("INSERT INTO personal_clipboard ".
"(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ".
" (?,?,?,?,?,?,?)",
array("integer", "text", "integer", "text", "integer", "timestamp", "integer"));
$ilDB->execute($st,
array($a_item_id, $a_type, $this->getId(), $a_title, $a_parent, $a_time, $a_order_nr));
}
else
{
$st = $ilDB->prepareManip("UPDATE personal_clipboard SET insert_time = ? ".
"WHERE user_id = ? AND item_id = ? AND type = ? AND parent = 0",
array("timestamp", "integer", "integer", "text"));
$ilDB->execute($st, array($a_time, $this->getId(), $a_item_id, $a_type));
}
}

+ Here is the call graph for this function:

ilObjUser::addUserDefinedFieldEntry ( )

Definition at line 3988 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by saveAsNew().

{
global $ilDB;
$query = "INSERT INTO usr_defined_data ".
"SET usr_id = ".$ilDB->quote($this->getId());
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::assignData (   $a_data)

loads a record "user" from array public

Parameters
arrayuserdata

Definition at line 283 of file class.ilObjUser.php.

References $ilErr, setAuthMode(), setCity(), setClientIP(), setComment(), setCountry(), setDelicious(), setDepartment(), setEmail(), setExternalAccount(), setFax(), setFirstname(), setFullname(), setGender(), setHobby(), setInstantMessengerId(), setInstitution(), setLastLogin(), setLastname(), setLastUpdate(), setLatitude(), setLocationZoom(), setLogin(), setLongitude(), setMatriculation(), setPasswd(), setPhoneHome(), setPhoneMobile(), setPhoneOffice(), setProfileIncomplete(), setStreet(), setTimeLimitFrom(), setTimeLimitMessage(), setTimeLimitOwner(), setTimeLimitUnlimited(), setTimeLimitUntil(), setUTitle(), and setZipcode().

Referenced by read().

{
global $ilErr;
// basic personal data
$this->setLogin($a_data["login"]);
if (! $a_data["passwd_type"])
{
$ilErr->raiseError("<b>Error: passwd_type missing in function assignData(). ".
$this->id."!</b><br />class: ".get_class($this)."<br />Script: "
.__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
}
if ($a_data["passwd"] != "********" and strlen($a_data['passwd']))
{
$this->setPasswd($a_data["passwd"], $a_data["passwd_type"]);
}
$this->setGender($a_data["gender"]);
$this->setUTitle($a_data["title"]);
$this->setFirstname($a_data["firstname"]);
$this->setLastname($a_data["lastname"]);
$this->setFullname();
// address data
$this->setInstitution($a_data["institution"]);
$this->setDepartment($a_data["department"]);
$this->setStreet($a_data["street"]);
$this->setCity($a_data["city"]);
$this->setZipcode($a_data["zipcode"]);
$this->setCountry($a_data["country"]);
$this->setPhoneOffice($a_data["phone_office"]);
$this->setPhoneHome($a_data["phone_home"]);
$this->setPhoneMobile($a_data["phone_mobile"]);
$this->setFax($a_data["fax"]);
$this->setMatriculation($a_data["matriculation"]);
$this->setEmail($a_data["email"]);
$this->setHobby($a_data["hobby"]);
$this->setClientIP($a_data["client_ip"]);
// instant messenger data
$this->setInstantMessengerId('icq',$a_data["im_icq"]);
$this->setInstantMessengerId('yahoo',$a_data["im_yahoo"]);
$this->setInstantMessengerId('msn',$a_data["im_msn"]);
$this->setInstantMessengerId('aim',$a_data["im_aim"]);
$this->setInstantMessengerId('skype',$a_data["im_skype"]);
// other data
$this->setDelicious($a_data["delicious"]);
$this->setLatitude($a_data["latitude"]);
$this->setLongitude($a_data["longitude"]);
$this->setLocationZoom($a_data["loc_zoom"]);
// system data
$this->setLastLogin($a_data["last_login"]);
$this->setLastUpdate($a_data["last_update"]);
$this->create_date = $a_data["create_date"];
$this->setComment($a_data["referral_comment"]);
$this->approve_date = $a_data["approve_date"];
$this->active = $a_data["active"];
$this->agree_date = $a_data["agree_date"];
// time limitation
$this->setTimeLimitOwner($a_data["time_limit_owner"]);
$this->setTimeLimitUnlimited($a_data["time_limit_unlimited"]);
$this->setTimeLimitFrom($a_data["time_limit_from"]);
$this->setTimeLimitUntil($a_data["time_limit_until"]);
$this->setTimeLimitMessage($a_data['time_limit_message']);
// user profile incomplete?
$this->setProfileIncomplete($a_data["profile_incomplete"]);
//iLinc
//$this->setiLincData($a_data['ilinc_id'],$a_data['ilinc_login'],$a_data['ilinc_passwd']);
//authentication
$this->setAuthMode($a_data['auth_mode']);
$this->setExternalAccount($a_data['ext_account']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::checkTimeLimit ( )

Definition at line 2225 of file class.ilObjUser.php.

References getTimeLimitFrom(), getTimeLimitUnlimited(), and getTimeLimitUntil().

{
if($this->getTimeLimitUnlimited())
{
return true;
}
if($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time())
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilObjUser::checkUserId ( )

Definition at line 2419 of file class.ilObjUser.php.

References $data, ilObject\$id, $ilAuth, $login, and getLoginFromAuth().

{
global $ilDB,$ilAuth;
$r = $this->ilias->db->query("SELECT usr_id FROM usr_data WHERE login = ".
$ilDB->quote($login));
//query has got a result
if ($r->numRows() > 0)
{
$data = $r->fetchRow();
$this->id = $data[0];
return $this->id;
}
return false;
}

+ Here is the call graph for this function:

ilObjUser::clipboardDeleteObjectsOfType (   $a_type)

Delete objects of type for user.

Definition at line 3389 of file class.ilObjUser.php.

References ilObject\getId().

{
global $ilDB;
$st = $ilDB->prepareManip("DELETE FROM personal_clipboard WHERE ".
"type = ? AND user_id = ?",
array("text", "integer"));
$ilDB->execute($st,
array($a_type, $this->getId()));
}

+ Here is the call graph for this function:

ilObjUser::clipboardHasObjectsOfType (   $a_type)

Check whether clipboard has objects of a certain type.

Definition at line 3369 of file class.ilObjUser.php.

References ilObject\getId().

{
global $ilDB;
$st = $ilDB->prepare("SELECT * FROM personal_clipboard WHERE ".
"parent = ? AND type = ? AND user_id = ?",
array("integer", "text", "integer"));
$set = $ilDB->execute($st,
array(0, $a_type, $this->getId()));
if ($rec = $ilDB->fetchAssoc($set))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilObjUser::delete ( )

deletes a user public

Parameters
integeruser_id

Reimplemented from ilObject.

Definition at line 1207 of file class.ilObjUser.php.

References ilEventParticipants\_deleteByUser(), ilBlockSetting\_deleteSettingsOfUser(), ilLinkCheckNotify\_deleteUser(), ilObjForum\_deleteUser(), ilObjUserTracking\_deleteUser(), ilObjCourse\_deleteUser(), ilLDAPRoleGroupMapping\_getInstance(), deleteUserDefinedFieldEntries(), and ilObject\getId().

{
global $rbacadmin, $ilDB;
// deassign from ldap groups
include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
$mapping->deleteUser($this->getId());
// remove mailbox / update sent mails
include_once ("Services/Mail/classes/class.ilMailbox.php");
$mailbox = new ilMailbox($this->getId());
$mailbox->delete();
$mailbox->updateMailsOfDeletedUser();
// delete feed blocks on personal desktop
include_once("./Services/Block/classes/class.ilCustomBlock.php");
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($this->getId());
$costum_block->setContextObjType("user");
$c_blocks = $costum_block->queryBlocksForContext();
include_once("./Services/Feeds/classes/class.ilPDExternalFeedBlock.php");
foreach($c_blocks as $c_block)
{
if ($c_block["type"] == "pdfeed")
{
$fb = new ilPDExternalFeedBlock($c_block["id"]);
$fb->delete();
}
}
// delete block settings
include_once("./Services/Block/classes/class.ilBlockSetting.php");
// delete user_account
$this->ilias->db->query("DELETE FROM usr_data WHERE usr_id = ".
$ilDB->quote($this->getId()));
// delete user_prefs
$this->ilias->db->query("DELETE FROM usr_pref WHERE usr_id= ".
$ilDB->quote($this->getId()));
// delete user_session
$this->ilias->db->query("DELETE FROM usr_session WHERE user_id= ".
$ilDB->quote($this->getId()));
// remove user from rbac
$rbacadmin->removeUser($this->getId());
// remove bookmarks
// TODO: move this to class.ilBookmarkFolder
$q = "DELETE FROM bookmark_tree WHERE tree = ".
$ilDB->quote($this->getId());
$this->ilias->db->query($q);
$q = "DELETE FROM bookmark_data WHERE user_id= ".
$ilDB->quote($this->getId());
$this->ilias->db->query($q);
// DELETE FORUM ENTRIES (not complete in the moment)
include_once './Modules/Forum/classes/class.ilObjForum.php';
// Delete link check notify entries
include_once './classes/class.ilLinkCheckNotify.php';
// Delete crs entries
include_once './Modules/Course/classes/class.ilObjCourse.php';
// Delete user tracking
include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
include_once 'Modules/Session/classes/class.ilEventParticipants.php';
// Delete user defined field entries
// delete object data
return true;
}

+ Here is the call graph for this function:

ilObjUser::deletePref (   $a_keyword)

Deletes a userpref value of the user from the database public.

Parameters
stringkeyword

Definition at line 1039 of file class.ilObjUser.php.

{
global $ilDB;
$query = sprintf("DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s",
$ilDB->quote($this->getId() . ""),
$ilDB->quote($a_keyword . "")
);
$ilDB->query($query);
}
ilObjUser::deleteUserDefinedFieldEntries ( )

Definition at line 3999 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by delete().

{
global $ilDB;
$query = "DELETE FROM usr_defined_data ".
"WHERE usr_id = ".$ilDB->quote($this->getId());
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::dropDesktopItem (   $a_item_id,
  $a_type 
)

drop an item from user's personal desktop

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3169 of file class.ilObjUser.php.

References _dropDesktopItem(), and ilObject\getId().

Referenced by ilObjGroup\leaveGroup().

{
ilObjUser::_dropDesktopItem($this->getId(), $a_item_id, $a_type);
/* global $ilDB;
$q = "DELETE FROM desktop_item WHERE ".
" item_id = ".$ilDB->quote($a_item_id)." AND ".
" type = ".$ilDB->quote($a_type)." AND ".
" user_id = ".$ilDB->quote($this->getId());
$this->ilias->db->query($q);
*/ }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::getActive ( )

get user active state public

Definition at line 2111 of file class.ilObjUser.php.

References $active.

{
return $this->active;
}
ilObjUser::getAgreeDate ( )

get the date when the user accepted the user agreement public

Returns
string date of last update

Definition at line 2064 of file class.ilObjUser.php.

{
return $this->agree_date;
}
& ilObjUser::getAppliedUsers ( )

Definition at line 2376 of file class.ilObjUser.php.

References __readAppliedUsers(), and ilObject\getId().

{
$this->applied_users = array();
$this->__readAppliedUsers($this->getId());
return $this->applied_users ? $this->applied_users : array();
}

+ Here is the call graph for this function:

ilObjUser::getApproveDate ( )

get the date when the user account was approved public

Returns
string approve date

Definition at line 2053 of file class.ilObjUser.php.

References $approve_date.

{
}
ilObjUser::getAuthMode (   $a_auth_key = false)

get auth mode public

Definition at line 3549 of file class.ilObjUser.php.

References $auth_mode, and ilAuthUtils\_getAuthMode().

Referenced by saveAsNew(), and update().

{
if (!$a_auth_key)
{
}
include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
return ilAuthUtils::_getAuthMode($this->auth_mode);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::getCity ( )

get city public

Definition at line 1677 of file class.ilObjUser.php.

References $city.

Referenced by getProfileAsString().

{
return $this->city;
}

+ Here is the caller graph for this function:

ilObjUser::getClientIP ( )

get client ip number public

Definition at line 1810 of file class.ilObjUser.php.

References $client_ip.

{
}
ilObjUser::getClipboardChilds (   $a_parent,
  $a_insert_time 
)

Get childs of an item.

Definition at line 3438 of file class.ilObjUser.php.

References ilObject\_lookupTitle(), and DB_FETCHMODE_ASSOC.

{
global $ilDB, $ilUser;
$st = $ilDB->prepare("SELECT * FROM personal_clipboard WHERE ".
"user_id = ? AND parent = ? AND insert_time = ? ".
" ORDER BY order_nr",
array("integer", "integer", "timestamp"));
$objs = $ilDB->execute($st,
array($ilUser->getId(), $a_parent, $a_insert_time));
$objects = array();
while ($obj = $objs->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($obj["type"] == "mob")
{
$obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
}
$objects[] = array ("id" => $obj["item_id"],
"type" => $obj["type"], "title" => $obj["title"]);
}
return $objects;
}

+ Here is the call graph for this function:

ilObjUser::getClipboardObjects (   $a_type = "",
  $a_top_nodes_only = false 
)

get all clipboard objects of user and specified type

Definition at line 3403 of file class.ilObjUser.php.

References ilObject\_lookupTitle(), DB_FETCHMODE_ASSOC, and ilObject\getId().

{
global $ilDB;
$par = "";
if ($a_top_nodes_only)
{
$par = " AND parent = ".$ilDB->quote(0)." ";
}
$type_str = ($a_type != "")
? " AND type = ".$ilDB->quote($a_type)." "
: "";
$q = "SELECT * FROM personal_clipboard WHERE ".
"user_id = ".$ilDB->quote($this->getId())." ".
$type_str.$par.
" ORDER BY order_nr";
$objs = $this->ilias->db->query($q);
$objects = array();
while ($obj = $objs->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($obj["type"] == "mob")
{
$obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
}
$objects[] = array ("id" => $obj["item_id"],
"type" => $obj["type"], "title" => $obj["title"],
"insert_time" => $obj["insert_time"]);
}
return $objects;
}

+ Here is the call graph for this function:

ilObjUser::getComment ( )

get referral comment public

Definition at line 2032 of file class.ilObjUser.php.

References $referral_comment.

Referenced by getProfileAsString().

+ Here is the caller graph for this function:

ilObjUser::getCountry ( )

get country public

Definition at line 1715 of file class.ilObjUser.php.

References $country.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getCourseMemberships (   $a_user_id = "")

Definition at line 2797 of file class.ilObjUser.php.

References ilCourseParticipants\_getInstanceByObjId(), and ilObject\getId().

{
global $rbacreview, $tree;
if (strlen($a_user_id) > 0)
{
$user_id = $a_user_id;
}
else
{
$user_id = $this->getId();
}
$crs_memberships = array();
// get all roles which the user is assigned to
$roles = $rbacreview->assignedRoles($user_id);
foreach ($roles as $role)
{
$ass_rolefolders = $rbacreview->getFoldersAssignedToRole($role); //rolef_refids
foreach ($ass_rolefolders as $role_folder)
{
$node = $tree->getParentNodeData($role_folder);
if ($node["type"] == "crs")
{
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
$crsmem = ilCourseParticipants::_getInstanceByObjId($node['obj_id']);
if ($crsmem->isAssigned($user_id) && !in_array($node['obj_id'], $crs_memberships))
{
array_push($crs_memberships, $node['obj_id']);
}
}
}
}
return $crs_memberships ? $crs_memberships : array();
}

+ Here is the call graph for this function:

ilObjUser::getCurrentLanguage ( )

returns the current language (may differ from user's pref setting!)

Definition at line 1979 of file class.ilObjUser.php.

References $_SESSION.

{
return $_SESSION['lang'];
}
ilObjUser::getDelicious ( )

Definition at line 4167 of file class.ilObjUser.php.

References $delicious.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilObjUser::getDepartment ( )

get department public

Definition at line 1639 of file class.ilObjUser.php.

References $department.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getDesktopItems (   $a_types = "")

Definition at line 3239 of file class.ilObjUser.php.

References _lookupDesktopItems(), and ilObject\getId().

{
return $this->_lookupDesktopItems($this->getId(), $a_types);
}

+ Here is the call graph for this function:

ilObjUser::getEmail ( )

get email address public

Definition at line 1865 of file class.ilObjUser.php.

References $email.

Referenced by getProfileAsString().

{
return $this->email;
}

+ Here is the caller graph for this function:

ilObjUser::getExternalAccount ( )

get external account

note: 3.7.0 uses this field only for cas and soap authentication.

public

Definition at line 3579 of file class.ilObjUser.php.

Referenced by saveAsNew(), and update().

{
return $this->ext_account;
}

+ Here is the caller graph for this function:

ilObjUser::getFax ( )

get fax public

Definition at line 1791 of file class.ilObjUser.php.

References $fax.

Referenced by getProfileAsString().

{
return $this->fax;
}

+ Here is the caller graph for this function:

ilObjUser::getFirstname ( )

get firstname public

Definition at line 1582 of file class.ilObjUser.php.

References $firstname.

Referenced by getProfileAsString(), and getPublicName().

{
}

+ Here is the caller graph for this function:

ilObjUser::getFullname (   $a_max_strlen = 0)

get fullname public

Parameters
integermax. string length to return (optional) if string length of fullname is greater than given a_max_strlen the name is shortened in the following way:
  1. abreviate firstname (-> Dr. J. Smith) if fullname is still too long
  2. drop title (-> John Smith) if fullname is still too long
  3. drop title and abreviate first name (J. Smith) if fullname is still too long
  4. drop title and firstname and shorten lastname to max length (–> Smith)

Definition at line 1348 of file class.ilObjUser.php.

References ilUtil\stripSlashes().

Referenced by ilChatInvitationGUI\getHTML().

{
if (!$a_max_strlen)
{
return ilUtil::stripSlashes($this->fullname);
}
if (strlen($this->fullname) <= $a_max_strlen)
{
return ilUtil::stripSlashes($this->fullname);
}
if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen)
{
return ilUtil::stripSlashes($this->utitle." ".substr($this->firstname,0,1).". ".$this->lastname);
}
if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen)
{
return ilUtil::stripSlashes($this->firstname." ".$this->lastname);
}
if ((strlen($this->lastname) + 3) <= $a_max_strlen)
{
return ilUtil::stripSlashes(substr($this->firstname,0,1).". ".$this->lastname);
}
return ilUtil::stripSlashes(substr($this->lastname,0,$a_max_strlen));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::getGender ( )

get gender public

Definition at line 1540 of file class.ilObjUser.php.

References $gender.

Referenced by getProfileAsString().

{
return $this->gender;
}

+ Here is the caller graph for this function:

ilObjUser::getGroupMemberships (   $a_user_id = "")

Definition at line 2749 of file class.ilObjUser.php.

References ilObject\getId().

{
global $rbacreview, $tree;
if (strlen($a_user_id) > 0)
{
$user_id = $a_user_id;
}
else
{
$user_id = $this->getId();
}
$grp_memberships = array();
// get all roles which the user is assigned to
$roles = $rbacreview->assignedRoles($user_id);
foreach ($roles as $role)
{
$ass_rolefolders = $rbacreview->getFoldersAssignedToRole($role); //rolef_refids
foreach ($ass_rolefolders as $role_folder)
{
$node = $tree->getParentNodeData($role_folder);
if ($node["type"] == "grp")
{
$group =& $this->ilias->obj_factory->getInstanceByRefId($node["child"]);
if ($group->isMember($user_id) == true && !in_array($group->getId(), $grp_memberships) )
{
array_push($grp_memberships, $group->getId());
}
}
unset($group);
}
}
return $grp_memberships;
}

+ Here is the call graph for this function:

ilObjUser::getHobby ( )

get hobby public

Definition at line 1884 of file class.ilObjUser.php.

References $hobby.

Referenced by getProfileAsString().

{
return $this->hobby;
}

+ Here is the caller graph for this function:

ilObjUser::getInstantMessengerId (   $a_im_type)

Definition at line 4156 of file class.ilObjUser.php.

Referenced by update().

{
$var = "im_".$a_im_type;
return $this->$var;
}

+ Here is the caller graph for this function:

ilObjUser::getInstitution ( )

get institution public

Definition at line 1620 of file class.ilObjUser.php.

References $institution.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getLanguage ( )

returns a 2char-language-string public

Returns
string language

Definition at line 1905 of file class.ilObjUser.php.

{
return $this->prefs["language"];
}
ilObjUser::getLastLogin ( )

returns last login date public

Returns
string date

Definition at line 1999 of file class.ilObjUser.php.

{
return $this->last_login;
}
ilObjUser::getLastname ( )

get lastname public

Definition at line 1601 of file class.ilObjUser.php.

References $lastname.

Referenced by getProfileAsString(), and getPublicName().

{
}

+ Here is the caller graph for this function:

ilObjUser::getLastPasswordChangeTS ( )

Definition at line 1915 of file class.ilObjUser.php.

References $last_password_change_ts.

Referenced by getPasswordAge(), isPasswordChangeDemanded(), isPasswordExpired(), setLastPasswordChangeToNow(), and update().

+ Here is the caller graph for this function:

ilObjUser::getLastUpdate ( )

Definition at line 2013 of file class.ilObjUser.php.

References ilObject\$last_update.

{
}
ilObjUser::getLastVisitedLessons ( )

get read lessons, ordered by timestamp public

Returns
array lessons

Definition at line 1384 of file class.ilObjUser.php.

References $result, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
//query
$q = "SELECT * FROM lo_access ".
"WHERE usr_id= ".$ilDB->quote($this->id)." ".
"ORDER BY timestamp DESC";
$rst = $this->ilias->db->query($q);
// fill array
$result = array();
while($record = $rst->fetchRow(DB_FETCHMODE_OBJECT))
{
$result[] = array(
"timestamp" => $record->timestamp,
"usr_id" => $record->usr_id,
"lm_id" => $record->lm_id,
"obj_id" => $record->obj_id,
"lm_title" => $record->lm_title);
}
return $result;
}
ilObjUser::getLatitude ( )

Get Latitude.

Returns
string Latitude

Definition at line 2331 of file class.ilObjUser.php.

References $latitude.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilObjUser::getLessons ( )

get all lessons, unordered public

Returns
array lessons

Definition at line 1414 of file class.ilObjUser.php.

References $result, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
//query
$q = "SELECT * FROM lo_access ".
"WHERE usr_id= ".$ilDB->quote($this->id)." ";
$rst = $this->ilias->db->query($q);
// fill array
$result = array();
while($record = $rst->fetchRow(DB_FETCHMODE_OBJECT))
{
$result[] = array(
"timestamp" => $record->timestamp,
"usr_id" => $record->usr_id,
"lm_id" => $record->lm_id,
"obj_id" => $record->obj_id,
"lm_title" => $record->lm_title);
}
return $result;
}
ilObjUser::getLocationZoom ( )

Get Location Zoom.

Returns
int Location Zoom

Definition at line 2371 of file class.ilObjUser.php.

References $loc_zoom.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilObjUser::getLogin ( )

get login / username public

Definition at line 1488 of file class.ilObjUser.php.

References $login.

Referenced by getProfileAsString(), and getPublicName().

{
return $this->login;
}

+ Here is the caller graph for this function:

ilObjUser::getLoginAttempts ( )

Definition at line 2219 of file class.ilObjUser.php.

References $login_attempts.

{
}
ilObjUser::getLoginByUserId (   $a_userid)

Definition at line 2559 of file class.ilObjUser.php.

References $ilias, and DB_FETCHMODE_OBJECT.

Referenced by ilObjPaymentSettingsGUI\editVendor().

{
global $ilias, $ilDB;
$query = "SELECT login FROM usr_data ".
"WHERE usr_id = ".$ilDB->quote($a_userid);
$row = $ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
return $row->login ? $row->login : false;
}

+ Here is the caller graph for this function:

static ilObjUser::getLoginFromAuth ( )
staticprivate

Gets the username from $ilAuth, and converts it into an ILIAS login name.

Definition at line 2442 of file class.ilObjUser.php.

References $ilAuth, $login, ilDAVServer\_isActive(), and ilAuthContainerMDB2\toUsernameWithoutDomain().

Referenced by checkUserId(), isCurrentUserActive(), and syncActive().

{
global $ilAuth;
// BEGIN WebDAV: Strip Microsoft Domain Names from logins
require_once ('Services/WebDAV/classes/class.ilDAVServer.php');
{
require_once ('Services/Authentication/classes/class.ilAuthContainerMDB2.php');
}
else
{
$login =$ilAuth->getUsername();
}
return $login;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::getLongitude ( )

Get Longitude.

Returns
string Longitude

Definition at line 2351 of file class.ilObjUser.php.

References $longitude.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilObjUser::getMatriculation ( )

get matriculation number public

Definition at line 1829 of file class.ilObjUser.php.

References $matriculation.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getPasswd ( )

get password

Returns
password. The password is encoded depending on the current password type. public
See Also
getPasswdType

Definition at line 1511 of file class.ilObjUser.php.

References $passwd.

{
return $this->passwd;
}
ilObjUser::getPasswdType ( )

get password type

Returns
password type (IL_PASSWD_PLAIN, IL_PASSWD_MD5 or IL_PASSWD_CRYPT). public
See Also
getPasswd

Definition at line 1521 of file class.ilObjUser.php.

References $passwd_type.

{
}
ilObjUser::getPasswordAge ( )

Definition at line 2286 of file class.ilObjUser.php.

References getLastPasswordChangeTS().

{
$current_ts = time();
$pass_change_ts = $this->getLastPasswordChangeTS();
$password_age = (int) ( ($current_ts - $pass_change_ts) / 86400 );
return $password_age;
}

+ Here is the call graph for this function:

ilObjUser::getPersonalPicturePath (   $a_size = "small",
  $a_force_pic = false 
)

get path to personal picture

Parameters
stringsize "small", "xsmall" or "xxsmall"

Definition at line 3819 of file class.ilObjUser.php.

References _getPersonalPicturePath(), and ilObject\getId().

{
return ilObjUser::_getPersonalPicturePath($this->getId(),$a_size,$a_force_pic);
}

+ Here is the call graph for this function:

ilObjUser::getPhoneHome ( )

get home phone public

Definition at line 1753 of file class.ilObjUser.php.

References $phone_home.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getPhoneMobile ( )

get mobile phone public

Definition at line 1772 of file class.ilObjUser.php.

References $phone_mobile.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getPhoneOffice ( )

get office phone public

Definition at line 1734 of file class.ilObjUser.php.

References $phone_office.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::getPref (   $a_keyword)

get a user preference

Parameters
stringname of parameter public

Definition at line 1157 of file class.ilObjUser.php.

Referenced by getTimeFormat(), getTimeZone(), and hasPublicProfile().

{
if (array_key_exists($a_keyword, $this->prefs))
{
return $this->prefs[$a_keyword];
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjUser::getProfileAsString ( $a_language)

Get formatted mail body text of user profile data.

Parameters
objectLanguage object (choose user language of recipient) or null to use language of current user

Definition at line 4015 of file class.ilObjUser.php.

References $gender, ilObject\$lng, ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), getCity(), getComment(), getCountry(), ilObject\getCreateDate(), getDepartment(), getEmail(), getFax(), getFirstname(), getGender(), getHobby(), getInstitution(), getLastname(), getLogin(), getMatriculation(), getPhoneHome(), getPhoneMobile(), getPhoneOffice(), getStreet(), getTimeLimitFrom(), getTimeLimitUnlimited(), getTimeLimitUntil(), getUTitle(), getZipcode(), IL_CAL_DATETIME, IL_CAL_UNIX, ilDatePresentation\resetToDefaults(), setLanguage(), and ilDatePresentation\setUseRelativeDates().

{
include_once './Services/AccessControl/classes/class.ilObjRole.php';
include_once 'classes/class.ilFormat.php';
global $lng,$rbacreview;
$language =& $a_language;
$language->loadLanguageModule('registration');
$language->loadLanguageModule('crs');
$body = '';
$body .= ($language->txt("login").": ".$this->getLogin()."\n");
if(strlen($this->getUTitle()))
{
$body .= ($language->txt("title").": ".$this->getUTitle()."\n");
}
if(strlen($this->getGender()))
{
$gender = ($this->getGender() == 'm') ?
$language->txt('gender_m') :
$language->txt('gender_f');
$body .= ($language->txt("gender").": ".$gender."\n");
}
if(strlen($this->getFirstname()))
{
$body .= ($language->txt("firstname").": ".$this->getFirstname()."\n");
}
if(strlen($this->getLastname()))
{
$body .= ($language->txt("lastname").": ".$this->getLastname()."\n");
}
if(strlen($this->getInstitution()))
{
$body .= ($language->txt("institution").": ".$this->getInstitution()."\n");
}
if(strlen($this->getDepartment()))
{
$body .= ($language->txt("department").": ".$this->getDepartment()."\n");
}
if(strlen($this->getStreet()))
{
$body .= ($language->txt("street").": ".$this->getStreet()."\n");
}
if(strlen($this->getCity()))
{
$body .= ($language->txt("city").": ".$this->getCity()."\n");
}
if(strlen($this->getZipcode()))
{
$body .= ($language->txt("zipcode").": ".$this->getZipcode()."\n");
}
if(strlen($this->getCountry()))
{
$body .= ($language->txt("country").": ".$this->getCountry()."\n");
}
if(strlen($this->getPhoneOffice()))
{
$body .= ($language->txt("phone_office").": ".$this->getPhoneOffice()."\n");
}
if(strlen($this->getPhoneHome()))
{
$body .= ($language->txt("phone_home").": ".$this->getPhoneHome()."\n");
}
if(strlen($this->getPhoneMobile()))
{
$body .= ($language->txt("phone_mobile").": ".$this->getPhoneMobile()."\n");
}
if(strlen($this->getFax()))
{
$body .= ($language->txt("fax").": ".$this->getFax()."\n");
}
if(strlen($this->getEmail()))
{
$body .= ($language->txt("email").": ".$this->getEmail()."\n");
}
if(strlen($this->getHobby()))
{
$body .= ($language->txt("hobby").": ".$this->getHobby()."\n");
}
if(strlen($this->getComment()))
{
$body .= ($language->txt("referral_comment").": ".$this->getComment()."\n");
}
if(strlen($this->getMatriculation()))
{
$body .= ($language->txt("matriculation").": ".$this->getMatriculation()."\n");
}
if(strlen($this->getCreateDate()))
{
$body .= ($language->txt("create_date").": ".$date."\n");
}
foreach($rbacreview->getGlobalRoles() as $role)
{
if($rbacreview->isAssigned($this->getId(),$role))
{
$gr[] = ilObjRole::_lookupTitle($role);
}
}
if(count($gr))
{
$body .= ($language->txt('reg_role_info').': '.implode(',',$gr)."\n");
}
// Time limit
if($this->getTimeLimitUnlimited())
{
$body .= ($language->txt('time_limit').": ".$language->txt('crs_unlimited')."\n");
}
else
{
$body .= $language->txt('time_limit').': '.$period;
/*
$body .= ($language->txt('time_limit').": ".$language->txt('crs_from')." ".
ilFormat::formatUnixTime($this->getTimeLimitFrom(), true)." ".
$language->txt('crs_to')." ".
ilFormat::formatUnixTime($this->getTimeLimitUntil(), true)."\n");
*/
}
return $body;
}

+ Here is the call graph for this function:

ilObjUser::getProfileIncomplete ( )

Definition at line 2241 of file class.ilObjUser.php.

Referenced by saveAsNew(), and update().

{
return $this->profile_incomplete;
}

+ Here is the caller graph for this function:

ilObjUser::getPublicName ( )

returns firstname lastname and login if profile is public, login otherwise

Returns
string

Definition at line 4563 of file class.ilObjUser.php.

References getFirstname(), getLastname(), getLogin(), and hasPublicProfile().

{
if ($this->hasPublicProfile())
return $this->getFirstname()." ".$this->getLastname()." (".$this->getLogin().")";
else
return $this->getLogin();
}

+ Here is the call graph for this function:

ilObjUser::getStoredActive (   $a_id)

get user active state

Parameters
integer$a_iduser id public
Returns
true if active, otherwise false

Definition at line 2150 of file class.ilObjUser.php.

References $ilias, and DB_FETCHMODE_OBJECT.

Referenced by syncActive().

{
global $ilias, $ilDB;
$query = "SELECT active FROM usr_data ".
"WHERE usr_id = ".$ilDB->quote($a_id);
$row = $ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
return $row->active ? true : false;
}

+ Here is the caller graph for this function:

ilObjUser::getStreet ( )

get street public

Definition at line 1658 of file class.ilObjUser.php.

References $street.

Referenced by getProfileAsString().

{
return $this->street;
}

+ Here is the caller graph for this function:

ilObjUser::getTimeFormat ( )

get time format

public

Returns

Definition at line 1124 of file class.ilObjUser.php.

References ilCalendarSettings\_getInstance(), and getPref().

{
if($format = $this->getPref('time_format'))
{
return $format;
}
else
{
include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
return $settings->getDefaultTimeFormat();
}
}

+ Here is the call graph for this function:

ilObjUser::getTimeLimitFrom ( )

Definition at line 2185 of file class.ilObjUser.php.

Referenced by checkTimeLimit(), getProfileAsString(), saveAsNew(), and update().

{
return $this->time_limit_from ? $this->time_limit_from : time();
}

+ Here is the caller graph for this function:

ilObjUser::getTimeLimitMessage ( )

Definition at line 2209 of file class.ilObjUser.php.

Referenced by update().

{
return $this->time_limit_message;
}

+ Here is the caller graph for this function:

ilObjUser::getTimeLimitOwner ( )

Definition at line 2177 of file class.ilObjUser.php.

Referenced by saveAsNew(), and update().

{
return $this->time_limit_owner ? $this->time_limit_owner : 7;
}

+ Here is the caller graph for this function:

ilObjUser::getTimeLimitUnlimited ( )

Definition at line 2201 of file class.ilObjUser.php.

Referenced by checkTimeLimit(), getProfileAsString(), saveAsNew(), and update().

{
return $this->time_limit_unlimited;
}

+ Here is the caller graph for this function:

ilObjUser::getTimeLimitUntil ( )

Definition at line 2193 of file class.ilObjUser.php.

Referenced by checkTimeLimit(), getProfileAsString(), saveAsNew(), and update().

{
return $this->time_limit_until ? $this->time_limit_until : time();
}

+ Here is the caller graph for this function:

ilObjUser::getTimeZone ( )

get timezone of user

public

Definition at line 1104 of file class.ilObjUser.php.

References ilCalendarSettings\_getInstance(), and getPref().

{
if($tz = $this->getPref('user_tz'))
{
return $tz;
}
else
{
include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
return $settings->getDefaultTimeZone();
}
}

+ Here is the call graph for this function:

ilObjUser::getUserDefinedData ( )

Definition at line 3946 of file class.ilObjUser.php.

{
return $this->user_defined_data ? $this->user_defined_data : array();
}
ilObjUser::getUserIdByEmail (   $a_email)
static

STATIC METHOD get the user_id of an email address.

Parameters
stringemail of user
Returns
integer id of user public

Definition at line 2540 of file class.ilObjUser.php.

References DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT usr_id FROM usr_data ".
"WHERE email = ".$ilDB->quote($a_email);
$row = $this->ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
return $row->usr_id ? $row->usr_id : 0;
}
ilObjUser::getUserIdByLogin (   $a_login)
ilObjUser::getUTitle ( )

get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets the user object's title) public

Definition at line 1563 of file class.ilObjUser.php.

References $utitle.

Referenced by getProfileAsString().

{
return $this->utitle;
}

+ Here is the caller graph for this function:

ilObjUser::getZipcode ( )

get zipcode public

Definition at line 1696 of file class.ilObjUser.php.

References $zipcode.

Referenced by getProfileAsString().

{
}

+ Here is the caller graph for this function:

ilObjUser::hasAcceptedUserAgreement ( )

check wether user has accepted user agreement

Definition at line 1465 of file class.ilObjUser.php.

{
if ($this->agree_date != "0000-00-00 00:00:00" || $this->login == "root")
{
return true;
}
return false;
}
ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

Returns
boolean

Definition at line 4554 of file class.ilObjUser.php.

References getPref().

Referenced by getPublicName().

{
return $this->getPref("public_profile") == "y";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::ilObjUser (   $a_user_id = 0,
  $a_call_by_reference = false 
)

Constructor public.

Parameters
integeruser_id

Definition at line 149 of file class.ilObjUser.php.

References $ilias, $skin, IL_PASSWD_PLAIN, ilObject\ilObject(), read(), and ilObject\setId().

{
global $ilias,$ilDB;
// init variables
$this->ilias =& $ilias;
$this->db =& $ilDB;
$this->type = "usr";
$this->ilObject($a_user_id, $a_call_by_reference);
$this->auth_mode = "default";
$this->passwd_type = IL_PASSWD_PLAIN;
// for gender selection. don't change this
/*$this->gender = array(
'm' => "salutation_m",
'f' => "salutation_f"
);*/
if (!empty($a_user_id))
{
$this->setId($a_user_id);
$this->read();
}
else
{
// TODO: all code in else-structure doesn't belongs in class user !!!
//load default data
$this->prefs = array();
//language
$this->prefs["language"] = $this->ilias->ini->readVariable("language","default");
//skin and pda support
$this->skin = $this->ilias->ini->readVariable("layout","skin");
$this->prefs["skin"] = $this->skin;
$this->prefs["show_users_online"] = "y";
//style (css)
$this->prefs["style"] = $this->ilias->ini->readVariable("layout","style");
}
}

+ Here is the call graph for this function:

ilObjUser::isChild (   $a_usr_id)

Definition at line 2384 of file class.ilObjUser.php.

References __readAppliedUsers(), and ilObject\getId().

{
if($a_usr_id == $this->getId())
{
return true;
}
$this->applied_users = array();
$this->__readAppliedUsers($this->getId());
return in_array($a_usr_id,$this->applied_users);
}

+ Here is the call graph for this function:

ilObjUser::isCurrentUserActive ( )

Definition at line 2465 of file class.ilObjUser.php.

References $data, $ilAuth, $login, and getLoginFromAuth().

{
global $ilDB,$ilAuth;
$r = $this->ilias->db->query("SELECT active FROM usr_data WHERE login= ".
$ilDB->quote($login));
//query has got a result
if ($r->numRows() > 0)
{
$data = $r->fetchRow();
if (!empty($data[0]))
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

ilObjUser::isDesktopItem (   $a_item_id,
  $a_type 
)

check wether an item is on the users desktop or not

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3218 of file class.ilObjUser.php.

References _isDesktopItem(), and ilObject\getId().

{
return ilObjUser::_isDesktopItem($this->getId(), $a_item_id, $a_type);
/* global $ilDB;
$q = "SELECT * FROM desktop_item WHERE ".
"item_id = ".$ilDB->quote($a_item_id)." AND type = ".
$ilDB->quote($a_type)." AND user_id = ".
$ilDB->quote($this->getId());
$item_set = $this->ilias->db->query($q);
if ($d = $item_set->fetchRow())
{
return true;
}
else
{
return false;
}*/
}

+ Here is the call graph for this function:

ilObjUser::isPasswordChangeDemanded ( )

Definition at line 2246 of file class.ilObjUser.php.

References ilSecuritySettings\_getInstance(), and getLastPasswordChangeTS().

{
//error_reporting(E_ALL);
if( $this->id == ANONYMOUS_USER_ID || $this->id == SYSTEM_USER_ID )
return false;
require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
if( $security->isPasswordChangeOnFirstLoginEnabled() &&
$this->getLastPasswordChangeTS() == 0 )
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilObjUser::isPasswordExpired ( )

Definition at line 2262 of file class.ilObjUser.php.

References ilSecuritySettings\_getInstance(), ilSecuritySettings\ACCOUNT_SECURITY_MODE_CUSTOMIZED, and getLastPasswordChangeTS().

{
//error_reporting(E_ALL);
if($this->id == ANONYMOUS_USER_ID) return false;
require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
if( $security->getAccountSecurityMode() == ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED &&
$this->getLastPasswordChangeTS() > 0 )
{
$max_pass_age = $security->getPasswordMaxAge();
if( $max_pass_age > 0 )
{
$max_pass_age_ts = ( $max_pass_age * 86400 );
$pass_change_ts = $this->getLastPasswordChangeTS();
$current_ts = time();
if( ($current_ts - $pass_change_ts) > $max_pass_age_ts )
return true;
}
}
return false;
}

+ Here is the call graph for this function:

static ilObjUser::lookupMatriculation (   $a_usr_id)
static

Lookup matriculation.

Returns
string matricualtion
Parameters
int$a_usr_idpublic

Definition at line 1840 of file class.ilObjUser.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

{
global $ilDB;
$query = "SELECT matriculation FROM usr_data ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id);
$res = $ilDB->query($query);
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
return $row->matriculation ? $row->matriculation : '';
}

+ Here is the caller graph for this function:

ilObjUser::read ( )

loads a record "user" from database private

Definition at line 195 of file class.ilObjUser.php.

References $data, $ilErr, assignData(), DB_FETCHMODE_ASSOC, IL_PASSWD_CRYPT, IL_PASSWD_MD5, readPrefs(), readUserDefinedFields(), setLastPasswordChangeTS(), setLoginAttempts(), and ilStyleDefinition\skinExists().

Referenced by ilObjUser(), and update().

{
global $ilErr, $ilDB;
// TODO: fetching default role should be done in rbacadmin
$q = "SELECT * FROM usr_data ".
"LEFT JOIN rbac_ua ON usr_data.usr_id=rbac_ua.usr_id ".
"WHERE usr_data.usr_id= ".$ilDB->quote($this->id);
$r = $this->ilias->db->query($q);
if ($r->numRows() > 0)
{
$data = $r->fetchRow(DB_FETCHMODE_ASSOC);
// convert password storage layout used by table usr_data into
// storage layout used by class ilObjUser
if ($data["passwd"] == "" && $data["i2passwd"] != "")
{
$data["passwd_type"] = IL_PASSWD_CRYPT;
$data["passwd"] = $data["i2passwd"];
}
else
{
$data["passwd_type"] = IL_PASSWD_MD5;
//$data["passwd"] = $data["passwd"]; (implicit)
}
unset($data["i2passw"]);
// this assign must not be set via $this->assignData($data)
// because this method will be called on profile updates and
// would set this values to 0, because they arent posted from form
$this->setLastPasswordChangeTS( $data['last_password_change'] );
$this->setLoginAttempts( $data['login_attempts'] );
// fill member vars in one shot
$this->assignData($data);
//get userpreferences from usr_pref table
$this->readPrefs();
//set language to default if not set
if ($this->prefs["language"] == "")
{
$this->prefs["language"] = $this->oldPrefs["language"];
}
//check skin-setting
include_once("./Services/Style/classes/class.ilStyleDefinition.php");
if ($this->prefs["skin"] == "" ||
!ilStyleDefinition::skinExists($this->prefs["skin"]))
{
$this->prefs["skin"] = $this->oldPrefs["skin"];
}
$this->skin = $this->prefs["skin"];
//check style-setting (skins could have more than one stylesheet
if ($this->prefs["style"] == "" ||
!ilStyleDefinition::skinExists($this->skin, $this->prefs["style"]))
{
//load default (css)
$this->prefs["style"] = $this->ilias->ini->readVariable("layout","style");
}
if (empty($this->prefs["hits_per_page"]))
{
$this->prefs["hits_per_page"] = 10;
}
}
else
{
$ilErr->raiseError("<b>Error: There is no dataset with id ".
$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__.
"<br />Line: ".__LINE__, $ilErr->FATAL);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::readPrefs ( )

get all user preferences private

Returns
integer number of preferences

Definition at line 1189 of file class.ilObjUser.php.

References $prefs, and _getPreferences().

Referenced by read().

{
global $ilDB;
if (is_array($this->prefs))
{
$this->oldPrefs = $this->prefs;
}
$this->prefs = ilObjUser::_getPreferences($this->id);
return count($prefs);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::readUserDefinedFields ( )

Definition at line 3973 of file class.ilObjUser.php.

References $res, DB_FETCHMODE_ASSOC, and ilObject\getId().

Referenced by read().

{
global $ilDB;
$query = "SELECT * FROM usr_defined_data ".
"WHERE usr_id = ".$ilDB->quote($this->getId());
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$this->user_defined_data = $row;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::refreshLogin ( )

updates the login data of a "user" // TODO set date with now() should be enough public

Definition at line 796 of file class.ilObjUser.php.

{
global $ilDB;
$q = "UPDATE usr_data SET ".
"last_login = now() ".
"WHERE usr_id = ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
}
ilObjUser::removeObjectFromClipboard (   $a_item_id,
  $a_type 
)

remove object from user's personal clipboard

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 3493 of file class.ilObjUser.php.

References ilObject\getId().

{
global $ilDB;
$q = "DELETE FROM personal_clipboard WHERE ".
"item_id = ".$ilDB->quote($a_item_id)." AND type = ".$ilDB->quote($a_type)." ".
" AND user_id = ".$ilDB->quote($this->getId());
$this->ilias->db->query($q);
}

+ Here is the call graph for this function:

ilObjUser::removeUserPicture ( )

Remove user picture.

Definition at line 3892 of file class.ilObjUser.php.

References $file, ilUtil\getWebspaceDir(), setPref(), and update().

{
$webspace_dir = ilUtil::getWebspaceDir();
$image_dir = $webspace_dir."/usr_images";
$file = $image_dir."/usr_".$this->getID()."."."jpg";
$thumb_file = $image_dir."/usr_".$this->getID()."_small.jpg";
$xthumb_file = $image_dir."/usr_".$this->getID()."_xsmall.jpg";
$xxthumb_file = $image_dir."/usr_".$this->getID()."_xxsmall.jpg";
$upload_file = $image_dir."/upload_".$this->getID();
// remove user pref file name
$this->setPref("profile_image", "");
$this->update();
if (@is_file($file))
{
unlink($file);
}
if (@is_file($thumb_file))
{
unlink($thumb_file);
}
if (@is_file($xthumb_file))
{
unlink($xthumb_file);
}
if (@is_file($xxthumb_file))
{
unlink($xxthumb_file);
}
if (@is_file($upload_file))
{
unlink($upload_file);
}
}

+ Here is the call graph for this function:

ilObjUser::replacePassword (   $new_md5)

replaces password with new md5 hash

Parameters
stringnew password as md5
Returns
boolean true on success; otherwise false public

Definition at line 813 of file class.ilObjUser.php.

References IL_PASSWD_MD5.

{
global $ilDB;
$this->passwd_type = IL_PASSWD_MD5;
$this->passwd = $new_md5;
$q = "UPDATE usr_data SET ".
"passwd= ".$ilDB->quote($this->passwd)." ".
"WHERE usr_id= ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
return true;
}
ilObjUser::resetLastPasswordChange ( )

Definition at line 2306 of file class.ilObjUser.php.

References ilObject\getId().

{
$query = "UPDATE usr_data SET usr_data.last_password_change = 0 " .
"WHERE usr_data.usr_id = ?";
$statement = $this->db->prepareManip( $query, array('integer') );
$affected = $this->db->execute( $statement, array($this->getId()) );
if($affected) return true;
else return false;
}

+ Here is the call graph for this function:

ilObjUser::resetPassword (   $a_new1,
  $a_new2 
)

reset password

Parameters
stringnew password1 as plaintext
stringnew password2 as plaintext
Returns
boolean true on success; otherwise false public

Definition at line 906 of file class.ilObjUser.php.

References IL_PASSWD_MD5.

{
global $ilDB;
if (func_num_args() != 2)
{
return false;
}
if (!isset($a_new1) or !isset($a_new2))
{
return false;
}
if ($a_new1 != $a_new2)
{
return false;
}
//update password
$this->passwd = md5($a_new1);
$this->passwd_type = IL_PASSWD_MD5;
$q = "UPDATE usr_data SET ".
"passwd= ".$ilDB->quote($this->passwd)." ".
"WHERE usr_id= ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
return true;
}
ilObjUser::saveAsNew (   $a_from_formular = true)

TODO: drop fields last_update & create_date.

redundant data in object_data! saves a new record "user" to database public

Parameters
booleanuser data from formular (addSlashes) or not (prepareDBString)

Definition at line 368 of file class.ilObjUser.php.

References $ilErr, $passwd, addUserDefinedFieldEntry(), getAuthMode(), getExternalAccount(), getProfileIncomplete(), getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, and updateUserDefinedFields().

{
global $ilErr, $ilDB;
switch ($this->passwd_type)
{
$pw_field = "passwd";
if(strlen($this->passwd))
{
$pw_value = md5($this->passwd);
}
else
{
$pw_value = $this->passwd;
}
break;
$pw_field = "passwd";
$pw_value = $this->passwd;
break;
$pw_field = "i2passwd";
$pw_value = $this->passwd;
break;
default :
$ilErr->raiseError("<b>Error: passwd_type missing in function saveAsNew. ".
$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__.
"<br />Line: ".__LINE__, $ilErr->FATAL);
}
if ($a_from_formular)
{
$q = "INSERT INTO usr_data "
. "(usr_id,login,".$pw_field.",firstname,lastname,title,gender,"
. "email,hobby,institution,department,street,city,zipcode,country,"
. "phone_office,phone_home,phone_mobile,fax,last_login,last_update,create_date,"
. "referral_comment,matriculation,client_ip, approve_date,agree_date,active,"
. "time_limit_unlimited,time_limit_until,time_limit_from,time_limit_owner,auth_mode,ext_account,profile_incomplete,"
. "im_icq,im_yahoo,im_msn,im_aim,im_skype,delicious,latitude,longitude,loc_zoom,last_password_change) "
. "VALUES "
. "(".
$ilDB->quote($this->id).",".
$ilDB->quote($this->login).",".
$ilDB->quote($pw_value).",".
$ilDB->quote($this->firstname).",".
$ilDB->quote($this->lastname).",".
$ilDB->quote($this->utitle).",".
$ilDB->quote($this->gender).",".
$ilDB->quote($this->email).",".
$ilDB->quote($this->hobby).",".
$ilDB->quote($this->institution).",".
$ilDB->quote($this->department).",".
$ilDB->quote($this->street).",".
$ilDB->quote($this->city).",".
$ilDB->quote($this->zipcode).",".
$ilDB->quote($this->country).",".
$ilDB->quote($this->phone_office).",".
$ilDB->quote($this->phone_home).",".
$ilDB->quote($this->phone_mobile).",".
$ilDB->quote($this->fax).", 0, now(), now(),".
$ilDB->quote($this->referral_comment).",".
$ilDB->quote($this->matriculation).",".
$ilDB->quote($this->client_ip).",".
$ilDB->quote($this->approve_date).",".
$ilDB->quote($this->agree_date).",".
$ilDB->quote($this->active).",".
$ilDB->quote($this->getTimeLimitUnlimited()).",".
$ilDB->quote($this->getTimeLimitUntil()).",".
$ilDB->quote($this->getTimeLimitFrom()).",".
$ilDB->quote($this->getTimeLimitOwner()).",".
$ilDB->quote($this->getAuthMode()).",".
$ilDB->quote($this->getExternalAccount()).",".
$ilDB->quote($this->getProfileIncomplete()).",".
$ilDB->quote($this->im_icq).",".
$ilDB->quote($this->im_yahoo).",".
$ilDB->quote($this->im_msn).",".
$ilDB->quote($this->im_aim).",".
$ilDB->quote($this->im_skype).",".
$ilDB->quote($this->delicious).",".
$ilDB->quote($this->latitude).",".
$ilDB->quote($this->longitude).",".
$ilDB->quote($this->loc_zoom).",".
$ilDB->quote($this->last_password_change_ts).
")";
}
else
{
$q = "INSERT INTO usr_data ".
"(usr_id,login,".$pw_field.",firstname,lastname,title,gender,"
. "email,hobby,institution,department,street,city,zipcode,country,"
. "phone_office,phone_home,phone_mobile,fax,last_login,last_update,create_date,"
. "referral_comment,matriculation,client_ip, approve_date,agree_date,active,"
. "time_limit_unlimited,time_limit_until,time_limit_from,time_limit_owner,auth_mode,ext_account,profile_incomplete,"
. "im_icq,im_yahoo,im_msn,im_aim,im_skype,delicious,latitude,longitude,loc_zoom,last_password_change) "
. "VALUES "
."(".
$ilDB->quote($this->id).",".
$ilDB->quote($this->login).",".
$ilDB->quote($pw_value).",".
$ilDB->quote($this->firstname).",".
$ilDB->quote($this->lastname).",".
$ilDB->quote($this->utitle).",".
$ilDB->quote($this->gender).",".
$ilDB->quote($this->email).",".
$ilDB->quote($this->hobby).",".
$ilDB->quote($this->institution).",".
$ilDB->quote($this->department).",".
$ilDB->quote($this->street).",".
$ilDB->quote($this->city).",".
$ilDB->quote($this->zipcode).",".
$ilDB->quote($this->country).",".
$ilDB->quote($this->phone_office).",".
$ilDB->quote($this->phone_home).",".
$ilDB->quote($this->phone_mobile).",".
$ilDB->quote($this->fax).", 0, now(), now(),".
$ilDB->quote($this->referral_comment).",".
$ilDB->quote($this->matriculation).",".
$ilDB->quote($this->client_ip).",".
$ilDB->quote($this->approve_date).",".
$ilDB->quote($this->agree_date).",".
$ilDB->quote($this->active).",".
$ilDB->quote($this->getTimeLimitUnlimited()).",".
$ilDB->quote($this->getTimeLimitUntil()).",".
$ilDB->quote($this->getTimeLimitFrom()).",".
$ilDB->quote($this->getTimeLimitOwner()).",".
$ilDB->quote($this->getAuthMode()).",".
$ilDB->quote($this->getExternalAccount()).",".
$ilDB->quote($this->getProfileIncomplete()).",".
$ilDB->quote($this->im_icq).",".
$ilDB->quote($this->im_yahoo).",".
$ilDB->quote($this->im_msn).",".
$ilDB->quote($this->im_aim).",".
$ilDB->quote($this->im_skype).",".
$ilDB->quote($this->delicious).",".
$ilDB->quote($this->latitude).",".
$ilDB->quote($this->longitude).",".
$ilDB->quote($this->loc_zoom).",".
$ilDB->quote($this->last_password_change_ts).
")";
}
$this->ilias->db->query($q);
// add new entry in usr_defined_data
// ... and update
// CREATE ENTRIES FOR MAIL BOX
include_once ("Services/Mail/classes/class.ilMailbox.php");
$mbox = new ilMailbox($this->id);
$mbox->createDefaultFolder();
include_once "Services/Mail/classes/class.ilMailOptions.php";
$mail_options = new ilMailOptions($this->id);
$mail_options->createMailOptionsEntry();
// create personal bookmark folder tree
include_once "./Services/PersonalDesktop/classes/class.ilBookmarkFolder.php";
$bmf = new ilBookmarkFolder(0, $this->id);
$bmf->createNewBookmarkTree();
}

+ Here is the call graph for this function:

ilObjUser::searchUsers (   $a_search_str,
  $active = 1,
  $a_return_ids_only = false,
  $filter_settings = FALSE 
)
static

STATIC METHOD get the user_ids which correspond a search string.

Parameters
stringsearch string
boolean$activeSearch only for active users
boolean$a_return_ids_onlyReturn only an array of user id's instead of id, login, name, active status
mixed$filter_settingsFilter settings of the user administration view public

Definition at line 2581 of file class.ilObjUser.php.

References $_SESSION, $active, $ilias, $ilLog, ilObject\$ref_id, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilAdminUserSearchGUI\performSearchSimple(), ilObjSurveyAdministrationGUI\searchObject(), and ilObjUserFolderGUI\searchUserObject().

{
// NO CLASS VARIABLES IN STATIC METHODS
global $ilias, $ilDB;
$active_filter = "";
$time_limit_filter = "";
$join_filter = " WHERE ";
$last_login_filter = "";
$without_anonymous_users = "AND usr_data.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID);
if (is_numeric($active) && $active > -1 && $filter_settings === FALSE) $active_filter = " AND active = ".$ilDB->quote($active);
global $ilLog; $ilLog->write("active = $active, filter settings = $filter_settings, active_filter = $active_filter");
if ($filter_settings !== FALSE && strlen($filter_settings))
{
switch ($filter_settings)
{
case -1:
$active_filter = "";
// show all users
break;
case 0:
$active_filter = " AND usr_data.active = " . $ilDB->quote("0");
// show only inactive users
break;
case 1:
$active_filter = " AND usr_data.active = " . $ilDB->quote("1");
// show only active users
break;
case 2:
$time_limit_filter = " AND usr_data.time_limit_unlimited = " . $ilDB->quote("0");
// show only users with limited access
break;
case 3:
// show only users without courses
$join_filter = " LEFT JOIN crs_members ON usr_data.usr_id = crs_members.usr_id WHERE crs_members.usr_id IS NULL AND ";
break;
case 4:
$date = strftime("%Y-%m-%d %H:%I:%S", mktime(0, 0, 0, $_SESSION["user_filter_data"]["m"], $_SESSION["user_filter_data"]["d"], $_SESSION["user_filter_data"]["y"]));
$last_login_filter = sprintf(" AND last_login < %s", $ilDB->quote($date));
break;
case 5:
// show only users with a certain course membership
$ref_id = $_SESSION["user_filter_data"];
if ($ref_id)
{
$join_filter = " LEFT JOIN crs_members ON usr_data.usr_id = crs_members.usr_id WHERE crs_members.obj_id = (SELECT obj_id FROM object_reference WHERE ref_id = " .
$ilDB->quote($ref_id) . ") AND ";
}
break;
case 6:
global $rbacreview;
$ref_id = $_SESSION["user_filter_data"];
if ($ref_id)
{
$rolf = $rbacreview->getRoleFolderOfObject($ref_id);
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
if (is_array($local_roles) && count($local_roles))
{
$role_ids = join("','", $local_roles);
$join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id IN ('" . $role_ids . "') AND ";
}
}
break;
case 7:
global $rbacreview;
$rol_id = $_SESSION["user_filter_data"];
if ($rol_id)
{
$join_filter = sprintf(" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = %s AND ", $ilDB->quote($rol_id));
$without_anonymous_users = "";
}
break;
}
}
// This is a temporary hack to search users by their role
// See Mantis #338. This is a hack due to Mantis #337.
if (strtolower(substr($a_search_str, 0, 5)) == "role:")
{
$query = "SELECT DISTINCT usr_data.usr_id,usr_data.login,usr_data.firstname,usr_data.lastname,usr_data.email ".
"FROM object_data,rbac_ua,usr_data ".
"WHERE object_data.title LIKE ".$ilDB->quote("%".substr($a_search_str,5)."%").
" and object_data.type = 'role' ".
"and rbac_ua.rol_id = object_data.obj_id ".
"and usr_data.usr_id = rbac_ua.usr_id ".
"AND rbac_ua.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID);
}
else
{
$query = "SELECT usr_data.usr_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.email, usr_data.active FROM usr_data ".
$join_filter .
"(usr_data.login LIKE ".$ilDB->quote("%".$a_search_str."%")." ".
"OR usr_data.firstname LIKE ".$ilDB->quote("%".$a_search_str."%")." ".
"OR usr_data.lastname LIKE ".$ilDB->quote("%".$a_search_str."%")." ".
"OR usr_data.email LIKE ".$ilDB->quote("%".$a_search_str."%").") ".
$without_anonymous_users .
$active_filter . $time_limit_filter . $last_login_filter;
}
$ilLog->write($query);
$res = $ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$users[] = array(
"usr_id" => $row->usr_id,
"login" => $row->login,
"firstname" => $row->firstname,
"lastname" => $row->lastname,
"email" => $row->email,
"active" => $row->active);
$ids[] = $row->usr_id;
}
if ($a_return_ids_only)
return $ids ? $ids : array();
else
return $users ? $users : array();
}

+ Here is the caller graph for this function:

ilObjUser::setActive (   $a_active,
  $a_owner = 6 
)

set user active state and updates system fields appropriately public

Parameters
string$a_activethe active state of the user account
string$a_ownerthe id of the person who approved the account, defaults to 6 (root)

Definition at line 2086 of file class.ilObjUser.php.

References setApproveDate(), and ilObject\setOwner().

Referenced by syncActive().

{
if (empty($a_owner))
{
$a_owner = 0;
}
if ($a_active)
{
$this->active = 1;
$this->setApproveDate(date('Y-m-d H:i:s'));
$this->setOwner($a_owner);
}
else
{
$this->active = 0;
$this->setApproveDate('0000-00-00 00:00:00');
$this->setOwner(0);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::setAgreeDate (   $a_str)

set date the user account was accepted by the user 0000-00-00 00:00:00 indicates that the user has not accepted his account public

Returns
void

Definition at line 2074 of file class.ilObjUser.php.

{
$this->agree_date = $a_str;
}
ilObjUser::setApproveDate (   $a_str)

set date the user account was activated 0000-00-00 00:00:00 indicates that the user has not yet been activated public

Returns
void

Definition at line 2043 of file class.ilObjUser.php.

Referenced by setActive().

{
$this->approve_date = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setAuthMode (   $a_str)

set auth mode public

Definition at line 3540 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->auth_mode = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setCity (   $a_str)

set city public

Parameters
stringcity

Definition at line 1668 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->city = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setClientIP (   $a_str)

set client ip number public

Parameters
stringclient ip

Definition at line 1801 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->client_ip = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setComment (   $a_str)

set referral comment public

Parameters
stringhobby

Definition at line 2023 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->referral_comment = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setCountry (   $a_str)

set country public

Parameters
stringcountry

Definition at line 1706 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->country = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setDelicious (   $a_delicious)

Definition at line 4162 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->delicious = $a_delicious;
}

+ Here is the caller graph for this function:

ilObjUser::setDepartment (   $a_str)

set department public

Parameters
stringdepartment

Definition at line 1630 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->department = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setDesktopItemParameters (   $a_item_id,
  $a_type,
  $a_par 
)

set parameters of a desktop item entry

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type
string$a_parparameters

Definition at line 3130 of file class.ilObjUser.php.

References ilObject\getId().

{
global $ilDB;
$q = "UPDATE desktop_item SET parameters = ".$ilDB->quote($a_par)." ".
" WHERE item_id = ".$ilDB->quote($a_item_id)." AND type = ".
$ilDB->quote($a_type)." ".
" AND user_id = ".$ilDB->quote($this->getId())." ";
$this->ilias->db->query($q);
}

+ Here is the call graph for this function:

ilObjUser::setEmail (   $a_str)

set email public

Parameters
stringemail address

Definition at line 1856 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->email = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setExternalAccount (   $a_str)

set external account

note: 3.7.0 uses this field only for cas and soap authentication.

public

Definition at line 3567 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->ext_account = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setFax (   $a_str)

set fax public

Parameters
stringfax

Definition at line 1782 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->fax = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setFirstname (   $a_str)

set firstname public

Parameters
stringfirstname

Definition at line 1573 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->firstname = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setFullname (   $a_title = "",
  $a_firstname = "",
  $a_lastname = "" 
)

builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname.

But you may use the function in static manner. static

Parameters
stringtitle (opt.)
stringfirstname (opt.)
stringlastname (opt.)

Definition at line 1304 of file class.ilObjUser.php.

References $fullname, and $lastname.

Referenced by assignData().

{
$this->fullname = "";
if ($a_title)
{
$fullname = $a_title." ";
}
elseif ($this->utitle)
{
$this->fullname = $this->utitle." ";
}
if ($a_firstname)
{
$fullname .= $a_firstname." ";
}
elseif ($this->firstname)
{
$this->fullname .= $this->firstname." ";
}
if ($a_lastname)
{
return $fullname.$a_lastname;
}
$this->fullname .= $this->lastname;
}

+ Here is the caller graph for this function:

ilObjUser::setGender (   $a_str)

set gender public

Parameters
stringgender

Definition at line 1531 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->gender = substr($a_str,-1);
}

+ Here is the caller graph for this function:

ilObjUser::setHobby (   $a_str)

set hobby public

Parameters
stringhobby

Definition at line 1875 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->hobby = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setInstantMessengerId (   $a_im_type,
  $a_im_id 
)

Definition at line 4150 of file class.ilObjUser.php.

Referenced by assignData().

{
$var = "im_".$a_im_type;
$this->$var = $a_im_id;
}

+ Here is the caller graph for this function:

ilObjUser::setInstitution (   $a_str)

set institution public

Parameters
stringinstitution

Definition at line 1611 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->institution = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setLanguage (   $a_str)

set user language public

Parameters
stringlang_key (i.e. de,en,fr,...)

Definition at line 1894 of file class.ilObjUser.php.

References $_SESSION, and setPref().

Referenced by getProfileAsString().

{
$this->setPref("language",$a_str);
unset($_SESSION['lang']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::setLastLogin (   $a_str)

set user's last login public

Parameters
stringlogin date

Definition at line 1989 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->last_login = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setLastname (   $a_str)

set lastame public

Parameters
stringlastname

Definition at line 1592 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->lastname = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setLastPasswordChangeToNow ( )

Definition at line 2294 of file class.ilObjUser.php.

References getLastPasswordChangeTS(), and setLastPasswordChangeTS().

{
$this->setLastPasswordChangeTS( time() );
$query = "UPDATE usr_data SET usr_data.last_password_change = ? " .
"WHERE usr_data.usr_id = ?";
$statement = $this->db->prepareManip( $query, array('integer','integer') );
$affected = $this->db->execute( $statement, array($this->getLastPasswordChangeTS(),$this->id) );
if($affected) return true;
else return false;
}

+ Here is the call graph for this function:

ilObjUser::setLastPasswordChangeTS (   $a_last_password_change_ts)

Definition at line 1910 of file class.ilObjUser.php.

Referenced by read(), and setLastPasswordChangeToNow().

{
$this->last_password_change_ts = $a_last_password_change_ts;
}

+ Here is the caller graph for this function:

ilObjUser::setLastUpdate (   $a_str)

set last update of user data set public

Parameters
stringdate

Definition at line 2009 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->last_update = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

Definition at line 2321 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->latitude = $a_latitude;
}

+ Here is the caller graph for this function:

ilObjUser::setLocationZoom (   $a_locationzoom)

Set Location Zoom.

Parameters
int$a_locationzoomLocation Zoom

Definition at line 2361 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->loc_zoom = $a_locationzoom;
}

+ Here is the caller graph for this function:

ilObjUser::setLogin (   $a_str)

set login / username public

Parameters
stringusername

Definition at line 1479 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->login = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setLoginAttempts (   $a_login_attempts)

Definition at line 2214 of file class.ilObjUser.php.

Referenced by read().

{
$this->login_attempts = $a_login_attempts;
}

+ Here is the caller graph for this function:

ilObjUser::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

Definition at line 2341 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->longitude = $a_longitude;
}

+ Here is the caller graph for this function:

ilObjUser::setMatriculation (   $a_str)

set matriculation number public

Parameters
stringmatriculation number

Definition at line 1820 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->matriculation = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setPasswd (   $a_str,
  $a_type = IL_PASSWD_PLAIN 
)

set password public

Parameters
stringpasswd

Definition at line 1498 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->passwd = $a_str;
$this->passwd_type = $a_type;
}

+ Here is the caller graph for this function:

ilObjUser::setPhoneHome (   $a_str)

set home phone public

Parameters
stringhome phone

Definition at line 1744 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->phone_home = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setPhoneMobile (   $a_str)

set mobile phone public

Parameters
stringmobile phone

Definition at line 1763 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->phone_mobile = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setPhoneOffice (   $a_str)

set office phone public

Parameters
stringoffice phone

Definition at line 1725 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->phone_office = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setPref (   $a_keyword,
  $a_value 
)

set a user preference

Parameters
stringname of parameter
stringvalue public

Definition at line 1144 of file class.ilObjUser.php.

Referenced by removeUserPicture(), setLanguage(), and writePref().

{
if ($a_keyword != "")
{
$this->prefs[$a_keyword] = $a_value;
}
}

+ Here is the caller graph for this function:

ilObjUser::setProfileIncomplete (   $a_prof_inc)

Definition at line 2237 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->profile_incomplete = (boolean) $a_prof_inc;
}

+ Here is the caller graph for this function:

ilObjUser::setSkin (   $a_str)

set user skin (template set) public

Parameters
stringdirectory name of template set

Definition at line 2167 of file class.ilObjUser.php.

{
// TODO: exception handling (dir exists)
$this->skin = $a_str;
}
ilObjUser::setStreet (   $a_str)

set street public

Parameters
stringstreet

Definition at line 1649 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->street = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setTimeLimitFrom (   $a_from)

Definition at line 2181 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->time_limit_from = $a_from;
}

+ Here is the caller graph for this function:

ilObjUser::setTimeLimitMessage (   $a_time_limit_message)

Definition at line 2205 of file class.ilObjUser.php.

Referenced by assignData().

{
return $this->time_limit_message = $a_time_limit_message;
}

+ Here is the caller graph for this function:

ilObjUser::setTimeLimitOwner (   $a_owner)

Definition at line 2173 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->time_limit_owner = $a_owner;
}

+ Here is the caller graph for this function:

ilObjUser::setTimeLimitUnlimited (   $a_unlimited)

Definition at line 2197 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->time_limit_unlimited = $a_unlimited;
}

+ Here is the caller graph for this function:

ilObjUser::setTimeLimitUntil (   $a_until)

Definition at line 2189 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->time_limit_until = $a_until;
}

+ Here is the caller graph for this function:

ilObjUser::setUserDefinedData (   $a_data)

Definition at line 3929 of file class.ilObjUser.php.

References $data.

{
if(!is_array($a_data))
{
return false;
}
foreach($a_data as $field => $data)
{
#$new_data[$field] = ilUtil::stripSlashes($data);
// Assign it directly to avoid update problems of unchangable fields
$this->user_defined_data[$field] = $data;
}
#$this->user_defined_data = $new_data;
return true;
}
ilObjUser::setUTitle (   $a_str)

set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets the user object's title) public

Parameters
stringtitle

Definition at line 1552 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->utitle = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::setZipcode (   $a_str)

set zipcode public

Parameters
stringzipcode

Definition at line 1687 of file class.ilObjUser.php.

Referenced by assignData().

{
$this->zipcode = $a_str;
}

+ Here is the caller graph for this function:

ilObjUser::syncActive ( )

synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account public

Definition at line 2121 of file class.ilObjUser.php.

References $ilAuth, getLoginFromAuth(), getStoredActive(), getUserIdByLogin(), and setActive().

Referenced by update().

{
global $ilAuth;
$storedActive = 0;
if ($this->getStoredActive($this->id))
{
$storedActive = 1;
}
$currentActive = 0;
if ($this->active)
{
$currentActive = 1;
}
if ((!empty($storedActive) && empty($currentActive)) ||
(empty($storedActive) && !empty($currentActive)))
{
$this->setActive($currentActive, $this->getUserIdByLogin(ilObjUser::getLoginFromAuth()));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::update ( )

updates a record "user" and write it into database public

Reimplemented from ilObject.

Definition at line 540 of file class.ilObjUser.php.

References $ilErr, getAuthMode(), getDelicious(), getExternalAccount(), getInstantMessengerId(), getLastPasswordChangeTS(), getLatitude(), getLocationZoom(), getLongitude(), getProfileIncomplete(), getTimeLimitFrom(), getTimeLimitMessage(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, read(), syncActive(), ilObject\updateOwner(), updateUserDefinedFields(), and writePrefs().

Referenced by removeUserPicture().

{
global $ilErr, $ilDB;
//$this->id = $this->data["Id"];
$this->syncActive();
if (isset($this->agree_date) && (strtotime($this->agree_date) !== false || $this->agree_date == "0000-00-00 00:00:00"))
{
$agreedate_update = "agree_date= ".$ilDB->quote($this->agree_date).",";
} else
{
$agreedate_update = "";
}
$pw_udpate = '';
switch ($this->passwd_type)
{
if(strlen($this->passwd))
{
$pw_update = "i2passwd='', passwd='".md5($this->passwd)."'";
}
else
{
$pw_update = "i2passwd='', passwd='".$this->passwd."'";
}
break;
$pw_update = "i2passwd='', passwd='".$this->passwd."'";
break;
$pw_update = "passwd='', i2passwd='".$this->passwd."'";
break;
default :
$ilErr->raiseError("<b>Error: passwd_type missing in function update()".$this->id."!</b><br />class: ".
get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
}
$q = "UPDATE usr_data SET ".
"gender = ".$ilDB->quote($this->gender).",".
"title= ".$ilDB->quote($this->utitle).",".
"firstname= ".$ilDB->quote($this->firstname).",".
"lastname= ".$ilDB->quote($this->lastname).",".
"email= ".$ilDB->quote($this->email).",".
"hobby= ".$ilDB->quote($this->hobby).",".
"institution= ".$ilDB->quote($this->institution).",".
"department= ".$ilDB->quote($this->department).",".
"street= ".$ilDB->quote($this->street).",".
"city= ".$ilDB->quote($this->city).",".
"zipcode= ".$ilDB->quote($this->zipcode).",".
"country= ".$ilDB->quote($this->country).",".
"phone_office= ".$ilDB->quote($this->phone_office).",".
"phone_home= ".$ilDB->quote($this->phone_home).",".
"phone_mobile= ".$ilDB->quote($this->phone_mobile).",".
"fax= ".$ilDB->quote($this->fax).",".
"referral_comment= ".$ilDB->quote($this->referral_comment).",".
"matriculation= ".$ilDB->quote($this->matriculation).",".
"client_ip= ".$ilDB->quote($this->client_ip).",".
"approve_date= ".$ilDB->quote($this->approve_date).",".
$agreedate_update.
"active= ".$ilDB->quote($this->active).",".
"time_limit_owner= ".$ilDB->quote($this->getTimeLimitOwner()).",".
"time_limit_unlimited= ".$ilDB->quote($this->getTimeLimitUnlimited()).",".
"time_limit_from= ".$ilDB->quote($this->getTimeLimitFrom()).",".
"time_limit_until= ".$ilDB->quote($this->getTimeLimitUntil()).",".
"time_limit_message= ".$ilDB->quote($this->getTimeLimitMessage()).",".
"profile_incomplete = ".$ilDB->quote($this->getProfileIncomplete()).",".
"auth_mode= ".$ilDB->quote($this->getAuthMode()).", ".
"ext_account= ".$ilDB->quote($this->getExternalAccount()).",".
$pw_update.", ".
"im_icq= ".$ilDB->quote($this->getInstantMessengerId('icq')).",".
"im_yahoo= ".$ilDB->quote($this->getInstantMessengerId('yahoo')).",".
"im_msn= ".$ilDB->quote($this->getInstantMessengerId('msn')).",".
"im_aim= ".$ilDB->quote($this->getInstantMessengerId('aim')).",".
"im_skype= ".$ilDB->quote($this->getInstantMessengerId('skype')).",".
"delicious= ".$ilDB->quote($this->getDelicious()).",".
"latitude= ".$ilDB->quote($this->getLatitude()).",".
"longitude= ".$ilDB->quote($this->getLongitude()).",".
"loc_zoom= ".$ilDB->quote($this->getLocationZoom()).",".
"last_update=now()".",".
"last_password_change= ".$ilDB->quote($this->getLastPasswordChangeTS()).
// "ilinc_id= ".$ilDB->quote($this->ilinc_id).",".
// "ilinc_login= ".$ilDB->quote($this->ilinc_login).",".
// "ilinc_passwd= ".$ilDB->quote($this->ilinc_passwd)." ".
" WHERE usr_id= ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
$this->writePrefs();
// update user defined fields
$this->read();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::updateLogin (   $a_login)

update login name

Parameters
stringnew login
Returns
boolean true on success; otherwise false public

Definition at line 996 of file class.ilObjUser.php.

{
global $ilDB;
if (func_num_args() != 1)
{
return false;
}
if (!isset($a_login))
{
return false;
}
//update login
$this->login = $a_login;
$q = "UPDATE usr_data SET ".
"login= ".$ilDB->quote($this->login)." ".
"WHERE usr_id= ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
return true;
}
ilObjUser::updatePassword (   $a_old,
  $a_new1,
  $a_new2 
)

updates password

Parameters
stringold password as plaintext
stringnew password1 as plaintext
stringnew password2 as plaintext
Returns
boolean true on success; otherwise false public

Definition at line 837 of file class.ilObjUser.php.

References _makeIlias2Password(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, and IL_PASSWD_PLAIN.

{
global $ilDB;
if (func_num_args() != 3)
{
return false;
}
if (!isset($a_old) or !isset($a_new1) or !isset($a_new2))
{
return false;
}
if ($a_new1 != $a_new2)
{
return false;
}
// is catched by isset() ???
if ($a_new1 == "" || $a_old == "")
{
return false;
}
//check old password
switch ($this->passwd_type)
{
if ($a_old != $this->passwd)
{
return false;
}
break;
if (md5($a_old) != $this->passwd)
{
return false;
}
break;
if (_makeIlias2Password($a_old) != $this->passwd)
{
return false;
}
break;
}
//update password
$this->passwd = md5($a_new1);
$this->passwd_type = IL_PASSWD_MD5;
$q = "UPDATE usr_data SET ".
"passwd= ".$ilDB->quote($this->passwd)." ".
"WHERE usr_id= ".$ilDB->quote($this->id)." ";
$this->ilias->db->query($q);
return true;
}

+ Here is the call graph for this function:

ilObjUser::updateUserDefinedFields ( )

Definition at line 3951 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by saveAsNew(), and update().

{
global $ilDB;
$fields = '';
foreach($this->user_defined_data as $field => $value)
{
if($field != 'usr_id')
{
$fields .= ("`".$field."` = ".$ilDB->quote($value).", ");
}
}
$query = "REPLACE INTO usr_defined_data ".
"SET ".$fields." ".
"usr_id = ".$ilDB->quote($this->getId());
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjUser::writeAccepted ( )

write accept date of user agreement to db

Definition at line 648 of file class.ilObjUser.php.

References ilObject\getId().

{
global $ilDB;
$q = "UPDATE usr_data SET agree_date = now()".
"WHERE usr_id = ".$ilDB->quote($this->getId());
$ilDB->query($q);
}

+ Here is the call graph for this function:

ilObjUser::writePref (   $a_keyword,
  $a_value 
)

write userpref to user table private

Parameters
stringkeyword
stringvalue

Definition at line 1027 of file class.ilObjUser.php.

References _writePref(), and setPref().

{
ilObjUser::_writePref($this->id, $a_keyword, $a_value);
$this->setPref($a_keyword, $a_value);
}

+ Here is the call graph for this function:

ilObjUser::writePrefs ( )

write all userprefs private

Definition at line 1077 of file class.ilObjUser.php.

Referenced by update().

{
global $ilDB;
//DELETE
$q = "DELETE FROM usr_pref ".
"WHERE usr_id= ".$ilDB->quote($this->id);
$this->ilias->db->query($q);
foreach ($this->prefs as $keyword => $value)
{
//INSERT
$q = "INSERT INTO usr_pref ".
"(usr_id, keyword, value) ".
"VALUES ".
"(".$ilDB->quote($this->id).",".$ilDB->quote($keyword).",".
$ilDB->quote($value).")";
$this->ilias->db->query($q);
}
}

+ Here is the caller graph for this function:

Field Documentation

ilObjUser::$approve_date

Definition at line 92 of file class.ilObjUser.php.

Referenced by getApproveDate().

ilObjUser::$auth_mode

Definition at line 96 of file class.ilObjUser.php.

Referenced by getAuthMode().

ilObjUser::$city

Definition at line 81 of file class.ilObjUser.php.

Referenced by getCity().

ilObjUser::$client_ip

Definition at line 95 of file class.ilObjUser.php.

Referenced by getClientIP().

ilObjUser::$country

Definition at line 83 of file class.ilObjUser.php.

Referenced by getCountry().

ilObjUser::$default_role

Definition at line 134 of file class.ilObjUser.php.

ilObjUser::$delicious

Definition at line 104 of file class.ilObjUser.php.

Referenced by getDelicious().

ilObjUser::$department

Definition at line 79 of file class.ilObjUser.php.

Referenced by getDepartment().

ilObjUser::$email

Definition at line 88 of file class.ilObjUser.php.

Referenced by getEmail().

ilObjUser::$fax

Definition at line 87 of file class.ilObjUser.php.

Referenced by getFax().

ilObjUser::$firstname

Definition at line 73 of file class.ilObjUser.php.

Referenced by getFirstname().

ilObjUser::$fullname

Definition at line 75 of file class.ilObjUser.php.

Referenced by setFullname().

ilObjUser::$gender

Definition at line 71 of file class.ilObjUser.php.

Referenced by getGender(), and getProfileAsString().

ilObjUser::$hobby

Definition at line 89 of file class.ilObjUser.php.

Referenced by getHobby().

ilObjUser::$im_aim

Definition at line 101 of file class.ilObjUser.php.

ilObjUser::$im_icq

Definition at line 98 of file class.ilObjUser.php.

ilObjUser::$im_msn

Definition at line 100 of file class.ilObjUser.php.

ilObjUser::$im_skype

Definition at line 102 of file class.ilObjUser.php.

ilObjUser::$im_yahoo

Definition at line 99 of file class.ilObjUser.php.

ilObjUser::$institution

Definition at line 78 of file class.ilObjUser.php.

Referenced by getInstitution().

ilObjUser::$last_password_change_ts

Definition at line 109 of file class.ilObjUser.php.

Referenced by getLastPasswordChangeTS().

ilObjUser::$lastname

Definition at line 74 of file class.ilObjUser.php.

Referenced by getLastname(), and setFullname().

ilObjUser::$latitude

Definition at line 105 of file class.ilObjUser.php.

Referenced by getLatitude().

ilObjUser::$loc_zoom

Definition at line 107 of file class.ilObjUser.php.

Referenced by getLocationZoom().

ilObjUser::$login

all user related data in single vars public

Definition at line 51 of file class.ilObjUser.php.

Referenced by checkUserId(), getLogin(), getLoginFromAuth(), and isCurrentUserActive().

ilObjUser::$login_attempts

Definition at line 110 of file class.ilObjUser.php.

Referenced by _getLoginAttempts(), and getLoginAttempts().

ilObjUser::$longitude

Definition at line 106 of file class.ilObjUser.php.

Referenced by getLongitude().

ilObjUser::$matriculation

Definition at line 90 of file class.ilObjUser.php.

Referenced by getMatriculation().

ilObjUser::$passwd

Definition at line 53 of file class.ilObjUser.php.

Referenced by getPasswd(), and saveAsNew().

ilObjUser::$passwd_type

Definition at line 54 of file class.ilObjUser.php.

Referenced by getPasswdType().

ilObjUser::$phone_home

Definition at line 85 of file class.ilObjUser.php.

Referenced by getPhoneHome().

ilObjUser::$phone_mobile

Definition at line 86 of file class.ilObjUser.php.

Referenced by getPhoneMobile().

ilObjUser::$phone_office

Definition at line 84 of file class.ilObjUser.php.

Referenced by getPhoneOffice().

ilObjUser::$prefs

Definition at line 119 of file class.ilObjUser.php.

Referenced by _getPreferences(), and readPrefs().

ilObjUser::$referral_comment

Definition at line 91 of file class.ilObjUser.php.

Referenced by getComment().

ilObjUser::$skin

Definition at line 126 of file class.ilObjUser.php.

Referenced by ilObjUser().

ilObjUser::$street

Definition at line 80 of file class.ilObjUser.php.

Referenced by getStreet().

ilObjUser::$user_defined_data = array()

Definition at line 112 of file class.ilObjUser.php.

ilObjUser::$utitle

Definition at line 72 of file class.ilObjUser.php.

Referenced by getUTitle().

ilObjUser::$zipcode

Definition at line 82 of file class.ilObjUser.php.

Referenced by getZipcode().


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