public function passChange() { if (!empty($_POST['oldpass']) && !empty($_POST['newpass']) && !empty($_POST['newpass2'])) { if ($_POST['newpass'] == $_POST['newpass2']) { $req = $this->model('auth')->find(1); $hash = $req->pass; if (password_verify($_POST['oldpass'], $hash)) { $req->pass = password_hash($_POST['newpass'], PASSWORD_BCRYPT); $req->save(); Tools::authCheck(); $this->view('admin/settings', ['cfg' => $this->cfg, 'changed' => true, 'lang' => $this->lang('settings')]); } else { Tools::authCheck(); $this->view('admin/settings', ['cfg' => $this->cfg, 'failed' => true, 'lang' => $this->lang('settings')]); } } else { Tools::authCheck(); $this->view('admin/settings', ['cfg' => $this->cfg, 'noMatch' => true, 'lang' => $this->lang('settings')]); } } else { Tools::authCheck(); $this->view('admin/settings', ['cfg' => $this->cfg, 'fields' => true, 'lang' => $this->lang('settings')]); } }
public function settings() { Tools::authCheck(); $this->view('admin/settings', ['cfg' => $this->cfg, 'lang' => $this->lang('settings')]); }