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 | |
_lookupName ($a_user_id) | |
lookup user name | |
refreshLogin () | |
updates the login data of a "user" // TODO set date with now() should be enough public | |
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 | |
_writePref ($a_usr_id, $a_keyword, $a_value) | |
writePrefs () | |
write all userprefs private | |
setPref ($a_keyword, $a_value) | |
set a user preference | |
getPref ($a_keyword) | |
get a user preference | |
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 () | |
get fullname public | |
getLastVisitedLessons () | |
get read lessons, ordered by timestamp public | |
getLessons () | |
get all lessons, unordered public | |
getCourses () | |
get courses the user has access to public | |
getLiterature () | |
get literature bookmarks 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 | |
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 | |
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 | |
setClientIP ($a_ip) | |
set client ip public | |
getClientIP () | |
get client ip 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 date the user account was activated 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 () | |
checkTimeLimit () | |
& | getAppliedUsers () |
isChild ($a_usr_id) | |
__readAppliedUsers ($a_parent_id) | |
checkUserId () | |
isCurrentUserActive () | |
getUserIdByLogin ($a_login) | |
getLoginByUserId ($a_userid) | |
getGroupMemberships ($a_user_id="") | |
_getNumberOfUsersForStyle ($a_skin, $a_style) | |
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) | |
get all desktop items of user and specified type | |
addObjectToClipboard ($a_item_id, $a_type, $a_title) | |
add an item to user's personal clipboard | |
getClipboardObjects ($a_type="") | |
get all clipboard objects of user and specified type | |
_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) | |
setiLincID ($a_str) | |
set iLinc ID public | |
getiLincID () | |
get iLinc ID public | |
Static Public Member Functions | |
getUserIdByEmail ($a_email) | |
STATIC METHOD get the user_id of an email address. | |
searchUsers ($a_search_str) | |
STATIC METHOD get the user_ids which correspond a search string. | |
_search (&$a_search_obj) | |
STATIC METHOD search for user data. | |
_getLinkToObject ($a_id) | |
STATIC METHOD create a link to the object This method used by class.ilSearchGUI.php to a link to the results. | |
updateActiveRoles ($a_user_id) | |
STATIC METHOD updates Session roles. | |
_getAllUserLogins (&$ilias) | |
STATIC METHOD get all user logins. | |
_getAllUserData ($a_fields=NULL) | |
STATIC METHOD get all user data. | |
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 | |
$hobby | |
$matriculation | |
$referral_comment | |
$approve_date | |
$active | |
$ilinc_id | |
$prefs | |
$skin | |
$default_role | |
$ilias |
Definition at line 40 of file class.ilObjUser.php.
ilObjUser::__readAppliedUsers | ( | $ | a_parent_id | ) |
Definition at line 1728 of file class.ilObjUser.php.
References $query, $res, and $row.
Referenced by getAppliedUsers(), and isChild().
{ $query = "SELECT usr_id FROM usr_data ". "WHERE time_limit_owner = '".$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; }
ilObjUser::_getAllUserData | ( | $ | a_fields = NULL |
) | [static] |
STATIC METHOD get all user data.
array | desired columns |
Definition at line 2062 of file class.ilObjUser.php.
Referenced by ilObjTest::createRandomSolutionsForAllUsers(), 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"; } $q = "SELECT ".$select." FROM usr_data "; $r = $ilDB->query($q); while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC)) { $result_arr[] = $row; } } return $result_arr; }
ilObjUser::_getAllUserLogins | ( | &$ | ilias | ) | [static] |
STATIC METHOD get all user logins.
ilias | object |
Definition at line 2042 of file class.ilObjUser.php.
References $ilias, $query, $res, and $row.
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(); }
ilObjUser::_getImportedUserId | ( | $ | i2_id | ) |
Definition at line 2753 of file class.ilObjUser.php.
References ilObject::$id, $query, $res, and $row.
Referenced by ilGroupImportParser::__assignMembers(), ilMailImportParser::handlerBeginTag(), and ilForumImportParser::handlerBeginTag().
{ $query = "SELECT obj_id FROM object_data WHERE import_id = '".$i2_id."'"; $res = $this->ilias->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $id = $row->obj_id; } return $id ? $id : 0; }
ilObjUser::_getLinkToObject | ( | $ | a_id | ) | [static] |
STATIC METHOD create a link to the object This method used by class.ilSearchGUI.php to a link to the results.
int | uniq id |
Definition at line 1945 of file class.ilObjUser.php.
Referenced by ilSearchGUI::__formatUserResult(), and ilSearchResult::createLink().
{ return array("profile.php?user=".$a_id,""); }
ilObjUser::_getNumberOfUsersForStyle | ( | $ | a_skin, | |
$ | a_style | |||
) |
skins and styles
Definition at line 2097 of file class.ilObjUser.php.
References $q.
Referenced by ilObjStyleSettingsGUI::displayStyleSettings(), 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"]; }
ilObjUser::_getUsersForClipboadObject | ( | $ | a_type, | |
$ | a_id | |||
) |
get all users, that have a certain object within their clipboard
string | $a_type object type | |
string | $a_type object type |
Definition at line 2721 of file class.ilObjUser.php.
References $q, $user_set, and $users.
Referenced by ilObjMediaObject::getUsages().
{ global $ilDB; $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE ". "item_id = '$a_id' AND ". "type = '$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; }
ilObjUser::_lookupHasIlias2Password | ( | $ | a_user_login | ) |
check if user has ilias 2 password (imported user)
Definition at line 646 of file class.ilObjUser.php.
ilObjUser::_lookupName | ( | $ | a_user_id | ) |
lookup user name
Definition at line 503 of file class.ilObjUser.php.
Referenced by ilObjSysUserTracking::getAccessPerUserDetail(), ilObjSysUserTracking::getAccessTotalPerUser(), ilHistoryGUI::getHistoryTable(), ilHistoryGUI::getVersionsTable(), and ilObjAssessmentFolderGUI::logsObject().
{ 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"]); }
ilObjUser::_makeIlias2Password | ( | $ | a_passwd | ) |
get encrypted Ilias 2 password (needed for imported ilias 2 users)
Definition at line 638 of file class.ilObjUser.php.
Referenced by _switchToIlias3Password(), and updatePassword().
{
return (crypt($a_passwd,substr($a_passwd,0,2)));
}
ilObjUser::_moveUsersToStyle | ( | $ | a_from_skin, | |
$ | a_from_style, | |||
$ | a_to_skin, | |||
$ | a_to_style | |||
) |
skins and styles
Definition at line 2116 of file class.ilObjUser.php.
References $q, and _writePref().
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); } }
ilObjUser::_search | ( | &$ | a_search_obj | ) | [static] |
STATIC METHOD search for user data.
This method is called from class.ilSearch
object | object of search class public |
Definition at line 1896 of file class.ilObjUser.php.
References $counter, $ilBench, $query, $res, and $row.
Referenced by ilSearch::performSearch().
{ global $ilBench; // 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'"; $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; // LINKS AND TARGETS AREN'T SAVED ANYMORE, SEARCHGUI HAS TO CALL ilObjUser::_getSearchLink // TO GET THE LINK OF SPECIFIC OBJECT #$result_data[$counter]["link"] = "profile.php?user=".$row->usr_id; #$result_data[$counter++]["target"] = ""; } return $result_data ? $result_data : array(); }
ilObjUser::_switchToIlias3Password | ( | $ | a_user, | |
$ | a_pw | |||
) |
Definition at line 665 of file class.ilObjUser.php.
References $ilias, $q, $user_set, and _makeIlias2Password().
{ global $ilias; $q = "SELECT i2passwd FROM usr_data ". "WHERE login = '".$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='".md5($a_pw)."', i2passwd=''". "WHERE login = '".$a_user."'"; $ilias->db->query($q); return true; } } return false; }
ilObjUser::_writePref | ( | $ | a_usr_id, | |
$ | a_keyword, | |||
$ | a_value | |||
) |
Definition at line 729 of file class.ilObjUser.php.
References $q.
Referenced by _moveUsersToStyle(), and writePref().
{ global $ilDB; //DELETE $q = "DELETE FROM usr_pref ". "WHERE usr_id='".$a_usr_id."' ". "AND keyword='".$a_keyword."'"; $ilDB->query($q); //INSERT if ($a_value != "") { $q = "INSERT INTO usr_pref ". "(usr_id, keyword, value) ". "VALUES ". "('".$a_usr_id."', '".$a_keyword."', '".$a_value."')"; $ilDB->query($q); } }
ilObjUser::addDesktopItem | ( | $ | a_item_id, | |
$ | a_type, | |||
$ | a_par = "" | |||
) |
add an item to user's personal desktop
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type |
Definition at line 2141 of file class.ilObjUser.php.
References $d, $q, and ilObject::getId().
{ $q = "SELECT * FROM desktop_item WHERE ". "item_id = '$a_item_id' AND type = '$a_type' AND user_id = '". $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 ". " ('$a_item_id','$a_type','".$this->getId()."' , '$a_par')"; $this->ilias->db->query($q); } }
ilObjUser::addObjectToClipboard | ( | $ | a_item_id, | |
$ | a_type, | |||
$ | a_title | |||
) |
add an item to user's personal clipboard
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type |
Definition at line 2672 of file class.ilObjUser.php.
References $d, $q, and ilObject::getId().
{ $q = "SELECT * FROM personal_clipboard WHERE ". "item_id = '$a_item_id' AND type = '$a_type' AND user_id = '". $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 personal_clipboard (item_id, type, user_id, title) VALUES ". " ('$a_item_id','$a_type','".$this->getId()."', '".$a_title."')"; $this->ilias->db->query($q); } }
ilObjUser::assignData | ( | $ | a_data | ) |
loads a record "user" from array public
array | userdata |
Definition at line 263 of file class.ilObjUser.php.
References $ilErr, setCity(), setComment(), setCountry(), setDepartment(), setEmail(), setFax(), setFirstname(), setFullname(), setGender(), setHobby(), setiLincID(), setInstitution(), setLastLogin(), setLastname(), setLastUpdate(), setLogin(), setMatriculation(), setPasswd(), setPhoneHome(), setPhoneMobile(), setPhoneOffice(), 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"] != "********") { $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"]); // 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->accept_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']); //iLinc $this->setiLincID($a_data['ilinc_id']); }
ilObjUser::checkTimeLimit | ( | ) |
Definition at line 1694 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; }
ilObjUser::checkUserId | ( | ) |
Definition at line 1748 of file class.ilObjUser.php.
References $data.
ilObjUser::delete | ( | ) |
deletes a user public
integer | user_id |
Reimplemented from ilObject.
Definition at line 844 of file class.ilObjUser.php.
References $q, $rbacadmin, ilCourseObjectiveResult::_deleteAll(), ilLinkCheckNotify::_deleteUser(), ilObjForum::_deleteUser(), and ilObject::getId().
{ global $rbacadmin; // remove mailbox / update sent mails include_once ("classes/class.ilMailbox.php"); $mailbox = new ilMailbox($this->getId()); $mailbox->delete(); $mailbox->updateMailsOfDeletedUser(); // delete user_account $this->ilias->db->query("DELETE FROM usr_data WHERE usr_id='".$this->getId()."'"); // delete user_prefs $this->ilias->db->query("DELETE FROM usr_pref WHERE usr_id='".$this->getId()."'"); // delete user_session $this->ilias->db->query("DELETE FROM usr_session WHERE user_id='".$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='".$this->getId()."'"; $this->ilias->db->query($q); $q = "DELETE FROM bookmark_data WHERE user_id='".$this->getId()."'"; $this->ilias->db->query($q); // DELETE FORUM ENTRIES (not complete in the moment) include_once './classes/class.ilObjForum.php'; ilObjForum::_deleteUser($this->getId()); // Delete link check notify entries include_once './classes/class.ilLinkCheckNotify.php'; ilLinkCheckNotify::_deleteUser($this->getId()); // Delete crs objectives results include_once './course/classes/class.ilCourseObjectiveResult.php'; ilCourseObjectiveResult::_deleteAll($this->getId()); // delete object data parent::delete(); return true; }
ilObjUser::dropDesktopItem | ( | $ | a_item_id, | |
$ | a_type | |||
) |
drop an item from user's personal desktop
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type |
Definition at line 2180 of file class.ilObjUser.php.
References $q.
ilObjUser::getActive | ( | ) |
get user active state public
Definition at line 1592 of file class.ilObjUser.php.
{
return $this->active;
}
& ilObjUser::getAppliedUsers | ( | ) |
Definition at line 1707 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(); }
ilObjUser::getApproveDate | ( | ) |
get date the user account was activated public
Definition at line 1556 of file class.ilObjUser.php.
{
return $this->approve_date;
}
ilObjUser::getCity | ( | ) |
ilObjUser::getClientIP | ( | ) |
get client ip public
Definition at line 1534 of file class.ilObjUser.php.
{ // XXX To be implemented return null; }
ilObjUser::getClipboardObjects | ( | $ | a_type = "" |
) |
get all clipboard objects of user and specified type
Definition at line 2691 of file class.ilObjUser.php.
References $obj, $q, and ilObject::_lookupTitle().
{ $type_str = ($a_type != "") ? " AND type = '$a_type' " : ""; $q = "SELECT * FROM personal_clipboard WHERE ". "user_id = '".$this->getId()."' ". $type_str; $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"]); } return $objects; }
ilObjUser::getComment | ( | ) |
get referral comment public
Definition at line 1515 of file class.ilObjUser.php.
{
return $this->referral_comment;
}
ilObjUser::getCountry | ( | ) |
ilObjUser::getCourses | ( | ) |
get courses the user has access to public
Definition at line 1004 of file class.ilObjUser.php.
References ilObject::$lng.
{ global $lng; //initialize array $courses = array(); //query $sql = "SELECT * FROM courses WHERE user_fk='".$this->id."' AND read=1"; $courses[] = array( "id" => 1, "title" => "Course 1", "desc" => "description of course one", "content" => "This is Course One", "datetime" => date("Y-m-d") ); return $courses; }
ilObjUser::getCurrentLanguage | ( | ) |
returns the current language (may differ from user's pref setting!)
Definition at line 1462 of file class.ilObjUser.php.
References $_SESSION.
{ return $_SESSION['lang']; }
ilObjUser::getDepartment | ( | ) |
get department public
Definition at line 1223 of file class.ilObjUser.php.
{
return $this->department;
}
ilObjUser::getDesktopItems | ( | $ | a_types | ) |
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... (maybe it should be a method in all object classes)
Definition at line 2220 of file class.ilObjUser.php.
References $ilUser, $q, $query, $rbacsystem, $result, $row, ilObjGlossary::_lookupOnline(), ilObjSAHSLearningModule::_lookupOnline(), ilObjFileBasedLM::_lookupOnline(), and ilObjContentObject::_lookupOnline().
{ global $ilUser, $rbacsystem; if (!is_array($a_types)) { $a_types = array($a_types); } $items = array(); $foundsurveys = array(); foreach($a_types as $a_type) { switch ($a_type) { case "lm": case "glo": case "tst": case "svy": case "dbk": case "sahs": case "htlm": case "mep": case "spl": case "qpl": $q = "SELECT obj.description, oref.ref_id, obj.title, parameters, oref.obj_id 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 = '$a_type' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { // check wether objects are online $skip = false; $continue_link = ""; switch($a_type) { case "lm": case "dbk": include_once("content/classes/class.ilObjContentObject.php"); if (!ilObjContentObject::_lookupOnline($item_rec["obj_id"])) { if (!$rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $skip = true; } } break; case "htlm": include_once("content/classes/class.ilObjFileBasedLM.php"); if (!ilObjFileBasedLM::_lookupOnline($item_rec["obj_id"])) { if (!$rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $skip = true; } } break; case "sahs": include_once("content/classes/class.ilObjSAHSLearningModule.php"); if (!ilObjSAHSLearningModule::_lookupOnline($item_rec["obj_id"])) { if (!$rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $skip = true; } } break; case "glo": include_once("content/classes/class.ilObjGlossary.php"); if (!ilObjGlossary::_lookupOnline($item_rec["obj_id"])) { if (!$rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $skip = true; } } break; } if($a_type == "glo") { $link = "content/glossary_presentation.php?ref_id=".$item_rec["ref_id"]. "&obj_id=".$item_rec["parameters"]; $edit_link = "content/glossary_edit.php?ref_id=".$item_rec["ref_id"]. "&obj_id=".$item_rec["parameters"]; $target = "bottom"; } elseif ($a_type == "sahs") { $link = "content/sahs_presentation.php?ref_id=".$item_rec["ref_id"]. "&obj_id=".$item_rec["parameters"]; $edit_link = "content/sahs_edit.php?ref_id=".$item_rec["ref_id"]; $target = "ilContObj".$item_rec["obj_id"]; } elseif ($a_type == "htlm") { $link = "content/fblm_presentation.php?ref_id=".$item_rec["ref_id"]; $edit_link = "content/fblm_edit.php?ref_id=".$item_rec["ref_id"]; $target = "ilContObj".$item_rec["obj_id"]; } elseif ($a_type == "tst") { $link = "assessment/test.php?ref_id=".$item_rec["ref_id"]."&cmd=run"; $target = "bottom"; $whereclause .= sprintf("obj_fi = %s OR ", $this->ilias->db->quote($item_rec["obj_id"])); $edit_link = ""; } elseif ($a_type == "svy") { $link = "survey/survey.php?ref_id=".$item_rec["ref_id"]."&cmd=run"; $target = "bottom"; $edit_link = ""; array_push($foundsurveys, $item_rec["obj_id"]); } elseif ($a_type == "mep") { $link = "content/mep_edit.php?ref_id=".$item_rec["ref_id"]; $target = "bottom"; $edit_link = ""; } elseif ($a_type == "qpl") { $link = "assessment/questionpool.php?ref_id=".$item_rec["ref_id"]; $target = "bottom"; $edit_link = ""; } elseif ($a_type == "spl") { $link = "survey/questionpool.php?ref_id=".$item_rec["ref_id"]; $target = "bottom"; $edit_link = ""; } else { if ($item_rec["parameters"] != "") { $continue_link = "content/lm_presentation.php?ref_id=".$item_rec["ref_id"]. "&obj_id=".$item_rec["parameters"]; } $link = "content/lm_presentation.php?ref_id=".$item_rec["ref_id"]; $edit_link = "content/lm_edit.php?ref_id=".$item_rec["ref_id"]; $target = "ilContObj".$item_rec["obj_id"]; } if (!$skip) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "parameters" => $item_rec["parameters"], "description" => $item_rec["description"], "link" => $link, "target" => $target, "edit_link" => $edit_link, "continue_link" => $continue_link); } } break; case "frm": include_once './classes/class.ilRepositoryExplorer.php'; $q = "SELECT 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 = 'frm' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => 'repository.php?ref_id='.$item_rec['ref_id'], "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type. $item_rec["ref_id"]]["edit_link"] = 'repository.php?ref_id='.$item_rec['ref_id'].'&cmd=edit'; } } break; case "cat": case "fold": $q = "SELECT 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 = '$a_type' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?ref_id=".$item_rec["ref_id"], "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "repository.php?cmd=edit&ref_id=".$item_rec["ref_id"]; } } break; case "webr": $q = "SELECT 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 = '$a_type' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "link/link_resources.php?ref_id=".$item_rec["ref_id"], "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "link/link_resources.php?cmd=edit&ref_id=".$item_rec["ref_id"]; } } break; case "grp": $q = "SELECT 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 = '$a_type' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?ref_id=".$item_rec["ref_id"]."&cmdClass=ilobjgroupgui", "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "repository.php?cmdClass=ilobjgroupgui&cmd=edit&ref_id=".$item_rec["ref_id"]; } } break; case "crs": $q = "SELECT 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 = 'crs' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?ref_id=".$item_rec["ref_id"]."&cmdClass=ilobjcoursegui", "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "repository.php?cmdClass=ilobjcoursegui&ref_id=".$item_rec["ref_id"]; } } break; case "file": $q = "SELECT 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 = 'file' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?cmd=sendfile&ref_id=".$item_rec["ref_id"]); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "repository.php?cmd=edit&cmdClass=ilobjfilegui&ref_id=".$item_rec["ref_id"]; } } break; case "exc": $q = "SELECT 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 = 'exc' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "exercise.php?cmd=view&ref_id=".$item_rec["ref_id"], "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "exercise.php?cmd=edit&ref_id=".$item_rec["ref_id"]; } } break; case "chat": $q = "SELECT 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 = 'chat' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "chat/chat_rep.php?ref_id=".$item_rec["ref_id"], "target" => "bottom"); if ($rbacsystem->checkAccess("write", $item_rec["ref_id"])) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]]["edit_link"] = "chat/chat_rep.php?cmd=edit&ref_id=".$item_rec["ref_id"]; } } break; case "icrs": $q = "SELECT 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 = 'icrs' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?ref_id=".$item_rec["ref_id"]."&cmdClass=ilobjilinccoursegui", "target" => "bottom"); } break; case "icla": $q = "SELECT 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 = 'icla' AND ". "it.user_id = '".$this->getId()."' ". "ORDER BY title"; $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC)) { // heavy workaround by setting cmdNode manually !!! $items[$item_rec["title"].$a_type.$item_rec["ref_id"]] = array ("type" => $a_type, "id" => $item_rec["ref_id"], "title" => $item_rec["title"], "description" => $item_rec["description"], "link" => "repository.php?cmd=join&ref_id=".$item_rec["ref_id"]."&cmdClass=ilobjilincclassroomgui&cmdNode=60", "target" => "_blank"); } break; } if ($a_type == "svy" && !empty($foundsurveys)) { $query = sprintf("SELECT survey_finished.state, survey_survey.obj_fi, object_reference.ref_id FROM survey_finished, survey_survey, object_reference WHERE survey_finished.survey_fi = survey_survey.survey_id AND object_reference.obj_id = survey_survey.obj_fi AND survey_survey.obj_fi IN (%s)", join($foundsurveys, ",") ); $result = $this->ilias->db->query($query); $states = array(); while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) { if (strcmp($row["state"], "") == 0) { $states[$row["ref_id"]] = $row["state"]; } else { $states[$row["ref_id"]] = (int)$row["state"]; } } foreach ($items as $key => $value) { $items[$key]["finished"] = $states[$value["id"]]; } } if ($a_type == "tst") { $whereclause = preg_replace("/ OR $/", "", $whereclause); if ($whereclause) { $status_array = array(); $whereclause = "WHERE ($whereclause) AND "; $q = sprintf("SELECT tst_tests.test_type_fi, tst_tests.starting_time, object_reference.ref_id as id, tst_tests.nr_of_tries, tst_active.tries FROM tst_tests, tst_active, object_reference $whereclause tst_tests.test_id = tst_active.test_fi AND object_reference.obj_id = tst_tests.obj_fi AND tst_active.user_fi = %s", $this->ilias->db->quote($ilUser->id) ); $item_set = $this->ilias->db->query($q); while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_OBJECT)) { $status_array[$item_rec->id] = $item_rec; } foreach ($items as $key => $value) { $items[$key]["nr_of_tries"] = $status_array[$value["id"]]->nr_of_tries; $items[$key]["used_tries"] = $status_array[$value["id"]]->tries; if ($status_array[$value["id"]]->test_type_fi == 1) { // assessment test. check starting time if ($status_array[$value["id"]]->starting_time) { preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $status_array[$value["id"]]->starting_time, $matches); $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $now = mktime(); if ($now < $epoch_time) { $items[$key]["starting_time_not_reached"] = 1; } } } } } } } ksort($items); return $items; }
ilObjUser::getEmail | ( | ) |
get email address public
Definition at line 1413 of file class.ilObjUser.php.
{
return $this->email;
}
ilObjUser::getFax | ( | ) |
ilObjUser::getFirstname | ( | ) |
get firstname public
Definition at line 1166 of file class.ilObjUser.php.
{
return $this->firstname;
}
ilObjUser::getFullname | ( | ) |
get fullname public
Definition at line 937 of file class.ilObjUser.php.
References ilUtil::stripSlashes().
{ return ilUtil::stripSlashes($this->fullname); }
ilObjUser::getGender | ( | ) |
ilObjUser::getGroupMemberships | ( | $ | a_user_id = "" |
) |
Definition at line 1955 of file class.ilObjUser.php.
References $rbacreview, $roles, $tree, $user_id, and 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; }
ilObjUser::getHobby | ( | ) |
ilObjUser::getiLincID | ( | ) |
get iLinc ID public
Definition at line 2778 of file class.ilObjUser.php.
{
return $this->ilinc_id;
}
ilObjUser::getInstitution | ( | ) |
get institution public
Definition at line 1204 of file class.ilObjUser.php.
{
return $this->institution;
}
ilObjUser::getLanguage | ( | ) |
returns a 2char-language-string public
Definition at line 1453 of file class.ilObjUser.php.
{ return $this->prefs["language"]; }
ilObjUser::getLastLogin | ( | ) |
returns last login date public
Definition at line 1482 of file class.ilObjUser.php.
{
return $this->last_login;
}
ilObjUser::getLastname | ( | ) |
get lastname public
Definition at line 1185 of file class.ilObjUser.php.
{
return $this->lastname;
}
ilObjUser::getLastUpdate | ( | ) |
Definition at line 1496 of file class.ilObjUser.php.
{
return $this->last_update;
}
ilObjUser::getLastVisitedLessons | ( | ) |
get read lessons, ordered by timestamp public
Definition at line 948 of file class.ilObjUser.php.
{ //query $q = "SELECT * FROM lo_access ". "WHERE usr_id='".$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::getLessons | ( | ) |
get all lessons, unordered public
Definition at line 976 of file class.ilObjUser.php.
{ //query $q = "SELECT * FROM lo_access ". "WHERE usr_id='".$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::getLiterature | ( | ) |
get literature bookmarks public
Definition at line 1030 of file class.ilObjUser.php.
{ //initialize array $literature = array(); //query $sql = "SELECT * FROM literature"; $literature[] = array( "id" => 1, "url" => "http://www.gutenberg.de", "desc" => "project gutenberg", ); return $literature; }
ilObjUser::getLogin | ( | ) |
get login / username public
Definition at line 1072 of file class.ilObjUser.php.
{
return $this->login;
}
ilObjUser::getLoginByUserId | ( | $ | a_userid | ) |
Definition at line 1829 of file class.ilObjUser.php.
References $ilias, $query, and $row.
Referenced by ilObjPaymentSettingsGUI::editVendor().
{ global $ilias; $query = "SELECT login FROM usr_data ". "WHERE usr_id = '".$a_userid."'"; $row = $ilias->db->getRow($query,DB_FETCHMODE_OBJECT); return $row->login ? $row->login : false; }
ilObjUser::getMatriculation | ( | ) |
get matriculation number public
Definition at line 1394 of file class.ilObjUser.php.
{
return $this->matriculation;
}
ilObjUser::getPasswd | ( | ) |
get password
Definition at line 1095 of file class.ilObjUser.php.
{
return $this->passwd;
}
ilObjUser::getPasswdType | ( | ) |
get password type
Definition at line 1105 of file class.ilObjUser.php.
{
return $this->passwd_type;
}
ilObjUser::getPhoneHome | ( | ) |
get home phone public
Definition at line 1337 of file class.ilObjUser.php.
{
return $this->phone_home;
}
ilObjUser::getPhoneMobile | ( | ) |
get mobile phone public
Definition at line 1356 of file class.ilObjUser.php.
{
return $this->phone_mobile;
}
ilObjUser::getPhoneOffice | ( | ) |
get office phone public
Definition at line 1318 of file class.ilObjUser.php.
{
return $this->phone_office;
}
ilObjUser::getPref | ( | $ | a_keyword | ) |
get a user preference
string | name of parameter public |
Definition at line 800 of file class.ilObjUser.php.
{
return $this->prefs[$a_keyword];
}
ilObjUser::getStoredActive | ( | $ | a_id | ) |
get user active state
integer | $a_id user id public |
Definition at line 1629 of file class.ilObjUser.php.
References $ilias, $query, and $row.
Referenced by syncActive().
{ global $ilias; $query = "SELECT active FROM usr_data ". "WHERE usr_id = '".$a_id."'"; $row = $ilias->db->getRow($query,DB_FETCHMODE_OBJECT); return $row->active ? true : false; }
ilObjUser::getStreet | ( | ) |
ilObjUser::getTimeLimitFrom | ( | ) |
Definition at line 1664 of file class.ilObjUser.php.
Referenced by checkTimeLimit(), saveAsNew(), and update().
{
return $this->time_limit_from ? $this->time_limit_from : time();
}
ilObjUser::getTimeLimitMessage | ( | ) |
Definition at line 1688 of file class.ilObjUser.php.
{
return $this->time_limit_message;
}
ilObjUser::getTimeLimitOwner | ( | ) |
Definition at line 1656 of file class.ilObjUser.php.
Referenced by saveAsNew(), and update().
{
return $this->time_limit_owner;
}
ilObjUser::getTimeLimitUnlimited | ( | ) |
Definition at line 1680 of file class.ilObjUser.php.
Referenced by checkTimeLimit(), and update().
{
return $this->time_limit_unlimited;
}
ilObjUser::getTimeLimitUntil | ( | ) |
Definition at line 1672 of file class.ilObjUser.php.
Referenced by checkTimeLimit(), saveAsNew(), and update().
{
return $this->time_limit_until ? $this->time_limit_until : time();
}
ilObjUser::getUserIdByEmail | ( | $ | a_email | ) | [static] |
STATIC METHOD get the user_id of an email address.
string | email of user |
Definition at line 1812 of file class.ilObjUser.php.
ilObjUser::getUserIdByLogin | ( | $ | a_login | ) |
Definition at line 1792 of file class.ilObjUser.php.
References $ilias, $query, and $row.
Referenced by ilPaymentTrusteeGUI::addUser(), ilObjPaymentSettingsGUI::addVendorObject(), ilMail::checkRecipients(), ilMail::getEmailsOfRecipients(), ilMail::getUserIds(), ilUserImportParser::importEndTag(), ilSoapUserAdministration::lookupUser(), submitAssistanceForm(), syncActive(), ilObjCourse::validate(), and ilUserImportParser::verifyEndTag().
{ global $ilias; $query = "SELECT usr_id FROM usr_data ". "WHERE login = '".$a_login."'"; $row = $ilias->db->getRow($query,DB_FETCHMODE_OBJECT); return $row->usr_id ? $row->usr_id : 0; }
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 1147 of file class.ilObjUser.php.
{
return $this->utitle;
}
ilObjUser::getZipcode | ( | ) |
ilObjUser::hasAcceptedUserAgreement | ( | ) |
check wether user has accepted user agreement
Definition at line 1049 of file class.ilObjUser.php.
References login().
{ if ($this->accept_date != "0000-00-00 00:00:00" || $this->login == "root") { return true; } return false; }
ilObjUser::ilObjUser | ( | $ | a_user_id = 0 , |
|
$ | a_call_by_reference = false | |||
) |
Constructor public.
integer | user_id |
Definition at line 128 of file class.ilObjUser.php.
References $ilias, ilObject::ilObject(), read(), and ilObject::setId().
{ global $ilias; // init variables $this->ilias =& $ilias; $this->type = "usr"; $this->ilObject($a_user_id, $a_call_by_reference); $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 if (strpos($_SERVER["HTTP_USER_AGENT"],"Windows CE") > 0) { $this->skin = "pda"; } else { $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"); } }
ilObjUser::isChild | ( | $ | a_usr_id | ) |
Definition at line 1715 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); }
ilObjUser::isCurrentUserActive | ( | ) |
Definition at line 1768 of file class.ilObjUser.php.
References $data.
ilObjUser::isDesktopItem | ( | $ | a_item_id, | |
$ | a_type | |||
) |
check wether an item is on the users desktop or not
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type |
Definition at line 2196 of file class.ilObjUser.php.
References $d, $q, and ilObject::getId().
{ $q = "SELECT * FROM desktop_item WHERE ". "item_id = '$a_item_id' AND type = '$a_type' AND user_id = '". $this->getId()."'"; $item_set = $this->ilias->db->query($q); if ($d = $item_set->fetchRow()) { return true; } else { return false; } }
ilObjUser::read | ( | ) |
loads a record "user" from database private
Definition at line 180 of file class.ilObjUser.php.
References $data, $ilErr, $q, assignData(), and readPrefs().
Referenced by ilObjUser(), and update().
{ global $ilErr; // 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='".$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"]); // 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 if ($this->prefs["skin"] == "" || file_exists($this->ilias->tplPath."/".$this->prefs["skin"]) == false) { $this->prefs["skin"] = $this->oldPrefs["skin"]; } //pda support if (strpos($_SERVER["HTTP_USER_AGENT"],"Windows CE") > 0) { $this->skin = "pda"; } else { $this->skin = $this->prefs["skin"]; } //check style-setting (skins could have more than one stylesheet if ($this->prefs["style"] == "" || file_exists($this->ilias->tplPath."/".$this->skin."/".$this->prefs["style"].".css") == false) { //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); } parent::read(); }
ilObjUser::readPrefs | ( | ) |
get all user preferences private
Definition at line 810 of file class.ilObjUser.php.
Referenced by read().
{ if (is_array($this->prefs)) { $this->oldPrefs = $this->prefs; } $this->prefs = array(); $q = "SELECT * FROM usr_pref WHERE usr_id='".$this->id."'"; // $q = "SELECT * FROM usr_pref WHERE value='"y"'"; $r = $this->ilias->db->query($q); while($row = $r->fetchRow(DB_FETCHMODE_ASSOC)) { $this->prefs[$row["keyword"]] = $row["value"]; } // while return $r->numRows(); }
ilObjUser::refreshLogin | ( | ) |
updates the login data of a "user" // TODO set date with now() should be enough public
Definition at line 522 of file class.ilObjUser.php.
References $q.
ilObjUser::removeObjectFromClipboard | ( | $ | a_item_id, | |
$ | a_type | |||
) |
remove object from user's personal clipboard
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type |
Definition at line 2745 of file class.ilObjUser.php.
References $q.
ilObjUser::resetPassword | ( | $ | a_new1, | |
$ | a_new2 | |||
) |
reset password
string | new password1 as plaintext | |
string | new password2 as plaintext |
Definition at line 606 of file class.ilObjUser.php.
References $q.
{ 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='".$this->passwd."' ". "WHERE usr_id='".$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
boolean | user data from formular (addSlashes) or not (prepareDBString) |
Definition at line 326 of file class.ilObjUser.php.
References $ilErr, $mbox, $q, ilUtil::addSlashes(), getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUntil(), login(), and ilUtil::prepareDBString().
{ global $ilErr; switch ($this->passwd_type) { case IL_PASSWD_PLAIN: $pw_field = "passwd"; $pw_value = md5($this->passwd); break; case IL_PASSWD_MD5: $pw_field = "passwd"; $pw_value = $this->passwd; break; case IL_PASSWD_CRYPT: $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,approve_date,active," . "time_limit_unlimited,time_limit_until,time_limit_from,time_limit_owner) " . "VALUES " . "('".$this->id."','".$this->login."','".$pw_value."', " . "'".ilUtil::addSlashes($this->firstname)."','".ilUtil::addSlashes($this->lastname)."', " . "'".ilUtil::addSlashes($this->utitle)."','".ilUtil::addSlashes($this->gender)."', " . "'".ilUtil::addSlashes($this->email)."','".ilUtil::addSlashes($this->hobby)."', " . "'".ilUtil::addSlashes($this->institution)."','".ilUtil::addSlashes($this->department)."', " . "'".ilUtil::addSlashes($this->street)."', " . "'".ilUtil::addSlashes($this->city)."','".ilUtil::addSlashes($this->zipcode)."','".ilUtil::addSlashes($this->country)."', " . "'".ilUtil::addSlashes($this->phone_office)."','".ilUtil::addSlashes($this->phone_home)."', " . "'".ilUtil::addSlashes($this->phone_mobile)."','".ilUtil::addSlashes($this->fax)."', 0, now(), now(), " . "'".ilUtil::addSlashes($this->referral_comment)."', '". ilUtil::addSlashes($this->matriculation) . "', '" .$this->approve_date."', '".$this->active."', " . "'".$this->getTimeLimitUnlimited()."','" . $this->getTimeLimitUntil()."','".$this->getTimeLimitFrom()."','".$this->getTimeLimitOwner()."'" . ")"; } 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,approve_date,active," . "time_limit_unlimited,time_limit_until,time_limit_from,time_limit_owner) " . "VALUES " . "('".$this->id."','".$this->login."','".$pw_value."', " . "'".ilUtil::prepareDBString($this->firstname)."','".ilUtil::prepareDBString($this->lastname)."', " . "'".ilUtil::prepareDBString($this->utitle)."','".ilUtil::prepareDBString($this->gender)."', " . "'".ilUtil::prepareDBString($this->email)."','".ilUtil::prepareDBString($this->hobby)."', " . "'".ilUtil::prepareDBString($this->institution)."','".ilUtil::prepareDBString($this->department)."', " . "'".ilUtil::prepareDBString($this->street)."', " . "'".ilUtil::prepareDBString($this->city)."','".ilUtil::prepareDBString($this->zipcode)."','".ilUtil::prepareDBString($this->country)."', " . "'".ilUtil::prepareDBString($this->phone_office)."','".ilUtil::prepareDBString($this->phone_home)."', " . "'".ilUtil::prepareDBString($this->phone_mobile)."','".ilUtil::prepareDBString($this->fax)."', 0, now(), now(), " . "'".ilUtil::prepareDBString($this->referral_comment)."', '".ilUtil::prepareDBString($this->matriculation)."', '".$this->approve_date."','".$this->active."', " . "'".$this->getTimeLimitUnlimited()."','".$this->getTimeLimitUntil()."','".$this->getTimeLimitFrom()."','".$this->getTimeLimitOwner()."'" . ")"; } $this->ilias->db->query($q); // CREATE ENTRIES FOR MAIL BOX include_once ("classes/class.ilMailbox.php"); $mbox = new ilMailbox($this->id); $mbox->createDefaultFolder(); include_once "classes/class.ilMailOptions.php"; $mail_options = new ilMailOptions($this->id); $mail_options->createMailOptionsEntry(); // create personal bookmark folder tree include_once "classes/class.ilBookmarkFolder.php"; $bmf = new ilBookmarkFolder(0, $this->id); $bmf->createNewBookmarkTree(); }
ilObjUser::searchUsers | ( | $ | a_search_str | ) | [static] |
STATIC METHOD get the user_ids which correspond a search string.
string | search string public |
Definition at line 1848 of file class.ilObjUser.php.
References $ilias, $query, $res, and $row.
Referenced by ilObjUserFolderGUI::searchUserObject().
{ // NO CLASS VARIABLES IN STATIC METHODS global $ilias; // 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 '%".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 != '".ANONYMOUS_USER_ID."'"; } else { $query = "SELECT usr_id,login,firstname,lastname,email,active FROM usr_data ". "WHERE (login LIKE '%".$a_search_str."%' ". "OR firstname LIKE '%".$a_search_str."%' ". "OR lastname LIKE '%".$a_search_str."%' ". "OR email LIKE '%".$a_search_str."%') ". "AND usr_id != '".ANONYMOUS_USER_ID."'"; } $res = $ilias->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $ids[] = array( "usr_id" => $row->usr_id, "login" => $row->login, "firstname" => $row->firstname, "lastname" => $row->lastname, "email" => $row->email, "active" => $row->active); } return $ids ? $ids : array(); }
ilObjUser::setActive | ( | $ | a_active, | |
$ | a_owner = 6 | |||
) |
set user active state and updates system fields appropriately public
string | $a_active the active state of the user account | |
string | $a_owner the id of the person who approved the account, defaults to 6 (root) |
Definition at line 1567 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); } }
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
Definition at line 1546 of file class.ilObjUser.php.
Referenced by setActive().
{ $this->approve_date = $a_str; }
ilObjUser::setCity | ( | $ | a_str | ) |
set city public
string | city |
Definition at line 1252 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->city = $a_str; }
ilObjUser::setClientIP | ( | $ | a_ip | ) |
set client ip public
string | hobby |
Definition at line 1525 of file class.ilObjUser.php.
{
// XXX To be implemented
}
ilObjUser::setComment | ( | $ | a_str | ) |
set referral comment public
string | hobby |
Definition at line 1506 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->referral_comment = $a_str; }
ilObjUser::setCountry | ( | $ | a_str | ) |
set country public
string | country |
Definition at line 1290 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->country = $a_str; }
ilObjUser::setDepartment | ( | $ | a_str | ) |
set department public
string | department |
Definition at line 1214 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->department = $a_str; }
ilObjUser::setDesktopItemParameters | ( | $ | a_item_id, | |
$ | a_type, | |||
$ | a_par | |||
) |
set parameters of a desktop item entry
int | $a_item_id ref_id for objects, that are in the main tree (learning modules, forums) obj_id for others | |
string | $a_type object type | |
string | $a_par parameters |
Definition at line 2165 of file class.ilObjUser.php.
References $q.
ilObjUser::setEmail | ( | $ | a_str | ) |
set email public
string | email address |
Definition at line 1404 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->email = $a_str; }
ilObjUser::setFax | ( | $ | a_str | ) |
set fax public
string | fax |
Definition at line 1366 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->fax = $a_str; }
ilObjUser::setFirstname | ( | $ | a_str | ) |
set firstname public
string | firstname |
Definition at line 1157 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->firstname = $a_str; }
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
string | title (opt.) | |
string | firstname (opt.) | |
string | lastname (opt.) |
Definition at line 903 of file class.ilObjUser.php.
References $fullname.
Referenced by assignData(), and ilPersonalDesktopGUI::displayUsersOnline().
{ $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; }
ilObjUser::setGender | ( | $ | a_str | ) |
set gender public
string | gender |
Definition at line 1115 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->gender = substr($a_str,-1); }
ilObjUser::setHobby | ( | $ | a_str | ) |
set hobby public
string | hobby |
Definition at line 1423 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->hobby = $a_str; }
ilObjUser::setiLincID | ( | $ | a_str | ) |
set iLinc ID public
Definition at line 2769 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->ilinc_id = $a_str; }
ilObjUser::setInstitution | ( | $ | a_str | ) |
set institution public
string | institution |
Definition at line 1195 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->institution = $a_str; }
ilObjUser::setLanguage | ( | $ | a_str | ) |
ilObjUser::setLastLogin | ( | $ | a_str | ) |
set user's last login public
string | login date |
Definition at line 1472 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->last_login = $a_str; }
ilObjUser::setLastname | ( | $ | a_str | ) |
set lastame public
string | lastname |
Definition at line 1176 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->lastname = $a_str; }
ilObjUser::setLastUpdate | ( | $ | a_str | ) |
set last update of user data set public
string | date |
Definition at line 1492 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->last_update = $a_str; }
ilObjUser::setLogin | ( | $ | a_str | ) |
set login / username public
string | username |
Definition at line 1063 of file class.ilObjUser.php.
References login().
Referenced by assignData().
{ $this->login = $a_str; }
ilObjUser::setMatriculation | ( | $ | a_str | ) |
set matriculation number public
string | matriculation number |
Definition at line 1385 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->matriculation = $a_str; }
ilObjUser::setPasswd | ( | $ | a_str, | |
$ | a_type = IL_PASSWD_PLAIN | |||
) |
set password public
string | passwd |
Definition at line 1082 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->passwd = $a_str; $this->passwd_type = $a_type; }
ilObjUser::setPhoneHome | ( | $ | a_str | ) |
set home phone public
string | home phone |
Definition at line 1328 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->phone_home = $a_str; }
ilObjUser::setPhoneMobile | ( | $ | a_str | ) |
set mobile phone public
string | mobile phone |
Definition at line 1347 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->phone_mobile = $a_str; }
ilObjUser::setPhoneOffice | ( | $ | a_str | ) |
set office phone public
string | office phone |
Definition at line 1309 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->phone_office = $a_str; }
ilObjUser::setPref | ( | $ | a_keyword, | |
$ | a_value | |||
) |
set a user preference
string | name of parameter | |
string | value public |
Definition at line 787 of file class.ilObjUser.php.
Referenced by setLanguage(), and writePref().
{ if ($a_keyword != "") { $this->prefs[$a_keyword] = $a_value; } }
ilObjUser::setSkin | ( | $ | a_str | ) |
set user skin (template set) public
string | directory name of template set |
Definition at line 1646 of file class.ilObjUser.php.
{
// TODO: exception handling (dir exists)
$this->skin = $a_str;
}
ilObjUser::setStreet | ( | $ | a_str | ) |
set street public
string | street |
Definition at line 1233 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->street = $a_str; }
ilObjUser::setTimeLimitFrom | ( | $ | a_from | ) |
Definition at line 1660 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->time_limit_from = $a_from; }
ilObjUser::setTimeLimitMessage | ( | $ | a_time_limit_message | ) |
Definition at line 1684 of file class.ilObjUser.php.
Referenced by assignData().
{
return $this->time_limit_message = $a_time_limit_message;
}
ilObjUser::setTimeLimitOwner | ( | $ | a_owner | ) |
Definition at line 1652 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->time_limit_owner = $a_owner; }
ilObjUser::setTimeLimitUnlimited | ( | $ | a_unlimited | ) |
Definition at line 1676 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->time_limit_unlimited = $a_unlimited; }
ilObjUser::setTimeLimitUntil | ( | $ | a_until | ) |
Definition at line 1668 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->time_limit_until = $a_until; }
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
string | title |
Definition at line 1136 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->utitle = $a_str; }
ilObjUser::setZipcode | ( | $ | a_str | ) |
set zipcode public
string | zipcode |
Definition at line 1271 of file class.ilObjUser.php.
Referenced by assignData().
{ $this->zipcode = $a_str; }
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 1602 of file class.ilObjUser.php.
References getStoredActive(), getUserIdByLogin(), and setActive().
Referenced by update().
{ $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($this->ilias->auth->getUsername())); } }
ilObjUser::update | ( | ) |
updates a record "user" and write it into database public
Reimplemented from ilObject.
Definition at line 418 of file class.ilObjUser.php.
References $ilErr, $q, getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), read(), syncActive(), ilObject::updateOwner(), and writePrefs().
{ global $ilErr; //$this->id = $this->data["Id"]; $this->syncActive(); $pw_udpate = ''; switch ($this->passwd_type) { case IL_PASSWD_PLAIN: $pw_update = "i2passwd='', passwd='".md5($this->passwd)."'"; break; case IL_PASSWD_MD5: $pw_update = "i2passwd='', passwd='".$this->passwd."'"; break; case IL_PASSWD_CRYPT: $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='".$this->gender."', ". "title='".ilUtil::prepareDBString($this->utitle)."', ". "firstname='".ilUtil::prepareDBString($this->firstname)."', ". "lastname='".ilUtil::prepareDBString($this->lastname)."', ". "email='".ilUtil::prepareDBString($this->email)."', ". "hobby='".ilUtil::prepareDBString($this->hobby)."', ". "institution='".ilUtil::prepareDBString($this->institution)."', ". "department='".ilUtil::prepareDBString($this->department)."', ". "street='".ilUtil::prepareDBString($this->street)."', ". "city='".ilUtil::prepareDBString($this->city)."', ". "zipcode='".ilUtil::prepareDBString($this->zipcode)."', ". "country='".ilUtil::prepareDBString($this->country)."', ". "phone_office='".ilUtil::prepareDBString($this->phone_office)."', ". "phone_home='".ilUtil::prepareDBString($this->phone_home)."', ". "phone_mobile='".ilUtil::prepareDBString($this->phone_mobile)."', ". "fax='".ilUtil::prepareDBString($this->fax)."', ". "referral_comment='".ilUtil::prepareDBString($this->referral_comment)."', ". "matriculation='".ilUtil::prepareDBString($this->matriculation)."', ". "approve_date='".ilUtil::prepareDBString($this->approve_date)."', ". "active='".ilUtil::prepareDBString($this->active)."', ". "time_limit_owner='".ilUtil::prepareDBString($this->getTimeLimitOwner())."', ". "time_limit_unlimited='".ilUtil::prepareDBString($this->getTimeLimitUnlimited())."', ". "time_limit_from='".ilUtil::prepareDBString($this->getTimeLimitFrom())."', ". "time_limit_until='".ilUtil::prepareDBString($this->getTimeLimitUntil())."', ". "time_limit_message='".$this->getTimeLimitMessage()."', ". $pw_update.", ". "last_update=now(), ". "ilinc_id='".ilUtil::prepareDBString($this->ilinc_id)."' ". "WHERE usr_id='".$this->id."'"; $this->ilias->db->query($q); $this->writePrefs(); parent::update(); parent::updateOwner(); $this->read(); return true; }
ilObjUser::updateActiveRoles | ( | $ | a_user_id | ) | [static] |
STATIC METHOD updates Session roles.
integer | user_id |
Definition at line 2007 of file class.ilObjUser.php.
References $_SESSION, $q, $rbacreview, $roles, and ilUtil::getUsersOnline().
Referenced by ilForumImportParser::__addModerator(), ilCourseMembers::add(), ilCourseMembers::delete(), ilObjGroup::ilClone(), ilObjForum::ilClone(), ilObjGroup::join(), ilObjGroup::leave(), ilObjForumGUI::saveObject(), ilCourseRegisterGUI::subscribe(), and ilCourseMembers::update().
{ global $rbacreview, $ilDB; if (!count($user_online = ilUtil::getUsersOnline($a_user_id)) == 1) { return false; } $role_arr = $rbacreview->assignedRoles($a_user_id); if ($_SESSION["AccountId"] == $a_user_id) { $_SESSION["RoleId"] = $role_arr; } else { $roles = "RoleId|".serialize($role_arr); $modified_data = preg_replace("/RoleId.*?;\}/",$roles,$user_online[$a_user_id]["data"]); $q = "UPDATE usr_session SET data='".ilUtil::prepareDBString($modified_data)."' WHERE user_id = '".$a_user_id."'"; $ilDB->query($q); } return true; }
ilObjUser::updateLogin | ( | $ | a_login | ) |
update login name
string | new login |
Definition at line 693 of file class.ilObjUser.php.
{ 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='".$this->login."' ". "WHERE usr_id='".$this->id."'"; $this->ilias->db->query($q); return true; }
ilObjUser::updatePassword | ( | $ | a_old, | |
$ | a_new1, | |||
$ | a_new2 | |||
) |
updates password
string | old password as plaintext | |
string | new password1 as plaintext | |
string | new password2 as plaintext |
Definition at line 539 of file class.ilObjUser.php.
References $q, and _makeIlias2Password().
{ 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) { case IL_PASSWD_PLAIN: if ($a_old != $this->passwd) { return false; } break; case IL_PASSWD_MD5: if (md5($a_old) != $this->passwd) { return false; } break; case IL_PASSWD_CRYPT: 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='".$this->passwd."' ". "WHERE usr_id='".$this->id."'"; $this->ilias->db->query($q); return true; }
ilObjUser::writeAccepted | ( | ) |
write accept date of user agreement to db
Definition at line 490 of file class.ilObjUser.php.
References $q, and ilObject::getId().
{ global $ilDB; $q = "UPDATE usr_data SET agree_date = now()". "WHERE usr_id = ".$ilDB->quote($this->getId()); $ilDB->query($q); }
ilObjUser::writePref | ( | $ | a_keyword, | |
$ | a_value | |||
) |
write userpref to user table private
string | keyword | |
string | value |
Definition at line 722 of file class.ilObjUser.php.
References _writePref(), and setPref().
{ ilObjUser::_writePref($this->id, $a_keyword, $a_value); $this->setPref($a_keyword, $a_value); }
ilObjUser::writePrefs | ( | ) |
write all userprefs private
Definition at line 755 of file class.ilObjUser.php.
References $q.
Referenced by update().
{ //DELETE $q = "DELETE FROM usr_pref ". "WHERE usr_id='".$this->id."'"; $this->ilias->db->query($q); foreach ($this->prefs as $keyword => $value) { //INSERT $q = "INSERT INTO usr_pref ". "(usr_id, keyword, value) ". "VALUES ". "('".$this->id."', '".$keyword."', '".$value."')"; $this->ilias->db->query($q); } }
ilObjUser::$active |
Definition at line 90 of file class.ilObjUser.php.
ilObjUser::$approve_date |
Definition at line 89 of file class.ilObjUser.php.
ilObjUser::$city |
Definition at line 78 of file class.ilObjUser.php.
ilObjUser::$country |
Definition at line 80 of file class.ilObjUser.php.
ilObjUser::$default_role |
Definition at line 113 of file class.ilObjUser.php.
ilObjUser::$department |
Definition at line 76 of file class.ilObjUser.php.
ilObjUser::$email |
Definition at line 85 of file class.ilObjUser.php.
ilObjUser::$fax |
Definition at line 84 of file class.ilObjUser.php.
ilObjUser::$firstname |
Definition at line 70 of file class.ilObjUser.php.
ilObjUser::$fullname |
Definition at line 72 of file class.ilObjUser.php.
Referenced by setFullname().
ilObjUser::$gender |
Definition at line 68 of file class.ilObjUser.php.
ilObjUser::$hobby |
Definition at line 86 of file class.ilObjUser.php.
ilObjUser::$ilias |
Reimplemented from ilObject.
Definition at line 120 of file class.ilObjUser.php.
Referenced by _getAllUserLogins(), _lookupHasIlias2Password(), _switchToIlias3Password(), getLoginByUserId(), getStoredActive(), getUserIdByLogin(), ilObjUser(), and searchUsers().
ilObjUser::$ilinc_id |
Definition at line 91 of file class.ilObjUser.php.
ilObjUser::$institution |
Definition at line 75 of file class.ilObjUser.php.
ilObjUser::$lastname |
Definition at line 71 of file class.ilObjUser.php.
ilObjUser::$login |
all user related data in single vars public
Definition at line 48 of file class.ilObjUser.php.
ilObjUser::$matriculation |
Definition at line 87 of file class.ilObjUser.php.
ilObjUser::$passwd |
Definition at line 50 of file class.ilObjUser.php.
ilObjUser::$passwd_type |
Definition at line 51 of file class.ilObjUser.php.
ilObjUser::$phone_home |
Definition at line 82 of file class.ilObjUser.php.
ilObjUser::$phone_mobile |
Definition at line 83 of file class.ilObjUser.php.
ilObjUser::$phone_office |
Definition at line 81 of file class.ilObjUser.php.
ilObjUser::$prefs |
Definition at line 98 of file class.ilObjUser.php.
ilObjUser::$referral_comment |
Definition at line 88 of file class.ilObjUser.php.
ilObjUser::$skin |
Definition at line 105 of file class.ilObjUser.php.
ilObjUser::$street |
Definition at line 77 of file class.ilObjUser.php.
ilObjUser::$utitle |
Definition at line 69 of file class.ilObjUser.php.
ilObjUser::$zipcode |
Definition at line 79 of file class.ilObjUser.php.