public function authAction()
 {
     $model = new PageModel();
     if (isPost()) {
         $email = post('email');
         $password = md5(post('password'));
         $user = $model->getUserByEP($email, $password);
         if ($user->id) {
             $modelProfile = new ProfileModel();
             $updateString = "`looking` = 0";
             $recId = $modelProfile->checkDiscoverRecord($user->id);
             if (!empty($recId->id)) {
                 $modelProfile->updateDiscoverRecord($recId->id, $updateString);
             }
             if (post("remember-me") == 1) {
                 $cookie_live_time = 7 * 24 * 60 * 60;
                 setMyCookie('user', $user->id, time() + $cookie_live_time);
             }
             setSession('user', $user->id, false);
             redirect(url($user->id));
         } else {
             $error = "error";
             setSession('login_error', "invalid");
             //  redirect(url());
             setMyCookie('login_error', "You have input the incorrect username and password, try again", time() + 5);
             redirect(url('page', 'index'));
         }
     }
 }
 public function authAction()
 {
     $model = new PageModel();
     if (isPost()) {
         $email = post('email');
         $password = md5(post('password'));
         $user = $model->getUserByEP($email, $password);
         if ($user->id) {
             setSession('user', $user->id, false);
             redirect(url($user->id));
         } else {
             $error = "error";
             setSession('login_error', "invalid");
             //  redirect(url());
             setMyCookie('login_error', "You have input the incorrect username and password, try again", time() + 5);
             redirect(url('page', 'index'));
         }
     }
 }