mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Revert "Revert "New login method (saml). Ticket#3393""
This reverts commit f59665fe4bdc5bad2bfe7072f2f1fef33fcc1afe.
This commit is contained in:
parent
e8b6c8e50a
commit
b98056b65a
@ -124,7 +124,12 @@ echo '<div id="login_in">';
|
|||||||
'', 'class="login login_password" placeholder="'.__('Password').'"', false, true);
|
'', 'class="login login_password" placeholder="'.__('Password').'"', false, true);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '<div class="login_button">';
|
echo '<div class="login_button">';
|
||||||
html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"');
|
if ($config['auth'] == 'saml') {
|
||||||
|
html_print_submit_button(__("Login with SAML"), "login_button_saml", false, 'class="sub login_boton"');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"');
|
||||||
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
break;
|
break;
|
||||||
case 'logout':
|
case 'logout':
|
||||||
|
@ -255,12 +255,14 @@ echo '</form>';
|
|||||||
|
|
||||||
if (auth_method !== 'mysql') {
|
if (auth_method !== 'mysql') {
|
||||||
$('tr.remote').show();
|
$('tr.remote').show();
|
||||||
|
if (auth_method == 'saml') {
|
||||||
|
$('tr#table2-autocreate_remote_users').hide();
|
||||||
|
}
|
||||||
show_autocreate_options(null);
|
show_autocreate_options(null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('tr.remote').hide();
|
$('tr.remote').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide all the auth methods (except mysql)
|
// Hide all the auth methods (except mysql)
|
||||||
_.each(auth_methods, function(value, key) {
|
_.each(auth_methods, function(value, key) {
|
||||||
if (value !== 'mysql')
|
if (value !== 'mysql')
|
||||||
|
@ -248,7 +248,8 @@ function process_user_login_remote ($login, $pass, $api = false) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($return === "permissions_changed") {
|
if ($return === "permissions_changed") {
|
||||||
$config["auth_error"] = __("Your permmission have been change. Please, login again");
|
$config["auth_error"] =
|
||||||
|
__("Your permissions have changed. Please, login again.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,4 +460,13 @@ define("OPTION_TREE_GROUP_SELECT", 6);
|
|||||||
define("OPTION_SINGLE_SELECT_TIME", 7);
|
define("OPTION_SINGLE_SELECT_TIME", 7);
|
||||||
define("OPTION_CUSTOM_INPUT", 8);
|
define("OPTION_CUSTOM_INPUT", 8);
|
||||||
define("OPTION_AGENT_AUTOCOMPLETE", 9);
|
define("OPTION_AGENT_AUTOCOMPLETE", 9);
|
||||||
|
|
||||||
|
/* SAML attributes constants */
|
||||||
|
define("SAML_ROLE", "urn:mace:rediris.es:entitlement:monitoring:role");
|
||||||
|
define("SAML_TAG", "urn:mace:rediris.es:entitlement:monitoring:tag");
|
||||||
|
define("USER_DESC", "commonName");
|
||||||
|
define("ID_USER_IN_PANDORA", "eduPersonTargetedId");
|
||||||
|
define("GROUP_IN_PANDORA", "schacHomeOrganization");
|
||||||
|
define("MAIL_IN_PANDORA", "mail");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -282,12 +282,22 @@ if (! isset ($config['id_user'])) {
|
|||||||
exit ("</html>");
|
exit ("</html>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$login_button_saml = get_parameter("login_button_saml", false);
|
||||||
if (isset ($double_auth_success) && $double_auth_success) {
|
if (isset ($double_auth_success) && $double_auth_success) {
|
||||||
// This values are true cause there are checked before complete the 2nd auth step
|
// This values are true cause there are checked before complete the 2nd auth step
|
||||||
$nick_in_db = $_SESSION["prepared_login_da"]['id_user'];
|
$nick_in_db = $_SESSION["prepared_login_da"]['id_user'];
|
||||||
$expired_pass = false;
|
$expired_pass = false;
|
||||||
}
|
}
|
||||||
|
else if (($config['auth'] == 'saml') && $login_button_saml) {
|
||||||
|
if (is_user_admin($nick)) {
|
||||||
|
$nick_in_db = $nick;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include_once(ENTERPRISE_DIR . "/include/auth/saml.php");
|
||||||
|
$saml_user_id = saml_process_user_login();
|
||||||
|
$nick_in_db = $saml_user_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// process_user_login is a virtual function which should be defined in each auth file.
|
// process_user_login is a virtual function which should be defined in each auth file.
|
||||||
// It accepts username and password. The rest should be internal to the auth file.
|
// It accepts username and password. The rest should be internal to the auth file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user