settings.php 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241
  1. <?php
  2. $data = false;
  3. ini_set("display_errors", 1);
  4. ini_set("error_reporting", E_ALL | E_STRICT);
  5. function registration_callback($username, $email, $userdir)
  6. {
  7. global $data;
  8. $data = array($username, $email, $userdir);
  9. }
  10. require_once("user.php");
  11. $USER = new User("registration_callback");
  12. require_once("translate.php");
  13. if(!$USER->authenticated) :
  14. die("Why you trying to access this without logging in?!?!");
  15. elseif($USER->authenticated && $USER->role !== "admin") :
  16. die("C'mon man! I give you access to my stuff and now you're trying to get in the back door?");
  17. endif;
  18. function printArray($arrayName){
  19. foreach ( $arrayName as $item ) :
  20. echo $item . "<br/>";
  21. endforeach;
  22. }
  23. function explosion($string, $position){
  24. $getWord = explode("|", $string);
  25. return $getWord[$position];
  26. }
  27. function write_ini_file($content, $path) {
  28. if (!$handle = fopen($path, 'w')) {
  29. return false;
  30. }
  31. $success = fwrite($handle, $content);
  32. fclose($handle);
  33. return $success;
  34. }
  35. function getServerPath() {
  36. if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
  37. $protocol = "https://";
  38. } else {
  39. $protocol = "http://";
  40. }
  41. return $protocol . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']);
  42. }
  43. function get_browser_name() {
  44. $user_agent = $_SERVER['HTTP_USER_AGENT'];
  45. if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
  46. elseif (strpos($user_agent, 'Edge')) return 'Edge';
  47. elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
  48. elseif (strpos($user_agent, 'Safari')) return 'Safari';
  49. elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
  50. elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
  51. return 'Other';
  52. }
  53. $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  54. $databaseLocation = "databaseLocation.ini.php";
  55. $userdirpath = USER_HOME;
  56. $userdirpath = substr_replace($userdirpath, "", -1);
  57. $file_db = new PDO("sqlite:" . $dbfile);
  58. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  59. $getUsers = $file_db->query('SELECT * FROM users');
  60. $gotUsers = $file_db->query('SELECT * FROM users');
  61. $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
  62. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  63. $tabSetup = "Yes";
  64. $hasOptions = "No";
  65. foreach($dbTab as $row) :
  66. if (in_array("tabs", $row)) :
  67. $tabSetup = "No";
  68. endif;
  69. endforeach;
  70. foreach($dbOptions as $row) :
  71. if (in_array("options", $row)) :
  72. $hasOptions = "Yes";
  73. endif;
  74. endforeach;
  75. if($hasOptions == "No") :
  76. $title = "Organizr";
  77. $topbar = "#eb6363";
  78. $topbartext = "#FFFFFF";
  79. $bottombar = "#eb6363";
  80. $sidebar = "#000000";
  81. $hoverbg = "#eb6363";
  82. $activetabBG = "#eb6363";
  83. $activetabicon = "#FFFFFF";
  84. $activetabtext = "#FFFFFF";
  85. $inactiveicon = "#FFFFFF";
  86. $inactivetext = "#FFFFFF";
  87. endif;
  88. if($tabSetup == "No") :
  89. $result = $file_db->query('SELECT * FROM tabs');
  90. endif;
  91. if($hasOptions == "Yes") :
  92. $resulto = $file_db->query('SELECT * FROM options');
  93. endif;
  94. if($hasOptions == "Yes") :
  95. foreach($resulto as $row) :
  96. $title = $row['title'];
  97. $topbartext = $row['topbartext'];
  98. $topbar = $row['topbar'];
  99. $bottombar = $row['bottombar'];
  100. $sidebar = $row['sidebar'];
  101. $hoverbg = $row['hoverbg'];
  102. $activetabBG = $row['activetabBG'];
  103. $activetabicon = $row['activetabicon'];
  104. $activetabtext = $row['activetabtext'];
  105. $inactiveicon = $row['inactiveicon'];
  106. $inactivetext = $row['inactivetext'];
  107. endforeach;
  108. endif;
  109. $action = "";
  110. if(isset($_POST['action'])) :
  111. $action = $_POST['action'];
  112. endif;
  113. if($action == "deleteDB") :
  114. unset($_COOKIE['Organizr']);
  115. setcookie('Organizr', '', time() - 3600, '/');
  116. unset($_COOKIE['OrganizrU']);
  117. setcookie('OrganizrU', '', time() - 3600, '/');
  118. $file_db = null;
  119. unlink($dbfile);
  120. foreach(glob($userdirpath . '/*') as $file) :
  121. if(is_dir($file)) :
  122. rmdir($file);
  123. elseif(!is_dir($file)) :
  124. unlink($file);
  125. endif;
  126. endforeach;
  127. rmdir($userdirpath);
  128. echo "<script>window.parent.location.reload();</script>";
  129. endif;
  130. if($action == "deleteLog") :
  131. unlink(FAIL_LOG);
  132. echo "<script type='text/javascript'>window.location.replace('settings.php');</script>";
  133. endif;
  134. if($action == "upgrade") :
  135. function downloadFile($url, $path){
  136. $folderPath = "upgrade/";
  137. if(!mkdir($folderPath)) : echo "can't make dir"; endif;
  138. $newfname = $folderPath . $path;
  139. $file = fopen ($url, 'rb');
  140. if ($file) {
  141. $newf = fopen ($newfname, 'wb');
  142. if ($newf) {
  143. while(!feof($file)) {
  144. fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
  145. }
  146. }
  147. }
  148. if ($file) {
  149. fclose($file);
  150. }
  151. if ($newf) {
  152. fclose($newf);
  153. }
  154. }
  155. function unzipFile($zipFile){
  156. $zip = new ZipArchive;
  157. $extractPath = "upgrade/";
  158. if($zip->open($extractPath . $zipFile) != "true"){
  159. echo "Error :- Unable to open the Zip File";
  160. }
  161. /* Extract Zip File */
  162. $zip->extractTo($extractPath);
  163. $zip->close();
  164. }
  165. // Function to remove folders and files
  166. function rrmdir($dir) {
  167. if (is_dir($dir)) {
  168. $files = scandir($dir);
  169. foreach ($files as $file)
  170. if ($file != "." && $file != "..") rrmdir("$dir/$file");
  171. rmdir($dir);
  172. }
  173. else if (file_exists($dir)) unlink($dir);
  174. }
  175. // Function to Copy folders and files
  176. function rcopy($src, $dst) {
  177. if (is_dir ( $src )) {
  178. if (!file_exists($dst)) : mkdir ( $dst ); endif;
  179. $files = scandir ( $src );
  180. foreach ( $files as $file )
  181. if ($file != "." && $file != "..")
  182. rcopy ( "$src/$file", "$dst/$file" );
  183. } else if (file_exists ( $src ))
  184. copy ( $src, $dst );
  185. }
  186. $url = "https://github.com/causefx/Organizr/archive/master.zip";
  187. $file = "upgrade.zip";
  188. $source = __DIR__ . "/upgrade/Organizr-master/";
  189. $cleanup = __DIR__ . "/upgrade/";
  190. $destination = __DIR__ . "/";
  191. downloadFile($url, $file);
  192. unzipFile($file);
  193. rcopy($source, $destination);
  194. rrmdir($cleanup);
  195. echo "<script>window.parent.location.reload(true);</script>";
  196. endif;
  197. if($action == "createLocation") :
  198. $databaseData = '; <?php die("Access denied"); ?>' . "\r\n";
  199. foreach ($_POST as $postName => $postValue) {
  200. if($postName !== "action") :
  201. if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif;
  202. $databaseData .= $postName . " = \"" . $postValue . "\"\r\n";
  203. endif;
  204. }
  205. write_ini_file($databaseData, $databaseLocation);
  206. endif;
  207. if(!isset($_POST['op'])) :
  208. $_POST['op'] = "";
  209. endif;
  210. if($action == "addTabz") :
  211. if($tabSetup == "No") :
  212. $file_db->exec("DELETE FROM tabs");
  213. endif;
  214. if($tabSetup == "Yes") :
  215. $file_db->exec("CREATE TABLE tabs (name TEXT UNIQUE, url TEXT, defaultz TEXT, active TEXT, user TEXT, guest TEXT, icon TEXT, iconurl TEXT, window TEXT)");
  216. endif;
  217. $addTabName = array();
  218. $addTabUrl = array();
  219. $addTabIcon = array();
  220. $addTabIconUrl = array();
  221. $addTabDefault = array();
  222. $addTabActive = array();
  223. $addTabUser = array();
  224. $addTabGuest = array();
  225. $addTabWindow = array();
  226. $buildArray = array();
  227. foreach ($_POST as $key => $value) :
  228. $trueKey = explode('-', $key);
  229. if ($value == "on") :
  230. $value = "true";
  231. endif;
  232. if($trueKey[0] == "name"):
  233. array_push($addTabName, $value);
  234. endif;
  235. if($trueKey[0] == "url"):
  236. array_push($addTabUrl, $value);
  237. endif;
  238. if($trueKey[0] == "icon"):
  239. array_push($addTabIcon, $value);
  240. endif;
  241. if($trueKey[0] == "iconurl"):
  242. array_push($addTabIconUrl, $value);
  243. endif;
  244. if($trueKey[0] == "default"):
  245. array_push($addTabDefault, $value);
  246. endif;
  247. if($trueKey[0] == "active"):
  248. array_push($addTabActive, $value);
  249. endif;
  250. if($trueKey[0] == "user"):
  251. array_push($addTabUser, $value);
  252. endif;
  253. if($trueKey[0] == "guest"):
  254. array_push($addTabGuest, $value);
  255. endif;
  256. if($trueKey[0] == "window"):
  257. array_push($addTabWindow, $value);
  258. endif;
  259. endforeach;
  260. $tabArray = 0;
  261. if(count($addTabName) > 0) :
  262. foreach(range(1,count($addTabName)) as $index) :
  263. if(!isset($addTabDefault[$tabArray])) :
  264. $tabDefault = "false";
  265. else :
  266. $tabDefault = $addTabDefault[$tabArray];
  267. endif;
  268. $buildArray[] = array('name' => $addTabName[$tabArray],
  269. 'url' => $addTabUrl[$tabArray],
  270. 'defaultz' => $tabDefault,
  271. 'active' => $addTabActive[$tabArray],
  272. 'user' => $addTabUser[$tabArray],
  273. 'guest' => $addTabGuest[$tabArray],
  274. 'icon' => $addTabIcon[$tabArray],
  275. 'window' => $addTabWindow[$tabArray],
  276. 'iconurl' => $addTabIconUrl[$tabArray]);
  277. $tabArray++;
  278. endforeach;
  279. endif;
  280. $insert = "INSERT INTO tabs (name, url, defaultz, active, user, guest, icon, iconurl, window)
  281. VALUES (:name, :url, :defaultz, :active, :user, :guest, :icon, :iconurl, :window)";
  282. $stmt = $file_db->prepare($insert);
  283. $stmt->bindParam(':name', $name);
  284. $stmt->bindParam(':url', $url);
  285. $stmt->bindParam(':defaultz', $defaultz);
  286. $stmt->bindParam(':active', $active);
  287. $stmt->bindParam(':user', $user);
  288. $stmt->bindParam(':guest', $guest);
  289. $stmt->bindParam(':icon', $icon);
  290. $stmt->bindParam(':iconurl', $iconurl);
  291. $stmt->bindParam(':window', $window);
  292. foreach ($buildArray as $t) :
  293. $name = $t['name'];
  294. $url = $t['url'];
  295. $defaultz = $t['defaultz'];
  296. $active = $t['active'];
  297. $user = $t['user'];
  298. $guest = $t['guest'];
  299. $icon = $t['icon'];
  300. $iconurl = $t['iconurl'];
  301. $window = $t['window'];
  302. $stmt->execute();
  303. endforeach;
  304. endif;
  305. if($action == "addOptionz") :
  306. if($hasOptions == "Yes") :
  307. $file_db->exec("DELETE FROM options");
  308. endif;
  309. if($hasOptions == "No") :
  310. $file_db->exec("CREATE TABLE options (title TEXT UNIQUE, topbar TEXT, bottombar TEXT, sidebar TEXT, hoverbg TEXT, topbartext TEXT, activetabBG TEXT, activetabicon TEXT, activetabtext TEXT, inactiveicon TEXT, inactivetext TEXT)");
  311. endif;
  312. $title = $_POST['title'];
  313. $topbartext = $_POST['topbartext'];
  314. $topbar = $_POST['topbar'];
  315. $bottombar = $_POST['bottombar'];
  316. $sidebar = $_POST['sidebar'];
  317. $hoverbg = $_POST['hoverbg'];
  318. $activetabBG = $_POST['activetabBG'];
  319. $activetabicon = $_POST['activetabicon'];
  320. $activetabtext = $_POST['activetabtext'];
  321. $inactiveicon = $_POST['inactiveicon'];
  322. $inactivetext = $_POST['inactivetext'];
  323. $insert = "INSERT INTO options (title, topbartext, topbar, bottombar, sidebar, hoverbg, activetabBG, activetabicon, activetabtext, inactiveicon, inactivetext)
  324. VALUES (:title, :topbartext, :topbar, :bottombar, :sidebar, :hoverbg, :activetabBG, :activetabicon , :activetabtext , :inactiveicon, :inactivetext)";
  325. $stmt = $file_db->prepare($insert);
  326. $stmt->bindParam(':title', $title);
  327. $stmt->bindParam(':topbartext', $topbartext);
  328. $stmt->bindParam(':topbar', $topbar);
  329. $stmt->bindParam(':bottombar', $bottombar);
  330. $stmt->bindParam(':sidebar', $sidebar);
  331. $stmt->bindParam(':hoverbg', $hoverbg);
  332. $stmt->bindParam(':activetabBG', $activetabBG);
  333. $stmt->bindParam(':activetabicon', $activetabicon);
  334. $stmt->bindParam(':activetabtext', $activetabtext);
  335. $stmt->bindParam(':inactiveicon', $inactiveicon);
  336. $stmt->bindParam(':inactivetext', $inactivetext);
  337. $stmt->execute();
  338. endif;
  339. ?>
  340. <!DOCTYPE html>
  341. <html lang="en" class="no-js">
  342. <head>
  343. <meta charset="UTF-8">
  344. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  345. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  346. <meta name="msapplication-tap-highlight" content="no" />
  347. <title>Settings</title>
  348. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  349. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  350. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
  351. <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
  352. <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css">
  353. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  354. <link rel="stylesheet" href="js/selects/cs-select.css">
  355. <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
  356. <link href="bower_components/iconpick/dist/css/fontawesome-iconpicker.min.css" rel="stylesheet">
  357. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css">
  358. <link rel="stylesheet" href="bower_components/sweetalert/dist/sweetalert.css">
  359. <link rel="stylesheet" href="bower_components/smoke/dist/css/smoke.min.css">
  360. <script src="js/menu/modernizr.custom.js"></script>
  361. <script type="text/javascript" src="js/sha1.js"></script>
  362. <script type="text/javascript" src="js/user.js"></script>
  363. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  364. <link rel="stylesheet" href="bower_components/DataTables/media/css/jquery.dataTables.css">
  365. <link rel="stylesheet" href="bower_components/datatables-tabletools/css/dataTables.tableTools.css">
  366. <link rel="stylesheet" href="css/style.css">
  367. <link href="css/jquery.filer.css" rel="stylesheet">
  368. <link href="css/jquery.filer-dragdropbox-theme.css" rel="stylesheet">
  369. <!--[if lt IE 9]>
  370. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  371. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  372. <![endif]-->
  373. </head>
  374. <body style="padding: 0; background: #273238;">
  375. <style>
  376. input.form-control.material.icp-auto.iconpicker-element.iconpicker-input {
  377. display: none;
  378. }input.form-control.iconpicker-search {
  379. color: black;
  380. }.key {
  381. font-family:Tahoma, sans-serif;
  382. border-style:solid;
  383. border-color:#D5D6AD #C1C1A8 #CDCBA5 #E7E5C5;
  384. border-width:2px 3px 8px 3px;
  385. background:#D6D4B4;
  386. display:inline-block;
  387. border-radius:5px;
  388. margin:3px;
  389. text-align:center;
  390. }.form-control.material {
  391. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  392. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  393. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  394. }.key span {
  395. background:#ECEECA;
  396. color:#5D5E4F;
  397. display:block;
  398. font-size:12px;
  399. padding:0 2px;
  400. border-radius:3px;
  401. width:14px;
  402. height:18px;
  403. line-height:18px;
  404. text-align:center;
  405. font-weight:bold;
  406. letter-spacing:1px;
  407. text-transform:uppercase;
  408. }.key.wide span {
  409. width:auto;
  410. padding:0 12px;
  411. }
  412. </style>
  413. <div id="main-wrapper" class="main-wrapper">
  414. <!--Content-->
  415. <div id="content" style="margin:0 20px; overflow:hidden">
  416. <br/>
  417. <div id="versionCheck"></div>
  418. <div class="row">
  419. <div class="col-lg-12">
  420. <div class="tabbable tabs-with-bg" id="eighth-tabs">
  421. <ul id="settingsTabs" class="nav nav-tabs" style="background: #C0C0C0">
  422. <li class="active">
  423. <a href="#tab-tabs" data-toggle="tab"><i class="fa fa-list gray"></i></a>
  424. </li>
  425. <li>
  426. <a href="#customedit" data-toggle="tab"><i class="fa fa-paint-brush green"></i></a>
  427. </li>
  428. <li>
  429. <a href="#useredit" data-toggle="tab"><i class="fa fa-user red"></i></a>
  430. </li>
  431. <li>
  432. <a href="#loginlog" data-toggle="tab"><i class="fa fa-file-text-o indigo"></i></a>
  433. </li>
  434. <li>
  435. <a href="#systemSettings" data-toggle="tab"><i class="fa fa-cog gray"></i></a>
  436. </li>
  437. <li>
  438. <a href="#about" data-toggle="tab"><i class="fa fa-info red-orange"></i></a>
  439. </li>
  440. <?php if($action) : ?>
  441. <button id="apply" style="margin: 8px" class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  442. <span class="btn-label"><i class="fa fa-check"></i></span><?php echo $language->translate("APPLY_CHANGES");?>
  443. </button>
  444. <?php endif; ?>
  445. </ul>
  446. <div class="tab-content" style="overflow: auto">
  447. <div class="big-box todo-list tab-pane big-box fade in active" id="tab-tabs">
  448. <div class="sort-todo">
  449. <a class="total-tabs"><?php echo $language->translate("TABS");?> <span class="badge gray-bg"></span></a>
  450. <button id="iconHide" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  451. <span class="btn-label"><i class="fa fa-upload"></i></span><?php echo $language->translate("UPLOAD_ICONS");?>
  452. </button>
  453. <button id="iconAll" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  454. <span class="btn-label"><i class="fa fa-picture-o"></i></span><?php echo $language->translate("VIEW_ICONS");?>
  455. </button>
  456. </div>
  457. <input type="file" name="files[]" id="uploadIcons" multiple="multiple">
  458. <div id="viewAllIcons" style="display: none;">
  459. <h4><strong><?php echo $language->translate("ALL_ICONS");?></strong> [<?php echo $language->translate("CLICK_ICON");?>]</h4>
  460. <div class="row">
  461. <textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
  462. <?php
  463. $dirname = "images/";
  464. $images = scandir($dirname);
  465. $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg");
  466. foreach($images as $curimg){
  467. if(!in_array($curimg, $ignore)) { ?>
  468. <div class="col-xs-2" style="width: 75px; height: 75px; padding-right: 0px;">
  469. <a data-toggle="tooltip" data-placement="bottom" title="<?=$dirname.$curimg;?>" class="thumbnail" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
  470. <img style="width: 50px; height: 50px;" src="<?=$dirname.$curimg;?>" alt="thumbnail" class="allIcons">
  471. </a>
  472. </div>
  473. <?php } } ?>
  474. </div>
  475. </div>
  476. <form id="add_tab" method="post">
  477. <div class="form-group add-tab">
  478. <div class="input-group">
  479. <div class="input-group-addon">
  480. <i class="fa fa-pencil gray"></i>
  481. </div>
  482. <input type="text" class="form-control name-of-todo" placeholder="<?php echo $language->translate("TYPE_HIT_ENTER");?>" style="border-top-left-radius: 0;
  483. border-bottom-left-radius: 0;">
  484. </div>
  485. </div>
  486. </form>
  487. <div class="panel">
  488. <form id="submitTabs" method="post">
  489. <div class="panel-body todo">
  490. <input type="hidden" name="action" value="addTabz" />
  491. <ul class="list-group ui-sortable">
  492. <?php if($tabSetup == "No") : $tabNum = 1;
  493. foreach($result as $row) :
  494. if($row['defaultz'] == "true") : $default = "checked"; else : $default = ""; endif;
  495. if($row['active'] == "true") : $activez = "checked"; else : $activez = ""; endif;
  496. if($row['guest'] == "true") : $guestz = "checked"; else : $guestz = ""; endif;
  497. if($row['user'] == "true") : $userz = "checked"; else : $userz = ""; endif;
  498. if($row['window'] == "true") : $windowz = "checked"; else : $windowz = ""; endif;
  499. ?>
  500. <li id="item-<?=$tabNum;?>" class="list-group-item gray-bg" style="position: relative; left: 0px; top: 0px;">
  501. <tab class="content-form form-inline">
  502. <div class="form-group">
  503. <div class="action-btns" style="width:calc(100%)">
  504. <a class="" style="margin-left: 0px"><span class="fa fa-hand-paper-o"></span></a>
  505. </div>
  506. </div>
  507. <div class="form-group">
  508. <input style="width: 100%;" type="text" class="form-control material input-sm" id="name-<?=$tabNum;?>" name="name-<?=$tabNum;?>" placeholder="<?php echo $language->translate("NEW_TAB_NAME");?>" value="<?=$row['name'];?>">
  509. </div>
  510. <div class="form-group">
  511. <input style="width: 100%;" type="text" class="form-control material input-sm" id="url-<?=$tabNum;?>" name="url-<?=$tabNum;?>" placeholder="<?php echo $language->translate("TAB_URL");?>" value="<?=$row['url']?>">
  512. </div>
  513. <div style="margin-right: 5px;" class="form-group">
  514. <div class="input-group">
  515. <input data-placement="bottomRight" class="form-control material icp-auto" name="icon-<?=$tabNum;?>" value="<?=$row['icon'];?>" type="text" />
  516. <span class="input-group-addon"></span>
  517. </div>
  518. - <?php echo $language->translate("OR");?> -
  519. </div>
  520. <div class="form-group">
  521. <input style="width: 100%;" type="text" class="form-control material input-sm" id="iconurl-<?=$tabNum;?>" name="iconurl-<?=$tabNum;?>" placeholder="<?php echo $language->translate("ICON_URL");?>" value="<?=$row['iconurl']?>">
  522. </div>
  523. <div class="form-group">
  524. <div class="radio radio-danger">
  525. <input type="radio" id="default[<?=$tabNum;?>]" value="true" name="default" <?=$default;?>>
  526. <label for="default[<?=$tabNum;?>]"><?php echo $language->translate("DEFAULT");?></label>
  527. </div>
  528. </div>
  529. <div class="form-group">
  530. <div class="">
  531. <input id="" class="switcher switcher-success" value="false" name="active-<?=$tabNum;?>" type="hidden">
  532. <input id="active[<?=$tabNum;?>]" class="switcher switcher-success" name="active-<?=$tabNum;?>" type="checkbox" <?=$activez;?>>
  533. <label for="active[<?=$tabNum;?>]"></label>
  534. </div>
  535. <?php echo $language->translate("ACTIVE");?>
  536. </div>
  537. <div class="form-group">
  538. <div class="">
  539. <input id="" class="switcher switcher-primary" value="false" name="user-<?=$tabNum;?>" type="hidden">
  540. <input id="user[<?=$tabNum;?>]" class="switcher switcher-primary" name="user-<?=$tabNum;?>" type="checkbox" <?=$userz;?>>
  541. <label for="user[<?=$tabNum;?>]"></label>
  542. </div>
  543. <?php echo $language->translate("USER");?>
  544. </div>
  545. <div class="form-group">
  546. <div class="">
  547. <input id="" class="switcher switcher-primary" value="false" name="guest-<?=$tabNum;?>" type="hidden">
  548. <input id="guest[<?=$tabNum;?>]" class="switcher switcher-warning" name="guest-<?=$tabNum;?>" type="checkbox" <?=$guestz;?>>
  549. <label for="guest[<?=$tabNum;?>]"></label>
  550. </div>
  551. <?php echo $language->translate("GUEST");?>
  552. </div>
  553. <div class="form-group">
  554. <div class="">
  555. <input id="" class="switcher switcher-primary" value="false" name="window-<?=$tabNum;?>" type="hidden">
  556. <input id="window[<?=$tabNum;?>]" class="switcher switcher-danger" name="window-<?=$tabNum;?>" type="checkbox" <?=$windowz;?>>
  557. <label for="window[<?=$tabNum;?>]"></label>
  558. </div>
  559. <?php echo $language->translate("NO_IFRAME");?>
  560. </div>
  561. <div class="pull-right action-btns" style="padding-top: 8px;">
  562. <a class="trash"><span class="fa fa-close"></span></a>
  563. </div>
  564. </tab>
  565. </li>
  566. <?php $tabNum ++; endforeach; endif;?>
  567. </ul>
  568. </div>
  569. <div class="checkbox clear-todo pull-left"></div>
  570. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  571. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_TABS");?>
  572. </button>
  573. </form>
  574. </div>
  575. </div>
  576. <div class="tab-pane big-box fade in" id="useredit">
  577. <div class="row">
  578. <div class="col-lg-12">
  579. <div class="gray-bg content-box big-box box-shadow">
  580. <form class="content-form form-inline" name="new user registration" id="registration" action="" method="POST">
  581. <input type="hidden" name="op" value="register"/>
  582. <input type="hidden" name="sha1" value=""/>
  583. <div class="form-group">
  584. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" value="">
  585. </div>
  586. <div class="form-group">
  587. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  588. </div>
  589. <div class="form-group">
  590. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  591. </div>
  592. <div class="form-group">
  593. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  594. </div>
  595. <button type="submit" onclick="User.processRegistration()" class="btn btn-primary btn-icon waves waves-circle waves-effect waves-float"><i class="fa fa-user-plus"></i></button>
  596. </form>
  597. </div>
  598. </div>
  599. </div>
  600. <div class="big-box">
  601. <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
  602. <input type="hidden" name="op" value="unregister"/>
  603. <p id="inputUsername"></p>
  604. <div class="table-responsive">
  605. <table class="table table-striped">
  606. <thead>
  607. <tr>
  608. <th>#</th>
  609. <th><?php echo $language->translate("USERNAME");?></th>
  610. <th><?php echo $language->translate("EMAIL");?></th>
  611. <th><?php echo $language->translate("LOGIN_STATUS");?></th>
  612. <th><?php echo $language->translate("LAST_SEEN");?></th>
  613. <th><?php echo $language->translate("USER_GROUP");?></th>
  614. <th><?php echo $language->translate("USER_ACTIONS");?></th>
  615. </tr>
  616. </thead>
  617. <tbody>
  618. <?php $countUsers = 1;
  619. foreach($gotUsers as $row) :
  620. if($row['role'] == "admin") :
  621. $userColor = "red";
  622. $disableAction = "disabled=\"disabled\"";
  623. else :
  624. $userColor = "blue";
  625. $disableAction = "";
  626. endif;
  627. if($row['active'] == "true") :
  628. $userActive = $language->translate("LOGGED_IN");
  629. $userActiveColor = "primary";
  630. else :
  631. $userActive = $language->translate("LOGGED_OUT");
  632. $userActiveColor = "danger";
  633. endif;
  634. $userpic = md5( strtolower( trim( $row['email'] ) ) );
  635. if(!empty($row["last"])) :
  636. $lastActive = date("Y-m-d H:i", intval($row["last"]));
  637. else :
  638. $lastActive = "";
  639. endif;
  640. ?>
  641. <tr id="<?=$row['username'];?>">
  642. <th scope="row"><?=$countUsers;?></th>
  643. <td><i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=25&d=mm" class="img-circle"></i> &nbsp; <?=$row['username'];?></td>
  644. <td><?=$row['email'];?></td>
  645. <td><span class="label label-<?=$userActiveColor;?>"><?=$userActive;?></span></td>
  646. <td><?=$lastActive;?></td>
  647. <td><span class="text-uppercase <?=$userColor;?>"><?=$row['role'];?></span></td>
  648. <td id="<?=$row['username'];?>">
  649. <button <?=$disableAction;?> class="btn waves btn-labeled btn-danger btn btn-sm text-uppercase waves-effect waves-float deleteUser">
  650. <span class="btn-label"><i class="fa fa-user-times"></i></span><?php echo $language->translate("DELETE");?>
  651. </button>
  652. </td>
  653. </tr>
  654. <?php $countUsers++; endforeach; ?>
  655. </tbody>
  656. </table>
  657. </div>
  658. </form>
  659. </div>
  660. </div>
  661. <div class="tab-pane big-box fade in" id="systemSettings">
  662. <div class="row">
  663. <div class="col-lg-12">
  664. <div class="gray-bg content-box big-box box-shadow">
  665. <form class="content-form form-inline" name="systemSettings" id="systemSettings" action="" method="POST">
  666. <input type="hidden" name="action" value="createLocation" />
  667. <div class="form-group">
  668. <input type="text" class="form-control material" name="databaseLocation" placeholder="<?php echo $language->translate("DATABASE_PATH");?>" autocorrect="off" autocapitalize="off" value="<?php echo DATABASE_LOCATION;?>">
  669. </div>
  670. <div class="form-group">
  671. <input type="text" class="form-control material" name="timezone" placeholder="<?php echo $language->translate("SET_TIMEZONE");?>" value="<?php echo TIMEZONE;?>">
  672. </div>
  673. <div class="form-group">
  674. <input type="text" class="form-control material" name="titleLogo" placeholder="<?php echo $language->translate("LOGO_URL_TITLE");?>" value="<?php echo TITLELOGO;?>">
  675. </div>
  676. <div class="form-group">
  677. <input type="text" class="form-control material" name="loadingIcon" placeholder="<?php echo $language->translate("LOADING_ICON_URL");?>" value="<?php echo LOADINGICON;?>">
  678. </div>
  679. <button type="submit" class="btn btn-success btn-icon waves waves-circle waves-effect waves-float"><i class="fa fa-floppy-o"></i></button>
  680. </form>
  681. </div>
  682. </div>
  683. </div>
  684. </div>
  685. <div class="tab-pane big-box fade in" id="loginlog">
  686. <div class="table-responsive">
  687. <?php if(file_exists(FAIL_LOG)) : ?>
  688. <div id="loginStats">
  689. <div class="content-box ultra-widget">
  690. <div class="w-progress">
  691. <span id="goodCount" class="w-amount green"></span>
  692. <span id="badCount" class="w-amount red pull-right">3</span>
  693. <br>
  694. <span class="text-uppercase w-name"><?php echo $language->translate("GOOD_LOGINS");?></span>
  695. <span class="text-uppercase w-name pull-right"><?php echo $language->translate("BAD_LOGINS");?></span>
  696. </div>
  697. <div class="progress progress-bar-sm zero-m">
  698. <div id="goodPercent" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"></div>
  699. <div id="badPercent" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"></div>
  700. </div>
  701. <div class="w-status clearfix">
  702. <div id="goodTitle" class="w-status-title pull-left text-uppercase">20%</div>
  703. <div id="badTitle" class="w-status-number pull-right text-uppercase">80%</div>
  704. </div>
  705. </div>
  706. </div>
  707. <table id="datatable" class="display">
  708. <thead>
  709. <tr>
  710. <th><?php echo $language->translate("DATE");?></th>
  711. <th><?php echo $language->translate("USERNAME");?></th>
  712. <th><?php echo $language->translate("IP_ADDRESS");?></th>
  713. <th><?php echo $language->translate("TYPE");?></th>
  714. </tr>
  715. </thead>
  716. <tbody>
  717. <?php
  718. $getFailLog = str_replace("\r\ndate", "date", file_get_contents(FAIL_LOG));
  719. $gotFailLog = json_decode($getFailLog, true);
  720. $goodLogin = 0;
  721. $badLogin = 0;
  722. function getColor($colorTest){
  723. if($colorTest == "bad_auth") :
  724. $gotColorTest = "danger";
  725. elseif($colorTest == "good_auth") :
  726. $gotColorTest = "primary";
  727. endif;
  728. echo $gotColorTest;
  729. }
  730. foreach (array_reverse($gotFailLog["auth"]) as $key => $val) :
  731. if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif;
  732. ?>
  733. <tr>
  734. <td><?=$val["date"];?></td>
  735. <td><?=$val["username"];?></td>
  736. <td><?=$val["ip"];?></td>
  737. <td><span class="label label-<?php getColor($val["auth_type"]);?>"><?=$val["auth_type"];?></span></td>
  738. </tr>
  739. <?php endforeach; ?>
  740. </tbody>
  741. </table>
  742. <?php
  743. $totalLogin = $goodLogin + $badLogin;
  744. $goodPercent = round(($goodLogin / $totalLogin) * 100);
  745. $badPercent = round(($badLogin / $totalLogin) * 100);
  746. endif;
  747. if(!file_exists(FAIL_LOG)) :
  748. echo $language->translate("NOTHING_LOG");
  749. endif;
  750. ?>
  751. </div>
  752. </div>
  753. <div class="tab-pane big-box fade in" id="about">
  754. <h4><strong><?php echo $language->translate("ABOUT");?> Organizr</strong></h4>
  755. <p id="version"></p>
  756. <p id="submitFeedback">
  757. <a href='https://github.com/causefx/Organizr/issues/new' target='_blank' type='button' class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span><?php echo $language->translate("SUBMIT_ISSUE");?></a>
  758. <a href='https://github.com/causefx/Organizr' target='_blank' type='button' class='btn waves btn-labeled btn-primary btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github'></i></span><?php echo $language->translate("VIEW_ON_GITHUB");?></a>
  759. <a href='https://gitter.im/Organizrr/Lobby' target='_blank' type='button' class='btn waves btn-labeled btn-dark btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-comments-o'></i></span><?php echo $language->translate("CHAT_WITH_US");?></a>
  760. <button type="button" class="class='btn waves btn-labeled btn-warning btn text-uppercase waves-effect waves-float" data-toggle="modal" data-target=".Help-Me-modal-lg"><span class='btn-label'><i class='fa fa-life-ring'></i></span><?php echo $language->translate("HELP");?></button>
  761. <div class="modal fade Help-Me-modal-lg" tabindex="-1" role="dialog">
  762. <div class="modal-dialog modal-lg" role="document">
  763. <div class="modal-content" style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;">
  764. <div class="modal-header">
  765. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  766. <h4 class="modal-title"><?php echo $language->translate("HELP");?>!</h4>
  767. </div>
  768. <div class="modal-body">
  769. <h4><strong><?php echo $language->translate("ADDING_TABS");?></strong></h4>
  770. <p><?php echo $language->translate("START_ADDING_TABS");?></p>
  771. <ul>
  772. <li><strong><?php echo $language->translate("TAB_URL");?></strong> <?php echo $language->translate("TAB_URL_ABOUT");?></li>
  773. <li><strong><?php echo $language->translate("ICON_URL");?></strong> <?php echo $language->translate("ICON_URL_ABOUT");?></li>
  774. <li><strong><?php echo $language->translate("DEFAULT");?></strong> <?php echo $language->translate("DEFAULT_ABOUT");?></li>
  775. <li><strong><?php echo $language->translate("ACTIVE");?></strong> <?php echo $language->translate("ACTIVE_ABOUT");?></li>
  776. <li><strong><?php echo $language->translate("USER");?></strong> <?php echo $language->translate("USER_ABOUT");?></li>
  777. <li><strong><?php echo $language->translate("GUEST");?></strong> <?php echo $language->translate("GUEST_ABOUT");?></li>
  778. <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>
  779. </ul>
  780. <h4><strong><?php echo $language->translate("QUICK_ACCESS");?></strong></h4>
  781. <p><?php echo $language->translate("QUICK_ACCESS_ABOUT");?> <mark><?php echo getServerPath(); ?>#Sonarr</mark></p>
  782. <h4><strong><?php echo $language->translate("SIDE_BY_SIDE");?></strong></h4>
  783. <p><?php echo $language->translate("SIDE_BY_SIDE_ABOUT");?></p>
  784. <ul>
  785. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS1");?></li>
  786. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS2");?> [<i class='mdi mdi-refresh'></i>]</li>
  787. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS3");?></li>
  788. </ul>
  789. <h4><strong><?php echo $language->translate("KEYBOARD_SHORTCUTS");?></strong></h4>
  790. <p><?php echo $language->translate("KEYBOARD_SHORTCUTS_ABOUT");?></p>
  791. <ul>
  792. <li><keyboard class="key"><span>S</span></keyboard> + <keyboard class="key"><span>S</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS1");?></li>
  793. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>&darr;</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS2");?></li>
  794. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>&uarr;</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS3");?></li>
  795. <li><keyboard class="key wide"><span>Esc</span></keyboard> + <keyboard class="key wide"><span>Esc</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS4");?></li>
  796. </ul>
  797. <h4><strong><?php echo $language->translate("TAB_NOT_LOADING");?></strong></h4>
  798. <p><?php echo $language->translate("TAB_NOT_LOADING_ABOUT");?></p>
  799. <?php
  800. if(get_browser_name() == "Chrome") : echo get_browser_name() . ": <a href='https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe' target='_blank'><strong>Ignore X-Frame headers</strong> by Guillaume Ryder</a>";
  801. elseif(get_browser_name() == "Firefox") : echo get_browser_name() . ": <a href='https://addons.mozilla.org/en-us/firefox/addon/ignore-x-frame-options/' target='_blank'><strong>Ignore X-Frame headers</strong> by rjhoukema</a>";
  802. else : echo "Sorry, currently there is no other alternative for " . get_browser_name(); endif;
  803. ?>
  804. </div>
  805. <div class="modal-footer">
  806. <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo $language->translate("CLOSE");?></button>
  807. </div>
  808. </div>
  809. </div>
  810. </div>
  811. </p>
  812. <p id="whatsnew"></p>
  813. <p id="downloadnow"></p>
  814. <div class="panel panel-danger">
  815. <div class="panel-heading">
  816. <h3 class="panel-title"><?php echo $language->translate("DELETE_DATABASE");?></h3>
  817. </div>
  818. <div class="panel-body">
  819. <div class="">
  820. <p><?php echo $language->translate("DELETE_WARNING");?></p>
  821. <form id="deletedb" method="post">
  822. <input type="hidden" name="action" value="deleteDB" />
  823. <button class="btn waves btn-labeled btn-danger pull-right text-uppercase waves-effect waves-float" type="submit">
  824. <span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("DELETE_DATABASE");?>
  825. </button>
  826. </form>
  827. </div>
  828. </div>
  829. </div>
  830. </div>
  831. <div class="tab-pane small-box fade in" id="customedit">
  832. <form id="add_optionz" method="post">
  833. <input type="hidden" name="action" value="addOptionz" />
  834. <div class="btn-group">
  835. <button type="button" class="btn btn-dark dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  836. <?php echo $language->translate("CHOOSE_THEME");?> <span class="caret"></span>
  837. </button>
  838. <ul class="dropdown-menu gray-bg">
  839. <li id="plexTheme" style="border: 1px #FFFFFF; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex</a></li>
  840. <li id="embyTheme" style="border: 1px #FFFFFF; border-style: groove; background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby</a></li>
  841. <li id="bookTheme" style="border: 1px #FFFFFF; border-style: groove; background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook</a></li>
  842. <li id="spaTheme" style="border: 1px #66BBAE; border-style: groove; background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa</a></li>
  843. <li id="darklyTheme" style="border: 1px #464545; border-style: groove; background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly</a></li>
  844. <li id="slateTheme" style="border: 1px #58C0DE; border-style: groove; background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate</a></li>
  845. <li id="monokaiTheme" style="border: 1px #AD80FD; border-style: groove; background: #333333; border-radius: 5px; margin: 5px;"><a style="color: #66D9EF !important;" href="#">Monokai</a></li>
  846. <li id="thejokerTheme" style="border: 1px #CCC6CC; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #CCCCCC !important;" href="#">The Joker</a></li>
  847. <li id="redTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Original Red</a></li>
  848. <li role="separator" class="divider"></li>
  849. <li id="defaultTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#"><?php echo $language->translate("DEFAULT");?></a></li>
  850. </ul>
  851. </div>
  852. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  853. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_OPTIONS");?>
  854. </button>
  855. <div class="big-box grids">
  856. <div class="row show-grids">
  857. <h4><strong><?php echo $language->translate("TITLE");?></strong></h4>
  858. <div class="col-md-2 gray-bg">
  859. <center><?php echo $language->translate("TITLE");?></center>
  860. <input name="title" class="form-control gray" value="<?=$title;?>" placeholder="Organizr">
  861. </div>
  862. <div class="col-md-2 gray-bg">
  863. <center><?php echo $language->translate("TITLE_TEXT");?></center>
  864. <input name="topbartext" id="topbartext" class="form-control jscolor {hash:true}" value="<?=$topbartext;?>">
  865. </div>
  866. </div>
  867. <div class="row show-grids">
  868. <h4><strong><?php echo $language->translate("NAVIGATION_BARS");?></strong></h4>
  869. <div class="col-md-2 gray-bg">
  870. <center><?php echo $language->translate("TOP_BAR");?></center>
  871. <input name="topbar" id="topbar" class="form-control jscolor {hash:true}" value="<?=$topbar;?>">
  872. </div>
  873. <div class="col-md-2 gray-bg">
  874. <center><?php echo $language->translate("BOTTOM_BAR");?></center>
  875. <input name="bottombar" id="bottombar" class="form-control jscolor {hash:true}" value="<?=$bottombar;?>">
  876. </div>
  877. <div class="clearfix visible-xs-block"></div>
  878. <div class="col-md-2 gray-bg">
  879. <center><?php echo $language->translate("SIDE_BAR");?></center>
  880. <input name="sidebar" id="sidebar" class="form-control jscolor {hash:true}" value="<?=$sidebar;?>">
  881. </div>
  882. <div class="col-md-2 gray-bg">
  883. <center><?php echo $language->translate("HOVER_BG");?></center>
  884. <input name="hoverbg" id="hoverbg" class="form-control jscolor {hash:true}" value="<?=$hoverbg;?>">
  885. </div>
  886. </div>
  887. <div class="row show-grids">
  888. <h4><strong><?php echo $language->translate("ACTIVE_TAB");?></strong></h4>
  889. <div class="col-md-2 gray-bg">
  890. <center><?php echo $language->translate("ACTIVE_TAB_BG");?></center>
  891. <input name="activetabBG" id="activetabBG" class="form-control jscolor {hash:true}" value=<?=$activetabBG;?>"">
  892. </div>
  893. <div class="col-md-2 gray-bg">
  894. <center><?php echo $language->translate("ACTIVE_TAB_ICON");?></center>
  895. <input name="activetabicon" id="activetabicon" class="form-control jscolor {hash:true}" value="<?=$activetabicon;?>">
  896. </div>
  897. <div class="col-md-2 gray-bg">
  898. <center><?php echo $language->translate("ACTIVE_TAB_TEXT");?></center>
  899. <input name="activetabtext" id="activetabtext" class="form-control jscolor {hash:true}" value="<?=$activetabtext;?>">
  900. </div>
  901. </div>
  902. <div class="row show-grids">
  903. <h4><strong><?php echo $language->translate("INACTIVE_TAB");?></strong></h4>
  904. <div class="col-md-2 gray-bg">
  905. <center><?php echo $language->translate("INACTIVE_ICON");?></center>
  906. <input name="inactiveicon" id="inactiveicon" class="form-control jscolor {hash:true}" value="<?=$inactiveicon;?>">
  907. </div>
  908. <div class="col-md-2 gray-bg">
  909. <center><?php echo $language->translate("INACTIVE_TEXT");?></center>
  910. <input name="inactivetext" id="inactivetext" class="form-control jscolor {hash:true}" value="<?=$inactivetext;?>">
  911. </div>
  912. </div>
  913. </div>
  914. </form>
  915. </div>
  916. </div>
  917. </div>
  918. </div>
  919. </div>
  920. </div>
  921. <!--End Content-->
  922. <!--Welcome notification-->
  923. <div id="welcome"></div>
  924. </div>
  925. <?php if(!$USER->authenticated) : ?>
  926. <?php endif;?>
  927. <?php if($USER->authenticated) : ?>
  928. <?php endif;?>
  929. <!--Scripts-->
  930. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  931. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  932. <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
  933. <script src="bower_components/Waves/dist/waves.min.js"></script>
  934. <script src="bower_components/moment/min/moment.min.js"></script>
  935. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  936. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  937. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  938. <script src="bower_components/cta/dist/cta.min.js"></script>
  939. <!--Menu-->
  940. <script src="js/menu/classie.js"></script>
  941. <script src="bower_components/iconpick/dist/js/fontawesome-iconpicker.js"></script>
  942. <!--Selects-->
  943. <script src="js/selects/selectFx.js"></script>
  944. <script src="js/jscolor.js"></script>
  945. <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script>
  946. <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
  947. <!--Notification-->
  948. <script src="js/notifications/notificationFx.js"></script>
  949. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  950. <script src="js/jquery.filer.min.js" type="text/javascript"></script>
  951. <script src="js/custom.js" type="text/javascript"></script>
  952. <!--Data Tables-->
  953. <script src="bower_components/DataTables/media/js/jquery.dataTables.js"></script>
  954. <script src="bower_components/datatables.net-responsive/js/dataTables.responsive.js"></script>
  955. <script src="bower_components/datatables-tabletools/js/dataTables.tableTools.js"></script>
  956. <script>
  957. $(function () {
  958. //Data Tables
  959. $('#datatable').DataTable({
  960. displayLength: 10,
  961. dom: 'T<"clear">lfrtip',
  962. responsive: true,
  963. "order": [[ 0, 'desc' ]],
  964. "language": {
  965. "info": "<?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 0);?> _START_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 1);?> _END_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 2);?> _TOTAL_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 3);?>",
  966. "infoEmpty": "<?php echo $language->translate('NO_ENTRIES');?>",
  967. "infoFiltered": "<?php echo explosion($language->translate('FILTERED'), 0);?> _MAX_ <?php echo explosion($language->translate('FILTERED'), 1);?>",
  968. "lengthMenu": "<?php echo $language->translate('SHOW');?> _MENU_ <?php echo $language->translate('ENTRIES');?>",
  969. "search": "",
  970. "searchPlaceholder": "<?php echo $language->translate('SEARCH');?>",
  971. "searchClass": "<?php echo $language->translate('SEARCH');?>",
  972. "zeroRecords": "<?php echo $language->translate('NO_MATCHING');?>",
  973. "paginate": {
  974. "next": "<?php echo $language->translate('NEXT');?>",
  975. "previous": "<?php echo $language->translate('PREVIOUS');?>",
  976. }
  977. }
  978. });
  979. });
  980. </script>
  981. <?php if($_POST['op']) : ?>
  982. <script>
  983. parent.notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000");
  984. <?php if(!empty($USER->error_log)) : ?>
  985. parent.notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000");
  986. <?php endif; ?>
  987. </script>
  988. <?php endif; ?>
  989. <?php if($action == "addTabz") : ?>
  990. <script>
  991. if(!window.location.hash) {
  992. window.location = window.location + '#loaded';
  993. window.location.reload();
  994. }else{
  995. parent.notify("<strong>Tabs Saved!</strong> Apply Changes To Reload The Page!","floppy-o","success","5000");
  996. }
  997. </script>
  998. <?php endif; ?>
  999. <?php if($action == "addOptionz") : ?>
  1000. <script>
  1001. parent.notify("<strong>Colors Saved!</strong> Apply Changes To Reload The Page!","floppy-o","success","5000");
  1002. </script>
  1003. <?php endif; ?>
  1004. <script>
  1005. (function($) {
  1006. function startTrigger(e,data) {
  1007. var $elem = $(this);
  1008. $elem.data('mouseheld_timeout', setTimeout(function() {
  1009. $elem.trigger('mouseheld');
  1010. }, e.data));
  1011. }
  1012. function stopTrigger() {
  1013. var $elem = $(this);
  1014. clearTimeout($elem.data('mouseheld_timeout'));
  1015. }
  1016. var mouseheld = $.event.special.mouseheld = {
  1017. setup: function(data) {
  1018. var $this = $(this);
  1019. $this.bind('mousedown', +data || mouseheld.time, startTrigger);
  1020. $this.bind('mouseleave mouseup', stopTrigger);
  1021. },
  1022. teardown: function() {
  1023. var $this = $(this);
  1024. $this.unbind('mousedown', startTrigger);
  1025. $this.unbind('mouseleave mouseup', stopTrigger);
  1026. },
  1027. time: 200 // default to 750ms
  1028. };
  1029. })(jQuery);
  1030. $(function () {
  1031. //$(".todo ul").sortable();
  1032. $(".todo ul").sortable({
  1033. 'containment': 'parent',
  1034. 'opacity': 0.9
  1035. });
  1036. $("#add_tab").on('submit', function (e) {
  1037. e.preventDefault();
  1038. var $toDo = $(this).find('.name-of-todo');
  1039. toDo_name = $toDo.val();
  1040. if (toDo_name.length >= 3) {
  1041. var newid = $('.list-group-item').length + 1;
  1042. $(".todo ul").append(
  1043. '<li id="item-' + newid + '" class="list-group-item gray-bg animated zoomInDown" style="position: relative; left: 0px; top: 0px;"><tab class="content-form form-inline"> <div class="form-group"><div class="action-btns" style="width:calc(100%)"><a class="" style="margin-left: 0px"><span class="fa fa-hand-paper-o"></span></a></div></div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" name="name-' + newid + '" id="name[' + newid + ']" placeholder="<?php echo $language->translate("NEW_TAB_NAME");?>" value="' + toDo_name + '"></div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" name="url-' + newid + '" id="url[' + newid + ']" placeholder="<?php echo $language->translate("TAB_URL");?>"></div> <div style="margin-right: 5px;" class="form-group"><div class="input-group"><input style="width: 100%;" name="icon-' + newid + '" data-placement="bottomRight" class="form-control material icp-auto" value="fa-diamond" type="text" /><span class="input-group-addon"></span></div> - <?php echo $language->translate("OR");?> -</div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" id="iconurl-' + newid + '" name="iconurl-' + newid + '" placeholder="<?php echo $language->translate("ICON_URL");?>" value=""></div> <div class="form-group"> <div class="radio radio-danger"> <input type="radio" name="default" id="default[' + newid + ']" name="default"> <label for="default[' + newid + ']"><?php echo $language->translate("DEFAULT");?></label></div></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-success" value="false" name="active-' + newid + '" type="hidden"><input name="active-' + newid + '" id="active[' + newid + ']" class="switcher switcher-success" type="checkbox" checked=""><label for="active[' + newid + ']"></label></div> <?php echo $language->translate("ACTIVE");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="user-' + newid + '" type="hidden"><input id="user[' + newid + ']" name="user-' + newid + '" class="switcher switcher-primary" type="checkbox" checked=""><label for="user[' + newid + ']"></label></div> <?php echo $language->translate("USER");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="guest-' + newid + '" type="hidden"><input name="guest-' + newid + '" id="guest[' + newid + ']" class="switcher switcher-warning" type="checkbox" checked=""><label for="guest[' + newid + ']"></label></div> <?php echo $language->translate("GUEST");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="window-' + newid + '" type="hidden"><input name="window-' + newid + '" id="window[' + newid + ']" class="switcher switcher-danger" type="checkbox"><label for="window[' + newid + ']"></label></div> <?php echo $language->translate("NO_IFRAME");?></div><div class="pull-right action-btns" style="padding-top: 8px;"><a class="trash"><span class="fa fa-close"></span></a></div></tab></li>'
  1044. );
  1045. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  1046. var eventObject = {
  1047. title: $.trim($("#" + newid).text()),
  1048. className: $("#" + newid).attr("data-bg"),
  1049. stick: true
  1050. };
  1051. $("#" + newid).data('eventObject', eventObject);
  1052. $toDo.val('').focus();
  1053. } else {
  1054. $toDo.focus();
  1055. }
  1056. });
  1057. count();
  1058. $(".list-group-item").addClass("list-item");
  1059. //Remove one completed item
  1060. $(document).on('click', '.trash', function (e) {
  1061. var listItemRemove = $(this).closest(".list-group-item");
  1062. var animation = "zoomOutRight";
  1063. var container = $(this).closest(".list-group-item");
  1064. //container.attr('class', 'list-group-item gray-bg animation-container');
  1065. container.addClass('animated ' + animation);
  1066. setTimeout(function() {
  1067. var clearedCompItem = listItemRemove.remove();
  1068. console.log("removed");
  1069. e.preventDefault();
  1070. count();
  1071. }, 800);
  1072. });
  1073. //Count items
  1074. function count() {
  1075. var active = $('.list-group-item').length;
  1076. $('.total-tabs span').text(active);
  1077. };
  1078. $("#submitTabs").on('submit', function (e) {
  1079. console.log("submitted");
  1080. $("div.radio").each(function(i) {
  1081. $(this).find('input').attr('name', 'default-' + i);
  1082. console.log(i);
  1083. });
  1084. $('form input[type="radio"]').not(':checked').each(function() {
  1085. $(this).prop('checked', true);
  1086. $(this).prop('value', "false");
  1087. console.log("found unchecked");
  1088. });
  1089. });
  1090. $('#apply').on('click touchstart', function(){
  1091. window.parent.location.reload();
  1092. });
  1093. });
  1094. </script>
  1095. <script>
  1096. function rememberTabSelection(tabPaneSelector, useHash) {
  1097. var key = 'selectedTabFor' + tabPaneSelector;
  1098. if(get(key))
  1099. $(tabPaneSelector).find('a[href=' + get(key) + ']').tab('show');
  1100. $(tabPaneSelector).on("click", 'a[data-toggle]', function(event) {
  1101. set(key, this.getAttribute('href'));
  1102. });
  1103. function get(key) {
  1104. return useHash ? location.hash: localStorage.getItem(key);
  1105. }
  1106. function set(key, value){
  1107. if(useHash)
  1108. location.hash = value;
  1109. else
  1110. localStorage.setItem(key, value);
  1111. }
  1112. }
  1113. $("#iconHide").click(function(){
  1114. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).toggle();
  1115. });
  1116. $("#iconAll").click(function(){
  1117. $( "div[id^='viewAllIcons']" ).toggle();
  1118. });
  1119. $(".deleteUser").click(function(){
  1120. var parent_id = $(this).parent().attr('id');
  1121. editUsername = $('#unregister').find('#inputUsername');
  1122. $(editUsername).html('<input type="hidden" name="username"value="' + parent_id + '" />');
  1123. });
  1124. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  1125. $("li[class^='list-group-item']").bind('mouseheld', function(e) {
  1126. $(this).find("span[class^='fa fa-hand-paper-o']").attr("class", "fa fa-hand-grab-o");
  1127. $(this).mouseup(function() {
  1128. $(this).find("span[class^='fa fa-hand-grab-o']").attr("class", "fa fa-hand-paper-o");
  1129. });
  1130. });
  1131. function copyToClipboard(elem) {
  1132. // create hidden text element, if it doesn't already exist
  1133. var targetId = "_hiddenCopyText_";
  1134. var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
  1135. var origSelectionStart, origSelectionEnd;
  1136. if (isInput) {
  1137. // can just use the original source element for the selection and copy
  1138. target = elem;
  1139. origSelectionStart = elem.selectionStart;
  1140. origSelectionEnd = elem.selectionEnd;
  1141. } else {
  1142. // must use a temporary form element for the selection and copy
  1143. target = document.getElementById(targetId);
  1144. if (!target) {
  1145. var target = document.createElement("textarea");
  1146. target.style.position = "absolute";
  1147. target.style.left = "-9999px";
  1148. target.style.top = "0";
  1149. target.id = targetId;
  1150. document.body.appendChild(target);
  1151. }
  1152. target.textContent = elem.textContent;
  1153. }
  1154. // select the content
  1155. var currentFocus = document.activeElement;
  1156. target.focus();
  1157. target.setSelectionRange(0, target.value.length);
  1158. // copy the selection
  1159. var succeed;
  1160. try {
  1161. succeed = document.execCommand("copy");
  1162. } catch(e) {
  1163. succeed = false;
  1164. }
  1165. // restore original focus
  1166. if (currentFocus && typeof currentFocus.focus === "function") {
  1167. //currentFocus.focus();
  1168. }
  1169. if (isInput) {
  1170. // restore prior selection
  1171. elem.setSelectionRange(origSelectionStart, origSelectionEnd);
  1172. } else {
  1173. // clear temporary content
  1174. target.textContent = "";
  1175. }
  1176. return succeed;
  1177. }
  1178. $("img[class^='allIcons']").click(function(){
  1179. $("textarea[id^='copyTarget']").val($(this).attr("src"));
  1180. copyToClipboard(document.getElementById("copyTarget"));
  1181. parent.notify("Icon Path Copied To Clipboard","clipboard","success","5000");
  1182. $( "div[id^='viewAllIcons']" ).toggle();
  1183. });
  1184. </script>
  1185. <script>
  1186. //Custom Themes
  1187. function changeColor(elementName, elementColor) {
  1188. var definedElement = document.getElementById(elementName);
  1189. definedElement.value = elementColor;
  1190. definedElement.style.backgroundColor = elementColor;
  1191. }
  1192. $('#plexTheme').on('click touchstart', function(){
  1193. changeColor("topbartext", "#E49F0C");
  1194. changeColor("topbar", "#000000");
  1195. changeColor("bottombar", "#000000");
  1196. changeColor("sidebar", "#121212");
  1197. changeColor("hoverbg", "#FFFFFF");
  1198. changeColor("activetabBG", "#E49F0C");
  1199. changeColor("activetabicon", "#FFFFFF");
  1200. changeColor("activetabtext", "#FFFFFF");
  1201. changeColor("inactiveicon", "#949494");
  1202. changeColor("inactivetext", "#B8B8B8");
  1203. });
  1204. $('#embyTheme').on('click touchstart', function(){
  1205. changeColor("topbartext", "#52B54B");
  1206. changeColor("topbar", "#212121");
  1207. changeColor("bottombar", "#212121");
  1208. changeColor("sidebar", "#121212");
  1209. changeColor("hoverbg", "#FFFFFF");
  1210. changeColor("activetabBG", "#52B54B");
  1211. changeColor("activetabicon", "#FFFFFF");
  1212. changeColor("activetabtext", "#FFFFFF");
  1213. changeColor("inactiveicon", "#949494");
  1214. changeColor("inactivetext", "#B8B8B8");
  1215. });
  1216. $('#bookTheme').on('click touchstart', function(){
  1217. changeColor("topbartext", "#FFFFFF");
  1218. changeColor("topbar", "#3B5998");
  1219. changeColor("bottombar", "#3B5998");
  1220. changeColor("sidebar", "#8B9DC3");
  1221. changeColor("hoverbg", "#FFFFFF");
  1222. changeColor("activetabBG", "#3B5998");
  1223. changeColor("activetabicon", "#FFFFFF");
  1224. changeColor("activetabtext", "#FFFFFF");
  1225. changeColor("inactiveicon", "#DFE3EE");
  1226. changeColor("inactivetext", "#DFE3EE");
  1227. });
  1228. $('#spaTheme').on('click touchstart', function(){
  1229. changeColor("topbartext", "#5B391E");
  1230. changeColor("topbar", "#66BBAE");
  1231. changeColor("bottombar", "#66BBAE");
  1232. changeColor("sidebar", "#C3EEE7");
  1233. changeColor("hoverbg", "#66BBAE");
  1234. changeColor("activetabBG", "#C6C386");
  1235. changeColor("activetabicon", "#FFFFFF");
  1236. changeColor("activetabtext", "#FFFFFF");
  1237. changeColor("inactiveicon", "#5B391E");
  1238. changeColor("inactivetext", "#5B391E");
  1239. });
  1240. $('#darklyTheme').on('click touchstart', function(){
  1241. changeColor("topbartext", "#FFFFFF");
  1242. changeColor("topbar", "#375A7F");
  1243. changeColor("bottombar", "#375A7F");
  1244. changeColor("sidebar", "#222222");
  1245. changeColor("hoverbg", "#464545");
  1246. changeColor("activetabBG", "#FFFFFF");
  1247. changeColor("activetabicon", "#464545");
  1248. changeColor("activetabtext", "#464545");
  1249. changeColor("inactiveicon", "#0CE3AC");
  1250. changeColor("inactivetext", "#0CE3AC");
  1251. });
  1252. $('#slateTheme').on('click touchstart', function(){
  1253. changeColor("topbartext", "#C8C8C8");
  1254. changeColor("topbar", "#272B30");
  1255. changeColor("bottombar", "#272B30");
  1256. changeColor("sidebar", "#32383E");
  1257. changeColor("hoverbg", "#58C0DE");
  1258. changeColor("activetabBG", "#3E444C");
  1259. changeColor("activetabicon", "#C8C8C8");
  1260. changeColor("activetabtext", "#FFFFFF");
  1261. changeColor("inactiveicon", "#C8C8C8");
  1262. changeColor("inactivetext", "#C8C8C8");
  1263. });
  1264. $('#defaultTheme').on('click touchstart', function(){
  1265. changeColor("topbartext", "#FFFFFF");
  1266. changeColor("topbar", "#eb6363");
  1267. changeColor("bottombar", "#eb6363");
  1268. changeColor("sidebar", "#000000");
  1269. changeColor("hoverbg", "#eb6363");
  1270. changeColor("activetabBG", "#eb6363");
  1271. changeColor("activetabicon", "#FFFFFF");
  1272. changeColor("activetabtext", "#FFFFFF");
  1273. changeColor("inactiveicon", "#FFFFFF");
  1274. changeColor("inactivetext", "#FFFFFF");
  1275. });
  1276. $('#redTheme').on('click touchstart', function(){
  1277. changeColor("topbartext", "#FFFFFF");
  1278. changeColor("topbar", "#eb6363");
  1279. changeColor("bottombar", "#eb6363");
  1280. changeColor("sidebar", "#000000");
  1281. changeColor("hoverbg", "#eb6363");
  1282. changeColor("activetabBG", "#eb6363");
  1283. changeColor("activetabicon", "#FFFFFF");
  1284. changeColor("activetabtext", "#FFFFFF");
  1285. changeColor("inactiveicon", "#FFFFFF");
  1286. changeColor("inactivetext", "#FFFFFF");
  1287. });
  1288. $('#monokaiTheme').on('click touchstart', function(){
  1289. changeColor("topbartext", "#66D9EF");
  1290. changeColor("topbar", "#333333");
  1291. changeColor("bottombar", "#333333");
  1292. changeColor("sidebar", "#393939");
  1293. changeColor("hoverbg", "#AD80FD");
  1294. changeColor("activetabBG", "#F92671");
  1295. changeColor("activetabicon", "#FFFFFF");
  1296. changeColor("activetabtext", "#FFFFFF");
  1297. changeColor("inactiveicon", "#66D9EF");
  1298. changeColor("inactivetext", "#66D9EF");
  1299. });
  1300. $('#thejokerTheme').on('click touchstart', function(){
  1301. changeColor("topbartext", "#CCCCCC");
  1302. changeColor("topbar", "#000000");
  1303. changeColor("bottombar", "#000000");
  1304. changeColor("sidebar", "#121212");
  1305. changeColor("hoverbg", "#CCC6CC");
  1306. changeColor("activetabBG", "#A50CB0");
  1307. changeColor("activetabicon", "#FFFFFF");
  1308. changeColor("activetabtext", "#FFFFFF");
  1309. changeColor("inactiveicon", "#949494");
  1310. changeColor("inactivetext", "#B8B8B8");
  1311. });
  1312. </script>
  1313. <script>
  1314. $( document ).ready(function() {
  1315. $("div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deletelog" method="post"><input type="hidden" name="action" value="deleteLog" /><button class="btn waves btn-labeled btn-danger text-uppercase waves-effect waves-float" type="submit"><span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("PURGE_LOG");?> </button></form>')
  1316. $('[data-toggle="tooltip"]').tooltip();
  1317. rememberTabSelection('#settingsTabs', !localStorage);
  1318. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  1319. $.ajax({
  1320. type: "GET",
  1321. url: "https://api.github.com/repos/causefx/Organizr/releases/latest",
  1322. dataType: "json",
  1323. success: function(github) {
  1324. var currentVersion = "0.9999";
  1325. var githubVersion = github.tag_name;
  1326. var githubDescription = github.body;
  1327. var githubName = github.name;
  1328. infoTabVersion = $('#about').find('#version');
  1329. infoTabNew = $('#about').find('#whatsnew');
  1330. infoTabDownload = $('#about').find('#downloadnow');
  1331. if(currentVersion < githubVersion){
  1332. console.log("You Need To Upgrade");
  1333. parent.notify("<strong><?php echo $language->translate("NEW_VERSION");?></strong> <?php echo $language->translate("CLICK_INFO");?>","arrow-circle-o-down","warning","50000");
  1334. $(infoTabNew).html("<br/><h4><strong><?php echo $language->translate("WHATS_NEW");?> " + githubVersion + "</strong></h4><strong><?php echo $language->translate("TITLE");?>: </strong>" + githubName + " <br/><strong><?php echo $language->translate("CHANGES");?>: </strong>" + githubDescription);
  1335. $(infoTabDownload).html("<br/><form style=\"display:initial;\" id=\"deletedb\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"upgrade\" /><button class=\"btn waves btn-labeled btn-success text-uppercase waves-effect waves-float\" type=\"submit\"><span class=\"btn-label\"><i class=\"fa fa-refresh\"></i></span><?php echo $language->translate("AUTO_UPGRADE");?></button></form> <a href='https://github.com/causefx/Organizr/archive/master.zip' target='_blank' type='button' class='btn waves btn-labeled btn-success text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-download'></i></span>Organizr v." + githubVersion + "</a>");
  1336. $( "p[id^='upgrade']" ).toggle();
  1337. }else if(currentVersion === githubVersion){
  1338. console.log("You Are on Current Version");
  1339. parent.notify("<?php echo $language->translate("SOFTWARE_IS");?> <strong><?php echo $language->translate("UP_TO_DATE");?></strong>","thumbs-up ","success","5000");
  1340. }else{
  1341. console.log("something went wrong");
  1342. parent.notify("<strong>WTF!? </strong>Can\'t check version.","thumbs-down","error","5000");
  1343. }
  1344. $(infoTabVersion).html("<strong><?php echo $language->translate("INSTALLED_VERSION");?>: </strong>" + currentVersion + " <strong><?php echo $language->translate("CURRENT_VERSION");?>: </strong>" + githubVersion + " <strong><?php echo $language->translate("DATABASE_PATH");?>: </strong> <?php echo htmlentities(DATABASE_LOCATION);?>");
  1345. }
  1346. });
  1347. <?php if(file_exists(FAIL_LOG)) : ?>
  1348. goodCount = $('#loginStats').find('#goodCount');
  1349. goodPercent = $('#loginStats').find('#goodPercent');
  1350. goodTitle = $('#loginStats').find('#goodTitle');
  1351. badCount = $('#loginStats').find('#badCount');
  1352. badPercent = $('#loginStats').find('#badPercent');
  1353. badTitle = $('#loginStats').find('#badTitle');
  1354. $(goodCount).html("<?php echo $goodLogin;?>");
  1355. $(goodTitle).html("<?php echo $goodPercent;?>%");
  1356. $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");
  1357. $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");
  1358. $(badCount).html("<?php echo $badLogin;?>");
  1359. $(badTitle).html("<?php echo $badPercent;?>%");
  1360. $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");
  1361. $(badPercent).attr('style', "width: <?php echo $badPercent;?>%");
  1362. <?php endif; ?>
  1363. });
  1364. </script>
  1365. </body>
  1366. </html>