commit
c8054fc64e
@ -0,0 +1,44 @@ |
|||||||
|
{% if _u.logged == 0 %} |
||||||
|
{% if login_form %} |
||||||
|
<div id="login-block" class="panel panel-default"> |
||||||
|
<div class="panel-body"> |
||||||
|
{{ login_language_form }} |
||||||
|
{% if plugin_login_top is not null %} |
||||||
|
<div id="plugin_login_top"> |
||||||
|
{{ plugin_login_top }} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{{ login_failed }} |
||||||
|
|
||||||
|
{% set azure_plugin_enabled = 'azure_active_directory'|api_get_plugin_setting('enable') %} |
||||||
|
{% set azure_plugin_manage_login = 'azure_active_directory'|api_get_plugin_setting('manage_login_enable') %} |
||||||
|
|
||||||
|
{% if 'false' == azure_plugin_enabled or 'false' == azure_plugin_manage_login %} |
||||||
|
{{ login_form }} |
||||||
|
|
||||||
|
{% if "allow_lostpassword" | api_get_setting == 'true' or "allow_registration"|api_get_setting == 'true' %} |
||||||
|
<ul class="nav nav-pills nav-stacked"> |
||||||
|
{% if "allow_registration"|api_get_setting != 'false' %} |
||||||
|
<li><a href="{{ _p.web_main }}auth/inscription.php"> {{ 'SignUp'|get_lang }} </a></li> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{% if "allow_lostpassword"|api_get_setting == 'true' %} |
||||||
|
<li> |
||||||
|
<a href="{{ _p.web_main }}auth/lostPassword.php">{{ 'LostPassword'|get_lang }}</a> |
||||||
|
</li> |
||||||
|
{% endif %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{% if plugin_login_bottom is not null %} |
||||||
|
<div id="plugin_login_bottom"> |
||||||
|
{{ plugin_login_bottom }} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
{% endif %} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
<?php |
||||||
|
/* For license terms, see /license.txt */ |
||||||
|
|
||||||
|
require __DIR__.'/../../main/inc/global.inc.php'; |
||||||
|
|
||||||
|
$plugin = AzureActiveDirectory::create(); |
||||||
|
|
||||||
|
$pluginEnabled = $plugin->get(AzureActiveDirectory::SETTING_ENABLE); |
||||||
|
$managementLoginEnabled = $plugin->get(AzureActiveDirectory::SETTING_MANAGEMENT_LOGIN_ENABLE); |
||||||
|
|
||||||
|
if ('true' !== $pluginEnabled || 'true' !== $managementLoginEnabled) { |
||||||
|
header('Location: '.api_get_path(WEB_PATH)); |
||||||
|
|
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
$userId = api_get_user_id(); |
||||||
|
|
||||||
|
if (!($userId) || api_is_anonymous($userId)) { |
||||||
|
$managementLoginName = $plugin->get(AzureActiveDirectory::SETTING_MANAGEMENT_LOGIN_NAME); |
||||||
|
|
||||||
|
if (empty($managementLoginName)) { |
||||||
|
$managementLoginName = $plugin->get_lang('ManagementLogin'); |
||||||
|
} |
||||||
|
|
||||||
|
$template = new Template($managementLoginName); |
||||||
|
// Only display if the user isn't logged in. |
||||||
|
$template->assign('login_language_form', api_display_language_form(true, true)); |
||||||
|
$template->assign('login_form', $template->displayLoginForm()); |
||||||
|
|
||||||
|
$content = $template->fetch('azure_active_directory/view/login.tpl'); |
||||||
|
|
||||||
|
$template->assign('content', $content); |
||||||
|
$template->display_one_col_template(); |
||||||
|
} |
||||||
@ -0,0 +1,19 @@ |
|||||||
|
<div class="row"> |
||||||
|
<div class="col-sm-4 col-sm-offset-4"> |
||||||
|
{{ login_language_form }} |
||||||
|
|
||||||
|
{{ login_form }} |
||||||
|
|
||||||
|
{% if "allow_lostpassword"|api_get_setting == 'true' or "allow_registration"|api_get_setting == 'true' %} |
||||||
|
<ul class="nav nav-pills nav-stacked"> |
||||||
|
{% if "allow_registration"|api_get_setting != 'false' %} |
||||||
|
<li><a href="{{ _p.web_main }}auth/inscription.php">{{ 'SignUp'|get_lang }}</a></li> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{% if "allow_lostpassword"|api_get_setting == 'true' %} |
||||||
|
<li><a href="{{ _p.web_main }}auth/lostPassword.php">{{ 'LostPassword'|get_lang }}</a></li> |
||||||
|
{% endif %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
Loading…
Reference in new issue