Beispiel #1
0
 public function check_admin_password()
 {
     $unique = '';
     $password = $_POST['admin_password'];
     if (Config::get('admin', 'hash') !== SecureHash::hash(Config::get('admin', 'hash_type'), $password, $unique, false)) {
         $this->redirect('home');
     }
 }
Beispiel #2
0
 public function form_token()
 {
     $token = SecureHash::hash('sha256', uniqid(mt_rand(10000, 99999), true), Config::get('namespace', 'base'), false);
     if (isset($this->session)) {
         $this->session->miranda_form_token = $token;
     } else {
         setcookie('miranda_form_token', $token, 0, Config::get('cookies', 'path'), Config::get('cookies', 'domain'), false, true);
     }
     return $token;
 }