4 require_once
"./classes/class.ilObjectGUI.php";
46 function ilObjUserGUI($a_data,$a_id,$a_call_by_reference =
false, $a_prepare_output =
true)
50 define(
'USER_FOLDER_ID',7);
53 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
57 $this->ctrl->saveParameter($this,
'obj_id');
59 $lng->loadLanguageModule(
'user');
63 $this->gender = array(
64 'm' =>
"salutation_m",
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
80 case "illearningprogressgui":
81 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
83 $this->ctrl->forwardCommand($new_gui);
86 case "ilobjilincusergui":
87 include_once
'./Modules/ILinc/classes/class.ilObjiLincUserGUI.php';
89 $this->ctrl->forwardCommand($new_gui);
99 $return = $this->
$cmd();
110 if(strtolower(get_class($this->
object)) ==
'ilobjuser')
112 $this->tpl->setTitle(
'['.$this->object->getLogin().
'] '.$this->
object->getTitle());
113 $this->tpl->setDescription($this->object->getLongDescription());
114 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.gif"), $this->lng->txt(
"obj_" . $this->object->getType()));
126 session_unregister(
"saved_post");
128 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
130 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
136 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
155 $tabs_gui->clearTargets();
159 $tabs_gui->setBackTarget(
160 $this->lng->txt(
"search_results"),
$_SESSION[
"usr_search_link"]);
162 $tabs_gui->addTarget(
"properties",
163 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this),
"",
true);
167 $tabs_gui->addTarget(
"properties",
168 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this));
171 $tabs_gui->addTarget(
"role_assignment",
172 $this->ctrl->getLinkTarget($this,
"roleassignment"), array(
"roleassignment"), get_class($this));
175 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
179 $tabs_gui->addTarget(
'learning_progress',
180 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
182 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
185 if ($this->ilias->getSetting(
"ilinc_active"))
187 $tabs_gui->addTarget(
"extt_ilinc",
188 $this->ctrl->getLinkTargetByClass(
'ilobjilincusergui',
''),
190 array(
'ilobjilincusergui'));
199 $this->back_target = array(
"text" => $a_text,
708 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
711 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
713 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
724 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
727 if($this->object->getType() ==
'usr')
729 $user_defined_data = $this->
object->getUserDefinedData();
731 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
733 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
734 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
738 $this->tpl->setCurrentBlock(
"field_text");
739 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
741 $this->tpl->parseCurrentBlock();
745 $this->tpl->setCurrentBlock(
"field_select");
747 'udf['.$definition[
'field_id'].
']',
748 $this->user_defined_fields->fieldValuesToSelectArray(
749 $definition[
'field_values']),
752 $this->tpl->parseCurrentBlock();
754 $this->tpl->setCurrentBlock(
"user_defined");
756 if($definition[
'required'])
758 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
762 $name = $definition[
'field_name'];
764 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
765 $this->tpl->parseCurrentBlock();
772 global
$tpl, $rbacsystem, $rbacreview, $ilUser;
776 $this->tabs_gui->clearTargets();
780 $obj_list = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
782 foreach ($obj_list as $obj_data)
785 if($this->object->getRefId() !=
USER_FOLDER_ID and !in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
787 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
795 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
798 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
800 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
808 $this->ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"),$this->ilias->error_obj->MESSAGE);
811 $keys = array_keys($rol);
814 if (in_array(4,$keys))
816 $this->default_role = 4;
820 if (count($keys) > 1 and in_array(2,$keys))
823 foreach ($keys as
$key => $val)
833 $this->default_role = array_shift($keys);
835 $this->selectable_roles = $rol;
843 global
$tpl, $rbacsystem, $rbacreview, $ilUser;
845 if (!$rbacsystem->checkAccess(
'create_user', $this->usrf_ref_id) and
846 !$rbacsystem->checkAccess(
'cat_administrate_users',$this->usrf_ref_id))
848 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
853 return $tpl->setContent($this->form_gui->getHtml());
864 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
867 if (!$ilAccess->checkAccess(
'create_user',
"", $this->usrf_ref_id) &&
868 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id))
870 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
876 if ($this->form_gui->checkInput())
888 $until =
new ilDateTime($_POST[
'time_limit_until'][
'date'].
' '.$_POST[
'time_limit_until'][
'time'],
IL_CAL_DATETIME,$ilUser->getTimeZone());
890 if (is_array($_POST[
'birthday']))
893 if ( ((
int) ($_POST[
'birthday'][
'date'][
'd'])) > 0)
895 $_POST[
'birthday'] = $_POST[
'birthday'][
'date'];
899 $_POST[
'birthday'] = null;
902 $userObj->assignData($_POST);
903 $userObj->setTitle($userObj->getFullname());
904 $userObj->setDescription($userObj->getEmail());
906 $userObj->setTimeLimitOwner($this->object->getRefId());
907 $userObj->setTimeLimitUnlimited($_POST[
"time_limit_unlimited"]);
913 foreach($_POST as $k => $v)
915 if (substr($k, 0, 4) ==
"udf_")
917 $udf[substr($k, 4)] = $v;
920 $userObj->setUserDefinedData($udf);
924 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
927 $userObj->setExternalAccount($_POST[
"ext_account"]);
933 $userObj->setLastPasswordChangeTS( time() );
936 $userObj->saveAsNew();
939 $userObj->setLanguage($_POST[
"language"]);
942 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
950 $sknst = explode(
":", $_POST[
"skin_style"]);
952 if ($userObj->getPref(
"style") != $sknst[1] ||
953 $userObj->getPref(
"skin") != $sknst[0])
955 $userObj->setPref(
"skin", $sknst[0]);
956 $userObj->setPref(
"style", $sknst[1]);
959 $userObj->setPref(
"hits_per_page", $_POST[
"hits_per_page"]);
960 $userObj->setPref(
"show_users_online", $_POST[
"show_users_online"]);
961 $userObj->setPref(
"hide_own_online_status", $_POST[
"hide_own_online_status"] ?
'y' :
'n');
962 if((
int)$ilSetting->get(
'session_reminder_enabled'))
964 $userObj->setPref(
'session_reminder_enabled', (
int)$_POST[
'session_reminder_enabled']);
966 $userObj->writePrefs();
969 $rbacadmin->assignUser($_POST[
"default_role"],$userObj->getId(),
true);
971 $msg = $this->lng->txt(
"user_added");
973 $ilUser->setPref(
'send_info_mails', ($_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
974 $ilUser->writePrefs();
976 $this->
object = $userObj;
980 if($_POST[
'send_mail'] ==
'y')
982 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
984 $acc_mail->useLangVariablesAsFallback(
true);
985 $acc_mail->setUserPassword($_POST[
'passwd']);
986 $acc_mail->setUser($userObj);
988 if ($acc_mail->send())
990 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_sent');
995 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_not_sent');
1005 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1007 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
1011 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1016 $this->form_gui->setValuesByPost();
1017 $tpl->setContent($this->form_gui->getHtml());
1028 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition, $ilUser
1031 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1034 $settings = $ilias->getAllSettings();
1037 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1039 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1046 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1048 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1054 $this->tabs_gui->clearTargets();
1060 $this->tpl->setContent($this->form_gui->getHTML());
1071 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
1073 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1080 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1082 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1088 unset(
$_POST[
'approve_date']);
1089 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
1090 unset(
$_POST[
'last_login']);
1092 if ($this->form_gui->checkInput())
1097 || trim(
$_POST[
'passwd']) ==
"")
1099 $_POST[
'passwd'] =
"********";
1104 require_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1106 if( $security_settings->getAccountSecurityMode() ==
1113 if(
$_POST[
'active'] == 1 )
1122 $until =
new ilDateTime($_POST[
'time_limit_until'][
'date'].
' '.$_POST[
'time_limit_until'][
'time'],
IL_CAL_DATETIME,$ilUser->getTimeZone());
1124 $_POST[
'time_limit_owner'] = $this->usrf_ref_id;
1125 if (is_array($_POST[
'birthday']))
1128 if ( ((
int) ($_POST[
'birthday'][
'date'][
'd'])) > 0)
1130 $_POST[
'birthday'] = $_POST[
'birthday'][
'date'];
1134 $_POST[
'birthday'] = null;
1137 $this->
object->assignData($_POST);
1140 foreach($_POST as $k => $v)
1142 if (substr($k, 0, 4) ==
"udf_")
1144 $udf[substr($k, 4)] = $v;
1147 $this->
object->setUserDefinedData($udf);
1151 $this->
object->updateLogin($_POST[
'login']);
1156 $this->form_gui->setValuesByPost();
1157 return $tpl->setContent($this->form_gui->getHtml());
1160 $this->
object->setTitle($this->object->getFullname());
1161 $this->
object->setDescription($this->object->getEmail());
1162 $this->
object->setLanguage($_POST[
"language"]);
1164 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1172 $sknst = explode(
":", $_POST[
"skin_style"]);
1174 if ($this->object->getPref(
"style") != $sknst[1] ||
1175 $this->
object->getPref(
"skin") != $sknst[0])
1177 $this->
object->setPref(
"skin", $sknst[0]);
1178 $this->
object->setPref(
"style", $sknst[1]);
1181 $this->
object->setPref(
"hits_per_page", $_POST[
"hits_per_page"]);
1182 $this->
object->setPref(
"show_users_online", $_POST[
"show_users_online"]);
1183 $this->
object->setPref(
"hide_own_online_status", $_POST[
"hide_own_online_status"] ?
'y' :
'n');
1188 $this->
object->setLastPasswordChangeTS( time() );
1191 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1193 $this->
object->setPref(
'session_reminder_enabled', (
int)$_POST[
'session_reminder_enabled']);
1197 $this->update = $this->
object->update();
1202 if ($ilUser->getId() == $this->
object->getId())
1204 $ilUser->readPrefs();
1206 $ilUser->setPref(
'send_info_mails', ($_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
1207 $ilUser->writePrefs();
1210 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
1220 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1222 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
1226 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1231 $this->form_gui->setValuesByPost();
1232 $tpl->setContent($this->form_gui->getHtml());
1246 $data[
"auth_mode"] = $this->
object->getAuthMode();
1247 $data[
"login"] = $this->
object->getLogin();
1250 $data[
"ext_account"] = $this->
object->getExternalAccount();
1253 require_once
'classes/class.ilFormat.php';
1256 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
1259 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
1262 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
1265 $data[
"active"] = $this->
object->getActive();
1266 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
1268 $from =
new ilDateTime($this->object->getTimeLimitFrom() ? $this->
object->getTimeLimitFrom() : time(),
IL_CAL_UNIX);
1269 $data[
"time_limit_from"][
"date"] = $from->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
1270 $data[
"time_limit_from"][
"time"] = $from->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
1272 $until =
new ilDateTime($this->object->getTimeLimitUntil() ? $this->
object->getTimeLimitUntil() : time(),
IL_CAL_UNIX);
1273 $data[
'time_limit_until'][
'date'] = $until->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
1274 $data[
'time_limit_until'][
'time'] = $until->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
1278 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1303 $data[
"gender"] = $this->
object->getGender();
1304 $data[
"firstname"] = $this->
object->getFirstname();
1305 $data[
"lastname"] = $this->
object->getLastname();
1306 $data[
"title"] = $this->
object->getUTitle();
1307 $data[
'birthday'] = $this->
object->getBirthday();
1308 $data[
"institution"] = $this->
object->getInstitution();
1309 $data[
"department"] = $this->
object->getDepartment();
1310 $data[
"street"] = $this->
object->getStreet();
1311 $data[
"city"] = $this->
object->getCity();
1312 $data[
"zipcode"] = $this->
object->getZipcode();
1313 $data[
"country"] = $this->
object->getCountry();
1314 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1315 $data[
"phone_home"] = $this->
object->getPhoneHome();
1316 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1317 $data[
"fax"] = $this->
object->getFax();
1318 $data[
"email"] = $this->
object->getEmail();
1319 $data[
"hobby"] = $this->
object->getHobby();
1320 $data[
"referral_comment"] = $this->
object->getComment();
1323 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1324 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1325 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1326 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1327 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1328 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1329 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1332 $data[
"matriculation"] = $this->
object->getMatriculation();
1333 $data[
"delicious"] = $this->
object->getDelicious();
1334 $data[
"client_ip"] = $this->
object->getClientIP();
1337 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1339 $user_defined_data = $this->
object->getUserDefinedData();
1340 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1342 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1346 $data[
"language"] = $this->
object->getLanguage();
1347 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1348 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1349 $data[
"show_users_online"] = $this->
object->prefs[
"show_users_online"];
1350 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1351 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1353 $this->form_gui->setValuesByArray($data);
1363 $settings = $ilSetting->getAll();
1365 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1368 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1369 if ($a_mode ==
"create")
1371 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1375 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1380 $sec_l->setTitle($lng->txt(
"login_data"));
1381 $this->form_gui->addItem($sec_l);
1384 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1388 foreach ($active_auth_modes as $auth_name => $auth_key)
1390 if ($auth_name ==
'default')
1396 $name = $this->lng->txt(
'auth_'.$auth_name);
1398 $option[$auth_name] =
$name;
1400 $am->setOptions($option);
1401 $this->form_gui->addItem($am);
1406 if ($a_mode ==
"edit")
1408 $lo->setCurrentUserId($this->object->getId());
1411 include_once
'Services/Calendar/classes/class.ilDate.php';
1416 $this->lng->txt(
'usr_loginname_history_info'),
1418 $last_history_entry[0]
1425 $this->form_gui->addItem($lo);
1433 $pw->setMaxLength(32);
1434 $pw->setValidateAuthPost(
"auth_mode");
1435 if ($a_mode ==
"create")
1437 $pw->setRequiredOnAuth(
true);
1440 $this->form_gui->addItem($pw);
1445 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1448 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1450 $ext->setMaxLength(50);
1451 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1452 $this->form_gui->addItem($ext);
1457 $sec_si->setTitle($this->lng->txt(
"system_information"));
1458 $this->form_gui->addItem($sec_si);
1461 if ($a_mode ==
"edit")
1463 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1467 $this->form_gui->addItem($siai);
1474 $this->form_gui->addItem($ac);
1477 $lng->loadLanguageModule(
'crs');
1482 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1483 $radg->addOption($op1);
1484 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1485 $radg->addOption($op2);
1495 $op2->addSubItem($acfrom);
1501 $op2->addSubItem($acto);
1504 $this->form_gui->addItem($radg);
1506 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1510 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1512 $disk_quota->setMaxLength(11);
1513 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1514 $this->form_gui->addItem($disk_quota);
1516 if ($a_mode ==
"edit")
1519 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1521 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1523 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1526 $dq_info[
'role_title']);
1528 else if (is_infinite($dq_info[
'role_disk_quota']))
1530 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1534 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1536 $dq_info[
'role_title']);
1538 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1544 if ($du_info[
'last_update'] === null)
1546 $disk_usage->
setValue($lng->txt(
'unknown'));
1550 require_once
'classes/class.ilFormat.php';
1554 foreach ($du_info[
'details'] as $detail_data)
1557 '<td>'.$detail_data[
'count'].
'</td>'.
1558 '<td>'.$lng->txt($detail_data[
'type']).
'</td>'.
1559 '<td>'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1563 $info .=
'</table>';
1564 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
ilFormat::formatDate($du_info[
'last_update'],
'datetime',
true);
1565 $disk_usage->setInfo($info);
1568 $this->form_gui->addItem($disk_usage);
1571 if (
true || $dq_info[
'last_reminder'])
1575 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1576 $this->form_gui->addItem($reminder);
1584 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1585 $this->form_gui->addItem($sec_pd);
1589 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1591 $gndr->addOption($female);
1593 $gndr->addOption($male);
1594 $this->form_gui->addItem($gndr);
1597 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1598 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1599 foreach($fields as $field => $req)
1603 $inp->setMaxLength(32);
1604 $inp->setRequired($req);
1605 $this->form_gui->addItem($inp);
1610 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1615 $this->form_gui->addItem($pi);
1618 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1619 $birthday->setShowEmpty(
true);
1620 $birthday->setStartYear(1900);
1621 $this->form_gui->addItem($birthday);
1625 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1626 $this->form_gui->addItem($sec_cd);
1631 array(
"institution", 40, 80),
1632 array(
"department", 40, 80),
1633 array(
"street", 40, 40),
1634 array(
"city", 40, 40),
1635 array(
"zipcode", 10, 10),
1636 array(
"country", 40, 40),
1637 array(
"phone_office", 30, 30),
1638 array(
"phone_home", 30, 30),
1639 array(
"phone_mobile", 30, 30),
1640 array(
"fax", 30, 30));
1641 foreach ($fields as $field)
1645 $inp->setMaxLength($field[2]);
1646 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1647 $settings[
"require_".$field[0]]);
1648 $this->form_gui->addItem($inp);
1653 $em->
setRequired(isset($settings[
"require_email"]) &&
1654 $settings[
"require_email"]);
1655 $this->form_gui->addItem($em);
1661 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1662 $settings[
"require_hobby"]);
1663 $this->form_gui->addItem($hob);
1669 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1670 $settings[
"require_referral_comment"]);
1671 $this->form_gui->addItem($rc);
1675 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1676 $this->form_gui->addItem($sec_im);
1679 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1680 foreach ($fields as $field)
1684 $im->setMaxLength(40);
1685 $this->form_gui->addItem($im);
1690 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1691 $this->form_gui->addItem($sec_oi);
1694 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1696 $mr->setMaxLength(40);
1697 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1698 $settings[
"require_matriculation"]);
1699 $this->form_gui->addItem($mr);
1704 $mr->setMaxLength(40);
1705 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1706 $settings[
"require_delicious"]);
1707 $this->form_gui->addItem($mr);
1712 $ip->setMaxLength(255);
1713 $ip->setInfo($this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
" <br />".
1714 '<small class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1715 $this->form_gui->addItem($ip);
1718 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1720 foreach($user_defined_fields->getDefinitions() as $field_id => $definition)
1725 "udf_".$definition[
'field_id']);
1727 $udf->setMaxLength(255);
1732 "udf_".$definition[
'field_id']);
1733 $udf->setUseRte(
true);
1738 "udf_".$definition[
'field_id']);
1739 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1740 $definition[
'field_values']));
1742 $udf->setRequired($definition[
'required']);
1743 $this->form_gui->addItem($udf);
1748 $sec_st->setTitle($this->lng->txt(
"settings"));
1749 $this->form_gui->addItem($sec_st);
1752 if ($a_mode ==
"create")
1757 $role->setValue($this->default_role);
1758 $role->setOptions($this->selectable_roles);
1759 $this->form_gui->addItem($role);
1765 $languages = $this->lng->getInstalledLanguages();
1767 foreach($languages as
$l)
1769 $options[
$l] = $lng->txt(
"lang_".$l);
1771 $lang->setOptions($options);
1772 $lang->setValue($ilSetting->get(
"language"));
1773 $this->form_gui->addItem(
$lang);
1778 $templates = $styleDefinition->getAllTemplates();
1779 include(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1781 if (count($templates) > 0 && is_array ($templates))
1783 foreach ($templates as $template)
1786 $styleDef->startParsing();
1787 $styles = $styleDef->getStyles();
1788 foreach ($styles as $style)
1794 $options[$template[
"id"].
":".$style[
"id"]] =
1795 $styleDef->getTemplateName().
" / ".$style[
"name"];
1799 $sk->setOptions($options);
1800 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1801 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1803 $this->form_gui->addItem($sk);
1808 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1809 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1811 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1812 $this->form_gui->addItem($hpp);
1816 'show_users_online');
1818 "y" => $lng->txt(
"users_online_show_y"),
1819 "associated" => $lng->txt(
"users_online_show_associated"),
1820 "n" => $lng->txt(
"users_online_show_n"));
1822 $uo->setValue($ilSetting->get(
"show_users_online"));
1823 $this->form_gui->addItem($uo);
1826 $os =
new ilCheckboxInputGUI($lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1827 $this->form_gui->addItem($os);
1831 $sec_op->setTitle($this->lng->txt(
"options"));
1832 $this->form_gui->addItem($sec_op);
1837 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1838 $this->form_gui->addItem($se);
1840 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1842 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1844 $this->form_gui->addItem($cb);
1850 if ($a_mode ==
"create" || $a_mode ==
"save")
1852 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1854 if ($a_mode ==
"edit" || $a_mode ==
"update")
1856 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1858 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1868 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition, $ilUser
1871 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1875 $settings = $ilias->getAllSettings();
1878 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1880 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1887 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1889 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1895 $this->tabs_gui->clearTargets();
1899 $data[
"fields"] = array();
1900 $data[
"fields"][
"login"] = $this->
object->getLogin();
1901 $data[
"fields"][
"passwd"] =
"********";
1902 #$data["fields"]["passwd2"] = "********"; // will not be saved
1903 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1904 $data[
"fields"][
"title"] = $this->
object->getUTitle();
1905 $data[
"fields"][
"gender"] = $this->
object->getGender();
1906 $data[
"fields"][
"firstname"] = $this->
object->getFirstname();
1907 $data[
"fields"][
"lastname"] = $this->
object->getLastname();
1908 $data[
"fields"][
"institution"] = $this->
object->getInstitution();
1909 $data[
"fields"][
"department"] = $this->
object->getDepartment();
1910 $data[
"fields"][
"street"] = $this->
object->getStreet();
1911 $data[
"fields"][
"city"] = $this->
object->getCity();
1912 $data[
"fields"][
"zipcode"] = $this->
object->getZipcode();
1913 $data[
"fields"][
"country"] = $this->
object->getCountry();
1914 $data[
"fields"][
"phone_office"] = $this->
object->getPhoneOffice();
1915 $data[
"fields"][
"phone_home"] = $this->
object->getPhoneHome();
1916 $data[
"fields"][
"phone_mobile"] = $this->
object->getPhoneMobile();
1917 $data[
"fields"][
"fax"] = $this->
object->getFax();
1918 $data[
"fields"][
"email"] = $this->
object->getEmail();
1919 $data[
"fields"][
"hobby"] = $this->
object->getHobby();
1920 $data[
"fields"][
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1921 $data[
"fields"][
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1922 $data[
"fields"][
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1923 $data[
"fields"][
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1924 $data[
"fields"][
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1925 $data[
"fields"][
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1926 $data[
"fields"][
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1927 $data[
"fields"][
"matriculation"] = $this->
object->getMatriculation();
1928 $data[
"fields"][
"client_ip"] = $this->
object->getClientIP();
1929 $data[
"fields"][
"referral_comment"] = $this->
object->getComment();
1931 $data[
"fields"][
"create_date"] = $this->
object->getCreateDate();
1932 $data[
"fields"][
"approve_date"] = $this->
object->getApproveDate();
1933 $data[
"fields"][
"agree_date"] = $this->
object->getAgreeDate();
1934 $data[
"fields"][
"last_login"] = $this->
object->getLastLogin();
1935 $data[
"fields"][
"active"] = $this->
object->getActive();
1936 $data[
"fields"][
"auth_mode"] = $this->
object->getAuthMode();
1937 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1940 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"personal_picture"));
1942 $full_img = $this->
object->getPref(
"profile_image");
1943 $last_dot = strrpos($full_img,
".");
1944 $small_img = substr($full_img, 0, $last_dot).
1945 "_small".substr($full_img, $last_dot, strlen($full_img) - $last_dot);
1946 $image_file = $webspace_dir.
"/usr_images/".$small_img;
1947 if (@is_file($image_file))
1949 $this->tpl->setVariable(
"IMG_PERSONAL", $image_file.
"?dummy=".rand(1,99999));
1950 $this->tpl->setVariable(
"ALT_IMG_PERSONAL",$this->lng->txt(
"personal_picture"));
1951 $this->tpl->setVariable(
"TXT_REMOVE_PIC", $this->lng->txt(
"remove_personal_picture"));
1954 $this->tpl->setVariable(
"UPLOAD", $this->lng->txt(
"upload"));
1955 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"userfile"));
1956 $this->tpl->setVariable(
"USER_FILE", $this->lng->txt(
"user_file"));
1981 $user_is_online =
false;
1985 $user_is_online =
true;
1988 preg_match(
"/RoleId.*?;\}/",$user_online[$this->object->getId()][
"data"],$matches);
1990 $active_roles = unserialize(substr($matches[0],7));
1993 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
1995 foreach ($assigned_roles as
$key => $role)
1997 $roleObj = $this->ilias->obj_factory->getInstanceByObjId($role);
2000 $rolf = $rbacreview->getFoldersAssignedToRole($role,
true);
2003 if (count($rolf) > 0)
2005 if (!$rbacreview->isDeleted($rolf[0]))
2009 if ($this->tree->isInTree($rolf[0]))
2011 $tmpPath = $this->tree->getPathFull($rolf[0]);
2014 for ($i = 0; $i < (count($tmpPath)-1); $i++)
2021 $path .= $tmpPath[$i][
"title"];
2026 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role.
")</b>";
2028 $active_roles = $active_roles ? $active_roles : array();
2029 if (in_array($role,$active_roles))
2031 $data[
"active_role"][$role][
"active"] =
true;
2034 $data[
"active_role"][$role][
"title"] = $roleObj->getTitle();
2035 $data[
"active_role"][$role][
"context"] = $path;
2042 $path =
"<b>No role folder found for role ".$role.
"!</b>";
2050 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"]))
2052 if (!isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"]))
2054 $_SESSION[
"error_post_vars"][
"Fobject"][
"active"] = 0;
2057 foreach (
$_SESSION[
"error_post_vars"][
"Fobject"] as
$key => $val)
2059 $str = $this->lng->txt(
$key);
2060 if (
$key ==
"title")
2062 $str = $this->lng->txt(
"person_title");
2064 if(
$key ==
'passwd2')
2068 if(
$key ==
'passwd')
2073 $this->tpl->setCurrentBlock(
'passwords_visible');
2074 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
2075 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
2076 $this->tpl->setVariable(
'VISIBLE_PASSWD',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd']);
2077 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd2']);
2078 $this->tpl->parseCurrentBlock();
2082 $this->tpl->setCurrentBlock(
'passwords_invisible');
2083 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
2084 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
2085 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
2088 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
2091 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
2092 $this->tpl->parseCurrentBlock();
2099 if (isset($settings[
"require_" .
$key]) && $settings[
"require_" . $key])
2101 $str = $str .
'<span class="asterisk">*</span>';
2104 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
2106 if ($key !=
"default_role" and $key !=
"language"
2107 and $key !=
"skin_style" and $key !=
"hits_per_page"
2108 and $key !=
"show_users_online")
2120 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
2123 $active =
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"];
2126 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
2131 if (!isset($data[
"fields"][
"active"]))
2133 $data[
"fields"][
"active"] = 0;
2136 foreach ($data[
"fields"] as
$key => $val)
2138 $str = $this->lng->txt(
$key);
2139 if (
$key ==
"title")
2141 $str = $this->lng->txt(
"person_title");
2143 if (
$key ==
"ext_account")
2147 if(
$key ==
'passwd')
2149 $auth_mode = $this->
object->getAuthMode(
true);
2152 $this->tpl->setCurrentBlock(
'passwords_visible');
2153 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
2154 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
2155 $this->tpl->setVariable(
'VISIBLE_PASSWD',
"********");
2156 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
"********");
2157 $this->tpl->parseCurrentBlock();
2161 $this->tpl->setCurrentBlock(
'passwords_invisible');
2162 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
2163 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
2164 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
2167 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
2170 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
2171 $this->tpl->parseCurrentBlock();
2177 if (isset($settings[
"require_" .
$key]) && $settings[
"require_" . $key])
2179 $str = $str .
'<span class="asterisk">*</span>';
2182 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
2185 #$this->tpl->parseCurrentBlock();
2189 $gender = strtoupper($data[
"fields"][
"gender"]);
2193 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
2196 $active = $data[
"fields"][
"active"];
2199 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
2204 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2207 $this->tpl->setCurrentBlock(
"ext_account");
2208 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT",$this->lng->txt(
"user_ext_account"));
2209 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT_DESC",$this->lng->txt(
"user_ext_account_desc"));
2210 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]))
2212 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2213 $_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]);
2217 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2218 $data[
"fields"][
"ext_account"]);
2229 $this->tpl->parseCurrentBlock();
2231 $auth_mode =
$_SESSION[
'error_post_vars'][
'Fobject'][
'auth_mode'] ?
2233 $this->
object->getAuthMode(
true);
2236 $this->tpl->setVariable(
"OPTION_DISABLED",
"\"disabled=disabled\"");
2238 $obj_str = ($this->call_by_reference) ?
"" :
"&obj_id=".$this->obj_id;
2240 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2241 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
2242 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2243 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2244 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
2245 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
2246 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2248 $this->tpl->setVariable(
"TXT_LOGIN_DATA", $this->lng->txt(
"login_data"));
2249 $this->tpl->setVariable(
"TXT_SYSTEM_INFO", $this->lng->txt(
"system_information"));
2250 $this->tpl->setVariable(
"TXT_PERSONAL_DATA", $this->lng->txt(
"personal_data"));
2251 $this->tpl->setVariable(
"TXT_CONTACT_DATA", $this->lng->txt(
"contact_data"));
2252 $this->tpl->setVariable(
"TXT_SETTINGS", $this->lng->txt(
"settings"));
2253 $this->tpl->setVariable(
"TXT_LANGUAGE",$this->lng->txt(
"language"));
2254 $this->tpl->setVariable(
"TXT_SKIN_STYLE",$this->lng->txt(
"usr_skin_style"));
2255 $this->tpl->setVariable(
"TXT_HITS_PER_PAGE",$this->lng->txt(
"hits_per_page"));
2256 $this->tpl->setVariable(
"TXT_SHOW_USERS_ONLINE",$this->lng->txt(
"show_users_online"));
2257 $this->tpl->setVariable(
"TXT_GENDER_F",$this->lng->txt(
"gender_f"));
2258 $this->tpl->setVariable(
"TXT_GENDER_M",$this->lng->txt(
"gender_m"));
2259 $this->tpl->setVariable(
"TXT_INSTANT_MESSENGERS",$this->lng->txt(
"user_profile_instant_messengers"));
2260 $this->tpl->setVariable(
"TXT_OTHER",$this->lng->txt(
"user_profile_other"));
2261 if ($this->object->getId() == $ilUser->getId())
2263 $this->tpl->setVariable(
"TXT_CURRENT_IP",
"(".$this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
")");
2265 $this->tpl->setVariable(
"TXT_CURRENT_IP_ALERT",$this->lng->txt(
"current_ip_alert"));
2268 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2272 $selected_auth_mode = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"] : $this->object->getAuthMode();
2274 foreach ($active_auth_modes as $auth_name => $auth_key)
2276 $this->tpl->setCurrentBlock(
"auth_mode_selection");
2278 if ($auth_name ==
'default')
2284 $name = $this->lng->txt(
'auth_'.$auth_name);
2287 $this->tpl->setVariable(
"AUTH_MODE_NAME",
$name);
2289 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
2291 if ($selected_auth_mode == $auth_name)
2293 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
2296 $this->tpl->parseCurrentBlock();
2301 $languages = $this->lng->getInstalledLanguages();
2304 $selected_lang = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"] : $this->object->getLanguage();
2306 foreach ($languages as $lang_key)
2308 $this->tpl->setCurrentBlock(
"language_selection");
2309 $this->tpl->setVariable(
"LANG", $this->lng->txt(
"lang_".$lang_key));
2310 $this->tpl->setVariable(
"LANGSHORT", $lang_key);
2312 if ($selected_lang == $lang_key)
2314 $this->tpl->setVariable(
"SELECTED_LANG",
"selected=\"selected\"");
2317 $this->tpl->parseCurrentBlock();
2322 $templates = $styleDefinition->getAllTemplates();
2325 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]))
2327 $sknst = explode(
":",
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]);
2329 $selected_style = $sknst[1];
2330 $selected_skin = $sknst[0];
2334 $selected_style = $this->
object->prefs[
"style"];
2335 $selected_skin = $this->
object->skin;
2338 include(
"./Services/Style/classes/class.ilObjStyleSettings.php");
2339 if (count($templates) > 0 && is_array ($templates))
2341 foreach ($templates as $template)
2346 $styleDef->startParsing();
2347 $styles = $styleDef->getStyles();
2348 foreach ($styles as $style)
2355 $this->tpl->setCurrentBlock(
"selectskin");
2357 if ($selected_skin == $template[
"id"] &&
2358 $selected_style == $style[
"id"])
2360 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
2363 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
2364 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
2365 $this->tpl->parseCurrentBlock();
2370 $hits_options = array(2,10,15,20,30,40,50,100,9999);
2372 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"]))
2374 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"];
2378 $selected_option = $this->
object->prefs[
"hits_per_page"];
2380 foreach($hits_options as $hits_option)
2382 $this->tpl->setCurrentBlock(
"selecthits");
2384 if ($selected_option == $hits_option)
2386 $this->tpl->setVariable(
"HITSSELECTED",
"selected=\"selected\"");
2389 $this->tpl->setVariable(
"HITSVALUE", $hits_option);
2391 if ($hits_option == 9999)
2393 $hits_option = $this->lng->txt(
"no_limit");
2396 $this->tpl->setVariable(
"HITSOPTION", $hits_option);
2397 $this->tpl->parseCurrentBlock();
2402 $users_online_options = array(
"y",
"associated",
"n");
2404 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"]))
2406 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"];
2410 $selected_option = $this->
object->prefs[
"show_users_online"];
2412 foreach($users_online_options as $an_option)
2414 $this->tpl->setCurrentBlock(
"show_users_online");
2416 if ($selected_option == $an_option)
2418 $this->tpl->setVariable(
"USERS_ONLINE_SELECTED",
"selected=\"selected\"");
2421 $this->tpl->setVariable(
"USERS_ONLINE_VALUE", $an_option);
2423 $this->tpl->setVariable(
"USERS_ONLINE_OPTION", $this->lng->txt(
"users_online_show_".$an_option));
2424 $this->tpl->parseCurrentBlock();
2429 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"]))
2431 $hide_own_online_status =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"];
2435 $hide_own_online_status = ($this->
object->prefs[
"hide_own_online_status"] !=
'') ? $this->object->prefs[
"hide_own_online_status"] :
"n";
2437 $this->tpl->setCurrentBlock(
"hide_own_online_status");
2438 $this->tpl->setVariable(
"TXT_HIDE_OWN_ONLINE_STATUS", $this->lng->txt(
"hide_own_online_status"));
2439 if ($hide_own_online_status ==
"y") {
2440 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"checked=\"checked\"");
2443 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"");
2445 $this->tpl->parseCurrentBlock();
2449 $this->tpl->setCurrentBlock(
"inform_user");
2452 $sendInfoMail = $ilUser->getPref(
'send_info_mails') ==
'y';
2456 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
2459 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL", $this->lng->txt(
"inform_user_mail"));
2460 $this->tpl->parseCurrentBlock();
2462 $this->lng->loadLanguageModule(
'crs');
2464 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] ?
2465 $_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] :
2466 $this->
object->getTimeLimitUnlimited();
2467 $time_limit_from =
$_SESSION[
"error_post_vars"][
"time_limit"][
"from"] ?
2469 $this->
object->getTimeLimitFrom();
2471 $time_limit_until =
$_SESSION[
"error_post_vars"][
"time_limit"][
"until"] ?
2473 $this->
object->getTimeLimitUntil();
2475 $this->tpl->setCurrentBlock(
"time_limit");
2476 $this->tpl->setVariable(
"TXT_TIME_LIMIT", $this->lng->txt(
"time_limit"));
2477 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED", $this->lng->txt(
"crs_unlimited"));
2478 $this->tpl->setVariable(
"TXT_TIME_LIMIT_FROM", $this->lng->txt(
"crs_from"));
2479 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNTIL", $this->lng->txt(
"crs_to"));
2481 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"time_limit[unlimited]",1));
2482 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[from][minute]",
2483 date(
"i",$time_limit_from)));
2484 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[from][hour]",
2485 date(
"G",$time_limit_from)));
2486 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_DAY",$this->
__getDateSelect(
"day",
"time_limit[from][day]",
2487 date(
"d",$time_limit_from)));
2488 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MONTH",$this->
__getDateSelect(
"month",
"time_limit[from][month]",
2489 date(
"m",$time_limit_from)));
2490 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_YEAR",$this->
__getDateSelect(
"year",
"time_limit[from][year]",
2491 date(
"Y",$time_limit_from)));
2492 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[until][minute]",
2493 date(
"i",$time_limit_until)));
2494 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[until][hour]",
2495 date(
"G",$time_limit_until)));
2496 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_DAY",$this->
__getDateSelect(
"day",
"time_limit[until][day]",
2497 date(
"d",$time_limit_until)));
2498 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MONTH",$this->
__getDateSelect(
"month",
"time_limit[until][month]",
2499 date(
"m",$time_limit_until)));
2500 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_YEAR",$this->
__getDateSelect(
"year",
"time_limit[until][year]",
2501 date(
"Y",$time_limit_until)));
2502 $this->tpl->parseCurrentBlock();
2515 global $ilUser, $rbacsystem;
2519 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
2521 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2528 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2530 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2534 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
2536 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
2538 if ($userfile_input->getDeletionFlag())
2540 $this->
object->removeUserPicture();
2544 if ($_FILES[
"userfile"][
"size"] == 0)
2551 $image_dir = $webspace_dir.
"/usr_images";
2552 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
2555 $this->
object->setPref(
"profile_image", $store_file);
2556 $this->
object->update();
2559 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
"pic";
2561 $uploaded_file,
false))
2564 $this->ctrl->redirect($this,
"showProfile");
2566 chmod($uploaded_file, 0770);
2570 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
2571 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
2572 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
2573 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
2579 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 200x200 -quality 100 JPEG:$show_file");
2580 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 100x100 -quality 100 JPEG:$thumb_file");
2581 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 75x75 -quality 100 JPEG:$xthumb_file");
2582 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 30x30 -quality 100 JPEG:$xxthumb_file");
2592 $image_dir = $webspace_dir.
"/usr_images";
2593 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
2594 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
2595 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
2596 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
2597 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
2600 $this->
object->setPref(
"profile_image",
"");
2601 $this->
object->update();
2604 if (@is_file(
$file))
2608 if (@is_file($thumb_file))
2610 unlink($thumb_file);
2612 if (@is_file($xthumb_file))
2614 unlink($xthumb_file);
2616 if (@is_file($xxthumb_file))
2618 unlink($xxthumb_file);
2620 if (@is_file($upload_file))
2622 unlink($upload_file);
2866 global
$ilias, $rbacsystem, $rbacadmin,$ilUser;
2868 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2871 $settings = $ilias->getAllSettings();
2874 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2876 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2883 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2885 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2895 foreach ($settings as
$key => $val)
2897 $field = substr(
$key,8);
2904 $require_keys[] = $field;
2908 $require_keys[] = $field;
2914 foreach ($require_keys as
$key => $val)
2917 $system_fields = array(
"default_role");
2918 if (!in_array($val, $system_fields))
2920 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2922 if (empty(
$_POST[
"Fobject"][$val]))
2924 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2925 $this->lng->txt($val),$this->ilias->error_obj->MESSAGE);
2933 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
2936 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2939 $this->ilias->raiseError($this->lng->txt(
"login_invalid"),$this->ilias->error_obj->MESSAGE);
2945 $this->ilias->raiseError($this->lng->txt(
"login_exists"),$this->ilias->error_obj->MESSAGE);
2950 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2951 !strlen($this->object->getPasswd()))
2953 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2954 $this->lng->txt(
'password'),$this->ilias->error_obj->MESSAGE);
2957 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2959 $this->ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->ilias->error_obj->MESSAGE);
2965 $this->ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->ilias->error_obj->MESSAGE);
2971 $_POST[
'Fobject'][
'passwd'] =
"********";
2975 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2977 $this->ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->ilias->error_obj->MESSAGE);
2980 if(
$_POST[
'Fobject'][
'ext_account'] &&
2983 if($elogin != $this->object->getLogin())
2985 $this->ilias->raiseError(
2986 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2987 $_POST[
"Fobject"][
"ext_account"],
2988 $_POST[
'Fobject'][
'auth_mode'],
2990 $this->ilias->error_obj->MESSAGE);
2996 include_once (
'./Services/User/classes/class.ilObjUser.php');
3002 $this->ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->ilias->error_obj->MESSAGE);
3009 if (!
$_POST[
"time_limit"][
"unlimited"] and
3012 $this->ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->ilias->error_obj->MESSAGE);
3015 if(!$this->ilias->account->getTimeLimitUnlimited())
3017 if($start < $this->ilias->account->getTimeLimitFrom() or
3018 $end > $this->ilias->account->getTimeLimitUntil() or
3019 $_POST[
'time_limit'][
'unlimited'])
3033 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
3035 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
3039 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
3040 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
3041 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
3043 $_POST[
'Fobject'][
'time_limit_message'] = 0;
3047 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
3050 $this->
object->assignData(
$_POST[
"Fobject"]);
3051 $this->
object->setUserDefinedData(
$_POST[
'udf']);
3055 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
3060 $this->form_gui->setValuesByPost();
3061 return $tpl->setContent($this->form_gui->getHtml());
3064 $this->
object->setTitle($this->object->getFullname());
3065 $this->
object->setDescription($this->object->getEmail());
3066 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
3069 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
3071 if ($this->object->getPref(
"style") != $sknst[1] ||
3072 $this->
object->getPref(
"skin") != $sknst[0])
3074 $this->
object->setPref(
"skin", $sknst[0]);
3075 $this->
object->setPref(
"style", $sknst[1]);
3079 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
3081 $this->
object->setPref(
"show_users_online",
$_POST[
"Fobject"][
"show_users_online"]);
3083 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
3084 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
3087 $this->
object->setPref(
"hide_own_online_status",
"n");
3090 $this->update = $this->
object->update();
3095 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
3096 $ilUser->writePrefs();
3100 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
3105 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
3107 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
3111 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
3124 global $rbacsystem, $rbacadmin, $rbacreview;
3126 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
3128 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
3131 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
3132 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
3135 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
3137 array_push($selected_roles,SYSTEM_ROLE_ID);
3140 $global_roles_all = $rbacreview->getGlobalRoles();
3141 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
3142 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
3143 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
3144 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
3145 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
3147 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
3148 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
3152 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
3153 $this->ctrl->redirect($this,
'roleassignment');
3156 foreach (array_diff($assigned_roles,$selected_roles) as $role)
3158 $rbacadmin->deassignUser($role,$this->object->getId());
3161 foreach (array_diff($selected_roles,$assigned_roles) as $role)
3163 $rbacadmin->assignUser($role,$this->object->getId(),
false);
3166 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
3169 $this->
object->update();
3173 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
3175 $this->ctrl->redirect($this,
'roleassignment');
3179 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
3191 global $rbacreview,$rbacsystem,$ilUser, $ilTabs;
3193 $ilTabs->activateTab(
"role_assignment");
3195 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
3197 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
3207 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html');
3211 $this->tpl->setCurrentBlock(
"filter");
3212 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
3214 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
3215 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
3216 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
3217 $this->tpl->parseCurrentBlock();
3221 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3225 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
3226 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
3230 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
3233 foreach ($role_list as $role)
3236 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3239 if ($rbacreview->isDeleted($rolf[0]))
3247 if ($this->tree->isInTree($rolf[0]))
3249 if ($rolf[0] == ROLE_FOLDER_ID)
3251 $path = $this->lng->txt(
"global");
3255 $tmpPath = $this->tree->getPathFull($rolf[0]);
3268 $path = $tmpPath[count($tmpPath)-2][
"title"];
3273 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
3279 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
3280 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
3285 if (substr($role[
"title"],0,3) ==
"il_")
3289 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3290 $rolf2 = $rolf_arr[0];
3297 $parent_node = $this->tree->getParentNodeData($rolf2);
3299 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
3302 $role_ids[$counter] = $role[
"obj_id"];
3304 $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"].
"\"/>";
3305 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
3306 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
3307 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
3309 $result_set[$counter][] = $role[
"description"];
3312 if ($role[
"role_type"] ==
"local") {
3320 foreach ($ref_ids as
$ref_id) {}
3322 require_once(
"./classes/class.ilLink.php");
3324 $result_set[$counter][] = $context =
"<a href='".ilLink::_getLink($ref_id,
ilObject::_lookupType(
$obj_id)).
"' target='_top'>".$path.
"</a>";
3328 $result_set[$counter][] = $path;
3332 $records[] = array(
"path" => $path,
"description" => $role[
"description"],
3333 "context" => $context,
"checkbox" => $checkbox,
3334 "role" => $link,
"title" =>
$title);
3340 $tab->setData($records);
3341 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
3353 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3355 $table_gui->writeFilterToSession();
3356 $table_gui->resetOffset();
3365 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3367 $table_gui->resetOffset();
3368 $table_gui->resetFilter();
3377 for($i=0;$i<=60;$i++)
3379 $days[$i] = $i < 10 ?
"0".$i : $i;
3384 for($i=0;$i<24;$i++)
3386 $days[$i] = $i < 10 ?
"0".$i : $i;
3391 for($i=1;$i<32;$i++)
3393 $days[$i] = $i < 10 ?
"0".$i : $i;
3398 for($i=1;$i<13;$i++)
3400 $month[$i] = $i < 10 ?
"0".$i : $i;
3405 if($a_selected < date(
'Y',time()))
3411 $start = date(
'Y',time());
3414 for($i =
$start;$i < date(
"Y",time()) + 11;++$i)
3424 return mktime($a_time_arr[
"hour"],
3425 $a_time_arr[
"minute"],
3426 $a_time_arr[
"second"],
3427 $a_time_arr[
"month"],
3429 $a_time_arr[
"year"]);
3436 $actions = array(
"assignSave" => $this->lng->txt(
"change_assignment"));
3439 $tpl =& $tbl->getTemplateObject();
3441 $tpl->setCurrentBlock(
"tbl_form_header");
3442 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3443 $tpl->parseCurrentBlock();
3445 $tpl->setCurrentBlock(
"tbl_action_row");
3447 $tpl->setVariable(
"COLUMN_COUNTS",4);
3452 $tpl->setCurrentBlock(
"tbl_action_btn");
3454 $tpl->setVariable(
"BTN_VALUE",$value);
3455 $tpl->parseCurrentBlock();
3458 if (!empty($a_role_ids))
3461 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
3462 $tpl->setVariable(
"JS_VARNAME",
"role_id");
3464 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3465 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3466 $tpl->parseCurrentBlock();
3469 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3472 $this->ctrl->setParameter($this,
"cmd",
"roleassignment");
3475 $tbl->setTitle($this->lng->txt(
"edit_roleassignment"),
"icon_role.gif",$this->lng->txt(
"roles"));
3478 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"role"),$this->lng->txt(
"description"),$this->lng->txt(
"context")));
3479 $tbl->setHeaderVars(array(
"",
"title",
"description",
"context"),$this->ctrl->getParameterArray($this,
"",
false));
3480 $tbl->setColumnWidth(array(
"",
"30%",
"40%",
"30%"));
3484 $this->tpl->setVariable(
"ROLES_TABLE",$tbl->tpl->get());
3491 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3501 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3506 $tbl->setOrderColumn($order);
3507 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3508 $tbl->setOffset(
$_GET[
"offset"]);
3509 $tbl->setLimit(
$_GET[
"limit"]);
3510 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3511 $tbl->setData($result_set);
3521 $action[0] = $this->lng->txt(
'assigned_roles');
3522 $action[1] = $this->lng->txt(
'all_roles');
3523 $action[2] = $this->lng->txt(
'all_global_roles');
3524 $action[3] = $this->lng->txt(
'all_local_roles');
3525 $action[4] = $this->lng->txt(
'internal_local_roles_only');
3526 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
3545 $ilLocator->clearItems();
3547 if (
$_GET[
"admin_mode"] ==
"settings")
3549 $ilLocator->addItem($this->lng->txt(
"administration"),
3550 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
3555 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3557 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3561 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3563 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
3566 if (
$_GET[
"obj_id"] > 0)
3568 $ilLocator->addItem($this->object->getTitle(),
3569 $this->ctrl->getLinkTarget($this,
"view"));
3582 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
3585 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3589 if ($this->object->getRefId() != ROOT_FOLDER_ID &&
3590 $this->
object->getRefId() != SYSTEM_FOLDER_ID)
3592 $par_id = $tree->getParentId($this->usrf_ref_id);
3593 $tpl->setUpperIcon(
"repository.php?ref_id=".$par_id);
3602 if(
$_POST[
'send_mail'] !=
'y')
3606 if(!strlen($this->object->getEmail()))
3612 $usr_lang =
new ilLanguage($this->object->getLanguage());
3614 $usr_lang->loadLanguageModule(
'registration');
3616 include_once
"Services/Mail/classes/class.ilMimeMail.php";
3619 $mmail->autoCheck(
false);
3620 $mmail->From($ilUser->getEmail());
3621 $mmail->To($this->object->getEmail());
3624 $subject = $usr_lang->txt(
"profile_changed");
3628 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
3630 $date = $this->
object->getApproveDate();
3632 if((time() - strtotime($date)) < 10)
3634 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
3638 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
3642 if(
$_POST[
'passwd'] !=
'********')
3644 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
3645 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
3646 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
3647 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
3649 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
3650 $body .= $this->
object->getProfileAsString($usr_lang);
3652 $mmail->Subject($subject);
3653 $mmail->Body($body);
3657 return "<br/>".$this->lng->txt(
"mail_sent");
3665 global $ilAccess,
$ilErr,
$lng, $ilNavigationHistory;
3666 $_GET[
"cmd"] =
"view";
3667 $_GET[
"user_id"] = (int) $a_target;
3668 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
3669 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
3670 include(
"ilias.php");