4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
46 public function __construct($a_data, $a_id, $a_call_by_reference =
false, $a_prepare_output =
true)
50 define(
'USER_FOLDER_ID', 7);
53 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
57 $this->ctrl->saveParameter($this,
array(
'obj_id',
'letter'));
58 $this->ctrl->setParameterByClass(
"ilobjuserfoldergui",
"letter",
$_GET[
"letter"]);
59 $this->ctrl->setContext($this->
object->getId(),
'usr');
60 $lng->loadLanguageModule(
'user');
64 $this->gender =
array(
65 'n' =>
"salutation_n",
66 'm' =>
"salutation_m",
67 'f' =>
"salutation_f",
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
80 switch ($next_class) {
81 case "illearningprogressgui":
82 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
84 $this->ctrl->forwardCommand($new_gui);
87 case "ilobjectownershipmanagementgui":
88 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
90 $this->ctrl->forwardCommand($gui);
94 if ($cmd ==
"" || $cmd ==
"view") {
98 $return = $this->$cmd();
109 if (strtolower(get_class($this->
object)) ==
'ilobjuser') {
110 $this->tpl->setTitle(
'[' . $this->
object->getLogin() .
'] ' . $this->
object->getTitle());
111 $this->tpl->setDescription($this->
object->getLongDescription());
112 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_" . $this->
object->getType() .
".svg"), $this->lng->txt(
"obj_" . $this->object->getType()));
114 parent::setTitleAndDescription();
124 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
125 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
129 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
148 $this->tabs_gui->clearTargets();
150 $ilHelp->setScreenIdComponent(
"usr");
152 if (
$_GET[
"search"]) {
153 $this->tabs_gui->setBackTarget(
154 $this->lng->txt(
"search_results"),
158 $this->tabs_gui->addTarget(
160 $this->ctrl->getLinkTarget($this,
"edit"),
161 array(
"edit",
"",
"view"),
167 $this->tabs_gui->addTarget(
169 $this->ctrl->getLinkTarget($this,
"edit"),
170 array(
"edit",
"",
"view"),
175 $this->tabs_gui->addTarget(
177 $this->ctrl->getLinkTarget($this,
"roleassignment"),
178 array(
"roleassignment"),
183 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
184 if ($rbacsystem->checkAccess(
'read', $this->ref_id) and
187 $this->tabs_gui->addTarget(
189 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
191 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui')
195 $this->tabs_gui->addTarget(
197 $this->ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
199 'ilobjectownershipmanagementgui' 208 $this->back_target =
array(
"text" => $a_text,
218 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
221 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
222 if ($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id])) {
232 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
235 if ($this->
object->getType() ==
'usr') {
236 $user_defined_data = $this->
object->getUserDefinedData();
238 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
239 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
240 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
243 $this->tpl->setCurrentBlock(
"field_text");
244 $this->tpl->setVariable(
"FIELD_NAME",
'udf[' . $definition[
'field_id'] .
']');
246 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
"field_select");
251 'udf[' . $definition[
'field_id'] .
']',
252 $this->user_defined_fields->fieldValuesToSelectArray(
253 $definition[
'field_values']
258 $this->tpl->parseCurrentBlock();
260 $this->tpl->setCurrentBlock(
"user_defined");
262 if ($definition[
'required']) {
263 $name = $definition[
'field_name'] .
"<span class=\"asterisk\">*</span>";
265 $name = $definition[
'field_name'];
267 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
268 $this->tpl->parseCurrentBlock();
278 $this->tabs_gui->clearTargets();
282 $obj_list = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
284 foreach ($obj_list as $obj_data) {
286 if ($this->
object->getRefId() !=
USER_FOLDER_ID and !in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
287 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
294 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID) {
296 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
297 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
304 $this->
ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"), $this->
ilias->error_obj->MESSAGE);
307 $keys = array_keys($rol);
310 if (in_array(4,
$keys)) {
311 $this->default_role = 4;
313 if (count(
$keys) > 1 and in_array(2,
$keys)) {
323 $this->default_role = array_shift(
$keys);
325 $this->selectable_roles = $rol;
335 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) and
336 !$rbacsystem->checkAccess(
'cat_administrate_users', $this->usrf_ref_id)) {
337 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
341 $this->initForm(
"create");
342 return $tpl->setContent($this->form_gui->getHtml());
353 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
356 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) &&
357 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id)) {
358 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
362 $this->initForm(
"create");
365 $profileMaybeIncomplete =
false;
366 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
370 if ($this->form_gui->checkInput()) {
376 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
377 $userObj->setTitle($userObj->getFullname());
378 $userObj->setDescription($userObj->getEmail());
381 foreach (
$_POST as $k => $v) {
382 if (substr($k, 0, 4) ==
"udf_") {
383 $udf[substr($k, 4)] = $v;
386 $userObj->setUserDefinedData($udf);
390 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
392 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
397 $userObj->setLastPasswordChangeTS(
time());
400 $userObj->saveAsNew();
404 $userObj->setLanguage(
$_POST[
"language"]);
408 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
416 $sknst = explode(
":",
$_POST[
"skin_style"]);
418 if ($userObj->getPref(
"style") != $sknst[1] ||
419 $userObj->getPref(
"skin") != $sknst[0]) {
420 $userObj->setPref(
"skin", $sknst[0]);
421 $userObj->setPref(
"style", $sknst[1]);
425 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
432 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
435 $userObj->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
438 $userObj->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
440 if ((
int) $ilSetting->get(
'session_reminder_enabled')) {
441 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
443 $userObj->writePrefs();
446 $rbacadmin->assignUser(
$_POST[
"default_role"], $userObj->getId(),
true);
448 $msg = $this->lng->txt(
"user_added");
450 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
451 $ilUser->writePrefs();
453 $this->
object = $userObj;
459 if ($profileMaybeIncomplete) {
460 include_once
'Services/User/classes/class.ilUserProfile.php';
462 $this->
object->setProfileIncomplete(
true);
463 $this->
object->update();
468 if (
$_POST[
'send_mail'] ==
'y') {
469 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
471 $acc_mail->useLangVariablesAsFallback(
true);
472 $acc_mail->setUserPassword(
$_POST[
'passwd']);
473 $acc_mail->setUser($userObj);
475 if ($acc_mail->send()) {
476 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_sent');
479 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_not_sent');
487 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
488 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
490 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
493 $this->form_gui->setValuesByPost();
494 $tpl->setContent($this->form_gui->getHtml());
508 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
514 if ($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
515 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
521 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
522 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
527 $this->tabs_gui->clearTargets();
531 $this->initForm(
"edit");
533 $this->showAcceptedTermsOfService();
534 $this->tpl->setContent($this->form_gui->getHTML());
555 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
560 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
561 $user->setTimeLimitUntil($until
565 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
567 if ($a_mode ==
'create') {
568 $user->setTimeLimitOwner($this->usrf_ref_id);
573 $bd = $this->form_gui->getItemByPostVar(
'birthday');
574 $bd = $bd->getDate();
575 $user->setBirthday($bd
581 $user->setLogin($this->form_gui->getInput(
'login'));
586 $user->setGender($this->form_gui->getInput(
'gender'));
591 $user->setUTitle($this->form_gui->getInput(
'title'));
596 $user->setFirstname($this->form_gui->getInput(
'firstname'));
600 $user->setLastname($this->form_gui->getInput(
'lastname'));
602 $user->setFullname();
606 $user->setInstitution($this->form_gui->getInput(
'institution'));
611 $user->setDepartment($this->form_gui->getInput(
'department'));
615 $user->setStreet($this->form_gui->getInput(
'street'));
619 $user->setCity($this->form_gui->getInput(
'city'));
623 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
627 $user->setCountry($this->form_gui->getInput(
'country'));
631 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
635 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
639 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
643 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
647 $user->setFax($this->form_gui->getInput(
'fax'));
651 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
655 $user->setEmail($this->form_gui->getInput(
'email'));
659 $user->setSecondEmail($this->form_gui->getInput(
'second_email'));
663 $user->setHobby($this->form_gui->getInput(
'hobby'));
667 $user->setComment($this->form_gui->getInput(
'referral_comment'));
671 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
672 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
673 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
676 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
679 $user->setLatitude($this->form_gui->getInput(
'latitude'));
680 $user->setLongitude($this->form_gui->getInput(
'longitude'));
681 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
684 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
685 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
687 if ((
int)
$user->getActive() != (int) $this->form_gui->getInput(
'active')) {
688 $user->setActive($this->form_gui->getInput(
'active'), $ilUser->getId());
703 if ($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write', $this->usrf_ref_id)) {
704 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
710 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
711 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
714 $this->initForm(
"edit");
717 unset(
$_POST[
'approve_date']);
718 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
719 unset(
$_POST[
'last_login']);
722 $profileMaybeIncomplete =
false;
723 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
727 if ($this->form_gui->checkInput()) {
731 && trim(
$_POST[
'passwd']) !=
"") {
739 if (
$_POST[
'active'] == 1) {
743 #$this->object->assignData($_POST); 747 foreach (
$_POST as $k => $v) {
748 if (substr($k, 0, 4) ==
"udf_") {
749 $udf[substr($k, 4)] = $v;
752 $this->
object->setUserDefinedData($udf);
755 $this->
object->updateLogin(
$_POST[
'login']);
758 $this->form_gui->setValuesByPost();
759 return $tpl->setContent($this->form_gui->getHtml());
762 $this->
object->setTitle($this->
object->getFullname());
763 $this->
object->setDescription($this->
object->getEmail());
766 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
769 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
781 $sknst = explode(
":",
$_POST[
"skin_style"]);
783 if ($this->
object->getPref(
"style") != $sknst[1] ||
784 $this->
object->getPref(
"skin") != $sknst[0]) {
785 $this->
object->setPref(
"skin", $sknst[0]);
786 $this->
object->setPref(
"style", $sknst[1]);
790 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
797 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
800 $this->
object->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
803 $this->
object->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
808 $this->
object->setLastPasswordChangeTS(
time());
811 if ((
int) $ilSetting->get(
'session_reminder_enabled')) {
812 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
816 $this->
object->setProfileIncomplete(
false);
818 $this->
update = $this->
object->update();
823 if ($ilUser->getId() == $this->
object->getId()) {
824 $ilUser->readPrefs();
826 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
827 $ilUser->writePrefs();
829 $mail_message = $this->__sendProfileMail();
830 $msg = $this->lng->txt(
'saved_successfully') . $mail_message;
837 if ($profileMaybeIncomplete) {
838 include_once
'Services/User/classes/class.ilUserProfile.php';
840 $this->
object->setProfileIncomplete(
true);
841 $this->
object->update();
848 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
849 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
851 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
854 $this->form_gui->setValuesByPost();
855 $tpl->setContent($this->form_gui->getHtml());
869 $data[
"auth_mode"] = $this->
object->getAuthMode();
870 $data[
"login"] = $this->
object->getLogin();
873 $data[
"ext_account"] = $this->
object->getExternalAccount();
878 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
881 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
884 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
887 $data[
"active"] = $this->
object->getActive();
888 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
890 $data[
"time_limit_from"] = $this->
object->getTimeLimitFrom()
893 $data[
"time_limit_until"] = $this->
object->getTimeLimitUntil()
899 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
926 $data[
"gender"] = $this->
object->getGender();
927 $data[
"firstname"] = $this->
object->getFirstname();
928 $data[
"lastname"] = $this->
object->getLastname();
929 $data[
"title"] = $this->
object->getUTitle();
930 $data[
'birthday'] = $this->
object->getBirthday()
933 $data[
"institution"] = $this->
object->getInstitution();
934 $data[
"department"] = $this->
object->getDepartment();
935 $data[
"street"] = $this->
object->getStreet();
936 $data[
"city"] = $this->
object->getCity();
937 $data[
"zipcode"] = $this->
object->getZipcode();
938 $data[
"country"] = $this->
object->getCountry();
939 $data[
"sel_country"] = $this->
object->getSelectedCountry();
940 $data[
"phone_office"] = $this->
object->getPhoneOffice();
941 $data[
"phone_home"] = $this->
object->getPhoneHome();
942 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
943 $data[
"fax"] = $this->
object->getFax();
944 $data[
"email"] = $this->
object->getEmail();
945 $data[
"second_email"] = $this->
object->getSecondEmail();
946 $data[
"hobby"] = $this->
object->getHobby();
947 $data[
"referral_comment"] = $this->
object->getComment();
950 $data[
"interests_general"] = $this->
object->getGeneralInterests();
951 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
952 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
955 $data[
"matriculation"] = $this->
object->getMatriculation();
956 $data[
"client_ip"] = $this->
object->getClientIP();
959 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
961 $user_defined_data = $this->
object->getUserDefinedData();
962 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
963 $data[
"udf_" . $field_id] = $user_defined_data[
"f_" . $field_id];
967 $data[
"language"] = $this->
object->getLanguage();
968 $data[
"skin_style"] = $this->
object->skin .
":" . $this->
object->prefs[
"style"];
969 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
971 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"];
972 $data[
'bs_allow_to_contact_me'] = $this->
object->prefs[
'bs_allow_to_contact_me'] ==
'y';
973 $data[
'chat_osc_accept_msg'] = $this->
object->prefs[
'chat_osc_accept_msg'] ==
'y';
974 $data[
"session_reminder_enabled"] = (int) $this->
object->prefs[
"session_reminder_enabled"];
976 $data[
"send_mail"] = ($this->object->prefs[
'send_info_mails'] ==
'y');
979 $this->form_gui->setValuesByArray($data);
985 public function initForm($a_mode)
991 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
994 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
995 if ($a_mode ==
"create") {
996 $this->form_gui->setTitle($lng->txt(
"usr_new"));
998 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1003 $sec_l->setTitle($lng->txt(
"login_data"));
1004 $this->form_gui->addItem($sec_l);
1007 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1011 foreach ($active_auth_modes as $auth_name => $auth_key) {
1012 if ($auth_name ==
'default') {
1016 #$name = $this->lng->txt('auth_'.$auth_name); 1017 include_once
'./Services/Authentication/classes/class.ilAuthUtils.php';
1021 $option[$auth_name] =
$name;
1023 $am->setOptions($option);
1024 $this->form_gui->addItem($am);
1026 if ($a_mode ==
"edit") {
1029 $this->form_gui->addItem(
$id);
1035 if ($a_mode ==
"edit") {
1036 $lo->setCurrentUserId($this->
object->getId());
1038 include_once
'Services/Calendar/classes/class.ilDate.php';
1043 $this->lng->txt(
'usr_loginname_history_info'),
1045 $last_history_entry[0]
1052 $this->form_gui->addItem($lo);
1061 $pw->setMaxLength(80);
1062 $pw->setValidateAuthPost(
"auth_mode");
1063 if ($a_mode ==
"create") {
1064 $pw->setRequiredOnAuth(
true);
1067 $this->form_gui->addItem($pw);
1072 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1074 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1076 $ext->setMaxLength(250);
1077 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1078 $this->form_gui->addItem($ext);
1083 $sec_si->setTitle($this->lng->txt(
"system_information"));
1084 $this->form_gui->addItem($sec_si);
1087 if ($a_mode ==
"edit") {
1088 $sia =
array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1089 foreach ($sia as $a) {
1091 $this->form_gui->addItem($siai);
1098 $this->form_gui->addItem($ac);
1101 $lng->loadLanguageModule(
'crs');
1106 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1107 $radg->addOption($op1);
1108 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1109 $radg->addOption($op2);
1118 $acfrom->setShowTime(
true);
1120 $op2->addSubItem($acfrom);
1125 $acto->setShowTime(
true);
1127 $op2->addSubItem($acto);
1130 $this->form_gui->addItem($radg);
1132 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1134 $lng->loadLanguageModule(
"file");
1137 $quota_head->setTitle($lng->txt(
"repository_disk_quota"));
1138 $this->form_gui->addItem($quota_head);
1141 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1143 $disk_quota->setMaxLength(11);
1144 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1145 $this->form_gui->addItem($disk_quota);
1147 if ($a_mode ==
"edit") {
1149 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1151 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota']) {
1152 $info_text = sprintf(
1153 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1156 $dq_info[
'role_title']
1158 } elseif (is_infinite($dq_info[
'role_disk_quota'])) {
1159 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1161 $info_text = sprintf(
1162 $lng->txt(
'disk_quota_is_1_by_2'),
1164 $dq_info[
'role_title']
1167 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1173 if ($du_info[
'last_update'] === null) {
1174 $disk_usage->
setValue($lng->txt(
'unknown'));
1177 $info =
'<table class="il_user_quota_disk_usage_overview">';
1179 foreach ($du_info[
'details'] as $detail_data) {
1181 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1182 '<td class="std">' . $lng->txt($detail_data[
'type']) .
'</td>' .
1187 $info .=
'</table>';
1188 $info .=
'<br>' . $this->lng->txt(
'last_update') .
': ' .
1190 $disk_usage->setInfo(
$info);
1192 $this->form_gui->addItem($disk_usage);
1195 if (
true || $dq_info[
'last_reminder']) {
1200 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1201 $this->form_gui->addItem($reminder);
1207 $lng->loadLanguageModule(
"file");
1210 $quota_head->setTitle($lng->txt(
"personal_workspace_disk_quota"));
1211 $this->form_gui->addItem($quota_head);
1214 $wsp_disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"wsp_disk_quota");
1216 $wsp_disk_quota->setMaxLength(11);
1217 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1218 $this->form_gui->addItem($wsp_disk_quota);
1220 if ($a_mode ==
"edit") {
1222 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1224 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota']) {
1225 $info_text = sprintf(
1226 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1229 $dq_info[
'role_title']
1231 } elseif (is_infinite($dq_info[
'role_wsp_disk_quota'])) {
1232 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1234 $info_text = sprintf(
1235 $lng->txt(
'disk_quota_is_1_by_2'),
1237 $dq_info[
'role_title']
1240 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1244 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1247 if (!
sizeof($du_info)) {
1248 $disk_usage->
setValue($lng->txt(
'unknown'));
1251 $info =
'<table class="il_user_quota_disk_usage_overview">';
1253 foreach ($du_info as $detail_data) {
1255 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1256 '<td class="std">' . $lng->txt(
"obj_" . $detail_data[
"src_type"]) .
'</td>' .
1257 '<td class="std">' .
ilUtil::formatSize($detail_data[
'filesize'],
'short') .
'</td>' .
1261 $info .=
'</table>';
1262 $disk_usage->setInfo(
$info);
1264 $this->form_gui->addItem($disk_usage);
1277 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1278 $this->form_gui->addItem($sec_pd);
1285 $neutral =
new ilRadioOption($lng->txt(
"salutation_n"),
"n");
1286 $gndr->addOption($neutral);
1287 $female =
new ilRadioOption($lng->txt(
"salutation_f"),
"f");
1288 $gndr->addOption($female);
1290 $gndr->addOption($male);
1291 $this->form_gui->addItem($gndr);
1295 $fields =
array(
"firstname" =>
true,
"lastname" =>
true,
1297 foreach ($fields as $field =>
$req) {
1300 $caption = ($field ==
"title")
1305 $inp->setMaxLength(32);
1306 $inp->setRequired(
$req);
1307 $this->form_gui->addItem($inp);
1314 if ($a_mode ==
"edit" || $a_mode ==
"upload") {
1315 $pi->
setImage(ilObjUser::_getPersonalPicturePath(
1322 $this->form_gui->addItem($pi);
1328 $this->form_gui->addItem($birthday);
1335 array(
"institution", 40, 80),
1336 array(
"department", 40, 80),
1337 array(
"street", 40, 40),
1338 array(
"city", 40, 40),
1339 array(
"zipcode", 10, 10),
1340 array(
"country", 40, 40),
1341 array(
"sel_country"),
1342 array(
"phone_office", 30, 30),
1343 array(
"phone_home", 30, 30),
1344 array(
"phone_mobile", 30, 30),
1345 array(
"fax", 30, 30));
1348 foreach ($fields as $field) {
1352 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1353 $this->form_gui->addItem($sec_cd);
1356 if ($a_mode ==
"edit") {
1359 $this->form_gui->addItem($orgus);
1363 if ($field[0] !=
"sel_country") {
1366 $inp->setMaxLength($field[2]);
1367 $inp->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1369 $this->form_gui->addItem($inp);
1372 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1376 $this->form_gui->addItem($cs);
1386 $this->form_gui->addItem($em);
1393 $this->form_gui->addItem($em);
1401 $hob->setRequired(isset(
$settings[
"require_hobby"]) &&
1403 $this->form_gui->addItem($hob);
1411 $rc->setRequired(isset(
$settings[
"require_referral_comment"]) &&
1413 $this->form_gui->addItem($rc);
1420 $sh->setTitle($lng->txt(
"interests"));
1421 $this->form_gui->addItem($sh);
1423 $multi_fields =
array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1424 foreach ($multi_fields as $multi_field) {
1429 $ti->setMaxLength(40);
1431 $ti->setRequired(isset(
$settings[
"require_" . $multi_field]) &&
1433 $this->form_gui->addItem($ti);
1441 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1442 $this->form_gui->addItem($sec_oi);
1447 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1449 $mr->setMaxLength(40);
1450 $mr->setRequired(isset(
$settings[
"require_matriculation"]) &&
1452 $this->form_gui->addItem($mr);
1458 $ip->setMaxLength(255);
1459 $ip->setInfo($this->lng->txt(
"current_ip") .
" " .
$_SERVER[
"REMOTE_ADDR"] .
" <br />" .
1460 '<span class="warning">' . $this->lng->txt(
"current_ip_alert") .
"</span>");
1461 $this->form_gui->addItem($ip);
1464 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1468 $all_defs = $user_defined_fields->getDefinitions();
1470 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1473 foreach ($all_defs as $field_id => $definition) {
1476 $definition[
'field_name'],
1477 "udf_" . $definition[
'field_id']
1480 $udf->setMaxLength(255);
1483 $definition[
'field_name'],
1484 "udf_" . $definition[
'field_id']
1486 $udf->setUseRte(
true);
1489 $definition[
'field_name'],
1490 "udf_" . $definition[
'field_id']
1492 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1493 $definition[
'field_values']
1496 $udf->setRequired($definition[
'required']);
1497 $this->form_gui->addItem($udf);
1502 $a_mode ==
'create' or
1511 $sec_st->setTitle($this->lng->txt(
"settings"));
1512 $this->form_gui->addItem($sec_st);
1516 if ($a_mode ==
"create") {
1518 $lng->txt(
"default_role"),
1522 $role->setValue($this->default_role);
1523 $role->setOptions($this->selectable_roles);
1524 $this->form_gui->addItem($role);
1530 $lng->txt(
"language"),
1533 $languages = $lng->getInstalledLanguages();
1534 $lng->loadLanguageModule(
"meta");
1536 foreach ($languages as
$l) {
1540 $lang->setValue($ilSetting->get(
"language"));
1541 $this->form_gui->addItem(
$lang);
1547 $lng->txt(
"skin_style"),
1553 $skins = $styleDefinition->getAllSkins();
1556 if (is_array($skins)) {
1560 foreach ($skins as $skin) {
1561 foreach ($skin->getStyles() as
$style) {
1562 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
1567 $options[$skin->getId() .
":" .
$style->getId()] = $skin->getName() .
" / " .
$style->getName();
1572 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin") .
1573 ":" . $ilClientIniFile->readVariable(
"layout",
"style"));
1575 $this->form_gui->addItem($sk);
1581 $lng->txt(
"hits_per_page"),
1584 $options =
array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1585 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1586 $hpp->setOptions($options);
1587 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1588 $this->form_gui->addItem($hpp);
1604 $lng->loadLanguageModule(
"awrn");
1606 $default = ($ilSetting->get(
'hide_own_online_status') ==
"n")
1607 ? $this->lng->txt(
"user_awrn_show")
1608 : $this->lng->txt(
"user_awrn_hide");
1611 "" => $this->lng->txt(
"user_awrn_default").
" (".$default.
")",
1612 "n" => $this->lng->txt(
"user_awrn_show"),
1613 "y" => $this->lng->txt(
"user_awrn_hide"));
1614 $os =
new ilSelectInputGUI($lng->txt(
"awrn_user_show"),
"hide_own_online_status");
1616 $os->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1617 $os->setInfo($lng->txt(
"awrn_hide_from_awareness_info"));
1618 $this->form_gui->addItem($os);
1627 $lng->loadLanguageModule(
'buddysystem');
1628 $os =
new ilCheckboxInputGUI($lng->txt(
'buddy_allow_to_contact_me'),
'bs_allow_to_contact_me');
1629 if ($a_mode ==
'create') {
1632 $this->form_gui->addItem($os);
1635 $lng->loadLanguageModule(
'chatroom');
1636 $chat_osc_acm =
new ilCheckboxInputGUI($lng->txt(
'chat_osc_accept_msg'),
'chat_osc_accept_msg');
1637 if ($a_mode ==
'create') {
1640 $this->form_gui->addItem($chat_osc_acm);
1643 if ((
int) $ilSetting->get(
'session_reminder_enabled')) {
1644 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1646 $this->form_gui->addItem($cb);
1652 $sec_op->setTitle($this->lng->txt(
"options"));
1653 $this->form_gui->addItem($sec_op);
1658 $se->
setInfo($lng->txt(
'inform_user_mail_info'));
1660 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1661 $this->form_gui->addItem($se);
1665 $irf->
setInfo($lng->txt(
'ignore_required_fields_info'));
1667 $this->form_gui->addItem($irf);
1672 if ($a_mode ==
"create" || $a_mode ==
"save") {
1673 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1675 if ($a_mode ==
"edit" || $a_mode ==
"update") {
1676 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1678 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1705 return (
bool)
$settings[
'usr_settings_changeable_lua_' . $a_field];
1721 !$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
1722 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1728 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1729 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1733 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1735 if ($_FILES[
"userfile"][
"tmp_name"] ==
"") {
1736 if ($userfile_input->getDeletionFlag()) {
1737 $this->
object->removeUserPicture();
1741 if ($_FILES[
"userfile"][
"size"] == 0) {
1745 $image_dir = $webspace_dir .
"/usr_images";
1746 $store_file =
"usr_" . $this->
object->getId() .
"." .
"jpg";
1749 $this->
object->setPref(
"profile_image", $store_file);
1750 $this->
object->update();
1753 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1754 $uploaded_file = $image_dir .
"/upload_" . $this->
object->getId() .
"." . $pi[
"extension"];
1755 if (!ilUtil::moveUploadedFile(
1756 $_FILES[
"userfile"][
"tmp_name"],
1757 $_FILES[
"userfile"][
"name"],
1762 $this->ctrl->redirect($this,
"showProfile");
1764 chmod($uploaded_file, 0770);
1768 $show_file =
"$image_dir/usr_" . $this->
object->getId() .
".jpg";
1769 $thumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_small.jpg";
1770 $xthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1771 $xxthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1779 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file);
1780 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file);
1781 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file);
1782 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file);
1784 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
1785 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
1786 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
1787 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
1798 $image_dir = $webspace_dir .
"/usr_images";
1799 $file = $image_dir .
"/usr_" . $this->
object->getID() .
"." .
"jpg";
1800 $thumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_small.jpg";
1801 $xthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xsmall.jpg";
1802 $xxthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xxsmall.jpg";
1803 $upload_file = $image_dir .
"/upload_" . $this->
object->getID();
1806 $this->
object->setPref(
"profile_image",
"");
1807 $this->
object->update();
1810 if (@is_file(
$file)) {
1813 if (@is_file($thumb_file)) {
1814 unlink($thumb_file);
1816 if (@is_file($xthumb_file)) {
1817 unlink($xthumb_file);
1819 if (@is_file($xxthumb_file)) {
1820 unlink($xxthumb_file);
1822 if (@is_file($upload_file)) {
1823 unlink($upload_file);
1839 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1840 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1847 if ($this->
object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles)) {
1848 array_push($selected_roles, SYSTEM_ROLE_ID);
1851 $global_roles_all = $rbacreview->getGlobalRoles();
1852 $assigned_roles_all = $rbacreview->assignedRoles($this->
object->getId());
1853 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
1854 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
1855 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
1856 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
1858 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
1859 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles))) {
1862 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role") .
"<br/>" . $this->lng->txt(
"action_aborted"),
true);
1863 $this->ctrl->redirect($this,
'roleassignment');
1866 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
1867 $rbacadmin->deassignUser($role, $this->
object->getId());
1870 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
1871 $rbacadmin->assignUser($role, $this->
object->getId(),
false);
1874 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
1877 $this->
object->update();
1881 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
1882 $this->ctrl->redirect($this,
'roleassignment');
1884 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1897 $ilTabs->activateTab(
"role_assignment");
1899 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1900 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1909 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
1912 $this->tpl->setCurrentBlock(
"filter");
1913 $this->tpl->setVariable(
"FILTER_TXT_FILTER", $this->lng->txt(
'filter'));
1915 $this->tpl->setVariable(
"FILTER_ACTION", $this->ctrl->getFormAction($this));
1916 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
1917 $this->tpl->setVariable(
"FILTER_VALUE", $this->lng->txt(
'apply_filter'));
1918 $this->tpl->parseCurrentBlock();
1922 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
1926 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"], $this->object->getId());
1927 $assigned_roles = $rbacreview->assignedRoles($this->
object->getId());
1931 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
1934 foreach ($role_list as $role) {
1936 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
1939 if ($rbacreview->isDeleted($rolf[0])) {
1946 if ($this->tree->isInTree($rolf[0])) {
1947 if ($rolf[0] == ROLE_FOLDER_ID) {
1948 $path = $this->lng->txt(
"global");
1950 $tmpPath = $this->tree->getPathFull($rolf[0]);
1963 $path = $tmpPath[count($tmpPath)-1][
"title"];
1966 $path =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $role[
"obj_id"] .
")</b>";
1972 if (($this->
object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
1973 or (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID)) {
1978 if ($role[
'obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
1979 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1985 if (substr($role[
"title"], 0, 3) ==
"il_") {
1987 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
1988 $rolf2 = $rolf_arr[0];
1993 $parent_node = $this->tree->getNodeData($rolf2);
1995 $role[
"description"] = $this->lng->txt(
"obj_" . $parent_node[
"type"]) .
" (#" . $parent_node[
"obj_id"] .
")";
1998 $role_ids[
$counter] = $role[
"obj_id"];
2000 $result_set[
$counter][] = $checkbox = ilUtil::formCheckBox(in_array($role[
"obj_id"], $assigned_roles),
"role_id[]", $role[
"obj_id"], $disabled) .
"<input type=\"hidden\" name=\"role_id_ctrl[]\" value=\"" . $role[
"obj_id"] .
"\"/>";
2001 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2002 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2003 $result_set[
$counter][] = $link =
"<a href=\"" . $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm") .
"\">" .
ilObjRole::_getTranslation($role[
"title"]) .
"</a>";
2005 $result_set[
$counter][] = $role[
"description"];
2008 if ($role[
"role_type"] ==
"local") {
2010 $obj_id = $rbacreview->getObjectOfRole($role[
"rol_id"]);
2016 foreach ($ref_ids as
$ref_id) {
2019 require_once(
"./Services/Link/classes/class.ilLink.php");
2028 "context" => $context,
"checkbox" => $checkbox,
2029 "role" => $link,
"title" =>
$title);
2035 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2045 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2047 $table_gui->writeFilterToSession();
2048 $table_gui->resetOffset();
2057 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2059 $table_gui->resetOffset();
2060 $table_gui->resetFilter();
2069 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2075 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2081 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2087 $month[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2092 if ($a_selected <
date(
'Y',
time())) {
2093 $start = $a_selected;
2108 $a_time_arr[
"hour"],
2109 $a_time_arr[
"minute"],
2110 $a_time_arr[
"second"],
2111 $a_time_arr[
"month"],
2127 $action[0] = $this->lng->txt(
'assigned_roles');
2128 $action[1] = $this->lng->txt(
'all_roles');
2129 $action[2] = $this->lng->txt(
'all_global_roles');
2130 $action[3] = $this->lng->txt(
'all_local_roles');
2131 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2132 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2139 parent::hitsperpageObject();
2151 $ilLocator->clearItems();
2153 if (
$_GET[
"admin_mode"] ==
"settings") {
2154 $this->ctrl->setParameterByClass(
2155 "ilobjsystemfoldergui",
2159 $ilLocator->addItem(
2160 $this->lng->txt(
"administration"),
2161 $this->ctrl->getLinkTargetByClass(
array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2166 $ilLocator->addItem(
2170 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view")
2172 } elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID) {
2173 $ilLocator->addItem(
2177 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view")
2181 if (
$_GET[
"obj_id"] > 0) {
2182 $ilLocator->addItem(
2183 $this->
object->getTitle(),
2184 $this->ctrl->getLinkTarget($this,
"view")
2196 public function __sendProfileMail()
2200 if (
$_POST[
'send_mail'] !=
'y') {
2203 if (!strlen($this->
object->getEmail())) {
2210 $usr_lang->loadLanguageModule(
'registration');
2212 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2215 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
2218 $mmail->From($senderFactory->system());
2222 $subject = $usr_lang->txt(
"profile_changed");
2226 $body = ($usr_lang->txt(
"reg_mail_body_salutation") .
" " . $this->
object->getFullname() .
",\n\n");
2228 $date = $this->
object->getApproveDate();
2230 if ((
time() - strtotime($date)) < 10) {
2231 $body .= ($usr_lang->txt(
'reg_mail_body_approve') .
"\n\n");
2233 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n");
2237 if (
$_POST[
'passwd'] !=
'') {
2238 $body .= $usr_lang->txt(
"reg_mail_body_text2") .
"\n" .
2239 ILIAS_HTTP_PATH .
"/login.php?client_id=" . $ilias->client_id .
"\n" .
2240 $usr_lang->txt(
"login") .
": " . $this->
object->getLogin() .
"\n" .
2241 $usr_lang->txt(
"passwd") .
": " .
$_POST[
'passwd'] .
"\n\n";
2243 $body .= ($usr_lang->txt(
"reg_mail_body_text3") .
"\n");
2244 $body .= $this->
object->getProfileAsString($usr_lang);
2246 $mmail->Subject($subject);
2247 $mmail->Body($body);
2251 return "<br/>" . $this->lng->txt(
"mail_sent");
2262 if ($a_target == md5(
"usrdelown")) {
2263 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
2264 $ilUser->hasDeletionFlag()) {
2265 $ilCtrl->setTargetScript(
"ilias.php");
2266 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2267 $ilCtrl->redirectByClass(
array(
"ilpersonaldesktopgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2269 exit(
"This account is not flagged for deletion.");
2273 if (substr($a_target, -4) ==
"_bdg") {
2274 $_GET[
"baseClass"] =
"ilPersonalDesktopGUI";
2275 $_GET[
"cmd"] =
"jumpToBadges";
2276 include(
"ilias.php");
2280 if (
'registration' == $a_target) {
2281 $_GET[
"baseClass"] =
'ilStartUpGUI';
2282 $ilCtrl->setTargetScript(
'ilias.php');
2283 $ilCtrl->redirectByClass(
array(
'ilStartUpGUI',
'ilAccountRegistrationGUI'),
'');
2284 } elseif (
'nameassist' == $a_target) {
2285 $_GET[
"baseClass"] =
'ilStartUpGUI';
2286 $ilCtrl->setTargetScript(
'ilias.php');
2287 $ilCtrl->redirectByClass(
array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'showUsernameAssistanceForm');
2288 } elseif (
'pwassist' == $a_target) {
2289 $_GET[
"baseClass"] =
'ilStartUpGUI';
2290 $ilCtrl->setTargetScript(
'ilias.php');
2291 $ilCtrl->redirectByClass(
array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'');
2292 } elseif (
'agreement' == $a_target) {
2293 if ($ilUser->getId() > 0 && !$ilUser->isAnonymous()) {
2294 $ilCtrl->setTargetScript(
"ilias.php");
2295 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2296 $ilCtrl->redirectByClass(
array(
"ilpersonaldesktopgui",
"ilpersonalprofilegui"),
"showUserAgreement");
2298 $_GET[
"baseClass"] =
'ilStartUpGUI';
2299 $ilCtrl->setTargetScript(
'ilias.php');
2300 $ilCtrl->redirectByClass(
array(
'ilStartUpGUI'),
'showTermsOfService');
2304 if (substr($a_target, 0, 1) ==
"n") {
2308 if (strpos($a_target,
'contact_approved') !==
false) {
2309 $_GET[
'cmd'] =
'approveContactRequest';
2310 } elseif (strpos($a_target,
'contact_ignored') !==
false) {
2311 $_GET[
'cmd'] =
'ignoreContactRequest';
2313 $_GET[
'cmd'] =
'view';
2316 $_GET[
"user_id"] = (int) $a_target;
2317 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2318 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2319 include(
"ilias.php");
2333 $profileMaybeIncomplete =
false;
2335 require_once
'Services/User/classes/class.ilUserProfile.php';
2338 $elm = $this->form_gui->getItemByPostVar($fieldName);
2344 if ($elm->getRequired()) {
2345 $profileMaybeIncomplete =
true;
2348 $elm->setRequired(
false);
2352 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2354 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
2355 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $definition[
'field_id']);
2361 if ($elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible']) {
2362 $profileMaybeIncomplete =
true;
2365 $elm->setRequired(
false);
2369 return $profileMaybeIncomplete;
2375 protected function showAcceptedTermsOfService()
2380 $agree_date = $this->form_gui->getItemByPostVar(
'agree_date');
2381 if ($agree_date && $agree_date->getValue()) {
2382 $this->lng->loadLanguageModule(
'tos');
2383 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
2388 if ($entity->getId()) {
2389 $show_agreement_text =
new ilCheckboxInputGUI($this->lng->txt(
'tos_show_signed_text'),
'tos_show_signed_text');
2392 $agreement_lang->
setValue($this->lng->txt(
'meta_l_' . $entity->getIso2LanguageCode()));
2393 $show_agreement_text->addSubItem($agreement_lang);
2395 require_once
'Services/TermsOfService/classes/form/class.ilTermsOfServiceSignedDocumentFormElementGUI.php';
2397 $show_agreement_text->addSubItem($agreement_document);
2398 $agree_date->addSubItem($show_agreement_text);
2400 } elseif ($agree_date) {
2401 $agree_date->setValue($this->lng->txt(
'tos_not_accepted_yet'));
__showUserDefinedFields()
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static isConvertVersionAtLeast($a_version)
Compare convert version numbers.
static _lookupLogin($a_user_id)
lookup login
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
Class for user related exception handling in ILIAS.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
getAdminTabs()
admin and normal tabs are equal for roles
addAdminLocatorItems($a_do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded) ...
assignSaveObject()
assign users to role
getValues()
Get values from user object and put them into form.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
createObject()
Display user create form.
setValue($a_value)
Set Value.
static _getInstance()
Get instance.
handleIgnoredRequiredFields()
Handles ignored required fields by changing the required flag of form elements.
loadValuesFromForm($a_mode='create')
uploadUserPictureObject()
upload user image
static _isActive()
Static getter.
removeUserPictureObject()
remove user image
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static MB2Bytes($a_value)
static _lookupPersonalWorkspaceDiskQuota($a_user_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
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.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
static _getActiveAuthModes()
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
__unsetSessionVariables()
Class ilObjectOwnershipManagementGUI.
static _resetLoginAttempts($a_usr_id)
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getAuthModeName($a_auth_key)
const LP_CONTEXT_USER_FOLDER
static _isPersonalWorkspaceActive()
Static getter.
static _getAssignUsersStatus($a_role_id)
static _getAllReferences($a_id)
get all reference ids of object
static _goto($a_target)
Goto user profile screen.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
static getExternalEmailsByUser(ilObjUser $user, ilMailOptions $mail_options=null)
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
isSettingChangeable($a_field)
Check if setting is visible This is the case when called from user folder.
prepareOutput($a_show_subobjects=true)
prepare output
static _enabledLearningProgress()
check wether learing progress is enabled or not
__checkUserDefinedRequiredFields()
display user create form
static execConvert($args)
execute convert command
__getDateSelect($a_type, $a_varname, $a_selected)
static getCurrentAcceptanceForUser(ilObjUser $user)
resetFilterObject()
Reset filter.
static _lookupDiskQuota($a_user_id)
Gets the disk quota info for the specified user account.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static Bytes2MB($a_value)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
static clear($a_var)
Unset a value.
editObject()
Display user edit form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _isExternalAccountEnabled()
Check if an external account name is required.
static getFilesizeByOwner($a_owner_id)
Get current storage size for owner.
static _getTranslation($a_role_title)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
update($pash, $contents, Config $config)
static _lookupDiskUsage($a_user_id)
Gets the disk usage info for the specified user account.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
TableGUI class for role assignment in user administration.
This class represents a non editable value in a property form.
static getAuthModeTranslation($a_auth_key)
setRows($a_rows)
Set Rows.
Create new PHPExcel object
obj_idprivate
static escapeShellArg($a_arg)
applyFilterObject()
Apply filter.
This class represents a text area property in a property form.
loadLanguageModule($a_module)
saveObject()
save user data public
const USER_FOLDER_ID
Class ilObjUserFolder.
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 formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
__construct($a_data, $a_id, $a_call_by_reference=false, $a_prepare_output=true)
Constructor public.
setBackTarget($a_text, $a_link)
set back tab target
updateObject()
Update user.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static getWebspaceDir($mode="filesystem")
get webspace directory
static _getInstance()
Get instance of ilSecuritySettings.
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
roleassignmentObject()
display roleassignment panel
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
static getFilesizeByTypeAndOwner($a_owner_id)
Get current storage size for owner (grouped by type)