Esempio n. 1
0
 public function postLoginUser(Router $r)
 {
     $r->post('/ajax/ControleUsuario/login/*/*', function ($email, $senha) {
         $em = Container::gerEntityManager();
         $c = new ControleUsuario($em);
         $json_str = file_get_contents("/var/www/minichat3des/public/js/srp.json");
         $jsrc = json_decode($json_str, true);
         extract($jsrc);
         $login = array("email" => mcrypt_decrypt(MCRYPT_3DES, $k, hexToString($email), MCRYPT_MODE_CBC, hexToString($iv)), "senha" => $senha);
         $rsp = $c->login($login);
         if ($rsp) {
             header("/chat");
         }
     });
 }
Esempio n. 2
0
 public function postLoginUser(Router $r)
 {
     $r->post('/ajax/ControleUsuario/login/*/*', function ($email, $senha) {
         $em = Container::gerEntityManager();
         $c = new ControleUsuario($em);
         $s = Container::getSession();
         $k = safeHexToString($s->get("key"));
         $iv = safeHexToString($s->get("iv"));
         $login = array("email" => mcrypt_decrypt(MCRYPT_3DES, $k, hexToString($email), MCRYPT_MODE_CBC, $iv), "senha" => mcrypt_decrypt(MCRYPT_3DES, $k, hexToString($senha), MCRYPT_MODE_CBC, $iv));
         $rsp = $c->login($login, $s);
         if ($rsp) {
             header("/chat");
         }
     });
 }