Added custom password reset / logout url

pull/1050/head
Iglocska 2016-03-18 08:00:32 +01:00
parent 1c3c68c4e0
commit cbb2a92f4b
3 changed files with 23 additions and 3 deletions

View File

@ -884,11 +884,29 @@ class Server extends AppModel {
),
'CustomAuth_disable_logout' => array(
'level' => 2,
'description' => 'Disable the logou button for users authenticate with the external auth mehanism.',
'description' => 'Disable the logout button for users authenticate with the external auth mechanism.',
'value' => false,
'errorMessage' => '',
'test' => 'testBool',
'type' => 'boolean'
),
'CustomAuth_custom_password_reset' => array(
'level' => 2,
'description' => 'Provide your custom authentication users with an external URL to the authentication system to reset their passwords.',
'value' => '',
'errorMessage' => '',
'test' => 'testForEmpty',
'type' => 'string',
'null' => true
),
'CustomAuth_custom_logout' => array(
'level' => 2,
'description' => 'Provide a custom logout URL for your users that will log them out using the authentication system you use.',
'value' => '',
'errorMessage' => '',
'test' => 'testForEmpty',
'type' => 'string',
'null' => true
)
),
'debug' => array(

View File

@ -84,8 +84,6 @@
<li><a href="<?php echo $baseurl;?>/pages/display/doc/quickstart">User Guide</a></li>
<li><a href="<?php echo $baseurl;?>/users/terms">Terms &amp; Conditions</a></li>
<li><a href="<?php echo $baseurl;?>/users/statistics">Statistics</a></li>
<li class="divider"></li>
<li><a href="<?php echo $baseurl;?>/users/logout">Log out</a></li>
</ul>
</li>
@ -189,6 +187,8 @@
</li>
<?php if (!$externalAuthUser || !Configure::read('Plugin.CustomAuth_disable_logout')): ?>
<li><a href="<?php echo $baseurl;?>/users/logout">Log out</a></li>
<?php elseif (Configure::read('Plugin.CustomAuth_custom_logout')): ?>
<li><a href="<?php echo h(Configure::read('Plugin.CustomAuth_custom_logout'));?>">Log out</a></li>
<?php endif; ?>
</ul>
</div>

View File

@ -128,6 +128,8 @@
if (((Configure::read('MISP.disableUserSelfManagement') && $isAdmin) || !Configure::read('MISP.disableUserSelfManagement')) && ($menuItem === 'edit' || $menuItem === 'view')): ?>
<li id='liedit'><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?></li>
<li class="divider"></li>
<?php elseif (Configure::read('CustomAuth_custom_password_reset')): ?>
<li id='lipwreset'><a href="<?php echo h(Configure::read('CustomAuth_custom_password_reset'));?>">Reset Password</a></li>
<?php endif; ?>
<li id='liview'><a href="<?php echo $baseurl;?>/users/view/me">My Profile</a></li>
<li id='lidashboard'><a href="<?php echo $baseurl;?>/users/dashboard">Dashboard</a></li>