4 define(
"IL_PASSWD_PLAIN",
"plain");
5 define(
"IL_PASSWD_CRYPTED",
"crypted");
8 require_once
"./Services/Object/classes/class.ilObject.php";
9 require_once
'./Services/User/exceptions/class.ilUserException.php';
10 require_once
'./Modules/OrgUnit/classes/class.ilObjOrgUnit.php';
11 require_once
'./Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php';
175 public function __construct($a_user_id = 0, $a_call_by_reference =
false)
184 parent::__construct($a_user_id, $a_call_by_reference);
185 $this->auth_mode =
"default";
194 if ($a_user_id > 0) {
195 $this->
setId($a_user_id);
200 $this->prefs =
array();
202 $this->prefs[
"language"] = $this->
ilias->ini->readVariable(
"language",
"default");
205 $this->skin = $this->
ilias->ini->readVariable(
"layout",
"skin");
211 $this->prefs[
"style"] = $this->
ilias->ini->readVariable(
"layout",
"style");
228 $r = $ilDB->queryF(
"SELECT * FROM usr_data " .
229 "WHERE usr_id= %s",
array(
"integer"),
array($this->
id));
231 if (
$data = $ilDB->fetchAssoc(
$r)) {
250 if ($this->prefs[
"language"] ==
"") {
251 $this->prefs[
"language"] = $this->oldPrefs[
"language"];
255 include_once(
"./Services/Style/System/classes/class.ilStyleDefinition.php");
256 if ($this->prefs[
"skin"] ==
"" ||
258 $this->prefs[
"skin"] = $this->oldPrefs[
"skin"];
261 $this->skin = $this->prefs[
"skin"];
264 if ($this->prefs[
"style"] ==
"" ||
267 $this->prefs[
"style"] = $this->
ilias->ini->readVariable(
"layout",
"style");
270 if (empty($this->prefs[
"hits_per_page"])) {
271 $this->prefs[
"hits_per_page"] = 10;
274 $ilErr->raiseError(
"<b>Error: There is no dataset with id " .
275 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " . __FILE__ .
276 "<br />Line: " . __LINE__, $ilErr->FATAL);
298 $this->password_encoding_type = $password_encryption_type;
328 if (!$a_data[
"passwd_type"]) {
329 $ilErr->raiseError(
"<b>Error: passwd_type missing in function assignData(). " .
330 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " 331 . __FILE__ .
"<br />Line: " . __LINE__, $ilErr->FATAL);
333 if ($a_data[
"passwd"] !=
"********" and strlen($a_data[
'passwd'])) {
334 $this->
setPasswd($a_data[
"passwd"], $a_data[
"passwd_type"]);
342 if (!is_array($a_data[
'birthday'])) {
352 $this->
setCity($a_data[
"city"]);
359 $this->
setFax($a_data[
"fax"]);
376 $this->create_date = $a_data[
"create_date"];
377 $this->
setComment($a_data[
"referral_comment"]);
378 $this->approve_date = $a_data[
"approve_date"];
379 $this->active = $a_data[
"active"];
380 $this->agree_date = $a_data[
"agree_date"];
407 public function saveAsNew($a_from_formular =
true)
409 global $ilAppEventHandler;
417 switch ($this->passwd_type) {
419 if (strlen($this->passwd)) {
420 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
433 $ilErr->raiseError(
"<b>Error: passwd_type missing in function saveAsNew. " .
434 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " . __FILE__ .
435 "<br />Line: " . __LINE__, $ilErr->FATAL);
438 if (!$this->active) {
444 $insert_array =
array(
445 "usr_id" =>
array(
"integer", $this->
id),
446 "login" =>
array(
"text", $this->login),
447 "passwd" =>
array(
"text", $pw_value),
450 "firstname" =>
array(
"text", $this->firstname),
451 "lastname" =>
array(
"text", $this->lastname),
452 "title" =>
array(
"text", $this->utitle),
453 "gender" =>
array(
"text", $this->gender),
454 "email" =>
array(
"text", trim($this->email)),
455 "second_email" =>
array(
"text", trim($this->second_email)),
456 "hobby" =>
array(
"text", (
string) $this->hobby),
457 "institution" =>
array(
"text", $this->institution),
458 "department" =>
array(
"text", $this->department),
459 "street" =>
array(
"text", $this->street),
460 "city" =>
array(
"text", $this->city),
461 "zipcode" =>
array(
"text", $this->zipcode),
462 "country" =>
array(
"text", $this->country),
463 "sel_country" =>
array(
"text", $this->sel_country),
464 "phone_office" =>
array(
"text", $this->phone_office),
465 "phone_home" =>
array(
"text", $this->phone_home),
466 "phone_mobile" =>
array(
"text", $this->phone_mobile),
467 "fax" =>
array(
"text", $this->fax),
469 "last_login" =>
array(
"timestamp", null),
472 "referral_comment" =>
array(
"text", $this->referral_comment),
473 "matriculation" =>
array(
"text", $this->matriculation),
474 "client_ip" =>
array(
"text", $this->client_ip),
475 "approve_date" =>
array(
"timestamp", $this->approve_date),
476 "agree_date" =>
array(
"timestamp", $this->agree_date),
477 "active" =>
array(
"integer", (
int) $this->active),
485 "latitude" =>
array(
"text", $this->latitude),
486 "longitude" =>
array(
"text", $this->longitude),
487 "loc_zoom" =>
array(
"integer", (
int) $this->loc_zoom),
488 "last_password_change" =>
array(
"integer", (
int) $this->last_password_change_ts),
489 'inactivation_date' =>
array(
'timestamp', $this->inactivation_date),
490 'is_self_registered' =>
array(
'integer', (
int) $this->is_self_registered),
492 $ilDB->insert(
"usr_data", $insert_array);
502 include_once(
"Services/Mail/classes/class.ilMailbox.php");
504 $mbox->createDefaultFolder();
506 include_once
"Services/Mail/classes/class.ilMailOptions.php";
508 $mail_options->createMailOptionsEntry();
511 include_once
"./Services/Bookmarks/classes/class.ilBookmarkFolder.php";
513 $bmf->createNewBookmarkTree();
515 $ilAppEventHandler->raise(
518 array(
"user_obj" => $this)
538 } elseif ($this->active) {
542 $update_array =
array(
543 "gender" =>
array(
"text", $this->gender),
544 "title" =>
array(
"text", $this->utitle),
545 "firstname" =>
array(
"text", $this->firstname),
546 "lastname" =>
array(
"text", $this->lastname),
547 "email" =>
array(
"text", trim($this->email)),
548 "second_email" =>
array(
"text", trim($this->second_email)),
550 "hobby" =>
array(
"text", $this->hobby),
551 "institution" =>
array(
"text", $this->institution),
552 "department" =>
array(
"text", $this->department),
553 "street" =>
array(
"text", $this->street),
554 "city" =>
array(
"text", $this->city),
555 "zipcode" =>
array(
"text", $this->zipcode),
556 "country" =>
array(
"text", $this->country),
557 "sel_country" =>
array(
"text", $this->sel_country),
558 "phone_office" =>
array(
"text", $this->phone_office),
559 "phone_home" =>
array(
"text", $this->phone_home),
560 "phone_mobile" =>
array(
"text", $this->phone_mobile),
561 "fax" =>
array(
"text", $this->fax),
562 "referral_comment" =>
array(
"text", $this->referral_comment),
563 "matriculation" =>
array(
"text", $this->matriculation),
564 "client_ip" =>
array(
"text", $this->client_ip),
565 "approve_date" =>
array(
"timestamp", $this->approve_date),
566 "active" =>
array(
"integer", $this->active),
575 "latitude" =>
array(
"text", $this->latitude),
576 "longitude" =>
array(
"text", $this->longitude),
577 "loc_zoom" =>
array(
"integer", (
int) $this->loc_zoom),
578 "last_password_change" =>
array(
"integer", $this->last_password_change_ts),
580 'inactivation_date' =>
array(
'timestamp', $this->inactivation_date)
583 if (isset($this->agree_date) && (strtotime($this->agree_date) !==
false || $this->agree_date == null)) {
584 $update_array[
"agree_date"] =
array(
"timestamp", $this->agree_date);
586 switch ($this->passwd_type) {
588 if (strlen($this->passwd)) {
589 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
593 $update_array[
"passwd"] =
array(
"text", (
string) $this->passwd);
598 $update_array[
"passwd"] =
array(
"text", (
string) $this->passwd);
602 $ilErr->raiseError(
"<b>Error: passwd_type missing in function update()" . $this->
id .
"!</b><br />class: " .
603 get_class($this) .
"<br />Script: " . __FILE__ .
"<br />Line: " . __LINE__, $ilErr->FATAL);
609 $ilDB->update(
"usr_data", $update_array,
array(
"usr_id" =>
array(
"integer", $this->
id)));
619 parent::updateOwner();
623 $ilAppEventHandler->raise(
626 array(
"user_obj" => $this)
639 $ilDB->manipulateF(
"UPDATE usr_data SET agree_date = " . $ilDB->now() .
646 private static function _lookup($a_user_id, $a_field)
650 $res = $ilDB->queryF(
651 "SELECT " . $a_field .
" FROM usr_data WHERE usr_id = %s",
656 while ($set = $ilDB->fetchAssoc(
$res)) {
657 return $set[$a_field];
669 $set = $ilDB->queryF(
670 "SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
675 if ($rec = $ilDB->fetchAssoc($set)) {
679 if ($rec[
"firstname"]) {
682 if ($rec[
"lastname"]) {
736 $res = $ilDB->queryF(
737 "SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
741 $user_rec = $ilDB->fetchAssoc(
$res);
742 return array(
"user_id" => $a_user_id,
743 "firstname" => $user_rec[
"firstname"],
744 "lastname" => $user_rec[
"lastname"],
745 "title" => $user_rec[
"title"],
746 "login" => $user_rec[
"login"]);
756 $res = $ilDB->queryF(
757 "SELECT * FROM usr_data WHERE usr_id = %s",
761 $user_rec = $ilDB->fetchAssoc(
$res);
788 if (!is_array($a_user_str)) {
789 $res = $ilDB->queryF(
790 "SELECT usr_id FROM usr_data WHERE login = %s",
794 $user_rec = $ilDB->fetchAssoc(
$res);
795 return $user_rec[
"usr_id"];
798 "SELECT usr_id FROM usr_data " .
799 " WHERE " . $ilDB->in(
"login", $a_user_str,
false,
"text")
802 while ($rec = $ilDB->fetchAssoc($set)) {
803 $ids[] = $rec[
"usr_id"];
828 "UPDATE usr_data SET " .
829 "last_login = " . $ilDB->now() .
830 " WHERE usr_id = %s",
844 public function resetPassword($raw, $raw_retype)
851 if (func_num_args() != 2) {
855 if (!isset($raw) || !isset($raw_retype)) {
859 if ($raw != $raw_retype) {
863 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
868 SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s 870 array(
'text',
'text',
'text',
'integer'),
891 $res = $ilDB->queryF(
893 SELECT * FROM loginname_history 899 return $ilDB->fetchAssoc(
$res) ? true :
false;
918 $ilDB->setLimit(1, 0);
919 $res = $ilDB->queryF(
921 SELECT login, history_date FROM loginname_history 922 WHERE usr_id = %s ORDER BY history_date DESC',
927 if (!is_array(
$row) || !count(
$row)) {
947 if (func_num_args() != 1) {
951 if (!isset($a_login)) {
955 $former_login = self::_lookupLogin($this->
getId());
958 if (0 == strcmp($a_login, $former_login)) {
965 $last_history_entry = null;
969 if ((
int) $ilSetting->get(
'allow_change_loginname') &&
970 (int) $ilSetting->get(
'reuse_of_loginnames') == 0 &&
971 self::_doesLoginnameExistInHistory($a_login)) {
972 throw new ilUserException($this->lng->txt(
'loginname_already_exists'));
973 } elseif ((
int) $ilSetting->get(
'allow_change_loginname') &&
974 (int) $ilSetting->get(
'loginname_change_blocking_time') &&
975 is_array($last_history_entry) &&
976 $last_history_entry[1] + (int) $ilSetting->get(
'loginname_change_blocking_time') >
time()) {
977 include_once
'Services/Calendar/classes/class.ilDate.php';
980 $this->lng->txt(
'changing_loginname_not_possible_info'),
985 new ilDateTime(($last_history_entry[1] + (
int) $ilSetting->get(
'loginname_change_blocking_time')),
IL_CAL_UNIX)
991 if ((
int) $ilSetting->get(
'allow_change_loginname') &&
992 (int) $ilSetting->get(
'create_history_loginname')) {
997 $this->login = $a_login;
1004 array(
'text',
'integer'),
1020 self::_writePref($this->
id, $a_keyword, $a_value);
1021 $this->
setPref($a_keyword, $a_value);
1032 self::_deletePref($this->
getId(), $a_keyword);
1040 public static function _deletePref($a_user_id, $a_keyword)
1048 'DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s',
1049 array(
'integer',
'text'),
1050 array($a_user_id, $a_keyword)
1064 "DELETE FROM usr_pref WHERE usr_id = %s",
1076 public static function _writePref($a_usr_id, $a_keyword, $a_value)
1082 "usr_id" =>
array(
"integer", $a_usr_id),
1083 "keyword" =>
array(
"text", $a_keyword),
1086 "value" =>
array(
"text",$a_value)
1111 foreach ($this->prefs as $keyword => $value) {
1112 self::_writePref($this->
id, $keyword, $value);
1127 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
1129 return $settings->getDefaultTimeZone();
1144 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
1146 return $settings->getDefaultTimeFormat();
1161 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
1163 return $settings->getDefaultDateFormat();
1175 if ($a_keyword !=
"") {
1176 $this->prefs[$a_keyword] = $a_value;
1187 if (array_key_exists($a_keyword, $this->prefs)) {
1188 return $this->prefs[$a_keyword];
1198 $query =
"SELECT * FROM usr_pref WHERE usr_id = " . $ilDB->quote($a_usr_id,
"integer") .
" " .
1199 "AND keyword = " . $ilDB->quote($a_keyword,
"text");
1216 if (is_array($this->prefs)) {
1228 public function delete()
1233 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
1235 $mapping->deleteUser($this->
getId());
1238 include_once(
"Services/Mail/classes/class.ilMailbox.php");
1241 $mailbox->updateMailsOfDeletedUser($this->
getLogin());
1244 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
1246 $costum_block->setContextObjId($this->
getId());
1247 $costum_block->setContextObjType(
"user");
1248 $c_blocks = $costum_block->queryBlocksForContext();
1249 include_once(
"./Services/Feeds/classes/class.ilPDExternalFeedBlock.php");
1250 foreach ($c_blocks as $c_block) {
1251 if ($c_block[
"type"] ==
"pdfeed") {
1259 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1264 "DELETE FROM usr_data WHERE usr_id = %s",
1277 include_once(
"./Services/Authentication/classes/class.ilSession.php");
1281 $rbacadmin->removeUser($this->
getId());
1285 $q =
"DELETE FROM bookmark_tree WHERE tree = " .
1286 $ilDB->quote($this->
getId(),
"integer");
1287 $ilDB->manipulate($q);
1289 $q =
"DELETE FROM bookmark_data WHERE user_id = " .
1290 $ilDB->quote($this->
getId(),
"integer");
1291 $ilDB->manipulate($q);
1294 include_once
'./Modules/Forum/classes/class.ilObjForum.php';
1298 include_once
'./Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1302 include_once
'./Modules/Course/classes/class.ilObjCourse.php';
1306 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
1309 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1313 include_once
'Modules/Scorm2004/classes/ilSCORM13Package.php';
1317 include_once
'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
1321 include_once
"./Services/Notification/classes/class.ilNotification.php";
1325 include_once
"./Modules/Portfolio/classes/class.ilObjPortfolio.php";
1329 include_once
"./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1331 $tree->cascadingDelete();
1334 include_once
"./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1338 require_once
'Services/User/classes/class.ilCronDeleteInactiveUserReminderMail.php';
1342 include_once
"Services/Badge/classes/class.ilBadgeAssignment.php";
1347 $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->
getId());
1359 global $ilAppEventHandler;
1360 $ilAppEventHandler->raise(
1380 public function setFullname($a_title =
"", $a_firstname =
"", $a_lastname =
"")
1382 $this->fullname =
"";
1386 } elseif ($this->utitle) {
1387 $this->fullname = $this->utitle .
" ";
1392 } elseif ($this->firstname) {
1393 $this->fullname .= $this->firstname .
" ";
1419 if (!$a_max_strlen) {
1423 if (strlen($this->fullname) <= $a_max_strlen) {
1427 if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1428 return ilUtil::stripSlashes($this->utitle .
" " . substr($this->firstname, 0, 1) .
". " . $this->lastname);
1431 if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1435 if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1449 $this->login = $a_str;
1468 $this->passwd = $a_str;
1501 $this->gender = substr($a_str, -1);
1522 $this->utitle = $a_str;
1543 $this->firstname = $a_str;
1562 $this->lastname = $a_str;
1581 $this->institution = $a_str;
1600 $this->department = $a_str;
1619 $this->street = $a_str;
1638 $this->city = $a_str;
1657 $this->zipcode = $a_str;
1677 $this->country = $a_str;
1697 $this->sel_country = $a_val;
1717 $this->phone_office = $a_str;
1736 $this->phone_home = $a_str;
1755 $this->phone_mobile = $a_str;
1774 $this->fax = $a_str;
1793 $this->client_ip = $a_str;
1812 $this->matriculation = $a_str;
1834 $query =
"SELECT matriculation FROM usr_data " .
1835 "WHERE usr_id = " . $ilDB->quote($a_usr_id);
1838 return $row->matriculation ?
$row->matriculation :
'';
1848 $this->email = $a_str;
1883 $this->hobby = $a_str;
1902 $this->
setPref(
"language", $a_str);
1913 return $this->prefs[
"language"];
1926 $this->
setPref(
"disk_quota", $a_disk_quota);
1940 return $this->prefs[
"disk_quota"] ? $this->prefs[
"disk_quota"] : 0;
1945 return $this->prefs[
"wsp_disk_quota"] ? $this->prefs[
"wsp_disk_quota"] : 0;
1950 $this->last_password_change_ts = $a_last_password_change_ts;
1963 $ilDB = $DIC->database();
1964 $lng = $DIC->language();
1966 $q =
"SELECT value FROM usr_pref WHERE usr_id= " .
1967 $ilDB->quote($a_usr_id,
"integer") .
" AND keyword = " .
1968 $ilDB->quote(
'language',
"text");
1972 return $row[
'value'];
1974 if (is_object(
$lng)) {
1975 return $lng->getDefaultLanguage();
1985 "UPDATE usr_data " .
1986 " SET ext_account = %s WHERE usr_id = %s",
1987 array(
"text",
"integer"),
1988 array($a_ext_id, $a_usr_id)
1997 "UPDATE usr_data " .
1998 " SET auth_mode = %s WHERE usr_id = %s",
1999 array(
"text",
"integer"),
2000 array($a_auth_mode, $a_usr_id)
2030 $this->last_login = $a_str;
2040 return $this->last_login;
2050 $this->last_update = $a_str;
2064 $this->referral_comment = $a_str;
2084 $this->approve_date = $a_str;
2115 $this->agree_date = $a_str;
2155 $query =
'SELECT usr_id FROM usr_data ' .
2156 'WHERE active = ' . $ilDB->quote(1,
'integer') .
' ' .
2157 'AND usr_id = ' . $ilDB->quote($a_usr_id,
'integer');
2180 if ($this->active) {
2184 if ((!empty($storedActive) && empty($currentActive)) ||
2185 (empty($storedActive) && !empty($currentActive))) {
2199 return $active ? true :
false;
2210 $this->skin = $a_str;
2215 $this->time_limit_owner = $a_owner;
2219 return $this->time_limit_owner ? $this->time_limit_owner : 7;
2223 $this->time_limit_from = $a_from;
2227 return $this->time_limit_from;
2231 $this->time_limit_until = $a_until;
2235 return $this->time_limit_until;
2239 $this->time_limit_unlimited = $a_unlimited;
2243 return $this->time_limit_unlimited;
2247 return $this->time_limit_message = $a_time_limit_message;
2251 return $this->time_limit_message;
2256 $this->login_attempts = $a_login_attempts;
2277 $this->profile_incomplete = (boolean) $a_prof_inc;
2281 if ($this->
id == ANONYMOUS_USER_ID) {
2284 return $this->profile_incomplete;
2292 if ($this->
id == ANONYMOUS_USER_ID) {
2296 if ($this->
id == SYSTEM_USER_ID) {
2297 require_once
'./Services/User/classes/class.ilUserPasswordManager.php';
2308 require_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2313 $security->isPasswordChangeOnFirstLoginEnabled() &&
2315 $this->is_self_registered == false
2325 if ($this->
id == ANONYMOUS_USER_ID) {
2329 require_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2332 $max_pass_age = $security->getPasswordMaxAge();
2333 if ($max_pass_age > 0) {
2334 $max_pass_age_ts = ($max_pass_age * 86400);
2336 $current_ts =
time();
2338 if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
2351 $current_ts =
time();
2353 $password_age = (int) (($current_ts - $pass_change_ts) / 86400);
2354 return $password_age;
2363 $query =
"UPDATE usr_data SET last_password_change = %s " .
2364 "WHERE usr_id = %s";
2365 $affected = $ilDB->manipulateF(
2367 array(
'integer',
'integer'),
2381 $query =
"UPDATE usr_data SET last_password_change = 0 " .
2382 "WHERE usr_id = %s";
2383 $affected = $ilDB->manipulateF(
2402 $this->latitude = $a_latitude;
2422 $this->longitude = $a_longitude;
2442 $this->loc_zoom = $a_locationzoom;
2465 $set = $ilDB->queryf(
2467 SELECT COUNT(*) session_count 2468 FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
2469 array(
'integer',
'integer',
'text'),
2470 array($a_user_id,
time(), $a_session_id)
2472 $row = $ilDB->fetchAssoc($set);
2473 return (
bool)
$row[
'session_count'];
2499 $uid =
$GLOBALS[
'DIC'][
'ilAuthSession']->getUserId();
2503 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
2520 $pos = strrpos($a_login,
'/');
2521 $pos2 = strrpos($a_login,
'\\');
2522 if ($pos ===
false || $pos < $pos2) {
2525 if ($pos !==
false) {
2526 $a_login = substr($a_login, $pos + 1);
2538 global
$ilDB,$ilAuth;
2541 $set = $ilDB->queryF(
2542 "SELECT active FROM usr_data WHERE login= %s",
2547 if ($rec = $ilDB->fetchAssoc($set)) {
2548 if ($rec[
"active"]) {
2581 $res = $ilDB->queryF(
2582 "SELECT login FROM usr_data " .
2583 "WHERE email = %s and active = 1",
2588 while (
$row = $ilDB->fetchObject(
$res)) {
2589 $ids[] =
$row->login;
2609 $res = $ilDB->queryF(
"SELECT usr_id FROM usr_data " .
2610 "WHERE email = %s",
array(
"text"),
array($a_email));
2613 return $row->usr_id ?
$row->usr_id : 0;
2640 public static function searchUsers($a_search_str,
$active = 1, $a_return_ids_only =
false, $filter_settings =
false)
2645 $query =
"SELECT usr_data.usr_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.email, usr_data.active FROM usr_data ";
2647 $without_anonymous_users =
true;
2650 $join_filter =
" WHERE ";
2651 if ($filter_settings !==
false && strlen($filter_settings)) {
2652 switch ($filter_settings) {
2655 $join_filter =
" LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.usr_id IS NULL AND ";
2661 $join_filter =
" LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.obj_id = " .
2662 "(SELECT obj_id FROM object_reference WHERE ref_id = " . $ilDB->quote(
$ref_id,
"integer") .
") AND ";
2669 $local_roles = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
2670 if (is_array($local_roles) && count($local_roles)) {
2671 $join_filter =
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
2672 $ilDB->in(
"rbac_ua.rol_id", $local_roles,
false, $local_roles) .
" AND ";
2678 $rol_id =
$_SESSION[
"user_filter_data"];
2680 $join_filter =
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
2681 $ilDB->quote($rol_id,
"integer") .
" AND ";
2682 $without_anonymous_users =
false;
2689 if (strtolower(substr($a_search_str, 0, 5)) ==
"role:") {
2690 $query =
"SELECT DISTINCT usr_data.usr_id,usr_data.login,usr_data.firstname,usr_data.lastname,usr_data.email " .
2691 "FROM object_data,rbac_ua,usr_data " .
2692 "WHERE " . $ilDB->like(
"object_data.title",
"text",
"%" . substr($a_search_str, 5) .
"%") .
2693 " AND object_data.type = 'role' " .
2694 "AND rbac_ua.rol_id = object_data.obj_id " .
2695 "AND usr_data.usr_id = rbac_ua.usr_id " .
2696 "AND rbac_ua.usr_id != " . $ilDB->quote(ANONYMOUS_USER_ID,
"integer");
2699 "(" . $ilDB->like(
"usr_data.login",
"text",
"%" . $a_search_str .
"%") .
" " .
2700 "OR " . $ilDB->like(
"usr_data.firstname",
"text",
"%" . $a_search_str .
"%") .
" " .
2701 "OR " . $ilDB->like(
"usr_data.lastname",
"text",
"%" . $a_search_str .
"%") .
" " .
2702 "OR " . $ilDB->like(
"usr_data.email",
"text",
"%" . $a_search_str .
"%") .
") ";
2704 if ($filter_settings !==
false && strlen($filter_settings)) {
2705 switch ($filter_settings) {
2707 $query.=
" AND usr_data.active = " . $ilDB->quote(0,
"integer") .
" ";
2710 $query.=
" AND usr_data.active = " . $ilDB->quote(1,
"integer") .
" ";
2713 $query.=
" AND usr_data.time_limit_unlimited = " . $ilDB->quote(0,
"integer") .
" ";
2716 $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"]));
2717 $query.=
" AND last_login < " . $ilDB->quote($date,
"timestamp") .
" ";
2722 if ($without_anonymous_users) {
2723 $query.=
"AND usr_data.usr_id != " . $ilDB->quote(ANONYMOUS_USER_ID,
"integer");
2726 if (is_numeric(
$active) &&
$active > -1 && $filter_settings ===
false) {
2727 $query.=
" AND active = " . $ilDB->quote(
$active,
"integer") .
" ";
2732 while (
$row = $ilDB->fetchObject(
$res)) {
2734 "usr_id" =>
$row->usr_id,
2735 "login" =>
$row->login,
2736 "firstname" =>
$row->firstname,
2737 "lastname" =>
$row->lastname,
2738 "email" =>
$row->email,
2739 "active" =>
$row->active);
2740 $ids[] =
$row->usr_id;
2742 if ($a_return_ids_only) {
2743 return $ids ? $ids :
array();
2752 public static function getAllUserLogins()
2761 $res = $ilDB->query(
2762 "SELECT login FROM usr_data WHERE " . $ilDB->in(
'usr_id',
array(ANONYMOUS_USER_ID),
true,
'integer')
2764 while (
$row = $ilDB->fetchAssoc(
$res)) {
2765 $logins[] =
$row[
'login'];
2782 $res = $ilDB->query(
"SELECT * FROM usr_data WHERE " .
2783 $ilDB->in(
"usr_id", $a_user_ids,
false,
"integer"));
2784 while (
$row = $ilDB->fetchAssoc(
$res)) {
2785 $user_data[
"$row[usr_id]"] =
$row;
2787 return $user_data ? $user_data :
array();
2802 $result_arr =
array();
2806 if ($a_fields !== null and is_array($a_fields)) {
2807 if (count($a_fields) == 0) {
2810 if (($usr_id_field = array_search(
"usr_id", $a_fields)) !==
false) {
2811 unset($a_fields[$usr_id_field]);
2814 $select = implode(
",", $a_fields) .
",usr_data.usr_id";
2816 if (in_array(
'online_time', $a_fields)) {
2817 $select .=
",ut_online.online_time ";
2821 $q =
"SELECT " . $select .
" FROM usr_data ";
2825 if (in_array(
'online_time', $a_fields)) {
2826 $q .=
"LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2832 $q .=
"WHERE active = " . $ilDB->quote(
$active,
"integer");
2835 $q .=
"WHERE time_limit_unlimited= " . $ilDB->quote(0,
"integer");;
2838 $qtemp = $q .
", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND " .
2839 $ilDB->like(
"object_data.title",
"text",
"%crs%") .
" AND usr_data.usr_id = rbac_ua.usr_id";
2840 $r = $ilDB->query($qtemp);
2841 $course_users =
array();
2842 while (
$row = $ilDB->fetchAssoc(
$r)) {
2843 array_push($course_users,
$row[
"usr_id"]);
2845 if (count($course_users)) {
2846 $q .=
" WHERE " . $ilDB->in(
"usr_data.usr_id", $course_users,
true,
"integer") .
" ";
2852 $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"]));
2853 $q.=
" AND last_login < " . $ilDB->quote($date,
"timestamp");
2858 $q .=
" LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id " .
2859 "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference " .
2860 "WHERE ref_id = " . $ilDB->quote(
$ref_id,
"integer") .
") ";
2867 $local_roles = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
2868 if (is_array($local_roles) && count($local_roles)) {
2869 $q.=
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
2870 $ilDB->in(
"rbac_ua.rol_id", $local_roles,
false,
"integer") .
" ";
2875 $rol_id =
$_SESSION[
"user_filter_data"];
2877 $q .=
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
2878 $ilDB->quote($rol_id,
"integer");
2882 $r = $ilDB->query($q);
2884 while (
$row = $ilDB->fetchAssoc(
$r)) {
2885 $result_arr[] =
$row;
2899 $q =
"SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 " .
2900 " WHERE up1.keyword= " . $ilDB->quote(
"style",
"text") .
2901 " AND up1.value= " . $ilDB->quote($a_style,
"text") .
2902 " AND up2.keyword= " . $ilDB->quote(
"skin",
"text") .
2903 " AND up2.value= " . $ilDB->quote($a_skin,
"text") .
2904 " AND up1.usr_id = up2.usr_id ";
2906 $cnt_set = $ilDB->query($q);
2908 $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2910 return $cnt_rec[
"cnt"];
2920 $q =
"SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 " .
2921 " WHERE up1.keyword = " . $ilDB->quote(
"style",
"text") .
2922 " AND up2.keyword = " . $ilDB->quote(
"skin",
"text") .
2923 " AND up1.usr_id = up2.usr_id";
2925 $sty_set = $ilDB->query($q);
2928 while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2929 $styles[] = $sty_rec[
"skin"] .
":" . $sty_rec[
"style"];
2942 $q =
"SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 " .
2943 " WHERE up1.keyword= " . $ilDB->quote(
"style",
"text") .
2944 " AND up1.value= " . $ilDB->quote($a_from_style,
"text") .
2945 " AND up2.keyword= " . $ilDB->quote(
"skin",
"text") .
2946 " AND up2.value= " . $ilDB->quote($a_from_skin,
"text") .
2947 " AND up1.usr_id = up2.usr_id ";
2949 $usr_set = $ilDB->query($q);
2951 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2952 self::_writePref($usr_rec[
"usr_id"],
"skin", $a_to_skin);
2953 self::_writePref($usr_rec[
"usr_id"],
"style", $a_to_style);
2971 $item_set = $ilDB->queryF(
2972 "SELECT * FROM desktop_item WHERE " .
2973 "item_id = %s AND type = %s AND user_id = %s",
2974 array(
"integer",
"text",
"integer"),
2979 if (!$ilDB->fetchAssoc($item_set)) {
2981 "INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES " .
2983 array(
"integer",
"text",
"integer",
"text"),
2988 include_once
'./Services/Calendar/classes/class.ilCalendarCategories.php';
3017 "UPDATE desktop_item SET parameters = %s " .
3018 " WHERE item_id = %s AND type = %s AND user_id = %s",
3019 array(
"text",
"integer",
"text",
"integer"),
3039 "DELETE FROM desktop_item WHERE " .
3040 " item_id = %s AND type = %s AND user_id = %s",
3041 array(
"integer",
"text",
"integer"),
3045 include_once
'./Services/Calendar/classes/class.ilCalendarCategories.php';
3072 "SELECT user_id FROM desktop_item WHERE item_id = %s",
3079 while (
$row = $ilDB->fetchObject(
$r)) {
3085 "DELETE FROM desktop_item WHERE item_id = %s",
3107 if (self::$is_desktop_item_loaded[$a_usr_id .
":" . $a_item_id]) {
3108 return self::$is_desktop_item_cache[$a_usr_id .
":" . $a_item_id .
":" .
$a_type];
3110 $item_set = $ilDB->queryF(
3111 "SELECT item_id FROM desktop_item WHERE " .
3112 "item_id = %s AND type = %s AND user_id = %s",
3113 array(
"integer",
"text",
"integer"),
3117 if ($ilDB->fetchAssoc($item_set)) {
3134 if (!is_array($a_item_ids)) {
3138 $item_ids =
array();
3139 foreach ($a_item_ids as
$id) {
3140 if (!self::$is_desktop_item_loaded[$a_usr_id .
":" . $id]) {
3143 self::$is_desktop_item_loaded[$a_usr_id .
":" .
$id] =
true;
3146 if (count($item_ids) > 0) {
3147 $item_set = $ilDB->query(
"SELECT item_id, type FROM desktop_item WHERE " .
3148 $ilDB->in(
"item_id", $item_ids,
false,
"integer") .
3149 " AND user_id = " . $ilDB->quote($a_usr_id,
"integer"));
3150 while (
$r = $ilDB->fetchAssoc($item_set)) {
3151 self::$is_desktop_item_cache[$a_usr_id .
":" .
$r[
"item_id"] .
":" .
$r[
"type"]]
3184 if ($a_types ==
"") {
3185 $is_nested_set = ($tree->getTreeImplementation() instanceof
ilNestedSetTree);
3187 $item_set = $ilDB->queryF(
"SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type " .
3188 " FROM desktop_item it, object_reference oref " .
3189 ", object_data obj" .
3191 "it.item_id = oref.ref_id AND " .
3192 "oref.obj_id = obj.obj_id AND " .
3193 "it.user_id = %s",
array(
"integer"),
array($user_id));
3194 $items = $all_parent_path =
array();
3195 while ($item_rec = $ilDB->fetchAssoc($item_set)) {
3196 if ($tree->isInTree($item_rec[
"ref_id"])
3197 && $item_rec[
"type"] !=
"rolf" 3198 && $item_rec[
"type"] !=
"itgr") {
3199 $parent_ref = $tree->getParentId($item_rec[
"ref_id"]);
3201 if (!isset($all_parent_path[$parent_ref])) {
3210 if ($parent_ref > 0) {
3211 $node = $tree->getNodeData($parent_ref);
3212 $all_parent_path[$parent_ref] = $node[
"title"];
3214 $all_parent_path[$parent_ref] =
"";
3219 $parent_path = $all_parent_path[$parent_ref];
3223 $items[$parent_path .
$title . $item_rec[
"ref_id"]] =
3224 array(
"ref_id" => $item_rec[
"ref_id"],
3225 "obj_id" => $item_rec[
"obj_id"],
3226 "type" => $item_rec[
"type"],
3228 "description" =>
$desc,
3229 "parent_ref" => $parent_ref);
3235 if (!is_array($a_types)) {
3236 $a_types =
array($a_types);
3239 $foundsurveys =
array();
3240 foreach ($a_types as
$a_type) {
3241 if ($a_type ==
"itgr") {
3244 $item_set = $ilDB->queryF(
3245 "SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item it, object_reference oref " .
3246 ", object_data obj WHERE " .
3247 "it.item_id = oref.ref_id AND " .
3248 "oref.obj_id = obj.obj_id AND " .
3249 "it.type = %s AND " .
3250 "it.user_id = %s " .
3252 array(
"text",
"integer"),
3253 array($a_type, $user_id)
3256 while ($item_rec = $ilDB->fetchAssoc($item_set)) {
3259 $items[
$title . $a_type . $item_rec[
"ref_id"]] =
3260 array(
"ref_id" => $item_rec[
"ref_id"],
3261 "obj_id" => $item_rec[
"obj_id"],
"type" => $a_type,
3295 $a_time =
date(
"Y-m-d H:i:s",
time());
3298 $item_set = $ilDB->queryF(
3299 "SELECT * FROM personal_clipboard WHERE " .
3300 "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
3301 array(
"integer",
"integer",
"text",
"integer"),
3306 if (!
$d = $item_set->fetchRow()) {
3308 "INSERT INTO personal_clipboard " .
3309 "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES " .
3310 " (%s,%s,%s,%s,%s,%s,%s)",
3311 array(
"integer",
"text",
"integer",
"text",
"integer",
"timestamp",
"integer"),
3312 array($a_item_id,
$a_type, $this->
getId(), $a_title, (
int) $a_parent, $a_time, (
int) $a_order_nr)
3316 "UPDATE personal_clipboard SET insert_time = %s " .
3317 "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
3318 array(
"timestamp",
"integer",
"integer",
"text"),
3331 $a_time =
date(
"Y-m-d H:i:s",
time());
3333 $ilDB->insert(
"personal_pc_clipboard",
array(
3334 "user_id" =>
array(
"integer", $this->
getId()),
3336 "insert_time" =>
array(
"timestamp", $a_time),
3337 "order_nr" =>
array(
"integer", $a_nr)
3348 $set = $ilDB->queryF(
"SELECT MAX(insert_time) mtime FROM personal_pc_clipboard " .
3350 $row = $ilDB->fetchAssoc($set);
3352 $set = $ilDB->queryF(
3353 "SELECT * FROM personal_pc_clipboard " .
3354 " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
3355 array(
"integer",
"timestamp"),
3359 while (
$row = $ilDB->fetchAssoc($set)) {
3360 $content[] =
$row[
"content"];
3373 $set = $ilDB->queryF(
3374 "SELECT * FROM personal_clipboard WHERE " .
3375 "parent = %s AND type = %s AND user_id = %s",
3376 array(
"integer",
"text",
"integer"),
3379 if ($rec = $ilDB->fetchAssoc($set)) {
3394 "DELETE FROM personal_clipboard WHERE " .
3395 "type = %s AND user_id = %s",
3396 array(
"text",
"integer"),
3408 $ilDB->manipulateF(
"DELETE FROM personal_clipboard WHERE " .
3420 if ($a_top_nodes_only) {
3421 $par =
" AND parent = " . $ilDB->quote(0,
"integer") .
" ";
3425 ?
" AND type = " . $ilDB->quote(
$a_type,
"text") .
" " 3427 $q =
"SELECT * FROM personal_clipboard WHERE " .
3428 "user_id = " . $ilDB->quote($this->
getId(),
"integer") .
" " .
3430 " ORDER BY order_nr";
3431 $objs = $ilDB->query($q);
3433 while ($obj = $ilDB->fetchAssoc($objs)) {
3434 if ($obj[
"type"] ==
"mob") {
3437 if ($obj[
"type"] ==
"incl") {
3438 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
3441 $objects[] =
array(
"id" => $obj[
"item_id"],
3442 "type" => $obj[
"type"],
"title" => $obj[
"title"],
3443 "insert_time" => $obj[
"insert_time"]);
3455 $objs = $ilDB->queryF(
3456 "SELECT * FROM personal_clipboard WHERE " .
3457 "user_id = %s AND parent = %s AND insert_time = %s " .
3458 " ORDER BY order_nr",
3459 array(
"integer",
"integer",
"timestamp"),
3460 array($ilUser->getId(), (int) $a_parent, $a_insert_time)
3463 while ($obj = $ilDB->fetchAssoc($objs)) {
3464 if ($obj[
"type"] ==
"mob") {
3467 $objects[] =
array(
"id" => $obj[
"item_id"],
3468 "type" => $obj[
"type"],
"title" => $obj[
"title"],
"insert_time" => $obj[
"insert_time"]);
3485 $q =
"SELECT DISTINCT user_id FROM personal_clipboard WHERE " .
3486 "item_id = " . $ilDB->quote($a_id,
"integer") .
" AND " .
3487 "type = " . $ilDB->quote(
$a_type,
"text");
3488 $user_set = $ilDB->query($q);
3490 while ($user_rec = $ilDB->fetchAssoc($user_set)) {
3491 $users[] = $user_rec[
"user_id"];
3508 $q =
"DELETE FROM personal_clipboard WHERE " .
3509 "item_id = " . $ilDB->quote($a_item_id,
"integer") .
3510 " AND type = " . $ilDB->quote(
$a_type,
"text") .
" " .
3511 " AND user_id = " . $ilDB->quote($this->
getId(),
"integer");
3512 $ilDB->manipulate($q);
3519 $query =
"SELECT obj_id FROM object_data WHERE import_id = " .
3520 $ilDB->quote($i2_id,
"text");
3523 while (
$row = $ilDB->fetchObject(
$res)) {
3536 require_once(
'./Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php');
3537 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
3546 return self::lookupOrgUnitsRepresentation($this->
getId());
3556 $this->auth_mode = $a_str;
3569 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
3582 $this->ext_account = $a_str;
3594 return $this->ext_account;
3612 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
3613 $q =
"SELECT login,usr_id,ext_account,auth_mode FROM usr_data " .
3614 "WHERE auth_mode = %s";
3616 $values[] = $a_auth_mode;
3618 $q.=
" OR auth_mode = %s ";
3620 $values[] =
'default';
3623 $res = $ilDB->queryF($q, $types, $values);
3624 while (
$row = $ilDB->fetchObject(
$res)) {
3625 if (
$row->auth_mode ==
'default') {
3626 $accounts[
$row->usr_id] =
$row->login;
3628 $accounts[
$row->usr_id] =
$row->ext_account;
3631 return $accounts ? $accounts :
array();
3645 if (!is_array($a_usr_ids)) {
3651 $q =
"UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE " .
3652 $ilDB->in(
"usr_id", $a_usr_ids,
false,
"integer");
3653 $ilDB->manipulate($q);
3655 $usrId_IN_usrIds = $ilDB->in(
"usr_id", $a_usr_ids,
false,
"integer");
3657 $q =
"UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
3658 $ilDB->manipulate($q);
3662 SET inactivation_date = %s 3663 WHERE inactivation_date IS NULL 3664 AND $usrId_IN_usrIds 3695 $settings =
$GLOBALS[
'DIC']->settings();
3699 "SELECT * FROM usr_data WHERE " .
3700 " ext_account = %s AND auth_mode = %s",
3701 array(
"text",
"text"),
3702 array($a_account, $a_auth)
3704 if ($usr =
$db->fetchAssoc(
$r)) {
3705 return $usr[
"login"];
3708 if (!$tryFallback) {
3714 "SELECT login FROM usr_data " .
3715 "WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = '') ",
3716 array(
"text",
"text"),
3717 array($a_account, $a_auth)
3719 if ($usr =
$db->fetchAssoc(
$res)) {
3720 return $usr[
'login'];
3726 "SELECT login FROM usr_data WHERE " .
3727 " ext_account = %s AND auth_mode = %s",
3728 array(
"text",
"text"),
3729 array($a_account,
"default")
3731 if ($usr =
$db->fetchAssoc(
$res)) {
3732 return $usr[
"login"];
3736 "SELECT login FROM usr_data " .
3737 "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
3738 array(
"text",
"text"),
3739 array($a_account,
"default")
3741 if ($usr =
$db->fetchAssoc(
$res)) {
3742 return $usr[
"login"];
3755 $r = $ilDB->query(
"SELECT count(*) AS cnt, auth_mode FROM usr_data " .
3756 "GROUP BY auth_mode");
3758 while ($cnt = $ilDB->fetchAssoc(
$r)) {
3759 $cnt_arr[$cnt[
"auth_mode"]] = $cnt[
"cnt"];
3776 $q =
"SELECT * FROM usr_data WHERE " .
3777 " email = %s AND (auth_mode = %s ";
3778 $types =
array(
"text",
"text");
3779 $values =
array($a_email,
"local");
3781 if ($ilSetting->get(
"auth_mode") == 1) {
3782 $q.=
" OR auth_mode = %s";
3784 $values[] =
"default";
3790 $usr_set = $ilDB->queryF($q, $types, $values);
3791 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
3792 $users[$usr_rec[
"usr_id"]] = $usr_rec[
"login"];
3809 $image_dir = $webspace_dir .
"/usr_images";
3810 $store_file =
"usr_" . $obj_id .
"." .
"jpg";
3811 $target_file = $image_dir .
"/$store_file";
3813 chmod($tmp_file, 0770);
3817 $show_file =
"$image_dir/usr_" . $obj_id .
".jpg";
3818 $thumb_file =
"$image_dir/usr_" . $obj_id .
"_small.jpg";
3819 $xthumb_file =
"$image_dir/usr_" . $obj_id .
"_xsmall.jpg";
3820 $xxthumb_file =
"$image_dir/usr_" . $obj_id .
"_xxsmall.jpg";
3823 ilUtil::execConvert($tmp_file .
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
3825 ilUtil::execConvert($tmp_file .
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
3828 self::_writePref($obj_id,
"profile_image", $store_file);
3844 if (isset(self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic])) {
3845 return self::$personal_image_cache[$this->
getId()][$a_size][(int) $a_force_pic];
3848 self::$personal_image_cache[$this->
getId()][$a_size][(int) $a_force_pic] = ilObjUser::_getPersonalPicturePath($this->
getId(), $a_size, $a_force_pic);
3850 return self::$personal_image_cache[$this->
getId()][$a_size][(int) $a_force_pic];
3862 public static function _getPersonalPicturePath(
3865 $a_force_pic =
false,
3866 $a_prevent_no_photo_image =
false 3871 $upload = $profile =
false;
3873 $in = $DIC->database()->in(
'usr_pref.keyword',
array(
'public_upload',
'public_profile'),
false,
'text');
3874 $res = $DIC->database()->queryF(
3876 SELECT usr_pref.*, ud.login, ud.firstname, ud.lastname 3877 FROM usr_data ud LEFT JOIN usr_pref ON usr_pref.usr_id = ud.usr_id AND $in 3878 WHERE ud.usr_id = %s",
3882 while (
$row = $DIC->database()->fetchAssoc(
$res)) {
3887 switch (
$row[
'keyword']) {
3888 case 'public_upload':
3889 $upload =
$row[
'value'] ==
'y';
3891 case 'public_profile':
3892 $profile = (
$row[
'value'] ==
'y' ||
3893 $row[
'value'] ==
'g');
3900 if (
defined(
'ILIAS_MODULE')) {
3901 $webspace_dir = (
'.' . $webspace_dir);
3905 $image_dir = $webspace_dir .
"/usr_images";
3907 if ($a_size ==
'big') {
3908 $thumb_file = $image_dir .
"/usr_" . $a_usr_id .
".jpg";
3910 $thumb_file = $image_dir .
"/usr_" . $a_usr_id .
"_" . $a_size .
".jpg";
3914 $random = new \ilRandom();
3915 if ((($upload && $profile) || $a_force_pic)
3916 && @is_file($thumb_file)) {
3917 $file = $thumb_file .
"?t=" . $random->int(1, 99999);
3919 if (!$a_prevent_no_photo_image) {
3921 if ($a_size ==
"small" || $a_size ==
"big") {
3932 $avatar = $DIC[
"user.avatar.factory"]->avatar($a_size);
3933 $avatar->setName($short);
3934 $avatar->setUsrId($a_usr_id);
3936 return $avatar->getUrl();
3940 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
3952 $a_dir = trim(str_replace(
"..",
"", $a_dir));
3953 if ($a_dir ==
"" || !is_dir($a_dir)) {
3958 $image_dir = $webspace_dir .
"/usr_images";
3960 "upload_" . $a_user_id .
"pic",
3961 "usr_" . $a_user_id .
"." .
"jpg",
3962 "usr_" . $a_user_id .
"_small.jpg",
3963 "usr_" . $a_user_id .
"_xsmall.jpg",
3964 "usr_" . $a_user_id .
"_xxsmall.jpg",
3965 "upload_" . $a_user_id);
3966 foreach ($images as $image) {
3967 if (is_file($image_dir .
"/" . $image)) {
3968 copy($image_dir .
"/" . $image, $a_dir .
"/" . $image);
3980 $image_dir = $webspace_dir .
"/usr_images";
3981 $file = $image_dir .
"/usr_" . $this->getID() .
"." .
"jpg";
3982 $thumb_file = $image_dir .
"/usr_" . $this->getID() .
"_small.jpg";
3983 $xthumb_file = $image_dir .
"/usr_" . $this->getID() .
"_xsmall.jpg";
3984 $xxthumb_file = $image_dir .
"/usr_" . $this->getID() .
"_xxsmall.jpg";
3985 $upload_file = $image_dir .
"/upload_" . $this->getID();
3989 $this->
setPref(
"profile_image",
"");
3993 if (@is_file(
$file)) {
3996 if (@is_file($thumb_file)) {
3997 unlink($thumb_file);
3999 if (@is_file($xthumb_file)) {
4000 unlink($xthumb_file);
4002 if (@is_file($xxthumb_file)) {
4003 unlink($xxthumb_file);
4005 if (@is_file($upload_file)) {
4006 unlink($upload_file);
4013 if (!is_array($a_data)) {
4016 foreach ($a_data as $field =>
$data) {
4017 #$new_data[$field] = ilUtil::stripSlashes($data); 4019 $this->user_defined_data[
'f_' . $field] =
$data;
4021 #$this->user_defined_data = $new_data; 4028 return $this->user_defined_data ? $this->user_defined_data :
array();
4037 $field_def =
array();
4039 include_once(
"./Services/User/classes/class.ilUserDefinedData.php");
4042 foreach ($this->user_defined_data as $field => $value) {
4043 if ($field !=
'usr_id') {
4045 $udata->set($field, $value);
4077 include_once(
"./Services/User/classes/class.ilUserDefinedData.php");
4089 $this->user_defined_data = $udata->getAll();
4113 include_once(
"./Services/User/classes/class.ilUserDefinedData.php");
4129 public function getProfileAsString(&$a_language)
4131 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
4135 $language =&$a_language;
4136 $language->loadLanguageModule(
'registration');
4137 $language->loadLanguageModule(
'crs');
4140 $body .= ($language->txt(
"login") .
": " . $this->
getLogin() .
"\n");
4143 $body .= ($language->txt(
"title") .
": " . $this->
getUTitle() .
"\n");
4146 $body .= ($language->txt(
"gender") .
": " . $language->txt(
'gender_' . strtolower($this->
getGender())) .
"\n");
4149 $body .= ($language->txt(
"firstname") .
": " . $this->
getFirstname() .
"\n");
4152 $body .= ($language->txt(
"lastname") .
": " . $this->
getLastname() .
"\n");
4155 $body .= ($language->txt(
"institution") .
": " . $this->
getInstitution() .
"\n");
4158 $body .= ($language->txt(
"department") .
": " . $this->
getDepartment() .
"\n");
4161 $body .= ($language->txt(
"street") .
": " . $this->
getStreet() .
"\n");
4163 if (strlen($this->
getCity())) {
4164 $body .= ($language->txt(
"city") .
": " . $this->
getCity() .
"\n");
4167 $body .= ($language->txt(
"zipcode") .
": " . $this->
getZipcode() .
"\n");
4170 $body .= ($language->txt(
"country") .
": " . $this->
getCountry() .
"\n");
4173 $body .= ($language->txt(
"sel_country") .
": " . $this->
getSelectedCountry() .
"\n");
4176 $body .= ($language->txt(
"phone_office") .
": " . $this->
getPhoneOffice() .
"\n");
4179 $body .= ($language->txt(
"phone_home") .
": " . $this->
getPhoneHome() .
"\n");
4182 $body .= ($language->txt(
"phone_mobile") .
": " . $this->
getPhoneMobile() .
"\n");
4184 if (strlen($this->
getFax())) {
4185 $body .= ($language->txt(
"fax") .
": " . $this->
getFax() .
"\n");
4188 $body .= ($language->txt(
"email") .
": " . $this->
getEmail() .
"\n");
4191 $body .= ($language->txt(
"second_email") .
": " . $this->
getSecondEmail() .
"\n");
4194 $body .= ($language->txt(
"hobby") .
": " . $this->
getHobby() .
"\n");
4197 $body .= ($language->txt(
"referral_comment") .
": " . $this->
getComment() .
"\n");
4200 $body .= ($language->txt(
"matriculation") .
": " . $this->
getMatriculation() .
"\n");
4208 $body .= ($language->txt(
"create_date") .
": " . $date .
"\n");
4211 foreach ($rbacreview->getGlobalRoles() as $role) {
4212 if ($rbacreview->isAssigned($this->getId(), $role)) {
4217 $body .= ($language->txt(
'reg_role_info') .
': ' . implode(
',', $gr) .
"\n");
4222 $body .= ($language->txt(
'time_limit') .
": " . $language->txt(
'crs_unlimited') .
"\n");
4235 $body .= $language->txt(
'time_limit') .
': ' . $start->get(
IL_CAL_DATETIME);
4239 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
4246 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
4248 if (strlen(
$data)) {
4250 $data = preg_replace(
'/<br(\s*)?\/?>/i',
"\n",
$data);
4254 $body .= $definition[
'field_name'] .
': ' .
$data .
"\n";
4268 if ($a_user_id > 0) {
4269 $set = $ilDB->queryF(
4270 "SELECT feed_hash from usr_data WHERE usr_id = %s",
4274 if ($rec = $ilDB->fetchAssoc($set)) {
4275 if (strlen($rec[
"feed_hash"]) == 32) {
4276 return $rec[
"feed_hash"];
4277 } elseif ($a_create) {
4278 $random = new \ilRandom();
4279 $hash = md5($random->int(1, 9999999) + str_replace(
" ",
"", (
string) microtime()));
4281 "UPDATE usr_data SET feed_hash = %s" .
4282 " WHERE usr_id = %s",
4283 array(
"text",
"integer"),
4284 array($hash, $a_user_id)
4303 if ($a_user_id > 0) {
4321 ($a_password==
"") ?
"" : md5($a_password)
4338 $q =
"SELECT DISTINCT login, usr_id FROM usr_data " .
4341 $values[] = $a_login;
4343 if ($a_user_id != 0) {
4344 $q.=
" AND usr_id != %s ";
4345 $types[] =
"integer";
4346 $values[] = $a_user_id;
4349 $r = $ilDB->queryF($q, $types, $values);
4351 if (
$row = $ilDB->fetchAssoc(
$r)) {
4352 return $row[
'usr_id'];
4371 $res = $ilDB->queryF(
4372 "SELECT * FROM usr_data " .
4373 "WHERE ext_account = %s AND auth_mode = %s",
4374 array(
"text",
"text"),
4375 array($a_external_account, $a_auth_mode)
4377 return $ilDB->fetchAssoc(
$res) ? true :
false;
4392 $ids = $rbacreview->assignedUsers($role_id);
4394 if (count($ids) == 0) {
4398 $query =
"SELECT usr_data.*, usr_pref.value AS language 4400 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 4401 WHERE " . $ilDB->in(
"usr_data.usr_id", $ids,
false,
"integer");
4402 $values[] =
"language";
4407 $query .=
" AND usr_data.active = %s";
4409 $types[] =
"integer";
4412 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
4414 $r = $ilDB->queryF(
$query, $types, $values);
4416 while (
$row = $ilDB->fetchAssoc(
$r)) {
4432 $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 = %s WHERE 1 = 1 ";
4434 $values[] =
"language";
4437 $query .=
" AND usr_data.active = %s";
4439 $types[] =
"integer";
4443 $query.=
" AND usr_data.time_limit_owner = %s";
4445 $types[] =
"integer";
4448 $query .=
" AND usr_data.usr_id != %s ";
4449 $values[] = ANONYMOUS_USER_ID;
4450 $types[] =
"integer";
4452 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
4484 $query =
"SELECT usr_data.*, usr_pref.value AS language 4486 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 4487 WHERE " . $ilDB->in(
"usr_data.usr_id", $a_mem_ids,
false,
"integer") .
" 4488 AND usr_data.usr_id != %s";
4489 $values[] =
"language";
4491 $values[] = ANONYMOUS_USER_ID;
4492 $types[] =
"integer";
4495 $query .=
" AND active = %s";
4497 $types[] =
"integer";
4500 if ($timelimitowner !=
USER_FOLDER_ID && $timelimitowner != -1) {
4501 $query.=
" AND usr_data.time_limit_owner = %s";
4502 $values[] = $timelimitowner;
4503 $types[] =
"integer";
4506 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
4513 return $mem_arr ? $mem_arr :
array();
4528 if (is_array($a_internalids)) {
4529 foreach ($a_internalids as $internalid) {
4530 if (is_numeric($internalid)) {
4531 $ids[] = $internalid;
4534 if (is_numeric($parsedid) && $parsedid > 0) {
4540 if (count($ids) == 0) {
4544 $query =
"SELECT usr_data.*, usr_pref.value AS language 4547 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 4548 WHERE " . $ilDB->in(
"usr_data.usr_id", $ids,
false,
"integer");
4549 $values[] =
"language";
4552 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
4575 "SELECT * FROM usr_pref WHERE usr_id = %s",
4580 while (
$row = $ilDB->fetchAssoc(
$r)) {
4601 $set = $ilDB->query(
4602 "SELECT usr_id FROM usr_pref " .
4603 " WHERE keyword = " . $ilDB->quote($a_keyword,
"text") .
4604 " AND " . $ilDB->in(
"usr_id", $a_user_ids,
false,
"integer") .
4605 " AND value = " . $ilDB->quote($a_val,
"text")
4607 while ($rec = $ilDB->fetchAssoc($set)) {
4608 $users[] = $rec[
"usr_id"];
4618 $query =
"UPDATE usr_data SET login_attempts = 0 WHERE usr_id = %s";
4619 $affected = $ilDB->manipulateF(
$query,
array(
'integer'),
array($a_usr_id));
4632 $query =
"SELECT login_attempts FROM usr_data WHERE usr_id = %s";
4634 $record = $ilDB->fetchAssoc(
$result);
4644 $query =
"UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
4645 $affected = $ilDB->manipulateF(
$query,
array(
'integer'),
array($a_usr_id));
4658 $query =
"UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
4675 return in_array($this->
getPref(
"public_profile"),
array(
"y",
"g"));
4698 $res = $ilDB->queryF(
4699 'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
4700 array(
'integer',
'text',
'integer'),
4704 if ($ilDB->numRows(
$res) == 0) {
4707 INSERT INTO loginname_history 4708 (usr_id, login, history_date) 4709 VALUES (%s, %s, %s)',
4710 array(
'integer',
'text',
'integer'),
4725 public static function _getUsersOnline($a_user_id = 0, $a_no_anonymous =
false)
4732 $ilDB = $DIC->database();
4738 $atime = $pd_set->get(
'user_activity_time') * 60;
4743 if ($a_user_id == 0) {
4744 $where[] =
'user_id > 0';
4745 } elseif (is_array($a_user_id)) {
4746 $where[] =
$ilDB->in(
"user_id", $a_user_id,
false,
"integer");
4748 $where[] =
'user_id = ' .
$ilDB->quote($a_user_id,
'integer');
4751 if ($a_no_anonymous) {
4752 $where[] =
'user_id != ' .
$ilDB->quote(ANONYMOUS_USER_ID,
'integer');
4755 include_once
'Services/User/classes/class.ilUserAccountSettings.php';
4757 include_once
'Services/User/classes/class.ilUserFilter.php';
4761 $where[] =
'expires > ' .
$ilDB->quote($ctime,
'integer');
4762 $where[] =
'(p.value IS NULL OR NOT p.value = ' .
$ilDB->quote(
'y',
'text') .
')';
4764 $where =
'WHERE ' . implode(
' AND ', $where);
4768 SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date 4770 LEFT JOIN usr_data u 4771 ON user_id = u.usr_id 4772 LEFT JOIN usr_pref p 4773 ON (p.usr_id = u.usr_id AND p.keyword = %s) 4775 GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date 4776 ORDER BY lastname, firstname 4779 array(
'hide_own_online_status')
4782 $log->debug(
"Query: " . $q);
4785 while ($user =
$ilDB->fetchAssoc(
$r)) {
4786 if ($atime <= 0 || $user[
'ctime'] + $atime > $ctime) {
4787 $users[$user[
'user_id']] = $user;
4791 $log->debug(
"Found users: " . count(
$users));
4793 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
4796 if ($user[
'agree_date'] || $user[
'user_id'] == SYSTEM_USER_ID ||
'root' === $user[
'login']) {
4803 $log->debug(
"TOS filtered to users: " . count(
$users));
4823 $atime = $pd_set->get(
"user_activity_time") * 60;
4825 $no_anonym = ($a_no_anonymous)
4826 ?
"AND user_id <> " . $ilDB->quote(ANONYMOUS_USER_ID,
"integer") .
" " 4833 $q =
"SELECT DISTINCT dat.obj_id as obj_id " .
4834 "FROM rbac_ua ua " .
4835 "JOIN rbac_fa fa ON fa.rol_id = ua.rol_id " .
4836 "JOIN object_reference r1 ON r1.ref_id = fa.parent " .
4837 "JOIN tree ON tree.child = r1.ref_id " .
4838 "JOIN object_reference r2 ON r2.ref_id = tree.child " .
4839 "JOIN object_data dat ON dat.obj_id = r2.obj_id " .
4840 "WHERE ua.usr_id = " . $ilDB->quote($a_user_id,
"integer") .
" " .
4841 "AND fa.assign = " . $ilDB->quote(
"y",
"text") .
" " .
4842 "AND dat.type IN (" . $ilDB->quote(
"crs",
"text") .
"," .
4843 $ilDB->quote(
"grp",
"text") .
")";
4844 $r = $ilDB->query($q);
4846 while (
$row = $ilDB->fetchAssoc(
$r)) {
4847 $groups_and_courses_of_user[] =
$row[
"obj_id"];
4850 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
4851 $tos_condition =
'';
4853 $tos_condition =
" AND (agree_date IS NOT NULL OR ud.usr_id = " . $ilDB->quote(SYSTEM_USER_ID,
'integer') .
") ";
4857 if (count($groups_and_courses_of_user) == 0) {
4858 $q =
"SELECT count(user_id) as num,ctime,user_id,firstname,lastname,title,login,last_login " .
4859 "FROM usr_session " .
4860 "JOIN usr_data ud ON user_id = ud.usr_id " .
4861 "WHERE user_id = " . $ilDB->quote($a_user_id,
"integer") .
" " .
4864 "AND expires > " . $ilDB->quote(
time(),
"integer") .
" " .
4865 "GROUP BY user_id,ctime,firstname,lastname,title,login,last_login";
4866 $r = $ilDB->query($q);
4868 $q =
"SELECT count(user_id) as num,s.ctime,s.user_id,ud.firstname,ud.lastname,ud.title,ud.login,ud.last_login " .
4869 "FROM usr_session s " .
4870 "JOIN usr_data ud ON ud.usr_id = s.user_id " .
4871 "JOIN rbac_ua ua ON ua.usr_id = s.user_id " .
4872 "JOIN rbac_fa fa ON fa.rol_id = ua.rol_id " .
4873 "JOIN tree ON tree.child = fa.parent " .
4874 "JOIN object_reference or1 ON or1.ref_id = tree.child " .
4875 "JOIN object_data od ON od.obj_id = or1.obj_id " .
4876 "LEFT JOIN usr_pref p ON (p.usr_id = ud.usr_id AND p.keyword = " .
4877 $ilDB->quote(
"hide_own_online_status",
"text") .
") " .
4878 "WHERE s.user_id != 0 " .
4880 "AND (p.value IS NULL OR NOT p.value = " . $ilDB->quote(
"y",
"text") .
") " .
4881 "AND s.expires > " . $ilDB->quote(
time(),
"integer") .
" " .
4882 "AND fa.assign = " . $ilDB->quote(
"y",
"text") .
" " .
4884 "AND " . $ilDB->in(
"od.obj_id", $groups_and_courses_of_user,
false,
"integer") .
" " .
4885 "GROUP BY s.user_id,s.ctime,ud.firstname,ud.lastname,ud.title,ud.login,ud.last_login " .
4886 "ORDER BY ud.lastname, ud.firstname";
4887 $r = $ilDB->query($q);
4890 while ($user = $ilDB->fetchAssoc(
$r)) {
4892 || $user[
"ctime"] + $atime > $ctime) {
4893 $users[$user[
"user_id"]] = $user;
4913 $random = new \ilRandom();
4914 $hashcode = substr(md5(uniqid($random->int(),
true)), 0, 16);
4916 $res = $ilDB->queryf(
4918 SELECT COUNT(usr_id) cnt FROM usr_data 4919 WHERE reg_hash = %s',
4924 if (
$row->cnt > 0) {
4939 array(
'text',
'integer'),
4940 array($hashcode, (
int) $a_usr_id)
4961 $res = $ilDB->queryf(
4963 SELECT usr_id, create_date FROM usr_data 4964 WHERE reg_hash = %s',
4968 while (
$row = $ilDB->fetchAssoc(
$res)) {
4969 require_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
4972 if ((
int) $oRegSettigs->getRegistrationHashLifetime() != 0 &&
4973 time() - (int) $oRegSettigs->getRegistrationHashLifetime() > strtotime(
$row[
'create_date'])) {
4974 require_once
'Services/Registration/exceptions/class.ilRegConfirmationLinkExpiredException.php';
4983 array(
'text',
'integer'),
4987 return (
int) $row[
'usr_id'];
4990 require_once
'Services/Registration/exceptions/class.ilRegistrationHashNotFoundException.php';
4996 if (strlen($a_birthday)) {
5000 $this->birthday = null;
5019 if (!(
int) $period) {
5025 $date =
date(
'Y-m-d H:i:s', (
time() - ((
int) $period * 24 * 60 * 60)));
5027 $query =
"SELECT usr_id FROM usr_data WHERE last_login < %s OR (ISNULL(last_login) AND create_date < %s)";
5033 $ids[] =
$row->usr_id;
5050 $field =
'inactivation_date';
5053 if (!(
int) $period) {
5059 $date =
date(
'Y-m-d H:i:s', (
time() - ((
int) $period * 24 * 60 * 60)));
5061 $query =
"SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
5067 $ids[] =
$row->usr_id;
5084 if ($a_last_login !== null) {
5085 $last_login = $a_last_login;
5087 $last_login =
date(
'Y-m-d H:i:s');
5092 $query =
"UPDATE usr_data SET last_login = %s WHERE usr_id = %s";
5093 $affected = $ilDB->manipulateF(
$query,
array(
'timestamp',
'integer'),
array($last_login, $a_usr_id));
5106 $query =
"UPDATE object_data SET owner = 0 " .
5107 "WHERE owner = " . $ilDB->quote($this->
getId(),
'integer');
5124 $q =
"SELECT DISTINCT " . $ilDB->upper($ilDB->substr(
"lastname", 1, 1)) .
" let" .
5126 " WHERE usr_id <> " . $ilDB->quote(ANONYMOUS_USER_ID,
"integer") .
5128 $let_set = $ilDB->query($q);
5131 while ($let_rec = $ilDB->fetchAssoc($let_set)) {
5132 $let[$let_rec[
"let"]] = $let_rec[
"let"];
5142 $query =
'SELECT count(*) num FROM object_data od ' .
5143 'JOIN usr_data ud ON obj_id = usr_id ' .
5144 'WHERE ' . $ilDB->in(
'obj_id', $a_usr_ids,
false,
'integer') .
' ';
5147 return $num_rows == count((
array) $a_usr_ids);
5156 return (
boolean)
$_SESSION[
"user_captcha_verified"];
5166 $_SESSION[
"user_captcha_verified"] = $a_val;
5177 include_once(
"./Services/Export/classes/class.ilExport.php");
5200 include_once(
"./Services/Export/classes/class.ilExport.php");
5202 if (!is_dir($dir)) {
5206 if (is_int(strpos($entry[
"entry"],
".zip"))) {
5207 return $entry[
"entry"];
5222 include_once(
"./Services/Export/classes/class.ilExport.php");
5225 if (is_file(
$file)) {
5244 include_once(
"./Services/Export/classes/class.ilImport.php");
5246 if (!$a_profile_data) {
5247 $imp->addSkipEntity(
"Services/User",
"usr_profile");
5250 $imp->addSkipEntity(
"Services/User",
"usr_setting");
5252 if (!$a_bookmarks) {
5253 $imp->addSkipEntity(
"Services/Bookmarks",
"bookmarks");
5256 $imp->addSkipEntity(
"Services/Notes",
"user_notes");
5259 $imp->addSkipEntity(
"Services/Calendar",
"calendar");
5262 $a_file[
"tmp_name"],
5278 $NOW = $ilDB->now();
5280 $usrId_IN_usrIds = $ilDB->in(
'usr_id', $usrIds,
false,
'integer');
5284 SET inactivation_date = $NOW 5285 WHERE inactivation_date IS NULL 5286 AND $usrId_IN_usrIds 5289 $ilDB->manipulate($queryString);
5301 $usrId_IN_usrIds = $ilDB->in(
'usr_id', $usrIds,
false,
'integer');
5305 SET inactivation_date = NULL 5306 WHERE $usrId_IN_usrIds 5309 $ilDB->manipulate($queryString);
5337 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5341 null == $this->agree_date &&
5342 'root' != $this->login &&
5343 !in_array($this->
getId(),
array(ANONYMOUS_USER_ID, SYSTEM_USER_ID))
5355 public static function hasUserToAcceptTermsOfService($a_username)
5362 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5368 $in = $ilDB->in(
'usr_id',
array(ANONYMOUS_USER_ID, SYSTEM_USER_ID),
true,
'integer');
5369 $res = $ilDB->queryF(
5370 "SELECT usr_id FROM usr_data WHERE login = %s AND agree_date IS NULL $in",
5374 return $ilDB->fetchAssoc(
$res) ? true :
false;
5388 $date_is = ($a_agreed)
5392 $users = (is_array($a_users))
5393 ?
" AND " . $ilDB->in(
"usr_id", $a_users,
false,
"integer")
5396 $set = $ilDB->query(
"SELECT usr_id FROM usr_data " .
5397 " WHERE agree_date " . $date_is .
5400 while ($rec = $ilDB->fetchAssoc($set)) {
5401 $ret[] = $rec[
"usr_id"];
5413 if (null === $status) {
5417 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5428 return self::_isAnonymous($this->
getId());
5437 return $usr_id == ANONYMOUS_USER_ID;
5452 return (
bool) $this->
getPref(
"delete_flag");
5460 $this->is_self_registered = (bool) $status;
5480 $this->interests_general = $value;
5510 $this->interests_help_offered = $value;
5540 $this->interests_help_looking = $value;
5584 if (!$this->
getId()) {
5588 $set = $ilDB->query(
"SELECT field_id,value" .
5589 " FROM usr_data_multi" .
5590 " WHERE usr_id = " . $ilDB->quote($this->getId(),
"integer") .
5592 while (
$row = $ilDB->fetchAssoc($set)) {
5593 $values[
$row[
"field_id"]][] = $row[
"value"];
5596 if (isset($values[
"interests_general"])) {
5601 if (isset($values[
"interests_help_offered"])) {
5606 if (isset($values[
"interests_help_looking"])) {
5622 if (!$this->
getId()) {
5636 foreach ($map as
$id => $values) {
5637 if (is_array($values) &&
sizeof($values)) {
5638 foreach ($values as $value) {
5639 $value = trim($value);
5641 $uniq_id = $ilDB->nextId(
'usr_data_multi');
5643 $ilDB->manipulate(
"INSERT usr_data_multi" .
5644 " (id,usr_id,field_id,value) VALUES" .
5645 " (" . $ilDB->quote($uniq_id,
"integer") .
5646 "," . $ilDB->quote($this->
getId(),
"integer") .
5647 "," . $ilDB->quote(
$id,
"text") .
5648 "," . $ilDB->quote($value,
"text") .
5663 if (!$this->
getId()) {
5667 $ilDB->manipulate(
"DELETE FROM usr_data_multi" .
5668 " WHERE usr_id = " . $ilDB->quote($this->getId(),
"integer"));
5671 public static function findInterests($a_term, $a_user_id = null, $a_field_id = null)
5677 $sql =
"SELECT DISTINCT(value)" .
5678 " FROM usr_data_multi" .
5679 " WHERE " . $ilDB->like(
"value",
"text",
"%" . $a_term .
"%");
5681 $sql .=
" AND field_id = " . $ilDB->quote($a_field_id,
"text");
5684 $sql .=
" AND usr_id <> " . $ilDB->quote($a_user_id,
"integer");
5686 $sql .=
" ORDER BY value";
5687 $set = $ilDB->query($sql);
5688 while (
$row = $ilDB->fetchAssoc($set)) {
5708 $ilDB = $DIC->database();
5710 $set =
$ilDB->query(
5711 "SELECT * FROM usr_pref " .
5712 " WHERE keyword = " .
$ilDB->quote(
"public_profile",
"text") .
5713 " AND " .
$ilDB->in(
"usr_id", $a_user_ids,
false,
"integer")
5716 "global" =>
array(),
5718 "public" =>
array(),
5719 "not_public" =>
array()
5721 while ($rec =
$ilDB->fetchAssoc($set)) {
5722 if ($rec[
"value"] ==
"g") {
5723 $r[
"global"][] = $rec[
"usr_id"];
5724 $r[
"public"][] = $rec[
"usr_id"];
5726 if ($rec[
"value"] ==
"y") {
5727 $r[
"local"][] = $rec[
"usr_id"];
5728 $r[
"public"][] = $rec[
"usr_id"];
5731 foreach ($a_user_ids as
$id) {
5732 if (!in_array($id,
$r[
"public"])) {
5733 $r[
"not_public"][] =
$id;
getCurrentLanguage()
returns the current language (may differ from user's pref setting!)
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
Class for user related exception handling in ILIAS.
static _getUserIdsByInactivationPeriod($period)
get ids of all users that have been inactivated since at least the given period
static getUserIdByLogin($a_login)
static toUsernameWithoutDomain($a_login)
Static function removes Microsoft domain name from username webdav related.
setActive($a_active, $a_owner=0)
set user active state and updates system fields appropriately public
Class ilMailOptions this class handles user mails.
dropDesktopItem($a_item_id, $a_type)
drop an item from user's personal desktop
static _lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
getClipboardObjects($a_type="", $a_top_nodes_only=false)
get all clipboard objects of user and specified type
static $is_desktop_item_loaded
static _getInstance()
get singleton instance
static _lookupSecondEmail($a_user_id)
Lookup second e-mail.
setInstitution($a_str)
set institution public
refreshLogin()
updates the login data of a "user" // TODO set date with now() should be enough public ...
static initInactivationDate($usrIds)
type $ilDB
static _getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
getAuthMode($a_auth_key=false)
get auth mode public
setLatitude($a_latitude)
Set Latitude.
getLogin()
get login / username public
setOfferingHelp(array $value=null)
Set help offering.
getActive()
get user active state public
addUserDefinedFieldEntry()
static _getInstance()
Get instance.
static _deleteUser($a_usr_id)
clipboardDeleteAll()
Delete objects of type for user.
static preloadIsDesktopItem($a_usr_id, $a_item_ids)
Preload desktop item information.
static lookupMatriculation($a_usr_id)
Lookup matriculation.
getTimeZone()
get timezone of user
setDepartment($a_str)
set department public
static _deleteSettingsOfUser($a_user)
Delete block settings of user.
static hasActiveSession($a_user_id, $a_session_id)
Check for simultaneous login.
getFirstname()
get firstname public
setSelectedCountry($a_val)
Set selected country (selection drop down)
getLoginByUserId($a_userid)
static getProfileStatusOfUsers($a_user_ids)
Get profile status.
setLoginAttempts($a_login_attempts)
setCaptchaVerified($a_val)
Set captcha verified.
getMatriculation()
get matriculation number public
static _getFeedPass($a_user_id)
Lookup news feed password for user.
isPasswordChangeDemanded()
getGeneralInterestsAsText()
Get general interests as plain text.
setLanguage($a_str)
set user language public
removeUserPicture($a_do_update=true)
Remove user picture.
setFullname($a_title="", $a_firstname="", $a_lastname="")
builds a string with title + firstname + lastname method is used to build fullname in member variable...
getOrgUnitsRepresentation()
getDesktopItems($a_types="")
static _writePref($a_usr_id, $a_keyword, $a_value)
static _lookupFullname($a_user_id)
Lookup Full Name.
Class for user related exception handling in ILIAS.
setLastLogin($a_str)
set user's last login public
static _getUsersForClipboadObject($a_type, $a_id)
get all users, that have a certain object within their clipboard
getInactivationDate()
getter for inactivation date
setProfileIncomplete($a_prof_inc)
Custom block for external feeds on personal desktop.
getDepartment()
get department public
setAuthMode($a_str)
set auth mode public
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static deleteByOwner($a_owner_id)
Delete all entries for owner.
static _incrementLoginAttempts($a_usr_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$login
all user related data in single vars public
static get($a_var)
Get a value.
getLocationZoom()
Get Location Zoom.
setId($a_id)
set object id public
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...
setDesktopItemParameters($a_item_id, $a_type, $a_par)
set parameters of a desktop item entry
static set($a_var, $a_val)
Set a value.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static resetToDefaults()
reset to defaults
static _getUserIdsByInactivityPeriod($period)
get ids of all users that have been inactive for at least the given period
static _getLastHistoryDataByUserId($a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
static _lookupId($a_user_str)
Lookup id by login.
getInstitution()
get institution public
setTimeLimitOwner($a_owner)
static setUseRelativeDates($a_status)
set use relative dates
assignData($a_data)
loads a record "user" from array public
static _lookupTitle($a_id)
lookup object title
static $personal_image_cache
static _isActive()
Static getter.
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
static _lookupClientIP($a_user_id)
Lookup client ip.
setLastname($a_str)
set lastame public
getCreateDate()
get create date public
Base class for nested set path based trees.
getLongitude()
Get Longitude.
getPhoneOffice()
get office phone public
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getStreet()
get street public
static subStr($a_str, $a_start, $a_length=null)
static userExists($a_usr_ids=array())
static getInstance()
Singelton get instance.
static _lookupGender($a_user_id)
Lookup gender.
setIsSelfRegistered($status)
getCountry()
Get country (free text)
static _resetLoginAttempts($a_usr_id)
static _getAuthMode($a_auth_mode, $a_db_handler='')
getPref($a_keyword)
get a user preference
static _getAuthModeName($a_auth_key)
static now()
Return current timestamp in Y-m-d H:i:s format.
static _getLoginAttempts($a_usr_id)
static _toggleActiveStatusOfUsers($a_usr_ids, $a_status)
Toggle active status of users.
static lookupTitle($a_page_id)
Lookup title.
read()
loads a record "user" from database private
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
deleteUserDefinedFieldEntries()
setCountry($a_str)
Set country (free text)
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
getLookingForHelp()
Get help looking for.
setPhoneHome($a_str)
set home phone public
getOfferingHelpAsText()
Get help offering as plain text.
setTimeLimitUnlimited($a_unlimited)
static styleExistsForSkinId($skin_id, $style_id)
Tree handler for personal workspace.
setPref($a_keyword, $a_value)
set a user preference
static _verifyRegistrationHash($a_hash)
Verifies a registration hash.
static _getImportedUserId($i2_id)
updateUserDefinedFields()
setInactivationDate($inactivation_date)
setter for inactivation date
setZipcode($a_str)
set zipcode public
setDiskQuota($a_disk_quota)
Sets the minimal disk quota imposed by this user account.
static _externalAccountExists($a_external_account, $a_auth_mode)
Check if an external account name already exists.
getDateFormat()
get date format
isDesktopItem($a_item_id, $a_type)
check wether an item is on the users desktop or not
addDesktopItem($a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
setAgreeDate($a_str)
set date the user account was accepted by the user nullindicates that the user has not accepted his a...
static setLanguage($a_lng)
set language
getUserIdByEmail($a_email)
STATIC METHOD get the user_id of an email address.
getAgreeDate()
get the date when the user accepted the user agreement public
static removeForUser($user_id)
Remove all notifications for given user.
static _getInstance()
Get singleton instance of this class.
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 2...
static _removeTrackingDataForUser($user_id)
setEmail($a_str)
set email public
getGeneralInterests()
Get general interests.
writeAccepted()
write accept date of user agreement to db
setPasswd($a_str, $a_type=IL_PASSWD_PLAIN)
set password public
static _removeItemFromDesktops($a_id)
removes object from all user's desktops public
static lookupOrgUnitsRepresentation($a_usr_id)
lokup org unit representation
getExternalAccount()
get external account
resetLastPasswordChange()
setTimeLimitUntil($a_until)
getPersonalWorkspaceDiskQuota()
setLogin($a_str)
set login / username public
getZipcode()
get zipcode public
getEmail()
get email address public
static _getAllUserData($a_fields=null, $active=-1)
STATIC METHOD get all user data.
setUserDefinedData($a_data)
static copyProfilePicturesToDirectory($a_user_id, $a_dir)
Get profile picture direcotory.
getLastname()
get lastname public
setOwner($a_owner)
set object owner
foreach($_POST as $key=> $value) $res
static execConvert($args)
execute convert command
setExternalAccount($a_str)
set external account
getId()
get object id public
getLastPasswordChangeTS()
exportPersonalData()
Export personal data.
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
static _getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
setComment($a_str)
set referral comment public
getDiskQuota()
Returns the minimal disk quota imposed by this user account.
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
static _lookupDescription($a_id)
lookup object description
Mail Box class Base class for creating and handling mail boxes.
importPersonalData( $a_file, $a_profile_data, $a_settings, $a_bookmarks, $a_notes, $a_calendar)
Import personal data.
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
static _deleteByUser($a_usr_id)
clipboardDeleteObjectsOfType($a_type)
Delete objects of type for user.
deletePref($a_keyword)
Deletes a userpref value of the user from the database public.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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
setHobby($a_str)
set hobby public
static 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.
setLocationZoom($a_locationzoom)
Set Location Zoom.
setMatriculation($a_str)
set matriculation number public
writePref($a_keyword, $a_value)
write userpref to user table private
setTimeLimitMessage($a_time_limit_message)
isCaptchaVerified()
Is user captcha verified?
getLastLogin()
returns last login date public
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
clipboardHasObjectsOfType($a_type)
Check whether clipboard has objects of a certain type.
getOfferingHelp()
Get help offering.
redirection script todo: (a better solution should control the processing via a xml file) ...
getLookingForHelpAsText()
Get help looking for as plain text.
setSecondEmail($second_email)
static _removeTrackingDataForUser($user_id)
static $is_desktop_item_cache
static _setFeedPass($a_user_id, $a_password)
Set news feed password for user.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct($a_user_id=0, $a_call_by_reference=false)
Constructor public.
setGender($a_str)
set gender public
static signFile($path_to_file)
static _uploadPersonalPicture($tmp_file, $obj_id)
Create a personal picture image file from a temporary image file.
writePrefs()
write all userprefs private
static _destroyByUserId($a_user_id)
Destroy session.
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
sendPersonalDataFile()
Send personal data file.
getUTitle()
get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets...
getPersonalPicturePath($a_size="small", $a_force_pic=false)
Get path to personal picture.
static _getAssociatedUsersOnline($a_user_id, $a_no_anonymous=false)
reads all active sessions from db and returns users that are online and who have a local role in a gr...
Create styles array
The data for the language used.
static deleteEntriesOfUser($a_user_id)
Delete data of user.
updateMultiTextFields($a_create=false)
Write multi-text values to DB.
setTimeLimitFrom($a_from)
static _getUsersForFolder($ref_id, $active)
get users for a category or from system folder
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
setCity($a_str)
set city public
getPCClipboardContent()
Add a page content item to PC clipboard (should go to another class)
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
This is the super class of all custom blocks.
if(php_sapi_name() !='cli') $in
setPhoneOffice($a_str)
set office phone public
update($pash, $contents, Config $config)
setLastPasswordChangeTS($a_last_password_change_ts)
getLatitude()
Get Latitude.
foreach($mandatory_scripts as $file) $timestamp
static getUserSubsetByPreferenceValue($a_user_ids, $a_keyword, $a_val)
For a given set of user IDs return a subset that has a given user preference set. ...
getSelectedCountry()
Get selected country (selection drop down)
getComment()
get referral comment public
buildTextFromArray($a_attr)
Convert multi-text values to plain text.
deleteMultiTextFields()
Remove multi-text values from DB.
setClientIP($a_str)
set client ip number public
getPersonalDataExportFile()
Get personal data export file.
static _lookupAuthMode($a_usr_id)
lookup auth mode
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static _lookupDesktopItems($user_id, $a_types="")
get all desktop items of user and specified type
static _setUserInactive($a_usr_id)
getFullname($a_max_strlen=0)
get fullname public
static _isAnonymous($usr_id)
static _lookupLanguage($a_usr_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
setFirstname($a_str)
set firstname public
getPasswdType()
get password type
static _getUsersForGroup($a_mem_ids, $active=-1)
return user data for group members
removeObjectFromClipboard($a_item_id, $a_type)
remove object from user's personal clipboard
static _deleteUser($a_usr_id)
setGeneralInterests(array $value=null)
Set general interests.
bookmark folder (note: this class handles personal bookmarks folders only)
static resetInactivationDate($usrIds)
type $ilDB
static _lookupEmail($a_user_id)
Lookup email.
static getInstance()
Singelton get instance.
static _lookupPref($a_usr_id, $a_keyword)
getTimeFormat()
get time format
static _generateRegistrationHash($a_usr_id)
Generates a unique hashcode for activating a user profile after registration.
setLookingForHelp(array $value=null)
Set help looking for.
static _lookupFeedHash($a_user_id, $a_create=false)
Lookup news feed hash for user.
static getFirstLettersOfLastnames()
Get first letters of all lastnames.
setFax($a_str)
set fax public
static removeSingleUserFromTable($usr_id)
getPhoneHome()
get home phone public
static _getUsersForIds($a_mem_ids, $active=-1, $timelimitowner=-1)
return user data for given user id
static _deleteUser($a_usr_id)
getHobby()
get hobby public
setPasswordSalt($password_salt)
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _updateLastLogin($a_usr_id, $a_last_login=null)
STATIC METHOD updates the last_login field of user with given id to given or current date...
getGender()
get gender public
const USER_FOLDER_ID
Class ilObjUserFolder.
setLastPasswordChangeToNow()
static findInterests($a_term, $a_user_id=null, $a_field_id=null)
static _getUserIdsByEmail($a_email)
STATIC METHOD get all user_ids of an email address.
setUTitle($a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
static getLogger($a_component_id)
Get component logger.
setSkin($a_str)
set user skin (template set) public
setApproveDate($a_str)
set date the user account was activated null indicates that the user has not yet been activated publ...
static _moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
setPasswordEncodingType($password_encryption_type)
static _lookupActive($a_usr_id)
Check user account active.
getStoredActive($a_id)
get user active state
getClipboardChilds($a_parent, $a_insert_time)
Get childs of an item.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _writeAuthMode($a_usr_id, $a_auth_mode)
getApproveDate()
get the date when the user account was approved public
setStreet($a_str)
set street public
static _getUsersForRole($role_id, $active=-1)
return array of complete users which belong to a specific role
update()
update object in db
setPhoneMobile($a_str)
set mobile phone public
Class for user related exception handling in ILIAS.
static getUsersAgreed($a_agreed=true, $a_users=null)
Get users that have or have not agreed to the user agreement.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
getClientIP()
get client ip number public
static deleteByUserId($a_user_id)
setLastUpdate($a_str)
set last update of user data set public
static _getPreferences($user_id)
get preferences for user
hasToAcceptTermsOfService()
readMultiTextFields()
Fetch multi-text values from DB.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
getLanguage()
returns a 2char-language-string public
static _getInstance()
Get instance of ilSecuritySettings.
static _getUserData($a_internalids)
return user data for given user ids
getPasswordEncodingType()
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
static getInstance()
Single method to reduce footprint (included files, created instances)
hasToAcceptTermsOfServiceInSession($status=null)
static _writeHistory($a_usr_id, $a_login)
setCurrentLanguage($a_val)
Set current language.
static _writeExternalAccount($a_usr_id, $a_ext_id)
hasPublicProfile()
returns true if public is profile, false otherwise
static _getAllUserAssignedStyles()
skins and styles
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _doesLoginnameExistInHistory($a_login)
Checks wether the passed loginname already exists in history.
addToPCClipboard($a_content, $a_time, $a_nr)
Add a page content item to PC clipboard (should go to another class)
updateLogin($a_login)
update login name
static _deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database public.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static _deleteUser($a_usr_id)
setLongitude($a_longitude)
Set Longitude.
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
readPrefs()
get all user preferences private
getPhoneMobile()
get mobile phone public
static _lookupLastLogin($a_user_id)
lookup last login