Exemple #1
0
 public function logintry($postdata)
 {
     $inputname = $postdata['inputname'];
     $inputpass = $postdata['inputpass'];
     $user = new User();
     $user->findByName($inputname);
     if ($user->getPassword() === hash('sha256', $inputpass)) {
         Session::create('user', $user->getName());
     } else {
         echo 0;
     }
 }