├── .gitignore ├── LICENSE ├── README.md ├── assets ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ └── bootstrap.min.css ├── fonts │ ├── exo-black-demo.html │ ├── exo-black-webfont.eot │ ├── exo-black-webfont.svg │ ├── exo-black-webfont.ttf │ ├── exo-black-webfont.woff │ ├── exo-bold-demo.html │ ├── exo-bold-webfont.eot │ ├── exo-bold-webfont.svg │ ├── exo-bold-webfont.ttf │ ├── exo-bold-webfont.woff │ ├── exo-extrabold-demo.html │ ├── exo-extrabold-webfont.eot │ ├── exo-extrabold-webfont.svg │ ├── exo-extrabold-webfont.ttf │ ├── exo-extrabold-webfont.woff │ ├── exo-extralight-demo.html │ ├── exo-extralight-webfont.eot │ ├── exo-extralight-webfont.svg │ ├── exo-extralight-webfont.ttf │ ├── exo-extralight-webfont.woff │ ├── exo-light-demo.html │ ├── exo-light-webfont.eot │ ├── exo-light-webfont.svg │ ├── exo-light-webfont.ttf │ ├── exo-light-webfont.woff │ ├── exo-medium-demo.html │ ├── exo-medium-webfont.eot │ ├── exo-medium-webfont.svg │ ├── exo-medium-webfont.ttf │ ├── exo-medium-webfont.woff │ ├── exo-regular-demo.html │ ├── exo-regular-webfont.eot │ ├── exo-regular-webfont.svg │ ├── exo-regular-webfont.ttf │ ├── exo-regular-webfont.woff │ ├── exo-semibold-demo.html │ ├── exo-semibold-webfont.eot │ ├── exo-semibold-webfont.svg │ ├── exo-semibold-webfont.ttf │ ├── exo-semibold-webfont.woff │ ├── generator_config.txt │ ├── meteocons-webfont.eot │ ├── meteocons-webfont.svg │ ├── meteocons-webfont.ttf │ ├── meteocons-webfont.woff │ ├── specimen_files │ │ ├── easytabs.js │ │ ├── exo-black-cleartype.png │ │ ├── exo-bold-cleartype.png │ │ ├── exo-extrabold-cleartype.png │ │ ├── exo-extralight-cleartype.png │ │ ├── exo-light-cleartype.png │ │ ├── exo-medium-cleartype.png │ │ ├── exo-regular-cleartype.png │ │ ├── exo-semibold-cleartype.png │ │ ├── grid_12-825-55-15.css │ │ └── specimen_stylesheet.css │ └── stylesheet.css ├── ico │ ├── apple-touch-icon.png │ └── favicon.ico ├── img │ ├── contact.png │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png ├── js │ ├── bootstrap.js │ └── bootstrap.min.js └── php │ ├── MinecraftServerStatus.class.php │ ├── MinecraftServerStatusSimple.class.php │ ├── Mobile_Detect.php │ ├── SABthrottle.php │ ├── bandwidth_ajax.php │ ├── disk_space_ajax.php │ ├── functions.php │ ├── index.php │ ├── init.php │ ├── left_column_top_ajax.php │ ├── lib │ ├── TransmissionRPC.class.php │ └── phpseclib0.3.5 │ │ ├── Crypt │ │ ├── AES.php │ │ ├── Blowfish.php │ │ ├── DES.php │ │ ├── Hash.php │ │ ├── RC4.php │ │ ├── RSA.php │ │ ├── Random.php │ │ ├── Rijndael.php │ │ ├── TripleDES.php │ │ └── Twofish.php │ │ ├── File │ │ ├── ANSI.php │ │ ├── ASN1.php │ │ └── X509.php │ │ ├── Math │ │ └── BigInteger.php │ │ ├── Net │ │ ├── Crypt │ │ │ ├── AES.php │ │ │ ├── Blowfish.php │ │ │ ├── DES.php │ │ │ ├── Hash.php │ │ │ ├── RC4.php │ │ │ ├── RSA.php │ │ │ ├── Random.php │ │ │ ├── Rijndael.php │ │ │ ├── TripleDES.php │ │ │ └── Twofish.php │ │ ├── Math │ │ │ └── BigInteger.php │ │ ├── SCP.php │ │ ├── SFTP.php │ │ ├── SFTP │ │ │ └── Stream.php │ │ ├── SSH1.php │ │ └── SSH2.php │ │ └── openssl.cnf │ ├── link.class.php │ ├── now_playing_ajax.php │ ├── now_playing_progress_bar.php │ ├── now_playing_title_ajax.php │ ├── ping_ajax.php │ ├── plex_check_ajax.php │ ├── service.class.php │ ├── serviceMinecraft.class.php │ ├── serviceSAB.class.php │ ├── services_ajax.php │ ├── system_load_ajax.php │ └── transcode_sessions_ajax.php ├── config.ini ├── index.php ├── init.php ├── mc ├── MinecraftServerStatus.class.php ├── MinecraftServerStatusSimple.class.php ├── css │ ├── bootstrap.css │ └── bootstrap.min.css ├── favicon.ico ├── ftb_players.php ├── ftb_status_buttons.php ├── img │ ├── apple-touch-icon.png │ ├── ftb.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ └── mc.png ├── index.php ├── js │ ├── bootstrap.js │ └── bootstrap.min.js ├── mc_players.php └── mc_status_buttons.php └── plex.php /.gitignore: -------------------------------------------------------------------------------- 1 | assets/caches 2 | assets/php/analyticstracking.php 3 | .idea/* 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Ryan Christensen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Network Status Page - 0.2.6 2 | =================== 3 | 4 | Designed to monitor a local server and network with forecast.io, Plex, and pfSense integration. 5 | 6 | Original Project: (The live site might be dead :( ) 7 | [Live site][ls] 8 | 9 | [Plex forum thread][pft] 10 | 11 | [ls]: http://d4rk.co/ 12 | [pft]: http://forums.plexapp.com/index.php/topic/84856-network-status-page/ 13 | 14 | As a suggestion from another GitHub user, I have created some Gitter chat rooms for my projects, here is the link for this one: 15 | 16 | [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scytherswings/Network-Status-Page?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) 17 | 18 | I'm going to concentrate on this project much less as I plan to make a new project using Ruby on Rails. It will be a while before my new project reaches feature parity so this should work for the time being. 19 | 20 | Here's the new project page: 21 | [Plex-Board](https://github.com/scytherswings/Plex-Board) 22 | 23 | ###Features 24 | --------------- 25 | * Responsive web design viewable on desktop, tablet and mobile web browsers 26 | 27 | * Designed using [Bootstrap 3][bs] 28 | 29 | * Uses jQuery to provide near real time feedback 30 | 31 | * Displays the following: 32 | * currently playing items from Plex Media Server 33 | * current network bandwidth from pfSense 34 | * current ping to ip of your choosing, e.g. Google DNS 35 | * online / offline status for custom services 36 | * minute by minute weather forecast from forecast.io 37 | * server load 38 | * total disk space for all hard drives 39 | 40 | * Now Playing section adjusts scrollable height on the fly depending on browser window height 41 | 42 | 43 | [bs]: http://getbootstrap.com 44 | 45 | 46 | ###Screenshots 47 | --------------- 48 | ![alt tag](http://d.pr/i/1hfF8+) 49 | 50 | ![alt tag](http://d.pr/i/1eTEu+) 51 | 52 | 53 | ###Requirements 54 | --------------- 55 | * [Plex Media Server][pms] (v0.9.8+) and a [myPlex][pp] account `These are both free.` 56 | * The weather sidebar requires a [forecast.io API key][fcAPI] `Free up to 1000 calls/day.` 57 | * Web server that supports php (apache, nginx, XAMPP, WampServer, EasyPHP, lighttpd, etc) 58 | * PHP 5.4 59 | 60 | **Note:** While this project is written with OS X in mind, it can very easily be adapted to run on linux or windows by rewriting the functions that don't work on those platforms. 61 | 62 | [pms]: https://plex.tv 63 | [pp]: https://plex.tv/subscription/about 64 | [fcAPI]: https://developer.forecast.io 65 | 66 | 67 | ###Optional 68 | --------------- 69 | * A few functions are written to be used with the following software but they are optional: 70 | * [SABnzbd+][sab] 71 | * [pfSense][pfs] 72 | 73 | [sab]: http://sabnzbd.org 74 | [pfs]: http://www.pfsense.org 75 | 76 | 77 | ###Configuration 78 | --------------- 79 | * To configure the location of your config.ini script, edit the path to the directory of the config.ini file that is set in /assets/php/functions.php 80 | * You should put the config.ini file outside your web root directory to limit access. 81 | * Create the caches and caches/thumbnails folder under the assets folder. I might make a deployment script to handle things like config files and folder creation. Make sure to give ownership to the user that is running your webserver. For apache users this is usually www-data. 82 | * the path should be something like: /var/www/html/assets/caches 83 | * and: /var/www/html/assets/caches/thumbnails 84 | -------------------------------------------------------------------------------- /assets/css/bootstrap-responsive.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.3.2 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /assets/fonts/exo-black-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-black-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-black-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-black-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-black-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-black-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-bold-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-bold-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-bold-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-extrabold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extrabold-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-extrabold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extrabold-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-extrabold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extrabold-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-extralight-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extralight-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-extralight-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extralight-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-extralight-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-extralight-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-light-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-light-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-light-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-light-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-medium-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-medium-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-medium-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-medium-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-medium-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-medium-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-regular-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-regular-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-regular-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/exo-semibold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-semibold-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/exo-semibold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-semibold-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/exo-semibold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/exo-semibold-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/generator_config.txt: -------------------------------------------------------------------------------- 1 | # Font Squirrel Font-face Generator Configuration File 2 | # Upload this file to the generator to recreate the settings 3 | # you used to create these fonts. 4 | 5 | {"mode":"optimal","formats":["ttf","woff","eotz"],"tt_instructor":"default","fix_vertical_metrics":"Y","fix_gasp":"xy","add_spaces":"Y","add_hyphens":"Y","fallback":"none","fallback_custom":"100","options_subset":"basic","subset_custom":"","subset_custom_range":"","css_stylesheet":"stylesheet.css","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0"} -------------------------------------------------------------------------------- /assets/fonts/meteocons-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/meteocons-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/meteocons-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/meteocons-webfont.ttf -------------------------------------------------------------------------------- /assets/fonts/meteocons-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/meteocons-webfont.woff -------------------------------------------------------------------------------- /assets/fonts/specimen_files/easytabs.js: -------------------------------------------------------------------------------- 1 | (function($){$.fn.easyTabs=function(option){var param=jQuery.extend({fadeSpeed:"fast",defaultContent:1,activeClass:'active'},option);$(this).each(function(){var thisId="#"+this.id;if(param.defaultContent==''){param.defaultContent=1;} 2 | if(typeof param.defaultContent=="number") 3 | {var defaultTab=$(thisId+" .tabs li:eq("+(param.defaultContent-1)+") a").attr('href').substr(1);}else{var defaultTab=param.defaultContent;} 4 | $(thisId+" .tabs li a").each(function(){var tabToHide=$(this).attr('href').substr(1);$("#"+tabToHide).addClass('easytabs-tab-content');});hideAll();changeContent(defaultTab);function hideAll(){$(thisId+" .easytabs-tab-content").hide();} 5 | function changeContent(tabId){hideAll();$(thisId+" .tabs li").removeClass(param.activeClass);$(thisId+" .tabs li a[href=#"+tabId+"]").closest('li').addClass(param.activeClass);if(param.fadeSpeed!="none") 6 | {$(thisId+" #"+tabId).fadeIn(param.fadeSpeed);}else{$(thisId+" #"+tabId).show();}} 7 | $(thisId+" .tabs li").click(function(){var tabId=$(this).find('a').attr('href').substr(1);changeContent(tabId);return false;});});}})(jQuery); -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-black-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-black-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-bold-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-bold-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-extrabold-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-extrabold-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-extralight-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-extralight-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-light-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-light-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-medium-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-medium-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-regular-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-regular-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/exo-semibold-cleartype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/fonts/specimen_files/exo-semibold-cleartype.png -------------------------------------------------------------------------------- /assets/fonts/specimen_files/grid_12-825-55-15.css: -------------------------------------------------------------------------------- 1 | /*Notes about grid: 2 | Columns: 12 3 | Grid Width: 825px 4 | Column Width: 55px 5 | Gutter Width: 15px 6 | -------------------------------*/ 7 | 8 | 9 | 10 | .section {margin-bottom: 18px; 11 | } 12 | .section:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;} 13 | .section {*zoom: 1;} 14 | 15 | .section .firstcolumn, 16 | .section .firstcol {margin-left: 0;} 17 | 18 | 19 | /* Border on left hand side of a column. */ 20 | .border { 21 | padding-left: 7px; 22 | margin-left: 7px; 23 | border-left: 1px solid #eee; 24 | } 25 | 26 | /* Border with more whitespace, spans one column. */ 27 | .colborder { 28 | padding-left: 42px; 29 | margin-left: 42px; 30 | border-left: 1px solid #eee; 31 | } 32 | 33 | 34 | 35 | /* The Grid Classes */ 36 | .grid1, .grid1_2cols, .grid1_3cols, .grid1_4cols, .grid2, .grid2_3cols, .grid2_4cols, .grid3, .grid3_2cols, .grid3_4cols, .grid4, .grid4_3cols, .grid5, .grid5_2cols, .grid5_3cols, .grid5_4cols, .grid6, .grid6_4cols, .grid7, .grid7_2cols, .grid7_3cols, .grid7_4cols, .grid8, .grid8_3cols, .grid9, .grid9_2cols, .grid9_4cols, .grid10, .grid10_3cols, .grid10_4cols, .grid11, .grid11_2cols, .grid11_3cols, .grid11_4cols, .grid12 37 | {margin-left: 15px;float: left;display: inline; overflow: hidden;} 38 | 39 | 40 | .width1, .grid1, .span-1 {width: 55px;} 41 | .width1_2cols,.grid1_2cols {width: 20px;} 42 | .width1_3cols,.grid1_3cols {width: 8px;} 43 | .width1_4cols,.grid1_4cols {width: 2px;} 44 | .input_width1 {width: 49px;} 45 | 46 | .width2, .grid2, .span-2 {width: 125px;} 47 | .width2_3cols,.grid2_3cols {width: 31px;} 48 | .width2_4cols,.grid2_4cols {width: 20px;} 49 | .input_width2 {width: 119px;} 50 | 51 | .width3, .grid3, .span-3 {width: 195px;} 52 | .width3_2cols,.grid3_2cols {width: 90px;} 53 | .width3_4cols,.grid3_4cols {width: 37px;} 54 | .input_width3 {width: 189px;} 55 | 56 | .width4, .grid4, .span-4 {width: 265px;} 57 | .width4_3cols,.grid4_3cols {width: 78px;} 58 | .input_width4 {width: 259px;} 59 | 60 | .width5, .grid5, .span-5 {width: 335px;} 61 | .width5_2cols,.grid5_2cols {width: 160px;} 62 | .width5_3cols,.grid5_3cols {width: 101px;} 63 | .width5_4cols,.grid5_4cols {width: 72px;} 64 | .input_width5 {width: 329px;} 65 | 66 | .width6, .grid6, .span-6 {width: 405px;} 67 | .width6_4cols,.grid6_4cols {width: 90px;} 68 | .input_width6 {width: 399px;} 69 | 70 | .width7, .grid7, .span-7 {width: 475px;} 71 | .width7_2cols,.grid7_2cols {width: 230px;} 72 | .width7_3cols,.grid7_3cols {width: 148px;} 73 | .width7_4cols,.grid7_4cols {width: 107px;} 74 | .input_width7 {width: 469px;} 75 | 76 | .width8, .grid8, .span-8 {width: 545px;} 77 | .width8_3cols,.grid8_3cols {width: 171px;} 78 | .input_width8 {width: 539px;} 79 | 80 | .width9, .grid9, .span-9 {width: 615px;} 81 | .width9_2cols,.grid9_2cols {width: 300px;} 82 | .width9_4cols,.grid9_4cols {width: 142px;} 83 | .input_width9 {width: 609px;} 84 | 85 | .width10, .grid10, .span-10 {width: 685px;} 86 | .width10_3cols,.grid10_3cols {width: 218px;} 87 | .width10_4cols,.grid10_4cols {width: 160px;} 88 | .input_width10 {width: 679px;} 89 | 90 | .width11, .grid11, .span-11 {width: 755px;} 91 | .width11_2cols,.grid11_2cols {width: 370px;} 92 | .width11_3cols,.grid11_3cols {width: 241px;} 93 | .width11_4cols,.grid11_4cols {width: 177px;} 94 | .input_width11 {width: 749px;} 95 | 96 | .width12, .grid12, .span-12 {width: 825px;} 97 | .input_width12 {width: 819px;} 98 | 99 | /* Subdivided grid spaces */ 100 | .emptycols_left1, .prepend-1 {padding-left: 70px;} 101 | .emptycols_right1, .append-1 {padding-right: 70px;} 102 | .emptycols_left2, .prepend-2 {padding-left: 140px;} 103 | .emptycols_right2, .append-2 {padding-right: 140px;} 104 | .emptycols_left3, .prepend-3 {padding-left: 210px;} 105 | .emptycols_right3, .append-3 {padding-right: 210px;} 106 | .emptycols_left4, .prepend-4 {padding-left: 280px;} 107 | .emptycols_right4, .append-4 {padding-right: 280px;} 108 | .emptycols_left5, .prepend-5 {padding-left: 350px;} 109 | .emptycols_right5, .append-5 {padding-right: 350px;} 110 | .emptycols_left6, .prepend-6 {padding-left: 420px;} 111 | .emptycols_right6, .append-6 {padding-right: 420px;} 112 | .emptycols_left7, .prepend-7 {padding-left: 490px;} 113 | .emptycols_right7, .append-7 {padding-right: 490px;} 114 | .emptycols_left8, .prepend-8 {padding-left: 560px;} 115 | .emptycols_right8, .append-8 {padding-right: 560px;} 116 | .emptycols_left9, .prepend-9 {padding-left: 630px;} 117 | .emptycols_right9, .append-9 {padding-right: 630px;} 118 | .emptycols_left10, .prepend-10 {padding-left: 700px;} 119 | .emptycols_right10, .append-10 {padding-right: 700px;} 120 | .emptycols_left11, .prepend-11 {padding-left: 770px;} 121 | .emptycols_right11, .append-11 {padding-right: 770px;} 122 | .pull-1 {margin-left: -70px;} 123 | .push-1 {margin-right: -70px;margin-left: 18px;float: right;} 124 | .pull-2 {margin-left: -140px;} 125 | .push-2 {margin-right: -140px;margin-left: 18px;float: right;} 126 | .pull-3 {margin-left: -210px;} 127 | .push-3 {margin-right: -210px;margin-left: 18px;float: right;} 128 | .pull-4 {margin-left: -280px;} 129 | .push-4 {margin-right: -280px;margin-left: 18px;float: right;} -------------------------------------------------------------------------------- /assets/fonts/specimen_files/specimen_stylesheet.css: -------------------------------------------------------------------------------- 1 | @import url('grid_12-825-55-15.css'); 2 | 3 | /* 4 | CSS Reset by Eric Meyer - Released under Public Domain 5 | http://meyerweb.com/eric/tools/css/reset/ 6 | */ 7 | html, body, div, span, applet, object, iframe, 8 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 9 | a, abbr, acronym, address, big, cite, code, 10 | del, dfn, em, font, img, ins, kbd, q, s, samp, 11 | small, strike, strong, sub, sup, tt, var, 12 | b, u, i, center, dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, table, 14 | caption, tbody, tfoot, thead, tr, th, td 15 | {margin: 0;padding: 0;border: 0;outline: 0; 16 | font-size: 100%;vertical-align: baseline; 17 | background: transparent;} 18 | body {line-height: 1;} 19 | ol, ul {list-style: none;} 20 | blockquote, q {quotes: none;} 21 | blockquote:before, blockquote:after, 22 | q:before, q:after {content: ''; content: none;} 23 | :focus {outline: 0;} 24 | ins {text-decoration: none;} 25 | del {text-decoration: line-through;} 26 | table {border-collapse: collapse;border-spacing: 0;} 27 | 28 | 29 | 30 | 31 | body { 32 | color: #000; 33 | background-color: #dcdcdc; 34 | } 35 | 36 | a { 37 | text-decoration: none; 38 | color: #1883ba; 39 | } 40 | 41 | h1{ 42 | font-size: 32px; 43 | font-weight: normal; 44 | font-style: normal; 45 | margin-bottom: 18px; 46 | } 47 | 48 | h2{ 49 | font-size: 18px; 50 | } 51 | 52 | #container { 53 | width: 865px; 54 | margin: 0px auto; 55 | } 56 | 57 | 58 | #header { 59 | padding: 20px; 60 | font-size: 36px; 61 | background-color: #000; 62 | color: #fff; 63 | } 64 | 65 | #header span { 66 | color: #666; 67 | } 68 | #main_content { 69 | background-color: #fff; 70 | padding: 60px 20px 20px; 71 | } 72 | 73 | 74 | #footer p { 75 | margin: 0; 76 | padding-top: 10px; 77 | padding-bottom: 50px; 78 | color: #333; 79 | font: 10px Arial, sans-serif; 80 | } 81 | 82 | .tabs { 83 | width: 100%; 84 | height: 31px; 85 | background-color: #444; 86 | } 87 | .tabs li { 88 | float: left; 89 | margin: 0; 90 | overflow: hidden; 91 | background-color: #444; 92 | } 93 | .tabs li a { 94 | display: block; 95 | color: #fff; 96 | text-decoration: none; 97 | font: bold 11px/11px 'Arial'; 98 | text-transform: uppercase; 99 | padding: 10px 15px; 100 | border-right: 1px solid #fff; 101 | } 102 | 103 | .tabs li a:hover { 104 | background-color: #00b3ff; 105 | 106 | } 107 | 108 | .tabs li.active a { 109 | color: #000; 110 | background-color: #fff; 111 | } 112 | 113 | 114 | 115 | div.huge { 116 | 117 | font-size: 300px; 118 | line-height: 1em; 119 | padding: 0; 120 | letter-spacing: -.02em; 121 | overflow: hidden; 122 | } 123 | div.glyph_range { 124 | font-size: 72px; 125 | line-height: 1.1em; 126 | } 127 | 128 | .size10{ font-size: 10px; } 129 | .size11{ font-size: 11px; } 130 | .size12{ font-size: 12px; } 131 | .size13{ font-size: 13px; } 132 | .size14{ font-size: 14px; } 133 | .size16{ font-size: 16px; } 134 | .size18{ font-size: 18px; } 135 | .size20{ font-size: 20px; } 136 | .size24{ font-size: 24px; } 137 | .size30{ font-size: 30px; } 138 | .size36{ font-size: 36px; } 139 | .size48{ font-size: 48px; } 140 | .size60{ font-size: 60px; } 141 | .size72{ font-size: 72px; } 142 | .size90{ font-size: 90px; } 143 | 144 | 145 | .psample_row1 { height: 120px;} 146 | .psample_row1 { height: 120px;} 147 | .psample_row2 { height: 160px;} 148 | .psample_row3 { height: 160px;} 149 | .psample_row4 { height: 160px;} 150 | 151 | .psample { 152 | overflow: hidden; 153 | position: relative; 154 | } 155 | .psample p { 156 | line-height: 1.3em; 157 | display: block; 158 | overflow: hidden; 159 | margin: 0; 160 | } 161 | 162 | .psample span { 163 | margin-right: .5em; 164 | } 165 | 166 | .white_blend { 167 | width: 100%; 168 | height: 61px; 169 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAO1JREFUeNrs3TsKgFAMRUE/eer+NxztxMYuEWQG3ECKwwUF58ycAKixOAGAyAKILAAiCyCyACILgMgCiCyAyAIgsgAiCyCyAIgsgMgCiCwAIgsgsgAiC4DIAogsACIL0CWuZ3UGgLrIhjMA1EV2OAOAJQtgyQLwjOzmDAAiCyCyAIgsQFtkd2cAEFkAkQVAZAHaIns4A4AlC2DJAiCyACILILIAiCzAV5H1dQGAJQsgsgCILIDIAvwisl58AViyAJYsACILILIAIgvAe2T9EhxAZAFEFgCRBeiL7HAGgLrIhjMAWLIAliwAt1OAAQDwygTBulLIlQAAAABJRU5ErkJggg==); 170 | position: absolute; 171 | bottom: 0; 172 | } 173 | .black_blend { 174 | width: 100%; 175 | height: 61px; 176 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPJJREFUeNrs3TEKhTAQRVGjibr/9QoxhY2N3Ywo50A28IrLwP9g6b1PAMSYTQAgsgAiC4DIAogsgMgCILIAIgsgsgCILIDIAogsACILILIAIguAyAKILIDIAiCyACILgMgCZCnjLWYAiFGvB0BQZJsZAFyyAC5ZAO6RXc0AILIAIguAyAKkRXYzA4DIAogsACILkBbZ3QwALlkAlywAIgsgsgAiC4DIArwVWf8uAHDJAogsACILILIAv4isH74AXLIALlkARBZAZAFEFoDnyPokOIDIAogsACILkBfZZgaAuMhWMwC4ZAE+p4x3mAEgxinAAJ+XBbPWGkwAAAAAAElFTkSuQmCC); 177 | position: absolute; 178 | bottom: 0; 179 | } 180 | .fullreverse { 181 | background: #000 !important; 182 | color: #fff !important; 183 | margin-left: -20px; 184 | padding-left: 20px; 185 | margin-right: -20px; 186 | padding-right: 20px; 187 | padding: 20px; 188 | margin-bottom:0; 189 | } 190 | 191 | 192 | .sample_table td { 193 | padding-top: 3px; 194 | padding-bottom:5px; 195 | padding-left: 5px; 196 | vertical-align: middle; 197 | line-height: 1.2em; 198 | } 199 | 200 | .sample_table td:first-child { 201 | background-color: #eee; 202 | text-align: right; 203 | padding-right: 5px; 204 | padding-left: 0; 205 | padding: 5px; 206 | font: 11px/12px "Courier New", Courier, mono; 207 | } 208 | 209 | code { 210 | white-space: pre; 211 | background-color: #eee; 212 | display: block; 213 | padding: 10px; 214 | margin-bottom: 18px; 215 | overflow: auto; 216 | } 217 | 218 | 219 | .bottom,.last {margin-bottom:0 !important; padding-bottom:0 !important;} 220 | 221 | .box { 222 | padding: 18px; 223 | margin-bottom: 18px; 224 | background: #eee; 225 | } 226 | 227 | .reverse,.reversed { background: #000 !important;color: #fff !important; border: none !important;} 228 | 229 | #bodycomparison { 230 | position: relative; 231 | overflow: hidden; 232 | font-size: 72px; 233 | height: 90px; 234 | white-space: nowrap; 235 | } 236 | 237 | #bodycomparison div{ 238 | font-size: 72px; 239 | line-height: 90px; 240 | display: inline; 241 | margin: 0 15px 0 0; 242 | padding: 0; 243 | } 244 | 245 | #bodycomparison div span{ 246 | font: 10px Arial; 247 | position: absolute; 248 | left: 0; 249 | } 250 | #xheight { 251 | float: none; 252 | position: absolute; 253 | color: #d9f3ff; 254 | font-size: 72px; 255 | line-height: 90px; 256 | } 257 | 258 | .fontbody { 259 | position: relative; 260 | } 261 | .arialbody{ 262 | font-family: Arial; 263 | position: relative; 264 | } 265 | .verdanabody{ 266 | font-family: Verdana; 267 | position: relative; 268 | } 269 | .georgiabody{ 270 | font-family: Georgia; 271 | position: relative; 272 | } 273 | 274 | /* @group Layout page 275 | */ 276 | 277 | #layout h1 { 278 | font-size: 36px; 279 | line-height: 42px; 280 | font-weight: normal; 281 | font-style: normal; 282 | } 283 | 284 | #layout h2 { 285 | font-size: 24px; 286 | line-height: 23px; 287 | font-weight: normal; 288 | font-style: normal; 289 | } 290 | 291 | #layout h3 { 292 | font-size: 22px; 293 | line-height: 1.4em; 294 | margin-top: 1em; 295 | font-weight: normal; 296 | font-style: normal; 297 | } 298 | 299 | 300 | #layout p.byline { 301 | font-size: 12px; 302 | margin-top: 18px; 303 | line-height: 12px; 304 | margin-bottom: 0; 305 | } 306 | #layout p { 307 | font-size: 14px; 308 | line-height: 21px; 309 | margin-bottom: .5em; 310 | } 311 | 312 | #layout p.large{ 313 | font-size: 18px; 314 | line-height: 26px; 315 | } 316 | 317 | #layout .sidebar p{ 318 | font-size: 12px; 319 | line-height: 1.4em; 320 | } 321 | 322 | #layout p.caption { 323 | font-size: 10px; 324 | margin-top: -16px; 325 | margin-bottom: 18px; 326 | } 327 | 328 | /* @end */ 329 | 330 | /* @group Glyphs */ 331 | 332 | #glyph_chart div{ 333 | background-color: #d9f3ff; 334 | color: black; 335 | float: left; 336 | font-size: 36px; 337 | height: 1.2em; 338 | line-height: 1.2em; 339 | margin-bottom: 1px; 340 | margin-right: 1px; 341 | text-align: center; 342 | width: 1.2em; 343 | position: relative; 344 | padding: .6em .2em .2em; 345 | } 346 | 347 | #glyph_chart div p { 348 | position: absolute; 349 | left: 0; 350 | top: 0; 351 | display: block; 352 | text-align: center; 353 | font: bold 9px Arial, sans-serif; 354 | background-color: #3a768f; 355 | width: 100%; 356 | color: #fff; 357 | padding: 2px 0; 358 | } 359 | 360 | 361 | #glyphs h1 { 362 | font-family: Arial, sans-serif; 363 | } 364 | /* @end */ 365 | 366 | /* @group Installing */ 367 | 368 | #installing { 369 | font: 13px Arial, sans-serif; 370 | } 371 | 372 | #installing p, 373 | #glyphs p{ 374 | line-height: 1.2em; 375 | margin-bottom: 18px; 376 | font: 13px Arial, sans-serif; 377 | } 378 | 379 | 380 | 381 | #installing h3{ 382 | font-size: 15px; 383 | margin-top: 18px; 384 | } 385 | 386 | /* @end */ 387 | 388 | #rendering h1 { 389 | font-family: Arial, sans-serif; 390 | } 391 | .render_table td { 392 | font: 11px "Courier New", Courier, mono; 393 | vertical-align: middle; 394 | } 395 | 396 | 397 | -------------------------------------------------------------------------------- /assets/fonts/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 15, 2013 */ 2 | 3 | 4 | 5 | @font-face { 6 | font-family: 'exoextralight'; 7 | src: url('exo-extralight-webfont.eot'); 8 | src: url('exo-extralight-webfont.eot?#iefix') format('embedded-opentype'), 9 | url('exo-extralight-webfont.woff') format('woff'), 10 | url('exo-extralight-webfont.ttf') format('truetype'), 11 | url('exo-extralight-webfont.svg#exoextralight') format('svg'); 12 | font-weight: normal; 13 | font-style: normal; 14 | 15 | } 16 | 17 | 18 | 19 | 20 | @font-face { 21 | font-family: 'exolight'; 22 | src: url('exo-light-webfont.eot'); 23 | src: url('exo-light-webfont.eot?#iefix') format('embedded-opentype'), 24 | url('exo-light-webfont.woff') format('woff'), 25 | url('exo-light-webfont.ttf') format('truetype'), 26 | url('exo-light-webfont.svg#exolight') format('svg'); 27 | font-weight: normal; 28 | font-style: normal; 29 | 30 | } 31 | 32 | 33 | 34 | 35 | @font-face { 36 | font-family: 'exoregular'; 37 | src: url('exo-regular-webfont.eot'); 38 | src: url('exo-regular-webfont.eot?#iefix') format('embedded-opentype'), 39 | url('exo-regular-webfont.woff') format('woff'), 40 | url('exo-regular-webfont.ttf') format('truetype'), 41 | url('exo-regular-webfont.svg#exoregular') format('svg'); 42 | font-weight: normal; 43 | font-style: normal; 44 | 45 | } 46 | 47 | 48 | 49 | 50 | @font-face { 51 | font-family: 'exoblack'; 52 | src: url('exo-black-webfont.eot'); 53 | src: url('exo-black-webfont.eot?#iefix') format('embedded-opentype'), 54 | url('exo-black-webfont.woff') format('woff'), 55 | url('exo-black-webfont.ttf') format('truetype'), 56 | url('exo-black-webfont.svg#exoblack') format('svg'); 57 | font-weight: normal; 58 | font-style: normal; 59 | 60 | } 61 | 62 | 63 | 64 | 65 | @font-face { 66 | font-family: 'exobold'; 67 | src: url('exo-bold-webfont.eot'); 68 | src: url('exo-bold-webfont.eot?#iefix') format('embedded-opentype'), 69 | url('exo-bold-webfont.woff') format('woff'), 70 | url('exo-bold-webfont.ttf') format('truetype'), 71 | url('exo-bold-webfont.svg#exobold') format('svg'); 72 | font-weight: normal; 73 | font-style: normal; 74 | 75 | } 76 | 77 | 78 | 79 | 80 | @font-face { 81 | font-family: 'exomedium'; 82 | src: url('exo-medium-webfont.eot'); 83 | src: url('exo-medium-webfont.eot?#iefix') format('embedded-opentype'), 84 | url('exo-medium-webfont.woff') format('woff'), 85 | url('exo-medium-webfont.ttf') format('truetype'), 86 | url('exo-medium-webfont.svg#exomedium') format('svg'); 87 | font-weight: normal; 88 | font-style: normal; 89 | 90 | } 91 | 92 | 93 | 94 | 95 | @font-face { 96 | font-family: 'exoextrabold'; 97 | src: url('exo-extrabold-webfont.eot'); 98 | src: url('exo-extrabold-webfont.eot?#iefix') format('embedded-opentype'), 99 | url('exo-extrabold-webfont.woff') format('woff'), 100 | url('exo-extrabold-webfont.ttf') format('truetype'), 101 | url('exo-extrabold-webfont.svg#exoextrabold') format('svg'); 102 | font-weight: normal; 103 | font-style: normal; 104 | 105 | } 106 | 107 | 108 | 109 | 110 | @font-face { 111 | font-family: 'exodemibold'; 112 | src: url('exo-semibold-webfont.eot'); 113 | src: url('exo-semibold-webfont.eot?#iefix') format('embedded-opentype'), 114 | url('exo-semibold-webfont.woff') format('woff'), 115 | url('exo-semibold-webfont.ttf') format('truetype'), 116 | url('exo-semibold-webfont.svg#exodemibold') format('svg'); 117 | font-weight: normal; 118 | font-style: normal; 119 | 120 | } 121 | 122 | @font-face { 123 | font-family: 'MeteoconsRegular'; 124 | src: url('meteocons-webfont.eot'); 125 | src: url('meteocons-webfont.eot?#iefix') format('embedded-opentype'), 126 | url('meteocons-webfont.woff') format('woff'), 127 | url('meteocons-webfont.ttf') format('truetype'), 128 | url('meteocons-webfont.svg#MeteoconsRegular') format('svg'); 129 | font-weight: normal; 130 | font-style: normal; 131 | 132 | } -------------------------------------------------------------------------------- /assets/ico/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/ico/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/ico/favicon.ico -------------------------------------------------------------------------------- /assets/img/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/img/contact.png -------------------------------------------------------------------------------- /assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /assets/php/MinecraftServerStatus.class.php: -------------------------------------------------------------------------------- 1 | '', 25 | 'gametype' => '', 26 | 'game_id' => '', 27 | 'version' => '', 28 | 'plugins' => '', 29 | 'map' => '', 30 | 'numplayers' => '', 31 | 'maxplayers' => '', 32 | 'hostport' => '', 33 | 'hostip' => '' 34 | ]; 35 | 36 | /** 37 | * Query a minecraft server and parse the status 38 | * @param string $Host 39 | * @param int $Port optional 40 | * @param int $Timeout optional 41 | */ 42 | public function __construct($Host, $Port = 25565, $Timeout = 1) { 43 | /* Connect to the host and creat a socket */ 44 | $this->Socket = @stream_socket_client('udp://'.$Host.':'.(int)$Port, $ErrNo, $ErrStr, $Timeout); 45 | if($ErrNo || $this->Socket === false) { 46 | $this->Info['online'] = false; return; 47 | //throw new Exception('Failed to connect', 1); 48 | } 49 | stream_set_timeout($this->Socket, $Timeout); 50 | 51 | /* Make handshake and request server status */ 52 | $Data = $this->Send(self::STATUS, pack('N', $this->Send(self::HANDSHAKE)).pack('c*', 0x00, 0x00, 0x00, 0x00)); 53 | //set_time_limit($met); 54 | 55 | // Try fallback if query is not enabled on the server 56 | if(!$Data){ 57 | if(!class_exists('MinecraftServerStatusSimple') && file_exists('MinecraftServerStatusSimple.class.php')) 58 | require_once('MinecraftServerStatusSimple.class.php'); 59 | if(class_exists('MinecraftServerStatusSimple')) { 60 | $Fallback = new MinecraftServerStatusSimple($Host, $Port, $Timeout); 61 | $this->Info = [ 62 | 'hostname' => $Fallback->Get('motd'), 63 | 'numplayers' => $Fallback->Get('numplayers'), 64 | 'maxplayers' => $Fallback->Get('maxplayers'), 65 | 'hostport' => (int)$Port, 66 | 'hostip' => $Host, 67 | 'online' => $Fallback->Get('online') 68 | ]; fclose($this->Socket); return; 69 | } 70 | } 71 | 72 | /* Prepare the data for parsing */ 73 | // Split the data string on the player position 74 | $Data = explode("\00\00\01player_\00\00", $Data); 75 | // Save the players 76 | $Players = ''; 77 | if($Data[1]) 78 | $Players = substr($Data[1], 0, -2); 79 | // Split the server infos (status) 80 | $Data = explode("\x00", $Data[0]); 81 | 82 | /* Parse server info */ 83 | for($i = 0; $i < sizeof($Data); $i += 2) { 84 | // Check if the server info is expected, if yes save the value 85 | if(array_key_exists($Data[$i], $this->Info) && array_key_exists($i+1, $Data)) 86 | $this->Info[$Data[$i]] = $Data[$i+1]; 87 | } 88 | 89 | // Parse plugins and try to determine the server software 90 | if($this->Info['plugins']) { 91 | $Data = explode(": ", $this->Info['plugins']); 92 | $this->Info['software'] = $Data[0]; 93 | if(isset($Data[1])) 94 | $this->Info['plugins'] = explode('; ', $Data[1]); 95 | else 96 | unset($this->Info['plugins']); 97 | } else { 98 | // It seems to be a vanilla server 99 | $this->Info['software'] = 'Vanilla'; 100 | unset($this->Info['plugins']); 101 | } 102 | 103 | // Parse players 104 | if($Players) 105 | $this->Info['players'] = explode("\00", $Players); 106 | 107 | // Cast types 108 | $this->Info['numplayers'] = (int)$this->Info['numplayers']; 109 | $this->Info['maxplayers'] = (int)$this->Info['maxplayers']; 110 | $this->Info['hostport'] = (int)$this->Info['hostport']; 111 | 112 | $this->Info['online'] = true; 113 | /* Close the connection */ 114 | fclose($this->Socket); 115 | } 116 | 117 | /** 118 | * Return the value of an key or the whole server info 119 | * @param string $Key optional 120 | * @return mixed 121 | */ 122 | public function Get($Key = '') { 123 | return $Key ? (array_key_exists($Key, $this->Info) ? $this->Info[$Key] : false) : $this->Info; 124 | } 125 | 126 | /** 127 | * Send a command to the server and get the answer 128 | * @param byte $Command 129 | * @param byte $Addition optional 130 | * @return string 131 | */ 132 | private function Send($Command, $Addition = '') { 133 | // pack the command into a binary string 134 | $Command = pack('c*', self::B1, self::B2, $Command, 0x01, 0x02, 0x03, 0x04).$Addition; 135 | // send the binary string to the server 136 | if(strlen($Command) !== @fwrite($this->Socket, $Command, strlen($Command))) 137 | // my attempt to not throw exceptions 138 | return false; 139 | #throw new Exception('Failed to write on socket', 2); 140 | 141 | // listen what the server has to say now 142 | $Data = fread($this->Socket, 2048); 143 | if($Data === false) 144 | // my attempt to not throw exceptions 145 | return false; 146 | #throw new Exception('Failed to read from socket', 3); 147 | 148 | // remove the first 5 unnecessary bytes (0x00, 0x01, 0x02, 0x03, 0x04) Status type and own ID token 149 | return substr($Data, 5); 150 | } 151 | } 152 | 153 | #catch (Exception $e) 154 | { 155 | //do nothing 156 | } 157 | -------------------------------------------------------------------------------- /assets/php/MinecraftServerStatusSimple.class.php: -------------------------------------------------------------------------------- 1 | Socket = @stream_socket_client('tcp://'.$Host.':'.$Port, $ErrNo, $ErrStr, $Timeout); 22 | if($ErrNo || $this->Socket === false) { 23 | $this->Info['online'] = false; return; 24 | //throw new Exception('Failed to connect', 1); 25 | } 26 | stream_set_timeout($this->Socket, $Timeout); 27 | 28 | // Tell the server to send the info 29 | fwrite($this->Socket, "\xfe"); 30 | // Read these info 31 | $Data = fread($this->Socket, 2048); 32 | // Remove the nulls 33 | $Data = str_replace("\x00", '', $Data); 34 | // cut the first 2 bytes off 35 | $Data = substr($Data, 2); 36 | // Separate Infos 37 | $Info = explode("\xa7", $Data); 38 | unset($Data); 39 | // Close connection 40 | fclose($this->Socket); 41 | 42 | $this->Info['online'] = false; 43 | if(sizeof($Info) == 3) { 44 | $this->Info['motd'] = $Info[0]; 45 | $this->Info['numplayers'] = (int)$Info[1]; 46 | $this->Info['maxplayers'] = (int)$Info[2]; 47 | $this->Info['online'] = true; 48 | } else if(sizeof($Info) > 3) { 49 | // Handle error, Minecraft doesn't handle this. 50 | $tmp = ''; 51 | for($i = 0; $i < sizeof($Info) - 2; $i++) { 52 | $tmp .= ($i > 0 ? '§' : '').$Info[$i]; 53 | } 54 | $this->Info['motd'] = $tmp; 55 | $this->Info['numplayers'] = (int)$Info[sizeof($Info) - 2]; 56 | $this->Info['maxplayers'] = (int)$Info[sizeof($Info) - 1]; 57 | $this->Info['error'] = 'Faulty motd or outdated script'; 58 | $this->Info['online'] = true; 59 | } else { 60 | $this->Info['error'] = 'Unexpected error, maybe this script is outdated'; 61 | } 62 | } 63 | 64 | /** 65 | * Return the value of an key or the whole server info 66 | * @param string $Key optional 67 | * @return mixed 68 | */ 69 | public function Get($Key = '') { 70 | return $Key ? (array_key_exists($Key, $this->Info) ? $this->Info[$Key] : false) : $this->Info; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /assets/php/SABthrottle.php: -------------------------------------------------------------------------------- 1 | login($pfSense_username,$pfSense_password)) { 50 | //exit('Login Failed'); 51 | return array(0,0); 52 | } 53 | $terminal_output = $ssh->exec('ping -c 5 -q -S '.$sourceIP.' '.$destinationIP); 54 | // If using something besides OS X you might want to customize the following variables for proper output of average ping. 55 | $findme_start = '= '; 56 | $start = strpos($terminal_output, $findme_start); 57 | $ping_return_value_str = substr($terminal_output, ($start +2), 100); 58 | $findme_stop1 = '.'; 59 | $stop = strpos($ping_return_value_str, $findme_stop1); 60 | $findme_avgPing_decimal = '.'; 61 | $avgPing_decimal = strpos($ping_return_value_str, $findme_avgPing_decimal, 6); 62 | $findme_forward_slash = '/'; 63 | $avgPing_forward_slash = strpos($ping_return_value_str, $findme_forward_slash); 64 | $avgPing = substr($ping_return_value_str, ($stop + 5), ($avgPing_decimal - $avgPing_forward_slash - 1)); 65 | return $avgPing; 66 | } 67 | 68 | function sabSpeedAdjuster() 69 | { 70 | /* 71 | global $sabnzbd_ip; 72 | global $sabnzbd_port; 73 | global $sabnzbd_api; 74 | global $sabnabdSpeedLimitMax; 75 | global $sabnzbdSpeedLimitMin; 76 | // Set how high ping we want to hit before throttling 77 | global $ping_throttle; 78 | global $wan1_ip; 79 | global $wan2_ip; 80 | global $ping_ip; 81 | */ 82 | // Check the current ping 83 | $avgPing = getping($wan2_ip,$ping_ip); 84 | // Get SABnzbd XML 85 | $sabnzbdXML = simplexml_load_file('http://'.$sabnzbd_ip.':'.$sabnzbd_port.'/api?mode=queue&start=START&limit=LIMIT&output=xml&apikey='.$sabnzbd_api); 86 | // Get current SAB speed limit 87 | $sabSpeedLimitCurrent = $sabnzbdXML->speedlimit; 88 | 89 | // Check to see if SAB is downloading 90 | if (($sabnzbdXML->status) == 'Downloading'): 91 | // If it is downloading and ping is over X value, slow it down 92 | if ($avgPing > $ping_throttle): 93 | if ($sabSpeedLimitCurrent > $sabnzbdSpeedLimitMin): 94 | // Reduce speed by 256KBps 95 | echo 'Ping is over '.$ping_throttle; 96 | echo '
'; 97 | echo 'Slowing down SAB'; 98 | $sabSpeedLimitSet = $sabSpeedLimitCurrent - 256; 99 | shell_exec('curl "http://'.$sabnzbd_ip.':'.$sabnzbd_port.'/api?mode=config&name=speedlimit&value='.$sabSpeedLimitSet.'&apikey='.$sabnzbd_api.'"'); 100 | else: 101 | echo 'Ping is over '.$ping_throttle.' but SAB cannot slow down anymore'; 102 | endif; 103 | elseif (($avgPing + 9) < $ping_throttle): 104 | if ($sabSpeedLimitCurrent < $sabnabdSpeedLimitMax): 105 | // Increase speed by 256KBps 106 | echo 'SAB is downloading and ping is '.($avgPing + 9).' so increasing download speed.'; 107 | $sabSpeedLimitSet = $sabSpeedLimitCurrent + 256; 108 | shell_exec('curl "http://'.$sabnzbd_ip.':'.$sabnzbd_port.'/api?mode=config&name=speedlimit&value='.$sabSpeedLimitSet.'&apikey='.$sabnzbd_api.'"'); 109 | else: 110 | echo 'SAB is downloading. Ping is low enough but we are at global download speed limit.'; 111 | endif; 112 | else: 113 | echo 'SAB is downloading. Ping is ok but not low enough to speed up SAB.'; 114 | endif; 115 | else: 116 | // do nothing, 117 | echo 'SAB is not downloading.'; 118 | endif; 119 | } 120 | 121 | sabSpeedAdjuster(); 122 | ?> 123 | 124 | -------------------------------------------------------------------------------- /assets/php/bandwidth_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | '; 21 | echo 'WAN1 Ping: '.getping($wan1_ip,$ping_ip).' ms'; 22 | echo '
'; 23 | echo ''; 24 | echo '
'; 25 | makeBandwidthBars('rl1'); 26 | echo '
'; 27 | echo 'WAN2 Ping: '.getping($wan2_ip,$ping_ip).' ms'; 28 | echo '
'; 29 | echo ''; 30 | echo '
'; 31 | makeBandwidthBars('rl4'); 32 | echo ''; 33 | 34 | ?> -------------------------------------------------------------------------------- /assets/php/disk_space_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /assets/php/index.php: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | Network Status Page 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 112 | 113 | 114 | 115 | 116 |
117 |
118 |
119 |
120 | 121 |
122 | 123 |
124 |
125 |

126 | Weather 127 |

128 |
129 |
130 | 132 |
133 |
134 |
135 | 136 |
137 |
138 |

139 | Throughput 140 |

141 |
142 |
143 |
144 |
145 |
146 | 147 |
148 |
149 |

150 | Services 151 |

152 |
153 |
154 |
155 |
156 |
157 | 158 |
159 |
160 | isMobile() ): 164 | echo '>'; 165 | else: 166 | echo ' style="overflow:auto;">'; 167 | endif; 168 | echo '
';?> 169 |
170 |
171 | 172 | isMobile() && !$detect->isTablet() ): 175 | echo '>'; 176 | else: 177 | echo ' style="padding-top: 20px;">'; 178 | endif;?> 179 | 180 |
181 |
182 | 183 |
184 |
185 |
186 |
187 | 190 |
191 |
192 | 193 |
194 |
195 |

196 | Storage 197 |

198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | 207 | 208 | 209 | 226 | 227 |
228 | 229 | 231 | 232 | 233 | 234 | 235 | 236 | 397 | 398 | 399 | -------------------------------------------------------------------------------- /assets/php/init.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/php/left_column_top_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | '; 14 | echo ''; 15 | echo '
  • Online profiles
  • '; 16 | echo "
  • Home
  • "; 17 | echo '
  • Blog
  • '; 18 | echo '
  • Twitter
  • '; 19 | echo '
  • Contact
  • '; 20 | echo ''; 21 | endif; 22 | ?> 23 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/Crypt/RC4.php: -------------------------------------------------------------------------------- 1 | 21 | * setKey('abcdefgh'); 27 | * 28 | * $size = 10 * 1024; 29 | * $plaintext = ''; 30 | * for ($i = 0; $i < $size; $i++) { 31 | * $plaintext.= 'a'; 32 | * } 33 | * 34 | * echo $rc4->decrypt($rc4->encrypt($plaintext)); 35 | * ?> 36 | * 37 | * 38 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 39 | * of this software and associated documentation files (the "Software"), to deal 40 | * in the Software without restriction, including without limitation the rights 41 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42 | * copies of the Software, and to permit persons to whom the Software is 43 | * furnished to do so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in 46 | * all copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54 | * THE SOFTWARE. 55 | * 56 | * @category Crypt 57 | * @package Crypt_RC4 58 | * @author Jim Wigginton 59 | * @copyright MMVII Jim Wigginton 60 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 61 | * @link http://phpseclib.sourceforge.net 62 | */ 63 | 64 | /**#@+ 65 | * @access private 66 | * @see Crypt_RC4::Crypt_RC4() 67 | */ 68 | /** 69 | * Toggles the internal implementation 70 | */ 71 | define('CRYPT_RC4_MODE_INTERNAL', 1); 72 | /** 73 | * Toggles the mcrypt implementation 74 | */ 75 | define('CRYPT_RC4_MODE_MCRYPT', 2); 76 | /**#@-*/ 77 | 78 | /**#@+ 79 | * @access private 80 | * @see Crypt_RC4::_crypt() 81 | */ 82 | define('CRYPT_RC4_ENCRYPT', 0); 83 | define('CRYPT_RC4_DECRYPT', 1); 84 | /**#@-*/ 85 | 86 | /** 87 | * Pure-PHP implementation of RC4. 88 | * 89 | * @author Jim Wigginton 90 | * @version 0.1.0 91 | * @access public 92 | * @package Crypt_RC4 93 | */ 94 | class Crypt_RC4 { 95 | /** 96 | * The Key 97 | * 98 | * @see Crypt_RC4::setKey() 99 | * @var String 100 | * @access private 101 | */ 102 | var $key = "\0"; 103 | 104 | /** 105 | * The Key Stream for encryption 106 | * 107 | * If CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT, this will be equal to the mcrypt object 108 | * 109 | * @see Crypt_RC4::setKey() 110 | * @var Array 111 | * @access private 112 | */ 113 | var $encryptStream = false; 114 | 115 | /** 116 | * The Key Stream for decryption 117 | * 118 | * If CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT, this will be equal to the mcrypt object 119 | * 120 | * @see Crypt_RC4::setKey() 121 | * @var Array 122 | * @access private 123 | */ 124 | var $decryptStream = false; 125 | 126 | /** 127 | * The $i and $j indexes for encryption 128 | * 129 | * @see Crypt_RC4::_crypt() 130 | * @var Integer 131 | * @access private 132 | */ 133 | var $encryptIndex = 0; 134 | 135 | /** 136 | * The $i and $j indexes for decryption 137 | * 138 | * @see Crypt_RC4::_crypt() 139 | * @var Integer 140 | * @access private 141 | */ 142 | var $decryptIndex = 0; 143 | 144 | /** 145 | * The Encryption Algorithm 146 | * 147 | * Only used if CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT. Only possible values are MCRYPT_RC4 or MCRYPT_ARCFOUR. 148 | * 149 | * @see Crypt_RC4::Crypt_RC4() 150 | * @var Integer 151 | * @access private 152 | */ 153 | var $mode; 154 | 155 | /** 156 | * Continuous Buffer status 157 | * 158 | * @see Crypt_RC4::enableContinuousBuffer() 159 | * @var Boolean 160 | * @access private 161 | */ 162 | var $continuousBuffer = false; 163 | 164 | /** 165 | * Default Constructor. 166 | * 167 | * Determines whether or not the mcrypt extension should be used. 168 | * 169 | * @return Crypt_RC4 170 | * @access public 171 | */ 172 | function Crypt_RC4() 173 | { 174 | if ( !defined('CRYPT_RC4_MODE') ) { 175 | switch (true) { 176 | case extension_loaded('mcrypt') && (defined('MCRYPT_ARCFOUR') || defined('MCRYPT_RC4')) && in_array('arcfour', mcrypt_list_algorithms()): 177 | define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_MCRYPT); 178 | break; 179 | default: 180 | define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_INTERNAL); 181 | } 182 | } 183 | 184 | switch ( CRYPT_RC4_MODE ) { 185 | case CRYPT_RC4_MODE_MCRYPT: 186 | switch (true) { 187 | case defined('MCRYPT_ARCFOUR'): 188 | $this->mode = MCRYPT_ARCFOUR; 189 | break; 190 | case defined('MCRYPT_RC4'); 191 | $this->mode = MCRYPT_RC4; 192 | } 193 | $this->encryptStream = mcrypt_module_open($this->mode, '', MCRYPT_MODE_STREAM, ''); 194 | $this->decryptStream = mcrypt_module_open($this->mode, '', MCRYPT_MODE_STREAM, ''); 195 | 196 | } 197 | } 198 | 199 | /** 200 | * Sets the key. 201 | * 202 | * Keys can be between 1 and 256 bytes long. If they are longer then 256 bytes, the first 256 bytes will 203 | * be used. If no key is explicitly set, it'll be assumed to be a single null byte. 204 | * 205 | * @access public 206 | * @param String $key 207 | */ 208 | function setKey($key) 209 | { 210 | $this->key = $key; 211 | 212 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 213 | mcrypt_generic_init($this->encryptStream, $this->key, ''); 214 | mcrypt_generic_init($this->decryptStream, $this->key, ''); 215 | return; 216 | } 217 | 218 | $keyLength = strlen($key); 219 | $keyStream = array(); 220 | for ($i = 0; $i < 256; $i++) { 221 | $keyStream[$i] = $i; 222 | } 223 | $j = 0; 224 | for ($i = 0; $i < 256; $i++) { 225 | $j = ($j + $keyStream[$i] + ord($key[$i % $keyLength])) & 255; 226 | $temp = $keyStream[$i]; 227 | $keyStream[$i] = $keyStream[$j]; 228 | $keyStream[$j] = $temp; 229 | } 230 | 231 | $this->encryptIndex = $this->decryptIndex = array(0, 0); 232 | $this->encryptStream = $this->decryptStream = $keyStream; 233 | } 234 | 235 | /** 236 | * Sets the password. 237 | * 238 | * Depending on what $method is set to, setPassword()'s (optional) parameters are as follows: 239 | * {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2}: 240 | * $hash, $salt, $count, $dkLen 241 | * 242 | * @param String $password 243 | * @param optional String $method 244 | * @access public 245 | */ 246 | function setPassword($password, $method = 'pbkdf2') 247 | { 248 | $key = ''; 249 | 250 | switch ($method) { 251 | default: // 'pbkdf2' 252 | list(, , $hash, $salt, $count) = func_get_args(); 253 | if (!isset($hash)) { 254 | $hash = 'sha1'; 255 | } 256 | // WPA and WPA2 use the SSID as the salt 257 | if (!isset($salt)) { 258 | $salt = 'phpseclib/salt'; 259 | } 260 | // RFC2898#section-4.2 uses 1,000 iterations by default 261 | // WPA and WPA2 use 4,096. 262 | if (!isset($count)) { 263 | $count = 1000; 264 | } 265 | if (!isset($dkLen)) { 266 | $dkLen = 128; 267 | } 268 | 269 | if (!class_exists('Crypt_Hash')) { 270 | require_once('Crypt/Hash.php'); 271 | } 272 | 273 | $i = 1; 274 | while (strlen($key) < $dkLen) { 275 | //$dk.= $this->_pbkdf($password, $salt, $count, $i++); 276 | $hmac = new Crypt_Hash(); 277 | $hmac->setHash($hash); 278 | $hmac->setKey($password); 279 | $f = $u = $hmac->hash($salt . pack('N', $i++)); 280 | for ($j = 2; $j <= $count; $j++) { 281 | $u = $hmac->hash($u); 282 | $f^= $u; 283 | } 284 | $key.= $f; 285 | } 286 | } 287 | 288 | $this->setKey(substr($key, 0, $dkLen)); 289 | } 290 | 291 | /** 292 | * Dummy function. 293 | * 294 | * Some protocols, such as WEP, prepend an "initialization vector" to the key, effectively creating a new key [1]. 295 | * If you need to use an initialization vector in this manner, feel free to prepend it to the key, yourself, before 296 | * calling setKey(). 297 | * 298 | * [1] WEP's initialization vectors (IV's) are used in a somewhat insecure way. Since, in that protocol, 299 | * the IV's are relatively easy to predict, an attack described by 300 | * {@link http://www.drizzle.com/~aboba/IEEE/rc4_ksaproc.pdf Scott Fluhrer, Itsik Mantin, and Adi Shamir} 301 | * can be used to quickly guess at the rest of the key. The following links elaborate: 302 | * 303 | * {@link http://www.rsa.com/rsalabs/node.asp?id=2009 http://www.rsa.com/rsalabs/node.asp?id=2009} 304 | * {@link http://en.wikipedia.org/wiki/Related_key_attack http://en.wikipedia.org/wiki/Related_key_attack} 305 | * 306 | * @param String $iv 307 | * @see Crypt_RC4::setKey() 308 | * @access public 309 | */ 310 | function setIV($iv) 311 | { 312 | } 313 | 314 | /** 315 | * Encrypts a message. 316 | * 317 | * @see Crypt_RC4::_crypt() 318 | * @access public 319 | * @param String $plaintext 320 | */ 321 | function encrypt($plaintext) 322 | { 323 | return $this->_crypt($plaintext, CRYPT_RC4_ENCRYPT); 324 | } 325 | 326 | /** 327 | * Decrypts a message. 328 | * 329 | * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). 330 | * Atleast if the continuous buffer is disabled. 331 | * 332 | * @see Crypt_RC4::_crypt() 333 | * @access public 334 | * @param String $ciphertext 335 | */ 336 | function decrypt($ciphertext) 337 | { 338 | return $this->_crypt($ciphertext, CRYPT_RC4_DECRYPT); 339 | } 340 | 341 | /** 342 | * Encrypts or decrypts a message. 343 | * 344 | * @see Crypt_RC4::encrypt() 345 | * @see Crypt_RC4::decrypt() 346 | * @access private 347 | * @param String $text 348 | * @param Integer $mode 349 | */ 350 | function _crypt($text, $mode) 351 | { 352 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 353 | $keyStream = $mode == CRYPT_RC4_ENCRYPT ? 'encryptStream' : 'decryptStream'; 354 | 355 | if (!$this->continuousBuffer) { 356 | mcrypt_generic_init($this->$keyStream, $this->key, ''); 357 | } 358 | 359 | return mcrypt_generic($this->$keyStream, $text); 360 | } 361 | 362 | if ($this->encryptStream === false) { 363 | $this->setKey($this->key); 364 | } 365 | 366 | switch ($mode) { 367 | case CRYPT_RC4_ENCRYPT: 368 | $keyStream = $this->encryptStream; 369 | list($i, $j) = $this->encryptIndex; 370 | break; 371 | case CRYPT_RC4_DECRYPT: 372 | $keyStream = $this->decryptStream; 373 | list($i, $j) = $this->decryptIndex; 374 | } 375 | 376 | $newText = ''; 377 | for ($k = 0; $k < strlen($text); $k++) { 378 | $i = ($i + 1) & 255; 379 | $j = ($j + $keyStream[$i]) & 255; 380 | $temp = $keyStream[$i]; 381 | $keyStream[$i] = $keyStream[$j]; 382 | $keyStream[$j] = $temp; 383 | $temp = $keyStream[($keyStream[$i] + $keyStream[$j]) & 255]; 384 | $newText.= chr(ord($text[$k]) ^ $temp); 385 | } 386 | 387 | if ($this->continuousBuffer) { 388 | switch ($mode) { 389 | case CRYPT_RC4_ENCRYPT: 390 | $this->encryptStream = $keyStream; 391 | $this->encryptIndex = array($i, $j); 392 | break; 393 | case CRYPT_RC4_DECRYPT: 394 | $this->decryptStream = $keyStream; 395 | $this->decryptIndex = array($i, $j); 396 | } 397 | } 398 | 399 | return $newText; 400 | } 401 | 402 | /** 403 | * Treat consecutive "packets" as if they are a continuous buffer. 404 | * 405 | * Say you have a 16-byte plaintext $plaintext. Using the default behavior, the two following code snippets 406 | * will yield different outputs: 407 | * 408 | * 409 | * echo $rc4->encrypt(substr($plaintext, 0, 8)); 410 | * echo $rc4->encrypt(substr($plaintext, 8, 8)); 411 | * 412 | * 413 | * echo $rc4->encrypt($plaintext); 414 | * 415 | * 416 | * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates 417 | * another, as demonstrated with the following: 418 | * 419 | * 420 | * $rc4->encrypt(substr($plaintext, 0, 8)); 421 | * echo $rc4->decrypt($des->encrypt(substr($plaintext, 8, 8))); 422 | * 423 | * 424 | * echo $rc4->decrypt($des->encrypt(substr($plaintext, 8, 8))); 425 | * 426 | * 427 | * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different 428 | * outputs. The reason is due to the fact that the initialization vector's change after every encryption / 429 | * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. 430 | * 431 | * Put another way, when the continuous buffer is enabled, the state of the Crypt_DES() object changes after each 432 | * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that 433 | * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), 434 | * however, they are also less intuitive and more likely to cause you problems. 435 | * 436 | * @see Crypt_RC4::disableContinuousBuffer() 437 | * @access public 438 | */ 439 | function enableContinuousBuffer() 440 | { 441 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 442 | mcrypt_generic_init($this->encryptStream, $this->key, ''); 443 | mcrypt_generic_init($this->decryptStream, $this->key, ''); 444 | } 445 | 446 | $this->continuousBuffer = true; 447 | } 448 | 449 | /** 450 | * Treat consecutive packets as if they are a discontinuous buffer. 451 | * 452 | * The default behavior. 453 | * 454 | * @see Crypt_RC4::enableContinuousBuffer() 455 | * @access public 456 | */ 457 | function disableContinuousBuffer() 458 | { 459 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_INTERNAL ) { 460 | $this->encryptIndex = $this->decryptIndex = array(0, 0); 461 | $this->encryptStream = $this->decryptStream = false; 462 | } 463 | 464 | $this->continuousBuffer = false; 465 | } 466 | 467 | /** 468 | * Dummy function. 469 | * 470 | * Since RC4 is a stream cipher and not a block cipher, no padding is necessary. The only reason this function is 471 | * included is so that you can switch between a block cipher and a stream cipher transparently. 472 | * 473 | * @see Crypt_RC4::disablePadding() 474 | * @access public 475 | */ 476 | function enablePadding() 477 | { 478 | } 479 | 480 | /** 481 | * Dummy function. 482 | * 483 | * @see Crypt_RC4::enablePadding() 484 | * @access public 485 | */ 486 | function disablePadding() 487 | { 488 | } 489 | } 490 | 491 | // vim: ts=4:sw=4:et: 492 | // vim6: fdl=1: 493 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/Crypt/Random.php: -------------------------------------------------------------------------------- 1 | 11 | * 16 | * 17 | * 18 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 19 | * of this software and associated documentation files (the "Software"), to deal 20 | * in the Software without restriction, including without limitation the rights 21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | * copies of the Software, and to permit persons to whom the Software is 23 | * furnished to do so, subject to the following conditions: 24 | * 25 | * The above copyright notice and this permission notice shall be included in 26 | * all copies or substantial portions of the Software. 27 | * 28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 34 | * THE SOFTWARE. 35 | * 36 | * @category Crypt 37 | * @package Crypt_Random 38 | * @author Jim Wigginton 39 | * @copyright MMVII Jim Wigginton 40 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 41 | * @link http://phpseclib.sourceforge.net 42 | */ 43 | 44 | /** 45 | * "Is Windows" test 46 | * 47 | * @access private 48 | */ 49 | define('CRYPT_RANDOM_IS_WINDOWS', strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); 50 | 51 | /** 52 | * Generate a random string. 53 | * 54 | * Although microoptimizations are generally discouraged as they impair readability this function is ripe with 55 | * microoptimizations because this function has the potential of being called a huge number of times. 56 | * eg. for RSA key generation. 57 | * 58 | * @param Integer $length 59 | * @return String 60 | * @access public 61 | */ 62 | function crypt_random_string($length) 63 | { 64 | if (CRYPT_RANDOM_IS_WINDOWS) { 65 | // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. 66 | // ie. class_alias is a function that was introduced in PHP 5.3 67 | if (function_exists('mcrypt_create_iv') && function_exists('class_alias')) { 68 | return mcrypt_create_iv($length); 69 | } 70 | // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, 71 | // to quote , "possible blocking behavior". as of 5.3.4 72 | // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both 73 | // call php_win32_get_random_bytes(): 74 | // 75 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008 76 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392 77 | // 78 | // php_win32_get_random_bytes() is defined thusly: 79 | // 80 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80 81 | // 82 | // we're calling it, all the same, in the off chance that the mcrypt extension is not available 83 | if (function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>=')) { 84 | return openssl_random_pseudo_bytes($length); 85 | } 86 | } else { 87 | // method 1. the fastest 88 | if (function_exists('openssl_random_pseudo_bytes')) { 89 | return openssl_random_pseudo_bytes($length); 90 | } 91 | // method 2 92 | static $fp = true; 93 | if ($fp === true) { 94 | // warning's will be output unles the error suppression operator is used. errors such as 95 | // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. 96 | $fp = @fopen('/dev/urandom', 'rb'); 97 | } 98 | if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() 99 | return fread($fp, $length); 100 | } 101 | // method 3. pretty much does the same thing as method 2 per the following url: 102 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391 103 | // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're 104 | // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir 105 | // restrictions or some such 106 | if (function_exists('mcrypt_create_iv')) { 107 | return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); 108 | } 109 | } 110 | // at this point we have no choice but to use a pure-PHP CSPRNG 111 | 112 | // cascade entropy across multiple PHP instances by fixing the session and collecting all 113 | // environmental variables, including the previous session data and the current session 114 | // data. 115 | // 116 | // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively) 117 | // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but 118 | // PHP isn't low level to be able to use those as sources and on a web server there's not likely 119 | // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use 120 | // however. a ton of people visiting the website. obviously you don't want to base your seeding 121 | // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled 122 | // by the user and (2) this isn't just looking at the data sent by the current user - it's based 123 | // on the data sent by all users. one user requests the page and a hash of their info is saved. 124 | // another user visits the page and the serialization of their data is utilized along with the 125 | // server envirnment stuff and a hash of the previous http request data (which itself utilizes 126 | // a hash of the session data before that). certainly an attacker should be assumed to have 127 | // full control over his own http requests. he, however, is not going to have control over 128 | // everyone's http requests. 129 | static $crypto = false, $v; 130 | if ($crypto === false) { 131 | // save old session data 132 | $old_session_id = session_id(); 133 | $old_use_cookies = ini_get('session.use_cookies'); 134 | $old_session_cache_limiter = session_cache_limiter(); 135 | if (isset($_SESSION)) { 136 | $_OLD_SESSION = $_SESSION; 137 | } 138 | if ($old_session_id != '') { 139 | session_write_close(); 140 | } 141 | 142 | session_id(1); 143 | ini_set('session.use_cookies', 0); 144 | session_cache_limiter(''); 145 | session_start(); 146 | 147 | $v = $seed = $_SESSION['seed'] = pack('H*', sha1( 148 | serialize($_SERVER) . 149 | serialize($_POST) . 150 | serialize($_GET) . 151 | serialize($_COOKIE) . 152 | serialize($GLOBALS) . 153 | serialize($_SESSION) . 154 | serialize($_OLD_SESSION) 155 | )); 156 | if (!isset($_SESSION['count'])) { 157 | $_SESSION['count'] = 0; 158 | } 159 | $_SESSION['count']++; 160 | 161 | session_write_close(); 162 | 163 | // restore old session data 164 | if ($old_session_id != '') { 165 | session_id($old_session_id); 166 | session_start(); 167 | ini_set('session.use_cookies', $old_use_cookies); 168 | session_cache_limiter($old_session_cache_limiter); 169 | } else { 170 | if (isset($_OLD_SESSION)) { 171 | $_SESSION = $_OLD_SESSION; 172 | unset($_OLD_SESSION); 173 | } else { 174 | unset($_SESSION); 175 | } 176 | } 177 | 178 | // in SSH2 a shared secret and an exchange hash are generated through the key exchange process. 179 | // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C. 180 | // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the 181 | // original hash and the current hash. we'll be emulating that. for more info see the following URL: 182 | // 183 | // http://tools.ietf.org/html/rfc4253#section-7.2 184 | // 185 | // see the is_string($crypto) part for an example of how to expand the keys 186 | $key = pack('H*', sha1($seed . 'A')); 187 | $iv = pack('H*', sha1($seed . 'C')); 188 | 189 | // ciphers are used as per the nist.gov link below. also, see this link: 190 | // 191 | // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives 192 | switch (true) { 193 | case class_exists('Crypt_AES'): 194 | $crypto = new Crypt_AES(CRYPT_AES_MODE_CTR); 195 | break; 196 | case class_exists('Crypt_TripleDES'): 197 | $crypto = new Crypt_TripleDES(CRYPT_DES_MODE_CTR); 198 | break; 199 | case class_exists('Crypt_DES'): 200 | $crypto = new Crypt_DES(CRYPT_DES_MODE_CTR); 201 | break; 202 | case class_exists('Crypt_RC4'): 203 | $crypto = new Crypt_RC4(); 204 | break; 205 | default: 206 | $crypto = $seed; 207 | return crypt_random_string($length); 208 | } 209 | 210 | $crypto->setKey($key); 211 | $crypto->setIV($iv); 212 | $crypto->enableContinuousBuffer(); 213 | } 214 | 215 | if (is_string($crypto)) { 216 | // the following is based off of ANSI X9.31: 217 | // 218 | // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf 219 | // 220 | // OpenSSL uses that same standard for it's random numbers: 221 | // 222 | // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c 223 | // (do a search for "ANS X9.31 A.2.4") 224 | // 225 | // ANSI X9.31 recommends ciphers be used and phpseclib does use them if they're available (see 226 | // later on in the code) but if they're not we'll use sha1 227 | $result = ''; 228 | while (strlen($result) < $length) { // each loop adds 20 bytes 229 | // microtime() isn't packed as "densely" as it could be but then neither is that the idea. 230 | // the idea is simply to ensure that each "block" has a unique element to it. 231 | $i = pack('H*', sha1(microtime())); 232 | $r = pack('H*', sha1($i ^ $v)); 233 | $v = pack('H*', sha1($r ^ $i)); 234 | $result.= $r; 235 | } 236 | return substr($result, 0, $length); 237 | } 238 | 239 | //return $crypto->encrypt(str_repeat("\0", $length)); 240 | 241 | $result = ''; 242 | while (strlen($result) < $length) { 243 | $i = $crypto->encrypt(microtime()); 244 | $r = $crypto->encrypt($i ^ $v); 245 | $v = $crypto->encrypt($r ^ $i); 246 | $result.= $r; 247 | } 248 | return substr($result, 0, $length); 249 | } 250 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/Net/Crypt/RC4.php: -------------------------------------------------------------------------------- 1 | 21 | * setKey('abcdefgh'); 27 | * 28 | * $size = 10 * 1024; 29 | * $plaintext = ''; 30 | * for ($i = 0; $i < $size; $i++) { 31 | * $plaintext.= 'a'; 32 | * } 33 | * 34 | * echo $rc4->decrypt($rc4->encrypt($plaintext)); 35 | * ?> 36 | * 37 | * 38 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 39 | * of this software and associated documentation files (the "Software"), to deal 40 | * in the Software without restriction, including without limitation the rights 41 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42 | * copies of the Software, and to permit persons to whom the Software is 43 | * furnished to do so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in 46 | * all copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54 | * THE SOFTWARE. 55 | * 56 | * @category Crypt 57 | * @package Crypt_RC4 58 | * @author Jim Wigginton 59 | * @copyright MMVII Jim Wigginton 60 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 61 | * @link http://phpseclib.sourceforge.net 62 | */ 63 | 64 | /**#@+ 65 | * @access private 66 | * @see Crypt_RC4::Crypt_RC4() 67 | */ 68 | /** 69 | * Toggles the internal implementation 70 | */ 71 | define('CRYPT_RC4_MODE_INTERNAL', 1); 72 | /** 73 | * Toggles the mcrypt implementation 74 | */ 75 | define('CRYPT_RC4_MODE_MCRYPT', 2); 76 | /**#@-*/ 77 | 78 | /**#@+ 79 | * @access private 80 | * @see Crypt_RC4::_crypt() 81 | */ 82 | define('CRYPT_RC4_ENCRYPT', 0); 83 | define('CRYPT_RC4_DECRYPT', 1); 84 | /**#@-*/ 85 | 86 | /** 87 | * Pure-PHP implementation of RC4. 88 | * 89 | * @author Jim Wigginton 90 | * @version 0.1.0 91 | * @access public 92 | * @package Crypt_RC4 93 | */ 94 | class Crypt_RC4 { 95 | /** 96 | * The Key 97 | * 98 | * @see Crypt_RC4::setKey() 99 | * @var String 100 | * @access private 101 | */ 102 | var $key = "\0"; 103 | 104 | /** 105 | * The Key Stream for encryption 106 | * 107 | * If CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT, this will be equal to the mcrypt object 108 | * 109 | * @see Crypt_RC4::setKey() 110 | * @var Array 111 | * @access private 112 | */ 113 | var $encryptStream = false; 114 | 115 | /** 116 | * The Key Stream for decryption 117 | * 118 | * If CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT, this will be equal to the mcrypt object 119 | * 120 | * @see Crypt_RC4::setKey() 121 | * @var Array 122 | * @access private 123 | */ 124 | var $decryptStream = false; 125 | 126 | /** 127 | * The $i and $j indexes for encryption 128 | * 129 | * @see Crypt_RC4::_crypt() 130 | * @var Integer 131 | * @access private 132 | */ 133 | var $encryptIndex = 0; 134 | 135 | /** 136 | * The $i and $j indexes for decryption 137 | * 138 | * @see Crypt_RC4::_crypt() 139 | * @var Integer 140 | * @access private 141 | */ 142 | var $decryptIndex = 0; 143 | 144 | /** 145 | * The Encryption Algorithm 146 | * 147 | * Only used if CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT. Only possible values are MCRYPT_RC4 or MCRYPT_ARCFOUR. 148 | * 149 | * @see Crypt_RC4::Crypt_RC4() 150 | * @var Integer 151 | * @access private 152 | */ 153 | var $mode; 154 | 155 | /** 156 | * Continuous Buffer status 157 | * 158 | * @see Crypt_RC4::enableContinuousBuffer() 159 | * @var Boolean 160 | * @access private 161 | */ 162 | var $continuousBuffer = false; 163 | 164 | /** 165 | * Default Constructor. 166 | * 167 | * Determines whether or not the mcrypt extension should be used. 168 | * 169 | * @return Crypt_RC4 170 | * @access public 171 | */ 172 | function Crypt_RC4() 173 | { 174 | if ( !defined('CRYPT_RC4_MODE') ) { 175 | switch (true) { 176 | case extension_loaded('mcrypt') && (defined('MCRYPT_ARCFOUR') || defined('MCRYPT_RC4')) && in_array('arcfour', mcrypt_list_algorithms()): 177 | define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_MCRYPT); 178 | break; 179 | default: 180 | define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_INTERNAL); 181 | } 182 | } 183 | 184 | switch ( CRYPT_RC4_MODE ) { 185 | case CRYPT_RC4_MODE_MCRYPT: 186 | switch (true) { 187 | case defined('MCRYPT_ARCFOUR'): 188 | $this->mode = MCRYPT_ARCFOUR; 189 | break; 190 | case defined('MCRYPT_RC4'); 191 | $this->mode = MCRYPT_RC4; 192 | } 193 | $this->encryptStream = mcrypt_module_open($this->mode, '', MCRYPT_MODE_STREAM, ''); 194 | $this->decryptStream = mcrypt_module_open($this->mode, '', MCRYPT_MODE_STREAM, ''); 195 | 196 | } 197 | } 198 | 199 | /** 200 | * Sets the key. 201 | * 202 | * Keys can be between 1 and 256 bytes long. If they are longer then 256 bytes, the first 256 bytes will 203 | * be used. If no key is explicitly set, it'll be assumed to be a single null byte. 204 | * 205 | * @access public 206 | * @param String $key 207 | */ 208 | function setKey($key) 209 | { 210 | $this->key = $key; 211 | 212 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 213 | mcrypt_generic_init($this->encryptStream, $this->key, ''); 214 | mcrypt_generic_init($this->decryptStream, $this->key, ''); 215 | return; 216 | } 217 | 218 | $keyLength = strlen($key); 219 | $keyStream = array(); 220 | for ($i = 0; $i < 256; $i++) { 221 | $keyStream[$i] = $i; 222 | } 223 | $j = 0; 224 | for ($i = 0; $i < 256; $i++) { 225 | $j = ($j + $keyStream[$i] + ord($key[$i % $keyLength])) & 255; 226 | $temp = $keyStream[$i]; 227 | $keyStream[$i] = $keyStream[$j]; 228 | $keyStream[$j] = $temp; 229 | } 230 | 231 | $this->encryptIndex = $this->decryptIndex = array(0, 0); 232 | $this->encryptStream = $this->decryptStream = $keyStream; 233 | } 234 | 235 | /** 236 | * Sets the password. 237 | * 238 | * Depending on what $method is set to, setPassword()'s (optional) parameters are as follows: 239 | * {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2}: 240 | * $hash, $salt, $count, $dkLen 241 | * 242 | * @param String $password 243 | * @param optional String $method 244 | * @access public 245 | */ 246 | function setPassword($password, $method = 'pbkdf2') 247 | { 248 | $key = ''; 249 | 250 | switch ($method) { 251 | default: // 'pbkdf2' 252 | list(, , $hash, $salt, $count) = func_get_args(); 253 | if (!isset($hash)) { 254 | $hash = 'sha1'; 255 | } 256 | // WPA and WPA2 use the SSID as the salt 257 | if (!isset($salt)) { 258 | $salt = 'phpseclib/salt'; 259 | } 260 | // RFC2898#section-4.2 uses 1,000 iterations by default 261 | // WPA and WPA2 use 4,096. 262 | if (!isset($count)) { 263 | $count = 1000; 264 | } 265 | if (!isset($dkLen)) { 266 | $dkLen = 128; 267 | } 268 | 269 | if (!class_exists('Crypt_Hash')) { 270 | require_once('Crypt/Hash.php'); 271 | } 272 | 273 | $i = 1; 274 | while (strlen($key) < $dkLen) { 275 | //$dk.= $this->_pbkdf($password, $salt, $count, $i++); 276 | $hmac = new Crypt_Hash(); 277 | $hmac->setHash($hash); 278 | $hmac->setKey($password); 279 | $f = $u = $hmac->hash($salt . pack('N', $i++)); 280 | for ($j = 2; $j <= $count; $j++) { 281 | $u = $hmac->hash($u); 282 | $f^= $u; 283 | } 284 | $key.= $f; 285 | } 286 | } 287 | 288 | $this->setKey(substr($key, 0, $dkLen)); 289 | } 290 | 291 | /** 292 | * Dummy function. 293 | * 294 | * Some protocols, such as WEP, prepend an "initialization vector" to the key, effectively creating a new key [1]. 295 | * If you need to use an initialization vector in this manner, feel free to prepend it to the key, yourself, before 296 | * calling setKey(). 297 | * 298 | * [1] WEP's initialization vectors (IV's) are used in a somewhat insecure way. Since, in that protocol, 299 | * the IV's are relatively easy to predict, an attack described by 300 | * {@link http://www.drizzle.com/~aboba/IEEE/rc4_ksaproc.pdf Scott Fluhrer, Itsik Mantin, and Adi Shamir} 301 | * can be used to quickly guess at the rest of the key. The following links elaborate: 302 | * 303 | * {@link http://www.rsa.com/rsalabs/node.asp?id=2009 http://www.rsa.com/rsalabs/node.asp?id=2009} 304 | * {@link http://en.wikipedia.org/wiki/Related_key_attack http://en.wikipedia.org/wiki/Related_key_attack} 305 | * 306 | * @param String $iv 307 | * @see Crypt_RC4::setKey() 308 | * @access public 309 | */ 310 | function setIV($iv) 311 | { 312 | } 313 | 314 | /** 315 | * Encrypts a message. 316 | * 317 | * @see Crypt_RC4::_crypt() 318 | * @access public 319 | * @param String $plaintext 320 | */ 321 | function encrypt($plaintext) 322 | { 323 | return $this->_crypt($plaintext, CRYPT_RC4_ENCRYPT); 324 | } 325 | 326 | /** 327 | * Decrypts a message. 328 | * 329 | * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). 330 | * Atleast if the continuous buffer is disabled. 331 | * 332 | * @see Crypt_RC4::_crypt() 333 | * @access public 334 | * @param String $ciphertext 335 | */ 336 | function decrypt($ciphertext) 337 | { 338 | return $this->_crypt($ciphertext, CRYPT_RC4_DECRYPT); 339 | } 340 | 341 | /** 342 | * Encrypts or decrypts a message. 343 | * 344 | * @see Crypt_RC4::encrypt() 345 | * @see Crypt_RC4::decrypt() 346 | * @access private 347 | * @param String $text 348 | * @param Integer $mode 349 | */ 350 | function _crypt($text, $mode) 351 | { 352 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 353 | $keyStream = $mode == CRYPT_RC4_ENCRYPT ? 'encryptStream' : 'decryptStream'; 354 | 355 | if (!$this->continuousBuffer) { 356 | mcrypt_generic_init($this->$keyStream, $this->key, ''); 357 | } 358 | 359 | return mcrypt_generic($this->$keyStream, $text); 360 | } 361 | 362 | if ($this->encryptStream === false) { 363 | $this->setKey($this->key); 364 | } 365 | 366 | switch ($mode) { 367 | case CRYPT_RC4_ENCRYPT: 368 | $keyStream = $this->encryptStream; 369 | list($i, $j) = $this->encryptIndex; 370 | break; 371 | case CRYPT_RC4_DECRYPT: 372 | $keyStream = $this->decryptStream; 373 | list($i, $j) = $this->decryptIndex; 374 | } 375 | 376 | $newText = ''; 377 | for ($k = 0; $k < strlen($text); $k++) { 378 | $i = ($i + 1) & 255; 379 | $j = ($j + $keyStream[$i]) & 255; 380 | $temp = $keyStream[$i]; 381 | $keyStream[$i] = $keyStream[$j]; 382 | $keyStream[$j] = $temp; 383 | $temp = $keyStream[($keyStream[$i] + $keyStream[$j]) & 255]; 384 | $newText.= chr(ord($text[$k]) ^ $temp); 385 | } 386 | 387 | if ($this->continuousBuffer) { 388 | switch ($mode) { 389 | case CRYPT_RC4_ENCRYPT: 390 | $this->encryptStream = $keyStream; 391 | $this->encryptIndex = array($i, $j); 392 | break; 393 | case CRYPT_RC4_DECRYPT: 394 | $this->decryptStream = $keyStream; 395 | $this->decryptIndex = array($i, $j); 396 | } 397 | } 398 | 399 | return $newText; 400 | } 401 | 402 | /** 403 | * Treat consecutive "packets" as if they are a continuous buffer. 404 | * 405 | * Say you have a 16-byte plaintext $plaintext. Using the default behavior, the two following code snippets 406 | * will yield different outputs: 407 | * 408 | * 409 | * echo $rc4->encrypt(substr($plaintext, 0, 8)); 410 | * echo $rc4->encrypt(substr($plaintext, 8, 8)); 411 | * 412 | * 413 | * echo $rc4->encrypt($plaintext); 414 | * 415 | * 416 | * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates 417 | * another, as demonstrated with the following: 418 | * 419 | * 420 | * $rc4->encrypt(substr($plaintext, 0, 8)); 421 | * echo $rc4->decrypt($des->encrypt(substr($plaintext, 8, 8))); 422 | * 423 | * 424 | * echo $rc4->decrypt($des->encrypt(substr($plaintext, 8, 8))); 425 | * 426 | * 427 | * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different 428 | * outputs. The reason is due to the fact that the initialization vector's change after every encryption / 429 | * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. 430 | * 431 | * Put another way, when the continuous buffer is enabled, the state of the Crypt_DES() object changes after each 432 | * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that 433 | * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), 434 | * however, they are also less intuitive and more likely to cause you problems. 435 | * 436 | * @see Crypt_RC4::disableContinuousBuffer() 437 | * @access public 438 | */ 439 | function enableContinuousBuffer() 440 | { 441 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { 442 | mcrypt_generic_init($this->encryptStream, $this->key, ''); 443 | mcrypt_generic_init($this->decryptStream, $this->key, ''); 444 | } 445 | 446 | $this->continuousBuffer = true; 447 | } 448 | 449 | /** 450 | * Treat consecutive packets as if they are a discontinuous buffer. 451 | * 452 | * The default behavior. 453 | * 454 | * @see Crypt_RC4::enableContinuousBuffer() 455 | * @access public 456 | */ 457 | function disableContinuousBuffer() 458 | { 459 | if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_INTERNAL ) { 460 | $this->encryptIndex = $this->decryptIndex = array(0, 0); 461 | $this->encryptStream = $this->decryptStream = false; 462 | } 463 | 464 | $this->continuousBuffer = false; 465 | } 466 | 467 | /** 468 | * Dummy function. 469 | * 470 | * Since RC4 is a stream cipher and not a block cipher, no padding is necessary. The only reason this function is 471 | * included is so that you can switch between a block cipher and a stream cipher transparently. 472 | * 473 | * @see Crypt_RC4::disablePadding() 474 | * @access public 475 | */ 476 | function enablePadding() 477 | { 478 | } 479 | 480 | /** 481 | * Dummy function. 482 | * 483 | * @see Crypt_RC4::enablePadding() 484 | * @access public 485 | */ 486 | function disablePadding() 487 | { 488 | } 489 | } 490 | 491 | // vim: ts=4:sw=4:et: 492 | // vim6: fdl=1: 493 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/Net/Crypt/Random.php: -------------------------------------------------------------------------------- 1 | 11 | * 16 | * 17 | * 18 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 19 | * of this software and associated documentation files (the "Software"), to deal 20 | * in the Software without restriction, including without limitation the rights 21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | * copies of the Software, and to permit persons to whom the Software is 23 | * furnished to do so, subject to the following conditions: 24 | * 25 | * The above copyright notice and this permission notice shall be included in 26 | * all copies or substantial portions of the Software. 27 | * 28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 34 | * THE SOFTWARE. 35 | * 36 | * @category Crypt 37 | * @package Crypt_Random 38 | * @author Jim Wigginton 39 | * @copyright MMVII Jim Wigginton 40 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 41 | * @link http://phpseclib.sourceforge.net 42 | */ 43 | 44 | /** 45 | * "Is Windows" test 46 | * 47 | * @access private 48 | */ 49 | define('CRYPT_RANDOM_IS_WINDOWS', strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); 50 | 51 | /** 52 | * Generate a random string. 53 | * 54 | * Although microoptimizations are generally discouraged as they impair readability this function is ripe with 55 | * microoptimizations because this function has the potential of being called a huge number of times. 56 | * eg. for RSA key generation. 57 | * 58 | * @param Integer $length 59 | * @return String 60 | * @access public 61 | */ 62 | function crypt_random_string($length) 63 | { 64 | if (CRYPT_RANDOM_IS_WINDOWS) { 65 | // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. 66 | // ie. class_alias is a function that was introduced in PHP 5.3 67 | if (function_exists('mcrypt_create_iv') && function_exists('class_alias')) { 68 | return mcrypt_create_iv($length); 69 | } 70 | // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, 71 | // to quote , "possible blocking behavior". as of 5.3.4 72 | // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both 73 | // call php_win32_get_random_bytes(): 74 | // 75 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008 76 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392 77 | // 78 | // php_win32_get_random_bytes() is defined thusly: 79 | // 80 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80 81 | // 82 | // we're calling it, all the same, in the off chance that the mcrypt extension is not available 83 | if (function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>=')) { 84 | return openssl_random_pseudo_bytes($length); 85 | } 86 | } else { 87 | // method 1. the fastest 88 | if (function_exists('openssl_random_pseudo_bytes')) { 89 | return openssl_random_pseudo_bytes($length); 90 | } 91 | // method 2 92 | static $fp = true; 93 | if ($fp === true) { 94 | // warning's will be output unles the error suppression operator is used. errors such as 95 | // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. 96 | $fp = @fopen('/dev/urandom', 'rb'); 97 | } 98 | if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() 99 | return fread($fp, $length); 100 | } 101 | // method 3. pretty much does the same thing as method 2 per the following url: 102 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391 103 | // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're 104 | // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir 105 | // restrictions or some such 106 | if (function_exists('mcrypt_create_iv')) { 107 | return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); 108 | } 109 | } 110 | // at this point we have no choice but to use a pure-PHP CSPRNG 111 | 112 | // cascade entropy across multiple PHP instances by fixing the session and collecting all 113 | // environmental variables, including the previous session data and the current session 114 | // data. 115 | // 116 | // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively) 117 | // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but 118 | // PHP isn't low level to be able to use those as sources and on a web server there's not likely 119 | // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use 120 | // however. a ton of people visiting the website. obviously you don't want to base your seeding 121 | // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled 122 | // by the user and (2) this isn't just looking at the data sent by the current user - it's based 123 | // on the data sent by all users. one user requests the page and a hash of their info is saved. 124 | // another user visits the page and the serialization of their data is utilized along with the 125 | // server envirnment stuff and a hash of the previous http request data (which itself utilizes 126 | // a hash of the session data before that). certainly an attacker should be assumed to have 127 | // full control over his own http requests. he, however, is not going to have control over 128 | // everyone's http requests. 129 | static $crypto = false, $v; 130 | if ($crypto === false) { 131 | // save old session data 132 | $old_session_id = session_id(); 133 | $old_use_cookies = ini_get('session.use_cookies'); 134 | $old_session_cache_limiter = session_cache_limiter(); 135 | if (isset($_SESSION)) { 136 | $_OLD_SESSION = $_SESSION; 137 | } 138 | if ($old_session_id != '') { 139 | session_write_close(); 140 | } 141 | 142 | session_id(1); 143 | ini_set('session.use_cookies', 0); 144 | session_cache_limiter(''); 145 | session_start(); 146 | 147 | $v = $seed = $_SESSION['seed'] = pack('H*', sha1( 148 | serialize($_SERVER) . 149 | serialize($_POST) . 150 | serialize($_GET) . 151 | serialize($_COOKIE) . 152 | serialize($GLOBALS) . 153 | serialize($_SESSION) . 154 | serialize($_OLD_SESSION) 155 | )); 156 | if (!isset($_SESSION['count'])) { 157 | $_SESSION['count'] = 0; 158 | } 159 | $_SESSION['count']++; 160 | 161 | session_write_close(); 162 | 163 | // restore old session data 164 | if ($old_session_id != '') { 165 | session_id($old_session_id); 166 | session_start(); 167 | ini_set('session.use_cookies', $old_use_cookies); 168 | session_cache_limiter($old_session_cache_limiter); 169 | } else { 170 | if (isset($_OLD_SESSION)) { 171 | $_SESSION = $_OLD_SESSION; 172 | unset($_OLD_SESSION); 173 | } else { 174 | unset($_SESSION); 175 | } 176 | } 177 | 178 | // in SSH2 a shared secret and an exchange hash are generated through the key exchange process. 179 | // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C. 180 | // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the 181 | // original hash and the current hash. we'll be emulating that. for more info see the following URL: 182 | // 183 | // http://tools.ietf.org/html/rfc4253#section-7.2 184 | // 185 | // see the is_string($crypto) part for an example of how to expand the keys 186 | $key = pack('H*', sha1($seed . 'A')); 187 | $iv = pack('H*', sha1($seed . 'C')); 188 | 189 | // ciphers are used as per the nist.gov link below. also, see this link: 190 | // 191 | // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives 192 | switch (true) { 193 | case class_exists('Crypt_AES'): 194 | $crypto = new Crypt_AES(CRYPT_AES_MODE_CTR); 195 | break; 196 | case class_exists('Crypt_TripleDES'): 197 | $crypto = new Crypt_TripleDES(CRYPT_DES_MODE_CTR); 198 | break; 199 | case class_exists('Crypt_DES'): 200 | $crypto = new Crypt_DES(CRYPT_DES_MODE_CTR); 201 | break; 202 | case class_exists('Crypt_RC4'): 203 | $crypto = new Crypt_RC4(); 204 | break; 205 | default: 206 | $crypto = $seed; 207 | return crypt_random_string($length); 208 | } 209 | 210 | $crypto->setKey($key); 211 | $crypto->setIV($iv); 212 | $crypto->enableContinuousBuffer(); 213 | } 214 | 215 | if (is_string($crypto)) { 216 | // the following is based off of ANSI X9.31: 217 | // 218 | // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf 219 | // 220 | // OpenSSL uses that same standard for it's random numbers: 221 | // 222 | // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c 223 | // (do a search for "ANS X9.31 A.2.4") 224 | // 225 | // ANSI X9.31 recommends ciphers be used and phpseclib does use them if they're available (see 226 | // later on in the code) but if they're not we'll use sha1 227 | $result = ''; 228 | while (strlen($result) < $length) { // each loop adds 20 bytes 229 | // microtime() isn't packed as "densely" as it could be but then neither is that the idea. 230 | // the idea is simply to ensure that each "block" has a unique element to it. 231 | $i = pack('H*', sha1(microtime())); 232 | $r = pack('H*', sha1($i ^ $v)); 233 | $v = pack('H*', sha1($r ^ $i)); 234 | $result.= $r; 235 | } 236 | return substr($result, 0, $length); 237 | } 238 | 239 | //return $crypto->encrypt(str_repeat("\0", $length)); 240 | 241 | $result = ''; 242 | while (strlen($result) < $length) { 243 | $i = $crypto->encrypt(microtime()); 244 | $r = $crypto->encrypt($i ^ $v); 245 | $v = $crypto->encrypt($r ^ $i); 246 | $result.= $r; 247 | } 248 | return substr($result, 0, $length); 249 | } 250 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/Net/SCP.php: -------------------------------------------------------------------------------- 1 | 13 | * login('username', 'password')) { 19 | * exit('bad login'); 20 | * } 21 | 22 | * $scp = new Net_SCP($ssh); 23 | * $scp->put('abcd', str_repeat('x', 1024*1024)); 24 | * ?> 25 | * 26 | * 27 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 28 | * of this software and associated documentation files (the "Software"), to deal 29 | * in the Software without restriction, including without limitation the rights 30 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 31 | * copies of the Software, and to permit persons to whom the Software is 32 | * furnished to do so, subject to the following conditions: 33 | * 34 | * The above copyright notice and this permission notice shall be included in 35 | * all copies or substantial portions of the Software. 36 | * 37 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 43 | * THE SOFTWARE. 44 | * 45 | * @category Net 46 | * @package Net_SCP 47 | * @author Jim Wigginton 48 | * @copyright MMX Jim Wigginton 49 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 50 | * @link http://phpseclib.sourceforge.net 51 | */ 52 | 53 | /**#@+ 54 | * @access public 55 | * @see Net_SCP::put() 56 | */ 57 | /** 58 | * Reads data from a local file. 59 | */ 60 | define('NET_SCP_LOCAL_FILE', 1); 61 | /** 62 | * Reads data from a string. 63 | */ 64 | define('NET_SCP_STRING', 2); 65 | /**#@-*/ 66 | 67 | /**#@+ 68 | * @access private 69 | * @see Net_SCP::_send() 70 | * @see Net_SCP::_receive() 71 | */ 72 | /** 73 | * SSH1 is being used. 74 | */ 75 | define('NET_SCP_SSH1', 1); 76 | /** 77 | * SSH2 is being used. 78 | */ 79 | define('NET_SCP_SSH2', 2); 80 | /**#@-*/ 81 | 82 | /** 83 | * Pure-PHP implementations of SCP. 84 | * 85 | * @author Jim Wigginton 86 | * @version 0.1.0 87 | * @access public 88 | * @package Net_SCP 89 | */ 90 | class Net_SCP { 91 | /** 92 | * SSH Object 93 | * 94 | * @var Object 95 | * @access private 96 | */ 97 | var $ssh; 98 | 99 | /** 100 | * Packet Size 101 | * 102 | * @var Integer 103 | * @access private 104 | */ 105 | var $packet_size; 106 | 107 | /** 108 | * Mode 109 | * 110 | * @var Integer 111 | * @access private 112 | */ 113 | var $mode; 114 | 115 | /** 116 | * Default Constructor. 117 | * 118 | * Connects to an SSH server 119 | * 120 | * @param String $host 121 | * @param optional Integer $port 122 | * @param optional Integer $timeout 123 | * @return Net_SCP 124 | * @access public 125 | */ 126 | function Net_SCP($ssh) 127 | { 128 | if (!is_object($ssh)) { 129 | return; 130 | } 131 | 132 | switch (strtolower(get_class($ssh))) { 133 | case'net_ssh2': 134 | $this->mode = NET_SCP_SSH2; 135 | break; 136 | case 'net_ssh1': 137 | $this->packet_size = 50000; 138 | $this->mode = NET_SCP_SSH1; 139 | break; 140 | default: 141 | return; 142 | } 143 | 144 | $this->ssh = $ssh; 145 | } 146 | 147 | /** 148 | * Uploads a file to the SCP server. 149 | * 150 | * By default, Net_SCP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. 151 | * So, for example, if you set $data to 'filename.ext' and then do Net_SCP::get(), you will get a file, twelve bytes 152 | * long, containing 'filename.ext' as its contents. 153 | * 154 | * Setting $mode to NET_SFTP_LOCAL_FILE will change the above behavior. With NET_SFTP_LOCAL_FILE, $remote_file will 155 | * contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how 156 | * large $remote_file will be, as well. 157 | * 158 | * Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take 159 | * care of that, yourself. 160 | * 161 | * @param String $remote_file 162 | * @param String $data 163 | * @param optional Integer $mode 164 | * @return Boolean 165 | * @access public 166 | */ 167 | function put($remote_file, $data, $mode = NET_SCP_STRING) 168 | { 169 | if (!isset($this->ssh)) { 170 | return false; 171 | } 172 | 173 | $this->ssh->exec('scp -t ' . $remote_file, false); // -t = to 174 | 175 | $temp = $this->_receive(); 176 | if ($temp !== chr(0)) { 177 | return false; 178 | } 179 | 180 | if ($this->mode == NET_SCP_SSH2) { 181 | $this->packet_size = $this->ssh->packet_size_client_to_server[NET_SSH2_CHANNEL_EXEC]; 182 | } 183 | 184 | $remote_file = basename($remote_file); 185 | $this->_send('C0644 ' . strlen($data) . ' ' . $remote_file . "\n"); 186 | 187 | $temp = $this->_receive(); 188 | if ($temp !== chr(0)) { 189 | return false; 190 | } 191 | 192 | if ($mode == NET_SCP_STRING) { 193 | $this->_send($data); 194 | } else { 195 | if (!is_file($data)) { 196 | user_error("$data is not a valid file", E_USER_NOTICE); 197 | return false; 198 | } 199 | $fp = @fopen($data, 'rb'); 200 | if (!$fp) { 201 | return false; 202 | } 203 | $size = filesize($data); 204 | for ($i = 0; $i < $size; $i += $this->packet_size) { 205 | $this->_send(fgets($fp, $this->packet_size)); 206 | } 207 | fclose($fp); 208 | } 209 | $this->_close(); 210 | } 211 | 212 | /** 213 | * Downloads a file from the SCP server. 214 | * 215 | * Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if 216 | * the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the 217 | * operation 218 | * 219 | * @param String $remote_file 220 | * @param optional String $local_file 221 | * @return Mixed 222 | * @access public 223 | */ 224 | function get($remote_file, $local_file = false) 225 | { 226 | if (!isset($this->ssh)) { 227 | return false; 228 | } 229 | 230 | $this->ssh->exec('scp -f ' . $remote_file, false); // -f = from 231 | 232 | $this->_send("\0"); 233 | 234 | if (!preg_match('#(?[^ ]+) (?\d+) (?.+)#', rtrim($this->_receive()), $info)) { 235 | return false; 236 | } 237 | 238 | $this->_send("\0"); 239 | 240 | $size = 0; 241 | 242 | if ($local_file !== false) { 243 | $fp = @fopen($local_file, 'wb'); 244 | if (!$fp) { 245 | return false; 246 | } 247 | } 248 | 249 | $content = ''; 250 | while ($size < $info['size']) { 251 | $data = $this->_receive(); 252 | // SCP usually seems to split stuff out into 16k chunks 253 | $size+= strlen($data); 254 | 255 | if ($local_file === false) { 256 | $content.= $data; 257 | } else { 258 | fputs($fp, $data); 259 | } 260 | } 261 | 262 | $this->_close(); 263 | 264 | if ($local_file !== false) { 265 | fclose($fp); 266 | return true; 267 | } 268 | 269 | return $content; 270 | } 271 | 272 | /** 273 | * Sends a packet to an SSH server 274 | * 275 | * @param String $data 276 | * @access private 277 | */ 278 | function _send($data) 279 | { 280 | switch ($this->mode) { 281 | case NET_SCP_SSH2: 282 | $this->ssh->_send_channel_packet(NET_SSH2_CHANNEL_EXEC, $data); 283 | break; 284 | case NET_SCP_SSH1: 285 | $data = pack('CNa*', NET_SSH1_CMSG_STDIN_DATA, strlen($data), $data); 286 | $this->ssh->_send_binary_packet($data); 287 | } 288 | } 289 | 290 | /** 291 | * Receives a packet from an SSH server 292 | * 293 | * @return String 294 | * @access private 295 | */ 296 | function _receive() 297 | { 298 | switch ($this->mode) { 299 | case NET_SCP_SSH2: 300 | return $this->ssh->_get_channel_packet(NET_SSH2_CHANNEL_EXEC, true); 301 | case NET_SCP_SSH1: 302 | if (!$this->ssh->bitmap) { 303 | return false; 304 | } 305 | while (true) { 306 | $response = $this->ssh->_get_binary_packet(); 307 | switch ($response[NET_SSH1_RESPONSE_TYPE]) { 308 | case NET_SSH1_SMSG_STDOUT_DATA: 309 | extract(unpack('Nlength', $response[NET_SSH1_RESPONSE_DATA])); 310 | return $this->ssh->_string_shift($response[NET_SSH1_RESPONSE_DATA], $length); 311 | case NET_SSH1_SMSG_STDERR_DATA: 312 | break; 313 | case NET_SSH1_SMSG_EXITSTATUS: 314 | $this->ssh->_send_binary_packet(chr(NET_SSH1_CMSG_EXIT_CONFIRMATION)); 315 | fclose($this->ssh->fsock); 316 | $this->ssh->bitmap = 0; 317 | return false; 318 | default: 319 | user_error('Unknown packet received', E_USER_NOTICE); 320 | return false; 321 | } 322 | } 323 | } 324 | } 325 | 326 | /** 327 | * Closes the connection to an SSH server 328 | * 329 | * @access private 330 | */ 331 | function _close() 332 | { 333 | switch ($this->mode) { 334 | case NET_SCP_SSH2: 335 | $this->ssh->_close_channel(NET_SSH2_CHANNEL_EXEC); 336 | break; 337 | case NET_SCP_SSH1: 338 | $this->ssh->disconnect(); 339 | } 340 | } 341 | } 342 | -------------------------------------------------------------------------------- /assets/php/lib/phpseclib0.3.5/openssl.cnf: -------------------------------------------------------------------------------- 1 | # minimalist openssl.cnf file for use with phpseclib 2 | 3 | HOME = . 4 | RANDFILE = $ENV::HOME/.rnd 5 | 6 | [ v3_ca ] -------------------------------------------------------------------------------- /assets/php/link.class.php: -------------------------------------------------------------------------------- 1 | name = $name; 12 | $this->url = $url; 13 | $this->ico = $ico; 14 | $this->prefix = $prefix; 15 | } 16 | 17 | function makeLink() 18 | { 19 | echo "
  • url\" $this->prefix>ico\"/> $this->name
  • "; 20 | } 21 | } 22 | ?> -------------------------------------------------------------------------------- /assets/php/now_playing_ajax.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /assets/php/now_playing_progress_bar.php: -------------------------------------------------------------------------------- 1 | Video[$plexSessionID]['duration']; 12 | $viewOffset = $plexSessionXML->Video[$plexSessionID]['viewOffset']; 13 | $progress = sprintf('%.0f',($viewOffset / $duration) * 100); 14 | 15 | return $progress; 16 | ?> -------------------------------------------------------------------------------- /assets/php/now_playing_title_ajax.php: -------------------------------------------------------------------------------- 1 | Video) == 0): 32 | $title = 'Recently Released'; 33 | else: 34 | $title = 'Now Playing'; 35 | endif; 36 | endif; 37 | 38 | echo '

    '.$title.'

    '; 39 | echo '
    '; 40 | } 41 | ?> 42 | -------------------------------------------------------------------------------- /assets/php/ping_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | -------------------------------------------------------------------------------- /assets/php/plex_check_ajax.php: -------------------------------------------------------------------------------- 1 | Video) > 0) { 29 | $viewers = count($plexSessionXML->Video); 30 | } 31 | endif; 32 | 33 | // Build an array to hold the values 34 | $array = [ 35 | 'status' => $plexStatus, 36 | 'viewers' => $viewers, 37 | ]; 38 | 39 | // Write the data out to the first Plex check file 40 | file_put_contents($plexcheckfile1, $array, LOCK_EX); 41 | 42 | // Check to see if it's the same as the second Plex check file 43 | if ($plexcheckfile1_md5 === $plexcheckfile2_md5) { 44 | // if they are the same do nothing 45 | } else { 46 | // If they are different, update plexcheckfile2 47 | file_put_contents($plexcheckfile2, $array, LOCK_EX); 48 | } 49 | } 50 | ?> -------------------------------------------------------------------------------- /assets/php/service.class.php: -------------------------------------------------------------------------------- 1 | name = $name; 14 | $this->port = $port; 15 | $this->url = $url; 16 | $this->host = $host; 17 | 18 | $this->status = $this->check_port(); 19 | } 20 | 21 | function check_port() 22 | { 23 | $conn = @fsockopen($this->host, $this->port, $errno, $errstr, 0.5); 24 | if ($conn) 25 | { 26 | fclose($conn); 27 | return true; 28 | } 29 | else 30 | return false; 31 | } 32 | 33 | function makeButton() 34 | { 35 | $icon = ''; 36 | $btn = $this->status ? 'success' : 'warning'; 37 | $prefix = $this->url == "" ? '' : ''; 40 | 41 | return $prefix . $icon . " " . $txt . $suffix; 42 | } 43 | } 44 | ?> -------------------------------------------------------------------------------- /assets/php/serviceMinecraft.class.php: -------------------------------------------------------------------------------- 1 | name = $name; 13 | $this->port = $port; 14 | $this->url = $url; 15 | $this->host = $host; 16 | 17 | $this->status = $this->check_port(); 18 | } 19 | 20 | function check_port() 21 | { 22 | $conn = @fsockopen($this->host, $this->port, $errno, $errstr, 0.5); 23 | if ($conn) 24 | { 25 | fclose($conn); 26 | return true; 27 | } 28 | else 29 | return false; 30 | } 31 | 32 | function makeButton() 33 | { 34 | $server = getMinecraftPlayers($this->port); 35 | $numPlayers = $server[1]; 36 | $players = 'Player'; 37 | if($numPlayers > 1) { 38 | $players = 'Players'; 39 | } 40 | if ($server[0] == true): 41 | $icon = ' ';//''; 42 | $txt = $this->status ? $numPlayers.' '.$players : 'Offline'; 43 | else: 44 | $icon = ''; 45 | $txt = $this->status ? 'Online' : 'Offline'; 46 | endif; 47 | $btn = $this->status ? 'success' : 'warning'; 48 | $prefix = $this->url == "" ? '' : ''; 50 | 51 | return $prefix . $icon . " " . $txt . $suffix; 52 | } 53 | } 54 | ?> -------------------------------------------------------------------------------- /assets/php/serviceSAB.class.php: -------------------------------------------------------------------------------- 1 | name = $name; 15 | $this->port = $port; 16 | $this->url = $url; 17 | $this->host = $host; 18 | 19 | $this->status = $this->check_port(); 20 | } 21 | 22 | function check_port() 23 | { 24 | $conn = @fsockopen($this->host, $this->port, $errno, $errstr, 0.5); 25 | if ($conn) 26 | { 27 | fclose($conn); 28 | return true; 29 | } 30 | else 31 | return false; 32 | } 33 | 34 | function makeButton() 35 | { 36 | global $sabnzbd_ip; 37 | global $sabnzbd_port; 38 | global $sabnzbd_api; 39 | 40 | $sabnzbdXML = simplexml_load_file('http://'.$sabnzbd_ip.':'.$sabnzbd_port.'/api?mode=qstatus&output=xml&apikey='.$sabnzbd_api); 41 | 42 | if (($sabnzbdXML->state) == 'Downloading'): 43 | $speed = $sabnzbdXML->speed; 44 | if (strpbrk($speed, 'K')): 45 | // This converts the speed from KBps or MBps to Mbps 46 | $convertedSpeed = number_format((substr($speed, 0, (strlen($speed) - 2)) * 8 / 1024), 1); 47 | else: 48 | $convertedSpeed = number_format((substr($speed, 0, (strlen($speed) - 2)) * 8), 0); 49 | endif; 50 | $icon = ''; 51 | $txt = $this->status ? $convertedSpeed.'Mb' : 'Offline'; 52 | else: 53 | $icon = ''; 54 | $txt = $this->status ? 'Online' : 'Offline'; 55 | endif; 56 | $btn = $this->status ? 'success' : 'warning'; 57 | $prefix = $this->url == "" ? '' : ''; 59 | 60 | return $prefix . $icon . " " . $txt . $suffix; 61 | } 62 | } 63 | ?> -------------------------------------------------------------------------------- /assets/php/services_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | state) == 'Downloading'): 23 | $timeleft = $sabnzbdXML->timeleft; 24 | $sabTitle = 'SABnzbd ('.$timeleft.')'; 25 | else: 26 | $sabTitle = 'SABnzbd'; 27 | endif; 28 | */ 29 | 30 | /* 31 | $services = array( 32 | new service($plex_server_name, $plex_port, $plex_URL, $plex_ip), 33 | //new service($pfSense_server_name, $pfSense_port, $pfSense_URL, $pfSense_ip), 34 | new serviceSAB($sabTitle, $sabnzbd_port, $sabnzbd_URL, $sabnzbd_ip), 35 | new service($sickbeard_server_name, $sickbeard_port, $sickbeard_URL, $sickbeard_ip), 36 | new service($couchpotato_server_name, $couchpotato_port, $couchpotato_URL, $couchpotato_ip), 37 | //new service("Transmission", 9091, "http://d4rk.co:9091", "10.0.1.5"), 38 | //new service("iTunes Server", 3689, "http://www.apple.com/itunes/"), 39 | //new service("Starbound Server", 21025, "http://playstarbound.com"), 40 | //new serviceMinecraft("Vanilla", 25564, "http://minecraft.d4rk.co", "mc.d4rk.co"), 41 | //new serviceMinecraft("Bevo Tech Pack", 25565, "http://minecraft.d4rk.co") 42 | ); 43 | */ 44 | 45 | //I'm experimenting with using objects to track services in funcitons.php 46 | 47 | global $services; 48 | 49 | function add_service($instances) { 50 | global $services; 51 | 52 | foreach ($instances as $instance) { 53 | $temp_object = new service(array_values($instance)[0],array_values($instance)[1],array_values($instance)[2],array_values($instance)[3]); 54 | $services[] = $temp_object; 55 | } 56 | } 57 | 58 | foreach ($service_instances as $service_instance) { 59 | add_service($service_instance); 60 | } 61 | 62 | 63 | ?> 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
    name; ?>makeButton(); ?>
    -------------------------------------------------------------------------------- /assets/php/system_load_ajax.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/php/transcode_sessions_ajax.php: -------------------------------------------------------------------------------- 1 |

    0) { 10 | echo ' style="margin-left:23px"'; 11 | }; 12 | ?> 13 | > 14 | 0) { 16 | echo ''.$transcodeSessions.''; 17 | }; 18 | ?> 19 | Load 20 |

    21 | -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | ; It is recommended that you place this file outside of web root. 2 | ; Values besides Integers and boolean values need to be surrounded with single quotes. 3 | 4 | [network_details] 5 | local_server_ip = '127.0.0.1' ; dont include http:// 6 | wan_domain = 'example.com' ; don't include http:// 7 | ping_ip = '8.8.8.8' ; IP address for the server to ping to get a sense of connection quality. By default it's Google's DNS service. 8 | wan1_ip = '4.2.2.4' 9 | wan2_ip = '3.3.3.3' 10 | 11 | [misc] 12 | ;cpu_cores = 1 ; Uncomment to manually set the number of logical CPU cores in your server. I would read /proc/cpuinfo to count the number of cores. 13 | trakt_username = 'username' ; Trakt.tv account name. There is a plugin for Plex Media Server to track what is watched. 14 | trakt_api_key = '' ; Go to trakt.tv/oauth/applications and add a new API app. See README for details on how to set this up. 15 | trakt_redirect_url = '' ; Trake uses OAUTH2 whichis a P.I.T.A.... 16 | 17 | [storage] 18 | dashboard[] = 'localhost' 19 | volume_name[] = 'test' 20 | volume_path[] = '/' 21 | 22 | 23 | 24 | [weather] 25 | forecast_api = '' ; Get a free forecast API from here - https://developer.forecast.io 26 | weather_always_display = false ; Boolean // If set to true the upper left sidebar will always display the weather no matter where viewed from. 27 | weather_lat = '45.784007' ; Latitude to be used for weather. 28 | weather_long = '-91.620592' ; Longitude to be used for weather. 29 | weather_name = 'Smallville, KS' ; This is the user friendly name for your location. Only seen on the weekly forecast when PMS is offline. 30 | weather_units = 'F' ; Choose Farenheit (F) which also reads out wind speed in mph or Celcius (C) with wind speed in km/h for your favorite temperature scale and wind speed 31 | 32 | ; If you do not use a service, be sure to comment out variables that would be used 33 | ; There are defined services that you can use: 34 | ; pfSense, plex, sabnzbd, couchpotato, sickbeard, minecraft, and deluge. 35 | ; The syntax for adding another service goes: 36 | ; service_name 37 | ; property[instance_number] = 'string' 38 | ; Just use the existing template as your format 39 | 40 | [pfSense] 41 | server_name[1] = 'firewall' ;This is just the name that you will see next to the service 42 | local_port[1] = '443' 43 | URL[1] = 'https://pfsense.example.com' 44 | local_ip[1] = '127.0.0.1' 45 | username[1] = 'username' ; This could be a second user in pfSense. 46 | password[1] = 'password' ; In pfSense 2.0.3 I couldn't get it to work without making a second admin account. 47 | 48 | [plex] 49 | server_name[1] = 'myPlexServer' 50 | local_port[1] = '32400' 51 | URL[1] = 'http://plex.example.com:32400/web/index.html#!/dashboard' 52 | local_ip[1] = '127.0.0.1' 53 | username[1] = 'email@example.com' ; myPlex username or email address 54 | password[1] = 'password' ; myPlex password 55 | 56 | server_name[2] = 'myPlexServer2' 57 | local_port[2] = '32400' 58 | URL[2] = 'http://plex.example.com:32400/web/index.html#!/dashboard' 59 | local_ip[2] = '127.0.0.1' 60 | username[2] = 'email@example.com' ; myPlex username or email address 61 | password[2] = 'password' ; myPlex password 62 | 63 | [sabnzbd] 64 | server_name[1] = 'sab' 65 | local_port[1] = '8080' 66 | URL[1] = 'http://sabnzbd.example.com:8080' 67 | local_ip[1] = '127.0.0.1' 68 | api[1] = '' ; Locate your SAB API key from Config -> General 69 | sabSpeedLimitMax[1] = '5120' ; This is the maximum speed in KBps you want SAB to be able to download at. 70 | sabSpeedLimitMin[1] = '256' ; This is the minimum speed in KBps you want SAB to be able to download at. (Value must be 1 or greater) 71 | ping_throttle[1] = '50' ; This is the max ping you want your network to hit before auto throttling 72 | 73 | [couchpotato] 74 | server_name[1] = 'potato' ; I'm not very creative with these names 75 | local_port[1] = '5050' 76 | URL[1] = 'http://couchpotato.example.com:5050' 77 | local_ip[1] = '127.0.0.1' 78 | username[1] = 'username' 79 | password[1] = 'password' 80 | 81 | [sickbeard] 82 | server_name[1] = 'sickbeard' ;This should work with sickrage too 83 | local_port[1] = '8081' 84 | URL[1] = 'http://sickbeard.example.com:8081' 85 | local_ip[1] = '127.0.0.1' 86 | username[1] = 'username' 87 | password[1] = 'password' 88 | [minecraft] 89 | server_name[1] = 'vanilla' 90 | local_port[1] = '25565' 91 | URL[1] = 'http://minecraft.example.com:8123' ;dynmap port 92 | local_ip[1] = '127.0.0.1' 93 | 94 | [deluge] 95 | server_name[1] = 'deluge' 96 | local_port[1] = '8112' 97 | URL[1] = 'http://deluge.example.com:8112' 98 | local_ip[1] = '127.0.0.1' 99 | username[1] = '' 100 | password[1] = 'password' 101 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | Network Status Page 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 111 | 112 | 113 | 114 | 115 |
    116 |
    117 |
    118 |
    119 | 120 |
    121 | 122 |
    123 |
    124 |

    125 | Weather 126 |

    127 |
    128 |
    129 | 131 |
    132 |
    133 |
    134 | 135 |
    136 |
    137 |

    138 | Throughput 139 |

    140 |
    141 |
    142 |
    143 |
    144 |
    145 | 146 |
    147 |
    148 |

    149 | Services 150 |

    151 |
    152 |
    153 |
    154 |
    155 |
    156 | 157 |
    158 |
    159 | isMobile() ): 163 | echo '>'; 164 | else: 165 | echo ' style="overflow:auto;">'; 166 | endif; 167 | echo '
    ';?> 168 |
    169 |
    170 | 171 | isMobile() && !$detect->isTablet() ): 174 | echo '>'; 175 | else: 176 | echo ' style="padding-top: 20px;">'; 177 | endif;?> 178 | 179 |
    180 |
    181 | 182 |
    183 |
    184 |
    185 |
    186 | 189 |
    190 |
    191 | 192 |
    193 |
    194 |

    195 | Storage 196 |

    197 |
    198 |
    199 |
    200 |
    201 |
    202 |
    203 |
    204 |
    205 | 206 | 207 | 208 | 225 | 226 |
    227 | 228 | 230 | 231 | 232 | 233 | 234 | 235 | 396 | 397 | 398 | -------------------------------------------------------------------------------- /init.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mc/MinecraftServerStatus.class.php: -------------------------------------------------------------------------------- 1 | '', 25 | 'gametype' => '', 26 | 'game_id' => '', 27 | 'version' => '', 28 | 'plugins' => '', 29 | 'map' => '', 30 | 'numplayers' => '', 31 | 'maxplayers' => '', 32 | 'hostport' => '', 33 | 'hostip' => '' 34 | ]; 35 | 36 | /** 37 | * Query a minecraft server and parse the status 38 | * @param string $Host 39 | * @param int $Port optional 40 | * @param int $Timeout optional 41 | */ 42 | public function __construct($Host, $Port = 25565, $Timeout = 1) { 43 | /* Connect to the host and creat a socket */ 44 | $this->Socket = @stream_socket_client('udp://'.$Host.':'.(int)$Port, $ErrNo, $ErrStr, $Timeout); 45 | if($ErrNo || $this->Socket === false) { 46 | $this->Info['online'] = false; return; 47 | //throw new Exception('Failed to connect', 1); 48 | } 49 | stream_set_timeout($this->Socket, $Timeout); 50 | 51 | /* Make handshake and request server status */ 52 | $Data = $this->Send(self::STATUS, pack('N', $this->Send(self::HANDSHAKE)).pack('c*', 0x00, 0x00, 0x00, 0x00)); 53 | //set_time_limit($met); 54 | 55 | // Try fallback if query is not enabled on the server 56 | if(!$Data){ 57 | if(!class_exists('MinecraftServerStatusSimple') && file_exists('MinecraftServerStatusSimple.class.php')) 58 | require_once('MinecraftServerStatusSimple.class.php'); 59 | if(class_exists('MinecraftServerStatusSimple')) { 60 | $Fallback = new MinecraftServerStatusSimple($Host, $Port, $Timeout); 61 | $this->Info = [ 62 | 'hostname' => $Fallback->Get('motd'), 63 | 'numplayers' => $Fallback->Get('numplayers'), 64 | 'maxplayers' => $Fallback->Get('maxplayers'), 65 | 'hostport' => (int)$Port, 66 | 'hostip' => $Host, 67 | 'online' => $Fallback->Get('online') 68 | ]; fclose($this->Socket); return; 69 | } 70 | } 71 | 72 | /* Prepare the data for parsing */ 73 | // Split the data string on the player position 74 | $Data = explode("\00\00\01player_\00\00", $Data); 75 | // Save the players 76 | $Players = ''; 77 | if($Data[1]) 78 | $Players = substr($Data[1], 0, -2); 79 | // Split the server infos (status) 80 | $Data = explode("\x00", $Data[0]); 81 | 82 | /* Parse server info */ 83 | for($i = 0; $i < sizeof($Data); $i += 2) { 84 | // Check if the server info is expected, if yes save the value 85 | if(array_key_exists($Data[$i], $this->Info) && array_key_exists($i+1, $Data)) 86 | $this->Info[$Data[$i]] = $Data[$i+1]; 87 | } 88 | 89 | // Parse plugins and try to determine the server software 90 | if($this->Info['plugins']) { 91 | $Data = explode(": ", $this->Info['plugins']); 92 | $this->Info['software'] = $Data[0]; 93 | if(isset($Data[1])) 94 | $this->Info['plugins'] = explode('; ', $Data[1]); 95 | else 96 | unset($this->Info['plugins']); 97 | } else { 98 | // It seems to be a vanilla server 99 | $this->Info['software'] = 'Vanilla'; 100 | unset($this->Info['plugins']); 101 | } 102 | 103 | // Parse players 104 | if($Players) 105 | $this->Info['players'] = explode("\00", $Players); 106 | 107 | // Cast types 108 | $this->Info['numplayers'] = (int)$this->Info['numplayers']; 109 | $this->Info['maxplayers'] = (int)$this->Info['maxplayers']; 110 | $this->Info['hostport'] = (int)$this->Info['hostport']; 111 | 112 | $this->Info['online'] = true; 113 | /* Close the connection */ 114 | fclose($this->Socket); 115 | } 116 | 117 | /** 118 | * Return the value of an key or the whole server info 119 | * @param string $Key optional 120 | * @return mixed 121 | */ 122 | public function Get($Key = '') { 123 | return $Key ? (array_key_exists($Key, $this->Info) ? $this->Info[$Key] : false) : $this->Info; 124 | } 125 | 126 | /** 127 | * Send a command to the server and get the answer 128 | * @param byte $Command 129 | * @param byte $Addition optional 130 | * @return string 131 | */ 132 | private function Send($Command, $Addition = '') { 133 | // pack the command into a binary string 134 | $Command = pack('c*', self::B1, self::B2, $Command, 0x01, 0x02, 0x03, 0x04).$Addition; 135 | // send the binary string to the server 136 | if(strlen($Command) !== @fwrite($this->Socket, $Command, strlen($Command))) 137 | // my attempt to not throw exceptions 138 | return false; 139 | #throw new Exception('Failed to write on socket', 2); 140 | 141 | // listen what the server has to say now 142 | $Data = fread($this->Socket, 2048); 143 | if($Data === false) 144 | // my attempt to not throw exceptions 145 | return false; 146 | #throw new Exception('Failed to read from socket', 3); 147 | 148 | // remove the first 5 unnecessary bytes (0x00, 0x01, 0x02, 0x03, 0x04) Status type and own ID token 149 | return substr($Data, 5); 150 | } 151 | } 152 | 153 | #catch (Exception $e) 154 | { 155 | //do nothing 156 | } 157 | -------------------------------------------------------------------------------- /mc/MinecraftServerStatusSimple.class.php: -------------------------------------------------------------------------------- 1 | Socket = @stream_socket_client('tcp://'.$Host.':'.$Port, $ErrNo, $ErrStr, $Timeout); 22 | if($ErrNo || $this->Socket === false) { 23 | $this->Info['online'] = false; return; 24 | //throw new Exception('Failed to connect', 1); 25 | } 26 | stream_set_timeout($this->Socket, $Timeout); 27 | 28 | // Tell the server to send the info 29 | fwrite($this->Socket, "\xfe"); 30 | // Read these info 31 | $Data = fread($this->Socket, 2048); 32 | // Remove the nulls 33 | $Data = str_replace("\x00", '', $Data); 34 | // cut the first 2 bytes off 35 | $Data = substr($Data, 2); 36 | // Separate Infos 37 | $Info = explode("\xa7", $Data); 38 | unset($Data); 39 | // Close connection 40 | fclose($this->Socket); 41 | 42 | $this->Info['online'] = false; 43 | if(sizeof($Info) == 3) { 44 | $this->Info['motd'] = $Info[0]; 45 | $this->Info['numplayers'] = (int)$Info[1]; 46 | $this->Info['maxplayers'] = (int)$Info[2]; 47 | $this->Info['online'] = true; 48 | } else if(sizeof($Info) > 3) { 49 | // Handle error, Minecraft doesn't handle this. 50 | $tmp = ''; 51 | for($i = 0; $i < sizeof($Info) - 2; $i++) { 52 | $tmp .= ($i > 0 ? '§' : '').$Info[$i]; 53 | } 54 | $this->Info['motd'] = $tmp; 55 | $this->Info['numplayers'] = (int)$Info[sizeof($Info) - 2]; 56 | $this->Info['maxplayers'] = (int)$Info[sizeof($Info) - 1]; 57 | $this->Info['error'] = 'Faulty motd or outdated script'; 58 | $this->Info['online'] = true; 59 | } else { 60 | $this->Info['error'] = 'Unexpected error, maybe this script is outdated'; 61 | } 62 | } 63 | 64 | /** 65 | * Return the value of an key or the whole server info 66 | * @param string $Key optional 67 | * @return mixed 68 | */ 69 | public function Get($Key = '') { 70 | return $Key ? (array_key_exists($Key, $this->Info) ? $this->Info[$Key] : false) : $this->Info; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /mc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/favicon.ico -------------------------------------------------------------------------------- /mc/ftb_players.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Get('numplayers')>"0"): 16 | foreach($Server_FTB->Get('players') as $Player_FTB) 17 | $avatarLocal = '/Users/zeus/Sites/d4rk.co/mc/img/avatars/' . $Player_FTB . '.png'; 18 | // If our local avatar file exists and is less than 24 hours old 19 | if (file_exists($avatarLocal) && (filemtime($avatarLocal) > (time() - 60 * 60 * 24))) { 20 | echo ''; 21 | } else { 22 | $f = file_put_contents($avatarLocal, fopen("https://minotar.net/helm/" . $Player_FTB . "/30.png", 'r')); 23 | if($f) { 24 | echo ''; 25 | } else { 26 | echo '

    Unable to download avatar

    '; 27 | } 28 | } endif 29 | ?> -------------------------------------------------------------------------------- /mc/ftb_status_buttons.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | Get('online')): ?> 8 | 9 | 10 | 11 | 12 | Get('online')): ?> 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /mc/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/img/apple-touch-icon.png -------------------------------------------------------------------------------- /mc/img/ftb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/img/ftb.png -------------------------------------------------------------------------------- /mc/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /mc/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /mc/img/mc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scytherswings/Network-Status-Page/5b4588d84a0ee67df4ad9a5ca866dd50ed03a810/mc/img/mc.png -------------------------------------------------------------------------------- /mc/index.php: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | d4rk.co - Minecraft Servers 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 28 | 29 | 30 | 31 | 32 | 33 | 86 | 87 | 88 | 91 |
    92 | 93 |
    94 | 95 |
    96 | 97 |
    98 |
    99 | 100 |
    101 | 102 |
    103 | 104 |
    105 | 106 |
    107 | 108 |
    109 | 110 |
    111 | 112 | Map 113 | 114 | 115 | 116 | 117 |
    118 |
    119 |
    120 |
    121 | 122 |
    123 | 124 |
    125 |
    126 | 127 |
    128 | 129 |
    130 | 131 |
    132 |
    133 | 134 |
    135 | 136 |
    137 | 138 |
    139 | 140 |
    141 | 142 |
    143 | 144 |
    145 | 146 | Map 147 | 148 | 149 |
    150 |
    151 |
    152 |
    153 | 154 |
    155 | 156 |
    157 |
    158 | 159 |
    160 | 161 |
    162 |

    Status Feed

    163 | 164 | 165 |
    166 |
    167 |
    168 | 169 | 191 | 192 | 212 | 213 | -------------------------------------------------------------------------------- /mc/mc_players.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Get('numplayers')>"0"): 16 | foreach($Server_MC->Get('players') as $Player_MC) 17 | $avatarLocal = '/Users/zeus/Sites/d4rk.co/mc/img/avatars/' . $Player_MC . '.png'; 18 | // If our local avatar file exists and is less than 24 hours old 19 | if (file_exists($avatarLocal) && (filemtime($avatarLocal) > (time() - 60 * 60 * 24))) { 20 | echo ''; 21 | } else { 22 | $f = file_put_contents($avatarLocal, fopen("https://minotar.net/helm/" . $Player_MC . "/30.png", 'r')); 23 | if($f) { 24 | echo ''; 25 | } else { 26 | echo '

    Unable to download avatar

    '; 27 | } 28 | } endif 29 | ?> -------------------------------------------------------------------------------- /mc/mc_status_buttons.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | Get('online')): ?> 8 | 9 | 10 | 11 | 12 | Get('online')): ?> 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /plex.php: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------