ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjAuthSettingsGUI Class Reference

Class ilObjAuthSettingsGUI. More...

+ Inheritance diagram for ilObjAuthSettingsGUI:
+ Collaboration diagram for ilObjAuthSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public. More...
 
 viewObject ()
 
 authSettingsObject ()
 display settings menu More...
 
 loginInfoObject ()
 displays login information of all installed languages More...
 
 cancelObject ()
 
 setAuthModeObject ()
 
 editSOAPObject ()
 Configure soap settings. More...
 
 testSoapAuthConnectionObject ()
 
 saveSOAPObject ()
 validates all input data, save them to database if correct and active chosen auth mode More...
 
 editScriptObject ()
 Configure Custom settings. More...
 
 saveScriptObject ()
 validates all input data, save them to database if correct and active chosen auth mode More...
 
 getAuthModeTitle ()
 get the title of auth mode More...
 
 updateAuthRolesObject ()
 
 updateAuthModeDeterminationObject ()
 update auth mode determination More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 
 getTabs ()
 get tabs public More...
 
 setSubTabs ($a_tab)
 set sub tabs More...
 
 apacheAuthSettingsObject ($form=false)
 
 saveApacheSettingsObject ()
 
 getApacheAuthSettingsForm ()
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Member Functions

 initAuthModeDetermination ()
 init auth mode determinitation form More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Member Functions

 validateApacheAuthAllowedDomains ($text)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjAuthSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 25 of file class.ilObjAuthSettingsGUI.php.

26  {
27  $this->type = "auth";
28  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
29 
30  $this->lng->loadLanguageModule('registration');
31 
32  define('LDAP_DEFAULT_PORT',389);
33  define('RADIUS_DEFAULT_PORT',1812);
34 
35  }

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjAuthSettingsGUI::addToExternalSettingsForm (   $a_form_id)
Parameters
string$a_form_id
Returns
array

Definition at line 1190 of file class.ilObjAuthSettingsGUI.php.

References array, ilAdministrationSettingsFormHandler\FORM_ACCESSIBILITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

1191  {
1192  switch($a_form_id)
1193  {
1195  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
1196  $fields = array(
1197  'adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForLogin(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
1198  );
1199 
1200  return array('authentication_settings' => array('authSettings', $fields));
1201  }
1202  }
Create styles array
The data for the language used.

◆ apacheAuthSettingsObject()

ilObjAuthSettingsGUI::apacheAuthSettingsObject (   $form = false)

Definition at line 998 of file class.ilObjAuthSettingsGUI.php.

References $path, ilObjectGUI\$tpl, and getApacheAuthSettingsForm().

Referenced by saveApacheSettingsObject().

999  {
1000  global $tpl;
1001 
1002  $this->tabs_gui->setTabActive("apache_auth_settings");
1003 
1004  if (!$form)
1005  {
1006  $form = $this->getApacheAuthSettingsForm();
1007 
1008  $settings = new ilSetting('apache_auth');
1009  $settingsMap = $settings->getAll();
1010 
1011  $path = ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt';
1012  if (file_exists($path) && is_readable($path)) {
1013  $settingsMap['apache_auth_domains'] = file_get_contents($path);
1014  }
1015 
1016  $form->setValuesByArray($settingsMap);
1017  }
1018  $tpl->setVariable('ADM_CONTENT', $form->getHtml());
1019  }
ILIAS Setting Class.
$path
Definition: aliased.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ authSettingsObject()

ilObjAuthSettingsGUI::authSettingsObject ( )

display settings menu

public

Definition at line 50 of file class.ilObjAuthSettingsGUI.php.

References $ilSetting, $server, ilAuthUtils\_getActiveAuthModes(), ilAuthUtils\_getAllAuthModes(), ilAuthUtils\_getAuthModeName(), ilObjUser\_getNumberOfUsersPerAuthMode(), ilObjRole\_lookupRegisterAllowed(), array, AUTH_APACHE, AUTH_CAS, AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, AUTH_SHIBBOLETH, ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), initAuthModeDetermination(), ilLDAPServer\isAuthModeLDAP(), and setSubTabs().

Referenced by updateAuthModeDeterminationObject(), and viewObject().

51  {
52  global $rbacsystem, $ilSetting;
53 
54  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
55  {
56  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
57  }
58 
59  $this->tabs_gui->setTabActive('authentication_settings');
60  $this->setSubTabs('authSettings');
61  $this->tabs_gui->setSubTabActive("auth_settings");
62 
63  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_general.html",
64  "Services/Authentication");
65 
66  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
67  $this->tpl->setVariable("TXT_AUTH_TITLE", $this->lng->txt("auth_select"));
68 
69  $this->tpl->setVariable("TXT_AUTH_MODE", $this->lng->txt("auth_mode"));
70  $this->tpl->setVariable("TXT_AUTH_DEFAULT", $this->lng->txt("default"));
71  $this->tpl->setVariable("TXT_AUTH_ACTIVE", $this->lng->txt("active"));
72  $this->tpl->setVariable("TXT_AUTH_NUM_USERS", $this->lng->txt("num_users"));
73 
74  $this->tpl->setVariable("TXT_LOCAL", $this->lng->txt("auth_local"));
75  $this->tpl->setVariable("TXT_LDAP", $this->lng->txt("auth_ldap"));
76  $this->tpl->setVariable("TXT_SHIB", $this->lng->txt("auth_shib"));
77 
78  $this->tpl->setVariable("TXT_CAS", $this->lng->txt("auth_cas"));
79 
80  $this->tpl->setVariable("TXT_RADIUS", $this->lng->txt("auth_radius"));
81  $this->tpl->setVariable("TXT_SCRIPT", $this->lng->txt("auth_script"));
82 
83  $this->tpl->setVariable("TXT_APACHE", $this->lng->txt("auth_apache"));
84 
86  $auth_modes = ilAuthUtils::_getAllAuthModes();
88  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
89  // icon handlers
90  $icon_ok = "<img src=\"".ilUtil::getImagePath("icon_ok.svg")."\" alt=\"".$this->lng->txt("enabled")."\" title=\"".$this->lng->txt("enabled")."\" border=\"0\" vspace=\"0\"/>";
91  $icon_not_ok = "<img src=\"".ilUtil::getImagePath("icon_not_ok.svg")."\" alt=\"".$this->lng->txt("disabled")."\" title=\"".$this->lng->txt("disabled")."\" border=\"0\" vspace=\"0\"/>";
92 
93 
94  foreach($auth_modes as $mode => $mode_name)
95  {
96  if(!in_array($mode,$valid_modes) && !ilLDAPServer::isAuthModeLDAP($mode))
97  {
98  continue;
99  }
100 
101  $this->tpl->setCurrentBlock('auth_mode');
102 
104  {
106  $this->tpl->setVariable("AUTH_NAME", $server->getName());
107  $this->tpl->setVariable('AUTH_ACTIVE',$server->isActive() ? $icon_ok : $icon_not_ok);
108  }
109  else
110  {
111  $this->tpl->setVariable("AUTH_NAME", $this->lng->txt("auth_" . $mode_name));
112  $this->tpl->setVariable('AUTH_ACTIVE',$this->ilias->getSetting($mode_name . '_active') || $mode == AUTH_LOCAL ? $icon_ok : $icon_not_ok);
113  }
114 
115  if ($ilSetting->get('auth_mode') == $mode)
116  {
117  $this->tpl->setVariable("AUTH_CHECKED","checked=\"checked\"");
118 
119  $this->tpl->setVariable("AUTH_USER_NUM",
120  ((int) $auth_cnt[$mode_name] + $auth_cnt["default"])." (".$this->lng->txt("auth_per_default").
121  ": ".$auth_cnt["default"].")");
122  }
123  else
124  {
125  $this->tpl->setVariable("AUTH_USER_NUM",
126  (int) $auth_cnt[$mode_name]);
127  }
128  $this->tpl->setVariable("AUTH_ID",$mode_name);
129  $this->tpl->setVariable("AUTH_VAL",$mode);
130  $this->tpl->parseCurrentBlock();
131  }
132 
133  $this->tpl->setVariable("TXT_CONFIGURE", $this->lng->txt("auth_configure"));
134  $this->tpl->setVariable("TXT_AUTH_REMARK", $this->lng->txt("auth_remark_non_local_auth"));
135  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
136  $this->tpl->setVariable("CMD_SUBMIT", "setAuthMode");
137 
138  // auth mode determinitation
139  if($this->initAuthModeDetermination())
140  {
141  $this->tpl->setVariable('TABLE_AUTH_DETERMINATION',$this->form->getHTML());
142  }
143 
144  // roles table
145  $this->tpl->setVariable("FORMACTION_ROLES",
146  $this->ctrl->getFormAction($this));
147  $this->tpl->setVariable("TXT_AUTH_ROLES", $this->lng->txt("auth_active_roles"));
148  $this->tpl->setVariable("TXT_ROLE", $this->lng->txt("obj_role"));
149  $this->tpl->setVariable("TXT_ROLE_AUTH_MODE", $this->lng->txt("auth_role_auth_mode"));
150  $this->tpl->setVariable("CMD_SUBMIT_ROLES", "updateAuthRoles");
151 
152  include_once("./Services/AccessControl/classes/class.ilObjRole.php");
153  $reg_roles = ilObjRole::_lookupRegisterAllowed();
154 
155  // auth mode selection
156  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
157  $active_auth_modes = ilAuthUtils::_getActiveAuthModes();
158 
159  foreach ($reg_roles as $role)
160  {
161  foreach ($active_auth_modes as $auth_name => $auth_key)
162  {
163  // do not list auth modes with external login screen
164  // even not default, because it can easily be set to
165  // a non-working auth mode
166  if ($auth_name == "default" || $auth_name == "cas"
167  || $auth_name == "shibboleth" || $auth_name == 'ldap'
168  || $auth_name == 'apache' || $auth_name == "ecs"
169  || $auth_name == "openid")
170  {
171  continue;
172  }
173 
174  $this->tpl->setCurrentBlock("auth_mode_selection");
175 
176  if ($auth_name == 'default')
177  {
178  $name = $this->lng->txt('auth_'.$auth_name)." (".$this->lng->txt('auth_'.ilAuthUtils::_getAuthModeName($auth_key)).")";
179  }
180  else if($id = ilLDAPServer::getServerIdByAuthMode($auth_key))
181  {
183  $name = $server->getName();
184  }
185  else
186  {
187  $name = $this->lng->txt('auth_'.$auth_name);
188  }
189 
190  $this->tpl->setVariable("AUTH_MODE_NAME", $name);
191 
192  $this->tpl->setVariable("AUTH_MODE", $auth_name);
193 
194  if ($role['auth_mode'] == $auth_name)
195  {
196  $this->tpl->setVariable("SELECTED_AUTH_MODE", "selected=\"selected\"");
197  }
198 
199  $this->tpl->parseCurrentBlock();
200  } // END auth_mode selection
201 
202  $this->tpl->setCurrentBlock("roles");
203  $this->tpl->setVariable("ROLE", $role['title']);
204  $this->tpl->setVariable("ROLE_ID", $role['id']);
205  $this->tpl->parseCurrentBlock();
206  }
207  }
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
const AUTH_LDAP
const AUTH_CAS
const AUTH_SHIBBOLETH
static _getActiveAuthModes()
const AUTH_APACHE
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
initAuthModeDetermination()
init auth mode determinitation form
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
Create styles array
The data for the language used.
$server
static _getAllAuthModes()
global $ilSetting
Definition: privfeed.php:17
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelObject()

ilObjAuthSettingsGUI::cancelObject ( )

Definition at line 242 of file class.ilObjAuthSettingsGUI.php.

243  {
244  $this->ctrl->redirect($this, "authSettings");
245  }

◆ editScriptObject()

ilObjAuthSettingsGUI::editScriptObject ( )

Configure Custom settings.

public

Definition at line 553 of file class.ilObjAuthSettingsGUI.php.

References $_SESSION.

554  {
555  global $rbacsystem;
556 
557  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
558  {
559  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
560  }
561 
562  if ($_SESSION["error_post_vars"])
563  {
564  $this->tpl->setVariable("AUTH_SCRIPT_NAME", $_SESSION["error_post_vars"]["auth_script"]["name"]);
565  }
566  else
567  {
568  // set already saved data
569  $settings = $this->ilias->getAllSettings();
570 
571  $this->tpl->setVariable("AUTH_SCRIPT_NAME", $settings["auth_script_name"]);
572  }
573 
574  $this->tabs_gui->setTabActive('auth_script');
575 
576  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_script.html",
577  "Services/Authentication");
578 
579  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
580  $this->tpl->setVariable("COLSPAN", 3);
581  $this->tpl->setVariable("TXT_AUTH_SCRIPT_TITLE", $this->lng->txt("auth_script_configure"));
582  $this->tpl->setVariable("TXT_OPTIONS", $this->lng->txt("options"));
583  $this->tpl->setVariable("TXT_AUTH_SCRIPT_NAME", $this->lng->txt("auth_script_name"));
584 
585  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
586  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
587  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
588  $this->tpl->setVariable("CMD_SUBMIT", "saveScript");
589  }
$_SESSION["AccountId"]
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ editSOAPObject()

ilObjAuthSettingsGUI::editSOAPObject ( )

Configure soap settings.

public

Definition at line 316 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $_SESSION, $https, $ilCtrl, $ilSetting, ilObjectGUI\$lng, $namespace, $ret, $server, array, object, and ilUtil\stripSlashes().

Referenced by testSoapAuthConnectionObject().

317  {
318  global $rbacsystem, $rbacreview, $ilSetting, $ilCtrl, $lng;
319 
320  if (!$rbacsystem->checkAccess("read",$this->object->getRefId()))
321  {
322  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
323  }
324 
325  $this->tabs_gui->setTabActive('auth_soap');
326 
327  //set Template
328  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.auth_soap.html','Services/Authentication');
329 
330  // compose role list
331  $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
332  $roles = array();
333 
334  foreach ($role_list as $role)
335  {
336  $roles[$role['obj_id']] = $role['title'];
337  }
338 
339  //set property form gui
340  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
341 
342  $soap_config = new ilPropertyFormGUI();
343  $soap_config->setTitle($this->lng->txt("auth_soap_auth"));
344  $soap_config->setDescription($this->lng->txt("auth_soap_auth_desc"));
345  $soap_config->setFormAction($this->ctrl->getFormAction($this, "editSOAP"));
346  $soap_config->addCommandButton("saveSOAP", $this->lng->txt("save"));
347  $soap_config->addCommandButton("editSOAP", $this->lng->txt("cancel"));
348 
349  //set activ
350  $active = new ilCheckboxInputGUI();
351  $active->setTitle($this->lng->txt("active"));
352  $active->setPostVar("soap[active]");
353 
354  //set server
355  $server = new ilTextInputGUI();
356  $server->setTitle($this->lng->txt("server"));
357  $server->setInfo($this->lng->txt("auth_soap_server_desc"));
358  $server->setPostVar("soap[server]");
359  $server->setSize(50);
360  $server->setMaxLength(256);
361  $server->setRequired(true);
362 
363  //set port
364  $port = new ilTextInputGUI();
365  $port->setTitle($this->lng->txt("port"));
366  $port->setInfo($this->lng->txt("auth_soap_port_desc"));
367  $port->setPostVar("soap[port]");
368  $port->setSize(7);
369  $port->setMaxLength(5);
370 
371  //set https
372  $https = new ilCheckboxInputGUI();
373  $https->setTitle($this->lng->txt("auth_soap_use_https"));
374  $https->setPostVar("soap[use_https]");
375 
376  //set uri
377  $uri = new ilTextInputGUI();
378  $uri->setTitle($this->lng->txt("uri"));
379  $uri->setInfo($this->lng->txt("auth_soap_uri_desc"));
380  $uri->setPostVar("soap[uri]");
381  $uri->setSize(50);
382  $uri->setMaxLength(256);
383 
384  //set namespace
385  $namespace = new ilTextInputGUI();
386  $namespace->setTitle($this->lng->txt("auth_soap_namespace"));
387  $namespace->setInfo($this->lng->txt("auth_soap_namespace_desc"));
388  $namespace->setPostVar("soap[namespace]");
389  $namespace->setSize(50);
390  $namespace->setMaxLength(256);
391 
392  //set dotnet
393  $dotnet = new ilCheckboxInputGUI();
394  $dotnet->setTitle($this->lng->txt("auth_soap_use_dotnet"));
395  $dotnet->setPostVar("soap[use_dotnet]");
396 
397  //set create users
398  $createuser = new ilCheckboxInputGUI();
399  $createuser->setTitle($this->lng->txt("auth_create_users"));
400  $createuser->setInfo($this->lng->txt("auth_soap_create_users_desc"));
401  $createuser->setPostVar("soap[create_users]");
402 
403  //set account mail
404  $sendmail = new ilCheckboxInputGUI();
405  $sendmail->setTitle($this->lng->txt("user_send_new_account_mail"));
406  $sendmail->setInfo($this->lng->txt("auth_new_account_mail_desc"));
407  $sendmail->setPostVar("soap[account_mail]");
408 
409  //set user default role
410  $defaultrole = new ilSelectInputGUI();
411  $defaultrole->setTitle($this->lng->txt("auth_user_default_role"));
412  $defaultrole->setInfo($this->lng->txt("auth_soap_user_default_role_desc"));
413  $defaultrole->setPostVar("soap[user_default_role]");
414  $defaultrole->setOptions($roles);
415 
416  //set allow local authentication
417  $allowlocal = new ilCheckboxInputGUI();
418  $allowlocal->setTitle($this->lng->txt("auth_allow_local"));
419  $allowlocal->setInfo($this->lng->txt("auth_soap_allow_local_desc"));
420  $allowlocal->setPostVar("soap[allow_local]");
421 
422  // get all settings
423  $settings = $ilSetting->getAll();
424 
425  // get values in error case
426  if ($_SESSION["error_post_vars"])
427  {
428  $active ->setChecked($_SESSION["error_post_vars"]["soap"]["active"]);
429  $server ->setValue($_SESSION["error_post_vars"]["soap"]["server"]);
430  $port ->setValue($_SESSION["error_post_vars"]["soap"]["port"]);
431  $https ->setChecked($_SESSION["error_post_vars"]["soap"]["use_https"]);
432  $uri ->setValue($_SESSION["error_post_vars"]["soap"]["uri"]);
433  $namespace ->setValue($_SESSION["error_post_vars"]["soap"]["namespace"]);
434  $dotnet ->setChecked($_SESSION["error_post_vars"]["soap"]["use_dotnet"]);
435  $createuser ->setChecked($_SESSION["error_post_vars"]["soap"]["create_users"]);
436  $allowlocal ->setChecked($_SESSION["error_post_vars"]["soap"]["allow_local"]);
437  $defaultrole->setValue($_SESSION["error_post_vars"]["soap"]["user_default_role"]);
438  $sendmail ->setChecked($_SESSION["error_post_vars"]["soap"]["account_mail"]);
439  }
440  else
441  {
442  $active ->setChecked($settings["soap_auth_active"]);
443  $server ->setValue($settings["soap_auth_server"]);
444  $port ->setValue($settings["soap_auth_port"]);
445  $https ->setChecked($settings["soap_auth_use_https"]);
446  $uri ->setValue($settings["soap_auth_uri"]);
447  $namespace ->setValue($settings["soap_auth_namespace"]);
448  $dotnet ->setChecked($settings["soap_auth_use_dotnet"]);
449  $createuser ->setChecked($settings["soap_auth_create_users"]);
450  $allowlocal ->setChecked($settings["soap_auth_allow_local"]);
451  $defaultrole->setValue($settings["soap_auth_user_default_role"]);
452  $sendmail ->setChecked($settings["soap_auth_account_mail"]);
453  }
454 
455  if (!$defaultrole->getValue())
456  {
457  $defaultrole->setValue(4);
458  }
459 
460  //add Items to property gui
461  $soap_config->addItem($active);
462  $soap_config->addItem($server);
463  $soap_config->addItem($port);
464  $soap_config->addItem($https);
465  $soap_config->addItem($uri);
466  $soap_config->addItem($namespace);
467  $soap_config->addItem($dotnet);
468  $soap_config->addItem($createuser);
469  $soap_config->addItem($sendmail);
470  $soap_config->addItem($defaultrole);
471  $soap_config->addItem($allowlocal);
472 
473  $this->tpl->setVariable("CONFIG_FORM", $soap_config->getHTML());
474 
475  // test form
476  $form = new ilPropertyFormGUI();
477  $form->setFormAction($ilCtrl->getFormAction($this));
478  $form->setTitle("Test Request");
479  $text_prop = new ilTextInputGUI("ext_uid", "ext_uid");
480  $form->addItem($text_prop);
481  $text_prop2 = new ilTextInputGUI("soap_pw", "soap_pw");
482  $form->addItem($text_prop2);
483  $cb = new ilCheckboxInputGUI("new_user", "new_user");
484  $form->addItem($cb);
485 
486  $form->addCommandButton("testSoapAuthConnection",
487  "Send");
488 
489  if ($ilCtrl->getCmd() == "testSoapAuthConnection")
490  {
491  include_once("./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
492  $ret = "<br />".ilSOAPAuth::testConnection(
493  ilUtil::stripSlashes($_POST["ext_uid"]),
494  ilUtil::stripSlashes($_POST["soap_pw"]),
495  (boolean) $_POST["new_user"]
496  );
497  }
498  $this->tpl->setVariable("TEST_FORM", $form->getHTML().$ret);
499  }
if($err=$client->getError()) $namespace
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
$https
Definition: imgupload.php:19
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
$server
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
$ret
Definition: parser.php:6
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjAuthSettingsGUI::executeCommand ( )

Execute command.

Called from control class ilAccessHandler $ilAccess ilErrorHandling $ilErr

Returns
void

Definition at line 816 of file class.ilObjAuthSettingsGUI.php.

References $cmd, $ilErr, $ret, object, ilObjectGUI\prepareOutput(), and setSubTabs().

817  {
818  global $ilAccess,$ilErr;
819 
820  $next_class = $this->ctrl->getNextClass($this);
821  $cmd = $this->ctrl->getCmd();
822  $this->prepareOutput();
823 
824 
825  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
826  {
827  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
828  }
829 
830  switch($next_class)
831  {
832  case 'ilregistrationsettingsgui':
833 
834  include_once './Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
835 
836  // Enable tabs
837  $this->tabs_gui->setTabActive('registration_settings');
838  $registration_gui = new ilRegistrationSettingsGUI();
839  $this->ctrl->forwardCommand($registration_gui);
840  break;
841 
842  case 'ilpermissiongui':
843 
844  // Enable tabs
845  $this->tabs_gui->setTabActive('perm_settings');
846 
847  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
848  $perm_gui = new ilPermissionGUI($this);
849  $ret =& $this->ctrl->forwardCommand($perm_gui);
850  break;
851 
852  case 'illdapsettingsgui':
853 
854  // Enable Tabs
855  $this->tabs_gui->setTabActive('auth_ldap');
856 
857  include_once './Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
858  $ldap_settings_gui = new ilLDAPSettingsGUI($this->object->getRefId());
859  $this->ctrl->forwardCommand($ldap_settings_gui);
860  break;
861 
862  case 'ilauthshibbolethsettingsgui':
863 
864  $this->tabs_gui->setTabActive('auth_shib');
865  include_once('./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
866  $shib_settings_gui = new ilAuthShibbolethSettingsGUI($this->object->getRefId());
867  $this->ctrl->forwardCommand($shib_settings_gui);
868  break;
869 
870  case 'ilcassettingsgui':
871 
872  $this->tabs_gui->setTabActive('auth_cas');
873  include_once './Services/CAS/classes/class.ilCASSettingsGUI.php';
874  $cas_settings = new ilCASSettingsGUI($this->object->getRefId());
875  $this->ctrl->forwardCommand($cas_settings);
876  break;
877 
878  case 'ilradiussettingsgui':
879 
880  $this->tabs_gui->setTabActive('auth_radius');
881  include_once './Services/Radius/classes/class.ilRadiusSettingsGUI.php';
882  $radius_settings_gui = new ilRadiusSettingsGUI($this->object->getRefId());
883  $this->ctrl->forwardCommand($radius_settings_gui);
884  break;
885 
886 
887  case 'ilauthloginpageeditorgui':
888 
889  $this->setSubTabs("authSettings");
890  $this->tabs_gui->setTabActive('authentication_settings');
891  $this->tabs_gui->setSubTabActive("auth_login_editor");
892 
893  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
894  $lpe = new ilAuthLoginPageEditorGUI($this->object->getRefId());
895  $this->ctrl->forwardCommand($lpe);
896  break;
897 
898  default:
899  if(!$cmd)
900  {
901  $cmd = "authSettings";
902  }
903  $cmd .= "Object";
904  $this->$cmd();
905 
906  break;
907  }
908  return true;
909  }
Login page editor settings GUI ILIAS page editor or richtext editor.
global $ilErr
Definition: raiseError.php:16
Class ilAuthShibbolethSettingsGUI.
$cmd
Definition: sahs_server.php:35
prepareOutput($a_show_subobjects=true)
prepare output
Class ilRegistrationSettingsGUI.
Create new PHPExcel object
obj_idprivate
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAuthSettingsGUI::getAdminTabs ( )

Definition at line 911 of file class.ilObjAuthSettingsGUI.php.

References getTabs().

912  {
913  $this->getTabs();
914  }
+ Here is the call graph for this function:

◆ getApacheAuthSettingsForm()

ilObjAuthSettingsGUI::getApacheAuthSettingsForm ( )

Definition at line 1070 of file class.ilObjAuthSettingsGUI.php.

References $GLOBALS, $options, $txt, ilObject\_lookupTitle(), ilSubEnabledFormPropertyGUI\addSubItem(), array, AUTH_APACHE, ilLDAPServer\getDataSource(), ilLDAPServer\getServerIds(), ilRadioOption\setDisabled(), ilFormPropertyGUI\setInfo(), and ilSelectInputGUI\setOptions().

Referenced by apacheAuthSettingsObject(), and saveApacheSettingsObject().

1071  {
1072  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1073 
1074  $form = new ilPropertyFormGUI();
1075  $form->setFormAction($this->ctrl->getFormAction($this));
1076  $form->setTitle($this->lng->txt('apache_settings'));
1077 
1078  $chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth');
1079  $form->addItem($chb_enabled);
1080 
1081  $chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate');
1082  $chb_enabled->addSubitem($chb_local_create_account);
1083 
1084  global $rbacreview;
1085  $roles = $rbacreview->getGlobalRolesArray();
1086  $select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role');
1087  $roleOptions = array();
1088  foreach($roles as $role) {
1089  $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']);
1090  }
1091  $select->setOptions($roleOptions);
1092  $select->setValue(4);
1093 
1094  $chb_local_create_account->addSubitem($select);
1095 
1096  $chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local');
1097  $form->addItem($chb_local);
1098 
1099  $chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap');
1100  $chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured'));
1101 
1102  $GLOBALS['lng']->loadLanguageModule('auth');
1103  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
1104  $servers = ilLDAPServer::getServerIds();
1105  if(count($servers))
1106  {
1107  $ldap_server_select = new ilSelectInputGUI($this->lng->txt('auth_ldap_server_ds'), 'apache_ldap_sid');
1108  $options[0] = $this->lng->txt('select_one');
1109  foreach($servers as $server_id)
1110  {
1111  $ldap_server = new ilLDAPServer($server_id);
1112  $options[$server_id] = $ldap_server->getName();
1113  }
1114  $ldap_server_select->setOptions($options);
1115  $ldap_server_select->setRequired(true);
1116 
1118  $ldap_server_select->setValue($ds);
1119 
1120  $chb_ldap->addSubItem($ldap_server_select);
1121  }
1122  $form->addItem($chb_ldap);
1123 
1124  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name');
1125  $txt->setRequired(true);
1126  $form->addItem($txt);
1127 
1128  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value');
1129  $txt->setRequired(true);
1130  $form->addItem($txt);
1131 
1132 
1133  $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page');
1134  $form->addItem($chb);
1135 
1136  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page');
1137  $txt->setRequired(true);
1138  $chb->addSubItem($txt);
1139 
1140  $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page');
1141  $form->addItem($chb);
1142 
1143  $sec = new ilFormSectionHeaderGUI();
1144  $sec->setTitle($this->lng->txt('apache_auth_username_config'));
1145  $form->addItem($sec);
1146 
1147  $rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type');
1148  $form->addItem($rag);
1149 
1150  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1);
1151  $rag->addOption($rao);
1152 
1153  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname');
1154  //$txt->setRequired(true);
1155  $rao->addSubItem($txt);
1156 
1157  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2);
1158  $rao->setDisabled(true);
1159  $rag->addOption($rao);
1160 
1161  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3);
1162  $rag->addOption($rao);
1163 
1164 /* $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname');
1165  $rao->addSubItem($txt);*/
1166 
1167  $sec = new ilFormSectionHeaderGUI();
1168  $sec->setTitle($this->lng->txt('apache_auth_security'));
1169  $form->addItem($sec);
1170 
1171  $txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains');
1172  $txt->setInfo($this->lng->txt('apache_auth_domains_description'));
1173 
1174  $form->addItem($txt);
1175 
1176  $form->addCommandButton('saveApacheSettings',$this->lng->txt('save'));
1177  $form->addCommandButton('cancel',$this->lng->txt('cancel'));
1178 
1179  return $form;
1180  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
const AUTH_APACHE
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
static getServerIds()
Get all server ids ilDB $ilDB.
if(!is_array($argv)) $options
This class represents a text property in a property form.
static getDataSource($a_auth_mode)
setOptions($a_options)
Set Options.
$txt
Definition: error.php:12
Create styles array
The data for the language used.
This class represents a text area property in a property form.
setDisabled($a_disabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthModeTitle()

ilObjAuthSettingsGUI::getAuthModeTitle ( )

get the title of auth mode

public

Returns
string language dependent title of auth mode

Definition at line 628 of file class.ilObjAuthSettingsGUI.php.

References AUTH_APACHE, AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, AUTH_SCRIPT, and AUTH_SHIBBOLETH.

Referenced by saveScriptObject(), and setAuthModeObject().

629  {
630  switch ($this->ilias->getSetting("auth_mode"))
631  {
632  case AUTH_LOCAL:
633  return $this->lng->txt("auth_local");
634  break;
635 
636  case AUTH_LDAP:
637  return $this->lng->txt("auth_ldap");
638  break;
639 
640  case AUTH_SHIBBOLETH:
641  return $this->lng->txt("auth_shib");
642  break;
643 
644  case AUTH_RADIUS:
645  return $this->lng->txt("auth_radius");
646  break;
647 
648  case AUTH_SCRIPT:
649  return $this->lng->txt("auth_script");
650  break;
651 
652  case AUTH_APACHE:
653  return $this->lng->txt("auth_apache");
654  break;
655 
656  default:
657  return $this->lng->txt("unknown");
658  break;
659  }
660  }
const AUTH_LDAP
const AUTH_SHIBBOLETH
const AUTH_APACHE
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
const AUTH_RADIUS
+ Here is the caller graph for this function:

◆ getTabs()

ilObjAuthSettingsGUI::getTabs ( )

get tabs public

Parameters
objecttabs gui object

Definition at line 921 of file class.ilObjAuthSettingsGUI.php.

References array, and object.

Referenced by getAdminTabs().

922  {
923  global $rbacsystem;
924 
925  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
926 
927  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
928  {
929  $this->tabs_gui->addTarget("authentication_settings", $this->ctrl->getLinkTarget($this, "authSettings"),
930  "", "", "");
931 
932  $this->tabs_gui->addTarget('registration_settings',
933  $this->ctrl->getLinkTargetByClass('ilregistrationsettingsgui','view'));
934 
935  $this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTargetByClass('illdapsettingsgui','serverList'),
936  "", "", "");
937 
938 
939  #$this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
940  # "", "", "");
941 
942  $this->tabs_gui->addTarget('auth_shib',$this->ctrl->getLinkTargetByClass('ilauthshibbolethsettingsgui','settings'));
943 
944  $this->tabs_gui->addTarget(
945  'auth_cas',
946  $this->ctrl->getLinkTargetByClass('ilcassettingsgui','settings')
947  );
948 
949  $this->tabs_gui->addTarget("auth_radius", $this->ctrl->getLinkTargetByClass('ilradiussettingsgui', "settings"),
950  "", "", "");
951 
952  $this->tabs_gui->addTarget("auth_soap", $this->ctrl->getLinkTarget($this, "editSOAP"),
953  "", "", "");
954 
955  $this->tabs_gui->addTarget("apache_auth_settings", $this->ctrl->getLinkTarget($this,'apacheAuthSettings'),
956  "", "", "");
957  }
958 
959  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
960  {
961  $this->tabs_gui->addTarget("perm_settings",
962  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
963  array("perm","info","owner"), 'ilpermissiongui');
964  }
965  }
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ initAuthModeDetermination()

ilObjAuthSettingsGUI::initAuthModeDetermination ( )
protected

init auth mode determinitation form

protected

Definition at line 683 of file class.ilObjAuthSettingsGUI.php.

References $counter, $header, $server, $text, ilAuthModeDetermination\_getInstance(), AUTH_APACHE, AUTH_LOCAL, AUTH_RADIUS, AUTH_SOAP, ilCaptchaUtil\checkFreetype(), ilAuthUtils\getAuthPlugins(), ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), ilLDAPServer\isAuthModeLDAP(), and ilFormPropertyGUI\setInfo().

Referenced by authSettingsObject().

684  {
685  if(is_object($this->form))
686  {
687  return true;
688  }
689  // Are there any authentication methods that support automatic determination ?
690 
691  include_once('Services/Authentication/classes/class.ilAuthModeDetermination.php');
693  if($det->getCountActiveAuthModes() <= 1)
694  {
695  return false;
696  }
697 
698  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
699  $this->form = new ilPropertyFormGUI();
700  $this->form->setFormAction($this->ctrl->getFormAction($this));
701  $this->form->setTableWidth('100%');
702  $this->form->setTitle($this->lng->txt('auth_auth_settings'));
703  $this->form->addCommandButton('updateAuthModeDetermination',$this->lng->txt('save'));
704 
705  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
706  $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
707  $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
708  $cap->setValue(1);
710  {
711  $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
712  }
713  $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
714  $this->form->addItem($cap);
715 
717  $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
718  $this->form->addItem($header);
719 
720  $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'),'kind');
721  $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
722  $kind->setValue($det->getKind());
723  $kind->setRequired(true);
724 
725  $option_user = new ilRadioOption($this->lng->txt('auth_by_user'),0);
726  $kind->addOption($option_user);
727 
728  $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'),1);
729 
730  include_once('Services/Authentication/classes/class.ilAuthUtils.php');
731 
732  $auth_sequenced = $det->getAuthModeSequence();
733  $counter = 1;
734  foreach($auth_sequenced as $auth_mode)
735  {
736  switch($auth_mode)
737  {
738  // begin-patch ldap_multiple
739  case ilLDAPServer::isAuthModeLDAP($auth_mode):
740  $auth_id = ilLDAPServer::getServerIdByAuthMode($auth_mode);
742  $text = $server->getName();
743  // end-patch ldap_multiple
744  break;
745  case AUTH_RADIUS:
746  $text = $this->lng->txt('auth_radius');
747  break;
748  case AUTH_LOCAL:
749  $text = $this->lng->txt('auth_local');
750  break;
751  case AUTH_SOAP:
752  $text = $this->lng->txt('auth_soap');
753  break;
754  case AUTH_APACHE:
755  $text = $this->lng->txt('auth_apache');
756  break;
757  // begin-patch auth_plugin
758  default:
759  foreach(ilAuthUtils::getAuthPlugins() as $pl)
760  {
761  $option = $pl->getMultipleAuthModeOptions($auth_mode);
762  $text = $option[$auth_mode]['txt'];
763  }
764  break;
765  // end-patch auth_plugin
766  }
767 
768  $pos = new ilTextInputGUI($text,'position['.$auth_mode.']');
769  $pos->setValue($counter++);
770  $pos->setSize(1);
771  $pos->setMaxLength(1);
772  $option_determination->addSubItem($pos);
773  }
774  $kind->addOption($option_determination);
775  $this->form->addItem($kind);
776  return true;
777  }
This class represents an option in a radio group.
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
This class represents a property form user interface.
This class represents a section header in a property form.
static checkFreetype()
Check whether captcha support is active.
This class represents a checkbox property in a property form.
const AUTH_APACHE
static getInstanceByServerId($a_server_id)
Get instance by server id.
setInfo($a_info)
Set Information Text.
$counter
static getAuthPlugins()
Get active enabled auth plugins.
This class represents a property in a property form.
$header
This class represents a text property in a property form.
const AUTH_LOCAL
const AUTH_SOAP
$server
$text
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loginInfoObject()

ilObjAuthSettingsGUI::loginInfoObject ( )

displays login information of all installed languages

public

Author
Michael Jansen

Definition at line 216 of file class.ilObjAuthSettingsGUI.php.

References $ilSetting, ilObjectGUI\$lng, and setSubTabs().

217  {
218  global $rbacsystem, $lng,$ilSetting;
219 
220  if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId()))
221  {
222  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
223  }
224 
225  $this->tabs_gui->setTabActive("authentication_settings");
226  $this->setSubTabs("authSettings");
227  $this->tabs_gui->setSubTabActive("auth_login_editor");
228 
229  $lng->loadLanguageModule("meta");
230 
231  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_login_messages.html",
232  "Services/Authentication");
233  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
234  $this->tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
235  $this->tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
236  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
237  $this->initLoginForm();
238  $this->tpl->setVariable('LOGIN_INFO',$this->form->getHTML());
239  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ saveApacheSettingsObject()

ilObjAuthSettingsGUI::saveApacheSettingsObject ( )

Definition at line 1021 of file class.ilObjAuthSettingsGUI.php.

References $ilCtrl, $ilSetting, apacheAuthSettingsObject(), array, AUTH_APACHE, AUTH_LOCAL, getApacheAuthSettingsForm(), ilUtil\sendSuccess(), and validateApacheAuthAllowedDomains().

1022  {
1023  global $ilCtrl;
1024  $form = $this->getApacheAuthSettingsForm();
1025  $form->setValuesByPost();
1026  /*$items = $form->getItems();
1027  foreach($items as $item)
1028  $item->validate();*/
1029  if ($form->checkInput())
1030  {
1031  $settings = new ilSetting('apache_auth');
1032  $fields = array
1033  (
1034  'apache_auth_indicator_name', 'apache_auth_indicator_value',
1035  'apache_enable_auth', 'apache_enable_local', 'apache_local_autocreate',
1036  'apache_enable_ldap', 'apache_auth_username_config_type',
1037  'apache_auth_username_direct_mapping_fieldname',
1038  'apache_default_role', 'apache_auth_target_override_login_page',
1039  'apache_auth_enable_override_login_page',
1040  'apache_auth_authenticate_on_login_page',
1041  'apache_ldap_sid'
1042 // 'apache_auth_username_by_function_functionname',
1043  );
1044 
1045  foreach($fields as $field)
1046  $settings->set($field, $form->getInput($field));
1047 
1048  if ($form->getInput('apache_enable_auth'))
1049  $this->ilias->setSetting('apache_active', true);
1050  else {
1051  $this->ilias->setSetting('apache_active', false);
1052  global $ilSetting;
1053  if ($ilSetting->get("auth_mode") == AUTH_APACHE) {
1054  $ilSetting->set("auth_mode", AUTH_LOCAL);
1055  }
1056  }
1057 
1058  $allowedDomains = $this->validateApacheAuthAllowedDomains($form->getInput('apache_auth_domains'));
1059  file_put_contents(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt', $allowedDomains);
1060 
1061  ilUtil::sendSuccess($this->lng->txt('apache_settings_changed_success'), true);
1062  $this->ctrl->redirect($this, 'apacheAuthSettings');
1063  }
1064  else
1065  {
1066  $this->apacheAuthSettingsObject($form);
1067  }
1068  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
const AUTH_APACHE
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ saveScriptObject()

ilObjAuthSettingsGUI::saveScriptObject ( )

validates all input data, save them to database if correct and active chosen auth mode

public

Definition at line 596 of file class.ilObjAuthSettingsGUI.php.

References $_POST, AUTH_SCRIPT, getAuthModeTitle(), and ilUtil\sendSuccess().

597  {
598  // validate required data
599  if (!$_POST["auth_script"]["name"])
600  {
601  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
602  }
603 
604  // validate script url
605  /*
606  if (( TODO ,$_POST["ldap"]["server"])) == false)
607  {
608  $this->ilias->raiseError($this->lng->txt("err_invalid_server"),$this->ilias->error_obj->MESSAGE);
609  }*/
610 
611  // TODO: check connection to server
612 
613  // all ok. save settings and activate auth by external script
614  $this->ilias->setSetting("auth_script_name", $_POST["auth_script"]["name"]);
615  $this->ilias->setSetting("auth_mode", AUTH_SCRIPT);
616 
617  ilUtil::sendSuccess($this->lng->txt("auth_mode_changed_to")." ".$this->getAuthModeTitle(),true);
618  $this->ctrl->redirect($this,'editScript');
619  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getAuthModeTitle()
get the title of auth mode
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSOAPObject()

ilObjAuthSettingsGUI::saveSOAPObject ( )

validates all input data, save them to database if correct and active chosen auth mode

public

Definition at line 511 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $ilSetting, $ilUser, and ilUtil\sendSuccess().

512  {
513  global $ilUser, $ilSetting, $rbacsystem;
514 
515  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
516  {
517  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
518  }
519 
520  // validate required data
521  if (!$_POST["soap"]["server"])
522  {
523  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
524  }
525 
526  // validate port
527  if ($_POST["soap"]["server"] != "" && (preg_match("/^[0-9]{0,5}$/",$_POST["soap"]["port"])) == false)
528  {
529  $this->ilias->raiseError($this->lng->txt("err_invalid_port"),$this->ilias->error_obj->MESSAGE);
530  }
531 
532  $ilSetting->set("soap_auth_server", $_POST["soap"]["server"]);
533  $ilSetting->set("soap_auth_port", $_POST["soap"]["port"]);
534  $ilSetting->set("soap_auth_active", $_POST["soap"]["active"]);
535  $ilSetting->set("soap_auth_uri", $_POST["soap"]["uri"]);
536  $ilSetting->set("soap_auth_namespace", $_POST["soap"]["namespace"]);
537  $ilSetting->set("soap_auth_create_users", $_POST["soap"]["create_users"]);
538  $ilSetting->set("soap_auth_allow_local", $_POST["soap"]["allow_local"]);
539  $ilSetting->set("soap_auth_account_mail", $_POST["soap"]["account_mail"]);
540  $ilSetting->set("soap_auth_use_https", $_POST["soap"]["use_https"]);
541  $ilSetting->set("soap_auth_use_dotnet", $_POST["soap"]["use_dotnet"]);
542  $ilSetting->set("soap_auth_user_default_role", $_POST["soap"]["user_default_role"]);
543  ilUtil::sendSuccess($this->lng->txt("auth_soap_settings_saved"),true);
544 
545  $this->ctrl->redirect($this,'editSOAP');
546  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setAuthModeObject()

ilObjAuthSettingsGUI::setAuthModeObject ( )

Definition at line 247 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $ilSetting, AUTH_LDAP, AUTH_RADIUS, AUTH_SCRIPT, getAuthModeTitle(), ilObjectGUI\getReturnLocation(), object, ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

248  {
249  global $rbacsystem,$ilSetting;
250 
251  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
252  {
253  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
254  }
255 
256  if (empty($_POST["auth_mode"]))
257  {
258  $this->ilias->raiseError($this->lng->txt("auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
259  }
260 
261  if ($_POST["auth_mode"] == AUTH_DEFAULT)
262  {
263  ilUtil::sendInfo($this->lng->txt("auth_mode").": ".$this->getAuthModeTitle()." ".$this->lng->txt("auth_mode_not_changed"),true);
264  $this->ctrl->redirect($this,'authSettings');
265  }
266 
267  switch ($_POST["auth_mode"])
268  {
269  case AUTH_LDAP:
270 
271  /*
272  if ($this->object->checkAuthLDAP() !== true)
273  {
274  ilUtil::sendInfo($this->lng->txt("auth_ldap_not_configured"),true);
275  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editLDAP", "", false, false)));
276  }
277  */
278  break;
279 
280  case AUTH_SHIB:
281  if ($this->object->checkAuthSHIB() !== true)
282  {
283  ilUtil::sendFailure($this->lng->txt("auth_shib_not_configured"),true);
284  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editSHIB", "", false, false)));
285  }
286  break;
287 
288  case AUTH_RADIUS:
289  if ($this->object->checkAuthRADIUS() !== true)
290  {
291  ilUtil::sendFailure($this->lng->txt("auth_radius_not_configured"),true);
292  $this->ctrl->redirect($this,'editRADIUS');
293  }
294  break;
295 
296  case AUTH_SCRIPT:
297  if ($this->object->checkAuthScript() !== true)
298  {
299  ilUtil::sendFailure($this->lng->txt("auth_script_not_configured"),true);
300  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editScript", "", false, false)));
301  }
302  break;
303  }
304 
305  $this->ilias->setSetting("auth_mode",$_POST["auth_mode"]);
306 
307  ilUtil::sendSuccess($this->lng->txt("auth_default_mode_changed_to")." ".$this->getAuthModeTitle(),true);
308  $this->ctrl->redirect($this,'authSettings');
309  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getAuthModeTitle()
get the title of auth mode
const AUTH_LDAP
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
static redirect($a_script)
http redirect to other script
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
$_POST["username"]
const AUTH_RADIUS
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAuthSettingsGUI::setSubTabs (   $a_tab)

set sub tabs

Definition at line 970 of file class.ilObjAuthSettingsGUI.php.

References $GLOBALS, and $ilUser.

Referenced by authSettingsObject(), executeCommand(), and loginInfoObject().

971  {
972  global $rbacsystem,$ilUser,$ilAccess;
973 
974  $GLOBALS['lng']->loadLanguageModule('auth');
975 
976  switch ($a_tab)
977  {
978  case 'authSettings':
979  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
980  {
981  $this->tabs_gui->addSubTabTarget("auth_settings",
982  $this->ctrl->getLinkTarget($this,'authSettings'),
983  "");
984  }
985  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
986  {
987  $this->tabs_gui->addSubTabTarget(
988  'auth_login_editor',
989  $this->ctrl->getLinkTargetByClass('ilauthloginpageeditorgui',''),
990  ''
991  );
992  }
993  break;
994  }
995  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ testSoapAuthConnectionObject()

ilObjAuthSettingsGUI::testSoapAuthConnectionObject ( )

Definition at line 501 of file class.ilObjAuthSettingsGUI.php.

References editSOAPObject().

502  {
503  $this->editSOAPObject();
504  }
editSOAPObject()
Configure soap settings.
+ Here is the call graph for this function:

◆ updateAuthModeDeterminationObject()

ilObjAuthSettingsGUI::updateAuthModeDeterminationObject ( )

update auth mode determination

public

Definition at line 785 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $counter, ilAuthModeDetermination\_getInstance(), array, authSettingsObject(), and ilUtil\sendSuccess().

786  {
787  include_once('Services/Authentication/classes/class.ilAuthModeDetermination.php');
789 
790  $det->setKind((int) $_POST['kind']);
791 
792  $pos = $_POST['position'] ? $_POST['position'] : array();
793  asort($pos,SORT_NUMERIC);
794 
795  $counter = 0;
796  foreach($pos as $auth_mode => $dummy)
797  {
798  $position[$counter++] = $auth_mode;
799  }
800  $det->setAuthModeSequence($position ? $position : array());
801  $det->save();
802 
803  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
804  ilCaptchaUtil::setActiveForLogin((bool)$_POST['activate_captcha_anonym']);
805 
806  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
807  $this->authSettingsObject();
808  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$counter
authSettingsObject()
display settings menu
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateAuthRolesObject()

ilObjAuthSettingsGUI::updateAuthRolesObject ( )

Definition at line 662 of file class.ilObjAuthSettingsGUI.php.

References $_POST, ilObjRole\_updateAuthMode(), and ilUtil\sendSuccess().

663  {
664  global $rbacsystem;
665 
666  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
667  {
668  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
669  }
670 
671  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
673 
674  ilUtil::sendSuccess($this->lng->txt("auth_mode_roles_changed"),true);
675  $this->ctrl->redirect($this,'authSettings');
676  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _updateAuthMode($a_roles)
redirection script todo: (a better solution should control the processing via a xml file) ...
$_POST["username"]
+ Here is the call graph for this function:

◆ validateApacheAuthAllowedDomains()

ilObjAuthSettingsGUI::validateApacheAuthAllowedDomains (   $text)
private

Definition at line 1182 of file class.ilObjAuthSettingsGUI.php.

References $text.

Referenced by saveApacheSettingsObject().

1182  {
1183  return join("\n", preg_split("/[\r\n]+/", $text));
1184  }
$text
+ Here is the caller graph for this function:

◆ viewObject()

ilObjAuthSettingsGUI::viewObject ( )

Definition at line 39 of file class.ilObjAuthSettingsGUI.php.

References authSettingsObject().

40  {
41  return $this->authSettingsObject();
42  }
authSettingsObject()
display settings menu
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: