Ejemplo n.º 1
0
 function requestToken()
 {
     $token = md5(uniqid(mt_rand(), true));
     if (!$this->user) {
         return null;
     }
     $table = new JS_Table('users');
     if ($table->store(array('ID' => $this->user->ID, 'token' => $token))) {
         $this->user->token = $token;
         return $token;
     }
     return null;
 }