mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
rename 2 functions
This commit is contained in:
parent
734881d098
commit
7a5fab82ca
3 changed files with 4 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ class DBConnection
|
|||
return self::$instance;
|
||||
}
|
||||
|
||||
public static function setPrefix($prefix)
|
||||
public static function setTablePrefix($prefix)
|
||||
{
|
||||
$db = self::instance();
|
||||
$db->setPrefix($prefix);
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ function idSignature(string $id, string $key, string $salt): string
|
|||
return hash_hmac('sha256', $id, $secret);
|
||||
}
|
||||
|
||||
function isSignatureOk(string $signature, string $id, string $key, string $salt): bool
|
||||
function isValidSignature(string $signature, string $id, string $key, string $salt): bool
|
||||
{
|
||||
if ( hash_equals($signature, idSignature($id, $key, $salt)) ) return true;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ else {
|
|||
die("Incorrect database connection config");
|
||||
}
|
||||
|
||||
DBConnection::setPrefix(MTT_DB_PREFIX);
|
||||
DBConnection::setTablePrefix(MTT_DB_PREFIX);
|
||||
DBCore::setDefaultInstance(new DBCore($db));
|
||||
Config::load();
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ function is_logged(): bool
|
|||
if ( !need_auth() ) return true;
|
||||
if ( !isset($_SESSION['logged']) || !isset($_SESSION['sign']) ) return false;
|
||||
if ( !(int)$_SESSION['logged'] ) return false;
|
||||
return isSignatureOk($_SESSION['sign'], session_id(), Config::get('password'), defined('MTT_SALT') ? MTT_SALT : '');
|
||||
return isValidSignature($_SESSION['sign'], session_id(), Config::get('password'), defined('MTT_SALT') ? MTT_SALT : '');
|
||||
}
|
||||
|
||||
function is_readonly(): bool
|
||||
|
|
|
|||
Loading…
Reference in a new issue