commit dd34f7a8daf9747782df67aaa8f02b20e85ad7a8 Author: Naeltard Date: Fri Jun 26 04:06:51 2015 +0200 teamspeak init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14bc68c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nbproject/private/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8220a5c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/system"] + path = lib/system + url = git@mojotrollz.eu:system.git diff --git a/index.php b/index.php new file mode 100644 index 0000000..6e27e52 --- /dev/null +++ b/index.php @@ -0,0 +1,13 @@ +useServerPort(9987); + + useServerPort: define server id + $tsstatus->useServerId($sid); + + imagePath: path to the TSStatus icons directory + $tsstatus->imagePath = "/tsstatus/img/"; + + clearServerGroupFlags: clear all server groups flags + $tsstatus->clearServerGroupFlags(); + + setServerGroupFlag: define a server group flag + $tsstatus->setServerGroupFlag(6, 'servergroup_300.png'); + + clearChannelGroupFlags: clear all channel groups flags + $tsstatus->clearChannelGroupFlags(); + + setChannelGroupFlag: define a channel group flag + $tsstatus->setChannelGroupFlag(5, 'changroup_100.png'); + $tsstatus->setChannelGroupFlag(6, 'changroup_200.png'); + + showNicknameBox: show/hide the nickname box + $tsstatus->showNicknameBox = true/false; + + timeout: The timeout, in seconds, for connect, read, write operations + $tsstatus->timeout = 2; + + showPasswordBox: show/hide the password box + $tsstatus->showPasswordBox = false; // never render the password box + $tsstatus->showPasswordBox = true; // the box will be rendered only if the server have a password + + setLoginPassword: set the ServerQuery login/password + $tsstatus->setLoginPassword("ServerQueryLogin", "ServerQueryPassword"); + + setCache: activate caching system to prevent bans from the server... you are banned extra_msg=you may retry in XXX seconds + $tsstatus->setCache(5); + $tsstatus->setCache(5, "/tmp/mycachefile"); + The first parameter is the cache time in seconds + The second parameter is the file were the datas will be stored (.../tsstatus/tsstatus.php.cache if not specified) + The cache file MUST be writable + + limitToChannels: define a list of channel to render, others will be ignored + $tsstatus->limitToChannels(1, 5, 17); // only render channels with ids equal to 1, 5 and 17 + + hideEmptyChannels: + $tsstatus->hideEmptyChannels = true/false; + + hideParentChannels: Use this options with limitToChannels or hideEmptyChannels + $tsstatus->hideParentChannels = true/false; + +Recognized Status +----------------- + + Clients: + - client is talking + - client is away + - harware input muted + - harware output muted + - input muted + - output muted + + Channels: + - channel is full + - passworded channel + +Recognized flags +----------------- + + Clients: + - Server admin + - Channel admin + - Channel operator + + Channels + - default channel + - passworded channel + - moderated channel + +Contact +------- + + Sebastien Gerard + http://tsstatus.sebastien.me/ + +Changelog +--------- + +2013-08-31 + - select server by udp port or server id + - better special characters support + - users are now sorted by talk power + - channels ids are now used for connect links, this prevent bugs with special characters + - bug fixes when multiple servers are diplayed on one page + - some visual improvements + - removed decodeUTF8 + - new features, hideEmptyChannels and hideParentChannels + +2010-02-26: + + - work with BETA 18 servers + - added showPasswordBox, setLoginPassword, setCache and limitToChannels methods. See "Advanced usage" section for more informations. All these new features are implemented in the generator. + - as suggested by COOLover on the official Teamspeak forum, TSStatus now send servergrouplist and channelgrouplist commands and call setServerGroupFlag and setChannelGroupFlag according to the received datas. + +2009-12-26 + - tested with severs BETA 3,5,6,7,8 + - first release of the TSStatus generator script + - added a new property, showNicknameBox, to show/hide the nickname box + - improved error messages. sockets and Teamspeak servers errors are now displayed with the error message and error number + - added a timeout property for connect, read, write operations + - properly disconnect from server and send the quit message + - code cleanup + +2009-12-23 + + - work with BETA 5 servers + - added a decodeUTF8 method for specials chars \ No newline at end of file diff --git a/lib/tsstatus/TSStatus.php b/lib/tsstatus/TSStatus.php new file mode 100644 index 0000000..0dc0e23 --- /dev/null +++ b/lib/tsstatus/TSStatus.php @@ -0,0 +1,428 @@ + + * @see http://tsstatus.sebastien.me/ + * @version 2013-08-31 + **/ + +class TSStatus +{ + private $_host; + private $_queryPort; + private $_serverDatas; + private $_channelDatas; + private $_userDatas; + private $_serverGroupFlags; + private $_channelGroupFlags; + private $_login; + private $_password; + private $_cacheFile; + private $_cacheTime; + private $_channelList; + private $_useCommand; + private $_javascriptName; + private $_socket; + + public $imagePath; + public $showNicknameBox; + public $timeout; + public $hideEmptyChannels; + public $hideParentChannels; + + public function TSStatus($host, $queryPort = 10011) + { + $this->_host = $host; + $this->_queryPort = $queryPort; + + $this->_socket = null; + $this->_serverDatas = array(); + $this->_channelDatas = array(); + $this->_userDatas = array(); + $this->_serverGroupFlags = array(); + $this->_channelGroupFlags = array(); + $this->_login = false; + $this->_password = false; + $this->_cacheTime = 0; + $this->_cacheFile = __FILE__ . ".cache"; + $this->_channelList = array(); + $this->_useCommand = "use port=9987"; + + $this->imagePath = "img/"; + $this->showNicknameBox = true; + $this->showPasswordBox = false; + $this->timeout = 2; + $this->hideEmptyChannels = false; + $this->hideParentChannels = false; + } + + public function useServerId($serverId) + { + $this->_useCommand = "use sid=$serverId"; + } + + public function useServerPort($serverPort) + { + $this->_useCommand = "use port=$serverPort"; + } + + public function setLoginPassword($login, $password) + { + $this->_login = $login; + $this->_password = $password; + } + + public function setCache($time, $file = false) + { + $this->_cacheTime = $time; + if($file !== false) $this->_cacheFile = $file; + } + + public function clearServerGroupFlags() + { + $this->_serverGroupFlags = array(); + } + + public function setServerGroupFlag($serverGroupId, $image) + { + $this->_serverGroupFlags[$serverGroupId] = $image; + } + + public function clearChannelGroupFlags() + { + $this->_channelGroupFlags = array(); + } + + public function setChannelGroupFlag($channelGroupId, $image) + { + $this->_channelGroupFlags[$channelGroupId] = $image; + } + + public function limitToChannels() + { + $this->_channelList = func_get_args(); + } + + private function ts3decode($str, $reverse = false) + { + $find = array('\\\\', "\/", "\s", "\p", "\a", "\b", "\f", "\n", "\r", "\t", "\v"); + $rplc = array(chr(92), chr(47), chr(32), chr(124), chr(7), chr(8), chr(12), chr(10), chr(3), chr(9), chr(11)); + + if(!$reverse) return str_replace($find, $rplc, $str); + return str_replace($rplc, $find, $str); + } + + private function toHTML($string) + { + return htmlentities($string, ENT_QUOTES, "UTF-8"); + } + + private function sortUsers($a, $b) + { + if($a["client_talk_power"] != $b["client_talk_power"]) return $a["client_talk_power"] > $b["client_talk_power"] ? -1 : 1; + return strcasecmp($a["client_nickname"], $b["client_nickname"]); + } + + private function parseLine($rawLine) + { + $datas = array(); + $rawItems = explode("|", $rawLine); + foreach ($rawItems as $rawItem) + { + $rawDatas = explode(" ", $rawItem); + $tempDatas = array(); + foreach($rawDatas as $rawData) + { + $ar = explode("=", $rawData, 2); + $tempDatas[$ar[0]] = isset($ar[1]) ? $this->ts3decode($ar[1]) : ""; + } + $datas[] = $tempDatas; + } + return $datas; + } + + private function sendCommand($cmd) + { + fputs($this->_socket, "$cmd\n"); + $response = ""; + do + { + $response .= fread($this->_socket, 8096); + }while(strpos($response, 'error id=') === false); + if(strpos($response, "error id=0") === false) + { + throw new Exception("TS3 Server returned the following error: " . $this->ts3decode(trim($response))); + } + return $response; + } + + private function queryServer() + { + $this->_socket = @fsockopen($this->_host, $this->_queryPort, $errno, $errstr, $this->timeout); + if($this->_socket) + { + @socket_set_timeout($this->_socket, $this->timeout); + $isTs3 = trim(fgets($this->_socket)) == "TS3"; + if(!$isTs3) throw new Exception("Not a Teamspeak 3 server/bad query port"); + + if($this->_login !== false) + { + $this->sendCommand("login client_login_name=" . $this->_login . " client_login_password=" . $this->_password); + } + + $response = ""; + $response .= $this->sendCommand($this->_useCommand); + $response .= $this->sendCommand("serverinfo"); + $response .= $this->sendCommand("channellist -topic -flags -voice -limits"); + $response .= $this->sendCommand("clientlist -uid -away -voice -groups"); + $response .= $this->sendCommand("servergrouplist"); + $response .= $this->sendCommand("channelgrouplist"); + + $this->disconnect(); + return $response; + } + else throw new Exception("Socket error: $errstr [$errno]"); + } + + private function disconnect() + { + @fputs($this->_socket, "quit\n"); + @fclose($this->_socket); + } + + private function update() + { + $response = $this->queryServer(); + $lines = explode("error id=0 msg=ok\n\r", $response); + if(count($lines) == 7) + { + $this->_serverDatas = $this->parseLine($lines[1]); + $this->_serverDatas = $this->_serverDatas[0]; + + $tmpChannels = $this->parseLine($lines[2]); + $hide = count($this->_channelList) > 0 || $this->hideEmptyChannels; + foreach ($tmpChannels as $channel) + { + $channel["show"] = !$hide; + $this->_channelDatas[$channel["cid"]] = $channel; + } + + $tmpUsers = $this->parseLine($lines[3]); + usort($tmpUsers, array($this, "sortUsers")); + foreach ($tmpUsers as $user) + { + if($user["client_type"] == 0) + { + if(!isset($this->_userDatas[$user["cid"]])) $this->_userDatas[$user["cid"]] = array(); + $this->_userDatas[$user["cid"]][] = $user; + } + } + + $serverGroups = $this->parseLine($lines[4]); + foreach ($serverGroups as $sg) if($sg["iconid"] > 0) $this->setServerGroupFlag($sg["sgid"], 'group_' . $sg["iconid"] . '.png'); + + $channelGroups = $this->parseLine($lines[5]); + foreach ($channelGroups as $cg) if($cg["iconid"] > 0) $this->setChannelGroupFlag($cg["cgid"], 'group_' . $cg["iconid"] . '.png'); + } + else throw new Exception("Invalid server response"); + } + + private function setShowFlag($channelIds) + { + if(!is_array($channelIds)) $channelIds = array($channelIds); + foreach ($channelIds as $cid) + { + if(isset($this->_channelDatas[$cid])) + { + $this->_channelDatas[$cid]["show"] = true; + if(!$this->hideParentChannels && $this->_channelDatas[$cid]["pid"] != 0) + { + $this->setShowFlag($this->_channelDatas[$cid]["pid"]); + } + } + } + } + + private function getCache() + { + if($this->_cacheTime > 0 && file_exists($this->_cacheFile) && (filemtime($this->_cacheFile) + $this->_cacheTime >= time()) ) + { + return file_get_contents($this->_cacheFile); + } + return false; + } + + private function saveCache($content) + { + if($this->_cacheTime > 0) + { + if(!@file_put_contents($this->_cacheFile, $content)) + { + throw new Exception("Unable to write to file: " . $this->_cacheFile); + } + } + } + + private function renderFlags($flags) + { + $content = ""; + foreach ($flags as $flag) $content .= ''; + return $content; + } + + private function renderOptionBox($name, $label) + { + $key = "tsstatus-" . $this->_javascriptName . "-$name"; + $value = isset($_COOKIE[$key]) ? htmlspecialchars($_COOKIE[$key]) : ""; + return ''; + } + + private function renderUsers($channelId) + { + $content = ""; + if(isset($this->_userDatas[$channelId])) + { + $imagePath = $this->imagePath; + foreach ($this->_userDatas[$channelId] as $user) + { + if($user["client_type"] == 0) + { + $name = $this->toHTML($user["client_nickname"]); + + $icon = "16x16_player_off.png"; + if($user["client_away"] == 1) $icon = "16x16_away.png"; + else if($user["client_flag_talking"] == 1) $icon = "16x16_player_on.png"; + else if($user["client_output_hardware"] == 0) $icon = "16x16_hardware_output_muted.png"; + else if($user["client_output_muted"] == 1) $icon = "16x16_output_muted.png"; + else if($user["client_input_hardware"] == 0) $icon = "16x16_hardware_input_muted.png"; + else if($user["client_input_muted"] == 1) $icon = "16x16_input_muted.png"; + + $flags = array(); + + if(isset($this->_channelGroupFlags[$user["client_channel_group_id"]])) + { + $flags[] = $this->_channelGroupFlags[$user["client_channel_group_id"]]; + } + + $serverGroups = explode(",", $user["client_servergroups"]); + foreach ($serverGroups as $serverGroup) + { + if(isset($this->_serverGroupFlags[$serverGroup])) + { + $flags[] = $this->_serverGroupFlags[$serverGroup]; + } + } + $flags = $this->renderFlags($flags); + + $content .= << + $name +
+ $flags +
+ +HTML; + } + } + } + return $content; + } + + private function renderChannels($channelId) + { + $content = ""; + $imagePath = $this->imagePath; + foreach ($this->_channelDatas as $channel) + { + if($channel["pid"] == $channelId) + { + if($channel["show"]) + { + $name = $this->toHTML($channel["channel_name"]); + $title = $name . " [" . $channel["cid"] . "]"; + $link = "javascript:tsstatusconnect('" . $this->_javascriptName . "'," . $channel["cid"] . ")"; + + $icon = "16x16_channel_green.png"; + if( $channel["channel_maxclients"] > -1 && ($channel["total_clients"] >= $channel["channel_maxclients"])) $icon = "16x16_channel_red.png"; + else if( $channel["channel_maxfamilyclients"] > -1 && ($channel["total_clients_family"] >= $channel["channel_maxfamilyclients"])) $icon = "16x16_channel_red.png"; + else if($channel["channel_flag_password"] == 1) $icon = "16x16_channel_yellow.png"; + + $flags = array(); + if($channel["channel_flag_default"] == 1) $flags[] = '16x16_default.png'; + if($channel["channel_needed_talk_power"] > 0) $flags[] = '16x16_moderated.png'; + if($channel["channel_flag_password"] == 1) $flags[] = '16x16_register.png'; + $flags = $this->renderFlags($flags); + + $users = $this->renderUsers($channel["cid"]); + $childs = $this->renderChannels($channel["cid"]); + + $cid = $channel["cid"]; + + $content .= << + + $name +
+ $flags +
+ $users +
+ $childs + +HTML; + } + else $content .= $this->renderChannels($channel["cid"]); + } + } + return $content; + } + + public function render() + { + try + { + $cache = $this->getCache(); + if($cache != false) return $cache; + + $this->update(); + + if($this->hideEmptyChannels && count($this->_channelList) > 0) $this->setShowFlag(array_intersect($this->_channelList, array_keys($this->_userDatas))); + else if($this->hideEmptyChannels) $this->setShowFlag(array_keys($this->_userDatas)); + else if(count($this->_channelList) > 0) $this->setShowFlag($this->_channelList); + + + $host = $this->_host; + $port = $this->_serverDatas["virtualserver_port"]; + $name = $this->toHTML($this->_serverDatas["virtualserver_name"]); + $icon = $this->imagePath . "16x16_server_green.png"; + $this->_javascriptName = $javascriptName = preg_replace("#[^a-z-A-Z0-9]#", "-", $host . "-" . $port); + + $options = ""; + if ($this->showNicknameBox) $options .= $this->renderOptionBox("nickname", "Nickname"); + if($this->showPasswordBox && isset($this->_serverDatas["virtualserver_flag_password"]) && $this->_serverDatas["virtualserver_flag_password"] == 1) $options .= $this->renderOptionBox("password", "Password"); + + $channels = $this->renderChannels(0); + + $content = << + + $options +
+ $name + $channels +
+ +HTML; + $this->saveCache($content); + } + catch (Exception $ex) + { + $this->disconnect(); + $content = '
' . $ex->getMessage() . '
'; + } + + return $content; + } + +} +?> \ No newline at end of file diff --git a/lib/tsstatus/autoload.inc b/lib/tsstatus/autoload.inc new file mode 100644 index 0000000..8fd92c5 --- /dev/null +++ b/lib/tsstatus/autoload.inc @@ -0,0 +1,2 @@ + + * @see http://tsstatus.sebastien.me/ + * @version 2013-08-31 + **/ + +.tsstatus, .tsstatuserror{ + background-color: #ffffff; + width: 300px; +} + +.tsstatus, .tsstatus *, .tsstatuserror{ + color: #00000; + font-family: Verdana; + font-size: 10px; +} + +.tsstatus label{ + border-bottom: 1px solid #aaaaaa; +} + +.tsstatusItem a{ + color: #000000; +} + +.tsstatusItem a:hover{ + background-color: #f6f6f6; + color: #000099; +} + +.tsstatuserror{ + color: #ff0000; +} + +.tsstatus, .tsstatus *{ + vertical-align: middle; + margin: 0; + padding: 0; +} + +.tsstatus{ + position: relative; + overflow: hidden; +} + +.tsstatus label{ + display: block; + padding: 2px 0; +} + +.tsstatusItem{ + margin-left: 16px; + position: relative; + white-space:nowrap; +} + +.tsstatusItem a{ + display: block; + text-decoration: none; +} + +.tsstatusItem img{ + border: 0; + vertical-align: middle; + margin-right: 2px; +} + +.tsstatusFlags{ + position: absolute; + right: 0; + top: 0; +} + +.tsstatusServer{ + margin-left: 0; +} diff --git a/lib/tsstatus/tsstatus.js b/lib/tsstatus/tsstatus.js new file mode 100644 index 0000000..cd73b6c --- /dev/null +++ b/lib/tsstatus/tsstatus.js @@ -0,0 +1,33 @@ +/** + * TSStatus: Teamspeak 3 viewer for php5 + * @author Sebastien Gerard + * @see http://tsstatus.sebastien.me/ + * @version 2013-08-31 + **/ + +function tsstatusconnect(id, channel) +{ + var id = "tsstatus-" + id; + var hostport = document.getElementById(id + "-hostport").value; + var nickname = document.getElementById(id + "-nickname"); + var password = document.getElementById(id + "-password"); + var command = "ts3server://" + hostport.replace(":", "?port="); + var dateExpire = new Date; + + dateExpire.setMonth(dateExpire.getMonth()+1); + + if(channel != null){ + command += "&cid=" + channel; + } + + if(nickname != null && nickname.value != ""){ + command += "&nickname=" + escape(nickname.value); + document.cookie = id + "-nickname=" + escape(nickname.value) + "; expires=" + dateExpire.toGMTString(); + } + + if(password != null && password.value != ""){ + command += "&password=" + escape(password.value); + document.cookie = id + "-password=" + escape(password.value) + "; expires=" + dateExpire.toGMTString(); + } + (window.open(command)).close(); +} diff --git a/lib/tsstatus/tsstatus.php.cache b/lib/tsstatus/tsstatus.php.cache new file mode 100644 index 0000000..e69de29 diff --git a/lib/tsstatus/tsstatusgen.php b/lib/tsstatus/tsstatusgen.php new file mode 100644 index 0000000..8db4e50 --- /dev/null +++ b/lib/tsstatus/tsstatusgen.php @@ -0,0 +1,235 @@ + + * @see http://tsstatus.sebastien.me/ + * @version 2013-08-31 + **/ + + +$enableGenerator = false; + + + + + + + + + +$absoluteDir = dirname(__FILE__) . "/"; +$wwwDir = substr($_SERVER["SCRIPT_NAME"], 0, strrpos($_SERVER["SCRIPT_NAME"], "/") + 1); + + +$host = isset($_POST["host"]) ? $_POST["host"] : ""; +$qport = isset($_POST["qport"]) ? intval($_POST["qport"]) : 10011; +$portOrId = isset($_POST["portOrId"]) ? intval($_POST["portOrId"]) : 1; +$port = isset($_POST["port"]) ? intval($_POST["port"]) : 9987; +$sid = isset($_POST["sid"]) ? intval($_POST["sid"]) : 1; +$showNicknameBox = !isset($_POST["showNicknameBox"]); +$timeout = isset($_POST["timeout"]) ? intval($_POST["timeout"]) : 2; +$showPasswordBox = !isset($_POST["showPasswordBox"]); +$serverQueryLogin = isset($_POST["serverQueryLogin"]) ? $_POST["serverQueryLogin"] : ""; +$serverQueryPassword = isset($_POST["serverQueryPassword"]) ? $_POST["serverQueryPassword"] : ""; +$cacheTime = isset($_POST["cacheTime"]) ? intval($_POST["cacheTime"]) : 0; +$cacheFile = isset($_POST["cacheFile"]) ? $_POST["cacheFile"] : ""; +$limitToChannels = isset($_POST["limitToChannels"]) ? $_POST["limitToChannels"] : ""; +$hideEmptyChannels = !isset($_POST["hideEmptyChannels"]); +$hideParentChannels = !isset($_POST["hideParentChannels"]); + + +if($timeout < 1) $timeout = 0; +else if($timeout > 10) $timeout = 10; + +$htmlCode = ' +'; +echo $htmlCode; + +$phpCode = "useServerPort(' . $port . ');' . "\n"; +if($portOrId == 2) $phpCode .= '$tsstatus->useServerId(' . $sid . ');' . "\n"; +$phpCode .= '$tsstatus->imagePath = "' . $wwwDir . 'img/";' . "\n"; +$phpCode .= '$tsstatus->timeout = ' . $timeout . ";\n"; +if($serverQueryLogin != "") $phpCode .= '$tsstatus->setLoginPassword("'.$serverQueryLogin.'", "'.$serverQueryPassword.'");' . "\n"; +if($cacheTime > 0 && $cacheFile == "") $phpCode .= '$tsstatus->setCache('.$cacheTime.');' . "\n"; +if($cacheTime > 0 && $cacheFile != "") $phpCode .= '$tsstatus->setCache('.$cacheTime.', "'.$cacheFile.'");' . "\n"; +if($limitToChannels != "") $phpCode .= '$tsstatus->limitToChannels('.$limitToChannels.');' . "\n"; +$phpCode .= '$tsstatus->hideEmptyChannels = ' . (!$hideEmptyChannels ? "true" : "false") . ";\n"; +$phpCode .= '$tsstatus->hideParentChannels = ' . (!$hideParentChannels ? "true" : "false") . ";\n"; +$phpCode .= '$tsstatus->showNicknameBox = ' . ($showNicknameBox ? "true" : "false") . ";\n"; +$phpCode .= '$tsstatus->showPasswordBox = ' . ($showPasswordBox ? "false" : "true") . ";\n"; +$phpCode .= 'echo $tsstatus->render();' . "\n?>"; + +?> + + +TSStatus generator + + + +

TSStatus generator

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HostYour Teamspeak server hostname or ip
Query portServer's query port, not the client port! (default 10011)
Server Port + /> + + You must define a server port or a server id to connect to
Server Id + /> + +
TimeoutThe timeout, in seconds, for connect, read, write operations
ServerQuery login[Optional] The ServerQuery login used by tsstatus
ServerQuery password[Optional] The ServerQuery password
Cache time + [Optional] Cache datas for X seconds before updating (prevent bans from the server). 0 => disabled +
Cache file + [Optional] The file were the datas will be stored (.../tsstatus/tsstatus.php.cache if not specified) +
Limit to these channels + [Optional] Comma seperated list of channels ID to display. If set TSStatus will only render these channels +
To use with "Limit to these channels" and "Hide empty channels" options
The box will only be visible if the the server have a password
+
+ +TSStatus result\n"; + + require_once($absoluteDir . "tsstatus.php"); + $tsstatus = new TSStatus($host, $qport); + $tsstatus->imagePath = $wwwDir . "img/"; + if($portOrId == 1) $tsstatus->useServerPort($port); + if($portOrId == 2) $tsstatus->useServerId($sid); + $tsstatus->timeout = $timeout; + if($serverQueryLogin != "") $tsstatus->setLoginPassword($serverQueryLogin, $serverQueryPassword); + if($cacheTime > 0 && $cacheFile == "") $tsstatus->setCache($cacheTime); + if($cacheTime > 0 && $cacheFile != "") $tsstatus->setCache($cacheTime, $cacheFile); + if($limitToChannels != "") + { + $ids = explode(",", $limitToChannels); + call_user_func_array(array($tsstatus, "limitToChannels"), $ids); + } + $tsstatus->hideEmptyChannels = !$hideEmptyChannels; + $tsstatus->hideParentChannels = !$hideParentChannels; + $tsstatus->showNicknameBox = $showNicknameBox; + $tsstatus->showPasswordBox = !$showPasswordBox; + echo $tsstatus->render(); + + echo "

HTML code

\n"; + highlight_string($htmlCode); + echo "

PHP code

\n"; + highlight_string($phpCode); + echo "

Full page sample

\n"; + highlight_string("\n\nTSStatus\n$htmlCode\n\n\n$phpCode\n\n"); + + echo '


Don\'t forget to disable this script once finished testing!
'; + } +} +else +{ + echo ' +
+ This script is disabled by default for security purposes!
+ To enable the script you have to edit tsstatusgen.php and replace $enableGenerator = false; by $enableGenerator = true; on line 10
+ Don\'t forget to disable this script once finished testing! +
'; +} +?> + + + \ No newline at end of file diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..712f9b0 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_55 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..1cf8024 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + teamspeak + + + diff --git a/sai.php b/sai.php new file mode 100644 index 0000000..970f057 --- /dev/null +++ b/sai.php @@ -0,0 +1,13 @@ +html(); \ No newline at end of file diff --git a/teamspeak/api/api_teamspeak.php b/teamspeak/api/api_teamspeak.php new file mode 100644 index 0000000..f294878 --- /dev/null +++ b/teamspeak/api/api_teamspeak.php @@ -0,0 +1,14 @@ +next()){ + $result[]= array( 'ID' => $marker['ID'], + 'lon' => $marker['lon'], + 'lat' => $marker['lat']); + } + + return JsonResult::toString($result);} +} + diff --git a/teamspeak/api/webcraft_billing/webcraft_satelite.php b/teamspeak/api/webcraft_billing/webcraft_satelite.php new file mode 100644 index 0000000..ba3eace --- /dev/null +++ b/teamspeak/api/webcraft_billing/webcraft_satelite.php @@ -0,0 +1,31 @@ +next()){ + $item['count'] = $count++; + $item['cost'] = number_format($item['cost'], 2, ",", "."); + $bill['items'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing/saimod_webcraft_billing_pdf_item.tpl'), $item);} + $bill = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing/saimod_webcraft_billing_pdf.tpl'), $bill); + require_once(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing/dompdf/dompdf_config.inc.php')); + $dompdf = new DOMPDF(); + $dompdf->load_html($bill); + $dompdf->set_paper("a4", 'portrait'); + $dompdf->render(); + $dompdf->stream("rechnung.pdf", array("Attachment" => 0)); + return; + } +} diff --git a/teamspeak/autoload.inc b/teamspeak/autoload.inc new file mode 100644 index 0000000..87f86bc --- /dev/null +++ b/teamspeak/autoload.inc @@ -0,0 +1,10 @@ +next()){ + //für jede rechnungsvorlage eine rechnung + //rechnung verschicken + mail('service@webcraft-media.de', 'Rechnung', 'message', 'From: Webcraft-Media '); + } + return \SYSTEM\CRON\cronstatus::CRON_STATUS_SUCCESFULLY; + } +} \ No newline at end of file diff --git a/teamspeak/dbd/autoload.inc.php b/teamspeak/dbd/autoload.inc.php new file mode 100644 index 0000000..0cfd86f --- /dev/null +++ b/teamspeak/dbd/autoload.inc.php @@ -0,0 +1,3 @@ +Vertretungsberechtigt\n

Webcraft Media

\n

Verantwortliche

\n

Tobias Rechel

\n

Ulf Gebhardt

\n

Kontakt

\n

EMail: t.rechel@webcraft-media.de

\n

Rechtlicher Hinweis

\n

1.Inhalt des Onlineangebotes

\n

Der Autor übernimmt keinerlei Gewähr für die Aktualität, Korrektheit, Vollständigkeit oder Qualität der bereitgestellten Informationen. Haftungsansprüche gegen den Autor, welche sich auf Schäden materieller oder ideeller Art beziehen, die durch die Nutzung oder Nichtnutzung der dargebotenen Informationen bzw. durch die Nutzung fehlerhafter und unvollständiger Informationen verursacht wurden, sind grundsätzlich ausgeschlossen, sofern seitens des Autors kein nachweislich vorsätzliches oder grob fahrlässiges Verschulden vorliegt. Alle Angebote sind freibleibend und unverbindlich. Der Autor behält es sich ausdrücklich vor, Teile der Seiten oder das gesamte Angebot ohne gesonderte Ankündigung zu verändern, zu ergänzen, zu löschen oder die Veröffentlichung zeitweise oder endgültig einzustellen.

\n

2.Verweise und Links

\n

Bei direkten oder indirekten Verweisen auf fremde Internetseiten ("Links"), die außerhalb des Verantwortungsbereiches des Autors liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall in Kraft treten, in dem der Autor von den Inhalten Kenntnis hat und es ihm technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Der Autor erklärt hiermit ausdrücklich, dass zum Zeitpunkt der Linksetzung keine illegalen Inhalte auf den zu verlinkenden Seiten erkennbar waren. Auf die aktuelle und zukünftige Gestaltung, die Inhalte oder die Urheberschaft der gelinkten/verknüpften Seiten hat der Autor keinerlei Einfluss. Deshalb distanziert er sich hiermit ausdrücklich von allen Inhalten aller gelinkten /verknüpften Seiten, die nach der Linksetzung verändert wurden. Diese Feststellung gilt für alle innerhalb des eigenen Internetangebotes gesetzten Links und Verweise sowie für Fremdeinträge in vom Autor eingerichteten Gästebüchern, Diskussionsforen und Mailinglisten. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargebotener Informationen entstehen, haftet allein der Anbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist.

\n

3. Urheber- und Kennzeichenrecht

\n

Der Autor ist bestrebt, in allen Publikationen die Urheberrechte der verwendeten Grafiken, Tondokumente, Videosequenzen und Texte zu beachten, von ihm selbst erstellte Grafiken, Tondokumente, Videosequenzen und Texte zu nutzen oder auf lizenzfreie Grafiken, Tondokumente, Videosequenzen und Texte zurückzugreifen. Alle innerhalb des Internetangebotes genannten und ggf. durch Dritte geschützten Marken- und Warenzeichen unterliegen uneingeschränkt den Bestimmungen des jeweils gültigen Kennzeichenrechts und den Besitzrechten der jeweiligen eingetragenen Eigentümer. Allein aufgrund der bloßen Nennung ist nicht der Schluß zu ziehen, dass Markenzeichen nicht durch Rechte Dritter geschützt sind! Das Copyright für veröffentlichte, vom Autor selbst erstellte Objekte bleibt allein beim Autor der Seiten. Eine Vervielfältigung oder Verwendung solcher Grafiken, Tondokumente, Videosequenzen und Texte in anderen elektronischen oder gedruckten Publikationen ist ohne ausdrückliche Zustimmung des Autors nicht gestattet.

\n

4. Datenschutz

\n

Sofern innerhalb des Internetangebotes die Möglichkeit zur Eingabe persönlicher oder geschäftlicher Daten (Emailadressen, Namen, Anschriften) besteht, so erfolgt die Preisgabe dieser Daten seitens des Nutzers auf ausdrücklich freiwilliger Basis. Die Inanspruchnahme und Bezahlung aller angebotenen Dienste ist - soweit technisch möglich und zumutbar - auch ohne Angabe solcher Daten bzw. unter Angabe anonymisierter Daten oder eines Pseudonyms gestattet.

\n

5. Rechtswirksamkeit dieses Haftungsausschlusses

\n

Dieser Haftungsausschluss ist als Teil des Internetangebotes zu betrachten, von dem aus auf diese Seite verwiesen wurde. Sofern Teile oder einzelne Formulierungen dieses Textes der geltenden Rechtslage nicht, nicht mehr oder nicht vollständig entsprechen sollten, bleiben die übrigen Teile des Dokumentes in ihrem Inhalt und ihrer Gültigkeit davon unberührt.

'); + diff --git a/teamspeak/dbd/tbl/locale_string.php b/teamspeak/dbd/tbl/locale_string.php new file mode 100644 index 0000000..6c734cb --- /dev/null +++ b/teamspeak/dbd/tbl/locale_string.php @@ -0,0 +1,6 @@ + Webcraft design done + +Danube +------ + +GALLERY + +-> done + +Mojotrollz +---------- + +- Repo wechseln +- start page + +UVote +----- + +- Backend? + +Rhein +----- + +- 420/6.5€ alles ! + +- > +- Transferieren (test war ok!) +- Redesign (Schatten etc) +- Gallery Modul (done) +- EMail Server fixen / SSL Cert benötigt? (done) + +Da-Sense +-------- + +- Docu +- Chron Hook +- New Database Model + +Redestoffmusik +-------------- + +- transferieren (done) \ No newline at end of file diff --git a/teamspeak/docu/todo/2.6.2014.md b/teamspeak/docu/todo/2.6.2014.md new file mode 100644 index 0000000..390e56c --- /dev/null +++ b/teamspeak/docu/todo/2.6.2014.md @@ -0,0 +1,82 @@ +Webcraft +-------- + +- CRON Modul, CRON STRUKTUR + +- worldmap + - design + - coole map +- worldchat + +Danube +------ + +- 450/6.5€ (where is da money?) +- GALLERY einbinden +- Domain Transfere +- sai fix(structure fix) + +Mojotrollz +---------- + +- Repo wechseln +- start page +- www fix + +UVote +----- + +- Backend? +- www fix + +Rhein +----- + +- 420/6.5€ +- Redesign + - Schatten (done) + - Farben (done) + - Banner + - Gallery Style (done) +- email schreiben mit pws (done) -> Modul wtf? where is it? +- rechnung 420/6.5€ +- spam filter (done) + +Da-Sense +-------- + +- Docu +- Chron Hook +- New Database Model + +Redestoffmusik +-------------- + +- redesign +- downloadstuff + +Akademischer Börsenverein Frankfurt +----------------------------------- + +- 600/6.5€ +- Auf Rücksprache + +Jörg +---- + +- Ole Anfrage + +Karate Zwingenberg +------------------ + +- Tobi muss Druck machen + +Lichtblick +---------- + +- Tobi Anfrage + +Schönheitschirurg +----------------- + +- Ole Anfrage(in Zeit) \ No newline at end of file diff --git a/teamspeak/docu/todo/25.5.2014.md b/teamspeak/docu/todo/25.5.2014.md new file mode 100644 index 0000000..1e46709 --- /dev/null +++ b/teamspeak/docu/todo/25.5.2014.md @@ -0,0 +1,83 @@ +Webcraft +-------- + +- CRON Modul, CRON STRUKTUR + +- worldmap + - markers (done) + - popup (done) + - design + - coole map +- worldchat +- sai lang switcher (done) +- www fix (done) + +Danube +------ + +- 450/6.5€ +- GALLERY einbinden +- Domain Transfere +- sai fix(structure fix) + +Mojotrollz +---------- + +- Repo wechseln +- start page +- www fix + +UVote +----- + +- Backend? +- www fix + +Rhein +----- + +- 420/6.5€ +- Transferieren (done) +- Anfrage Api (done) +- Sai Startpage (done) +- Redesign + - Schatten + - Farben + - Banner + - Gallery Style +- sai fix(structure fix) (done) +- gallery in saimod (done) +- danube gallery einbinden (done) +- rechnungs mod einbinden (done) +- anrufen (done) +- Karte Rand (done) +- Files Umbenennen fixen (done) +- www fix (done) +- email problem lösen (weiterleitung) (done?) +- email schreiben mit pws (done) -> Modul wtf? where is it? +- rechnung +- spam filter (done) + +Da-Sense +-------- + +- Docu +- Chron Hook +- New Database Model + +Redestoffmusik +-------------- + +- redesign +- downloadstuff +- sai fix(structure fix) (done) +- www fix (done) + +Akademischer Börsenverein Frankfurt +----------------------------------- + +- 600/6.5€ +- klären -> Montag 26.5 + +- design +- MENU Modul \ No newline at end of file diff --git a/teamspeak/docu/todo/29.7.2014.md b/teamspeak/docu/todo/29.7.2014.md new file mode 100644 index 0000000..431bed4 --- /dev/null +++ b/teamspeak/docu/todo/29.7.2014.md @@ -0,0 +1,105 @@ +Textmodul +--------- + +- Backbutton +- Delete Nachfrage +- post/get zeichenproblem +- Timestamp für texte +- Blocksatz + +Karate Zwingenberg +------------------ + +- Trainingskalender (Ulf) + +- News + - user Rechte für Texgruppen? + - Design + - Original Logo + - Schwarzer Balken muss weg + - bottom bar mit spk logo und impressum-webcraft + +Webcraft +-------- + +- CRON Modul (done?), CRON STRUKTUR (done?) + +- worldmap + - design + - text bricht aus den divs (generelles problem?) + - mehr backgrounds + - coole map (done) +- worldchat + +Rhein +----- + +- 420/6.5€ +- treffen ulf do + +Danube +------ + +- 450/6.5€ (where is da money?) +- GALLERY einbinden +- Domain Transfere +- sai fix(structure fix) + +Mojotrollz +---------- + +- Repo wechseln +- start page +- www fix + +UVote +----- + +- Backend? +- www fix + + + +Da-Sense +-------- + +- Chron Hook +- New Database Model + +Redestoffmusik +-------------- + +- Sascha bescheid sagen, dass er den shit hochladen muss +- MMONE Album einbinden + +Akademischer Börsenverein Frankfurt +----------------------------------- + +- 600/6.5€ +- Auf Rücksprache + +Jörg +---- + +- Ole Anfrage + +Lichtblick +---------- + +- Tobi Anfrage + +Schönheitschirurg +----------------- + +- Ole Anfrage(in Zeit) + +Frisöse Zwbg +------------ + +- Ole Di treffen + +Synagogenverein Zwingenberg +--------------------------- + +- Do anfrage Ulf + diff --git a/teamspeak/files/autoload.inc.php b/teamspeak/files/autoload.inc.php new file mode 100644 index 0000000..22d9137 --- /dev/null +++ b/teamspeak/files/autoload.inc.php @@ -0,0 +1,3 @@ +'. + ''. + ''. + ''. + '';} + public static function css(){ + return ''. + ''. + ''. + '';} + + private static function ts_app(){ + $ts = new TSStatus('mojotrollz.eu'); + $ts->setLoginPassword('mojotrollztsquery', '9aYllYkG'); + $ts->imagePath = \SYSTEM\SERVERPATH(new PLIB(),'tsstatus/img/'); + return $ts->render(); + } + + public function html($_escaped_fragment_ = NULL) { + $vars = array(); + $vars['css'] = self::css(); + $vars['js'] = ''; + if(!$_escaped_fragment_){ + $vars['js'] = self::js();} + $vars['ts_app'] = self::ts_app(); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('teamspeak')); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/teamspeak.tpl'), $vars); + } +} \ No newline at end of file diff --git a/teamspeak/page/default_page/js/default_page.js b/teamspeak/page/default_page/js/default_page.js new file mode 100644 index 0000000..edc2aef --- /dev/null +++ b/teamspeak/page/default_page/js/default_page.js @@ -0,0 +1,6 @@ +$(document).ready(function() { + //new SYSTEM('./api.php',1,'start'); //state system not in use yet + $('#impressum').click(function(){ + $('#modal_text').modal('show');}); + + }); \ No newline at end of file diff --git a/teamspeak/page/default_page/tpl/teamspeak.tpl b/teamspeak/page/default_page/tpl/teamspeak.tpl new file mode 100644 index 0000000..647b2dc --- /dev/null +++ b/teamspeak/page/default_page/tpl/teamspeak.tpl @@ -0,0 +1 @@ +${ts_app} \ No newline at end of file diff --git a/teamspeak/page/page_teamspeak.php b/teamspeak/page/page_teamspeak.php new file mode 100644 index 0000000..485c45c --- /dev/null +++ b/teamspeak/page/page_teamspeak.php @@ -0,0 +1,9 @@ +html($_escaped_fragment_);} + public static function page_start(){ + return (new default_start())->html();} + public static function page_impressum(){ + return (new default_impressum())->html();} +} \ No newline at end of file diff --git a/teamspeak/path/PAPI.php b/teamspeak/path/PAPI.php new file mode 100644 index 0000000..5acdde5 --- /dev/null +++ b/teamspeak/path/PAPI.php @@ -0,0 +1,5 @@ +