Moves the client to another channel.

@param  integer $cid
@param  string  $cpw
@return void
541180
public function move($cid, $cpw = null)
  {
    $this->getParent()->clientMove($this->getId(), $cid, $cpw);
  }
941114
public function actionAll( $cid ) {

		$dataProvider	= $this->modelService->getPage( [ 'conditions' => [ 'categoryId' => $cid ] ] );
		$category		= $this->categoryService->getById( $cid );

		return $this->render( 'all', [
			'dataProvider' => $dataProvider,
			'category' => $category
		]);
	}
472617
protected function cidExists($cid)
    {
        foreach ($this->attachment as $attachment) {
            if ('inline' == $attachment[6] and $cid == $attachment[7]) {
                return true;
            }
        }

        return false;
    }
719809
public function subChannelGetById($cid)
  {
    if(!array_key_exists((int) $cid, $this->subChannelList()))
    {
      throw new Exception("invalid channelID", 0x300);
    }

    return $this->channelList[(int) $cid];
  }
1101516
public function channelGetPathway($cid)
  {
    $channel = $this->channelGetById($cid);
    $pathway = $channel["channel_name"];

    if($channel["pid"])
    {
      $pathway = $this->channelGetPathway($channel["pid"]) . "/" . $channel["channel_name"];
    }

    return $pathway;
  }
108033
public function run( $cid ) {

		if( isset( $this->model ) ) {

			$modelAddress = $this->modelAddressService->getById( $cid );

			if( isset( $modelAddress ) && $modelAddress->isParentValid( $this->model->id, $this->parentType ) ) {

				$address = $modelAddress->model;

				if( isset( $this->scenario ) ) {

					$address->setScenario( $this->scenario );
				}

				if( $address->load( Yii::$app->request->post(), $address->getClassName() ) && $address->validate() ) {

					$modelAddress->type = $this->modelType;

					$this->addressService->update( $address );

					$this->modelAddressService->update( $modelAddress );

					$address->refresh();

					$data = [
						'cid' => $modelAddress->id, 'ctype' => $modelAddress->type,
						'title' => $address->title, 'line1' => $address->line1, 'line2' => $address->line2,
						'country' => $address->countryName, 'province' => $address->provinceName,
						'region' => $address->regionName, 'city' => $address->cityName,
						'zip' => $address->zip, 'value' => $address->toString()
					];

					// Trigger Ajax Success
					return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
				}

				// Generate Errors
				$errors = AjaxUtil::generateErrorMessage( $address );

				// Trigger Ajax Failure
				return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_REQUEST ), $errors );
			}
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
297925
public static function ipCidrsCheck($p_ip, $p_cidrs)
    {
        foreach ($p_cidrs as $name => $range) {
            if (self::ipCidrCheck($p_ip, $range)) {
                return true;
            }
        }
        
        return false;
    }
181776
public void update(ChannelData cc)                   // F177053
	{
		if (tc.isEntryEnabled()) SibTr.entry(this, tc, "update", cc);  // F177053
		// TODO: decide what to do if we are notified our configuration has changed.
		if (tc.isEntryEnabled()) SibTr.exit(this, tc, "update");   // F177053
		this.chfwConfig=cc;
	}
17011
public function updateDisplayOrder($displayOrder, $cID = 0)
    {
        $displayOrder = (int) $displayOrder;

        //this line was added to allow changing the display order of aliases
        if (!intval($cID)) {
            $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->cID;
        }

        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);

        $oldDisplayOrder = $db->fetchColumn('SELECT cDisplayOrder FROM Pages WHERE cID = ?', [$cID]);

        // Exit out if the display order for this page doesn't change.
        if ($oldDisplayOrder === null || $displayOrder === (int) $oldDisplayOrder) {
            return;
        }

        // Store the new display order.
        $db->executeQuery('update Pages set cDisplayOrder = ? where cID = ?', [$displayOrder, $cID]);

        // Because the display order of another page can be changed,
        // the page object is retrieved first in order to pass it to the event.
        $page = $this;
        if ($cID && (int) $cID !== (int) $this->getCollectionID()) {
            $page = static::getByID($cID);
        }

        if ($page->isError()) {
            return;
        }

        // Fire an event that the page display order has changed.
        $event = new DisplayOrderUpdateEvent($page);
        $event->setOldDisplayOrder($oldDisplayOrder);
        $event->setNewDisplayOrder($displayOrder);
        Events::dispatch('on_page_display_order_update', $event);
    }
451236
public function run( $cid ) {

		if( isset( $this->model ) ) {

			$modelLocation = $this->modelLocationService->getById( $cid );

			if( isset( $modelLocation ) && $modelLocation->isParentValid( $this->model->id, $this->parentType ) ) {

				$location = $modelLocation->model;

				$adata	= $location->getAttributeArray( $this->returnAttributes );
				$data	= [ 'cid' => $cid, 'location' => $adata, 'type' => $modelLocation->type ];

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
			}
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
533369
public function subChannelGetById($cid)
  {
    if(!array_key_exists((int) $cid, $this->subChannelList()))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
    }

    return $this->channelList[(int) $cid];
  }
120761
public function set($cid, $data)
    {
        $result = null;
        $this->hook->attach('cache.set.before', $cid, $data, $result, $this);

        if (isset($result)) {
            return $result;
        }

        if (is_array($cid)) {
            $cid = gplcart_array_hash($cid);
        }

        $this->file = GC_DIR_CACHE . "/$cid.cache";

        $result = false;

        if (file_put_contents($this->file, serialize((array) $data)) !== false) {
            chmod($this->file, 0600);
            $result = true;
        }

        $this->hook->attach('cache.set.after', $cid, $data, $result, $this);
        return (bool) $result;
    }
142737
public function channelSpacerGetType($cid)
  {
    $channel = $this->channelGetById($cid);

    if(!$this->channelIsSpacer($channel))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channel flags", 0x307);
    }

    switch($channel["channel_name"]->section("]", 1))
    {
      case "___":
        return TeamSpeak3::SPACER_SOLIDLINE;

      case "---":
        return TeamSpeak3::SPACER_DASHLINE;

      case "...":
        return TeamSpeak3::SPACER_DOTLINE;

      case "-.-":
        return TeamSpeak3::SPACER_DASHDOTLINE;

      case "-..":
        return TeamSpeak3::SPACER_DASHDOTDOTLINE;

      default:
        return TeamSpeak3::SPACER_CUSTOM;
    }
  }
1117448
private function addServiceLocalTempVariables($cId, $definition)
    {
        static $template = "        \$%s = %s;\n";

        $localDefinitions = array_merge(
            array($definition),
            $this->getInlinedDefinitions($definition)
        );

        $calls = $behavior = array();
        foreach ($localDefinitions as $iDefinition) {
            $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior);
            $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior);
            $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior);
            $this->getServiceCallsFromArguments(array($iDefinition->getConfigurator()), $calls, $behavior);
            $this->getServiceCallsFromArguments(array($iDefinition->getFactory()), $calls, $behavior);
        }

        $code = '';
        foreach ($calls as $id => $callCount) {
            if ('service_container' === $id || $id === $cId) {
                continue;
            }

            if ($callCount > 1) {
                $name = $this->getNextVariableName();
                $this->referenceVariables[$id] = new Variable($name);

                if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $behavior[$id]) {
                    $code .= sprintf($template, $name, $this->getServiceCall($id));
                } else {
                    $code .= sprintf($template, $name, $this->getServiceCall($id, new Reference($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)));
                }
            }
        }

        if ('' !== $code) {
            $code .= "\n";
        }

        return $code;
    }
1234514
public function channelSpacerGetAlign($cid)
  {
    $channel = $this->channelGetById($cid);

    if(!$this->channelIsSpacer($channel) || !preg_match("/\[(.*)spacer.*\]/", $channel, $matches) || !isset($matches[1]))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channel flags", 0x307);
    }

    switch($matches[1])
    {
      case "*":
        return TeamSpeak3::SPACER_ALIGN_REPEAT;

      case "c":
        return TeamSpeak3::SPACER_ALIGN_CENTER;

      case "r":
        return TeamSpeak3::SPACER_ALIGN_RIGHT;

      default:
        return TeamSpeak3::SPACER_ALIGN_LEFT;
    }
  }
827668
public function push($payload): void
    {
        // attach sender if not broadcast
        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
            $this->addDescriptor($this->sender);
        }

        // check if to broadcast to other clients
        if ($this->shouldBroadcast()) {
            $this->addDescriptors($this->getWebsocketConnections());
        }

        // push message to designated fds
        foreach ($this->descriptors as $descriptor) {
            if ($this->shouldPushToDescriptor($descriptor)) {
                $this->server->push($descriptor, $payload, $this->opcode);
            }
        }
    }
32656
public function channelGroupPermRemove($cgid, $permid)
  {
    if(!is_array($permid))
    {
      $permident = (is_numeric($permid)) ? "permid" : "permsid";
    }
    else
    {
      $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
    }

    $this->execute("channelgroupdelperm", array("cgid" => $cgid, $permident => $permid));
  }