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);
    }
}
Esempio n. 2
0
$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();
                    }
                }
            }
        }
        $ts3viewer->close();
    }
Esempio n. 3
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();
}