generated from jric11/baseProject
added new bootstrap css and js for login and create account
This commit is contained in:
@@ -164,29 +164,6 @@ class Base {
|
||||
exit();
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Return a decrypted string
|
||||
// =========================
|
||||
|
||||
protected function decrypt($encrypted = "", $key = "") {
|
||||
|
||||
$key = (empty($key)) ? __CLASS__ : $key;
|
||||
|
||||
$decoded = base64_decode($encrypted);
|
||||
$ivlen = openssl_cipher_iv_length($cipher = "AES-128-CBC");
|
||||
$iv = substr($decoded, 0, $ivlen);
|
||||
$hmac = substr($decoded, $ivlen, $sha2len = 32);
|
||||
$raw = substr($decoded, $ivlen + $sha2len);
|
||||
$decrypted = openssl_decrypt($raw, $cipher, $key, $options = OPENSSL_RAW_DATA, $iv);
|
||||
$calcmac = hash_hmac("sha256", $raw, $key, $as_binary = true);
|
||||
|
||||
if (($hmac === false) or ($calcmac === false)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return (hash_equals($hmac, $calcmac)) ? $decrypted : "";
|
||||
}
|
||||
|
||||
// ======================
|
||||
// Display a Content Page
|
||||
// ======================
|
||||
@@ -207,9 +184,6 @@ class Base {
|
||||
|
||||
public function displayError($error_number = "", $error_message = "", $error_file = "", $error_line = "") {
|
||||
|
||||
echo $error_message;
|
||||
die();
|
||||
|
||||
if (error_reporting() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user