4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 include_once(
'./Services/Calendar/classes/class.ilDatePresentation.php');
47 function ilObjUserGUI($a_data,$a_id,$a_call_by_reference =
false, $a_prepare_output =
true)
51 define(
'USER_FOLDER_ID',7);
54 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
58 $this->ctrl->saveParameter($this, array(
'obj_id',
'letter'));
59 $this->ctrl->setParameterByClass(
"ilobjuserfoldergui",
"letter",
$_GET[
"letter"]);
61 $lng->loadLanguageModule(
'user');
65 $this->gender = array(
66 'm' =>
"salutation_m",
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
82 case "illearningprogressgui":
83 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
85 $this->ctrl->forwardCommand($new_gui);
88 case "ilobjectownershipmanagementgui":
89 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
91 $this->ctrl->forwardCommand($gui);
100 $return = $this->
$cmd();
111 if(strtolower(get_class($this->
object)) ==
'ilobjuser')
113 $this->tpl->setTitle(
'['.$this->object->getLogin().
'] '.$this->
object->getTitle());
114 $this->tpl->setDescription($this->object->getLongDescription());
115 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
".svg"), $this->lng->txt(
"obj_" . $this->object->getType()));
119 parent::setTitleAndDescription();
129 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
131 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
137 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
154 global $rbacsystem, $ilHelp;
156 $tabs_gui->clearTargets();
158 $ilHelp->setScreenIdComponent(
"usr");
162 $tabs_gui->setBackTarget(
163 $this->lng->txt(
"search_results"),
$_SESSION[
"usr_search_link"]);
165 $tabs_gui->addTarget(
"properties",
166 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this),
"",
true);
170 $tabs_gui->addTarget(
"properties",
171 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this));
174 $tabs_gui->addTarget(
"role_assignment",
175 $this->ctrl->getLinkTarget($this,
"roleassignment"), array(
"roleassignment"), get_class($this));
178 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
179 if($rbacsystem->checkAccess(
'read',$this->ref_id) and
184 $tabs_gui->addTarget(
'learning_progress',
185 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
187 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
190 $tabs_gui->addTarget(
'user_ownership',
191 $this->ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
193 'ilobjectownershipmanagementgui');
201 $this->back_target = array(
"text" => $a_text,
211 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
214 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
216 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
227 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
230 if($this->object->getType() ==
'usr')
232 $user_defined_data = $this->
object->getUserDefinedData();
234 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
236 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
237 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
241 $this->tpl->setCurrentBlock(
"field_text");
242 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
244 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
"field_select");
250 'udf['.$definition[
'field_id'].
']',
251 $this->user_defined_fields->fieldValuesToSelectArray(
252 $definition[
'field_values']),
255 $this->tpl->parseCurrentBlock();
257 $this->tpl->setCurrentBlock(
"user_defined");
259 if($definition[
'required'])
261 $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();
279 $this->tabs_gui->clearTargets();
283 $obj_list = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
285 foreach ($obj_list as $obj_data)
288 if($this->object->getRefId() !=
USER_FOLDER_ID and !in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
290 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
298 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
301 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
303 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
311 $this->
ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"),$this->
ilias->error_obj->MESSAGE);
314 $keys = array_keys($rol);
317 if (in_array(4,$keys))
319 $this->default_role = 4;
323 if (count($keys) > 1 and in_array(2,$keys))
326 foreach ($keys as $key => $val)
336 $this->default_role = array_shift($keys);
338 $this->selectable_roles = $rol;
348 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) and
349 !$rbacsystem->checkAccess(
'cat_administrate_users',$this->usrf_ref_id))
351 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
356 return $tpl->setContent($this->form_gui->getHtml());
367 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
370 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) &&
371 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id))
373 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
380 $profileMaybeIncomplete =
false;
381 if($this->form_gui->getInput(
'ignore_rf',
false))
386 if ($this->form_gui->checkInput())
389 $role_select = $this->form_gui->getItemByPostVar(
'default_role');
390 if(!array_key_exists($role_select->getValue(), (array) $role_select->getOptions()))
392 $role_select->setAlert($this->lng->txt(
'err_invalid_form_input'));
394 $this->form_gui->setValuesByPost();
395 return $tpl->setContent($this->form_gui->getHtml());
401 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
402 $userObj->setTitle($userObj->getFullname());
403 $userObj->setDescription($userObj->getEmail());
406 foreach(
$_POST as $k => $v)
408 if (substr($k, 0, 4) ==
"udf_")
410 $udf[substr($k, 4)] = $v;
413 $userObj->setUserDefinedData($udf);
417 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
420 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
425 $userObj->setLastPasswordChangeTS( time() );
428 $userObj->saveAsNew();
433 $userObj->setLanguage(
$_POST[
"language"]);
437 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
447 $sknst = explode(
":",
$_POST[
"skin_style"]);
449 if ($userObj->getPref(
"style") != $sknst[1] ||
450 $userObj->getPref(
"skin") != $sknst[0])
452 $userObj->setPref(
"skin", $sknst[0]);
453 $userObj->setPref(
"style", $sknst[1]);
458 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
462 $userObj->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
466 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
468 if((
int)$ilSetting->get(
'session_reminder_enabled'))
470 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
472 $userObj->writePrefs();
475 $rbacadmin->assignUser(
$_POST[
"default_role"],$userObj->getId(),
true);
477 $msg = $this->lng->txt(
"user_added");
479 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
480 $ilUser->writePrefs();
482 $this->
object = $userObj;
489 if( $profileMaybeIncomplete )
491 include_once
'Services/User/classes/class.ilUserProfile.php';
494 $this->
object->setProfileIncomplete(
true );
495 $this->
object->update();
500 if(
$_POST[
'send_mail'] ==
'y')
502 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
504 $acc_mail->useLangVariablesAsFallback(
true);
505 $acc_mail->setUserPassword(
$_POST[
'passwd']);
506 $acc_mail->setUser($userObj);
508 if ($acc_mail->send())
510 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_sent');
515 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_not_sent');
525 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
527 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
531 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
536 $this->form_gui->setValuesByPost();
537 $tpl->setContent($this->form_gui->getHtml());
548 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition,
$ilUser 551 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
554 $settings = $ilias->getAllSettings();
557 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
559 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
566 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
568 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
574 $this->tabs_gui->clearTargets();
580 $this->showAcceptedTermsOfService();
581 $this->tpl->setContent($this->form_gui->getHTML());
607 $user->setTimeLimitUntil($until->get(
IL_CAL_UNIX));
609 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
611 if($a_mode ==
'create')
613 $user->setTimeLimitOwner($this->usrf_ref_id);
619 $bd = $this->form_gui->getInput(
'birthday');
622 $user->setBirthday($bd[
'date']);
626 $user->setBirthday(null);
631 $user->setLogin($this->form_gui->getInput(
'login'));
637 $user->setGender($this->form_gui->getInput(
'gender'));
643 $user->setUTitle($this->form_gui->getInput(
'title'));
649 $user->setFirstname($this->form_gui->getInput(
'firstname'));
654 $user->setLastname($this->form_gui->getInput(
'lastname'));
656 $user->setFullname();
661 $user->setInstitution($this->form_gui->getInput(
'institution'));
667 $user->setDepartment($this->form_gui->getInput(
'department'));
672 $user->setStreet($this->form_gui->getInput(
'street'));
677 $user->setCity($this->form_gui->getInput(
'city'));
682 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
687 $user->setCountry($this->form_gui->getInput(
'country'));
692 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
697 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
702 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
707 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
712 $user->setFax($this->form_gui->getInput(
'fax'));
717 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
722 $user->setEmail($this->form_gui->getInput(
'email'));
727 $user->setHobby($this->form_gui->getInput(
'hobby'));
732 $user->setComment($this->form_gui->getInput(
'referral_comment'));
736 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
737 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
738 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
741 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
745 $user->setInstantMessengerId(
'icq', $this->form_gui->getInput(
'im_icq'));
746 $user->setInstantMessengerId(
'yahoo', $this->form_gui->getInput(
'im_yahoo'));
747 $user->setInstantMessengerId(
'msn', $this->form_gui->getInput(
'im_msn'));
748 $user->setInstantMessengerId(
'aim', $this->form_gui->getInput(
'im_aim'));
749 $user->setInstantMessengerId(
'skype', $this->form_gui->getInput(
'im_skype'));
750 $user->setInstantMessengerId(
'jabber', $this->form_gui->getInput(
'im_jabber'));
751 $user->setInstantMessengerId(
'voip', $this->form_gui->getInput(
'im_voip'));
756 $user->setDelicious($this->form_gui->getInput(
'delicious'));
759 $user->setLatitude($this->form_gui->getInput(
'latitude'));
760 $user->setLongitude($this->form_gui->getInput(
'longitude'));
761 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
764 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
765 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
767 if((
int) $user->getActive() != (int) $this->form_gui->getInput(
'active'))
769 $user->setActive($this->form_gui->getInput(
'active'), $ilUser->getId());
784 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
786 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
793 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
795 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
801 unset(
$_POST[
'approve_date']);
802 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
803 unset(
$_POST[
'last_login']);
806 $profileMaybeIncomplete =
false;
807 if($this->form_gui->getInput(
'ignore_rf',
false))
812 if ($this->form_gui->checkInput())
817 && trim(
$_POST[
'passwd']) !=
"")
826 if(
$_POST[
'active'] == 1 )
831 #$this->object->assignData($_POST); 835 foreach(
$_POST as $k => $v)
837 if (substr($k, 0, 4) ==
"udf_")
839 $udf[substr($k, 4)] = $v;
842 $this->
object->setUserDefinedData($udf);
846 $this->
object->updateLogin(
$_POST[
'login']);
851 $this->form_gui->setValuesByPost();
852 return $tpl->setContent($this->form_gui->getHtml());
855 $this->
object->setTitle($this->object->getFullname());
856 $this->
object->setDescription($this->object->getEmail());
860 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
863 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
878 $sknst = explode(
":",
$_POST[
"skin_style"]);
880 if ($this->object->getPref(
"style") != $sknst[1] ||
881 $this->
object->getPref(
"skin") != $sknst[0])
883 $this->
object->setPref(
"skin", $sknst[0]);
884 $this->
object->setPref(
"style", $sknst[1]);
889 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
893 $this->
object->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
897 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
902 $this->
object->setLastPasswordChangeTS( time() );
905 if((
int)$ilSetting->get(
'session_reminder_enabled'))
907 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
911 $this->
object->setProfileIncomplete(
false );
913 $this->update = $this->
object->update();
918 if ($ilUser->getId() == $this->
object->getId())
920 $ilUser->readPrefs();
922 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
923 $ilUser->writePrefs();
926 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
934 if( $profileMaybeIncomplete )
936 include_once
'Services/User/classes/class.ilUserProfile.php';
939 $this->
object->setProfileIncomplete(
true );
940 $this->
object->update();
947 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
949 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
953 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
958 $this->form_gui->setValuesByPost();
959 $tpl->setContent($this->form_gui->getHtml());
973 $data[
"auth_mode"] = $this->
object->getAuthMode();
974 $data[
"login"] = $this->
object->getLogin();
977 $data[
"ext_account"] = $this->
object->getExternalAccount();
980 require_once
'./Services/Utilities/classes/class.ilFormat.php';
983 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
986 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
989 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
992 $data[
"active"] = $this->
object->getActive();
993 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
995 $from =
new ilDateTime($this->object->getTimeLimitFrom() ? $this->
object->getTimeLimitFrom() : time(),
IL_CAL_UNIX);
996 $data[
"time_limit_from"][
"date"] = $from->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
997 $data[
"time_limit_from"][
"time"] = $from->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
999 $until =
new ilDateTime($this->object->getTimeLimitUntil() ? $this->
object->getTimeLimitUntil() : time(),
IL_CAL_UNIX);
1000 $data[
'time_limit_until'][
'date'] = $until->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
1001 $data[
'time_limit_until'][
'time'] = $until->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
1005 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1034 $data[
"gender"] = $this->
object->getGender();
1035 $data[
"firstname"] = $this->
object->getFirstname();
1036 $data[
"lastname"] = $this->
object->getLastname();
1037 $data[
"title"] = $this->
object->getUTitle();
1038 $data[
'birthday'] = $this->
object->getBirthday();
1039 $data[
"institution"] = $this->
object->getInstitution();
1040 $data[
"department"] = $this->
object->getDepartment();
1041 $data[
"street"] = $this->
object->getStreet();
1042 $data[
"city"] = $this->
object->getCity();
1043 $data[
"zipcode"] = $this->
object->getZipcode();
1044 $data[
"country"] = $this->
object->getCountry();
1045 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1046 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1047 $data[
"phone_home"] = $this->
object->getPhoneHome();
1048 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1049 $data[
"fax"] = $this->
object->getFax();
1050 $data[
"email"] = $this->
object->getEmail();
1051 $data[
"hobby"] = $this->
object->getHobby();
1052 $data[
"referral_comment"] = $this->
object->getComment();
1055 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1056 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1057 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1060 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1061 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1062 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1063 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1064 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1065 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1066 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1069 $data[
"matriculation"] = $this->
object->getMatriculation();
1070 $data[
"delicious"] = $this->
object->getDelicious();
1071 $data[
"client_ip"] = $this->
object->getClientIP();
1074 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1076 $user_defined_data = $this->
object->getUserDefinedData();
1077 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1079 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1083 $data[
"language"] = $this->
object->getLanguage();
1084 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1085 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1086 $data[
"show_users_online"] = $this->
object->prefs[
"show_users_online"];
1087 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1088 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1090 $this->form_gui->setValuesByArray($data);
1100 $settings = $ilSetting->getAll();
1102 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1105 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1106 if ($a_mode ==
"create")
1108 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1112 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1117 $sec_l->setTitle($lng->txt(
"login_data"));
1118 $this->form_gui->addItem($sec_l);
1121 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1125 foreach ($active_auth_modes as $auth_name => $auth_key)
1127 if ($auth_name ==
'default')
1133 $name = $this->lng->txt(
'auth_'.$auth_name);
1135 $option[$auth_name] = $name;
1138 $this->form_gui->addItem($am);
1140 if($a_mode ==
"edit")
1143 $id->
setValue($this->object->getId());
1144 $this->form_gui->addItem($id);
1150 if ($a_mode ==
"edit")
1152 $lo->setCurrentUserId($this->object->getId());
1155 include_once
'Services/Calendar/classes/class.ilDate.php';
1160 $this->lng->txt(
'usr_loginname_history_info'),
1162 $last_history_entry[0]
1169 $this->form_gui->addItem($lo);
1177 $pw->setMaxLength(32);
1178 $pw->setValidateAuthPost(
"auth_mode");
1179 if ($a_mode ==
"create")
1181 $pw->setRequiredOnAuth(
true);
1184 $this->form_gui->addItem($pw);
1189 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1192 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1194 $ext->setMaxLength(250);
1195 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1196 $this->form_gui->addItem($ext);
1201 $sec_si->setTitle($this->lng->txt(
"system_information"));
1202 $this->form_gui->addItem($sec_si);
1205 if ($a_mode ==
"edit")
1207 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1211 $this->form_gui->addItem($siai);
1218 $this->form_gui->addItem($ac);
1221 $lng->loadLanguageModule(
'crs');
1226 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1227 $radg->addOption($op1);
1228 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1229 $radg->addOption($op2);
1239 $op2->addSubItem($acfrom);
1245 $op2->addSubItem($acto);
1248 $this->form_gui->addItem($radg);
1250 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1253 $lng->loadLanguageModule(
"file");
1256 $quota_head->setTitle($lng->txt(
"repository_disk_quota"));
1257 $this->form_gui->addItem($quota_head);
1260 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1262 $disk_quota->setMaxLength(11);
1263 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1264 $this->form_gui->addItem($disk_quota);
1266 if ($a_mode ==
"edit")
1269 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1271 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1273 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1276 $dq_info[
'role_title']);
1278 else if (is_infinite($dq_info[
'role_disk_quota']))
1280 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1284 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1286 $dq_info[
'role_title']);
1288 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1294 if ($du_info[
'last_update'] === null)
1296 $disk_usage->
setValue($lng->txt(
'unknown'));
1300 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1302 $info =
'<table class="il_user_quota_disk_usage_overview">';
1304 foreach ($du_info[
'details'] as $detail_data)
1307 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1308 '<td class="std">'.$lng->txt($detail_data[
'type']).
'</td>'.
1309 '<td class="std">'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1313 $info .=
'</table>';
1314 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
1316 $disk_usage->setInfo($info);
1319 $this->form_gui->addItem($disk_usage);
1322 if (
true || $dq_info[
'last_reminder'])
1328 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1329 $this->form_gui->addItem($reminder);
1336 $lng->loadLanguageModule(
"file");
1339 $quota_head->setTitle($lng->txt(
"personal_workspace_disk_quota"));
1340 $this->form_gui->addItem($quota_head);
1343 $wsp_disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"wsp_disk_quota");
1345 $wsp_disk_quota->setMaxLength(11);
1346 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1347 $this->form_gui->addItem($wsp_disk_quota);
1349 if ($a_mode ==
"edit")
1352 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1354 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota'])
1356 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1359 $dq_info[
'role_title']);
1361 else if (is_infinite($dq_info[
'role_wsp_disk_quota']))
1363 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1367 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1369 $dq_info[
'role_title']);
1371 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1375 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1378 if (!
sizeof($du_info))
1380 $disk_usage->
setValue($lng->txt(
'unknown'));
1384 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1386 $info =
'<table class="il_user_quota_disk_usage_overview">';
1388 foreach ($du_info as $detail_data)
1391 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1392 '<td class="std">'.$lng->txt(
"obj_".$detail_data[
"src_type"]).
'</td>'.
1393 '<td class="std">'.ilFormat::formatSize($detail_data[
'filesize'],
'short').
'</td>'.
1397 $info .=
'</table>';
1398 $disk_usage->setInfo($info);
1401 $this->form_gui->addItem($disk_usage);
1415 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1416 $this->form_gui->addItem($sec_pd);
1423 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1425 $gndr->addOption($female);
1427 $gndr->addOption($male);
1428 $this->form_gui->addItem($gndr);
1432 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1433 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1434 foreach($fields as $field => $req)
1440 $inp->setMaxLength(32);
1441 $inp->setRequired($req);
1442 $this->form_gui->addItem($inp);
1450 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1455 $this->form_gui->addItem($pi);
1461 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1462 $birthday->setShowEmpty(
true);
1463 $birthday->setStartYear(1900);
1464 $this->form_gui->addItem($birthday);
1471 array(
"institution", 40, 80),
1472 array(
"department", 40, 80),
1473 array(
"street", 40, 40),
1474 array(
"city", 40, 40),
1475 array(
"zipcode", 10, 10),
1476 array(
"country", 40, 40),
1477 array(
"sel_country"),
1478 array(
"phone_office", 30, 30),
1479 array(
"phone_home", 30, 30),
1480 array(
"phone_mobile", 30, 30),
1481 array(
"fax", 30, 30));
1484 foreach ($fields as $field)
1490 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1491 $this->form_gui->addItem($sec_cd);
1495 if ($field[0] !=
"sel_country")
1499 $inp->setMaxLength($field[2]);
1500 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1501 $settings[
"require_".$field[0]]);
1502 $this->form_gui->addItem($inp);
1507 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1509 $cs->
setRequired(isset($settings[
"require_".$field[0]]) &&
1510 $settings[
"require_".$field[0]]);
1511 $this->form_gui->addItem($cs);
1520 $em->
setRequired(isset($settings[
"require_email"]) &&
1521 $settings[
"require_email"]);
1522 $this->form_gui->addItem($em);
1531 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1532 $settings[
"require_hobby"]);
1533 $this->form_gui->addItem($hob);
1542 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1543 $settings[
"require_referral_comment"]);
1544 $this->form_gui->addItem($rc);
1551 $sh->setTitle($lng->txt(
"interests"));
1552 $this->form_gui->addItem($sh);
1554 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1555 foreach($multi_fields as $multi_field)
1562 $ti->setMaxLength(40);
1564 $ti->setRequired(isset($settings[
"require_".$multi_field]) &&
1565 $settings[
"require_".$multi_field]);
1566 $this->form_gui->addItem($ti);
1575 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1576 $this->form_gui->addItem($sec_im);
1580 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1581 foreach ($fields as $field)
1587 $im->setMaxLength(40);
1588 $this->form_gui->addItem($im);
1596 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1597 $this->form_gui->addItem($sec_oi);
1603 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1605 $mr->setMaxLength(40);
1606 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1607 $settings[
"require_matriculation"]);
1608 $this->form_gui->addItem($mr);
1616 $mr->setMaxLength(40);
1617 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1618 $settings[
"require_delicious"]);
1619 $this->form_gui->addItem($mr);
1625 $ip->setMaxLength(255);
1626 $ip->setInfo($this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
" <br />".
1627 '<span class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1628 $this->form_gui->addItem($ip);
1631 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1636 $all_defs = $user_defined_fields->getDefinitions();
1640 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1643 foreach($all_defs as $field_id => $definition)
1648 "udf_".$definition[
'field_id']);
1650 $udf->setMaxLength(255);
1655 "udf_".$definition[
'field_id']);
1656 $udf->setUseRte(
true);
1661 "udf_".$definition[
'field_id']);
1662 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1663 $definition[
'field_values']));
1665 $udf->setRequired($definition[
'required']);
1666 $this->form_gui->addItem($udf);
1671 $a_mode ==
'create' or
1679 $sec_st->setTitle($this->lng->txt(
"settings"));
1680 $this->form_gui->addItem($sec_st);
1684 if ($a_mode ==
"create")
1689 $role->setValue($this->default_role);
1690 $role->setOptions($this->selectable_roles);
1691 $this->form_gui->addItem($role);
1699 $languages = $lng->getInstalledLanguages();
1700 $lng->loadLanguageModule(
"meta");
1702 foreach($languages as $l)
1704 $options[$l] = $lng->txt(
"meta_l_".$l);
1707 $lang->setValue($ilSetting->get(
"language"));
1708 $this->form_gui->addItem(
$lang);
1716 $templates = $styleDefinition->getAllTemplates();
1718 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1721 if (count($templates) > 0 && is_array ($templates))
1723 foreach ($templates as $template)
1726 $styleDef->startParsing();
1727 $styles = $styleDef->getStyles();
1728 foreach ($styles as $style)
1734 $options[$template[
"id"].
":".$style[
"id"]] =
1735 $styleDef->getTemplateName().
" / ".$style[
"name"];
1740 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1741 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1743 $this->form_gui->addItem($sk);
1751 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1752 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1753 $hpp->setOptions($options);
1754 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1755 $this->form_gui->addItem($hpp);
1759 'show_users_online');
1761 "y" => $lng->txt(
"users_online_show_y"),
1762 "associated" => $lng->txt(
"users_online_show_associated"),
1763 "n" => $lng->txt(
"users_online_show_n"));
1765 $uo->setValue($ilSetting->get(
"show_users_online"));
1766 $this->form_gui->addItem($uo);
1772 $os =
new ilCheckboxInputGUI($lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1773 $this->form_gui->addItem($os);
1776 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1778 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1780 $this->form_gui->addItem($cb);
1787 $sec_op->setTitle($this->lng->txt(
"options"));
1788 $this->form_gui->addItem($sec_op);
1793 $se->
setInfo($lng->txt(
'inform_user_mail_info'));
1795 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1796 $this->form_gui->addItem($se);
1800 $irf->
setInfo($lng->txt(
'ignore_required_fields_info'));
1802 $this->form_gui->addItem($irf);
1807 if ($a_mode ==
"create" || $a_mode ==
"save")
1809 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1811 if ($a_mode ==
"edit" || $a_mode ==
"update")
1813 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1815 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1831 static $settings = null;
1840 if($settings == NULL)
1842 $settings = $ilSetting->getAll();
1844 return (
bool) $settings[
'usr_settings_changeable_lua_'.$a_field];
1860 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1862 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
1869 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1871 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
1875 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1877 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
1879 if ($userfile_input->getDeletionFlag())
1881 $this->
object->removeUserPicture();
1885 if ($_FILES[
"userfile"][
"size"] == 0)
1892 $image_dir = $webspace_dir.
"/usr_images";
1893 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
1896 $this->
object->setPref(
"profile_image", $store_file);
1897 $this->
object->update();
1900 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
"pic";
1902 $uploaded_file,
false))
1905 $this->ctrl->redirect($this,
"showProfile");
1907 chmod($uploaded_file, 0770);
1911 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
1912 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
1913 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
1914 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
1923 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:".$show_file);
1924 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:".$thumb_file);
1925 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:".$xthumb_file);
1926 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:".$xxthumb_file);
1930 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
1931 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
1932 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
1933 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
1944 $image_dir = $webspace_dir.
"/usr_images";
1945 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
1946 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
1947 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
1948 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
1949 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
1952 $this->
object->setPref(
"profile_image",
"");
1953 $this->
object->update();
1956 if (@is_file(
$file))
1960 if (@is_file($thumb_file))
1962 unlink($thumb_file);
1964 if (@is_file($xthumb_file))
1966 unlink($xthumb_file);
1968 if (@is_file($xxthumb_file))
1970 unlink($xxthumb_file);
1972 if (@is_file($upload_file))
1974 unlink($upload_file);
2220 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2223 $settings = $ilias->getAllSettings();
2226 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2228 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
2235 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2237 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
2241 foreach (
$_POST[
"Fobject"] as $key => $val)
2247 foreach ($settings as $key => $val)
2249 $field = substr($key,8);
2256 $require_keys[] = $field;
2260 $require_keys[] = $field;
2266 foreach ($require_keys as $key => $val)
2269 $system_fields = array(
"default_role");
2270 if (!in_array($val, $system_fields))
2272 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2274 if (empty(
$_POST[
"Fobject"][$val]))
2276 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2277 $this->lng->txt($val),$this->
ilias->error_obj->MESSAGE);
2285 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->
ilias->error_obj->MESSAGE);
2288 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2291 $this->
ilias->raiseError($this->lng->txt(
"login_invalid"),$this->
ilias->error_obj->MESSAGE);
2297 $this->
ilias->raiseError($this->lng->txt(
"login_exists"),$this->
ilias->error_obj->MESSAGE);
2302 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2303 !strlen($this->object->getPasswd()))
2305 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2306 $this->lng->txt(
'password'),$this->
ilias->error_obj->MESSAGE);
2309 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2311 $this->
ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->
ilias->error_obj->MESSAGE);
2317 $this->
ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->
ilias->error_obj->MESSAGE);
2323 $_POST[
'Fobject'][
'passwd'] =
"********";
2327 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2329 $this->
ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->
ilias->error_obj->MESSAGE);
2332 if(
$_POST[
'Fobject'][
'ext_account'] &&
2335 if($elogin != $this->object->getLogin())
2337 $this->
ilias->raiseError(
2338 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2339 $_POST[
"Fobject"][
"ext_account"],
2340 $_POST[
'Fobject'][
'auth_mode'],
2342 $this->
ilias->error_obj->MESSAGE);
2348 include_once (
'./Services/User/classes/class.ilObjUser.php');
2354 $this->
ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->
ilias->error_obj->MESSAGE);
2361 if (!
$_POST[
"time_limit"][
"unlimited"] and
2364 $this->
ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->
ilias->error_obj->MESSAGE);
2367 if(!$this->
ilias->account->getTimeLimitUnlimited())
2369 if($start < $this->
ilias->account->getTimeLimitFrom() or
2370 $end > $this->
ilias->account->getTimeLimitUntil() or
2371 $_POST[
'time_limit'][
'unlimited'])
2385 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
2387 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
2391 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
2392 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
2393 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
2395 $_POST[
'Fobject'][
'time_limit_message'] = 0;
2399 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
2402 $this->
object->assignData(
$_POST[
"Fobject"]);
2403 $this->
object->setUserDefinedData(
$_POST[
'udf']);
2407 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
2412 $this->form_gui->setValuesByPost();
2413 return $tpl->setContent($this->form_gui->getHtml());
2416 $this->
object->setTitle($this->object->getFullname());
2417 $this->
object->setDescription($this->object->getEmail());
2418 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
2421 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
2423 if ($this->object->getPref(
"style") != $sknst[1] ||
2424 $this->
object->getPref(
"skin") != $sknst[0])
2426 $this->
object->setPref(
"skin", $sknst[0]);
2427 $this->
object->setPref(
"style", $sknst[1]);
2431 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
2433 $this->
object->setPref(
"show_users_online",
$_POST[
"Fobject"][
"show_users_online"]);
2435 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
2436 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
2439 $this->
object->setPref(
"hide_own_online_status",
"n");
2442 $this->update = $this->
object->update();
2447 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
2448 $ilUser->writePrefs();
2452 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
2457 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2459 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
2463 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2476 global $rbacsystem, $rbacadmin, $rbacreview;
2478 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2480 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->
ilias->error_obj->MESSAGE);
2483 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
2484 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
2487 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
2489 array_push($selected_roles,SYSTEM_ROLE_ID);
2492 $global_roles_all = $rbacreview->getGlobalRoles();
2493 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
2494 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
2495 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
2496 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
2497 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
2499 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
2500 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
2504 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
2505 $this->ctrl->redirect($this,
'roleassignment');
2508 foreach (array_diff($assigned_roles,$selected_roles) as $role)
2510 $rbacadmin->deassignUser($role,$this->object->getId());
2513 foreach (array_diff($selected_roles,$assigned_roles) as $role)
2515 $rbacadmin->assignUser($role,$this->object->getId(),
false);
2518 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
2521 $this->
object->update();
2525 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2527 $this->ctrl->redirect($this,
'roleassignment');
2531 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2543 global $rbacreview,$rbacsystem,
$ilUser, $ilTabs;
2545 $ilTabs->activateTab(
"role_assignment");
2547 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2549 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->
ilias->error_obj->MESSAGE);
2559 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
2563 $this->tpl->setCurrentBlock(
"filter");
2564 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
2566 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
2567 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
2568 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
2569 $this->tpl->parseCurrentBlock();
2573 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2577 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
2578 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
2582 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
2585 foreach ($role_list as $role)
2588 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2591 if ($rbacreview->isDeleted($rolf[0]))
2599 if ($this->tree->isInTree($rolf[0]))
2601 if ($rolf[0] == ROLE_FOLDER_ID)
2603 $path = $this->lng->txt(
"global");
2607 $tmpPath = $this->tree->getPathFull($rolf[0]);
2620 $path = $tmpPath[count($tmpPath)-1][
"title"];
2625 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
2631 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
2632 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
2638 if($role[
'obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
2640 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
2647 if (substr($role[
"title"],0,3) ==
"il_")
2651 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2652 $rolf2 = $rolf_arr[0];
2659 $parent_node = $this->tree->getNodeData($rolf2);
2661 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
2664 $role_ids[$counter] = $role[
"obj_id"];
2666 $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"].
"\"/>";
2667 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2668 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2669 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
2671 $result_set[$counter][] = $role[
"description"];
2674 if ($role[
"role_type"] ==
"local") {
2682 foreach ($ref_ids as
$ref_id) {}
2684 require_once(
"./Services/Link/classes/class.ilLink.php");
2690 $result_set[$counter][] =
$path;
2694 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
2695 "context" => $context,
"checkbox" => $checkbox,
2696 "role" => $link,
"title" => $title);
2703 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2713 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2715 $table_gui->writeFilterToSession();
2716 $table_gui->resetOffset();
2725 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2727 $table_gui->resetOffset();
2728 $table_gui->resetFilter();
2737 for($i=0;$i<=60;$i++)
2739 $days[$i] = $i < 10 ?
"0".$i : $i;
2744 for($i=0;$i<24;$i++)
2746 $days[$i] = $i < 10 ?
"0".$i : $i;
2751 for($i=1;$i<32;$i++)
2753 $days[$i] = $i < 10 ?
"0".$i : $i;
2758 for($i=1;$i<13;$i++)
2760 $month[$i] = $i < 10 ?
"0".$i : $i;
2765 if($a_selected < date(
'Y',time()))
2767 $start = $a_selected;
2771 $start = date(
'Y',time());
2774 for($i = $start;$i < date(
"Y",time()) + 11;++$i)
2784 return mktime($a_time_arr[
"hour"],
2785 $a_time_arr[
"minute"],
2786 $a_time_arr[
"second"],
2787 $a_time_arr[
"month"],
2789 $a_time_arr[
"year"]);
2802 $action[0] = $this->lng->txt(
'assigned_roles');
2803 $action[1] = $this->lng->txt(
'all_roles');
2804 $action[2] = $this->lng->txt(
'all_global_roles');
2805 $action[3] = $this->lng->txt(
'all_local_roles');
2806 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2807 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2814 parent::hitsperpageObject();
2826 $ilLocator->clearItems();
2828 if (
$_GET[
"admin_mode"] ==
"settings")
2830 $this->ctrl->setParameterByClass(
"ilobjsystemfoldergui",
2831 "ref_id", SYSTEM_FOLDER_ID);
2832 $ilLocator->addItem($this->lng->txt(
"administration"),
2833 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2838 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2840 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
2842 elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID)
2844 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2846 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2849 if (
$_GET[
"obj_id"] > 0)
2851 $ilLocator->addItem($this->object->getTitle(),
2852 $this->ctrl->getLinkTarget($this,
"view"));
2869 if(
$_POST[
'send_mail'] !=
'y')
2873 if(!strlen($this->object->getEmail()))
2879 $usr_lang =
new ilLanguage($this->object->getLanguage());
2881 $usr_lang->loadLanguageModule(
'registration');
2883 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2886 $mmail->autoCheck(
false);
2887 $mmail->From($ilUser->getEmail());
2888 $mmail->To($this->object->getEmail());
2891 $subject = $usr_lang->txt(
"profile_changed");
2895 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
2897 $date = $this->
object->getApproveDate();
2899 if((time() - strtotime($date)) < 10)
2901 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
2905 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
2909 if(
$_POST[
'passwd'] !=
'********')
2911 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
2912 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
2913 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
2914 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
2916 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
2917 $body .= $this->
object->getProfileAsString($usr_lang);
2919 $mmail->Subject($subject);
2920 $mmail->Body($body);
2924 return "<br/>".$this->lng->txt(
"mail_sent");
2935 if($a_target == md5(
"usrdelown"))
2937 if($ilUser->getId() != ANONYMOUS_USER_ID &&
2938 $ilUser->hasDeletionFlag())
2940 $ilCtrl->setTargetScript(
"ilias.php");
2941 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2942 $ilCtrl->redirectByClass(array(
"ilpersonaldesktopgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2944 exit(
"This account is not flagged for deletion.");
2947 if (substr($a_target, 0, 1) ==
"n")
2952 $_GET[
"cmd"] =
"view";
2953 $_GET[
"user_id"] = (int) $a_target;
2954 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2955 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2956 include(
"ilias.php");
2970 $profileMaybeIncomplete =
false;
2972 require_once
'Services/User/classes/class.ilUserProfile.php';
2976 $elm = $this->form_gui->getItemByPostVar($fieldName);
2978 if( !$elm )
continue;
2980 if( $elm->getRequired() )
2982 $profileMaybeIncomplete =
true;
2985 $elm->setRequired(
false );
2989 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2991 foreach($user_defined_fields->getDefinitions() as $field_id => $definition)
2993 $elm = $this->form_gui->getItemByPostVar(
'udf_'.$definition[
'field_id']);
2995 if( !$elm )
continue;
2997 if( $elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible'] )
2999 $profileMaybeIncomplete =
true;
3002 $elm->setRequired(
false );
3006 return $profileMaybeIncomplete;
3012 protected function showAcceptedTermsOfService()
3017 $agree_date = $this->form_gui->getItemByPostVar(
'agree_date');
3018 if($agree_date && $agree_date->getValue())
3020 $this->lng->loadLanguageModule(
'tos');
3021 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
3026 if($entity->getId())
3028 $show_agreement_text =
new ilCheckboxInputGUI($this->lng->txt(
'tos_show_signed_text'),
'tos_show_signed_text');
3031 $agreement_lang->
setValue($this->lng->txt(
'meta_l_' . $entity->getIso2LanguageCode()));
3032 $show_agreement_text->addSubItem($agreement_lang);
3034 require_once
'Services/TermsOfService/classes/form/class.ilTermsOfServiceSignedDocumentFormElementGUI.php';
3036 $show_agreement_text->addSubItem($agreement_document);
3037 $agree_date->addSubItem($show_agreement_text);
3040 else if($agree_date)
3042 $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 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.
getAdminTabs(&$tabs_gui)
admin and normal tabs are equal for roles
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
assignSaveObject()
assign users to role
getValues()
Get values from user object and put them into form.
addAdminLocatorItems()
should be overwritten to add object specific items (repository items are preloaded) ...
createObject()
Display user create form.
setValue($a_value)
Set Value.
updateObjectOld()
save user data public
static _getInstance()
Get instance.
handleIgnoredRequiredFields()
Handles ignored required fields by changing the required flag of form elements.
loadValuesFromForm($a_mode='create')
_lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
uploadUserPictureObject()
upload user image
static _isActive()
Static getter.
removeUserPictureObject()
remove user image
_getTranslation($a_role_title)
static _lookupPersonalWorkspaceDiskQuota($a_user_id)
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
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
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
__unsetSessionVariables()
ilObjUserGUI($a_data, $a_id, $a_call_by_reference=false, $a_prepare_output=true)
Constructor public.
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
Class ilObjectOwnershipManagementGUI.
static _resetLoginAttempts($a_usr_id)
static _getAuthModeName($a_auth_key)
static isPassword($a_passwd, &$customError=null)
validates a password public
const LP_CONTEXT_USER_FOLDER
static _isPersonalWorkspaceActive()
Static getter.
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 _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
static _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.
static _enabledLearningProgress()
check wether learing progress is enabled or not
__checkUserDefinedRequiredFields()
display user create form
getTabs(&$tabs_gui)
get tabs
static execConvert($args)
execute convert command
if(!is_array($argv)) $options
this class encapsulates the PHP mail() function.
__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)
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.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
redirection script todo: (a better solution should control the processing via a xml file) ...
_lookupLogin($a_user_id)
lookup login
initForm($a_mode)
Init user form.
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
_getAuthMode($a_auth_mode, $a_db_handler='')
static _isExternalAccountEnabled()
Check if an external account name is required.
get($a_format, $a_format_str='', $a_tz='')
get formatted date
getObjectOfRole($a_role_id)
Get object id of objects a role is assigned to.
static getFilesizeByOwner($a_owner_id)
Get current storage size for owner.
prepareOutput()
prepare output
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookupDiskUsage($a_user_id)
Gets the disk usage info for the specified user account.
TableGUI class for role assignment in user administration.
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
_getAssignUsersStatus($a_role_id)
static escapeShellArg($a_arg)
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
applyFilterObject()
Apply filter.
This class represents a text area property in a property form.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
loadLanguageModule($a_module)
saveObject()
save user data public
parses the template.xml that defines all styles of the current template
const USER_FOLDER_ID
Class ilObjUserFolder.
setBackTarget($a_text, $a_link)
set back tab target
updateObject()
Update user.
static getWebspaceDir($mode="filesystem")
get webspace directory
static _getInstance()
Get instance of ilSecuritySettings.
Class ilObjUserTrackingGUI.
roleassignmentObject()
display roleassignment panel
static getFilesizeByTypeAndOwner($a_owner_id)
Get current storage size for owner (grouped by type)