4 require_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   32                 define(
'USER_FOLDER_ID',7);
 
   35                 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
 
   37                 $this->lng->loadLanguageModule(
'search');
 
   38                 $this->lng->loadLanguageModule(
"user");
 
   40                 $ilCtrl->saveParameter($this, 
"letter");
 
   45                 $this->user_owner_id = $a_id;
 
   49                 return $this->user_owner_id ? $this->user_owner_id : 
USER_FOLDER_ID;
 
   56                 $next_class = $this->ctrl->getNextClass($this);
 
   57                 $cmd = $this->ctrl->getCmd();
 
   62                         case 'ilusertablegui':
 
   63                                 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
 
   65                                 $u_table->initFilter();
 
   66                                 $this->ctrl->setReturn($this,
'view');
 
   67                                 $this->ctrl->forwardCommand($u_table);
 
   70                         case 'ilpermissiongui':
 
   71                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
   73                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
 
   76                         case 'ilrepositorysearchgui':
 
   77                                 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
 
   79                                 $user_search->enableSearchableCheck(
false);
 
   80                                 $user_search->setCallback(
 
   82                                         'searchResultHandler',
 
   85                                 $this->tabs_gui->setTabActive(
'search_user_extended');
 
   86                                 $this->ctrl->setReturn($this,
'view');
 
   87                                 $ret =& $this->ctrl->forwardCommand($user_search);
 
   90                         case 'ilaccountcodesgui':
 
   91                                 $this->tabs_gui->setTabActive(
'settings');
 
   93                                 $ilTabs->activateSubTab(
"account_codes");
 
   94                                 include_once(
"./Services/User/classes/class.ilAccountCodesGUI.php");
 
   96                                 $this->ctrl->forwardCommand($acc);
 
   99                         case 'ilcustomuserfieldsgui':
 
  100                                 $this->tabs_gui->setTabActive(
'settings');
 
  102                                 $ilTabs->activateSubTab(
"user_defined_fields");
 
  103                                 include_once(
"./Services/User/classes/class.ilCustomUserFieldsGUI.php");
 
  105                                 $this->ctrl->forwardCommand($cf);
 
  124                 global $rbacsystem, 
$tpl;
 
  126                 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()) ||
 
  130                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  133                 include_once 
"Services/User/classes/class.ilUserLPTableGUI.php";
 
  134                 $tbl = 
new ilUserLPTableGUI($this, 
"learningProgress", $this->object->getRefId());
 
  136                 $tpl->setContent($tbl->getHTML());
 
  145                 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
 
  147                 $utab->resetOffset();
 
  148                 $utab->resetFilter();
 
  161                 $ilCtrl->setParameterByClass(
"ilobjusergui", 
"new_type", 
"usr");
 
  162                 $ilCtrl->redirectByClass(array(
"iladministrationgui", 
"ilobjusergui"), 
"create");
 
  173                 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
 
  175                 $utab->resetOffset();
 
  176                 $utab->writeFilterToSession();
 
  178                 $ilTabs->activateTab(
"obj_usrf");
 
  190                 $ilToolbar->addButton($this->lng->txt(
"usr_add"),
 
  191                         $this->ctrl->getLinkTarget($this, 
"addUser"));
 
  192                 $ilToolbar->addButton($this->lng->txt(
"import_users"),
 
  193                         $this->ctrl->getLinkTarget($this, 
"importUserForm"));
 
  196                 include_once 
'./Services/User/classes/class.ilUserAccountSettings.php';
 
  198                 if ((
int) $ilSetting->get(
'user_adm_alpha_nav'))
 
  200                         $ilToolbar->addSeparator();
 
  203                         include_once(
"./Services/Form/classes/class.ilAlphabetInputGUI.php");
 
  205                         include_once(
"./Services/User/classes/class.ilObjUser.php");
 
  211                         $ai->setParentCommand($this, 
"chooseLetter");
 
  212                         $ai->setHighlighted(
$_GET[
"letter"]);
 
  213                         $ilToolbar->addInputItem($ai, 
true);
 
  217                 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
 
  219                 $tpl->setContent($utab->getHTML());
 
  227                 include_once 
'./Services/User/classes/class.ilUserAutoComplete.php';
 
  229                 $auto->setSearchFields(array(
'login',
'firstname',
'lastname',
'email'));
 
  230                 $auto->enableFieldSearchableCheck(
false);
 
  245                 $ilCtrl->redirect($this, 
"view");
 
  259                 $operations = array();
 
  261                 if ($this->actions == 
"")
 
  264                                 "delete" => array(
"name" => 
"delete", 
"lng" => 
"delete"),
 
  265                                 "activate" => array(
"name" => 
"activate", 
"lng" => 
"activate"),
 
  266                                 "deactivate" => array(
"name" => 
"deactivate", 
"lng" => 
"deactivate"),
 
  267                                 "accessRestrict" => array(
"name" => 
"accessRestrict", 
"lng" => 
"accessRestrict"),
 
  268                                 "accessFree" => array(
"name" => 
"accessFree", 
"lng" => 
"accessFree"),
 
  269                                 "export" => array(
"name" => 
"export", 
"lng" => 
"export")
 
  278                         if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
 
  280                                 $operations[] = 
$row;
 
  284                 if (count($operations) > 0)
 
  286                         $select = 
"<select name=\"selectedAction\">\n";
 
  287                         foreach ($operations as $val)
 
  289                                 $select .= 
"<option value=\"" . $val[
"name"] . 
"\"";
 
  290                                 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
 
  292                                         $select .= 
" selected=\"selected\"";
 
  295                                 $select .= $this->lng->txt($val[
"lng"]);
 
  296                                 $select .= 
"</option>";
 
  298                         $select .= 
"</select>";
 
  299                         $this->tpl->setCurrentBlock(
"tbl_action_select");
 
  300                         $this->tpl->setVariable(
"SELECT_ACTION", $select);
 
  301                         $this->tpl->setVariable(
"BTN_NAME", 
"userAction");
 
  302                         $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
 
  303                         $this->tpl->parseCurrentBlock();
 
  306                 if ($with_subobjects === 
true)
 
  311                 if ((count($operations) > 0) or $subobjs === 
true)
 
  313                         $this->tpl->setCurrentBlock(
"tbl_action_row");
 
  314                         $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
 
  316                         $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
 
  317                         $this->tpl->parseCurrentBlock();
 
  331                 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
 
  333                 if (!$rbacsystem->checkAccess(
'create_usr',$this->object->getRefId()))
 
  346                                         for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
 
  348                                                 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
 
  354                                 if ($row[
"max"] == 
"" || $count < $row[
"max"])
 
  356                                         $subobj[] = $row[
"name"];
 
  361                 if (is_array($subobj))
 
  365                         $this->tpl->setCurrentBlock(
"add_object");
 
  366                         $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
 
  367                         $this->tpl->setVariable(
"BTN_NAME", 
"create");
 
  368                         $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
 
  369                         $this->tpl->parseCurrentBlock();
 
  379                 $this->ctrl->redirect($this, 
'view');
 
  384                 $this->ctrl->redirectByClass(
'ilrepositorysearchgui', 
'showSearchResults');
 
  397                 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
 
  399                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
 
  403                 foreach (
$_POST[
"id"] as $id)
 
  406                         $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
 
  407                         $obj->setActive(TRUE, $ilUser->getId());
 
  415                         $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');                   
 
  419                         $this->ctrl->redirect($this, 
"view");
 
  433                 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
 
  435                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
 
  439                 foreach (
$_POST[
"id"] as $id)
 
  442                         $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
 
  443                         $obj->setActive(FALSE, $ilUser->getId());
 
  452                         $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');                   
 
  456                         $this->ctrl->redirect($this, 
"view");
 
  465                 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
 
  467                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
 
  471                 foreach (
$_POST[
"id"] as $id)
 
  474                         $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
 
  475                         $obj->setTimeLimitOwner($ilUser->getId());
 
  476                         $obj->setTimeLimitUnlimited(1);
 
  477                         $obj->setTimeLimitFrom(
"");
 
  478                         $obj->setTimeLimitUntil(
"");
 
  479                         $obj->setTimeLimitMessage(0);
 
  488                         $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');                   
 
  492                         $this->ctrl->redirect($this, 
"view");
 
  502                 $this->tpl->setContent($a_form->getHTML());
 
  517                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  519                 $form->setTitle($this->lng->txt(
"time_limit_add_time_limit_for_selected"));
 
  520                 $form->setFormAction($this->ctrl->getFormAction($this, 
"confirmaccessRestrict"));
 
  524                 $from->setRequired(
true);
 
  525                 $form->addItem($from);
 
  529                 $to->setShowTime(
true);
 
  532                 $form->addCommandButton(
"confirmaccessRestrict", $this->lng->txt(
"confirm"));
 
  533                 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  535                 foreach($user_ids as $user_id)
 
  538                         $ufield->setValue($user_id);
 
  539                         $form->addItem($ufield);
 
  543                 if($a_from_search || 
$_POST[
"frsrch"])
 
  547                         $form->addItem($field);
 
  556                 if(!$form->checkInput())
 
  561                 $timefrom = $form->getItemByPostVar(
"from")->getDate()->get(
IL_CAL_UNIX);
 
  562                 $timeuntil = $form->getItemByPostVar(
"to")->getDate()->get(
IL_CAL_UNIX);
 
  563                 if ($timeuntil <= $timefrom)
 
  572                 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
 
  574                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
 
  578                 foreach (
$_POST[
"id"] as $id)
 
  581                         $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
 
  582                         $obj->setTimeLimitOwner($ilUser->getId());
 
  583                         $obj->setTimeLimitUnlimited(0);
 
  584                         $obj->setTimeLimitFrom($timefrom);
 
  585                         $obj->setTimeLimitUntil($timeuntil);
 
  586                         $obj->setTimeLimitMessage(0);
 
  595                         $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');                   
 
  599                         $this->ctrl->redirect($this, 
"view");
 
  613                 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
 
  616                         $ilCtrl->redirect($this, 
"view");
 
  619                 if (in_array($ilUser->getId(), 
$_POST[
"id"]))
 
  621                         $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
 
  625                 foreach (
$_POST[
"id"] as $id)
 
  628                         $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
 
  637                         $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');                   
 
  641                         $this->ctrl->redirect($this, 
"view");
 
  652                 if(
$_POST[
"select_cmd_all"])
 
  654                         include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
 
  656                         return $utab->getUserIdsForFilter();
 
  674                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
  679                         $ilTabs->activateTab(
"obj_usrf");
 
  683                         $ilTabs->activateTab(
"search_user_extended");
 
  686                 if (strcmp($action, 
"accessRestrict") == 0) 
 
  695                         $cancel = 
"cancelUserFolderAction";
 
  699                         $cancel = 
"cancelSearchAction";                                                 
 
  703                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  705                 $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  706                 $cgui->setHeaderText($this->lng->txt(
"info_" . $action . 
"_sure"));
 
  707                 $cgui->setCancel($this->lng->txt(
"cancel"), $cancel);
 
  708                 $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirm" . $action);
 
  712                         $cgui->addHiddenItem(
"frsrch", 1);
 
  715                 foreach($user_ids as $id)
 
  719                         $login = $user->getLastLogin();
 
  722                                 $login = $this->lng->txt(
"never");
 
  729                         $caption = $user->getFullname().
" (".$user->getLogin().
")".
", ".
 
  730                                 $user->getEmail().
" -  ".$this->lng->txt(
"last_login").
": ".$login;
 
  732                         $cgui->addItem(
"id[]", $id, $caption);
 
  735                 $this->tpl->setContent($cgui->getHTML());
 
  745                 $_POST[
"selectedAction"] = 
"delete";
 
  754                 $_POST[
"selectedAction"] = 
"activate";
 
  763                 $_POST[
"selectedAction"] = 
"deactivate";
 
  772                 $_POST[
"selectedAction"] = 
"accessRestrict";
 
  781                 $_POST[
"selectedAction"] = 
"accessFree";
 
  795                 global 
$tpl, $rbacsystem;
 
  798                 if (
$_GET[
"baseClass"] == 
'ilRepositoryGUI')
 
  800                         $this->tabs_gui->clearTargets();
 
  803                 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
 
  805                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  809                 $tpl->setContent($this->form->getHTML());
 
  821                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  825                 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
  830                 $this->form->addItem($fi);
 
  832                 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
 
  833                 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
 
  835                 $this->form->setTitle($lng->txt(
"import_users"));
 
  836                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  849                 if (@is_dir($import_dir))
 
  854                 if (strtolower(
$_GET[
"baseClass"]) == 
'iladministrationgui')
 
  856                         $this->ctrl->redirect($this, 
"view");
 
  861                         $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
 
  874                 $importDir = 
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id(); 
 
  887                 if (
$_GET[
"baseClass"] == 
'ilRepositoryGUI')
 
  889                         $this->tabs_gui->clearTargets();
 
  893                 if ($this->form->checkInput())
 
  895                         include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  896                         include_once 
'./Services/User/classes/class.ilUserImportParser.php';
 
  898                         global $rbacreview, $rbacsystem, 
$tree, 
$lng;
 
  901                         $this->tpl->addBlockfile(
"ADM_CONTENT", 
"adm_content", 
"tpl.usr_import_roles.html", 
"Services/User");
 
  906                         if (@is_dir($import_dir))
 
  913                         $file_name = $_FILES[
"importFile"][
"name"];
 
  914                         $parts = pathinfo($file_name);
 
  915                         $full_path = $import_dir.
"/".$file_name;
 
  918                         if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
 
  921                                 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
 
  922                                         , $this->ilias->error_obj->MESSAGE);
 
  925                                 $_FILES[
"importFile"][
"name"], $full_path);
 
  928                         if (strtolower($parts[
"extension"]) == 
"zip")
 
  935                                 foreach ($file_list as $a_file)
 
  937                                         if (substr($a_file[
'entry'],-4) == 
'.xml')
 
  939                                                 $xml_file = $import_dir.
"/".$a_file[
'entry'];
 
  943                                 if (is_null($xml_file))
 
  945                                         $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
 
  946                                         $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
 
  952                                 $xml_file = $full_path;
 
  956                         if (!is_file($xml_file))
 
  959                                 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
 
  960                                         .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
 
  963                         require_once(
"./Services/User/classes/class.ilUserImportParser.php");
 
  968                         $importParser->startParsing();
 
  969                         switch ($importParser->getErrorLevel())
 
  974                                         $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
 
  978                                         $this->ilias->raiseError(
 
  979                                                 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
 
  980                                                 $this->ilias->error_obj->MESSAGE
 
  987                         $this->tpl->setCurrentBlock(
"role_selection_form");
 
  988                         $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
 
  989                         $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
 
  990                         $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
 
  991                         $this->tpl->setVariable(
"IMPORT_FILE", $file_name);
 
  992                         $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
 
  993                         $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
 
  994                         $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
 
  995                         $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
 
  996                         $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
 
  997                         $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
 
 1001                         $importParser->startParsing();
 
 1002                         $roles = $importParser->getCollectedRoles();
 
 1005                         $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
 
 1006                         $gl_roles = array();
 
 1007                         $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
 
 1008                         foreach ($all_gl_roles as $obj_data)
 
 1019                                 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
 
 1022                                         if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
 
 1024                                                 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
 
 1030                         $got_globals = 
false;
 
 1031                         foreach($roles as $role_id => $role)
 
 1033                                 if ($role[
"type"] == 
"Global")
 
 1037                                                 $got_globals = 
true;
 
 1039                                                 $this->tpl->setCurrentBlock(
"global_role_section");
 
 1040                                                 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
 
 1041                                                 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
 
 1045                                         $pre_select = array_search($role[name], $gl_roles);
 
 1048                                                 switch($role[
"name"])
 
 1050                                                         case "Administrator":   
 
 1051                                                                 $pre_select = array_search(
"Administrator", $gl_roles);
 
 1055                                                                 $pre_select = array_search(
"User", $gl_roles);
 
 1059                                                                 $pre_select = array_search(
"User", $gl_roles);
 
 1063                                                                 $pre_select = array_search(
"Guest", $gl_roles);
 
 1067                                                                 $pre_select = array_search(
"User", $gl_roles);
 
 1071                                         $this->tpl->setCurrentBlock(
"global_role");
 
 1072                                         $role_select = 
ilUtil::formSelect($pre_select, 
"role_assign[".$role_id.
"]", $gl_roles, 
false, 
true);
 
 1073                                         $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
 
 1074                                         $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
 
 1075                                         $this->tpl->parseCurrentBlock();
 
 1080                         $got_locals = 
false;
 
 1081                         foreach($roles as $role_id => $role)
 
 1083                                 if ($role[
"type"] == 
"Local")
 
 1092                                 $this->tpl->setCurrentBlock(
"local_role_section");
 
 1093                                 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
 
 1094                                 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
 
 1105                                         $loc_roles = array();
 
 1106                                         foreach($roles as $role_id => $role)
 
 1108                                                 if ($role[
"type"] == 
"Local")
 
 1110                                                         $searchName = (substr($role[
'name'],0,1) == 
'#') ? $role[
'name'] : 
'#'.$role[
'name'];
 
 1111                                                         $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
 
 1112                                                         foreach ($matching_role_ids as $mid) {
 
 1113                                                                 if (! in_array($mid, $loc_roles)) {
 
 1114                                                                         $loc_roles[] = array(
'obj_id'=>$mid);
 
 1123                                         $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
 
 1128                                 $l_roles_mailbox_searcharray = array();
 
 1129                                 foreach ($loc_roles as $key => $loc_role)
 
 1132                                         $rolf = $rbacreview->getFoldersAssignedToRole($loc_role[
"obj_id"],
true);
 
 1138                                         if (!$rbacreview->isDeleted($rolf[0])
 
 1139                                         && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
 
 1140                                         && $rolf[0] != ROLE_FOLDER_ID
 
 1154                                                 if ($this->tree->isInTree($rolf[0]))
 
 1158                                                         $tmpPath = $this->tree->getPathFull($rolf[0]);
 
 1159                                                         for ($i = 1, 
$n = count($tmpPath) - 1; $i < 
$n; $i++)
 
 1165                                                                 if ($i < 3 || $i > $n - 3)
 
 1169                                                                 else if ($i == 3 || $i == $n - 3)
 
 1174                                                                 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
 
 1179                                                         $path = 
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role[
"obj_id"].
")</b>";
 
 1181                                                 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role[
'obj_id']);
 
 1182                                                 $l_roles[$loc_role[
'obj_id']] = $roleMailboxAddress.
', '.
$path;
 
 1187                                 natcasesort($l_roles);
 
 1188                                 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role"); 
 
 1189                                 foreach($roles as $role_id => $role)
 
 1191                                         if ($role[
"type"] == 
"Local")
 
 1193                                                 $this->tpl->setCurrentBlock(
"local_role");
 
 1194                                                 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
 
 1195                                                 $searchName = (substr($role[
'name'],0,1) == 
'#') ? $role[
'name'] : 
'#'.$role[
'name'];
 
 1196                                                 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
 
 1197                                                 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] : 
"";
 
 1202                                                         $selectable_roles = array();
 
 1203                                                         $selectable_roles[
""] =  $this->lng->txt(
"usrimport_ignore_role");
 
 1204                                                         foreach ($matching_role_ids as $id)
 
 1206                                                                 $selectable_roles[$id] =  $l_roles[$id];
 
 1208                                                         $role_select = 
ilUtil::formSelect($pre_select, 
"role_assign[".$role_id.
"]", $selectable_roles, 
false, 
true);
 
 1210                                                         $role_select = 
ilUtil::formSelect($pre_select, 
"role_assign[".$role_id.
"]", $l_roles, 
false, 
true);
 
 1212                                                 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
 
 1213                                                 $this->tpl->parseCurrentBlock();
 
 1219                         $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
 
 1224                         $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
 
 1225                         $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
 
 1229                         $this->lng->loadLanguageModule(
"mail");
 
 1230                         include_once 
'./Services/User/classes/class.ilObjUserFolder.php';
 
 1232                         if (trim($amail[
"body"]) != 
"" && trim($amail[
"subject"]) != 
"")
 
 1234                                 $this->tpl->setCurrentBlock(
"inform_user");
 
 1235                                 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
 
 1238                                         $this->tpl->setVariable(
"SEND_MAIL", 
" checked=\"checked\"");
 
 1240                                 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
 
 1241                                         $this->lng->txt(
"user_send_new_account_mail"));
 
 1242                                 $this->tpl->parseCurrentBlock();
 
 1247                         $this->form->setValuesByPost();
 
 1248                         $tpl->setContent($this->form->getHtml());
 
 1260                 if (
$_GET[
"baseClass"] == 
'ilRepositoryGUI')
 
 1262                         $this->tabs_gui->clearTargets();
 
 1265                 include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
 1266                 include_once 
'./Services/User/classes/class.ilUserImportParser.php';
 
 1268                 global $rbacreview, $rbacsystem, 
$tree, 
$lng;
 
 1270                 switch (
$_POST[
"conflict_handling_choice"])
 
 1272                         case "update_on_conflict" :
 
 1275                         case "ignore_on_conflict" :
 
 1287                 if (
$_POST[
"role_assign"])
 
 1289                         $global_roles = $rbacreview->getGlobalRoles();
 
 1290                         $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
 
 1291                         foreach (
$_POST[
"role_assign"] as $role_id)
 
 1295                                         if (in_array($role_id, $global_roles))
 
 1297                                                 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
 
 1299                                                         if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
 
 1305                                                                 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"), 
 
 1306                                                                         $this->ilias->error_obj->MESSAGE);
 
 1312                                                 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
 
 1313                                                 if ($rbacreview->isDeleted($rolf[0])
 
 1314                                                         || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
 
 1317                                                         $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"), 
 
 1318                                                                 $this->ilias->error_obj->MESSAGE);
 
 1326                 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
 
 1327                 $importParser->startParsing();
 
 1332                 switch ($importParser->getErrorLevel())
 
 1338                                 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")), 
true);
 
 1341                                 $this->ilias->raiseError(
 
 1342                                         $this->lng->txt(
"user_import_failed")
 
 1343                                         .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
 
 1344                                         $this->ilias->error_obj->MESSAGE
 
 1349                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
 1351                         $this->ctrl->redirect($this, 
"view");
 
 1356                         $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
 
 1363                 global $rbacsystem,
$ilias;
 
 1367                 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
 
 1369                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
 1372                 if(!count($app_users =& $ilias->account->getAppliedUsers()))
 
 1379                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.usr_applied_users.html", 
"Services/User");
 
 1380                 $this->lng->loadLanguageModule(
'crs');
 
 1383                 foreach($app_users as 
$usr_id)
 
 1388                         $f_result[$counter][]   = $tmp_user->getLogin();
 
 1389                         $f_result[$counter][]   = $tmp_user->getFirstname();
 
 1390                         $f_result[$counter][]   = $tmp_user->getLastname();
 
 1392                         if($tmp_user->getTimeLimitUnlimited())
 
 1394                                 $f_result[$counter][]   = 
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
 
 1398                                 $limit = 
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
 
 1399                                 $limit .= 
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
 
 1401                                 $f_result[$counter][]   = $limit;
 
 1415                 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
 
 1417                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
 
 1420                 $this->lng->loadLanguageModule(
'crs');
 
 1424                 if(!isset(
$_SESSION[
'error_post_vars']))
 
 1426                         ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
 
 1429                 if(!count(
$_POST[
"users"]))
 
 1445                         $title .= $tmp_user->getLogin();
 
 1455                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.usr_edit_applied_users.html", 
"Services/User");
 
 1456                 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
 
 1459                 $time_limit_unlimited = 
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ? 
 
 1462                 $time_limit_start = 
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ? 
 
 1465                 $time_limit_end = 
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ? 
 
 1471                 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
 
 1473                 $this->tpl->setVariable(
"TITLE",
$title);
 
 1474                 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
 
 1475                 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
 
 1476                 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
 
 1477                 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
 
 1478                 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
 
 1479                 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
 
 1483                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
 
 1484                                                                                                                                                                          date(
"d",$time_limit_start)));
 
 1485                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
 
 1486                                                                                                                                                                            date(
"m",$time_limit_start)));
 
 1487                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
 
 1488                                                                                                                                                                           date(
"Y",$time_limit_start)));
 
 1489                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
 
 1490                                                                                                                                                                           date(
"G",$time_limit_start)));
 
 1491                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
 
 1492                                                                                                                                                                           date(
"i",$time_limit_start)));
 
 1493                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
 
 1494                                                                                                                                                                    date(
"d",$time_limit_end)));
 
 1495                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
 
 1496                                                                                                                                                                          date(
"m",$time_limit_end)));
 
 1497                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
 
 1498                                                                                                                                                                         date(
"Y",$time_limit_end)));
 
 1499                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
 
 1500                                                                                                                                                                           date(
"G",$time_limit_end)));
 
 1501                 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
 
 1502                                                                                                                                                                           date(
"i",$time_limit_end)));
 
 1503                 if($this->ilias->account->getTimeLimitUnlimited())
 
 1505                         $this->tpl->setVariable(
"ROWSPAN",3);
 
 1506                         $this->tpl->setCurrentBlock(
"unlimited");
 
 1507                         $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
 
 1508                         $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
 
 1509                         $this->tpl->parseCurrentBlock();
 
 1513                         $this->tpl->setVariable(
"ROWSPAN",2);
 
 1521                 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
 
 1523                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
 
 1529                 if(!
$_POST[
'au'][
'time_limit_unlimited'])
 
 1540                 #if(!$this->ilias->account->getTimeLimitUnlimited()) 
 1542                 #       if($start < $this->ilias->account->getTimeLimitFrom() or 
 1543                 #          $end > $this->ilias->account->getTimeLimitUntil()) 
 1545                 #               $_SESSION['error_post_vars'] = $_POST; 
 1546                 #               ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners')); 
 1547                 #               $this->editAppliedUsersObject(); 
 1557                         $tmp_user->setTimeLimitUnlimited((
int) 
$_POST[
'au'][
'time_limit_unlimited']);
 
 1558                         $tmp_user->setTimeLimitFrom($start);
 
 1559                         $tmp_user->setTimeLimitUntil($end);
 
 1560                         $tmp_user->setTimeLimitMessage(0);
 
 1561                         $tmp_user->update();
 
 1576                 $tpl =& $tbl->getTemplateObject();
 
 1579                 $tpl->setCurrentBlock(
"tbl_form_header");
 
 1581                 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
 
 1582                 $tpl->parseCurrentBlock();
 
 1584                 $tpl->setCurrentBlock(
"tbl_action_btn");
 
 1585                 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
 
 1586                 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
 
 1587                 $tpl->parseCurrentBlock();
 
 1589                 $tpl->setCurrentBlock(
"tbl_action_row");
 
 1590                 $tpl->setVariable(
"COLUMN_COUNTS",5);
 
 1592                 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
 
 1593                 $tpl->parseCurrentBlock();
 
 1597                 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.png",$this->lng->txt(
"users"));
 
 1598                 $tbl->setHeaderNames(array(
'',
 
 1599                                                                    $this->lng->txt(
"login"),
 
 1600                                                                    $this->lng->txt(
"firstname"),
 
 1601                                                                    $this->lng->txt(
"lastname"),
 
 1602                                                                    $this->lng->txt(
"time_limits")));
 
 1603                 $header_params = $this->ctrl->getParameterArray($this, 
"appliedUsers");
 
 1604                 $tbl->setHeaderVars(array(
"",
 
 1609                                                         array($header_params));
 
 1610                 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
 
 1616                 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
 
 1623                 include_once 
"./Services/Table/classes/class.ilTableGUI.php";
 
 1630                 $offset = 
$_GET[
"offset"];
 
 1631                 $order = 
$_GET[
"sort_by"];
 
 1632                 $direction = 
$_GET[
"sort_order"];
 
 1635                 $tbl->setOrderColumn($order);
 
 1636                 $tbl->setOrderDirection($direction);
 
 1637                 $tbl->setOffset($offset);
 
 1638                 $tbl->setLimit(
$_GET[
"limit"]);
 
 1639                 $tbl->setMaxCount(count($result_set));
 
 1640                 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
 
 1641                 $tbl->setData($result_set);
 
 1649                 for($i=0;$i<=60;$i++)
 
 1651                     $days[$i] = $i < 10 ? 
"0".$i : $i;
 
 1656                 for($i=0;$i<24;$i++)
 
 1658                     $days[$i] = $i < 10 ? 
"0".$i : $i;
 
 1663                 for($i=1;$i<32;$i++)
 
 1665                     $days[$i] = $i < 10 ? 
"0".$i : $i;
 
 1670                 for($i=1;$i<13;$i++)
 
 1672                     $month[$i] = $i < 10 ? 
"0".$i : $i;
 
 1677                 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
 
 1686         return mktime($a_time_arr[
"hour"],
 
 1687                       $a_time_arr[
"minute"],
 
 1688                       $a_time_arr[
"second"],
 
 1689                       $a_time_arr[
"month"],
 
 1691                       $a_time_arr[
"year"]);
 
 1710                 include_once 
'./Services/User/classes/class.ilUserAccountSettings.php';
 
 1713                 $show_blocking_time_in_days = $ilSetting->get(
'loginname_change_blocking_time') / 86400;
 
 1714                 $show_blocking_time_in_days = (float)$show_blocking_time_in_days;
 
 1716                 $this->form->setValuesByArray(
 
 1718                                 'lua'   => $aset->isLocalUserAdministrationEnabled(),
 
 1719                                 'lrua'  => $aset->isUserAccessRestricted(),
 
 1720                                 'allow_change_loginname' => (bool)$ilSetting->get(
'allow_change_loginname'),
 
 1721                                 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
 
 1722                                 'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
 
 1723                                 'loginname_change_blocking_time' => (float)$show_blocking_time_in_days,
 
 1724                                 'user_adm_alpha_nav' => (
int)$ilSetting->get(
'user_adm_alpha_nav'),
 
 1726                                 'user_reactivate_code' => (int)$ilSetting->get(
'user_reactivate_code'),
 
 1727                                 'user_own_account' => (int)$ilSetting->get(
'user_delete_own_account'),
 
 1728                                 'user_own_account_email' => $ilSetting->get(
'user_delete_own_account_email')
 
 1732                 $this->tpl->setContent($this->form->getHTML());
 
 1745                 if($this->form->checkInput())
 
 1749                         if(!strlen($this->form->getInput(
'loginname_change_blocking_time')))
 
 1752                                 $this->form->getItemByPostVar(
'loginname_change_blocking_time')
 
 1753                                                                                 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
 
 1758                                 include_once 
'./Services/User/classes/class.ilUserAccountSettings.php';
 
 1763                                 $ilSetting->set(
'allow_change_loginname', (
int)$this->form->getInput(
'allow_change_loginname'));
 
 1764                                 $ilSetting->set(
'create_history_loginname', (
int)$this->form->getInput(
'create_history_loginname'));
 
 1765                                 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->form->getInput(
'reuse_of_loginnames'));
 
 1766                                 $save_blocking_time_in_seconds = (int)($this->form->getInput(
'loginname_change_blocking_time') * 86400);
 
 1767                                 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
 
 1768                                 $ilSetting->set(
'user_adm_alpha_nav', (
int)$this->form->getInput(
'user_adm_alpha_nav'));
 
 1770                                 $ilSetting->set(
'user_portfolios', (
int)$this->form->getInput(
'user_portfolios'));
 
 1771                                 $ilSetting->set(
'user_reactivate_code', (
int)$this->form->getInput(
'user_reactivate_code'));
 
 1773                                 $ilSetting->set(
'user_delete_own_account', (
int)$this->form->getInput(
'user_own_account'));
 
 1774                                 $ilSetting->set(
'user_delete_own_account_email', $this->form->getInput(
'user_own_account_email'));
 
 1788                 $this->form->setValuesByPost();         
 
 1789                 $this->tpl->setContent($this->form->getHTML());
 
 1800                 $this->tabs_gui->setTabActive(
'settings');
 
 1801                 $this->tabs_gui->setSubTabActive(
'general_settings');
 
 1803                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1805                 $this->form->setFormAction($this->ctrl->getFormAction($this, 
'saveGeneralSettings'));
 
 1807                 $this->form->setTitle($this->lng->txt(
'general_settings'));
 
 1809                 $lua = 
new ilCheckboxInputGUI($this->lng->txt(
'enable_local_user_administration'),
'lua');
 
 1810                 $lua->
setInfo($this->lng->txt(
'enable_local_user_administration_info'));
 
 1812                 $this->form->addItem($lua);
 
 1815                 $lrua->
setInfo($this->lng->txt(
'restrict_user_access_info'));
 
 1817                 $this->form->addItem($lrua);
 
 1820                 $alph = 
new ilCheckboxInputGUI($this->lng->txt(
'user_adm_enable_alpha_nav'), 
'user_adm_alpha_nav');
 
 1823                 $this->form->addItem($alph);
 
 1832                 $code = 
new ilCheckboxInputGUI($this->lng->txt(
"user_account_code_setting"), 
"user_reactivate_code");
 
 1833                 $code->
setInfo($this->lng->txt(
'user_account_code_setting_info'));
 
 1834                 $this->form->addItem($code);            
 
 1837                 $own = 
new ilCheckboxInputGUI($this->lng->txt(
"user_allow_delete_own_account"), 
"user_own_account");
 
 1838                 $this->form->addItem($own);             
 
 1839                 $own_email = 
new ilEMailInputGUI($this->lng->txt(
"user_delete_own_account_notification_email"), 
"user_own_account_email");
 
 1840                 $own->addSubItem($own_email);
 
 1843                 $log->setTitle($this->lng->txt(
'loginname_settings'));
 
 1844                 $this->form->addItem(
$log);
 
 1846                 $chbChangeLogin = 
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'), 
'allow_change_loginname');
 
 1848                 $this->form->addItem($chbChangeLogin);          
 
 1849                 $chbCreateHistory = 
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'), 
'create_history_loginname');
 
 1850                 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
 
 1851                 $chbCreateHistory->setValue(1);
 
 1853                 $chbChangeLogin->addSubItem($chbCreateHistory); 
 
 1854                 $chbReuseLoginnames = 
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'), 
'reuse_of_loginnames');
 
 1856                 $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
 
 1858                 $chbChangeLogin->addSubItem($chbReuseLoginnames);
 
 1859                 $chbChangeBlockingTime = 
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'), 
'loginname_change_blocking_time');
 
 1861                 $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
 
 1862                 $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
 
 1863                 $chbChangeBlockingTime->setSize(10);
 
 1864                 $chbChangeBlockingTime->setMaxLength(10);
 
 1865                 $chbChangeLogin->addSubItem($chbChangeBlockingTime);            
 
 1867                 $this->form->addCommandButton(
'saveGeneralSettings', $this->lng->txt(
'save'));
 
 1887                 include_once 
'Services/Search/classes/class.ilUserSearchOptions.php';
 
 1888                 $lng->loadLanguageModule(
"administration");
 
 1889                 $lng->loadLanguageModule(
"mail");
 
 1891                 $ilTabs->activateTab(
'settings');
 
 1892                 $ilTabs->activateSubTab(
'standard_fields');
 
 1894                 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
 
 1896                 if($this->confirm_change) 
$tab->setConfirmChange();
 
 1897                 $tpl->setContent(
$tab->getHTML());
 
 1907                 include_once 
'Services/Search/classes/class.ilUserSearchOptions.php';
 
 1908                 include_once 
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
 
 1913                 include_once(
"./Services/User/classes/class.ilUserProfile.php");
 
 1915                 $up->skipField(
"username");
 
 1916                 $field_properties = $up->getStandardFields();
 
 1917                 $profile_fields = array_keys($field_properties);
 
 1920                 foreach ($profile_fields as $field)
 
 1922                         if (    
$_POST[
"chb"][
"required_".$field] &&
 
 1923                                         !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
 
 1934                         $this->confirm_change = 1;
 
 1940                 $fixed_required_fields = array(
 
 1947                         "hits_per_page" => 0,
 
 1948                         "show_users_online" => 0,
 
 1949                         "hide_own_online_status" => 0
 
 1954                 if ($privacy->enabledCourseExport() == 
true && 
 
 1955                         $privacy->courseConfirmationRequired() == 
true && 
 
 1958                         foreach ($profile_fields as $field)
 
 1960                                 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) && 
$_POST[
"chb"][
"course_export_" . $field] == 
"1")
 
 1962                                         #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export')); 
 1963                                         #$this->confirm_change = 1; 
 1964                                         #$this->settingsObject(); 
 1970                 if($action == 
'save')
 
 1972                         include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
 
 1976                 foreach ($profile_fields as $field)
 
 1984                         if (!
$_POST[
"chb"][
"visible_".$field] && !$field_properties[$field][
"visible_hide"])
 
 1986                                 $ilias->setSetting(
"usr_settings_hide_".$field, 
"1");
 
 1990                                 $ilias->deleteSetting(
"usr_settings_hide_".$field);
 
 1993                         if (!
$_POST[
"chb"][
"changeable_" . $field] && !$field_properties[$field][
"changeable_hide"])
 
 1995                                 $ilias->setSetting(
"usr_settings_disable_".$field, 
"1");
 
 1999                                 $ilias->deleteSetting(
"usr_settings_disable_".$field);
 
 2003                         if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field] && !$field_properties[$field][
"visib_reg_hide"])
 
 2005                                 $ilSetting->set(
'usr_settings_visib_reg_'.$field, 
'1');
 
 2009                                 $ilSetting->set(
'usr_settings_visib_reg_'.$field, 
'0');
 
 2012                         if ((
int)
$_POST[
'chb'][
'visib_lua_' . $field])
 
 2015                                 $ilSetting->set(
'usr_settings_visib_lua_'.$field, 
'1');
 
 2019                                 $ilSetting->set(
'usr_settings_visib_lua_'.$field, 
'0');
 
 2022                         if ((
int)
$_POST[
'chb'][
'changeable_lua_' . $field])
 
 2025                                 $ilSetting->set(
'usr_settings_changeable_lua_'.$field, 
'1');
 
 2029                                 $ilSetting->set(
'usr_settings_changeable_lua_'.$field, 
'0');
 
 2032                         if (
$_POST[
"chb"][
"export_" . $field] && !$field_properties[$field][
"export_hide"])
 
 2034                                 $ilias->setSetting(
"usr_settings_export_".$field, 
"1");
 
 2038                                 $ilias->deleteSetting(
"usr_settings_export_".$field);
 
 2042                         if (
$_POST[
"chb"][
"course_export_" . $field] && !$field_properties[$field][
"course_export_hide"])
 
 2044                                 $ilias->setSetting(
"usr_settings_course_export_".$field, 
"1");
 
 2048                                 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
 
 2052                         if (
$_POST[
"chb"][
"group_export_" . $field] && !$field_properties[$field][
"group_export_hide"])
 
 2054                                 $ilias->setSetting(
"usr_settings_group_export_".$field, 
"1");
 
 2058                                 $ilias->deleteSetting(
"usr_settings_group_export_".$field);
 
 2061                         $is_fixed = array_key_exists($field, $fixed_required_fields);
 
 2062                         if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed && 
$_POST[
"chb"][
"required_".$field])
 
 2064                                 $ilias->setSetting(
"require_".$field, 
"1");
 
 2068                                 $ilias->deleteSetting(
"require_" . $field);
 
 2072                 if (
$_POST[
"select"][
"default_hits_per_page"])
 
 2074                         $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
 
 2077                 if (
$_POST[
"select"][
"default_show_users_online"])
 
 2079                         $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
 
 2082                 if (
$_POST[
"chb"][
"export_preferences"])
 
 2084                         $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
 
 2086                         $ilias->deleteSetting(
"usr_settings_export_preferences");
 
 2089                 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
 
 2101                 $action[-1] = $this->lng->txt(
'all_users');
 
 2102                 $action[1] = $this->lng->txt(
'usr_active_only');
 
 2103                 $action[0] = $this->lng->txt(
'usr_inactive_only');
 
 2104                 $action[2] = $this->lng->txt(
'usr_limited_access_only');
 
 2105                 $action[3] = $this->lng->txt(
'usr_without_courses');
 
 2106                 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
 
 2107                 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
 
 2108                 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
 
 2109                 $action[7] = $this->lng->txt(
"usr_filter_role");
 
 2122                 if(!isset(
$_POST[
"file"]))
 
 2124                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2127                 if (count(
$_POST[
"file"]) > 1)
 
 2129                         $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 2134                 $export_dir = $this->
object->getExportDirectory();
 
 2143                 if(!isset(
$_POST[
"file"]))
 
 2145                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2149                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2151                 $cgui->setFormAction($this->ctrl->getFormAction($this));
 
 2152                 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
 
 2153                 $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelDeleteExportFile");
 
 2154                 $cgui->setConfirm($this->lng->txt(
"confirm"), 
"deleteExportFile");              
 
 2162                         $cgui->addItem(
"file[]", $file, $caption);
 
 2165                 $this->tpl->setContent($cgui->getHTML());
 
 2174                 $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");
 
 2183                 $export_dir = $this->
object->getExportDirectory();
 
 2186                         $file = basename($file);
 
 2188                         $exp_file = $export_dir.
"/".
$file;
 
 2189                         if (@is_file($exp_file))
 
 2194                 $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");
 
 2211                 if (
$_POST[
"cmd"][
"export"])
 
 2213                         $this->
object->buildExportFile(
$_POST[
"export_type"]);
 
 2214                         $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");
 
 2218                 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_export.html',
'Services/User');
 
 2220                 $export_types = array(
 
 2221                         "userfolder_export_excel_x86",
 
 2222                         "userfolder_export_csv",
 
 2223                         "userfolder_export_xml" 
 2227                 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
 2231                 $this->tpl->addBlockfile(
"EXPORT_FILES", 
"export_files", 
"tpl.table.html");
 
 2234                 $this->tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.usr_export_file_row.html", 
"Services/User");
 
 2238                 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
 
 2240                 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
 
 2241                         $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
 
 2242                 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this, 
"export"));
 
 2244                 $tbl->enabled[
"sort"] = 
false;
 
 2245                 $tbl->setColumnWidth(array(
"1%", 
"49%", 
"25%", 
"25%"));
 
 2248                 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
 
 2249                 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
 
 2250                 $tbl->setLimit(
$_GET[
"limit"]);
 
 2251                 $tbl->setOffset(
$_GET[
"offset"]);
 
 2252                 $tbl->setMaxCount($this->maxcount);             
 
 2255                 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
 
 2259                 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
 
 2260                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 2261                 $this->tpl->setVariable(
"BTN_NAME", 
"confirmDeleteExportFile");
 
 2262                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
 
 2263                 $this->tpl->parseCurrentBlock();
 
 2265                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 2266                 $this->tpl->setVariable(
"BTN_NAME", 
"downloadExportFile");
 
 2267                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
 
 2268                 $this->tpl->parseCurrentBlock();
 
 2271                 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
 
 2274                 $export_files = $this->
object->getExportFiles();
 
 2276                 $tbl->setMaxCount(count($export_files));
 
 2277                 $export_files = array_slice($export_files, 
$_GET[
"offset"], 
$_GET[
"limit"]);
 
 2281                 if(count($export_files) > 0)
 
 2284                         foreach($export_files as $exp_file)
 
 2286                                 $this->tpl->setCurrentBlock(
"tbl_content");
 
 2287                                 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
 
 2290                                 $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 2292                                 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
 
 2293                                 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
 
 2295                                 $file_arr = explode(
"__", $exp_file[
"filename"]);
 
 2298                                 $this->tpl->parseCurrentBlock();
 
 2301                         $this->tpl->setCurrentBlock(
"selectall");
 
 2302                         $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
 
 2303                         $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 2304                         $this->tpl->parseCurrentBlock();
 
 2317                 $this->tpl->parseCurrentBlock();
 
 2320                 foreach ($export_types as $export_type)
 
 2322                         $this->tpl->setCurrentBlock(
"option");
 
 2323                         $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
 
 2324                         $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
 
 2325                         $this->tpl->parseCurrentBlock();
 
 2328                 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
 
 2329                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 2336                 $lng->loadLanguageModule(
"meta");
 
 2337                 $lng->loadLanguageModule(
"mail");
 
 2339                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2341                 $form->setFormAction($ilCtrl->getFormAction($this));
 
 2344                 $form->setTitle($lng->txt(
"user_new_account_mail"));
 
 2345                 $form->setDescription($lng->txt(
"user_new_account_mail_desc"));
 
 2347                 $langs = $lng->getInstalledLanguages();
 
 2348                 foreach($langs as $lang_key)
 
 2350                         $amail = $this->
object->_lookupNewAccountMail($lang_key);
 
 2352                         $title = $lng->txt(
"meta_l_".$lang_key);
 
 2353                         if ($lang_key == $lng->getDefaultLanguage())
 
 2355                                 $title .= 
" (".$lng->txt(
"default").
")";
 
 2359                         $header->setTitle(
$title);
 
 2360                         $form->addItem($header);
 
 2362                         $subj = 
new ilTextInputGUI($lng->txt(
"subject"), 
"subject_".$lang_key);
 
 2364                         $subj->
setValue($amail[
"subject"]);
 
 2365                         $form->addItem($subj);
 
 2367                         $salg = 
new ilTextInputGUI($lng->txt(
"mail_salutation_general"), 
"sal_g_".$lang_key);
 
 2370                         $form->addItem($salg);
 
 2372                         $salf = 
new ilTextInputGUI($lng->txt(
"mail_salutation_female"), 
"sal_f_".$lang_key);
 
 2375                         $form->addItem($salf);
 
 2377                         $salm = 
new ilTextInputGUI($lng->txt(
"mail_salutation_male"), 
"sal_m_".$lang_key);
 
 2380                         $form->addItem($salm);
 
 2386                         $body->setCols(100);
 
 2387                         $form->addItem($body);
 
 2389                         $att = 
new ilFileInputGUI($lng->txt(
"attachment"), 
"att_".$lang_key);
 
 2390                         $att->setAllowDeletion(
true);
 
 2391                         if($amail[
"att_file"])
 
 2393                                 $att->
setValue($amail[
"att_file"]);
 
 2395                         $form->addItem($att);
 
 2398                 $form->addCommandButton(
"saveNewAccountMail", $lng->txt(
"save"));
 
 2399                 $form->addCommandButton(
"cancelNewAccountMail", $lng->txt(
"cancel"));
 
 2412                 $this->tabs_gui->setTabActive(
'settings');
 
 2413                 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
 
 2417                 $ftpl = 
new ilTemplate(
'tpl.usrf_new_account_mail.html', 
true, 
true, 
'Services/User');
 
 2418                 $ftpl->setVariable(
"FORM", $form->getHTML());
 
 2422                 $ftpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
 
 2423                 $ftpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
 
 2424                 $ftpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
 
 2425                 $ftpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
 
 2426                 $ftpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
 
 2427                 $ftpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
 
 2428                 $ftpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
 
 2429                 $ftpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
 
 2430                 $ftpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
 
 2431                 $ftpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
 
 2432                 $ftpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
 
 2433                 $ftpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
 
 2434                 $ftpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
 
 2435                 $ftpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
 
 2436                 $ftpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
 
 2437                 $ftpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));    
 
 2439                 $this->tpl->setContent($ftpl->get());
 
 2444                 $this->ctrl->redirect($this, 
"settings");
 
 2451                 $langs = $lng->getInstalledLanguages();
 
 2452                 foreach($langs as $lang_key)
 
 2454                         $this->
object->_writeNewAccountMail($lang_key,
 
 2461                         if($_FILES[
"att_".$lang_key][
"tmp_name"])
 
 2463                                 $this->
object->_updateAccountMailAttachment($lang_key, 
 
 2464                                         $_FILES[
"att_".$lang_key][
"tmp_name"],
 
 2465                                         $_FILES[
"att_".$lang_key][
"name"]);                             
 
 2468                         if (
$_POST[
"att_".$lang_key.
"_delete"])
 
 2470                                 $this->
object->_deleteAccountMailAttachment($lang_key);
 
 2475                 $this->ctrl->redirect($this, 
"newAccountMail");
 
 2490                 include_once 
'Services/Tracking/classes/class.ilObjUserTracking.php';
 
 2494                 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
 
 2496                         $tabs_gui->addTarget(
"obj_usrf",
 
 2497                                 $this->ctrl->getLinkTarget($this, 
"view"), array(
"view",
"delete",
"resetFilter", 
"userAction", 
""), 
"", 
"");
 
 2499                         $tabs_gui->addTarget(
 
 2500                                 "search_user_extended",
 
 2501                                 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''),
 
 2503                                 "ilrepositorysearchgui",
 
 2508                 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
 
 2510                         $tabs_gui->addTarget(
"settings",
 
 2511                                 $this->ctrl->getLinkTarget($this, 
"generalSettings"),array(
'settings',
'generalSettings',
'listUserDefinedField',
'newAccountMail'));
 
 2513                         $tabs_gui->addTarget(
"export",
 
 2514                                 $this->ctrl->getLinkTarget($this, 
"export"), 
"export", 
"", 
"");
 
 2519                                 $tabs_gui->addTarget(
"learning_progress",
 
 2520                                                                          $this->ctrl->getLinkTarget($this, 
"learningProgress"), 
"learningProgress", 
"", 
"");
 
 2524                 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
 
 2526                         $tabs_gui->addTarget(
"perm_settings",
 
 2527                                                                  $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"), 
 
 2528                                                                  array(
"perm",
"info",
"owner"), 
'ilpermissiongui');
 
 2543                                 $this->tabs_gui->addSubTabTarget(
 
 2545                                         $this->ctrl->getLinkTarget($this, 
'generalSettings'), 
'generalSettings', get_class($this));                                                                                              
 
 2546                                 $this->tabs_gui->addSubTabTarget(
"standard_fields",
 
 2547                                                                                                  $this->ctrl->getLinkTarget($this,
'settings'),
 
 2548                                                                                                  array(
"settings", 
"saveGlobalUserSettings"), get_class($this));
 
 2549                                 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
 
 2550                                                                                                  $this->ctrl->getLinkTargetByClass(
"ilcustomuserfieldsgui", 
"listUserDefinedFields"),
 
 2551                                                                                                  "listUserDefinedFields",get_class($this));
 
 2552                                 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
 
 2553                                                                                                  $this->ctrl->getLinkTarget($this,
'newAccountMail'),
 
 2554                                                                                                  "newAccountMail",get_class($this));                            
 
 2555                                 $this->tabs_gui->addSubTab(
"account_codes", $this->lng->txt(
"user_account_codes"),
 
 2556                                                                                          $this->ctrl->getLinkTargetByClass(
"ilaccountcodesgui"));                                                                                                
 
 2565                 $show_blocking_time_in_days = (int)$ilSetting->get(
'loginname_change_blocking_time') / 86400;
 
 2568                 $this->loginSettingsForm->setValuesByArray(array(
 
 2569                         'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
 
 2570                         'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
 
 2571                         'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
 
 2572                         'loginname_change_blocking_time' => (float)$show_blocking_time_in_days
 
 2575                 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
 
 2581                 $this->tabs_gui->setTabActive(
'settings');
 
 2582                 $this->tabs_gui->setSubTabActive(
'loginname_settings');
 
 2584                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2586                 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this, 
'saveLoginnameSettings'));
 
 2587                 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
 
 2589                 $chbChangeLogin = 
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'), 
'allow_change_loginname');
 
 2591                 $this->loginSettingsForm->addItem($chbChangeLogin);             
 
 2592                         $chbCreateHistory = 
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'), 
'create_history_loginname');
 
 2593                         $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
 
 2594                         $chbCreateHistory->setValue(1);
 
 2595                 $chbChangeLogin->addSubItem($chbCreateHistory); 
 
 2596                         $chbReuseLoginnames = 
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'), 
'reuse_of_loginnames');
 
 2598                         $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
 
 2599                 $chbChangeLogin->addSubItem($chbReuseLoginnames);
 
 2600                         $chbChangeBlockingTime = 
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'), 
'loginname_change_blocking_time');
 
 2602                         $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
 
 2603                         $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
 
 2604                         $chbChangeBlockingTime->setSize(10);
 
 2605                         $chbChangeBlockingTime->setMaxLength(10);
 
 2606                 $chbChangeLogin->addSubItem($chbChangeBlockingTime);            
 
 2608                 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
 
 2616                 if($this->loginSettingsForm->checkInput())
 
 2620                         if(!strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
 
 2623                                 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
 
 2624                                                                                 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
 
 2629                                 $save_blocking_time_in_seconds = (int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time') * 86400;
 
 2631                                 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
 
 2632                                 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
 
 2633                                 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'reuse_of_loginnames'));
 
 2634                                 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
 
 2647                 $this->loginSettingsForm->setValuesByPost();            
 
 2649                 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
 
 2661                 if ($ilAccess->checkAccess(
"read", 
"", $a_target))
 
 2663                         ilUtil::redirect(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=".$a_target.
"&jmpToUser=".$a_user);
 
 2668                         if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
 2675                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
 
 2687                         $ilCtrl->setParameterByClass(
"ilobjusergui", 
"obj_id", (
int) $_GET[
"jmpToUser"]);
 
 2688                         $ilCtrl->redirectByClass(
"ilobjusergui", 
"view");
 
 2697                 if(!count((array) $a_usr_ids))
 
 2703                 $_POST[
'id'] = $a_usr_ids;
 
 2706                 if(stristr($a_cmd, 
"export"))
 
 2708                         $cmd = $a_cmd.
"Object";
 
 2709                         return $this->
$cmd();
 
 2712                 $_POST[
'selectedAction'] = $a_cmd;              
 
 2724                                 'activate' => $this->lng->txt(
'activate'),
 
 2725                                 'deactivate' => $this->lng->txt(
'deactivate'),
 
 2726                                 'accessRestrict' => $this->lng->txt(
'accessRestrict'),
 
 2727                                 'accessFree' => $this->lng->txt(
'accessFree')
 
 2730                         if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
 
 2732                                 $cmds[
"delete"] = $this->lng->txt(
"delete");
 
 2739                                 'activateUsers' => $this->lng->txt(
'activate'),
 
 2740                                 'deactivateUsers' => $this->lng->txt(
'deactivate'),
 
 2741                                 'restrictAccess' => $this->lng->txt(
'accessRestrict'),
 
 2742                                 'freeAccess' => $this->lng->txt(
'accessFree')
 
 2745                         if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
 
 2747                                 $cmds[
"deleteUsers"] = $this->lng->txt(
"delete");                               
 
 2752                 $export_types = array(
"userfolder_export_excel_x86", 
"userfolder_export_csv", 
"userfolder_export_xml");         
 
 2753                 foreach ($export_types as $type)
 
 2755                         $cmd = explode(
"_", $type);
 
 2757                         $cmds[
'usrExport'.ucfirst(
$cmd)] = $this->lng->txt(
'export').
' - '.
 
 2758                                 $this->lng->txt($type);
 
 2772                 $this->
object->buildExportFile(
"userfolder_export_excel_x86", $user_ids);               
 
 2773                 $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");
 
 2784                 $this->
object->buildExportFile(
"userfolder_export_csv", $user_ids);             
 
 2785                 $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");
 
 2796                 $this->
object->buildExportFile(
"userfolder_export_xml", $user_ids);             
 
 2797                 $this->ctrl->redirectByClass(
"ilobjuserfoldergui", 
"export");