CAS authentification configuration

skala
Hubert Borderiou 14 years ago
parent 98d3424974
commit 7a86cb95f0
  1. 18
      main/admin/user_add.php
  2. 21
      main/admin/user_edit.php
  3. 5
      main/install/configuration.dist.php
  4. 12
      plugin/add_cas_login_button/readme.txt

@ -128,14 +128,24 @@ if (api_get_setting('login_is_email') != 'true') {
// Password // Password
$group = array(); $group = array();
$auth_sources = 0; //make available wider as we need it in case of form reset (see below) $auth_sources = 0; //make available wider as we need it in case of form reset (see below)
$nb_ext_auth_source_added = 0;
if (count($extAuthSource) > 0) { if (count($extAuthSource) > 0) {
$group[] =& HTML_QuickForm::createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
$auth_sources = array(); $auth_sources = array();
foreach($extAuthSource as $key => $info) { foreach($extAuthSource as $key => $info) {
$auth_sources[$key] = $key; // @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
// Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
// extAuthSource always on for CAS even if not activated
// same action for file user_edit.php
if (($key == CAS_AUTH_SOURCE && api_get_setting('cas_activate') === 'true') || ($key != CAS_AUTH_SOURCE)) {
$auth_sources[$key] = $key;
$nb_ext_auth_source_added++;
}
} }
$group[] =& HTML_QuickForm::createElement('select', 'auth_source', null, $auth_sources); if ($nb_ext_auth_source_added > 0) {
$group[] =& HTML_QuickForm::createElement('static', '', '', '<br />'); $group[] =& HTML_QuickForm::createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
$group[] =& HTML_QuickForm::createElement('select', 'auth_source', null, $auth_sources);
$group[] =& HTML_QuickForm::createElement('static', '', '', '<br />');
}
} }
$group[] =& HTML_QuickForm::createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'<br />', 1); $group[] =& HTML_QuickForm::createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'<br />', 1);
$group[] =& HTML_QuickForm::createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0); $group[] =& HTML_QuickForm::createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0);

@ -158,15 +158,26 @@ if (api_get_setting('login_is_email') != 'true') {
// Password // Password
$form->addElement('radio', 'reset_password', get_lang('Password'), get_lang('DontResetPassword'), 0); $form->addElement('radio', 'reset_password', get_lang('Password'), get_lang('DontResetPassword'), 0);
$nb_ext_auth_source_added = 0;
if (count($extAuthSource) > 0) { if (count($extAuthSource) > 0) {
$group[] =& HTML_QuickForm::createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication').' ', 3);
$auth_sources = array(); $auth_sources = array();
foreach($extAuthSource as $key => $info) { foreach($extAuthSource as $key => $info) {
$auth_sources[$key] = $key; // @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
// Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
// extAuthSource always on for CAS even if not activated
// same action for file user_add.php
if (($key == CAS_AUTH_SOURCE && api_get_setting('cas_activate') === 'true') || ($key != CAS_AUTH_SOURCE)) {
$auth_sources[$key] = $key;
$nb_ext_auth_source_added++;
}
}
if ($nb_ext_auth_source_added > 0) {
// @todo check the radio button for external authentification and select the external authentification in the menu
$group[] =& HTML_QuickForm::createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication').' ', 3);
$group[] =& HTML_QuickForm::createElement('select', 'auth_source', null, $auth_sources);
$group[] =& HTML_QuickForm::createElement('static', '', '', '<br />');
$form->addGroup($group, 'password', null, '', false);
} }
$group[] =& HTML_QuickForm::createElement('select', 'auth_source', null, $auth_sources);
$group[] =& HTML_QuickForm::createElement('static', '', '', '<br />');
$form->addGroup($group, 'password', null, '', false);
} }
$form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1); $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
$group = array(); $group = array();

@ -87,6 +87,11 @@ $_configuration['db_admin_path'] = '';
// $extAuthSource["ldap"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/login.php"; // $extAuthSource["ldap"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/login.php";
// $extAuthSource["ldap"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/newUser.php"; // $extAuthSource["ldap"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/newUser.php";
// //
// Go to Chamilo > Administration > CAS to activate CAS
// You can leave these lines uncommented even if you don't use CAS
$extAuthSource["cas"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/cas/login.php";
$extAuthSource["cas"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/cas/newUser.php";
//
// To fetch external login information, uncomment those 2 lines and modify files auth/external_login/newUser.php and auth/external_login/updateUser.php files // To fetch external login information, uncomment those 2 lines and modify files auth/external_login/newUser.php and auth/external_login/updateUser.php files
// $extAuthSource["external_login"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/newUser.php"; // $extAuthSource["external_login"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/newUser.php";
// $extAuthSource["external_login"]["updateUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/updateUser.php"; // $extAuthSource["external_login"]["updateUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/updateUser.php";

@ -1,7 +1,7 @@
README README
<br/><br/>
This plugin add a button to allow user to login to Chamilo with CAS authentification. This plugin add a button to allow user to login to Chamilo with CAS authentification.<br/><br/>
You have to activate your CAS connection to display this button. You have to activate your CAS connection to display this button.<br/>
You have to configure your CAS connection to have the button works. You have to configure your CAS connection to have the button works.<br/>
To activate and configure CAS, for your Chamilo platform, go to Administration > Configuration settings > CAS To activate and configure CAS, for your Chamilo platform, go to Administration > Configuration settings > CAS<br/>
This plugin has been done to be added in the login_top region, but you can put it where you want. This plugin has been done to be added in the login_top region, but you can put it where you want.<br/>
Loading…
Cancel
Save