예제 #1
0
 /**
  * Validate password
  *
  * @access public
  * @author Dao Anh Minh
  */
 public static function _validation_change_pass($old_pass, $account_id)
 {
     Validation::active()->set_message('change_pass', 'Mật khẩu cũ không đúng');
     $account = Model_Account::query()->where('id', $account_id)->where('password', Auth\Auth::instance()->hash_password($old_pass))->count();
     if ($account > 0) {
         return true;
     } else {
         return false;
     }
 }
예제 #2
0
 /**
  * Xóa tài khoản
  *
  * @param integer $account_id account id
  *
  * @access public
  * @author Dao Anh Minh
  */
 public function action_delete($account_id)
 {
     $account = Model_Account::query()->where('id', $account_id)->get_one();
     if (empty($account) or $account->username == 'admin') {
         Session::set_flash('error', __('account.account_not_exist'));
         Response::redirect('admin/account');
     }
     if ($account->delete()) {
         Session::set_flash('success', __('account.success_delete'));
         Response::redirect('admin/account/index');
     } else {
         Session::set_flash('error', __('common.system_error'));
         Response::redirect('admin/account/register');
     }
 }