Verified Commit f4c0a3a9 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(user-reminder) Various fixes on postpone page

Fixed problems with workflow and template of the expired_postpone page

issue #5961
Showing with 21 additions and 20 deletions
+21 -20
...@@ -42,28 +42,28 @@ class expiredUserPostpone extends standAlonePage ...@@ -42,28 +42,28 @@ class expiredUserPostpone extends standAlonePage
function execute () function execute ()
{ {
global $error_collector, $error_collector_mailto; global $error_collector, $error_collector_mailto;
if (!$this->activated) { if (!$this->activated) {
return; return;
} }
$success = TRUE;
$this->message = [];
if (($_SERVER['REQUEST_METHOD'] == 'GET') && isset($_GET['token'])) { if (($_SERVER['REQUEST_METHOD'] == 'GET') && isset($_GET['token'])) {
// Check if the token match // Check if the token match
$this->uid = $_GET['uid']; $this->uid = $_GET['uid'];
if ($this->checkToken($_GET['token'])) { if ($this->checkToken($_GET['token'])) {
$this->message = [];
$this->postponeExpiration(); $this->postponeExpiration();
if (!empty($this->message)) {
msg_dialog::displayChecks($this->message);
}
} else { } else {
$this->message[] = _('This token is invalid'); $this->message[] = _('This token is invalid');
} }
} else {
$this->message[] = _('Token is missing from URL');
} }
$success = TRUE;
/* Do we need to show error messages? */ /* Do we need to show error messages? */
if (count($this->message) != 0) { if (!empty($this->message)) {
/* Show error message and continue editing */
msg_dialog::displayChecks($this->message); msg_dialog::displayChecks($this->message);
$success = FALSE; $success = FALSE;
} }
......
<?php <?php
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2016 FusionDirectory
Copyright (C) 2016-2019 FusionDirectory
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -22,6 +23,4 @@ require_once('../include/php_setup.inc'); ...@@ -22,6 +23,4 @@ require_once('../include/php_setup.inc');
require_once('functions.inc'); require_once('functions.inc');
require_once('variables.inc'); require_once('variables.inc');
$expiredPostpone = new expiredUserPostpone(); expiredUserPostpone::run();
$expiredPostpone->execute();
<body onLoad="javascript:$$('div.debug_div').each(function (a) { a.hide(); });"> <body onLoad="javascript:$$('div.debug_div').each(function (a) { a.hide(); });">
{* FusionDirectory user reminder - smarty template *} {* FusionDirectory user reminder - smarty template *}
{$php_errors} {$php_errors}
{$msg_dialogs}
<div id="window-container"> <div id="window-container">
<div id="window-div"> <div id="window-div">
{$msg_dialogs} <div id="window-titlebar">
<div id="window-titlebar"> <p>
<p> <img class="center" src="geticon.php?context=types&amp;icon=user&amp;size=48" alt="{t}User{/t}" title="{t}User{/t}"/>
<img class="center" src="geticon.php?context=types&amp;icon=user&amp;size=48" alt="{t}User{/t}" title="{t}User{/t}"/> {t}Expiration postpone{/t}
{t}Expiration postpone{/t} </p>
</p> </div>
</div> <div id="window-content">
<div style="padding-left:10px;padding-right:10px;"> <div>
<!-- Display error message on demand --> <!-- Display error message on demand -->
<p class="warning">{$message}</p> <p class="warning">{$message}</p>
{if $success} {if $success}
<div class="success"> <div class="success">
<img class="center" src="geticon.php?context=status&amp;icon=task-complete&amp;size=16" alt="{t}Success{/t}" title="{t}Success{/t}">&nbsp; <img class="center" src="geticon.php?context=status&amp;icon=task-complete&amp;size=16" alt="{t}Success{/t}" title="{t}Success{/t}">&nbsp;
<b>{t}Your expiration has been postponed successfully.{/t}</b><br/> <b>{t}Your expiration has been postponed successfully.{/t}</b><br/>
<br/><a href="./">Return to login screen</a>
</div> </div>
{else} {else}
<div class="error"> <div class="error">
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<b>{t}There was a problem{/t}</b> <b>{t}There was a problem{/t}</b>
</div> </div>
{/if} {/if}
<br/><a href="./">Return to login screen</a>
</div> </div>
</div>
</div> </div>
</div> </div>
</body> </body>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment