Exemplo n.º 1
0
 function loginAct(Request $request)
 {
     $name = $_POST['nick'];
     $password = $_POST['password'];
     if (\App\Model\User::validate($name, $password)) {
         $user = \App\Model\User::getByName($name);
         $_SESSION['user'] = $user->toArray();
         echo 'success';
     } else {
         echo 'failure';
     }
 }