Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory-plugins
Commits
542309da
Verified
Commit
542309da
authored
6 months ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
Feat(Reminder) - Logic of error handling
error handling and tpl updates
parent
f72fb6e0
dev
6310-tasks-reminder-error-in-the-schema-duplicate-attribute-id
6311-put-the-version-1-5-in-all-yaml-for-fusiondirectory-1-5
6322-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen-2
6332-zimbra-allows-update-of-data-for-unknown-domain-name-for-specific-individual-aliases
6337-webservice-issue-with-archiving-post-request-not-responding-but-successfully-archiving-user
6341-supann-extract-resources-states-sub-states-from-backend-configuration-to-their-own-objects
master
fusiondirectory-1.5
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
user-reminder/html/class_reminderFrontEnd.inc
+16
-6
user-reminder/html/class_reminderFrontEnd.inc
user-reminder/ihtml/themes/breezy/taskReminder.tpl
+18
-17
user-reminder/ihtml/themes/breezy/taskReminder.tpl
with
34 additions
and
23 deletions
+34
-23
user-reminder/html/class_reminderFrontEnd.inc
+
16
−
6
View file @
542309da
...
@@ -58,6 +58,8 @@ class reminderFrontEnd extends standAlonePage
...
@@ -58,6 +58,8 @@ class reminderFrontEnd extends standAlonePage
function
execute
()
function
execute
()
{
{
global
$error_collector
;
global
$error_collector
;
$success
=
FALSE
;
$error
=
FALSE
;
if
(
!
empty
(
$_POST
))
{
if
(
!
empty
(
$_POST
))
{
$this
->
sanitizeInputs
();
$this
->
sanitizeInputs
();
...
@@ -72,25 +74,31 @@ class reminderFrontEnd extends standAlonePage
...
@@ -72,25 +74,31 @@ class reminderFrontEnd extends standAlonePage
// Verify if uid is set (thanks to post) and verify token validity.
// Verify if uid is set (thanks to post) and verify token validity.
if
(
!
empty
(
$this
->
uid
))
{
if
(
!
empty
(
$this
->
uid
))
{
// verification of token
// verification of token
if
(
$this
->
checkToken
(
$this
->
token
))
{
if
(
!
$this
->
checkToken
(
$this
->
token
))
{
$this
->
message
[]
=
"
Token is valid and not expired.
"
;
$this
->
message
[]
=
"
Error, data received are incorrect!
"
;
}
else
{
}
else
{
$
this
->
message
[]
=
"Token is not valid or expired."
;
$
success
=
TRUE
;
}
}
}
}
if
(
!
empty
(
$this
->
message
))
{
if
(
!
empty
(
$this
->
message
))
{
msg_dialog
::
displayChecks
(
$this
->
message
);
msg_dialog
::
displayChecks
(
$this
->
message
);
$
success
=
FALS
E
;
$
error
=
TRU
E
;
}
}
// Initialize smarty and pass the status of potential error ??
// Initialize smarty and pass the status of potential error ??
$this
->
initSmarty
(
$success
);
$this
->
initSmarty
(
$success
,
$error
);
}
}
private
function
initSmarty
(
$success
)
/**
* @param bool $success
* @param bool $error
* @return void
* Note : success allows to display certain part of the tpl '<div>' element.
*/
private
function
initSmarty
(
bool
$success
,
bool
$error
)
{
{
$smarty
=
get_smarty
();
$smarty
=
get_smarty
();
...
@@ -112,6 +120,8 @@ class reminderFrontEnd extends standAlonePage
...
@@ -112,6 +120,8 @@ class reminderFrontEnd extends standAlonePage
$smarty
->
assign
(
'version'
,
FD_VERSION
);
$smarty
->
assign
(
'version'
,
FD_VERSION
);
$smarty
->
assign
(
'activated'
,
$this
->
activated
);
$smarty
->
assign
(
'activated'
,
$this
->
activated
);
$smarty
->
assign
(
'success'
,
$success
);
$smarty
->
assign
(
'error'
,
$error
);
$smarty
->
assign
(
'taskName'
,
$this
->
task
[
'name'
]);
$smarty
->
assign
(
'taskName'
,
$this
->
task
[
'name'
]);
$smarty
->
assign
(
'token'
,
$this
->
token
);
$smarty
->
assign
(
'token'
,
$this
->
token
);
$smarty
->
display
(
get_template_path
(
'taskReminder.tpl'
));
$smarty
->
display
(
get_template_path
(
'taskReminder.tpl'
));
...
...
This diff is collapsed.
Click to expand it.
user-reminder/ihtml/themes/breezy/taskReminder.tpl
+
18
−
17
View file @
542309da
...
@@ -16,24 +16,25 @@
...
@@ -16,24 +16,25 @@
{
t
}
Reminder - Account prolongation
{/
t
}
{
t
}
Reminder - Account prolongation
{/
t
}
</p>
</p>
</div>
</div>
{
if
!
$success
&&
!
$error
}
<div
style=
"text-align: center;"
>
<label
for=
"login"
>
<img
class=
"center"
src=
"geticon.php?context=types&icon=user&size=48"
alt=
"
{
t
}
Username
{/
t
}
"
title=
"
{
t
}
Username
{/
t
}
"
/>
</label>
<input
type=
"text"
name=
"login"
placeholder=
"
{
t
}
Enter your ID
{/
t
}
"
required
/>
<br
/>
<div
style=
"text-align: center;"
>
<!-- Hidden fields for taskName and token from $_GET -->
<label
for=
"login"
>
<input
type=
"hidden"
name=
"taskName"
value=
"
{
$taskName
}
"
/>
<img
class=
"center"
src=
"geticon.php?context=types&icon=user&size=48"
alt=
"
{
t
}
Username
{/
t
}
"
title=
"
{
t
}
Username
{/
t
}
"
/>
<input
type=
"hidden"
name=
"token"
value=
"
{
$token
}
"
/>
</label>
</div>
<input
type=
"text"
name=
"login"
placeholder=
"
{
t
}
Enter your ID
{/
t
}
"
required
/>
<br
/>
<!-- Hidden fields for taskName and token from $_GET -->
<div
id=
"window-footer"
class=
"plugbottom"
>
<input
type=
"hidden"
name=
"taskName"
value=
"
{
$taskName
}
"
/>
<div>
<input
type=
"hidden"
name=
"token"
value=
"
{
$token
}
"
/>
<input
type=
"submit"
name=
"apply"
value=
"
{
t
}
Submit
{/
t
}
"
title=
"
{
t
}
Click here to prolonged your account.
{/
t
}
"
/>
</div>
</div>
</div>
<div
id=
"window-footer"
class=
"plugbottom"
>
{/
if
}
<div>
<input
type=
"submit"
name=
"apply"
value=
"
{
t
}
Submit
{/
t
}
"
title=
"
{
t
}
Click here to prolonged your account.
{/
t
}
"
/>
</div>
</div>
</form>
</form>
<div
id=
"window-content"
>
<div
id=
"window-content"
>
...
@@ -47,7 +48,7 @@
...
@@ -47,7 +48,7 @@
{
else
if
$error
}
{
else
if
$error
}
<div
class=
"error"
>
<div
class=
"error"
>
<img
class=
"center"
src=
"geticon.php?context=status&icon=task-failure&size=16"
alt=
"
{
t
}
Error
{/
t
}
"
title=
"
{
t
}
Error
{/
t
}
"
>
<img
class=
"center"
src=
"geticon.php?context=status&icon=task-failure&size=16"
alt=
"
{
t
}
Error
{/
t
}
"
title=
"
{
t
}
Error
{/
t
}
"
>
<b>
{
t
}
An unexpected error occurred
{/
t
}
</b>
<b>
{
t
}
Error, data received are invalid!
{/
t
}
</b>
</div>
</div>
{/
if
}
{/
if
}
<br/>
<br/>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets