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"]);
466 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
470 $userObj->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
472 if((
int)$ilSetting->get(
'session_reminder_enabled'))
474 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
476 $userObj->writePrefs();
479 $rbacadmin->assignUser(
$_POST[
"default_role"],$userObj->getId(),
true);
481 $msg = $this->lng->txt(
"user_added");
483 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
484 $ilUser->writePrefs();
486 $this->
object = $userObj;
493 if( $profileMaybeIncomplete )
495 include_once
'Services/User/classes/class.ilUserProfile.php';
498 $this->
object->setProfileIncomplete(
true );
499 $this->
object->update();
504 if(
$_POST[
'send_mail'] ==
'y')
506 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
508 $acc_mail->useLangVariablesAsFallback(
true);
509 $acc_mail->setUserPassword(
$_POST[
'passwd']);
510 $acc_mail->setUser($userObj);
512 if ($acc_mail->send())
514 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_sent');
519 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_not_sent');
529 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
531 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
535 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
540 $this->form_gui->setValuesByPost();
541 $tpl->setContent($this->form_gui->getHtml());
552 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition,
$ilUser 555 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
558 $settings = $ilias->getAllSettings();
561 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
563 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
570 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
572 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
578 $this->tabs_gui->clearTargets();
584 $this->showAcceptedTermsOfService();
585 $this->tpl->setContent($this->form_gui->getHTML());
611 $user->setTimeLimitUntil($until->get(
IL_CAL_UNIX));
613 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
615 if($a_mode ==
'create')
617 $user->setTimeLimitOwner($this->usrf_ref_id);
623 $bd = $this->form_gui->getInput(
'birthday');
626 $user->setBirthday($bd[
'date']);
630 $user->setBirthday(null);
635 $user->setLogin($this->form_gui->getInput(
'login'));
641 $user->setGender($this->form_gui->getInput(
'gender'));
647 $user->setUTitle($this->form_gui->getInput(
'title'));
653 $user->setFirstname($this->form_gui->getInput(
'firstname'));
658 $user->setLastname($this->form_gui->getInput(
'lastname'));
660 $user->setFullname();
665 $user->setInstitution($this->form_gui->getInput(
'institution'));
671 $user->setDepartment($this->form_gui->getInput(
'department'));
676 $user->setStreet($this->form_gui->getInput(
'street'));
681 $user->setCity($this->form_gui->getInput(
'city'));
686 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
691 $user->setCountry($this->form_gui->getInput(
'country'));
696 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
701 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
706 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
711 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
716 $user->setFax($this->form_gui->getInput(
'fax'));
721 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
726 $user->setEmail($this->form_gui->getInput(
'email'));
731 $user->setHobby($this->form_gui->getInput(
'hobby'));
736 $user->setComment($this->form_gui->getInput(
'referral_comment'));
740 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
741 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
742 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
745 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
749 $user->setInstantMessengerId(
'icq', $this->form_gui->getInput(
'im_icq'));
750 $user->setInstantMessengerId(
'yahoo', $this->form_gui->getInput(
'im_yahoo'));
751 $user->setInstantMessengerId(
'msn', $this->form_gui->getInput(
'im_msn'));
752 $user->setInstantMessengerId(
'aim', $this->form_gui->getInput(
'im_aim'));
753 $user->setInstantMessengerId(
'skype', $this->form_gui->getInput(
'im_skype'));
754 $user->setInstantMessengerId(
'jabber', $this->form_gui->getInput(
'im_jabber'));
755 $user->setInstantMessengerId(
'voip', $this->form_gui->getInput(
'im_voip'));
760 $user->setDelicious($this->form_gui->getInput(
'delicious'));
763 $user->setLatitude($this->form_gui->getInput(
'latitude'));
764 $user->setLongitude($this->form_gui->getInput(
'longitude'));
765 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
768 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
769 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
771 if((
int) $user->getActive() != (int) $this->form_gui->getInput(
'active'))
773 $user->setActive($this->form_gui->getInput(
'active'), $ilUser->getId());
788 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
790 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
797 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
799 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
805 unset(
$_POST[
'approve_date']);
806 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
807 unset(
$_POST[
'last_login']);
810 $profileMaybeIncomplete =
false;
811 if($this->form_gui->getInput(
'ignore_rf',
false))
816 if ($this->form_gui->checkInput())
821 && trim(
$_POST[
'passwd']) !=
"")
830 if(
$_POST[
'active'] == 1 )
835 #$this->object->assignData($_POST); 839 foreach(
$_POST as $k => $v)
841 if (substr($k, 0, 4) ==
"udf_")
843 $udf[substr($k, 4)] = $v;
846 $this->
object->setUserDefinedData($udf);
850 $this->
object->updateLogin(
$_POST[
'login']);
855 $this->form_gui->setValuesByPost();
856 return $tpl->setContent($this->form_gui->getHtml());
859 $this->
object->setTitle($this->object->getFullname());
860 $this->
object->setDescription($this->object->getEmail());
864 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
867 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
882 $sknst = explode(
":",
$_POST[
"skin_style"]);
884 if ($this->object->getPref(
"style") != $sknst[1] ||
885 $this->
object->getPref(
"skin") != $sknst[0])
887 $this->
object->setPref(
"skin", $sknst[0]);
888 $this->
object->setPref(
"style", $sknst[1]);
893 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
901 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
905 $this->
object->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
910 $this->
object->setLastPasswordChangeTS( time() );
913 if((
int)$ilSetting->get(
'session_reminder_enabled'))
915 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
919 $this->
object->setProfileIncomplete(
false );
921 $this->update = $this->
object->update();
926 if ($ilUser->getId() == $this->
object->getId())
928 $ilUser->readPrefs();
930 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
931 $ilUser->writePrefs();
934 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
942 if( $profileMaybeIncomplete )
944 include_once
'Services/User/classes/class.ilUserProfile.php';
947 $this->
object->setProfileIncomplete(
true );
948 $this->
object->update();
955 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
957 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
961 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
966 $this->form_gui->setValuesByPost();
967 $tpl->setContent($this->form_gui->getHtml());
981 $data[
"auth_mode"] = $this->
object->getAuthMode();
982 $data[
"login"] = $this->
object->getLogin();
985 $data[
"ext_account"] = $this->
object->getExternalAccount();
988 require_once
'./Services/Utilities/classes/class.ilFormat.php';
991 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
994 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
997 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
1000 $data[
"active"] = $this->
object->getActive();
1001 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
1003 $from =
new ilDateTime($this->object->getTimeLimitFrom() ? $this->
object->getTimeLimitFrom() : time(),
IL_CAL_UNIX);
1004 $data[
"time_limit_from"][
"date"] = $from->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
1005 $data[
"time_limit_from"][
"time"] = $from->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
1007 $until =
new ilDateTime($this->object->getTimeLimitUntil() ? $this->
object->getTimeLimitUntil() : time(),
IL_CAL_UNIX);
1008 $data[
'time_limit_until'][
'date'] = $until->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
1009 $data[
'time_limit_until'][
'time'] = $until->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
1013 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1042 $data[
"gender"] = $this->
object->getGender();
1043 $data[
"firstname"] = $this->
object->getFirstname();
1044 $data[
"lastname"] = $this->
object->getLastname();
1045 $data[
"title"] = $this->
object->getUTitle();
1046 $data[
'birthday'] = $this->
object->getBirthday();
1047 $data[
"institution"] = $this->
object->getInstitution();
1048 $data[
"department"] = $this->
object->getDepartment();
1049 $data[
"street"] = $this->
object->getStreet();
1050 $data[
"city"] = $this->
object->getCity();
1051 $data[
"zipcode"] = $this->
object->getZipcode();
1052 $data[
"country"] = $this->
object->getCountry();
1053 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1054 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1055 $data[
"phone_home"] = $this->
object->getPhoneHome();
1056 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1057 $data[
"fax"] = $this->
object->getFax();
1058 $data[
"email"] = $this->
object->getEmail();
1059 $data[
"hobby"] = $this->
object->getHobby();
1060 $data[
"referral_comment"] = $this->
object->getComment();
1063 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1064 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1065 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1068 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1069 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1070 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1071 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1072 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1073 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1074 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1077 $data[
"matriculation"] = $this->
object->getMatriculation();
1078 $data[
"delicious"] = $this->
object->getDelicious();
1079 $data[
"client_ip"] = $this->
object->getClientIP();
1082 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1084 $user_defined_data = $this->
object->getUserDefinedData();
1085 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1087 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1091 $data[
"language"] = $this->
object->getLanguage();
1092 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1093 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1095 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1096 $data[
'bs_allow_to_contact_me'] = $this->
object->prefs[
'bs_allow_to_contact_me'] ==
'y';
1097 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1099 $data[
"send_mail"] = ($this->object->prefs[
'send_info_mails'] ==
'y');
1102 $this->form_gui->setValuesByArray($data);
1112 $settings = $ilSetting->getAll();
1114 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1117 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1118 if ($a_mode ==
"create")
1120 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1124 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1129 $sec_l->setTitle($lng->txt(
"login_data"));
1130 $this->form_gui->addItem($sec_l);
1133 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1137 foreach ($active_auth_modes as $auth_name => $auth_key)
1139 if ($auth_name ==
'default')
1146 #$name = $this->lng->txt('auth_'.$auth_name); 1147 include_once
'./Services/Authentication/classes/class.ilAuthUtils.php';
1152 $option[$auth_name] = $name;
1155 $this->form_gui->addItem($am);
1157 if($a_mode ==
"edit")
1160 $id->
setValue($this->object->getId());
1161 $this->form_gui->addItem($id);
1167 if ($a_mode ==
"edit")
1169 $lo->setCurrentUserId($this->object->getId());
1172 include_once
'Services/Calendar/classes/class.ilDate.php';
1177 $this->lng->txt(
'usr_loginname_history_info'),
1179 $last_history_entry[0]
1186 $this->form_gui->addItem($lo);
1194 $pw->setMaxLength(80);
1195 $pw->setValidateAuthPost(
"auth_mode");
1196 if ($a_mode ==
"create")
1198 $pw->setRequiredOnAuth(
true);
1201 $this->form_gui->addItem($pw);
1206 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1209 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1211 $ext->setMaxLength(250);
1212 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1213 $this->form_gui->addItem($ext);
1218 $sec_si->setTitle($this->lng->txt(
"system_information"));
1219 $this->form_gui->addItem($sec_si);
1222 if ($a_mode ==
"edit")
1224 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1228 $this->form_gui->addItem($siai);
1235 $this->form_gui->addItem($ac);
1238 $lng->loadLanguageModule(
'crs');
1243 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1244 $radg->addOption($op1);
1245 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1246 $radg->addOption($op2);
1256 $op2->addSubItem($acfrom);
1262 $op2->addSubItem($acto);
1265 $this->form_gui->addItem($radg);
1267 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1270 $lng->loadLanguageModule(
"file");
1273 $quota_head->setTitle($lng->txt(
"repository_disk_quota"));
1274 $this->form_gui->addItem($quota_head);
1277 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1279 $disk_quota->setMaxLength(11);
1280 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1281 $this->form_gui->addItem($disk_quota);
1283 if ($a_mode ==
"edit")
1286 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1288 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1290 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1293 $dq_info[
'role_title']);
1295 else if (is_infinite($dq_info[
'role_disk_quota']))
1297 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1301 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1303 $dq_info[
'role_title']);
1305 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1311 if ($du_info[
'last_update'] === null)
1313 $disk_usage->
setValue($lng->txt(
'unknown'));
1317 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1319 $info =
'<table class="il_user_quota_disk_usage_overview">';
1321 foreach ($du_info[
'details'] as $detail_data)
1324 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1325 '<td class="std">'.$lng->txt($detail_data[
'type']).
'</td>'.
1326 '<td class="std">'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1330 $info .=
'</table>';
1331 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
1333 $disk_usage->setInfo(
$info);
1336 $this->form_gui->addItem($disk_usage);
1339 if (
true || $dq_info[
'last_reminder'])
1345 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1346 $this->form_gui->addItem($reminder);
1353 $lng->loadLanguageModule(
"file");
1356 $quota_head->setTitle($lng->txt(
"personal_workspace_disk_quota"));
1357 $this->form_gui->addItem($quota_head);
1360 $wsp_disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"wsp_disk_quota");
1362 $wsp_disk_quota->setMaxLength(11);
1363 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1364 $this->form_gui->addItem($wsp_disk_quota);
1366 if ($a_mode ==
"edit")
1369 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1371 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota'])
1373 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1376 $dq_info[
'role_title']);
1378 else if (is_infinite($dq_info[
'role_wsp_disk_quota']))
1380 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1384 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1386 $dq_info[
'role_title']);
1388 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1392 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1395 if (!
sizeof($du_info))
1397 $disk_usage->
setValue($lng->txt(
'unknown'));
1401 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1403 $info =
'<table class="il_user_quota_disk_usage_overview">';
1405 foreach ($du_info as $detail_data)
1408 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1409 '<td class="std">'.$lng->txt(
"obj_".$detail_data[
"src_type"]).
'</td>'.
1410 '<td class="std">'.ilFormat::formatSize($detail_data[
'filesize'],
'short').
'</td>'.
1414 $info .=
'</table>';
1415 $disk_usage->setInfo(
$info);
1418 $this->form_gui->addItem($disk_usage);
1432 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1433 $this->form_gui->addItem($sec_pd);
1440 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1442 $gndr->addOption($female);
1444 $gndr->addOption($male);
1445 $this->form_gui->addItem($gndr);
1449 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1450 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1451 foreach($fields as $field => $req)
1456 $caption = ($field ==
"title")
1461 $inp->setMaxLength(32);
1462 $inp->setRequired($req);
1463 $this->form_gui->addItem($inp);
1471 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1476 $this->form_gui->addItem($pi);
1482 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1483 $birthday->setShowEmpty(
true);
1484 $birthday->setStartYear(1900);
1485 $this->form_gui->addItem($birthday);
1492 array(
"institution", 40, 80),
1493 array(
"department", 40, 80),
1494 array(
"street", 40, 40),
1495 array(
"city", 40, 40),
1496 array(
"zipcode", 10, 10),
1497 array(
"country", 40, 40),
1498 array(
"sel_country"),
1499 array(
"phone_office", 30, 30),
1500 array(
"phone_home", 30, 30),
1501 array(
"phone_mobile", 30, 30),
1502 array(
"fax", 30, 30));
1505 foreach ($fields as $field)
1511 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1512 $this->form_gui->addItem($sec_cd);
1516 if ($field[0] !=
"sel_country")
1520 $inp->setMaxLength($field[2]);
1521 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1522 $settings[
"require_".$field[0]]);
1523 $this->form_gui->addItem($inp);
1528 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1530 $cs->
setRequired(isset($settings[
"require_".$field[0]]) &&
1531 $settings[
"require_".$field[0]]);
1532 $this->form_gui->addItem($cs);
1541 $em->
setRequired(isset($settings[
"require_email"]) &&
1542 $settings[
"require_email"]);
1543 $this->form_gui->addItem($em);
1552 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1553 $settings[
"require_hobby"]);
1554 $this->form_gui->addItem($hob);
1563 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1564 $settings[
"require_referral_comment"]);
1565 $this->form_gui->addItem($rc);
1572 $sh->setTitle($lng->txt(
"interests"));
1573 $this->form_gui->addItem($sh);
1575 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1576 foreach($multi_fields as $multi_field)
1583 $ti->setMaxLength(40);
1585 $ti->setRequired(isset($settings[
"require_".$multi_field]) &&
1586 $settings[
"require_".$multi_field]);
1587 $this->form_gui->addItem($ti);
1596 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1597 $this->form_gui->addItem($sec_im);
1601 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1602 foreach ($fields as $field)
1607 $im->
setRequired(isset($settings[
"require_instant_messengers"]) && $settings[
"require_instant_messengers"]);
1609 $im->setMaxLength(40);
1610 $this->form_gui->addItem($im);
1618 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1619 $this->form_gui->addItem($sec_oi);
1625 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1627 $mr->setMaxLength(40);
1628 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1629 $settings[
"require_matriculation"]);
1630 $this->form_gui->addItem($mr);
1638 $mr->setMaxLength(40);
1639 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1640 $settings[
"require_delicious"]);
1641 $this->form_gui->addItem($mr);
1647 $ip->setMaxLength(255);
1648 $ip->setInfo($this->lng->txt(
"current_ip").
" ".
$_SERVER[
"REMOTE_ADDR"].
" <br />".
1649 '<span class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1650 $this->form_gui->addItem($ip);
1653 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1658 $all_defs = $user_defined_fields->getDefinitions();
1662 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1665 foreach($all_defs as $field_id => $definition)
1670 "udf_".$definition[
'field_id']);
1672 $udf->setMaxLength(255);
1677 "udf_".$definition[
'field_id']);
1678 $udf->setUseRte(
true);
1683 "udf_".$definition[
'field_id']);
1684 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1685 $definition[
'field_values']));
1687 $udf->setRequired($definition[
'required']);
1688 $this->form_gui->addItem($udf);
1693 $a_mode ==
'create' or
1702 $sec_st->setTitle($this->lng->txt(
"settings"));
1703 $this->form_gui->addItem($sec_st);
1707 if ($a_mode ==
"create")
1712 $role->setValue($this->default_role);
1713 $role->setOptions($this->selectable_roles);
1714 $this->form_gui->addItem($role);
1722 $languages = $lng->getInstalledLanguages();
1723 $lng->loadLanguageModule(
"meta");
1725 foreach($languages as
$l)
1730 $lang->setValue($ilSetting->get(
"language"));
1731 $this->form_gui->addItem(
$lang);
1739 $templates = $styleDefinition->getAllTemplates();
1741 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1744 if (count($templates) > 0 && is_array ($templates))
1746 foreach ($templates as $template)
1749 $styleDef->startParsing();
1750 $styles = $styleDef->getStyles();
1751 foreach ($styles as
$style)
1757 $options[$template[
"id"].
":".$style[
"id"]] =
1758 $styleDef->getTemplateName().
" / ".$style[
"name"];
1763 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1764 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1766 $this->form_gui->addItem($sk);
1774 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1775 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1776 $hpp->setOptions($options);
1777 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1778 $this->form_gui->addItem($hpp);
1795 $lng->loadLanguageModule(
"awrn");
1796 $os =
new ilCheckboxInputGUI($lng->txt(
"awrn_hide_from_awareness"),
"hide_own_online_status");
1797 $this->form_gui->addItem($os);
1803 $lng->loadLanguageModule(
'buddysystem');
1804 $os =
new ilCheckboxInputGUI($lng->txt(
'buddy_allow_to_contact_me'),
'bs_allow_to_contact_me');
1805 $this->form_gui->addItem($os);
1808 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1810 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1812 $this->form_gui->addItem($cb);
1819 $sec_op->setTitle($this->lng->txt(
"options"));
1820 $this->form_gui->addItem($sec_op);
1825 $se->
setInfo($lng->txt(
'inform_user_mail_info'));
1827 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1828 $this->form_gui->addItem($se);
1832 $irf->
setInfo($lng->txt(
'ignore_required_fields_info'));
1834 $this->form_gui->addItem($irf);
1839 if ($a_mode ==
"create" || $a_mode ==
"save")
1841 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1843 if ($a_mode ==
"edit" || $a_mode ==
"update")
1845 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1847 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1863 static $settings = null;
1872 if($settings == NULL)
1874 $settings = $ilSetting->getAll();
1876 return (
bool) $settings[
'usr_settings_changeable_lua_'.$a_field];
1892 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1894 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
1901 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1903 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
1907 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1909 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
1911 if ($userfile_input->getDeletionFlag())
1913 $this->
object->removeUserPicture();
1917 if ($_FILES[
"userfile"][
"size"] == 0)
1924 $image_dir = $webspace_dir.
"/usr_images";
1925 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
1928 $this->
object->setPref(
"profile_image", $store_file);
1929 $this->
object->update();
1932 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1933 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
".".$pi[
"extension"];
1935 $uploaded_file,
false))
1938 $this->ctrl->redirect($this,
"showProfile");
1940 chmod($uploaded_file, 0770);
1944 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
1945 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
1946 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
1947 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
1956 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:".$show_file);
1957 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:".$thumb_file);
1958 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:".$xthumb_file);
1959 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:".$xxthumb_file);
1963 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
1964 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
1965 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
1966 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
1977 $image_dir = $webspace_dir.
"/usr_images";
1978 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
1979 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
1980 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
1981 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
1982 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
1985 $this->
object->setPref(
"profile_image",
"");
1986 $this->
object->update();
1989 if (@is_file(
$file))
1993 if (@is_file($thumb_file))
1995 unlink($thumb_file);
1997 if (@is_file($xthumb_file))
1999 unlink($xthumb_file);
2001 if (@is_file($xxthumb_file))
2003 unlink($xxthumb_file);
2005 if (@is_file($upload_file))
2007 unlink($upload_file);
2253 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2256 $settings = $ilias->getAllSettings();
2259 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2261 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
2268 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2270 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->
ilias->error_obj->MESSAGE);
2274 foreach (
$_POST[
"Fobject"] as $key => $val)
2280 foreach ($settings as $key => $val)
2282 $field = substr($key,8);
2289 $require_keys[] = $field;
2293 $require_keys[] = $field;
2299 foreach ($require_keys as $key => $val)
2302 $system_fields = array(
"default_role");
2303 if (!in_array($val, $system_fields))
2305 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2307 if (empty(
$_POST[
"Fobject"][$val]))
2309 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2310 $this->lng->txt($val),$this->
ilias->error_obj->MESSAGE);
2318 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->
ilias->error_obj->MESSAGE);
2321 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2324 $this->
ilias->raiseError($this->lng->txt(
"login_invalid"),$this->
ilias->error_obj->MESSAGE);
2330 $this->
ilias->raiseError($this->lng->txt(
"login_exists"),$this->
ilias->error_obj->MESSAGE);
2335 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2336 !strlen($this->object->getPasswd()))
2338 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2339 $this->lng->txt(
'password'),$this->
ilias->error_obj->MESSAGE);
2342 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2344 $this->
ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->
ilias->error_obj->MESSAGE);
2350 $this->
ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->
ilias->error_obj->MESSAGE);
2356 $_POST[
'Fobject'][
'passwd'] =
"********";
2360 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2362 $this->
ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->
ilias->error_obj->MESSAGE);
2365 if(
$_POST[
'Fobject'][
'ext_account'] &&
2368 if($elogin != $this->object->getLogin())
2370 $this->
ilias->raiseError(
2371 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2372 $_POST[
"Fobject"][
"ext_account"],
2373 $_POST[
'Fobject'][
'auth_mode'],
2375 $this->
ilias->error_obj->MESSAGE);
2381 include_once (
'./Services/User/classes/class.ilObjUser.php');
2387 $this->
ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->
ilias->error_obj->MESSAGE);
2394 if (!
$_POST[
"time_limit"][
"unlimited"] and
2397 $this->
ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->
ilias->error_obj->MESSAGE);
2400 if(!$this->
ilias->account->getTimeLimitUnlimited())
2402 if($start < $this->
ilias->account->getTimeLimitFrom() or
2403 $end > $this->
ilias->account->getTimeLimitUntil() or
2404 $_POST[
'time_limit'][
'unlimited'])
2418 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
2420 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
2424 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
2425 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
2426 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
2428 $_POST[
'Fobject'][
'time_limit_message'] = 0;
2432 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
2435 $this->
object->assignData(
$_POST[
"Fobject"]);
2436 $this->
object->setUserDefinedData(
$_POST[
'udf']);
2440 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
2445 $this->form_gui->setValuesByPost();
2446 return $tpl->setContent($this->form_gui->getHtml());
2449 $this->
object->setTitle($this->object->getFullname());
2450 $this->
object->setDescription($this->object->getEmail());
2451 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
2454 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
2456 if ($this->object->getPref(
"style") != $sknst[1] ||
2457 $this->
object->getPref(
"skin") != $sknst[0])
2459 $this->
object->setPref(
"skin", $sknst[0]);
2460 $this->
object->setPref(
"style", $sknst[1]);
2464 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
2468 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
2469 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
2472 $this->
object->setPref(
"hide_own_online_status",
"n");
2475 if(isset(
$_POST[
'Fobject'][
'bs_allow_to_contact_me']) &&
$_POST[
'Fobject'][
'bs_allow_to_contact_me'] == 1)
2477 $this->
object->setPref(
'bs_allow_to_contact_me',
'y');
2481 $this->
object->setPref(
'bs_allow_to_contact_me',
'n');
2484 $this->update = $this->
object->update();
2489 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
2490 $ilUser->writePrefs();
2494 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
2499 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2501 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
2505 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2518 global $rbacsystem, $rbacadmin, $rbacreview;
2520 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2522 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->
ilias->error_obj->MESSAGE);
2525 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
2526 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
2529 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
2531 array_push($selected_roles,SYSTEM_ROLE_ID);
2534 $global_roles_all = $rbacreview->getGlobalRoles();
2535 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
2536 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
2537 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
2538 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
2539 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
2541 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
2542 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
2546 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
2547 $this->ctrl->redirect($this,
'roleassignment');
2550 foreach (array_diff($assigned_roles,$selected_roles) as $role)
2552 $rbacadmin->deassignUser($role,$this->object->getId());
2555 foreach (array_diff($selected_roles,$assigned_roles) as $role)
2557 $rbacadmin->assignUser($role,$this->object->getId(),
false);
2560 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
2563 $this->
object->update();
2567 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2569 $this->ctrl->redirect($this,
'roleassignment');
2573 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2585 global $rbacreview,$rbacsystem,
$ilUser, $ilTabs;
2587 $ilTabs->activateTab(
"role_assignment");
2589 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2591 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->
ilias->error_obj->MESSAGE);
2601 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
2605 $this->tpl->setCurrentBlock(
"filter");
2606 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
2608 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
2609 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
2610 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
2611 $this->tpl->parseCurrentBlock();
2615 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2619 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
2620 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
2624 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
2627 foreach ($role_list as $role)
2630 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2633 if ($rbacreview->isDeleted($rolf[0]))
2641 if ($this->tree->isInTree($rolf[0]))
2643 if ($rolf[0] == ROLE_FOLDER_ID)
2645 $path = $this->lng->txt(
"global");
2649 $tmpPath = $this->tree->getPathFull($rolf[0]);
2662 $path = $tmpPath[count($tmpPath)-1][
"title"];
2667 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
2673 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
2674 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
2680 if($role[
'obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
2682 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
2689 if (substr($role[
"title"],0,3) ==
"il_")
2693 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2694 $rolf2 = $rolf_arr[0];
2701 $parent_node = $this->tree->getNodeData($rolf2);
2703 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
2706 $role_ids[$counter] = $role[
"obj_id"];
2708 $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"].
"\"/>";
2709 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2710 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2711 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
2713 $result_set[$counter][] = $role[
"description"];
2716 if ($role[
"role_type"] ==
"local") {
2724 foreach ($ref_ids as
$ref_id) {}
2726 require_once(
"./Services/Link/classes/class.ilLink.php");
2732 $result_set[$counter][] =
$path;
2736 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
2737 "context" => $context,
"checkbox" => $checkbox,
2738 "role" => $link,
"title" => $title);
2745 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2755 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2757 $table_gui->writeFilterToSession();
2758 $table_gui->resetOffset();
2767 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2769 $table_gui->resetOffset();
2770 $table_gui->resetFilter();
2779 for($i=0;$i<=60;$i++)
2781 $days[$i] = $i < 10 ?
"0".$i : $i;
2786 for($i=0;$i<24;$i++)
2788 $days[$i] = $i < 10 ?
"0".$i : $i;
2793 for($i=1;$i<32;$i++)
2795 $days[$i] = $i < 10 ?
"0".$i : $i;
2800 for($i=1;$i<13;$i++)
2802 $month[$i] = $i < 10 ?
"0".$i : $i;
2807 if($a_selected < date(
'Y',time()))
2809 $start = $a_selected;
2813 $start = date(
'Y',time());
2816 for($i = $start;$i < date(
"Y",time()) + 11;++$i)
2826 return mktime($a_time_arr[
"hour"],
2827 $a_time_arr[
"minute"],
2828 $a_time_arr[
"second"],
2829 $a_time_arr[
"month"],
2831 $a_time_arr[
"year"]);
2844 $action[0] = $this->lng->txt(
'assigned_roles');
2845 $action[1] = $this->lng->txt(
'all_roles');
2846 $action[2] = $this->lng->txt(
'all_global_roles');
2847 $action[3] = $this->lng->txt(
'all_local_roles');
2848 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2849 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2856 parent::hitsperpageObject();
2868 $ilLocator->clearItems();
2870 if (
$_GET[
"admin_mode"] ==
"settings")
2872 $this->ctrl->setParameterByClass(
"ilobjsystemfoldergui",
2873 "ref_id", SYSTEM_FOLDER_ID);
2874 $ilLocator->addItem($this->lng->txt(
"administration"),
2875 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2880 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2882 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
2884 elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID)
2886 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2888 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2891 if (
$_GET[
"obj_id"] > 0)
2893 $ilLocator->addItem($this->object->getTitle(),
2894 $this->ctrl->getLinkTarget($this,
"view"));
2911 if(
$_POST[
'send_mail'] !=
'y')
2915 if(!strlen($this->object->getEmail()))
2921 $usr_lang =
new ilLanguage($this->object->getLanguage());
2923 $usr_lang->loadLanguageModule(
'registration');
2925 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2928 $mmail->autoCheck(
false);
2929 $mmail->From($ilUser->getEmail());
2930 $mmail->To($this->object->getEmail());
2933 $subject = $usr_lang->txt(
"profile_changed");
2937 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
2939 $date = $this->
object->getApproveDate();
2941 if((time() - strtotime($date)) < 10)
2943 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
2947 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
2951 if(
$_POST[
'passwd'] !=
'')
2953 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
2954 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
2955 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
2956 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
2958 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
2959 $body .= $this->
object->getProfileAsString($usr_lang);
2961 $mmail->Subject($subject);
2962 $mmail->Body($body);
2966 return "<br/>".$this->lng->txt(
"mail_sent");
2977 if($a_target == md5(
"usrdelown"))
2979 if($ilUser->getId() != ANONYMOUS_USER_ID &&
2980 $ilUser->hasDeletionFlag())
2982 $ilCtrl->setTargetScript(
"ilias.php");
2983 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2984 $ilCtrl->redirectByClass(array(
"ilpersonaldesktopgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2986 exit(
"This account is not flagged for deletion.");
2989 if (substr($a_target, 0, 1) ==
"n")
2994 if(strpos($a_target,
'contact_approved') !==
false)
2996 $_GET[
'cmd'] =
'approveContactRequest';
2998 else if(strpos($a_target,
'contact_ignored') !==
false)
3000 $_GET[
'cmd'] =
'ignoreContactRequest';
3004 $_GET[
'cmd'] =
'view';
3007 $_GET[
"user_id"] = (int) $a_target;
3008 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
3009 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
3010 include(
"ilias.php");
3024 $profileMaybeIncomplete =
false;
3026 require_once
'Services/User/classes/class.ilUserProfile.php';
3030 $elm = $this->form_gui->getItemByPostVar($fieldName);
3032 if( !$elm )
continue;
3034 if( $elm->getRequired() )
3036 $profileMaybeIncomplete =
true;
3039 $elm->setRequired(
false );
3043 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
3045 foreach($user_defined_fields->getDefinitions() as $field_id => $definition)
3047 $elm = $this->form_gui->getItemByPostVar(
'udf_'.$definition[
'field_id']);
3049 if( !$elm )
continue;
3051 if( $elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible'] )
3053 $profileMaybeIncomplete =
true;
3056 $elm->setRequired(
false );
3060 return $profileMaybeIncomplete;
3066 protected function showAcceptedTermsOfService()
3071 $agree_date = $this->form_gui->getItemByPostVar(
'agree_date');
3072 if($agree_date && $agree_date->getValue())
3074 $this->lng->loadLanguageModule(
'tos');
3075 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
3080 if($entity->getId())
3082 $show_agreement_text =
new ilCheckboxInputGUI($this->lng->txt(
'tos_show_signed_text'),
'tos_show_signed_text');
3085 $agreement_lang->
setValue($this->lng->txt(
'meta_l_' . $entity->getIso2LanguageCode()));
3086 $show_agreement_text->addSubItem($agreement_lang);
3088 require_once
'Services/TermsOfService/classes/form/class.ilTermsOfServiceSignedDocumentFormElementGUI.php';
3090 $show_agreement_text->addSubItem($agreement_document);
3091 $agree_date->addSubItem($show_agreement_text);
3094 else if($agree_date)
3096 $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.
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.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
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) ...
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.
static getAuthModeTranslation($a_auth_key)
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)