Adding/removing forum from the moderation list for user of given ID.
@param int $uid user ID
@param int $fid forum ID
@return Response
179923
public function actionMod($uid = null, $fid = null)
    {
        if (!is_numeric($uid) || $uid < 1 || !is_numeric($fid) || $fid < 1) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the moderator or forum with this ID.'));
            return $this->redirect(['admin/mods']);
        }
        $mod = User::find()->where(['id' => $uid, 'role' => User::ROLE_MODERATOR])->limit(1)->one();
        if (empty($mod)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the moderator with this ID.'));
            return $this->redirect(['admin/mods']);
        }
        $forum = Forum::find()->where(['id' => $fid])->limit(1)->one();
        if (empty($forum)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the forum with this ID.'));
            return $this->redirect(['admin/mods']);
        }
        if ($mod->updateModeratorForOne($forum->id)) {
            $this->success(Yii::t('podium/flash', 'Moderation list has been updated.'));
        } else {
            $this->error(Yii::t('podium/flash', 'Sorry! There was an error while updating the moderation list.'));
        }
        return $this->redirect(['admin/mods', 'id' => $uid]);
    }
1077040
public function removeSub($topic, $uid)
    {
        ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->my_removeSub($topic, $uid);
    }
58749
public function my_removeUid($uid)
    {
        if (get_instance()->isCluster()) {
            $this->map[$this->node_name]->remove($uid);
            foreach ($this->client as $client) {
                $client->removeNodeUid($this->node_name, $uid);
            }
            if (Start::isLeader()) {
                get_instance()->pub('$SYS/uidcount', $this->countOnline());
            }
        }
        $this->my_clearUidSub($uid);
    }
1063654
public function actionDeletepost($cid = null, $fid = null, $tid = null, $pid = null)
    {
        $post = Post::verify($cid, $fid, $tid, $pid);
        if (empty($post)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the post you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if ($post->thread->locked == 1 && !User::can(Rbac::PERM_UPDATE_THREAD, ['item' => $post->thread])) {
            $this->info(Yii::t('podium/flash', 'This thread is locked.'));
            return $this->redirect([
                'forum/thread',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'id' => $post->thread->id,
                'slug' => $post->thread->slug
            ]);
        }

        if (!User::can(Rbac::PERM_DELETE_OWN_POST, ['post' => $post]) && !User::can(Rbac::PERM_DELETE_POST, ['item' => $post])) {
            $this->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
            return $this->redirect(['forum/index']);
        }

        $postData = Yii::$app->request->post('post');
        if ($postData) {
            if ($postData != $post->id) {
                $this->error(Yii::t('podium/flash', 'Sorry! There was an error while deleting the post.'));
            } else {
                if ($post->podiumDelete()) {
                    $this->success(Yii::t('podium/flash', 'Post has been deleted.'));
                    if (Thread::find()->where(['id' => $post->thread->id])->exists()) {
                        return $this->redirect([
                            'forum/forum',
                            'cid' => $post->forum->category->id,
                            'id' => $post->forum->id,
                            'slug' => $post->forum->slug
                        ]);
                    }
                    return $this->redirect([
                        'forum/thread',
                        'cid' => $post->forum->category->id,
                        'fid' => $post->forum->id,
                        'id' => $post->thread->id,
                        'slug' => $post->thread->slug
                    ]);
                }
                $this->error(Yii::t('podium/flash', 'Sorry! There was an error while deleting the post.'));
            }
        }
        return $this->render('deletepost', ['model' => $post]);
    }
770189
public function actionDeleteposts($cid = null, $fid = null, $id = null, $slug = null)
    {
        $thread = (new ThreadVerifier([
            'categoryId' => $cid,
            'forumId' => $fid,
            'threadId' => $id,
            'threadSlug' => $slug
        ]))->verify();
        if (empty($thread)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if (!User::can(Rbac::PERM_DELETE_POST, ['item' => $thread])) {
            $this->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
            return $this->redirect(['forum/index']);
        }

        $posts = Yii::$app->request->post('post');
        if ($posts) {
            if (!is_array($posts)) {
                $this->error(Yii::t('podium/flash', 'You have to select at least one post.'));
            } else {
                if ($thread->podiumDeletePosts($posts)) {
                    $this->success(Yii::t('podium/flash', 'Posts have been deleted.'));
                    if (Thread::find()->where(['id' => $thread->id])->exists()) {
                        return $this->redirect([
                            'forum/thread',
                            'cid' => $thread->forum->category->id,
                            'fid' => $thread->forum->id,
                            'id' => $thread->id,
                            'slug' => $thread->slug
                        ]);
                    }
                    return $this->redirect([
                        'forum',
                        'cid' => $thread->forum->category->id,
                        'id' => $thread->forum->id,
                        'slug' => $thread->forum->slug
                    ]);
                }
                $this->error(Yii::t('podium/flash', 'Sorry! There was an error while deleting the posts.'));
            }
        }
        return $this->render('deleteposts', [
            'model' => $thread,
            'dataProvider' => (new Post())->search($thread->forum->id, $thread->id)
        ]);
    }
1246562
public function update($user_uid, $uid)
    {
        $user = Subbly::api('subbly.user')->find($user_uid);

        if (!Input::has('user_address')) {
            return $this->jsonErrorResponse('"user_address" is required.');
        }

        $userAddress = Subbly::api('subbly.user_address')->update($uid, Input::get('user_address'));

        return $this->jsonResponse(array(
            'user_address' => $userAddress,
        ),
        array(
            'status' => array(
                'code'    => 200,
                'message' => 'UserAddress updated',
            ),
        ));
    }
20726
public function deleteUser($uid, $eventTime=null)
    {
        $eventTime = $this->getEventTime($eventTime);

        $json = json_encode([
            'event' => '$delete',
            'entityType' => 'user',
            'entityId' => $uid,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
1347785
public function actionReport($cid = null, $fid = null, $tid = null, $pid = null)
    {
        $post = Post::verify($cid, $fid, $tid, $pid);
        if (empty($post)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the post you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if (User::can(Rbac::PERM_UPDATE_POST, ['item' => $post])) {
            $this->info(Yii::t('podium/flash', "You don't have to report this post since you are allowed to modify it."));
            return $this->redirect([
                'forum/edit',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'tid' => $post->thread->id,
                'pid' => $post->id
            ]);
        }

        if ($post->author_id == User::loggedId()) {
            $this->info(Yii::t('podium/flash', 'You can not report your own post. Please contact the administrator or moderators if you have got any concerns regarding your post.'));
            return $this->redirect([
                'forum/thread',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'id' => $post->thread->id,
                'slug' => $post->thread->slug
            ]);
        }

        $model = new Message();
        $model->scenario = 'report';
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if ($model->podiumReport($post)) {
                $this->success(Yii::t('podium/flash', 'Thank you for your report. The moderation team will take a look at this post.'));
                return $this->redirect([
                    'forum/thread',
                    'cid' => $post->forum->category->id,
                    'fid' => $post->forum->id,
                    'id' => $post->thread->id,
                    'slug' => $post->thread->slug
                ]);
            }
            $this->error(Yii::t('podium/flash', 'Sorry! There was an error while notifying the moderation team. Contact administrator about this problem.'));
        }
        return $this->render('report', ['model' => $model, 'post' => $post]);
    }
920171
public function show($uid)
    {
        $options = $this->getParams('includes');

        $user = Subbly::api('subbly.user')->find($uid, $options);

        return $this->jsonResponse(array(
            'user' => $this->presenter->single($user),
        ));
    }
281329
public function my_removeSub($topic, $uid)
    {
        if (empty($uid)) return;
        if (isset($this->subArr[$topic])) {
            $this->subArr[$topic]->remove($uid);
            if ($this->subArr[$topic]->count() == 0) {
                unset($this->subArr[$topic]);
            }
        }
    }
217143
public function remove(int $id): PodiumResponse
    {
        $forumRemover = $this->getRemover($id);

        if ($forumRemover === null) {
            throw new ModelNotFoundException('Forum of given ID can not be found.');
        }

        return $forumRemover->remove();
    }
1300439
public function push($fid,$msg){
        if( $this->server->server->exist($fid)){
            $this->server->server->push($fid,$msg);
        }
    }
467141
public static function removeUserFromGroups($uid)
	{
		$db = \App::get('db');
		$tables = array('#__xgroups_members', '#__xgroups_managers', '#__xgroups_invitees', '#__xgroups_applicants');

		foreach ($tables as $table)
		{
			$sql = "DELETE FROM `".$table."` WHERE uidNumber=" . $db->quote($uid);
			$db->setQuery($sql);
			$db->query();
		}

		return true;
	}
1334567
public static function oneByMessageAndUser($mid, $uid)
	{
		return self::all()
			->whereEquals('mid', $mid)
			->whereEquals('uid', $uid)
			->row();
	}
599846
public function getAllThreadIdsForUser($uid) {
    $query = 'SELECT DISTINCT(thread.id), MAX(thread.updated) ' .
      'FROM {private_message_threads} AS thread ' .
      'JOIN {private_message_thread__members} AS member ' .
      'ON member.entity_id = thread.id AND member.members_target_id = :uid ' .
      'JOIN {private_message_thread__private_messages} AS thread_messages ' .
      'ON thread_messages.entity_id = thread.id ' .
      'JOIN {private_messages} AS messages ' .
      'ON messages.id = thread_messages.private_messages_target_id ' .
      'JOIN {private_message_thread__last_delete_time} AS thread_delete_time ' .
      'ON thread_delete_time.entity_id = thread.id ' .
      'JOIN {pm_thread_delete_time} as owner_delete_time ' .
      'ON owner_delete_time.id = thread_delete_time.last_delete_time_target_id AND owner_delete_time.owner = :uid ' .
      'WHERE owner_delete_time.delete_time <= messages.created ';
    $vars = [':uid' => $uid];

    $query .= 'GROUP BY thread.id ORDER BY MAX(thread.updated) DESC, thread.id';

    $thread_ids = $this->database->query(
      $query,
      $vars
    )->fetchCol();

    return is_array($thread_ids) ? $thread_ids : [];
  }
668551
def forum_post_delete(self, post_id):
        
        return self._get('forum_posts/{0}.json'.format(post_id),
                         method='DELETE', auth=True)
1249221
public function setJid( $jid ){
		extract( self::disassemble( $jid ) );
		$this->set( $domain, $node, $resource );
	}