124 bool $a_call_by_reference =
false 132 $this->irss = $DIC->resourceStorage();
133 $this->auth_mode =
"default";
134 $this->passwd_type = self::PASSWD_PLAIN;
135 if ($a_user_id > 0) {
136 $this->
setId($a_user_id);
140 $this->prefs[
"language"] = $this->
ilias->ini->readVariable(
"language",
"default");
141 $this->skin = $this->
ilias->ini->readVariable(
"layout",
"skin");
143 $this->prefs[
"style"] = $this->
ilias->ini->readVariable(
"layout",
"style");
146 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
147 $this->date_format_factory = (
new DataFactory())->dateFormat();
162 $r =
$ilDB->queryF(
"SELECT * FROM usr_data " .
163 'WHERE usr_id= %s', [
'integer'], [$this->
id]);
168 $data[
"passwd_type"] = self::PASSWD_CRYPTED;
183 if (!isset($this->prefs[
'language']) || $this->prefs[
'language'] ===
'') {
184 $this->prefs[
'language'] = $this->oldPrefs[
'language'] ??
'';
188 !isset($this->prefs[
'skin']) || $this->prefs[
'skin'] ===
'' ||
191 $this->prefs[
'skin'] = $this->oldPrefs[
'skin'] ??
'';
194 $this->skin = $this->prefs[
"skin"];
197 !isset($this->prefs[
'style']) ||
198 $this->prefs[
'style'] ===
'' ||
206 $this->prefs[
"skin"] = $this->
ilias->ini->readVariable(
"layout",
"skin");
207 $this->prefs[
"style"] = $this->
ilias->ini->readVariable(
"layout",
"style");
210 if (empty($this->prefs[
"hits_per_page"])) {
211 $this->prefs[
"hits_per_page"] = 10;
214 $ilErr->raiseError(
"<b>Error: There is no dataset with id " .
215 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " . __FILE__ .
216 "<br />Line: " . __LINE__,
$ilErr->FATAL);
232 $this->password_encoding_type = $password_encryption_type;
256 $this->
setLogin($a_data[
"login"] ??
'');
257 if (!($a_data[
"passwd_type"] ??
false)) {
258 $ilErr->raiseError(
"<b>Error: passwd_type missing in function assignData(). " .
259 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " 260 . __FILE__ .
"<br />Line: " . __LINE__,
$ilErr->FATAL);
262 if (($a_data[
"passwd"] ??
'') !=
"********" && strlen($a_data[
'passwd'] ??
'')) {
263 $this->
setPasswd($a_data[
"passwd"] ??
'', $a_data[
"passwd_type"] ??
'');
266 $this->
setGender((
string) ($a_data[
"gender"] ??
''));
267 $this->
setUTitle((
string) ($a_data[
"title"] ??
''));
268 $this->
setFirstname((
string) ($a_data[
"firstname"] ??
''));
269 $this->
setLastname((
string) ($a_data[
"lastname"] ??
''));
271 if (isset($a_data[
'birthday']) && is_string($a_data[
'birthday'])) {
279 $this->
setDepartment((
string) ($a_data[
"department"] ??
''));
280 $this->
setStreet((
string) ($a_data[
"street"] ??
''));
281 $this->
setCity((
string) ($a_data[
"city"] ??
''));
282 $this->
setZipcode((
string) ($a_data[
"zipcode"] ??
''));
283 $this->
setCountry((
string) ($a_data[
"country"] ??
''));
286 $this->
setPhoneHome((
string) ($a_data[
"phone_home"] ??
''));
288 $this->
setFax((
string) ($a_data[
"fax"] ??
''));
290 $this->
setEmail((
string) ($a_data[
"email"] ??
''));
291 $this->
setSecondEmail((
string) ($a_data[
"second_email"] ?? null));
292 $this->
setHobby((
string) ($a_data[
"hobby"] ??
''));
293 $this->
setClientIP((
string) ($a_data[
"client_ip"] ??
''));
303 $this->
setLastLogin((
string) ($a_data[
"last_login"] ??
''));
304 $this->
setFirstLogin((
string) ($a_data[
"first_login"] ??
''));
306 $this->
setLastUpdate((
string) ($a_data[
"last_update"] ??
''));
307 $this->create_date = $a_data[
"create_date"] ??
"";
308 $this->
setComment((
string) ($a_data[
"referral_comment"] ??
''));
309 $this->approve_date = ($a_data[
"approve_date"] ?? null);
310 $this->active = ($a_data[
"active"] ?? 0);
311 $this->agree_date = ($a_data[
"agree_date"] ?? null);
326 $this->
setAuthMode((
string) ($a_data[
'auth_mode'] ?? null));
332 $this->avatar_rid = (string) ($a_data[
'rid'] ?? self::NO_AVATAR_RID);
344 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
350 switch ($this->passwd_type) {
351 case self::PASSWD_PLAIN:
352 if (strlen($this->passwd)) {
360 case self::PASSWD_CRYPTED:
365 $ilErr->raiseError(
"<b>Error: passwd_type missing in function saveAsNew. " .
366 $this->
id .
"!</b><br />class: " . get_class($this) .
"<br />Script: " . __FILE__ .
367 "<br />Line: " . __LINE__,
$ilErr->FATAL);
370 if (!$this->active) {
379 "passwd" => [
"text", $pw_value],
386 "email" => [
"text", trim($this->email ??
'')],
387 "second_email" => [
"text", trim($this->second_email ??
'')],
401 "last_login" => [
"timestamp", null],
402 "first_login" => [
"timestamp", null],
403 "last_profile_prompt" => [
"timestamp", null],
421 "loc_zoom" => [
"integer", (
int) $this->loc_zoom],
422 "last_password_change" => [
"integer", $this->last_password_change_ts],
425 'is_self_registered' => [
'integer', (
int) $this->is_self_registered],
427 $ilDB->insert(
"usr_data", $insert_array);
434 $mbox->createDefaultFolder();
437 $mail_options->createMailOptionsEntry();
439 $ilAppEventHandler->raise(
442 [
"user_obj" => $this]
458 } elseif ($this->active) {
465 "firstname" => [
"text", substr($this->firstname, 0, 128)],
466 "lastname" => [
"text", substr($this->lastname, 0, 128)],
467 "email" => [
"text", substr(trim($this->email), 0, 128)],
468 "second_email" => [
"text", trim($this->second_email ??
'')],
497 "loc_zoom" => [
"integer", (
int) $this->loc_zoom],
498 'login_attempts' => [
'integer', $this->login_attempts],
499 "last_password_change" => [
"integer", $this->last_password_change_ts],
500 "passwd_policy_reset" => [
"integer", $this->passwd_policy_reset],
503 'reg_hash' => [
'text', null],
506 ($this->avatar_rid ?? self::NO_AVATAR_RID)
510 if ($this->agree_date === null || (is_string($this->agree_date) && strtotime($this->agree_date) !==
false)) {
513 switch ($this->passwd_type) {
514 case self::PASSWD_PLAIN:
515 if (strlen($this->passwd)) {
517 $update_array[
'passwd'] = [
'text', $this->
getPasswd()];
523 case self::PASSWD_CRYPTED:
528 $ilErr->raiseError(
"<b>Error: passwd_type missing in function update()" . $this->
id .
"!</b><br />class: " .
529 get_class($this) .
"<br />Script: " . __FILE__ .
"<br />Line: " . __LINE__,
$ilErr->FATAL);
535 $ilDB->update(
"usr_data", $update_array, [
"usr_id" => [
"integer", $this->
id]]);
549 $ilAppEventHandler->raise(
552 [
"user_obj" => $this]
564 $ilDB->manipulateF(
"UPDATE usr_data SET agree_date = " .
$ilDB->now() .
565 " WHERE usr_id = %s", [
"integer"], [$this->
getId()]);
574 $ilDB = $DIC->database();
577 "SELECT " . $a_field .
" FROM usr_data WHERE usr_id = %s",
583 return $set[$a_field];
593 $ilDB = $DIC[
'ilDB'];
595 $set =
$ilDB->queryF(
596 "SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
601 if ($rec =
$ilDB->fetchAssoc($set)) {
603 $fullname = $rec[
"title"] .
" ";
605 if ($rec[
"firstname"]) {
606 $fullname .= $rec[
"firstname"] .
" ";
608 if ($rec[
"lastname"]) {
609 $fullname .= $rec[
"lastname"];
617 return self::_lookup($a_user_id,
"email") ??
'';
622 return (
string) self::_lookup($a_user_id,
"gender") ??
'';
627 return self::_lookup($a_user_id,
"client_ip") ??
'';
638 $ilDB = $DIC[
'ilDB'];
641 "SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
645 if ($user_rec =
$ilDB->fetchAssoc(
$res)) {
646 return [
"user_id" => $a_user_id,
647 "firstname" => $user_rec[
"firstname"],
648 "lastname" => $user_rec[
"lastname"],
649 "title" => $user_rec[
"title"],
650 "login" => $user_rec[
"login"]
653 return [
"user_id" => 0,
669 $ilDB = $DIC[
'ilDB'];
672 "SELECT * FROM usr_data WHERE usr_id = %s",
682 return (
string) self::_lookup($a_user_id,
"login") ??
'';
687 return (
string) self::_lookup($a_user_id,
"ext_account") ??
'';
698 $ilDB = $DIC[
'ilDB'];
700 if (!is_array($a_user_str)) {
702 "SELECT usr_id FROM usr_data WHERE login = %s",
708 if (is_array($user_rec)) {
709 return (
int) $user_rec[
"usr_id"];
716 "SELECT usr_id FROM usr_data " .
717 " WHERE " .
$ilDB->in(
"login", $a_user_str,
false,
"text")
721 while ($rec =
$ilDB->fetchAssoc($set)) {
722 $ids[] = (
int) $rec[
'usr_id'];
730 return self::_lookup($a_user_id,
"last_login") ??
'';
735 return self::_lookup($a_user_id,
"first_login") ??
'';
748 "UPDATE usr_data SET " .
749 "last_login = " .
$ilDB->now() .
750 " WHERE usr_id = %s",
757 "UPDATE usr_data SET " .
758 "first_login = " .
$ilDB->now() .
759 " WHERE usr_id = %s",
763 $this->app_event_handler->raise(
766 [
"user_obj" => $this]
786 if (func_num_args() != 2) {
790 if (!isset($raw) || !isset($raw_retype)) {
794 if ($raw != $raw_retype) {
802 SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s 804 [
'text',
'text',
'text',
'integer'],
818 $ilDB = $DIC->database();
822 SELECT * FROM loginname_history 841 $ilDB = $DIC[
'ilDB'];
843 $ilDB->setLimit(1, 0);
846 SELECT login, history_date FROM loginname_history 847 WHERE usr_id = %s ORDER BY history_date DESC',
852 if (!is_array($row) || !count($row)) {
857 $row[
'login'], $row[
'history_date']
874 $lng = $DIC->language();
876 if (func_num_args() != 1) {
880 if (!isset($a_login)) {
884 $former_login = self::_lookupLogin($this->
getId());
887 if (0 == strcmp($a_login, $former_login)) {
892 $last_history_entry = self::_getLastHistoryDataByUserId($this->
getId());
894 $last_history_entry = null;
898 if ((
int)
$ilSetting->get(
'allow_change_loginname') &&
900 self::_doesLoginnameExistInHistory($a_login)) {
902 } elseif ((
int)
$ilSetting->get(
'allow_change_loginname') &&
904 is_array($last_history_entry) &&
905 $last_history_entry[1] + (
int)
$ilSetting->get(
'loginname_change_blocking_time') > time()) {
908 $lng->
txt(
'changing_loginname_not_possible_info'),
919 if ((
int)
$ilSetting->get(
'allow_change_loginname') &&
921 self::_writeHistory($this->
getId(), $former_login);
925 $this->
login = $a_login;
944 self::_writePref($this->
id, $a_keyword, $a_value);
945 $this->
setPref($a_keyword, $a_value);
950 self::_deletePref($this->
getId(), $a_keyword);
953 public static function _deletePref(
int $a_user_id,
string $a_keyword): void
957 $ilDB = $DIC->database();
960 'DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s',
962 [$a_user_id, $a_keyword]
973 $ilDB = $DIC->database();
976 "DELETE FROM usr_pref WHERE usr_id = %s",
989 $ilDB = $DIC->database();
993 "usr_id" => [
"integer", $a_usr_id],
994 "keyword" => [
"text", $a_keyword],
997 "value" => [
"text",$a_value]
1004 self::_deleteAllPref($this->
id);
1005 foreach ($this->prefs as $keyword => $value) {
1006 self::_writePref($this->
id, $keyword, (
string) $value);
1012 if ($tz = $this->
getPref(
'user_tz')) {
1022 if ($format = $this->
getPref(
'time_format')) {
1026 return $settings->getDefaultTimeFormat();
1032 if (!($format = $this->
getPref(
'date_format'))) {
1034 $format =
$settings->getDefaultDateFormat();
1039 return $this->date_format_factory->germanShort();
1042 return $this->date_format_factory->americanShort();
1046 return $this->date_format_factory->standard();
1050 public function setPref(
string $a_keyword, ?
string $a_value): void
1052 if ($a_keyword !=
"") {
1053 $this->prefs[$a_keyword] = $a_value;
1057 public function getPref(
string $a_keyword): ?string
1059 return $this->prefs[$a_keyword] ?? null;
1064 return (array_key_exists($a_keyword, $this->prefs));
1073 $ilDB = $DIC[
'ilDB'];
1075 $query =
"SELECT * FROM usr_pref WHERE usr_id = " .
$ilDB->quote($a_usr_id,
"integer") .
" " .
1076 "AND keyword = " .
$ilDB->quote($a_keyword,
"text");
1087 if (is_array($this->prefs)) {
1090 $this->prefs = self::_getPreferences($this->
id);
1093 public function delete():
bool 1097 $rbacadmin = $DIC->rbac()->admin();
1100 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
1101 $ilAppEventHandler->raise(
1104 [
'usr_id' => $this->
getId()]
1109 $mapping->deleteUser($this->
getId());
1114 $mailbox->updateMailsOfDeletedUser($this->
getLogin());
1121 "DELETE FROM usr_data WHERE usr_id = %s",
1129 self::_deleteAllPref($this->
getId());
1137 $rbacadmin->removeUser($this->
getId());
1141 $q =
"DELETE FROM bookmark_tree WHERE tree = " .
1145 $q =
"DELETE FROM bookmark_data WHERE user_id = " .
1171 $tree->cascadingDelete();
1174 $this->cron_delete_user_reminder_mail->removeSingleUserFromTable($this->
getId());
1181 $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->
getId());
1204 $this->fullname = ($this->utitle !=
"")
1205 ? $this->utitle .
" " 1207 $this->fullname .= $this->firstname .
" ";
1225 if (!$a_max_strlen) {
1229 if (strlen($this->fullname) <= $a_max_strlen) {
1233 if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1234 return ilUtil::stripSlashes($this->utitle .
" " . substr($this->firstname, 0, 1) .
". " . $this->lastname);
1237 if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1241 if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1250 $this->
login = $a_str;
1262 $this->passwd = $a_str;
1263 $this->passwd_type = $a_type;
1284 $this->gender = substr($a_str, -1);
1299 $this->utitle = $a_str;
1309 $this->firstname = $a_str;
1319 $this->lastname = $a_str;
1329 $this->institution = $a_str;
1339 $this->department = $a_str;
1349 $this->street = $a_str;
1359 $this->city = $a_str;
1369 $this->zipcode = $a_str;
1379 $this->country = $a_str;
1392 $this->sel_country = $a_val;
1405 $this->phone_office = $a_str;
1415 $this->phone_home = $a_str;
1425 $this->phone_mobile = $a_str;
1435 $this->fax = $a_str;
1445 $this->client_ip = $a_str;
1455 $this->matriculation = $a_str;
1467 $ilDB = $DIC[
'ilDB'];
1469 $query =
"SELECT matriculation FROM usr_data " .
1470 "WHERE usr_id = " .
$ilDB->quote($a_usr_id);
1473 return $row->matriculation ?:
'';
1478 $this->email = $a_str;
1498 $this->hobby = $a_str;
1508 $this->
setPref(
"language", $a_str);
1514 return $this->prefs[
"language"];
1519 $this->last_password_change_ts = $a_last_password_change_ts;
1534 $this->passwd_policy_reset = $status;
1541 $ilDB = $DIC->database();
1542 $lng = $DIC->language();
1544 $q =
"SELECT value FROM usr_pref WHERE usr_id= " .
1545 $ilDB->quote($a_usr_id,
"integer") .
" AND keyword = " .
1546 $ilDB->quote(
'language',
"text");
1549 while ($row =
$ilDB->fetchAssoc(
$r)) {
1550 return (
string) $row[
'value'];
1552 if (is_object(
$lng)) {
1564 $ilDB = $DIC[
'ilDB'];
1567 "UPDATE usr_data " .
1568 " SET ext_account = %s WHERE usr_id = %s",
1569 [
"text",
"integer"],
1570 [$a_ext_id, $a_usr_id]
1578 $ilDB = $DIC[
'ilDB'];
1581 "UPDATE usr_data " .
1582 " SET auth_mode = %s WHERE usr_id = %s",
1583 [
"text",
"integer"],
1584 [$a_auth_mode, $a_usr_id]
1606 $this->last_login = $a_str;
1616 $this->first_login = $a_str;
1626 $this->last_profile_prompt = $a_str;
1636 $this->last_update = $a_str;
1646 $this->referral_comment = $a_str;
1660 $this->approve_date = $a_str;
1674 $this->agree_date = $a_str;
1706 $ilDB = $DIC[
'ilDB'];
1708 $query =
'SELECT usr_id FROM usr_data ' .
1709 'WHERE active = ' .
$ilDB->quote(1,
'integer') .
' ' .
1710 'AND usr_id = ' .
$ilDB->quote($a_usr_id,
'integer');
1731 if ($this->active) {
1735 if ((!empty($storedActive) && empty($currentActive)) ||
1736 (empty($storedActive) && !empty($currentActive))) {
1737 $this->
setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1746 return (
bool) self::_lookup($a_id,
"active");
1751 $this->skin = $a_str;
1756 $this->time_limit_owner = $a_owner;
1761 return $this->time_limit_owner ?: 7;
1766 $this->time_limit_from = $a_from;
1776 $this->time_limit_until = $a_until;
1786 $this->time_limit_unlimited = $a_unlimited;
1796 $this->time_limit_message = $a_time_limit_message;
1806 $this->login_attempts = $a_login_attempts;
1827 $this->profile_incomplete = $a_prof_inc;
1858 $passwordResetOnFirstLogin = (
1859 $security->isPasswordChangeOnFirstLoginEnabled() &&
1864 return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1875 $max_pass_age = $security->getPasswordMaxAge();
1876 if ($max_pass_age > 0) {
1877 $max_pass_age_ts = ($max_pass_age * 86400);
1879 $current_ts = time();
1881 if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1894 $current_ts = time();
1896 $password_age = (
int) (($current_ts - $pass_change_ts) / 86400);
1897 return $password_age;
1904 $ilDB = $DIC[
'ilDB'];
1908 $query =
"UPDATE usr_data SET last_password_change = %s " .
1909 "WHERE usr_id = %s";
1910 $affected =
$ilDB->manipulateF(
1912 [
'integer',
'integer'],
1926 $query =
"UPDATE usr_data SET last_password_change = 0 " .
1927 "WHERE usr_id = %s";
1928 $affected =
$ilDB->manipulateF(
1942 $this->latitude = $a_latitude;
1952 $this->longitude = $a_longitude;
1962 $this->loc_zoom = $a_locationzoom;
1983 string $a_session_id
1987 $ilDB = $DIC[
'ilDB'];
1989 $set =
$ilDB->queryf(
1991 SELECT COUNT(*) session_count 1992 FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
1993 [
'integer',
'integer',
'text'],
1994 [$a_user_id, time(), $a_session_id]
1996 $row =
$ilDB->fetchAssoc($set);
1997 return (
bool) $row[
'session_count'];
2005 $login = self::getLoginFromAuth();
2006 $id = self::_lookupId($login);
2018 $uid =
$GLOBALS[
'DIC'][
'ilAuthSession']->getUserId();
2019 $login = self::_lookupLogin($uid);
2023 $login = self::toUsernameWithoutDomain($login);
2036 $pos = strrpos($a_login,
'/');
2037 $pos2 = strrpos($a_login,
'\\');
2038 if ($pos ===
false || $pos < $pos2) {
2042 $a_login = substr($a_login, $pos + 1);
2054 $login = self::getLoginFromAuth();
2055 $set =
$ilDB->queryF(
2056 "SELECT active FROM usr_data WHERE login= %s",
2061 if ($rec =
$ilDB->fetchAssoc($set)) {
2062 if ($rec[
"active"]) {
2072 return (
int) self::_lookupId($a_login);
2082 $ilDB = $DIC->database();
2085 "SELECT usr_id FROM usr_data " .
2086 "WHERE email = %s and active = 1",
2091 while ($row =
$ilDB->fetchObject(
$res)) {
2092 $ids[] = (
int) $row->usr_id;
2106 $ilDB = $DIC->database();
2109 "SELECT login FROM usr_data " .
2110 "WHERE email = %s and active = 1",
2115 while ($row =
$ilDB->fetchObject(
$res)) {
2116 $ids[] = $row->login;
2124 $login = self::_lookupLogin($a_userid);
2125 return $login ?: null;
2131 public static function getAllUserLogins(): array
2138 $ilDB = $DIC[
'ilDB'];
2145 while ($row =
$ilDB->fetchAssoc(
$res)) {
2146 $logins[] = $row[
'login'];
2160 $ilDB = $DIC[
'ilDB'];
2161 $res =
$ilDB->query(
"SELECT * FROM usr_data WHERE " .
2162 $ilDB->in(
"usr_id", $a_user_ids,
false,
"integer"));
2164 while ($row =
$ilDB->fetchAssoc(
$res)) {
2165 $user_data[$row[
'usr_id']] = $row;
2176 ?array $a_fields = null,
2181 $ilDB = $DIC[
'ilDB'];
2185 if ($a_fields !== null and is_array($a_fields)) {
2186 if (count($a_fields) == 0) {
2189 if (($usr_id_field = array_search(
"usr_id", $a_fields)) !==
false) {
2190 unset($a_fields[$usr_id_field]);
2193 $select = implode(
",", $a_fields) .
",usr_data.usr_id";
2195 if (in_array(
'online_time', $a_fields)) {
2196 $select .=
",ut_online.online_time ";
2200 $q =
"SELECT " . $select .
" FROM usr_data ";
2204 if (in_array(
'online_time', $a_fields)) {
2205 $q .=
"LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2211 $q .=
"WHERE active = " .
$ilDB->quote($active,
"integer");
2214 $q .=
"WHERE time_limit_unlimited= " .
$ilDB->quote(0,
"integer");
2217 $qtemp =
$q .
", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND " .
2218 $ilDB->like(
"object_data.title",
"text",
"%crs%") .
" AND usr_data.usr_id = rbac_ua.usr_id";
2221 while ($row =
$ilDB->fetchAssoc(
$r)) {
2222 $course_users[] = $row[
"usr_id"];
2224 if (count($course_users)) {
2225 $q .=
" WHERE " .
$ilDB->in(
"usr_data.usr_id", $course_users,
true,
"integer") .
" ";
2232 $date = date(
"Y-m-d H:i:s", mktime(0, 0, 0, $session_data[
"m"], $session_data[
"d"], $session_data[
"y"]));
2233 $q .=
" AND last_login < " .
$ilDB->quote($date,
"timestamp");
2238 $q .=
" LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id " .
2239 "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference " .
2240 "WHERE ref_id = " .
$ilDB->quote(
$ref_id,
"integer") .
") ";
2246 $rbacreview = $DIC[
'rbacreview'];
2249 $local_roles = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
2250 if (is_array($local_roles) && count($local_roles)) {
2251 $q .=
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
2252 $ilDB->in(
"rbac_ua.rol_id", $local_roles,
false,
"integer") .
" ";
2259 $q .=
" LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
2260 $ilDB->quote($rol_id,
"integer");
2266 while ($row =
$ilDB->fetchAssoc(
$r)) {
2267 $result_arr[] = $row;
2280 $ilDB = $DIC[
'ilDB'];
2282 $q =
"SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 " .
2283 " WHERE up1.keyword= " .
$ilDB->quote(
"style",
"text") .
2284 " AND up1.value= " .
$ilDB->quote($a_style,
"text") .
2285 " AND up2.keyword= " .
$ilDB->quote(
"skin",
"text") .
2286 " AND up2.value= " .
$ilDB->quote($a_skin,
"text") .
2287 " AND up1.usr_id = up2.usr_id ";
2291 $cnt_rec =
$ilDB->fetchAssoc($cnt_set);
2293 return (
int) $cnt_rec[
"cnt"];
2303 $ilDB = $DIC[
'ilDB'];
2305 $q =
"SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 " .
2306 " WHERE up1.keyword = " .
$ilDB->quote(
"style",
"text") .
2307 " AND up2.keyword = " .
$ilDB->quote(
"skin",
"text") .
2308 " AND up1.usr_id = up2.usr_id";
2313 while ($sty_rec =
$ilDB->fetchAssoc($sty_set)) {
2314 $styles[] = $sty_rec[
"skin"] .
":" . $sty_rec[
"style"];
2321 string $a_from_skin,
2322 string $a_from_style,
2328 $ilDB = $DIC[
'ilDB'];
2330 $q =
"SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 " .
2331 " WHERE up1.keyword= " .
$ilDB->quote(
"style",
"text") .
2332 " AND up1.value= " .
$ilDB->quote($a_from_style,
"text") .
2333 " AND up2.keyword= " .
$ilDB->quote(
"skin",
"text") .
2334 " AND up2.value= " .
$ilDB->quote($a_from_skin,
"text") .
2335 " AND up1.usr_id = up2.usr_id ";
2339 while ($usr_rec =
$ilDB->fetchAssoc($usr_set)) {
2340 self::_writePref($usr_rec[
"usr_id"],
"skin", $a_to_skin);
2341 self::_writePref($usr_rec[
"usr_id"],
"style", $a_to_style);
2363 string $a_time =
"",
2368 $ilDB = $DIC[
'ilDB'];
2370 if ($a_time ===
"") {
2371 $a_time = date(
"Y-m-d H:i:s");
2374 $item_set =
$ilDB->queryF(
2375 "SELECT * FROM personal_clipboard WHERE " .
2376 "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
2377 [
"integer",
"integer",
"text",
"integer"],
2378 [0, $a_item_id, $a_type, $this->
getId()]
2382 if (!$item_set->fetchRow()) {
2384 "INSERT INTO personal_clipboard " .
2385 "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES " .
2386 " (%s,%s,%s,%s,%s,%s,%s)",
2387 [
"integer",
"text",
"integer",
"text",
"integer",
"timestamp",
"integer"],
2388 [$a_item_id, $a_type, $this->
getId(), $a_title, $a_parent, $a_time, $a_order_nr]
2392 "UPDATE personal_clipboard SET insert_time = %s " .
2393 "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
2394 [
"timestamp",
"integer",
"integer",
"text"],
2395 [$a_time, $this->
getId(), $a_item_id, $a_type]
2411 $a_time = date(
"Y-m-d H:i:s");
2414 $ilDB->insert(
"personal_pc_clipboard", [
2415 "user_id" => [
"integer", $this->
getId()],
2416 "content" => [
"clob", $a_content],
2417 "insert_time" => [
"timestamp", $a_time],
2418 "order_nr" => [
"integer", $a_nr]
2434 $set =
$ilDB->queryF(
"SELECT MAX(insert_time) mtime FROM personal_pc_clipboard " .
2435 " WHERE user_id = %s", [
"integer"], [$this->
getId()]);
2436 $row =
$ilDB->fetchAssoc($set);
2438 $set =
$ilDB->queryF(
2439 "SELECT * FROM personal_pc_clipboard " .
2440 " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
2441 [
"integer",
"timestamp"],
2442 [$this->
getId(), $row[
"mtime"]]
2445 while ($row =
$ilDB->fetchAssoc($set)) {
2446 $content[] = $row[
"content"];
2459 $ilDB = $DIC[
'ilDB'];
2461 $set =
$ilDB->queryF(
2462 "SELECT * FROM personal_clipboard WHERE " .
2463 "parent = %s AND type = %s AND user_id = %s",
2464 [
"integer",
"text",
"integer"],
2465 [0, $a_type, $this->
getId()]
2467 if (
$ilDB->fetchAssoc($set)) {
2479 "DELETE FROM personal_clipboard WHERE " .
2480 "type = %s AND user_id = %s",
2481 [
"text",
"integer"],
2482 [$a_type, $this->
getId()]
2490 $ilDB = $DIC[
'ilDB'];
2492 $ilDB->manipulateF(
"DELETE FROM personal_clipboard WHERE " .
2493 "user_id = %s", [
"integer"], [$this->
getId()]);
2500 string $a_type =
"",
2501 bool $a_top_nodes_only =
false 2505 $ilDB = $DIC[
'ilDB'];
2508 if ($a_top_nodes_only) {
2509 $par =
" AND parent = " .
$ilDB->quote(0,
"integer") .
" ";
2512 $type_str = ($a_type !=
"")
2513 ?
" AND type = " .
$ilDB->quote($a_type,
"text") .
" " 2515 $q =
"SELECT * FROM personal_clipboard WHERE " .
2516 "user_id = " .
$ilDB->quote($this->
getId(),
"integer") .
" " .
2518 " ORDER BY order_nr";
2521 while ($obj =
$ilDB->fetchAssoc($objs)) {
2522 if ($obj[
"type"] ==
"mob") {
2528 if ($obj[
"type"] ==
"incl") {
2534 $objects[] = [
"id" => $obj[
"item_id"],
2535 "type" => $obj[
"type"],
"title" => $obj[
"title"],
2536 "insert_time" => $obj[
"insert_time"]];
2546 string $a_insert_time
2550 $ilDB = $DIC[
'ilDB'];
2551 $ilUser = $DIC[
'ilUser'];
2553 $objs =
$ilDB->queryF(
2554 "SELECT * FROM personal_clipboard WHERE " .
2555 "user_id = %s AND parent = %s AND insert_time = %s " .
2556 " ORDER BY order_nr",
2557 [
"integer",
"integer",
"timestamp"],
2558 [$ilUser->getId(), $a_parent, $a_insert_time]
2561 while ($obj =
$ilDB->fetchAssoc($objs)) {
2562 if ($obj[
"type"] ==
"mob") {
2565 $objects[] = [
"id" => $obj[
"item_id"],
2566 "type" => $obj[
"type"],
"title" => $obj[
"title"],
"insert_time" => $obj[
"insert_time"]];
2581 $ilDB = $DIC[
'ilDB'];
2583 $q =
"SELECT DISTINCT user_id FROM personal_clipboard WHERE " .
2584 "item_id = " .
$ilDB->quote($a_id,
"integer") .
" AND " .
2585 "type = " .
$ilDB->quote($a_type,
"text");
2588 while ($user_rec =
$ilDB->fetchAssoc($user_set)) {
2589 $users[] = (
int) $user_rec[
"user_id"];
2601 $q =
"DELETE FROM personal_clipboard WHERE " .
2602 "item_id = " .
$ilDB->quote($a_item_id,
"integer") .
2603 " AND type = " .
$ilDB->quote($a_type,
"text") .
" " .
2604 " AND user_id = " .
$ilDB->quote($this->
getId(),
"integer");
2613 $ilDB = $DIC[
'ilDB'];
2615 $query =
"SELECT obj_id FROM object_data WHERE import_id = " .
2616 $ilDB->quote($i2_id,
"text");
2620 while ($row =
$ilDB->fetchObject(
$res)) {
2621 $id = (
int) $row->obj_id;
2632 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
2637 return self::lookupOrgUnitsRepresentation($this->
getId());
2642 $this->auth_mode = $a_str;
2655 $this->ext_account = $a_str;
2670 string $a_auth_mode,
2671 bool $a_read_auth_default =
false 2675 $ilDB = $DIC[
'ilDB'];
2678 $q =
"SELECT login,usr_id,ext_account,auth_mode FROM usr_data " .
2679 "WHERE auth_mode = %s";
2681 $values[] = $a_auth_mode;
2683 $q .=
" OR auth_mode = %s ";
2685 $values[] =
'default';
2690 while ($row =
$ilDB->fetchObject(
$res)) {
2691 if ($row->auth_mode ==
'default') {
2692 $accounts[$row->usr_id] = $row->login;
2694 $accounts[$row->usr_id] = $row->ext_account;
2706 $ilDB = $DIC[
'ilDB'];
2709 $q =
"UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE " .
2710 $ilDB->in(
"usr_id", $a_usr_ids,
false,
"integer");
2713 $usrId_IN_usrIds =
$ilDB->in(
"usr_id", $a_usr_ids,
false,
"integer");
2715 $q =
"UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
2720 SET inactivation_date = %s 2721 WHERE inactivation_date IS NULL 2722 AND $usrId_IN_usrIds 2730 return (
string) self::_lookup($a_usr_id,
"auth_mode");
2740 bool $tryFallback =
true 2747 "SELECT * FROM usr_data WHERE " .
2748 " ext_account = %s AND auth_mode = %s",
2750 [$a_account, $a_auth]
2753 return $usr[
"login"];
2756 if (!$tryFallback) {
2762 "SELECT login FROM usr_data " .
2763 "WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = '') ",
2765 [$a_account, $a_auth]
2768 return $usr[
'login'];
2774 "SELECT login FROM usr_data WHERE " .
2775 " ext_account = %s AND auth_mode = %s",
2777 [$a_account,
"default"]
2780 return $usr[
"login"];
2784 "SELECT login FROM usr_data " .
2785 "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
2787 [$a_account,
"default"]
2790 return $usr[
"login"];
2803 $ilDB = $DIC[
'ilDB'];
2805 $r =
$ilDB->query(
"SELECT count(*) AS cnt, auth_mode FROM usr_data " .
2806 "GROUP BY auth_mode");
2808 while ($cnt =
$ilDB->fetchAssoc(
$r)) {
2809 $cnt_arr[$cnt[
"auth_mode"]] = (
int) $cnt[
"cnt"];
2819 $ilDB = $DIC[
'ilDB'];
2824 $q =
"SELECT * FROM usr_data WHERE " .
2825 " email = %s AND (auth_mode = %s ";
2826 $types = [
"text",
"text"];
2827 $values = [$a_email,
"local"];
2830 $q .=
" OR auth_mode = %s";
2832 $values[] =
"default";
2838 $usr_set =
$ilDB->queryF(
$q, $types, $values);
2839 while ($usr_rec =
$ilDB->fetchAssoc($usr_set)) {
2840 $users[$usr_rec[
"usr_id"]] = $usr_rec[
"login"];
2859 $stream = Streams::ofResource(fopen($tmp_file,
'rb'));
2864 $DIC->resourceStorage()->manage()->replaceWithStream(
2871 $rid = $DIC->resourceStorage()->manage()->stream(
2888 string $a_size =
"small",
2889 bool $a_force_pic =
false 2891 if (isset(self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic])) {
2892 return self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic];
2895 self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic] = self::_getPersonalPicturePath($this->
getId(), $a_size, $a_force_pic);
2897 return self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic];
2907 return self::_getAvatar($this->
getId());
2913 $define->setSize(
'xsmall');
2914 return $define->getAvatar();
2923 string $a_size =
"small",
2924 bool $a_force_pic =
false,
2925 bool $a_prevent_no_photo_image =
false,
2926 bool $html_export =
false 2929 $define->setForcePicture($a_force_pic);
2930 $define->setSize($a_size);
2931 return $define->getLegacyPictureURL();
2938 $a_dir = trim(str_replace(
"..",
"", $a_dir));
2939 if ($a_dir ==
"" || !is_dir($a_dir)) {
2944 $irss = $DIC->resourceStorage();
2949 $stream = $irss->
consume()->stream($rid)->getStream();
2950 $target = $a_dir .
"/usr_" . $a_user_id .
".jpg";
2951 fwrite(fopen($target,
'wb'), (
string) $stream);
2958 $image_dir = $webspace_dir .
"/usr_images";
2960 "upload_" . $a_user_id .
"pic",
2961 "usr_" . $a_user_id .
"." .
"jpg",
2962 "usr_" . $a_user_id .
"_small.jpg",
2963 "usr_" . $a_user_id .
"_xsmall.jpg",
2964 "usr_" . $a_user_id .
"_xxsmall.jpg",
2965 "upload_" . $a_user_id];
2966 foreach ($images as $image) {
2967 if (is_file($image_dir .
"/" . $image)) {
2968 copy($image_dir .
"/" . $image, $a_dir .
"/" . $image);
2975 bool $a_do_update =
true 2978 $rid = $this->irss->manage()->find($this->
getAvatarRid());
2985 $this->
setPref(
"profile_image",
"");
2993 foreach ($a_data as $field =>
$data) {
2994 $this->user_defined_data[
'f_' . $field] =
$data;
3000 return $this->user_defined_data ?: [];
3006 foreach ($this->user_defined_data as $field => $value) {
3007 if ($field !==
'usr_id' && $value !== null) {
3008 $udata->set($field, $value);
3017 $this->user_defined_data = $udata->getAll();
3029 public function getProfileAsString(
ilLanguage $language):
string 3033 $rbacreview = $DIC[
'rbacreview'];
3038 $body = ($language->
txt(
"login") .
": " . $this->
getLogin() .
"\n");
3041 $body .= ($language->
txt(
"title") .
": " . $this->
getUTitle() .
"\n");
3044 $body .= ($language->
txt(
"gender") .
": " . $language->
txt(
'gender_' . strtolower($this->
getGender())) .
"\n");
3047 $body .= ($language->
txt(
"firstname") .
": " . $this->
getFirstname() .
"\n");
3050 $body .= ($language->
txt(
"lastname") .
": " . $this->
getLastname() .
"\n");
3053 $body .= ($language->
txt(
"institution") .
": " . $this->
getInstitution() .
"\n");
3056 $body .= ($language->
txt(
"department") .
": " . $this->
getDepartment() .
"\n");
3059 $body .= ($language->
txt(
"street") .
": " . $this->
getStreet() .
"\n");
3061 if (strlen($this->
getCity())) {
3062 $body .= ($language->
txt(
"city") .
": " . $this->
getCity() .
"\n");
3065 $body .= ($language->
txt(
"zipcode") .
": " . $this->
getZipcode() .
"\n");
3068 $body .= ($language->
txt(
"country") .
": " . $this->
getCountry() .
"\n");
3074 $body .= ($language->
txt(
"phone_office") .
": " . $this->
getPhoneOffice() .
"\n");
3077 $body .= ($language->
txt(
"phone_home") .
": " . $this->
getPhoneHome() .
"\n");
3080 $body .= ($language->
txt(
"phone_mobile") .
": " . $this->
getPhoneMobile() .
"\n");
3082 if (strlen($this->
getFax())) {
3083 $body .= ($language->
txt(
"fax") .
": " . $this->
getFax() .
"\n");
3086 $body .= ($language->
txt(
"email") .
": " . $this->
getEmail() .
"\n");
3090 $body .= ($language->
txt(
"second_email") .
": " . $this->
getSecondEmail() .
"\n");
3093 $body .= ($language->
txt(
"hobby") .
": " . $this->
getHobby() .
"\n");
3096 $body .= ($language->
txt(
"referral_comment") .
": " . $this->
getComment() .
"\n");
3107 $body .= ($language->
txt(
"create_date") .
": " . $date .
"\n");
3111 foreach ($rbacreview->getGlobalRoles() as $role) {
3112 if ($rbacreview->isAssigned($this->getId(), $role)) {
3117 $body .= ($language->
txt(
'reg_role_info') .
': ' . implode(
',', $gr) .
"\n");
3122 $body .= ($language->
txt(
'time_limit') .
": " . $language->
txt(
'crs_unlimited') .
"\n");
3135 $body .= $language->
txt(
'time_limit') .
': ' .
3136 $language->
txt(
'from') .
" " .
3147 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
3148 $data = $user_defined_data[
"f_" . $field_id] ??
'';
3152 preg_replace(
'/<br(\s*)?\/?>/i',
"\n",
$data)
3156 $body .= $definition[
'field_name'] .
': ' .
$data .
"\n";
3169 $ilDB = $DIC[
'ilDB'];
3171 if ($a_user_id > 0) {
3172 $set =
$ilDB->queryF(
3173 'SELECT feed_hash from usr_data WHERE usr_id = %s',
3177 if ($rec =
$ilDB->fetchAssoc($set)) {
3178 $feed_hash = $rec[
'feed_hash'];
3179 if (is_string($feed_hash) && strlen($feed_hash) === 32) {
3184 $hash = md5(random_int(1, 9999999) + str_replace(
' ',
'', microtime()));
3186 'UPDATE usr_data SET feed_hash = %s' .
3187 ' WHERE usr_id = %s',
3206 if ($a_user_id > 0) {
3207 return self::_lookupPref($a_user_id,
"priv_feed_pass");
3223 ($a_password ==
"") ?
"" : md5($a_password)
3237 $ilDB = $DIC[
'ilDB'];
3239 $q =
"SELECT DISTINCT login, usr_id FROM usr_data " .
3242 $values[] = $a_login;
3244 if ($a_user_id != 0) {
3245 $q .=
" AND usr_id != %s ";
3246 $types[] =
"integer";
3247 $values[] = $a_user_id;
3250 $r =
$ilDB->queryF(
$q, $types, $values);
3252 if ($row =
$ilDB->fetchAssoc(
$r)) {
3253 return (
int) $row[
'usr_id'];
3262 string $a_external_account,
3267 $ilDB = $DIC[
'ilDB'];
3270 "SELECT * FROM usr_data " .
3271 "WHERE ext_account = %s AND auth_mode = %s",
3273 [$a_external_account, $a_auth_mode]
3288 $ilDB = $DIC[
'ilDB'];
3289 $rbacreview = $DIC[
'rbacreview'];
3290 $ids = $rbacreview->assignedUsers($role_id);
3292 if (count($ids) == 0) {
3296 $query =
"SELECT usr_data.*, usr_pref.value AS language 3298 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3299 WHERE " .
$ilDB->in(
"usr_data.usr_id", $ids,
false,
"integer");
3300 $values[] =
"language";
3304 if (is_numeric($active) && $active > -1) {
3305 $query .=
" AND usr_data.active = %s";
3307 $types[] =
"integer";
3310 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
3312 $r =
$ilDB->queryF($query, $types, $values);
3314 while ($row =
$ilDB->fetchAssoc(
$r)) {
3331 $ilDB = $DIC[
'ilDB'];
3332 $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";
3334 $values[] =
"language";
3336 if (is_numeric($active) && $active > -1) {
3337 $query .=
" AND usr_data.active = %s";
3339 $types[] =
"integer";
3343 $query .=
" AND usr_data.time_limit_owner = %s";
3345 $types[] =
"integer";
3348 $query .=
" AND usr_data.usr_id != %s ";
3350 $types[] =
"integer";
3352 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
3354 $result =
$ilDB->queryF($query, $types, $values);
3356 while ($row =
$ilDB->fetchAssoc($result)) {
3373 return self::_getUsersForIds($a_mem_ids, $active);
3385 int $timelimitowner = -1
3389 $ilDB = $DIC[
'ilDB'];
3391 $query =
"SELECT usr_data.*, usr_pref.value AS language 3393 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3394 WHERE " .
$ilDB->in(
"usr_data.usr_id", $a_mem_ids,
false,
"integer") .
" 3395 AND usr_data.usr_id != %s";
3396 $values[] =
"language";
3399 $types[] =
"integer";
3401 if (is_numeric($active) && $active > -1) {
3402 $query .=
" AND active = %s";
3404 $types[] =
"integer";
3407 if ($timelimitowner !=
USER_FOLDER_ID && $timelimitowner != -1) {
3408 $query .=
" AND usr_data.time_limit_owner = %s";
3409 $values[] = $timelimitowner;
3410 $types[] =
"integer";
3413 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
3415 $result =
$ilDB->queryF($query, $types, $values);
3417 while ($row =
$ilDB->fetchAssoc($result)) {
3434 $ilDB = $DIC[
'ilDB'];
3437 if (is_array($a_internalids)) {
3438 foreach ($a_internalids as $internalid) {
3439 if (is_numeric($internalid)) {
3440 $ids[] = $internalid;
3443 if (is_numeric($parsedid) && $parsedid > 0) {
3449 if (count($ids) == 0) {
3453 $query =
"SELECT usr_data.*, usr_pref.value AS language 3456 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3457 WHERE " .
$ilDB->in(
"usr_data.usr_id", $ids,
false,
"integer");
3458 $values[] =
"language";
3461 $query .=
" ORDER BY usr_data.lastname, usr_data.firstname ";
3464 $result =
$ilDB->queryF($query, $types, $values);
3465 while ($row =
$ilDB->fetchAssoc($result)) {
3481 $ilDB = $DIC[
'ilDB'];
3486 "SELECT * FROM usr_pref WHERE usr_id = %s",
3491 while ($row =
$ilDB->fetchAssoc(
$r)) {
3492 $prefs[$row[
"keyword"]] = $row[
"value"];
3509 $ilDB = $DIC[
'ilDB'];
3512 $set =
$ilDB->query(
3513 "SELECT usr_id FROM usr_pref " .
3514 " WHERE keyword = " .
$ilDB->quote($a_keyword,
"text") .
3515 " AND " .
$ilDB->in(
"usr_id", $a_user_ids,
false,
"integer") .
3516 " AND value = " .
$ilDB->quote($a_val,
"text")
3518 while ($rec =
$ilDB->fetchAssoc($set)) {
3519 $users[] = $rec[
"usr_id"];
3529 $ilDB = $DIC[
'ilDB'];
3531 $query =
"SELECT login_attempts FROM usr_data WHERE usr_id = %s";
3532 $result =
$ilDB->queryF($query, [
'integer'], [$a_usr_id]);
3533 $record =
$ilDB->fetchAssoc($result);
3534 return (
int) ($record[
'login_attempts'] ?? 0);
3542 $ilDB = $DIC[
'ilDB'];
3544 $query =
"UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
3545 $affected =
$ilDB->manipulateF($query, [
'integer'], [$a_usr_id]);
3559 $ilDB = $DIC[
'ilDB'];
3561 $query =
"UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
3562 $affected =
$ilDB->manipulateF($query, [
'timestamp',
'integer'], [
ilUtil::now(), $a_usr_id]);
3576 return in_array($this->
getPref(
"public_profile"), [
"y",
"g"]);
3597 $ilDB = $DIC[
'ilDB'];
3602 'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3603 [
'integer',
'text',
'integer'],
3610 INSERT INTO loginname_history 3611 (usr_id, login, history_date) 3612 VALUES (%s, %s, %s)',
3613 [
'integer',
'text',
'integer'],
3625 bool $a_no_anonymous =
false 3629 $ilDB = $DIC->database();
3634 $atime = $pd_set->get(
'user_activity_time') * 60;
3639 if ($a_user_id === 0) {
3640 $where[] =
'user_id > 0';
3642 $where[] =
'user_id = ' .
$ilDB->quote($a_user_id,
'integer');
3645 if ($a_no_anonymous) {
3653 $where[] =
'expires > ' .
$ilDB->quote($ctime,
'integer');
3654 $where[] =
'(p.value IS NULL OR NOT p.value = ' .
$ilDB->quote(
'y',
'text') .
')';
3656 $where =
'WHERE ' . implode(
' AND ', $where);
3660 SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date 3662 LEFT JOIN usr_data u 3663 ON user_id = u.usr_id 3664 LEFT JOIN usr_pref p 3665 ON (p.usr_id = u.usr_id AND p.keyword = %s) 3667 GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date 3668 ORDER BY lastname, firstname 3671 [
'hide_own_online_status']
3678 if ($atime <= 0 ||
$user[
'ctime'] + $atime > $ctime) {
3683 $log->
debug(
"Found users: " . count($users));
3685 $hide_users = $DIC[
'legalDocuments']->usersWithHiddenOnlineStatus(array_map(intval(...), array_column($users,
'user_id')));
3686 $users = array_filter(
3688 fn(
$user) => !in_array((
int)
$user[
'user_id'], $hide_users,
true)
3702 $ilDB = $DIC[
'ilDB'];
3707 $hashcode = substr(md5(uniqid(mt_rand(),
true)), 0, 16);
3711 SELECT COUNT(usr_id) cnt FROM usr_data 3712 WHERE reg_hash = %s',
3717 if ($row->cnt > 0) {
3732 [
'text',
'integer'],
3733 [$hashcode, $a_usr_id]
3752 $ilDB = $DIC[
'ilDB'];
3756 SELECT usr_id, create_date FROM usr_data 3757 WHERE reg_hash = %s',
3761 while ($row =
$ilDB->fetchAssoc(
$res)) {
3764 if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3765 time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row[
'create_date'])) {
3767 'reg_confirmation_hash_life_time_expired',
3768 (
int) $row[
'usr_id']
3777 [
'text',
'integer'],
3778 [
'', (
int) $row[
'usr_id']]
3781 return (
int) $row[
'usr_id'];
3789 if ($a_birthday && strlen($a_birthday)) {
3793 $this->birthday = null;
3813 if ($periodInDays < 1) {
3817 $date = date(
'Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3819 $query =
"SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s";
3823 $types = [
'timestamp'];
3826 $res = $DIC->database()->queryF($query, $types, $values);
3827 while ($row = $DIC->database()->fetchAssoc(
$res)) {
3828 $ids[] = (
int) $row[
'usr_id'];
3840 int $thresholdInDays
3844 $date = date(
'Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3846 $query =
"SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s";
3850 $types = [
'timestamp'];
3853 $res = $DIC->database()->queryF($query, $types, $values);
3854 while ($row = $DIC->database()->fetchAssoc(
$res)) {
3855 $ids[] = (
int) $row[
'usr_id'];
3871 $field =
'inactivation_date';
3880 $ilDB = $DIC[
'ilDB'];
3882 $date = date(
'Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3884 $query =
"SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3886 $res =
$ilDB->queryF($query, [
'timestamp',
'integer'], [$date, 0]);
3890 $ids[] = (
int) $row->usr_id;
3900 $query =
"UPDATE object_data SET owner = 0 " .
3901 "WHERE owner = " .
$ilDB->quote($this->
getId(),
'integer');
3902 $ilDB->query($query);
3910 ?array $user_ids = null
3914 $ilDB = $DIC->database();
3916 $q =
"SELECT DISTINCT " .
$ilDB->upper(
$ilDB->substr(
"lastname", 1, 1)) .
" let" .
3919 ($user_ids !== null ?
" AND " .
$ilDB->in(
'usr_id', $user_ids,
false,
"integer") :
"") .
3924 while ($let_rec =
$ilDB->fetchAssoc($let_set)) {
3925 $let[$let_rec[
"let"]] = $let_rec[
"let"];
3931 array $a_usr_ids = []
3935 $ilDB = $DIC[
'ilDB'];
3937 $query =
'SELECT count(*) num FROM object_data od ' .
3938 'JOIN usr_data ud ON obj_id = usr_id ' .
3939 'WHERE ' .
$ilDB->in(
'obj_id', $a_usr_ids,
false,
'integer') .
' ';
3942 return $num_rows == count($a_usr_ids);
3964 if (!is_dir($dir)) {
3968 if (is_int(strpos($entry[
"entry"],
".zip"))) {
3969 return $entry[
"entry"];
3980 if (is_file($file)) {
3987 bool $a_profile_data,
3994 $imp->addSkipImporter(
"Services/Bookmarks");
3995 if (!$a_profile_data) {
3996 $imp->addSkipEntity(
"Services/User",
"usr_profile");
3999 $imp->addSkipEntity(
"Services/User",
"usr_setting");
4002 $imp->addSkipEntity(
"Services/Notes",
"user_notes");
4005 $imp->addSkipEntity(
"Services/Calendar",
"calendar");
4008 $a_file[
"tmp_name"],
4027 return self::_isAnonymous($this->
getId());
4047 return (
bool) $this->
getPref(
"delete_flag");
4052 $this->is_self_registered = $status;
4070 $this->interests_general = $value ?? [];
4094 $this->interests_help_offered = $value ?? [];
4118 $this->interests_help_looking = $value ?? [];
4144 if (count($a_attr) > 0) {
4145 return implode(
", ", $a_attr);
4154 $ilDB = $DIC[
'ilDB'];
4156 if (!$this->
getId()) {
4160 $set =
$ilDB->query(
"SELECT field_id,value" .
4161 " FROM usr_data_multi" .
4162 " WHERE usr_id = " .
$ilDB->quote($this->getId(),
"integer") .
4164 while ($row =
$ilDB->fetchAssoc($set)) {
4165 $values[$row[
"field_id"]][] = $row[
"value"];
4168 if (isset($values[
"interests_general"])) {
4173 if (isset($values[
"interests_help_offered"])) {
4178 if (isset($values[
"interests_help_looking"])) {
4189 $ilDB = $DIC[
'ilDB'];
4191 if (!$this->
getId()) {
4205 foreach ($map as
$id => $values) {
4206 if (is_array($values) && count($values)) {
4207 foreach ($values as $value) {
4208 $value = trim($value);
4210 $uniq_id =
$ilDB->nextId(
'usr_data_multi');
4212 $ilDB->manipulate(
"INSERT usr_data_multi" .
4213 " (id,usr_id,field_id,value) VALUES" .
4214 " (" .
$ilDB->quote($uniq_id,
"integer") .
4215 "," .
$ilDB->quote($this->
getId(),
"integer") .
4217 "," .
$ilDB->quote($value,
"text") .
4229 $ilDB = $DIC[
'ilDB'];
4231 if (!$this->
getId()) {
4235 $ilDB->manipulate(
"DELETE FROM usr_data_multi" .
4236 " WHERE usr_id = " .
$ilDB->quote($this->getId(),
"integer"));
4241 ?
int $a_user_id = null,
4242 string $a_field_id = null
4246 $ilDB = $DIC[
'ilDB'];
4250 $sql =
"SELECT DISTINCT(value)" .
4251 " FROM usr_data_multi" .
4252 " WHERE " .
$ilDB->like(
"value",
"text",
"%" . $a_term .
"%");
4254 $sql .=
" AND field_id = " .
$ilDB->quote($a_field_id,
"text");
4257 $sql .=
" AND usr_id <> " .
$ilDB->quote($a_user_id,
"integer");
4259 $sql .=
" ORDER BY value";
4260 $set =
$ilDB->query($sql);
4261 while ($row =
$ilDB->fetchAssoc($set)) {
4262 $res[] = $row[
"value"];
4281 $ilDB = $DIC->database();
4283 $set =
$ilDB->query(
4284 "SELECT * FROM usr_pref " .
4285 " WHERE keyword = " .
$ilDB->quote(
"public_profile",
"text") .
4286 " AND " .
$ilDB->in(
"usr_id", $a_user_ids,
false,
"integer")
4294 while ($rec =
$ilDB->fetchAssoc($set)) {
4295 if ($rec[
"value"] ==
"g") {
4296 $r[
"global"][] = $rec[
"usr_id"];
4297 $r[
"public"][] = $rec[
"usr_id"];
4299 if ($rec[
"value"] ==
"y") {
4300 $r[
"local"][] = $rec[
"usr_id"];
4301 $r[
"public"][] = $rec[
"usr_id"];
4304 foreach ($a_user_ids as
$id) {
4305 if (!in_array($id,
$r[
"public"])) {
4306 $r[
"not_public"][] =
$id;
getCurrentLanguage()
returns the current language (may differ from user's pref setting!)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static hasActiveSession(int $a_user_id, string $a_session_id)
setUTitle(string $a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
setProfileIncomplete(bool $a_prof_inc)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static get(string $a_var)
setTimeLimitUnlimited(bool $a_unlimited)
static _setFeedPass(int $a_user_id, string $a_password)
Set news feed password for user.
setClientIP(string $a_str)
setAvatarRid(?string $avatar_rid)
getStoredActive(int $a_id)
get user active state
setLastLogin(string $a_str)
static _getUsersForRole(int $role_id, int $active=-1)
return array of complete users which belong to a specific role
resetPassword(string $raw, string $raw_retype)
Resets the user password.
refreshLogin()
updates the login data of a "user"
static _getLoginAttempts(int $a_usr_id)
static _destroyByUserId(int $a_user_id)
Destroy session.
static copyProfilePicturesToDirectory(int $a_user_id, string $a_dir)
static _deleteUser(int $a_usr_id)
static _lookupLanguage(int $a_usr_id)
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
static getLogger(string $a_component_id)
Get component logger.
static _getAllUserData(?array $a_fields=null, int $active=-1)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAuthMode(?string $a_auth_mode)
writePref(string $a_keyword, string $a_value)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setAgreeDate(?string $a_str)
array $interests_help_looking
static styleExists(string $style_id)
static getUserIdsByInactivityPeriod(int $periodInDays)
Get ids of all users that have been inactive for at least the given period.
static lookupMatriculation(int $a_usr_id)
static getFirstLettersOfLastnames(?array $user_ids=null)
Get first letters of all lastnames.
__construct(int $a_user_id=0, bool $a_call_by_reference=false)
static getProfileStatusOfUsers(array $a_user_ids)
Get profile status.
static _verifyRegistrationHash(string $a_hash)
Verifies a registration hash.
assignData(array $a_data)
loads a record "user" from array
fetchAssoc(ilDBStatement $statement)
static _externalAccountExists(string $a_external_account, string $a_auth_mode)
Check if an external account name already exists.
setMatriculation(string $a_str)
static _lookupFullname(int $a_user_id)
isPasswordChangeDemanded()
getGeneralInterestsAsText()
Get general interests as plain text.
getDefaultLanguage()
Return default language.
getOrgUnitsRepresentation()
Class for user related exception handling in ILIAS.
setPhoneOffice(string $a_str)
addToPCClipboard(string $a_content, string $a_time, int $a_nr)
Add a page content item to PC clipboard (should go to another class)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _moveUsersToStyle(string $a_from_skin, string $a_from_style, string $a_to_skin, string $a_to_style)
static _getPreferences(int $user_id)
get preferences for user
removeObjectFromClipboard(int $a_item_id, string $a_type)
getPasswordPolicyResetStatus()
static _removeTrackingDataForUser(int $user_id)
to be called from IlObjUser
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
updateLogin(string $a_login)
update login name
setSelectedCountry(string $a_val)
Set selected country (selection drop down)
deletePref(string $a_keyword)
static _lookupLastLogin(int $a_user_id)
array $interests_help_offered
string $time_limit_message
static array $personal_image_cache
setFullname()
builds a string with title + firstname + lastname method is used to build fullname in member variable...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _writeAuthMode(int $a_usr_id, string $a_auth_mode)
static _lookupName(int $a_user_id)
lookup user name
static resetToDefaults()
reset to defaults
static _lookupId($a_user_str)
static lookupTitle(int $a_page_id)
static _deleteSettingsOfUser(int $a_user)
getFullname(int $a_max_strlen=0)
removeUserPicture(bool $a_do_update=true)
static getUserIdsByEmail(string $a_email)
loadLanguageModule(string $a_module)
Load language module.
static _lookupPref(int $a_usr_id, string $a_keyword)
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user
static getUserSubsetByPreferenceValue(array $a_user_ids, string $a_keyword, string $a_val)
For a given set of user IDs return a subset that has a given user preference set. ...
getCreateDate()
Get create date in YYYY-MM-DD HH-MM-SS format.
static _lookupExternalAccount(int $a_user_id)
static _getUsersForGroup(array $a_mem_ids, int $active=-1)
return user data for group members
static _deleteByUser(int $a_usr_id)
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
static setLanguage(ilLanguage $a_lng)
static _lookupAuthMode(int $a_usr_id)
setPasswordSalt(?string $password_salt)
static lookupOrgUnitsRepresentation(int $a_usr_id)
lookup org unit representation
static _lookupGender(int $a_user_id)
setTimeLimitUntil(?int $a_until)
static _getAuthModeName($a_auth_key)
static _uploadPersonalPicture(string $tmp_file, int $obj_id)
Create a personal picture image file from a temporary image file.
setLoginAttempts(int $a_login_attempts)
static now()
Return current timestamp in Y-m-d H:i:s format.
static _deleteAllPref(int $a_user_id)
Deletes a userpref value of the user from the database.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
setInstitution(string $a_str)
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
deleteUserDefinedFieldEntries()
getAuthMode(bool $a_auth_key=false)
static _deleteUser(int $a_usr_id)
getOfferingHelpAsText()
Get help offering as plain text.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLatitude(?string $a_latitude)
setComment(string $a_str)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
addObjectToClipboard(int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time="", int $a_order_nr=0)
add an item to user's personal clipboard
updateUserDefinedFields()
int $last_password_change_ts
static _getAvatar(int $a_usr_id)
setExternalAccount(string $a_str)
static _getNumberOfUsersForStyle(string $a_skin, string $a_style)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
setPasswordPolicyResetStatus(bool $status)
static findInterests(string $a_term, ?int $a_user_id=null, string $a_field_id=null)
setBirthday(?string $a_birthday)
static _writeExternalAccount(int $a_usr_id, string $a_ext_id)
static _getInstance()
Get singleton instance of this class.
bool $time_limit_unlimited
static _getExternalAccountsByAuthMode(string $a_auth_mode, bool $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
static getUserIdByLogin(string $a_login)
writeAccepted()
write accept date of user agreement
static _getLastHistoryDataByUserId(int $a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
ilAppEventHandler $app_event_handler
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
resetLastPasswordChange()
static userExists(array $a_usr_ids=[])
static _lookupClientIP(int $a_user_id)
setDepartment(string $a_str)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
static deleteEntriesOfUser(int $a_user_id)
setOfferingHelp(?array $value=null)
getLastPasswordChangeTS()
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
clipboardDeleteObjectsOfType(string $a_type)
static getUserLoginsByEmail(string $a_email)
getLoginByUserId(int $a_userid)
This describes how a letter or a picture avatar could be modified during construction of UI...
static _getFeedPass(int $a_user_id)
Lookup news feed password for user.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _generateRegistrationHash(int $a_usr_id)
Generates a unique hashcode for activating a user profile after registration.
static styleExistsForSkinId(string $skin_id, string $style_id)
setApproveDate(?string $a_str)
set date the user account was activated null indicates that the user has not yet been activated ...
Mail Box class Base class for creating and handling mail boxes.
static _setUserInactive(int $a_usr_id)
setPhoneHome(string $a_str)
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
static _toggleActiveStatusOfUsers(array $a_usr_ids, bool $a_status)
static _loginExists(string $a_login, int $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 removeForUser(int $user_id)
Remove all notifications for given user.
getPref(string $a_keyword)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
setInactivationDate(?string $inactivation_date)
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
static _getUsersOnline(int $a_user_id=0, bool $a_no_anonymous=false)
reads all active sessions from db and returns users that are online OR returns only one active user i...
updateOwner()
update owner of object in db
static _deletePref(int $a_user_id, string $a_keyword)
static _getUserData(array $a_internalids)
return user data for given user ids
checkUserId()
check user id with login name
header include for all ilias files.
static _writeHistory(int $a_usr_id, string $a_login)
getLookingForHelpAsText()
Get help looking for as plain text.
setIsSelfRegistered(bool $status)
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static _lookupFields(int $a_user_id)
lookup fields (deprecated; use more specific methods instead)
bool $passwd_policy_reset
setPref(string $a_keyword, ?string $a_value)
Class ilUserAvatarResolver.
static _getUserIdsByInactivationPeriod(int $period)
get ids of all users that have been inactivated since at least the given period
setFirstLogin(string $a_str)
setCountry(string $a_str)
queryF(string $query, array $types, array $values)
getPCClipboardContent()
Add a page content item to PC clipboard (should go to another class)
static _isAnonymous(int $usr_id)
existsPref(string $a_keyword)
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
importPersonalData(array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
foreach($mandatory_scripts as $file) $timestamp
setPhoneMobile(string $a_str)
getSelectedCountry()
Get selected country (selection drop down)
static deleteByUserId(int $a_user_id)
setLastPasswordChangeTS(int $a_last_password_change_ts)
setLastname(string $a_str)
setPasswordEncodingType(?string $password_encryption_type)
getPersonalPicturePath(string $a_size="small", bool $a_force_pic=false)
static _doesLoginnameExistInHistory(string $a_login)
Checks whether the passed loginname already exists in history.
static _getUsersForClipboadObject(string $a_type, int $a_id)
get all users, that have a certain object within their clipboard
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
Class ilObjAuthSettingsGUI.
getPersonalDataExportFile()
static skinExists(string $skin_id, ?ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static _incrementLoginAttempts(int $a_usr_id)
string $last_profile_prompt
static _lookupFeedHash(int $a_user_id, bool $a_create=false)
Lookup news feed hash for user.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
setLastProfilePrompt(string $a_str)
static _getImportedUserId(string $i2_id)
static _getUsersForFolder(int $ref_id, int $active)
get users for a category or from system folder
setLanguage(string $a_str)
static _readUsersProfileData(array $a_user_ids)
static _lookup(int $a_user_id, string $a_field)
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
static toUsernameWithoutDomain(string $a_login)
Static function removes Microsoft domain name from username webdav related.
setTimeLimitOwner(int $a_owner)
updateMultiTextFields(bool $a_create=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
setSecondEmail(?string $second_email)
string $password_encoding_type
static _writePref(int $a_usr_id, string $a_keyword, string $a_value)
setLongitude(?string $a_longitude)
setLocationZoom(?int $a_locationzoom)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
DateFormatFactory $date_format_factory
setLastPasswordChangeToNow()
setZipcode(string $a_str)
ilCronDeleteInactiveUserReminderMail $cron_delete_user_reminder_mail
setTimeLimitMessage(string $a_time_limit_message)
static _lookupFirstLogin(int $a_user_id)
debug(string $message, array $context=[])
Class for user related exception handling in ILIAS.
setUserDefinedData(array $a_data)
static _lookupType(int $id, bool $reference=false)
static setUseRelativeDates(bool $a_status)
set use relative dates
setGeneralInterests(?array $value=null)
setTimeLimitFrom(?int $a_from)
getClipboardChilds(int $a_parent, string $a_insert_time)
Get children of an item.
setFirstname(string $a_str)
string $inactivation_date
static _lookupEmail(int $a_user_id)
static clear(string $a_var)
static _getInstance()
Get instance of ilSecuritySettings.
getPasswordEncodingType()
static getInstance()
Singleton method to reduce footprint (included files, created instances)
static set(string $a_var, $a_val)
Set a value.
static _getUsersForIds(array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
return user data for given user id
setAuthMode(?string $a_str)
setCurrentLanguage(string $a_val)
Set current language.
static _lookupActive(int $a_usr_id)
hasPublicProfile()
returns true if public is profile, false otherwise
static _getAllUserAssignedStyles()
setLastUpdate(string $a_str)
static getUserIdsNeverLoggedIn(int $thresholdInDays)
Get ids of all users that have never logged in.
static _removeTrackingDataForUser(int $user_id)
getClipboardObjects(string $a_type="", bool $a_top_nodes_only=false)
get all clipboard objects of user and specified type
static _getLocalAccountsForEmail(string $a_email)
clipboardHasObjectsOfType(string $a_type)
Check whether clipboard has objects of a certain type.
static _lookupLogin(int $a_user_id)
setLookingForHelp(?array $value=null)