diff --git a/classes/Auth.class.php b/classes/Auth.class.php index b206f27..fd5f0fb 100644 --- a/classes/Auth.class.php +++ b/classes/Auth.class.php @@ -6,11 +6,11 @@ return AuthFactory::getInstance()->isLoggedIn(); } - public static function TwoFactorLogin(string $username, string $password) : bool { + public static function TwoFactorLogin(string $username, #[\SensitiveParameter] string $password) : bool { return AuthFactory::getInstance()->TwoFactorLogin($username, $password); } - public static function login(string $username, string $password) : bool { + public static function login(string $username, #[\SensitiveParameter] string $password) : bool { return AuthFactory::getInstance()->login($username, $password); } diff --git a/classes/AuthFactory.class.php b/classes/AuthFactory.class.php index 6d91b84..af7c136 100644 --- a/classes/AuthFactory.class.php +++ b/classes/AuthFactory.class.php @@ -50,7 +50,7 @@ return $this->user->getMail(); } - public function login(string $username, string $password) : bool { + public function login(string $username, #[\SensitiveParameter] string $password) : bool { $result = Database::single('SELECT `id`, `username`, `password`, UPPER(SHA2(CONCAT(`id`, :salt, :password), 512)) as `crypted` FROM `' . DATABASE_PREFIX . 'users` WHERE `username`=:username LIMIT 1', [ 'username' => $username, 'password' => $password, @@ -79,7 +79,7 @@ return true; } - public function TwoFactorLogin(string $username, string $password) : bool { + public function TwoFactorLogin(string $username, #[\SensitiveParameter] string $password) : bool { $result = Database::single('SELECT `id`, `username`, `email`, `password`, UPPER(SHA2(CONCAT(`id`, :salt, :password), 512)) as `crypted` FROM `' . DATABASE_PREFIX . 'users` WHERE `username`=:username LIMIT 1', [ 'username' => $username, 'password' => $password, diff --git a/classes/Core.class.php b/classes/Core.class.php index b1c0608..5aa6111 100644 --- a/classes/Core.class.php +++ b/classes/Core.class.php @@ -88,7 +88,7 @@ require_once($path); } - public function getAdminCore() { + public function getAdminCore() : CoreAdmin { return $this->admin; } diff --git a/classes/Encryption.class.php b/classes/Encryption.class.php index 6fbae1a..3a1dabd 100644 --- a/classes/Encryption.class.php +++ b/classes/Encryption.class.php @@ -2,11 +2,11 @@ namespace fruithost; class Encryption { - public static function encrypt(string $data, string $secret) : string | false { + public static function encrypt(string $data, #[\SensitiveParameter] string $secret) : string | false { return base64_encode(openssl_encrypt($data, 'aes-256-cbc', $secret, 0, substr(ENCRYPTION_SALT, 0, 16))); } - public static function decrypt(string $data, string $secret) : string | false { + public static function decrypt(string $data, #[\SensitiveParameter] string $secret) : string | false { return openssl_decrypt(base64_decode($data), 'aes-256-cbc', $secret, 0, substr(ENCRYPTION_SALT, 0, 16)); } } diff --git a/classes/Hooks.class.php b/classes/Hooks.class.php index c1dca3d..f51ef14 100644 --- a/classes/Hooks.class.php +++ b/classes/Hooks.class.php @@ -9,7 +9,7 @@ protected $actions = []; protected $current_filter = []; - protected function createID($method) { + protected function createID(mixed $method) { if(is_string($method)) { return $method; } @@ -31,7 +31,7 @@ return false; } - public function callAllHook($args) { + public function callAllHook(array $args) { reset($this->filters['all']); do { @@ -44,7 +44,7 @@ } /* Filter */ - public function addFilter($name, $method, $priority = 50, $logged_in = true) { + public function addFilter(string $name, \Closure | array $method, int $priority = 50, bool $logged_in = true) : bool { $this->filters[$name][$priority][$this->createID($method)] = [ 'method' => $method, 'logged_in' => $logged_in @@ -54,7 +54,7 @@ return true; } - public function removeFilter($name, $method, $priority = 50) { + public function removeFilter(string $name, \Closure | array $method, int $priority = 50) : bool { $method = $this->createID($method); if(!isset($this->filters[$name][$priority][$method])) { @@ -71,7 +71,7 @@ return true; } - public function hasFilter($name, $method = false) { + public function hasFilter(string $name, mixed $method = false) : bool { $exists = isset($this->filters[$name]); if($method === false || !$exists) { @@ -91,7 +91,7 @@ return false; } - public function applyFilter($name, $arguments) { + public function applyFilter(string $name, mixed $arguments) : mixed { $args = []; $value = $arguments; @@ -142,19 +142,19 @@ } /* Actions */ - public function addAction($name, $method, $priority = 50, $logged_in = true) { + public function addAction(string $name, \Closure | array $method, int $priority = 50, bool $logged_in = true) : bool { return $this->addFilter($name, $method, $priority, $logged_in); } - public function removeAction($name, $method, $priority = 50) { + public function removeAction(string $name, \Closure | array $method, int $priority = 50) : bool { return $this->removeFilter($name, $method, $priority); } - public function hasAction($name, $method = false) { + public function hasAction(string $name, mixed $method = false) : bool { return $this->hasFilter($name, $method); } - public function runAction($name, $arguments = null) { + public function runAction(string $name, mixed $arguments = null) : bool { if(!is_array($this->actions)) { $this->actions = []; } diff --git a/classes/I18N.class.php b/classes/I18N.class.php index f88a91f..d10f4a0 100644 --- a/classes/I18N.class.php +++ b/classes/I18N.class.php @@ -45,7 +45,7 @@ return $default; } - protected static function set() { + protected static function set() : string { $language = Auth::getSettings('LANGUAGE', NULL, self::getSettings('LANGUAGE', 'en_US')); if(!Auth::isLoggedIn() && Request::has('lang')) { @@ -55,7 +55,7 @@ return $language; } - protected static function load($language) { + protected static function load(string $language) { $file = sprintf('%slanguages/%s.po', PATH, $language); if(file_exists($file)) { @@ -87,7 +87,7 @@ } } - public static function getLanguages() { + public static function getLanguages() : array { return self::$languages; } @@ -95,7 +95,7 @@ print self::get($string); } - public static function get($string) { + public static function get($string) : string { if(self::$translation == null) { return $string; } diff --git a/classes/Modal.class.php b/classes/Modal.class.php index 8e79223..2c025dc 100644 --- a/classes/Modal.class.php +++ b/classes/Modal.class.php @@ -9,7 +9,7 @@ private $callbacks = []; private $variables = []; - public function __construct($name, $title, $content, $variables = []) { + public function __construct(string $name, string $title, $content, $variables = []) { $this->name = $name; $this->title = $title; $this->variables = $variables; @@ -27,30 +27,30 @@ return $this->callbacks[$name]; } - public function onSave($method) { + public function onSave($method) : Modal { $this->callbacks['save'] = $method; return $this; } - public function getName() { + public function getName() : string { return $this->name; } - public function getTitle() { + public function getTitle() : string { return $this->title; } - public function addButton($button) { + public function addButton(array $button) : Modal { $this->buttons[] = $button; return $this; } - public function getButtons() { + public function getButtons() : array { return $this->buttons; } - public function getContent($template) { + public function getContent(Template $template) { foreach($this->variables AS $name => $value) { ${$name} = $value; } diff --git a/classes/Module.class.php b/classes/Module.class.php index 03eb9bd..ed12379 100644 --- a/classes/Module.class.php +++ b/classes/Module.class.php @@ -12,11 +12,11 @@ $this->info = new ModuleInfo($path); } - public function isValid() { + public function isValid() : bool { return (!empty($this->info) && !$this->info->isValid()); } - public function getInfo() { + public function getInfo() : ModuleInfo { return $this->info; } @@ -24,11 +24,11 @@ return $this->instance; } - public function getPath() { + public function getPath() : string { return $this->path; } - public function getSettings($name, $default = NULL) { + public function getSettings(string $name, mixed $default = NULL) : mixed { $result = Database::single('SELECT * FROM `' . DATABASE_PREFIX . 'modules_settings` WHERE `module`=:module AND `key`=:key LIMIT 1', [ 'key' => $name, 'module' => $this->getDirectory() @@ -43,7 +43,7 @@ return $default; } - public function setSettings($name, $value = NULL) { + public function setSettings(string $name, mixed $value = NULL) { if(Database::exists('SELECT `id` FROM `' . DATABASE_PREFIX . 'modules_settings` WHERE `module`=:module AND `key`=:key LIMIT 1', [ 'module' => $this->getDirectory(), 'key' => $name @@ -63,27 +63,27 @@ } } - public function hasSettingsPath() { + public function hasSettingsPath() : bool { return file_exists($this->getSettingsPath()); } - public function getSettingsPath() { + public function getSettingsPath() : string { return sprintf('%s%sadmin.php', $this->path, DS); } - public function getDirectory() { + public function getDirectory() : string { return basename($this->path); } - public function isEnabled() { + public function isEnabled() : bool { return $this->enabled; } - public function setEnabled($state) { + public function setEnabled(bool $state) { $this->enabled = $state; } - public function init($core) { + public function init(Core $core) : Module { $script = sprintf('%s%smodule.php', $this->path, DS); if(!file_exists($script)) { diff --git a/classes/ModuleAuthor.class.php b/classes/ModuleAuthor.class.php index e209843..887169e 100644 --- a/classes/ModuleAuthor.class.php +++ b/classes/ModuleAuthor.class.php @@ -6,7 +6,7 @@ private $email = null; private $url = null; - public function __construct($object) { + public function __construct(object $object) { if(!empty($object->name)) { $this->name = $object->name; } @@ -20,15 +20,15 @@ } } - public function getName() { + public function getName() : string { return $this->name; } - public function getMail() { + public function getMail() : string { return $this->email; } - public function getWebsite() { + public function getWebsite() : string { return $this->url; } } diff --git a/classes/ModuleInfo.class.php b/classes/ModuleInfo.class.php index 3df48da..5a4fc31 100644 --- a/classes/ModuleInfo.class.php +++ b/classes/ModuleInfo.class.php @@ -12,7 +12,7 @@ private $repository = null; private $is_valid = false; - public function __construct($path) { + public function __construct(string $path) { $file = sprintf('%s%smodule.package', $path, DS); if(!file_exists($file)) { @@ -73,27 +73,27 @@ $this->is_valid = true; } - public function isValid() { + public function isValid() : bool { return $this->is_valid; } - public function getName() { + public function getName() : string { return $this->name; } - public function getVersion() { + public function getVersion() : string { return $this->version; } - public function getCategory() { + public function getCategory() : string { return $this->category; } - public function getOrder() { + public function getOrder() : int { return $this->order; } - public function getIcon($raw = false) { + public function getIcon(bool $raw = false) : string { if($raw) { return $this->icon; } @@ -103,15 +103,15 @@ return sprintf('%s', $this->icon); } - public function getDescription() { + public function getDescription() : string { return $this->description; } - public function getAuthor() { + public function getAuthor() : ModuleAuthor { return $this->author; } - public function getRepository() { + public function getRepository() : string { return $this->repository; } } diff --git a/classes/ModuleInterface.class.php b/classes/ModuleInterface.class.php index ec0a112..8dd6606 100644 --- a/classes/ModuleInterface.class.php +++ b/classes/ModuleInterface.class.php @@ -5,7 +5,7 @@ private $core = null; private $instance = null; - public function __construct($core, $instance) { + public function __construct(Core $core, $instance) { $this->core = $core; $this->instance = $instance; @@ -20,7 +20,7 @@ /* Override Me */ } - public function getRouter() { + public function getRouter() : Router { return $this->core->getRouter(); } @@ -28,79 +28,79 @@ return $this->core->getModules(); } - public function getTemplate() { + public function getTemplate() : Template { return $this->core->getTemplate(); } - public function getCore() { + public function getCore() : Core { return $this->core; } - public function getInstance() { + public function getInstance() : Module { return $this->instance; } - public function setSettings($name, $value = NULL) { + public function setSettings(string $name, mixed $value = NULL) { $this->instance->setSettings($name, $value); } - public function getSettings($name, $default = NULL) { + public function getSettings(string $name, mixed $default = NULL) : mixed { return $this->instance->getSettings($name, $default); } - public function addButton($button, $logged_in = false) { + public function addButton(Button $button, bool $logged_in = false) { $this->addFilter('buttons', function($buttons) use($button) { $buttons[] = $button; return $buttons; }, 10, $logged_in); } - public function addModal($modal, $logged_in = false) { + public function addModal(Modal $modal, bool $logged_in = false) { $this->addFilter('modals', function($modals) use($modal) { $modals[] = $modal; return $modals; }, 10, $logged_in); } - public function assign($name, $value) { + public function assign(string $name, mixed $value) { $this->getCore()->getTemplate()->assign($name, $value); } - public function url($path = '') { + public function url(string $path = '') : string { return $this->getCore()->getTemplate()->url($path); } /* Filter */ - public function addFilter($name, $method, $priority = 10, $logged_in = false) { + public function addFilter(string $name, \Closure | array $method, int $priority = 50, bool $logged_in = true) : bool { return $this->core->getHooks()->addFilter($name, $method, $priority); } - public function removeFilter($name, $method, $priority = 10) { + public function removeFilter(string $name, \Closure | array $method, int $priority = 50) : bool { return $this->core->getHooks()->removeFilter($name, $method, $priority); } - public function hasFilter($name, $method = false) { + public function hasFilter(string $name, mixed $method = false) : bool { return $this->core->getHooks()->hasFilter($name, $method); } - public function applyFilter($name, $arguments) { + public function applyFilter(string $name, mixed $arguments) : mixed { return $this->core->getHooks()->applyFilter($name, $arguments); } /* Actions */ - public function addAction($name, $method, $priority = 10) { + public function addAction(string $name, \Closure | array $method, int $priority = 50, bool $logged_in = true) : bool { return $this->core->getHooks()->addAction($name, $method, $priority); } - public function removeAction($name, $method, $priority = 10) { + public function removeAction(string $name, \Closure | array $method, int $priority = 50) : bool { return $this->core->getHooks()->removeAction($name, $method, $priority); } - public function hasAction($name, $method = false) { + public function hasAction(string $name, mixed $method = false) : bool { return $this->core->getHooks()->hasAction($name, $method); } - public function runAction($name, $arguments) { + public function runAction(string $name, mixed $arguments = null) : bool { return $this->core->getHooks()->runAction($name, $arguments); } } diff --git a/classes/Modules.class.php b/classes/Modules.class.php index 05d6162..d50ba06 100644 --- a/classes/Modules.class.php +++ b/classes/Modules.class.php @@ -5,7 +5,7 @@ private $core = null; private $modules = []; - public function __construct($core) { + public function __construct(Core $core) { $this->core = $core; $enabled = []; @@ -25,7 +25,7 @@ } } - public function getList() { + public function getList() : array { $modules = []; foreach(new \DirectoryIterator($this->getPath()) AS $info) { @@ -51,11 +51,11 @@ return $modules; } - public function getPath() { + public function getPath() : string { return sprintf('%s%s%s', dirname(PATH), DS, 'modules'); } - public function addModule($name, $module) { + public function addModule(string $name, Module $module) { if(!$module->isEnabled()) { return; } @@ -63,11 +63,11 @@ $this->modules[$name] = $module->init($this->core); } - public function getModules() { + public function getModules() : array { return $this->modules; } - public function hasModule($name, $all = false) { + public function hasModule(string $name, bool $all = false) : bool { if($all) { $modules = $this->getList(); @@ -85,7 +85,7 @@ return true; } - public function getModule($name, $all = false) { + public function getModule(string $name, bool $all = false) : Module | null { if($all) { $modules = $this->getList(); diff --git a/classes/PHP.class.php b/classes/PHP.class.php index ae3fdbf..5cec572 100644 --- a/classes/PHP.class.php +++ b/classes/PHP.class.php @@ -9,7 +9,7 @@ private $data = []; private $error = false; - public function setPath($path) { + public function setPath(string $path) { $this->path = $path; } @@ -39,7 +39,7 @@ $this->content = $result; } - public function exploding($name, $data) { + public function exploding(string $name, mixed $data) : array { if($name == 'Configuration File (php.ini) Path') { return $this->highlight($this->path); } @@ -67,7 +67,7 @@ return $this->highlight($data); } - public function highlight($data) { + public function highlight(array | string $data) : array | string { if(is_array($data)) { foreach($data AS $name => $value) { $data[$name] = $this->highlight($value); @@ -106,7 +106,7 @@ return $data; } - public function hasErrors() { + public function hasErrors() : bool { return $this->error; } @@ -174,7 +174,7 @@ ]; } - public function getInfo() { + public function getInfo() : array { $this->execute(); $this->parse(); diff --git a/classes/Request.class.php b/classes/Request.class.php index f72c1b7..1c2c0aa 100644 --- a/classes/Request.class.php +++ b/classes/Request.class.php @@ -11,7 +11,7 @@ } } - public static function getInstance() { + public static function getInstance() : RequestFactory { if(self::$instance === NULL) { self::$instance = new self(); } @@ -37,11 +37,11 @@ $this->_get = $_GET; } - public function has($name) { + public function has(string $name) : bool { return in_array($name, array_keys($this->_get)); } - public function get($name) { + public function get(string $name) : mixed { if(!$this->has($name)) { return null; } @@ -49,7 +49,7 @@ return $this->_get[$name]; } - public function url() { + public function url() : string { return $_SERVER['REQUEST_URI']; } } @@ -59,15 +59,15 @@ RequestFactory::getInstance()->init(); } - public static function has($name) { + public static function has(string $name) : bool { return RequestFactory::getInstance()->has($name); } - public static function get($name) { + public static function get(string $name) : mixed { return RequestFactory::getInstance()->get($name); } - public static function url() { + public static function url() : string { return RequestFactory::getInstance()->url(); } } diff --git a/classes/Router.class.php b/classes/Router.class.php index 0490898..375f72b 100644 --- a/classes/Router.class.php +++ b/classes/Router.class.php @@ -64,7 +64,7 @@ $this->redirect = $redirect; } - public function run($ajax = false) { + public function run(bool $ajax = false) { // @ToDo is secure? $uri = explode('/', ($ajax ? preg_replace('#(http|https)://([^/]+)#', '', $_SERVER['HTTP_REFERER']) : $_SERVER['REQUEST_URI'])); $name = explode('/', $_SERVER['SCRIPT_NAME']); diff --git a/classes/Session.class.php b/classes/Session.class.php index 17ee98f..4c78026 100644 --- a/classes/Session.class.php +++ b/classes/Session.class.php @@ -17,7 +17,7 @@ return session_id(); } - public static function has($name) : bool { + public static function has(string $name) : bool { self::init(); if(isset($_SESSION[$name])) { @@ -27,7 +27,7 @@ return false; } - public static function get($name) : bool | int | float | string | array | object | null { + public static function get(string $name) : bool | int | float | string | array | object | null { self::init(); if(isset($_SESSION[$name])) { diff --git a/classes/Template.class.php b/classes/Template.class.php index 0143d9d..7858d95 100644 --- a/classes/Template.class.php +++ b/classes/Template.class.php @@ -11,7 +11,7 @@ private $files = null; private $navigation = null; - public function __construct($core) { + public function __construct(Core $core) { $this->core = $core; $this->files = new TemplateFiles(); $this->navigation = new TemplateNavigation($this->core); @@ -57,7 +57,7 @@ return $this->core; } - public function getAdminCore() { + public function getAdminCore() : CoreAdmin { return $this->core->getAdminCore(); } @@ -65,11 +65,11 @@ return array_key_exists($name, $this->assigns); } - public function getAssigns() { + public function getAssigns() : array { return $this->assigns; } - public function getFiles() { + public function getFiles() : TemplateFiles { return $this->files; } @@ -77,7 +77,7 @@ $this->assigns[$name] = $value; } - public function display($file, $arguments = [], $basedir = true) { + public function display(string $file, array $arguments = [], bool $basedir = true) { $template = $this; foreach($arguments AS $name => $value) { @@ -165,7 +165,7 @@ } } - public function getLanguage($short = false) { + public function getLanguage(bool $short = false) : string { $language = $this->getCore()->getSettings('LANGUAGE', 'en_US'); $language = Auth::getSettings('LANGUAGE', NULL, $language); @@ -184,7 +184,7 @@ $this->core->getHooks()->runAction('html_foot'); } - public function url($path = null, $parameters = null) { + public function url(bool | string $path = null, array $parameters = null) : string { $scheme = 'http'; if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { diff --git a/classes/TemplateDefaults.class.php b/classes/TemplateDefaults.class.php index 2c8ad5a..b313853 100644 --- a/classes/TemplateDefaults.class.php +++ b/classes/TemplateDefaults.class.php @@ -73,53 +73,55 @@ } public function foot_modals() { - $modals = $this->getCore()->getHooks()->applyFilter('modals', [], 10, false); - $template = $this; + $modals = $this->getCore()->getHooks()->applyFilter('modals', [], 10, false); + $template = $this; - foreach($modals AS $modal) { - ?> - \ No newline at end of file diff --git a/default/admin/users/delete.php b/default/admin/users/delete.php deleted file mode 100644 index 1c14132..0000000 --- a/default/admin/users/delete.php +++ /dev/null @@ -1 +0,0 @@ -DELETE? \ No newline at end of file diff --git a/default/css/style.css b/default/css/style.css index b192494..f3fe788 100644 --- a/default/css/style.css +++ b/default/css/style.css @@ -1,3 +1,9 @@ +@keyframes blink { + 50% { + visibility: hidden; + } +} + * { outline: none !important; -webkit-user-select: none; @@ -408,7 +414,7 @@ tr:hover .module-badge { /* Bash Colors */ div.terminal { top: 48px; - left: 266px; + left: 256px; bottom: 0; right: 0; background: #282c34; diff --git a/default/header.php b/default/header.php index 088ac62..c393bf2 100644 --- a/default/header.php +++ b/default/header.php @@ -27,7 +27,7 @@ ?> -
@@ -40,7 +33,7 @@ function send(cmd) { $.ajax({ type: 'POST', - url: '/server/console', + url: 'url('/server/console'); ?>', data: { action: 'command', command: cmd diff --git a/default/server/settings.php b/default/server/settings.php index c5464dc..54fc9dd 100644 --- a/default/server/settings.php +++ b/default/server/settings.php @@ -16,7 +16,6 @@ exit(); } ?> -
diff --git a/handler/admin/users.php b/handler/admin/users.php index e074936..b3427b3 100644 --- a/handler/admin/users.php +++ b/handler/admin/users.php @@ -7,7 +7,7 @@ use fruithost\Response; use PHPMailer\PHPMailer; - $users = Database::fetch('SELECT *, \'**********\' AS `password` FROM `' . DATABASE_PREFIX . 'users` WHERE `deleted`=\'NO\''); + $users = Database::fetch('SELECT *, \'[*** PROTECTED ***]\' AS `password` FROM `' . DATABASE_PREFIX . 'users` WHERE `deleted`=\'NO\''); if(isset($_POST['action'])) { $user = new User(); @@ -222,7 +222,7 @@ } } - $users = Database::fetch('SELECT *, \'**********\' AS `password` FROM `' . DATABASE_PREFIX . 'users` WHERE `deleted`=\'NO\''); + $users = Database::fetch('SELECT *, \'[*** PROTECTED ***]\' AS `password` FROM `' . DATABASE_PREFIX . 'users` WHERE `deleted`=\'NO\''); break; /* create user */ diff --git a/handler/login.php b/handler/login.php index 6115a36..89508dc 100644 --- a/handler/login.php +++ b/handler/login.php @@ -32,7 +32,7 @@ } else if(Auth::getSettings('2FA_ENABLED', $_POST['username'], 'false') === 'true' && Auth::TwoFactorLogin($_POST['username'], $_POST['password'])) { $text = ''; $code = rand(100000, 999999); - $result = Database::single('SELECT * FROM `' . DATABASE_PREFIX . 'users` WHERE `username`=:username LIMIT 1', [ + $result = Database::single('SELECT *, \'[*** PROTECTED ***]\' AS `password` FROM `' . DATABASE_PREFIX . 'users` WHERE `username`=:username LIMIT 1', [ 'username' => $_POST['username'] ]); diff --git a/handler/lost-password.php b/handler/lost-password.php index 9f5aa51..2d08c81 100644 --- a/handler/lost-password.php +++ b/handler/lost-password.php @@ -6,7 +6,7 @@ if(!empty($token)) { $found = null; - $result = Database::fetch('SELECT `id`, `username`, `email`, `lost_token`, UPPER(SHA2(CONCAT(`id`, :salt, `email`), 512)) AS `crypted_mail` FROM `' . DATABASE_PREFIX . 'users` WHERE `lost_enabled`=\'YES\' AND `lost_time` > DATE_SUB(NOW(), INTERVAL 24 HOUR)', [ + $result = Database::fetch('SELECT `id`, `username`, \'[*** PROTECTED ***]\' AS `password`, `email`, `lost_token`, UPPER(SHA2(CONCAT(`id`, :salt, `email`), 512)) AS `crypted_mail` FROM `' . DATABASE_PREFIX . 'users` WHERE `lost_enabled`=\'YES\' AND `lost_time` > DATE_SUB(NOW(), INTERVAL 24 HOUR)', [ 'salt' => RESET_PASSWORD_SALT ]); @@ -60,7 +60,7 @@ $template->assign('changeable', true); } } else if(isset($_POST['action']) && $_POST['action'] == 'lost-password') { - $result = Database::single('SELECT `id`, `username`, `email`, UPPER(SHA2(CONCAT(`id`, :salt, `email`), 512)) AS `crypted_mail` FROM `' . DATABASE_PREFIX . 'users` WHERE `email`=:email LIMIT 1', [ + $result = Database::single('SELECT `id`, `username`, \'[*** PROTECTED ***]\' AS `password`, `email`, UPPER(SHA2(CONCAT(`id`, :salt, `email`), 512)) AS `crypted_mail` FROM `' . DATABASE_PREFIX . 'users` WHERE `email`=:email LIMIT 1', [ 'email' => $_POST['email'], 'salt' => RESET_PASSWORD_SALT ]);