function broadcast($pNotification, $forcereload = TRUE)
{
    global $pluginManager;
    $notificationManager = $pluginManager->getNotificationManager();
    if ($pNotification instanceof Notification) {
        $pMessage = $pNotification->getMessage();
        if ($pluginManager->isInstalled('plg_ts3viewer')) {
            require_once $pluginManager->getController('plg_ts3viewer', 'Ts3Viewer');
            $ts3Viewer = new Ts3Viewer();
            $ts3Viewer->connect();
            $ts3Viewer->setNickname("Vision (Webinterface)");
            $ts3Viewer->writeBroadcast($pMessage);
            $ts3Viewer->close();
        }
        $notificationManager->addServerNotification($pNotification, $forcereload);
    }
}
Exemplo n.º 2
0
<?php

$pluginManager->databaseManager->selectTable(1);
$jUI->add(new JUI\Widget($pluginManager->getPluginName(), "settings"));
$list = new JUI\ListView();
$list->addItem("Benutzer", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'user'));
$list->addItem("Channel", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'channel'));
$list->addItem("Broadcast senden", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'broadcast'));
$list->addItem("Einstellungen", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'settings'));
$jUI->add($list);
$jUI->hline();
$userId = $pluginManager->getSimpleStorage('connected_user_id', '', FALSE);
if (!empty($userId)) {
    require_once $pluginManager->getController('Ts3Viewer');
    require_once $pluginManager->getController('userButtons');
    $ts3viewer = new Ts3Viewer();
    if ($ts3viewer->connect()) {
        $ts3viewer->setNickname("Vision (Webinterface)");
        $userId = $pluginManager->getSimpleStorage('connected_user_id', '', FALSE);
        if (!empty($userId)) {
            $users = $ts3viewer->clientList();
            if (!empty($users) && is_array($users)) {
                foreach ($users as $user) {
                    if ($user['client_database_id'] == $userId) {
                        $jUI->add(new JUI\Heading($user['client_nickname']));
                        addUserButtons($user['clid']);
                        $jUI->newline();
                    }
                }
            }
        }
<?php

require_once $pluginManager->getController('Ts3Viewer');
$ts3viewer = new Ts3Viewer();
if ($ts3viewer->connect()) {
    $ts3viewer->setNickname("Vision (Webinterface: " . $loginManager->getUsername() . ")");
    $command = $pluginManager->getCommand(0);
    if (!empty($command)) {
        $logManager->addLog($loginManager->getUsername() . " hat den Benutzer mit der Nummer " . $command . " vom Server gekickt.");
        $ts3viewer->kick($command, "Bye bye (kicked by " . $loginManager->getUsername() . ")", true);
        die('{"redirect":["' . $pluginManager->getPluginName() . '", "user", ""]}');
    }
    $ts3viewer->close();
}
Exemplo n.º 4
0
<?php

include $pluginManager->getController('Ts3Viewer');
$ts3viewer = new Ts3Viewer();
if ($ts3viewer->connect()) {
    $ts3viewer->setNickname("Vision (Webinterface: " . $loginManager->getUsername() . ")");
    $command = $pluginManager->getCommand(0);
    if (!empty($command)) {
        $logManager->addLog($loginManager->getUsername() . " hat den Benutzer mit der Nummer " . $command . " aus dem Channel gekickt.");
        $ts3viewer->kick($command, "Sie wurden aus dem Channel gekickt");
        die('{"redirect":["' . $pluginManager->getPluginName() . '", "user", ""]}');
    }
    $ts3viewer->close();
}
Exemplo n.º 5
0
<?php

include $pluginManager->getController('Ts3Viewer');
$afkshort = 21;
$afklong = 22;
$ts3viewer = new Ts3Viewer();
if ($ts3viewer->connect()) {
    $ts3viewer->setNickname("Vision (Webinterface: " . $loginManager->getUsername() . ")");
    $command = $pluginManager->getCommand(0);
    if (empty($command)) {
        $list = $ts3viewer->clientList();
        $channellist = $ts3viewer->channelList(true);
        $nameArray = array();
        $clickArray = array();
        if (!empty($list)) {
            foreach ($list as $user) {
                if ($user['client_type'] == '0') {
                    $cid = $user['cid'];
                    $nameArray[] = $user['client_nickname'] . ' - ' . $channellist[$cid]['channel_name'];
                    $clickArray[] = "openPlugin('" . $pluginManager->getPluginName() . "','user','" . $user['clid'] . "')";
                }
            }
        }
        echo '[{"type":"list","value":' . json_encode($nameArray) . ',"click":' . json_encode($clickArray) . '}]';
    } else {
        if (is_numeric($command)) {
            if (!empty($_POST['message'])) {
                $ts3viewer->writeMessage($command, $_POST['message']);
                die('{"redirect":["' . $pluginManager->getPluginName() . '", "user", ""]}');
            } else {
                if (!empty($pluginManager->getCommand(1))) {