new database
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
require_once (realpath(dirname(__FILE__) ."/../../../bootstrap.php"));
|
||||
require_once(realpath(dirname(__FILE__) . "/../../../bootstrap.php"));
|
||||
|
||||
use Backend\Models\Group;
|
||||
use Backend\Models\Password;
|
||||
|
||||
session_start();
|
||||
|
||||
|
||||
@@ -14,7 +15,7 @@ session_start();
|
||||
function groupViaToken(string $token): ?Group
|
||||
{
|
||||
|
||||
if($password = Password::firstWhere('remember_token', $token)){
|
||||
if ($password = Password::firstWhere('remember_token', $token)) {
|
||||
return Group::find($password->group_id);
|
||||
}
|
||||
return null;
|
||||
@@ -34,15 +35,14 @@ function isLogin(): bool
|
||||
*/
|
||||
function passwordValidate(string $password1): bool
|
||||
{
|
||||
$uppercase = preg_match('@[A-Z]@', $password1);
|
||||
$lowercase = preg_match('@[a-z]@', $password1);
|
||||
$number = preg_match('@[0-9]@', $password1);
|
||||
$specialChars = preg_match('@[^\w]@', $password1);
|
||||
$uppercase = preg_match('@[A-Z]@', $password1);
|
||||
$lowercase = preg_match('@[a-z]@', $password1);
|
||||
$number = preg_match('@[0-9]@', $password1);
|
||||
$specialChars = preg_match('@[^\w]@', $password1);
|
||||
|
||||
if(!$uppercase || !$lowercase || !$number || !$specialChars || (strlen($password1) >= 8 && strlen($password1) <= 255) ) {
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
if (!$uppercase || !$lowercase || !$number || !$specialChars || (strlen($password1) >= 8 && strlen($password1) <= 255)) {
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
function makeLogin(string $groupName, int $groupId)
|
||||
|
||||
Reference in New Issue
Block a user