The controller function returns filtered filename as string (or null).
More...
The controller function returns filtered filename as string (or null).
The Controller Class.
Controller filter and return filename
- Author
- Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
- Copyright
- 2009-2016 Daniel Retzl yawk.io @license https://opensource.org/licenses/MIT
- Version
- 1.0.0
Definition at line 14 of file controller.php.
◆ __construct()
YAWK\controller::__construct |
( |
| ) |
|
◆ filterfilename()
static YAWK\controller::filterfilename |
( |
|
$db, |
|
|
|
$lang, |
|
|
|
$filename |
|
) |
| |
|
static |
Main filter controller: checks GET params and lead to corresponding actions.
- Parameters
-
- Returns
- false|string
This is used whether to detect that users wants to reset password, load a page or delegate any other action
Definition at line 46 of file controller.php.
50 if (isset(
$_GET[
'resetPassword']) && (
$_GET[
'resetPassword']) ==
true)
52 if (isset(
$_GET[
'token']) && (is_string(
$_GET[
'token'])))
60 echo
"<div class=\"container-fluid\">
61 <div class=\"row text-center\">
62 <div class=\"col-md-12\"><b class=\"text-danger\"><br><br<b>$lang[PASSWORD_RESET_ERROR]</b>
63 <br><i>$lang[PASSWORD_RESET_ERROR_UID]</i>
64 <br><br></div></div>";
70 echo
"<div class=\"container-fluid\">
71 <div class=\"row text-center\">
72 <div class=\"col-md-4\"> </div>
73 <div class=\"col-md-4\"><br><br><h3>$lang[PASSWORD_RESET]<br>
74 <p class=\"small text-gray\">$lang[PASSWORD_REQUIREMENTS]</small></h3><hr>";
76 echo
"<hr><br><br></div>
77 <div class=\"col-md-4\"> </div></div>";
83 die (
$lang[
'PASSWORD_RESET_ERROR_TOKEN']);
88 if (isset(
$_GET[
'setNewPassword']) && (
$_GET[
'setNewPassword'] ==
true))
91 if (isset($_POST[
'newPassword1']) && (!empty($_POST[
'newPassword1']) && (is_string($_POST[
'newPassword1']))
92 && (isset($_POST[
'newPassword2']) && (!empty($_POST[
'newPassword2']) && (is_string($_POST[
'newPassword2']))
93 && ($_POST[
'newPassword1'] == $_POST[
'newPassword2'])))))
96 $_POST[
'newPassword1'] = trim($_POST[
'newPassword1']);
97 $_POST[
'newPassword2'] = trim($_POST[
'newPassword2']);
99 $_POST[
'newPassword1'] = strip_tags($_POST[
'newPassword1']);
100 $_POST[
'newPassword2'] = strip_tags($_POST[
'newPassword2']);
103 if (isset($_POST[
'uid']) && (!empty($_POST[
'uid']) && (is_numeric($_POST[
'uid']))))
109 $user = user::getUserNameFromID(
$db, $_POST[
'uid']);
111 if (!isset($user) || (empty($user)) || (!is_string($user)))
117 echo
"<div class=\"container-fluid\">
118 <div class=\"row text-center\">
119 <div class=\"col-md-4\"> </div>
120 <div class=\"col-md-4\"><br><br><h3>$lang[PASSWORD_CHANGED]<br>
121 <p class=\"small text-gray\">$lang[PASSWORD_CHANGED_LOGIN]</small></h3><hr></div></div>";
123 echo
"<hr><br><br><br><br>";
129 echo
"<div class=\"container-fluid\">
130 <div class=\"row text-center\">
131 <div class=\"col-md-4\"> </div>
132 <div class=\"col-md-4\"><br><br><h3>$lang[PASSWORD_CHANGED_ERROR]<br>
133 <p class=\"small text-gray\">$lang[PLEASE_TRY_AGAIN]</small></h3><hr>";
137 <div class=\"col-md-4\"> </div></div>";
149 echo
"<div class=\"container-fluid\">
151 <div class=\"col-md-4\"> </div>
152 <div class=\"col-md-4 text-center\"><br><br><h3>$lang[PASSWORD_CHANGED_ERROR]<br>
153 <p class=\"small text-gray\">$lang[PLEASE_TRY_AGAIN]</small></h3><hr>
155 <div class=\"col-md-4\"> </div></div>";
179 echo
"<br><br><br><br>";
180 die(
"Unable to display page - filename not set. output of \$filename: $filename");
197 if (!isset(
$db)) {
$db =
new db(); }
198 sys::setSyslog(
$db, 4, 1,
"404 ERROR $notfound", 0, 0, 0, 0);
print $lang['FILEMAN_UPLOAD']
static setNewPassword($db, $newPassword, $uid)
Set a new user password.
static drawLoginBox($username, $password)
return the html for a default login box
static drawPasswordResetForm($db, $lang, $uid)
Draw the form where users can reset their password.
static checkResetToken($db, $token)
Check if password reset token matches and return uid.
References $_GET, $db, YAWK\controller\$filename, $lang, $uid, YAWK\user\checkResetToken(), die, YAWK\user\drawLoginBox(), YAWK\user\drawPasswordResetForm(), exit, and YAWK\user\setNewPassword().
Referenced by YAWK\BACKEND\AdminLTE\drawHtmlContent(), and YAWK\page\getContent().
◆ frontEndInit()
static YAWK\controller::frontEndInit |
( |
|
$db, |
|
|
|
$currentpage, |
|
|
|
$user, |
|
|
|
$template |
|
) |
| |
|
static |
◆ $filename
YAWK\controller::$filename |
The documentation for this class was generated from the following file: