예제 #1
0
파일: tags.php 프로젝트: rhrn/apirn
 public function remove($user, $id)
 {
     $remove = MDB::objectId($id);
     $remove['user_id'] = MDB::stringId($user);
     $x = $this->collection->remove($remove, array('safe' => true));
     if ($x['n']) {
         return $id;
     }
 }
예제 #2
0
파일: tokens.php 프로젝트: rhrn/apirn
 public function gen(array $user)
 {
     $id = MDB::stringId($user);
     $tail = base64_encode(hash('sha256', date('Y-m-d') . $id . $user["_id"]->getTimestamp() . $user["_id"]->getInc() . microtime()));
     self::$user_id = MDB::stringId($user);
     self::$token = $id . Model_V1_Tokens::DELIMETER . $tail;
     if ($this->add()) {
         return self::$token;
     }
 }