Example #1
0
File: Tag.php Project: 4otaku/api
 public function process()
 {
     if (!$this->is_moderator()) {
         $item_id = (int) $this->get('id');
         $author = $this->db->get_field('art_artist', 'id_user', $item_id);
         if ($this->get_user() != $author) {
             throw new ErrorApi(ErrorApi::INSUFFICIENT_RIGHTS);
         }
     }
     parent::process();
 }
Example #2
0
File: Tag.php Project: 4otaku/api
 protected function get_count_insert_data($tag, $id)
 {
     return array_merge(parent::get_count_insert_data($tag, $id), array('name' => $tag, 'original' => 1));
 }