Exemplo n.º 1
0
 function process(&$a = null)
 {
     try {
         $this->err = '';
         if (Check::isdatetime($_REQUEST['timestamp']) == false) {
             $this->err .= "bad timestamp. ";
         }
         if (preg_match('/^[a-f\\d]{32}$/', $_REQUEST['password']) == false) {
             $this->err .= "bad password format. ";
         }
         if (preg_match('/[\\w\\-\\.]+@[\\w\\-\\.]+/', $_REQUEST['email']) == false) {
             $this->err .= "bad email username. ";
         }
         if ($this->err) {
             throw new Exception($this->err);
         }
         file_put_contents("/tmp/process.txt", $this->err);
         $print = parent::process($a);
         return $print;
     } catch (Exception $e) {
         return "ERROR : {$a} {$e->getMessage()}";
     }
 }