settings.php 157 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593
  1. <?php
  2. $data = false;
  3. ini_set("display_errors", 1);
  4. ini_set("error_reporting", E_ALL | E_STRICT);
  5. require_once("user.php");
  6. require_once("functions.php");
  7. $USER = new User("registration_callback");
  8. if(!$USER->authenticated) :
  9. header( 'Location: error.php?error=999' );
  10. elseif($USER->authenticated && $USER->role !== "admin") :
  11. header( 'Location: error.php?error=401' );
  12. endif;
  13. $dbfile = DATABASE_LOCATION.'users.db';
  14. $databaseLocation = "databaseLocation.ini.php";
  15. $homepageSettings = "homepageSettings.ini.php";
  16. $userdirpath = USER_HOME;
  17. $userdirpath = substr_replace($userdirpath, "", -1);
  18. $file_db = new PDO("sqlite:" . $dbfile);
  19. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  20. $getUsers = $file_db->query('SELECT * FROM users');
  21. $gotUsers = $file_db->query('SELECT * FROM users');
  22. $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
  23. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  24. $tabSetup = "Yes";
  25. $hasOptions = "No";
  26. foreach($dbTab as $row) :
  27. if (in_array("tabs", $row)) :
  28. $tabSetup = "No";
  29. endif;
  30. endforeach;
  31. foreach($dbOptions as $row) :
  32. if (in_array("options", $row)) :
  33. $hasOptions = "Yes";
  34. endif;
  35. endforeach;
  36. if($hasOptions == "No") :
  37. $title = "Organizr";
  38. $topbar = "#333333";
  39. $topbartext = "#66D9EF";
  40. $bottombar = "#333333";
  41. $sidebar = "#393939";
  42. $hoverbg = "#AD80FD";
  43. $activetabBG = "#F92671";
  44. $activetabicon = "#FFFFFF";
  45. $activetabtext = "#FFFFFF";
  46. $inactiveicon = "#66D9EF";
  47. $inactivetext = "#66D9EF";
  48. $loading = "#66D9EF";
  49. $hovertext = "#000000";
  50. endif;
  51. if($tabSetup == "No") :
  52. $result = $file_db->query('SELECT * FROM tabs');
  53. endif;
  54. if($hasOptions == "Yes") :
  55. $resulto = $file_db->query('SELECT * FROM options');
  56. endif;
  57. if($hasOptions == "Yes") :
  58. foreach($resulto as $row) :
  59. $title = isset($row['title']) ? $row['title'] : "Organizr";
  60. $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF";
  61. $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333";
  62. $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333";
  63. $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939";
  64. $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD";
  65. $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671";
  66. $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF";
  67. $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF";
  68. $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF";
  69. $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF";
  70. $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF";
  71. $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000";
  72. endforeach;
  73. endif;
  74. $action = "";
  75. if(isset($_POST['action'])) :
  76. $action = $_POST['action'];
  77. endif;
  78. if($action == "deleteDB") :
  79. unset($_COOKIE['Organizr']);
  80. setcookie('Organizr', '', time() - 3600, '/');
  81. unset($_COOKIE['OrganizrU']);
  82. setcookie('OrganizrU', '', time() - 3600, '/');
  83. $file_db = null;
  84. unlink($dbfile);
  85. foreach(glob($userdirpath . '/*') as $file) :
  86. if(is_dir($file)) :
  87. rmdir($file);
  88. elseif(!is_dir($file)) :
  89. unlink($file);
  90. endif;
  91. endforeach;
  92. rmdir($userdirpath);
  93. echo "<script>window.parent.location.reload();</script>";
  94. endif;
  95. if($action == "deleteLog") :
  96. unlink(FAIL_LOG);
  97. echo "<script type='text/javascript'>window.location.replace('settings.php');</script>";
  98. endif;
  99. if($action == "upgrade") :
  100. function downloadFile($url, $path){
  101. $folderPath = "upgrade/";
  102. if(!mkdir($folderPath)) : echo "can't make dir"; endif;
  103. $newfname = $folderPath . $path;
  104. $file = fopen ($url, 'rb');
  105. if ($file) {
  106. $newf = fopen ($newfname, 'wb');
  107. if ($newf) {
  108. while(!feof($file)) {
  109. fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
  110. }
  111. }
  112. }
  113. if ($file) {
  114. fclose($file);
  115. }
  116. if ($newf) {
  117. fclose($newf);
  118. }
  119. }
  120. function unzipFile($zipFile){
  121. $zip = new ZipArchive;
  122. $extractPath = "upgrade/";
  123. if($zip->open($extractPath . $zipFile) != "true"){
  124. echo "Error :- Unable to open the Zip File";
  125. }
  126. /* Extract Zip File */
  127. $zip->extractTo($extractPath);
  128. $zip->close();
  129. }
  130. // Function to remove folders and files
  131. function rrmdir($dir) {
  132. if (is_dir($dir)) {
  133. $files = scandir($dir);
  134. foreach ($files as $file)
  135. if ($file != "." && $file != "..") rrmdir("$dir/$file");
  136. rmdir($dir);
  137. }
  138. else if (file_exists($dir)) unlink($dir);
  139. }
  140. // Function to Copy folders and files
  141. function rcopy($src, $dst) {
  142. if (is_dir ( $src )) {
  143. if (!file_exists($dst)) : mkdir ( $dst ); endif;
  144. $files = scandir ( $src );
  145. foreach ( $files as $file )
  146. if ($file != "." && $file != "..")
  147. rcopy ( "$src/$file", "$dst/$file" );
  148. } else if (file_exists ( $src ))
  149. copy ( $src, $dst );
  150. }
  151. $url = "https://github.com/causefx/Organizr/archive/master.zip";
  152. $file = "upgrade.zip";
  153. $source = __DIR__ . "/upgrade/Organizr-master/";
  154. $cleanup = __DIR__ . "/upgrade/";
  155. $destination = __DIR__ . "/";
  156. downloadFile($url, $file);
  157. unzipFile($file);
  158. rcopy($source, $destination);
  159. rrmdir($cleanup);
  160. echo "<script>top.location.href = 'index.php#upgrade';</script>";
  161. endif;
  162. if($action == 'createLocation' || $action == 'homepageSettings') {
  163. unset($_POST['action']);
  164. updateConfig($_POST);
  165. echo "<script>parent.notify('<strong>".$language->translate("SETTINGS_SAVED")."</strong>','floppy-o','success','5000', '$notifyExplode[0]', '$notifyExplode[1]');</script>";
  166. echo "<script>setTimeout(function() {window.location.href = window.location.href},1500);</script>";
  167. }
  168. if(!isset($_POST['op'])) :
  169. $_POST['op'] = "";
  170. endif;
  171. if($action == "addTabz") :
  172. if($tabSetup == "No") :
  173. $file_db->exec("DELETE FROM tabs");
  174. endif;
  175. if($tabSetup == "Yes") :
  176. $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)");
  177. endif;
  178. $addTabName = array();
  179. $addTabUrl = array();
  180. $addTabIcon = array();
  181. $addTabIconUrl = array();
  182. $addTabDefault = array();
  183. $addTabActive = array();
  184. $addTabUser = array();
  185. $addTabGuest = array();
  186. $addTabWindow = array();
  187. $buildArray = array();
  188. foreach ($_POST as $key => $value) :
  189. $trueKey = explode('-', $key);
  190. if ($value == "on") :
  191. $value = "true";
  192. endif;
  193. if($trueKey[0] == "name"):
  194. array_push($addTabName, $value);
  195. endif;
  196. if($trueKey[0] == "url"):
  197. array_push($addTabUrl, $value);
  198. endif;
  199. if($trueKey[0] == "icon"):
  200. array_push($addTabIcon, $value);
  201. endif;
  202. if($trueKey[0] == "iconurl"):
  203. array_push($addTabIconUrl, $value);
  204. endif;
  205. if($trueKey[0] == "default"):
  206. array_push($addTabDefault, $value);
  207. endif;
  208. if($trueKey[0] == "active"):
  209. array_push($addTabActive, $value);
  210. endif;
  211. if($trueKey[0] == "user"):
  212. array_push($addTabUser, $value);
  213. endif;
  214. if($trueKey[0] == "guest"):
  215. array_push($addTabGuest, $value);
  216. endif;
  217. if($trueKey[0] == "window"):
  218. array_push($addTabWindow, $value);
  219. endif;
  220. endforeach;
  221. $tabArray = 0;
  222. if(count($addTabName) > 0) :
  223. foreach(range(1,count($addTabName)) as $index) :
  224. if(!isset($addTabDefault[$tabArray])) :
  225. $tabDefault = "false";
  226. else :
  227. $tabDefault = $addTabDefault[$tabArray];
  228. endif;
  229. $buildArray[] = array('name' => $addTabName[$tabArray],
  230. 'url' => $addTabUrl[$tabArray],
  231. 'defaultz' => $tabDefault,
  232. 'active' => $addTabActive[$tabArray],
  233. 'user' => $addTabUser[$tabArray],
  234. 'guest' => $addTabGuest[$tabArray],
  235. 'icon' => $addTabIcon[$tabArray],
  236. 'window' => $addTabWindow[$tabArray],
  237. 'iconurl' => $addTabIconUrl[$tabArray]);
  238. $tabArray++;
  239. endforeach;
  240. endif;
  241. $insert = "INSERT INTO tabs (name, url, defaultz, active, user, guest, icon, iconurl, window)
  242. VALUES (:name, :url, :defaultz, :active, :user, :guest, :icon, :iconurl, :window)";
  243. $stmt = $file_db->prepare($insert);
  244. $stmt->bindParam(':name', $name);
  245. $stmt->bindParam(':url', $url);
  246. $stmt->bindParam(':defaultz', $defaultz);
  247. $stmt->bindParam(':active', $active);
  248. $stmt->bindParam(':user', $user);
  249. $stmt->bindParam(':guest', $guest);
  250. $stmt->bindParam(':icon', $icon);
  251. $stmt->bindParam(':iconurl', $iconurl);
  252. $stmt->bindParam(':window', $window);
  253. foreach ($buildArray as $t) :
  254. $name = $t['name'];
  255. $url = $t['url'];
  256. $defaultz = $t['defaultz'];
  257. $active = $t['active'];
  258. $user = $t['user'];
  259. $guest = $t['guest'];
  260. $icon = $t['icon'];
  261. $iconurl = $t['iconurl'];
  262. $window = $t['window'];
  263. $stmt->execute();
  264. endforeach;
  265. endif;
  266. if($action == "addOptionz") :
  267. if($hasOptions == "Yes") :
  268. $file_db->exec("DELETE FROM options");
  269. endif;
  270. if($hasOptions == "No") :
  271. $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, loading TEXT, hovertext TEXT)");
  272. endif;
  273. $title = $_POST['title'];
  274. $topbartext = $_POST['topbartext'];
  275. $topbar = $_POST['topbar'];
  276. $bottombar = $_POST['bottombar'];
  277. $sidebar = $_POST['sidebar'];
  278. $hoverbg = $_POST['hoverbg'];
  279. $hovertext = $_POST['hovertext'];
  280. $activetabBG = $_POST['activetabBG'];
  281. $activetabicon = $_POST['activetabicon'];
  282. $activetabtext = $_POST['activetabtext'];
  283. $inactiveicon = $_POST['inactiveicon'];
  284. $inactivetext = $_POST['inactivetext'];
  285. $loading = $_POST['loading'];
  286. $insert = "INSERT INTO options (title, topbartext, topbar, bottombar, sidebar, hoverbg, activetabBG, activetabicon, activetabtext, inactiveicon, inactivetext, loading, hovertext)
  287. VALUES (:title, :topbartext, :topbar, :bottombar, :sidebar, :hoverbg, :activetabBG, :activetabicon , :activetabtext , :inactiveicon, :inactivetext, :loading, :hovertext)";
  288. $stmt = $file_db->prepare($insert);
  289. $stmt->bindParam(':title', $title);
  290. $stmt->bindParam(':topbartext', $topbartext);
  291. $stmt->bindParam(':topbar', $topbar);
  292. $stmt->bindParam(':bottombar', $bottombar);
  293. $stmt->bindParam(':sidebar', $sidebar);
  294. $stmt->bindParam(':hoverbg', $hoverbg);
  295. $stmt->bindParam(':activetabBG', $activetabBG);
  296. $stmt->bindParam(':activetabicon', $activetabicon);
  297. $stmt->bindParam(':activetabtext', $activetabtext);
  298. $stmt->bindParam(':inactiveicon', $inactiveicon);
  299. $stmt->bindParam(':inactivetext', $inactivetext);
  300. $stmt->bindParam(':loading', $loading);
  301. $stmt->bindParam(':hovertext', $hovertext);
  302. $stmt->execute();
  303. endif;
  304. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  305. ?>
  306. <!DOCTYPE html>
  307. <html lang="en" class="no-js">
  308. <head>
  309. <meta charset="UTF-8">
  310. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  311. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  312. <meta name="msapplication-tap-highlight" content="no" />
  313. <title>Settings</title>
  314. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  315. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  316. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
  317. <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
  318. <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css">
  319. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  320. <link rel="stylesheet" href="js/selects/cs-select.css">
  321. <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
  322. <link href="bower_components/iconpick/dist/css/fontawesome-iconpicker.min.css" rel="stylesheet">
  323. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css">
  324. <link rel="stylesheet" href="bower_components/sweetalert/dist/sweetalert.css">
  325. <link rel="stylesheet" href="bower_components/smoke/dist/css/smoke.min.css">
  326. <script src="js/menu/modernizr.custom.js"></script>
  327. <script type="text/javascript" src="js/sha1.js"></script>
  328. <script type="text/javascript" src="js/user.js"></script>
  329. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  330. <link rel="stylesheet" href="bower_components/DataTables/media/css/jquery.dataTables.css">
  331. <link rel="stylesheet" href="bower_components/datatables-tabletools/css/dataTables.tableTools.css">
  332. <link rel="stylesheet" href="bower_components/numbered/jquery.numberedtextarea.css">
  333. <link rel="stylesheet" href="css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  334. <link href="css/jquery.filer.css" rel="stylesheet">
  335. <link href="css/jquery.filer-dragdropbox-theme.css" rel="stylesheet">
  336. <!--[if lt IE 9]>
  337. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  338. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  339. <![endif]-->
  340. <!--Scripts-->
  341. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  342. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  343. <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
  344. <script src="bower_components/Waves/dist/waves.min.js"></script>
  345. <script src="bower_components/moment/min/moment.min.js"></script>
  346. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  347. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  348. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  349. <script src="bower_components/cta/dist/cta.min.js"></script>
  350. <!--Menu-->
  351. <script src="js/menu/classie.js"></script>
  352. <script src="bower_components/iconpick/dist/js/fontawesome-iconpicker.js"></script>
  353. <!--Selects-->
  354. <script src="js/selects/selectFx.js"></script>
  355. <script src="js/jscolor.js"></script>
  356. <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script>
  357. <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
  358. <script src="bower_components/numbered/jquery.numberedtextarea.js"></script>
  359. <!--Notification-->
  360. <script src="js/notifications/notificationFx.js"></script>
  361. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  362. <script src="js/jquery.filer.min.js" type="text/javascript"></script>
  363. <script src="js/custom.js?v=<?php echo INSTALLEDVERSION; ?>" type="text/javascript"></script>
  364. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  365. <!--Data Tables-->
  366. <script src="bower_components/DataTables/media/js/jquery.dataTables.js"></script>
  367. <script src="bower_components/datatables.net-responsive/js/dataTables.responsive.js"></script>
  368. <script src="bower_components/datatables-tabletools/js/dataTables.tableTools.js"></script>
  369. </head>
  370. <body class="scroller-body" style="padding: 0; background: #273238; overflow: hidden">
  371. <style>
  372. @media screen and (max-width:737px){
  373. .email-body{width: 100%; overflow: auto;}
  374. .email-content, .email-new {
  375. -webkit-overflow-scrolling: touch;
  376. -webkit-transform: translateZ(0);
  377. overflow: scroll;
  378. position: fixed;
  379. height:100% !important;
  380. margin-top:0;
  381. }.email-content .email-header, .email-new .email-header{
  382. padding: 10px 30px;
  383. z-index: 1000;
  384. }
  385. }@media screen and (min-width:737px){
  386. .email-body{width: 100%}
  387. .email-content .close-button, .email-content .email-actions, .email-new .close-button, .email-new .email-actions {
  388. position: relative;
  389. top: 15px;
  390. right: 0px;
  391. float: right;
  392. }.email-inner-section {
  393. margin-top: 50px;
  394. }.email-content, .email-new {
  395. overflow: auto;
  396. margin-top: 0;
  397. height: 100%;
  398. position: fixed;
  399. max-width: 100%;
  400. width: 84%;
  401. right: -84%;
  402. }.email-content .email-header, .email-new .email-header{
  403. position: fixed;
  404. padding: 10px 30px;
  405. width: 84%;
  406. z-index: 1000;
  407. }
  408. }ul.inbox-nav.nav {
  409. background: white;
  410. padding: 5px;
  411. border-radius: 5px;
  412. }.profile-usermenu ul li.active a {
  413. border-left: 3px solid <?=$activetabBG;?> !important;
  414. padding-left: 12px;
  415. }.profile-usermenu ul li a:hover {
  416. background: <?=$hoverbg;?> !important;
  417. color: <?=$hovertext;?> !important;
  418. cursor: pointer;
  419. }input.form-control.material.icp-auto.iconpicker-element.iconpicker-input {
  420. display: none;
  421. }input.form-control.iconpicker-search {
  422. color: black;
  423. }.key {
  424. font-family:Tahoma, sans-serif;
  425. border-style:solid;
  426. border-color:#D5D6AD #C1C1A8 #CDCBA5 #E7E5C5;
  427. border-width:2px 3px 8px 3px;
  428. background:#D6D4B4;
  429. display:inline-block;
  430. border-radius:5px;
  431. margin:3px;
  432. text-align:center;
  433. }.form-control.material {
  434. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  435. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  436. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  437. }.key span {
  438. background:#ECEECA;
  439. color:#5D5E4F;
  440. display:block;
  441. font-size:12px;
  442. padding:0 2px;
  443. border-radius:3px;
  444. width:14px;
  445. height:18px;
  446. line-height:18px;
  447. text-align:center;
  448. font-weight:bold;
  449. letter-spacing:1px;
  450. text-transform:uppercase;
  451. }.key.wide span {
  452. width:auto;
  453. padding:0 12px;
  454. }.dragging{
  455. border: 2px solid;
  456. }.todo .action-btns a span {
  457. color: #76828e !important;
  458. }.todo li:nth-child(even) {
  459. background: #FFFFFF !important;
  460. }.themeImage {
  461. position: fixed;
  462. left: 160px;
  463. top: 0px;
  464. height: 400px;
  465. }.chooseTheme a span {
  466. position:absolute; display:none; z-index:99;
  467. }.chooseTheme a:hover span {
  468. display:block;
  469. }ul.nav.nav-tabs.apps {
  470. border: solid;
  471. border-top: 0;
  472. border-left: 0;
  473. border-right: 0;
  474. border-radius: 0;
  475. }li.apps.active {
  476. border: solid;
  477. border-bottom: 0;
  478. border-radius: 5px;
  479. top: 3px;
  480. }<?php if(CUSTOMCSS == "true") :
  481. $template_file = "custom.css";
  482. $file_handle = fopen($template_file, "rb");
  483. echo fread($file_handle, filesize($template_file));
  484. fclose($file_handle);
  485. echo "\n";
  486. endif; ?>
  487. </style>
  488. <div id="main-wrapper" class="main-wrapper">
  489. <!--Content-->
  490. <div id="content" style="margin:0 10px; overflow:hidden">
  491. <br/>
  492. <div id="versionCheck"></div>
  493. <div class="row">
  494. <div class="col-lg-2">
  495. <?php if($action) : ?>
  496. <button id="apply" style="width: 100%" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">
  497. <?php echo $language->translate("APPLY_CHANGES");?>
  498. </button>
  499. <?php endif; ?>
  500. <div class="content-box profile-sidebar box-shadow">
  501. <img src="images/organizr-logo-h-d.png" width="100%" style="margin-top: -10px;">
  502. <div class="profile-usermenu">
  503. <ul class="nav" id="settings-list">
  504. <li class=""><a id="open-tabs"><i class="fa fa-list red-orange"></i>Edit Tabs</a></li>
  505. <li class=""><a id="open-colors"><i class="fa fa-paint-brush green"></i>Edit Colors</a></li>
  506. <li><a id="open-users"><i class="fa fa-user red"></i>Manage Users</a></li>
  507. <li><a id="open-logs"><i class="fa fa-file-text-o blue"></i>View Logs</a></li>
  508. <li><a id="open-homepage"><i class=" fa fa-home yellow"></i>Edit Homepage</a></li>
  509. <li><a id="open-advanced"><i class=" fa fa-cog light-blue"></i>Advanced</a></li>
  510. <li><a id="open-info"><i class=" fa fa-info orange"></i>&nbsp; About</a></li>
  511. </ul>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="col-lg-10">
  516. </div>
  517. </div>
  518. <div class="email-content tab-box white-bg">
  519. <div class="email-body">
  520. <div class="email-header gray-bg">
  521. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  522. <h1>Edit Tabs</h1>
  523. </div>
  524. <div class="email-inner small-box">
  525. <div class="email-inner-section">
  526. <div class="small-box todo-list fade in" id="tab-tabs">
  527. <div class="sort-todo">
  528. <a class="total-tabs"><?php echo $language->translate("TABS");?> <span class="badge gray-bg"></span></a>
  529. <button id="iconHide" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  530. <span class="btn-label"><i class="fa fa-upload"></i></span><?php echo $language->translate("UPLOAD_ICONS");?>
  531. </button>
  532. <button id="iconAll" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  533. <span class="btn-label"><i class="fa fa-picture-o"></i></span><?php echo $language->translate("VIEW_ICONS");?>
  534. </button>
  535. </div>
  536. <input type="file" name="files[]" id="uploadIcons" multiple="multiple">
  537. <div id="viewAllIcons" style="display: none;">
  538. <h4><strong><?php echo $language->translate("ALL_ICONS");?></strong> [<?php echo $language->translate("CLICK_ICON");?>]</h4>
  539. <div class="row">
  540. <textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
  541. <?php
  542. $dirname = "images/";
  543. $images = scandir($dirname);
  544. $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store", "confused.png", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg", "login.png", "themes", "nadaplaying.jpg", "organizr-logo-h-d.png", "organizr-logo-h.png");
  545. foreach($images as $curimg){
  546. if(!in_array($curimg, $ignore)) { ?>
  547. <div class="col-xs-2" style="width: 75px; height: 75px; padding-right: 0px;">
  548. <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);">
  549. <img style="width: 50px; height: 50px;" src="<?=$dirname.$curimg;?>" alt="thumbnail" class="allIcons">
  550. </a>
  551. </div>
  552. <?php } } ?>
  553. </div>
  554. </div>
  555. <form id="add_tab" method="post">
  556. <div class="form-group add-tab">
  557. <div class="input-group">
  558. <div class="input-group-addon">
  559. <i class="fa fa-pencil gray"></i>
  560. </div>
  561. <input type="text" class="form-control name-of-todo" placeholder="<?php echo $language->translate("TYPE_HIT_ENTER");?>" style="border-top-left-radius: 0;
  562. border-bottom-left-radius: 0;">
  563. </div>
  564. </div>
  565. </form>
  566. <div class="panel">
  567. <form id="submitTabs" method="post">
  568. <div class="panel-body todo">
  569. <input type="hidden" name="action" value="addTabz" />
  570. <ul class="list-group ui-sortable">
  571. <?php if($tabSetup == "No") : $tabNum = 1;
  572. foreach($result as $row) :
  573. if($row['defaultz'] == "true") : $default = "checked"; else : $default = ""; endif;
  574. if($row['active'] == "true") : $activez = "checked"; else : $activez = ""; endif;
  575. if($row['guest'] == "true") : $guestz = "checked"; else : $guestz = ""; endif;
  576. if($row['user'] == "true") : $userz = "checked"; else : $userz = ""; endif;
  577. if($row['window'] == "true") : $windowz = "checked"; else : $windowz = ""; endif;
  578. if($row['iconurl'] != "") : $backgroundListImage = "background-image: url('". $row['iconurl'] . "') !important; background-repeat: no-repeat !important; background-position: left !important; background-blend-mode: difference !important; background-size: 50px 50px !important"; else : $backgroundListImage = ""; endif;
  579. ?>
  580. <li id="item-<?=$tabNum;?>" class="list-group-item" style="position: relative; left: 0px; top: 0px;">
  581. <tab class="content-form form-inline">
  582. <div class="form-group">
  583. <div class="action-btns tabIconView" style="width:calc(100%)">
  584. <?php if($backgroundListImage == "") : ?>
  585. <a class="" style="margin-left: 0px"><span style="font: normal normal normal 30px/1 FontAwesome;" class="fa fa-hand-paper-o"></span></a>
  586. <?php endif; ?>
  587. <?php if($backgroundListImage != "") : ?>
  588. <a class="" style="margin-left: 0px"><span style="display: none; font: normal normal normal 30px/1 FontAwesome;" class="fa fa-hand-paper-o"></span></a>
  589. <a class="" style="margin-left: 0px"><span style=""><img style="height: 30px; width: 30px" src="<?=$row['iconurl']?>"></span></a>
  590. <?php endif; ?>
  591. </div>
  592. </div>
  593. <div class="form-group">
  594. <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'];?>">
  595. </div>
  596. <div class="form-group">
  597. <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']?>">
  598. </div>
  599. <div style="margin-right: 5px;" class="form-group">
  600. <div class="input-group">
  601. <input data-placement="bottomRight" class="form-control material icp-auto" name="icon-<?=$tabNum;?>" value="<?=$row['icon'];?>" type="text" />
  602. <span class="input-group-addon"></span>
  603. </div>
  604. - <?php echo $language->translate("OR");?> -
  605. </div>
  606. <div class="form-group">
  607. <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']?>">
  608. </div>
  609. <div class="form-group">
  610. <div class="radio radio-danger">
  611. <input type="radio" id="default[<?=$tabNum;?>]" value="true" name="default" <?=$default;?>>
  612. <label for="default[<?=$tabNum;?>]"><?php echo $language->translate("DEFAULT");?></label>
  613. </div>
  614. </div>
  615. <div class="form-group">
  616. <div class="">
  617. <input id="" class="switcher switcher-success" value="false" name="active-<?=$tabNum;?>" type="hidden">
  618. <input id="active[<?=$tabNum;?>]" class="switcher switcher-success" name="active-<?=$tabNum;?>" type="checkbox" <?=$activez;?>>
  619. <label for="active[<?=$tabNum;?>]"></label>
  620. </div>
  621. <?php echo $language->translate("ACTIVE");?>
  622. </div>
  623. <div class="form-group">
  624. <div class="">
  625. <input id="" class="switcher switcher-primary" value="false" name="user-<?=$tabNum;?>" type="hidden">
  626. <input id="user[<?=$tabNum;?>]" class="switcher switcher-primary" name="user-<?=$tabNum;?>" type="checkbox" <?=$userz;?>>
  627. <label for="user[<?=$tabNum;?>]"></label>
  628. </div>
  629. <?php echo $language->translate("USER");?>
  630. </div>
  631. <div class="form-group">
  632. <div class="">
  633. <input id="" class="switcher switcher-primary" value="false" name="guest-<?=$tabNum;?>" type="hidden">
  634. <input id="guest[<?=$tabNum;?>]" class="switcher switcher-warning" name="guest-<?=$tabNum;?>" type="checkbox" <?=$guestz;?>>
  635. <label for="guest[<?=$tabNum;?>]"></label>
  636. </div>
  637. <?php echo $language->translate("GUEST");?>
  638. </div>
  639. <div class="form-group">
  640. <div class="">
  641. <input id="" class="switcher switcher-primary" value="false" name="window-<?=$tabNum;?>" type="hidden">
  642. <input id="window[<?=$tabNum;?>]" class="switcher switcher-danger" name="window-<?=$tabNum;?>" type="checkbox" <?=$windowz;?>>
  643. <label for="window[<?=$tabNum;?>]"></label>
  644. </div>
  645. <?php echo $language->translate("NO_IFRAME");?>
  646. </div>
  647. <div class="pull-right action-btns" style="padding-top: 8px;">
  648. <a class="trash"><span class="fa fa-trash"></span></a>
  649. </div>
  650. </tab>
  651. </li>
  652. <?php $tabNum ++; endforeach; endif;?>
  653. </ul>
  654. </div>
  655. <div class="checkbox clear-todo pull-left"></div>
  656. <button style="margin-top: 5px;" class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  657. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_TABS");?>
  658. </button>
  659. </form>
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. </div>
  665. </div>
  666. <div class="email-content color-box white-bg">
  667. <div class="email-body">
  668. <div class="email-header gray-bg">
  669. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  670. <h1>Color Settings</h1>
  671. </div>
  672. <div class="email-inner small-box">
  673. <div class="email-inner-section">
  674. <div class="small-box fade in" id="customedit">
  675. <form id="add_optionz" method="post">
  676. <input type="hidden" name="action" value="addOptionz" />
  677. <div class="btn-group">
  678. <button type="button" class="btn btn-dark dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  679. <?php echo $language->translate("CHOOSE_THEME");?> <span class="caret"></span>
  680. </button>
  681. <ul class="dropdown-menu gray-bg">
  682. <li class="chooseTheme" id="plexTheme" style="border: 1px #FFFFFF; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex<span><img class="themeImage" src="images/themes/plex.png"></span></a></li>
  683. <li class="chooseTheme" id="newPlexTheme" style="border: 1px #E5A00D; border-style: groove; background: #282A2D; border-radius: 5px; margin: 5px;"><a style="color: #E5A00D !important;" href="#">New Plex<span><img class="themeImage" src="images/themes/newplex.png"></span></a></li>
  684. <li class="chooseTheme" id="embyTheme" style="border: 1px #FFFFFF; border-style: groove; background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby<span><img class="themeImage" src="images/themes/emby.png"></span></a></li>
  685. <li class="chooseTheme" id="bookTheme" style="border: 1px #FFFFFF; border-style: groove; background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook<span><img class="themeImage" src="images/themes/facebook.png"></span></a></li>
  686. <li class="chooseTheme" id="spaTheme" style="border: 1px #66BBAE; border-style: groove; background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa<span><img class="themeImage" src="images/themes/spa.png"></span></a></li>
  687. <li class="chooseTheme" id="darklyTheme" style="border: 1px #464545; border-style: groove; background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly<span><img class="themeImage" src="images/themes/darkly.png"></span></a></li>
  688. <li class="chooseTheme" id="slateTheme" style="border: 1px #58C0DE; border-style: groove; background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate<span><img class="themeImage" src="images/themes/slate.png"></span></a></li>
  689. <li class="chooseTheme" id="monokaiTheme" style="border: 1px #AD80FD; border-style: groove; background: #333333; border-radius: 5px; margin: 5px;"><a style="color: #66D9EF !important;" href="#">Monokai<span><img class="themeImage" src="images/themes/monokai.png"></span></a></li>
  690. <li class="chooseTheme" id="thejokerTheme" style="border: 1px #CCC6CC; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #CCCCCC !important;" href="#">The Joker<span><img class="themeImage" src="images/themes/joker.png"></span></a></li>
  691. <li class="chooseTheme" id="redTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Original Red<span><img class="themeImage" src="images/themes/original.png"></span></a></li>
  692. </ul>
  693. </div>
  694. <button id="editCssButton" class="btn waves btn-labeled btn-primary btn-sm text-uppercase waves-effect waves-float" type="button">
  695. <span class="btn-label"><i class="fa fa-css3"></i></span><?php echo $language->translate("EDIT_CUSTOM_CSS");?>
  696. </button>
  697. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  698. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_OPTIONS");?>
  699. </button>
  700. <div class="big-box grids">
  701. <div class="row show-grids col-lg-12">
  702. <h4><strong><?php echo $language->translate("TITLE");?></strong></h4>
  703. <div class="col-md-4 gray-bg">
  704. <center><?php echo $language->translate("TITLE");?></center>
  705. <input name="title" class="form-control gray" value="<?=$title;?>" placeholder="Organizr">
  706. </div>
  707. <div class="col-md-4 gray-bg">
  708. <center><?php echo $language->translate("TITLE_TEXT");?></center>
  709. <input name="topbartext" id="topbartext" class="form-control jscolor {hash:true}" value="<?=$topbartext;?>">
  710. </div>
  711. <div class="col-md-4 gray-bg">
  712. <center><?php echo $language->translate("LOADING_COLOR");?></center>
  713. <input name="loading" id="loading" class="form-control jscolor {hash:true}" value="<?=$loading;?>">
  714. </div>
  715. </div>
  716. <div class="row show-grids col-lg-12">
  717. <h4><strong><?php echo $language->translate("NAVIGATION_BARS");?></strong></h4>
  718. <div class="col-md-4 gray-bg">
  719. <center><?php echo $language->translate("TOP_BAR");?></center>
  720. <input name="topbar" id="topbar" class="form-control jscolor {hash:true}" value="<?=$topbar;?>">
  721. </div>
  722. <div class="col-md-4 gray-bg">
  723. <center><?php echo $language->translate("BOTTOM_BAR");?></center>
  724. <input name="bottombar" id="bottombar" class="form-control jscolor {hash:true}" value="<?=$bottombar;?>">
  725. </div>
  726. <div class="clearfix visible-xs-block"></div>
  727. <div class="col-md-4 gray-bg">
  728. <center><?php echo $language->translate("SIDE_BAR");?></center>
  729. <input name="sidebar" id="sidebar" class="form-control jscolor {hash:true}" value="<?=$sidebar;?>">
  730. </div>
  731. </div>
  732. <div class="row show-grids col-lg-12">
  733. <div class="col-md-6 gray-bg">
  734. <center><?php echo $language->translate("HOVER_BG");?></center>
  735. <input name="hoverbg" id="hoverbg" class="form-control jscolor {hash:true}" value="<?=$hoverbg;?>">
  736. </div>
  737. <div class="col-md-6 gray-bg">
  738. <center><?php echo $language->translate("HOVER_TEXT");?></center>
  739. <input name="hovertext" id="hovertext" class="form-control jscolor {hash:true}" value="<?=$hovertext;?>">
  740. </div>
  741. </div>
  742. <div class="row show-grids col-lg-12">
  743. <h4><strong><?php echo $language->translate("ACTIVE_TAB");?></strong></h4>
  744. <div class="col-md-4 gray-bg">
  745. <center><?php echo $language->translate("ACTIVE_TAB_BG");?></center>
  746. <input name="activetabBG" id="activetabBG" class="form-control jscolor {hash:true}" value=<?=$activetabBG;?>"">
  747. </div>
  748. <div class="col-md-4 gray-bg">
  749. <center><?php echo $language->translate("ACTIVE_TAB_ICON");?></center>
  750. <input name="activetabicon" id="activetabicon" class="form-control jscolor {hash:true}" value="<?=$activetabicon;?>">
  751. </div>
  752. <div class="col-md-4 gray-bg">
  753. <center><?php echo $language->translate("ACTIVE_TAB_TEXT");?></center>
  754. <input name="activetabtext" id="activetabtext" class="form-control jscolor {hash:true}" value="<?=$activetabtext;?>">
  755. </div>
  756. </div>
  757. <div class="row show-grids col-lg-12">
  758. <h4><strong><?php echo $language->translate("INACTIVE_TAB");?></strong></h4>
  759. <div class="col-md-6 gray-bg">
  760. <center><?php echo $language->translate("INACTIVE_ICON");?></center>
  761. <input name="inactiveicon" id="inactiveicon" class="form-control jscolor {hash:true}" value="<?=$inactiveicon;?>">
  762. </div>
  763. <div class="col-md-6 gray-bg">
  764. <center><?php echo $language->translate("INACTIVE_TEXT");?></center>
  765. <input name="inactivetext" id="inactivetext" class="form-control jscolor {hash:true}" value="<?=$inactivetext;?>">
  766. </div>
  767. </div>
  768. </div>
  769. </form>
  770. <form style="display: none" id="editCssForm" method="POST" action="ajax.php">
  771. <button class="btn waves btn-labeled btn-warning btn-sm pull-left text-uppercase waves-effect waves-float" type="button" id="backToThemeButton">
  772. <span class="btn-label"><i class="fa fa-arrow-left"></i></span><?php echo $language->translate("GO_BACK");?>
  773. </button>
  774. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  775. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_CSS");?>
  776. </button>
  777. <br><br>
  778. <input type="hidden" name="submit" value="editCSS" />
  779. <h1><?php echo $language->translate("EDIT_CUSTOM_CSS");?></h1>
  780. <!--<p>Variables Available<code>$topbar - $topbartext - $bottombar - $sidebar - $hoverbg - $activetabBG - $activetabicon - $activetabtext - $inactiveicon - $inactivetext - $loading - $hovertext</code></p>-->
  781. <textarea class="form-control" id="css-show" name="css-show" rows="25" style="background: #000; color: #FFF;">
  782. <?php if(CUSTOMCSS == "true") :
  783. $template_file = "custom.css";
  784. $file_handle = fopen($template_file, "rb");
  785. echo fread($file_handle, filesize($template_file));
  786. fclose($file_handle);
  787. endif;?></textarea>
  788. </form>
  789. </div>
  790. </div>
  791. </div>
  792. </div>
  793. </div>
  794. <div class="email-content homepage-box white-bg">
  795. <?php
  796. $urlPattern = '.*'; // https?:\/\/([-a-zA-Z0-9@:%._\+~#=]{2,256}\.)+[a-z]{2,}\b(:\d{2,5})?[^?.\s]*
  797. echo buildSettings(
  798. array(
  799. 'title' => 'Homepage Settings',
  800. 'id' => 'homepage_settings',
  801. 'tabs' => array(
  802. array(
  803. 'title' => 'Plex',
  804. 'id' => 'plex',
  805. 'image' => 'images/plex.png',
  806. 'fields' => array(
  807. array(
  808. 'type' => 'text',
  809. 'placeholder' => 'http://hostname:32400',
  810. 'labelTranslate' => 'PLEX_URL',
  811. 'assist' => 'http://hostname:32400',
  812. 'name' => 'plexURL',
  813. 'pattern' => $urlPattern,
  814. 'value' => PLEXURL,
  815. ),
  816. array(
  817. 'type' => 'text',
  818. 'placeholder' => randString(20),
  819. 'labelTranslate' => 'PLEX_TOKEN',
  820. 'name' => 'plexToken',
  821. 'pattern' => '[a-zA-Z0-9]{20}',
  822. 'value' => PLEXTOKEN,
  823. ),
  824. array(
  825. array(
  826. 'type' => 'checkbox',
  827. 'labelTranslate' => 'RECENT_MOVIES',
  828. 'name' => 'plexRecentMovie',
  829. 'value' => PLEXRECENTMOVIE,
  830. ),
  831. array(
  832. 'type' => 'checkbox',
  833. 'labelTranslate' => 'RECENT_TV',
  834. 'name' => 'plexRecentTV',
  835. 'value' => PLEXRECENTTV,
  836. ),
  837. array(
  838. 'type' => 'checkbox',
  839. 'labelTranslate' => 'RECENT_MUSIC',
  840. 'name' => 'plexRecentMusic',
  841. 'value' => PLEXRECENTMUSIC,
  842. ),
  843. array(
  844. 'type' => 'checkbox',
  845. 'labelTranslate' => 'PLAYING_NOW',
  846. 'name' => 'plexPlayingNow',
  847. 'value' => PLEXPLAYINGNOW,
  848. ),
  849. ),
  850. ),
  851. ),
  852. array(
  853. 'title' => 'Emby',
  854. 'id' => 'emby',
  855. 'image' => 'images/emby.png',
  856. 'fields' => array(
  857. array(
  858. 'type' => 'text',
  859. 'placeholder' => 'http://hostname:8096/emby',
  860. 'labelTranslate' => 'EMBY_URL',
  861. 'assist' => 'http://hostname:8096 | https://hostname/emby | http://hostname:8096/emby',
  862. 'name' => 'embyURL',
  863. 'pattern' => $urlPattern,
  864. 'value' => EMBYURL,
  865. ),
  866. array(
  867. 'type' => 'text',
  868. 'placeholder' => randString(32),
  869. 'labelTranslate' => 'EMBY_TOKEN',
  870. 'name' => 'plexToken',
  871. 'pattern' => '[a-zA-Z0-9]{32}',
  872. 'value' => EMBYTOKEN,
  873. ),
  874. array(
  875. array(
  876. 'type' => 'checkbox',
  877. 'labelTranslate' => 'RECENT_MOVIES',
  878. 'name' => 'embyRecentMovie',
  879. 'value' => EMBYRECENTMOVIE,
  880. ),
  881. array(
  882. 'type' => 'checkbox',
  883. 'labelTranslate' => 'RECENT_TV',
  884. 'name' => 'embyRecentTV',
  885. 'value' => EMBYRECENTTV,
  886. ),
  887. array(
  888. 'type' => 'checkbox',
  889. 'labelTranslate' => 'RECENT_MUSIC',
  890. 'name' => 'embyRecentMusic',
  891. 'value' => EMBYRECENTMUSIC,
  892. ),
  893. array(
  894. 'type' => 'checkbox',
  895. 'labelTranslate' => 'PLAYING_NOW',
  896. 'name' => 'embyPlayingNow',
  897. 'value' => EMBYPLAYINGNOW,
  898. ),
  899. ),
  900. ),
  901. ),
  902. array(
  903. 'title' => 'Sonarr',
  904. 'id' => 'sonarr',
  905. 'image' => 'images/sonarr.png',
  906. 'fields' => array(
  907. array(
  908. 'type' => 'text',
  909. 'placeholder' => 'http://hostname:8989',
  910. 'labelTranslate' => 'SONARR_URL',
  911. 'assist' => 'http://hostname:8989 | hostname/sonarr | http://hostname:8989/sonarr',
  912. 'name' => 'sonarrURL',
  913. 'pattern' => $urlPattern,
  914. 'value' => SONARRURL,
  915. ),
  916. array(
  917. 'type' => 'text',
  918. 'placeholder' => randString(32),
  919. 'labelTranslate' => 'SONARR_KEY',
  920. 'name' => 'sonarrKey',
  921. 'pattern' => '[a-zA-Z0-9]{32}',
  922. 'value' => SONARRKEY,
  923. ),
  924. ),
  925. ),
  926. array(
  927. 'title' => 'Radarr',
  928. 'id' => 'radarr',
  929. 'image' => 'images/radarr.png',
  930. 'fields' => array(
  931. array(
  932. 'type' => 'text',
  933. 'placeholder' => 'http://hostname:8989',
  934. 'labelTranslate' => 'RADARR_URL',
  935. 'assist' => 'http://hostname:8989 | hostname/radarr | http://hostname:8989/radarr',
  936. 'name' => 'radarrURL',
  937. 'pattern' => $urlPattern,
  938. 'value' => RADARRURL,
  939. ),
  940. array(
  941. 'type' => 'text',
  942. 'placeholder' => randString(32),
  943. 'labelTranslate' => 'RADARR_KEY',
  944. 'name' => 'radarrKey',
  945. 'pattern' => '[a-zA-Z0-9]{32}',
  946. 'value' => RADARRKEY,
  947. ),
  948. ),
  949. ),
  950. array(
  951. 'title' => 'Sickbeard/Sickrage',
  952. 'id' => 'sick',
  953. 'image' => 'images/sickrage.png',
  954. 'fields' => array(
  955. array(
  956. 'type' => 'text',
  957. 'placeholder' => 'http://hostname:8081/sick',
  958. 'labelTranslate' => 'SICK_URL',
  959. 'assist' => 'http://hostname:8081 | hostname/sick | http://hostname:8081/sick',
  960. 'name' => 'sickrageURL',
  961. 'pattern' => $urlPattern,
  962. 'value' => SICKRAGEURL,
  963. ),
  964. array(
  965. 'type' => 'text',
  966. 'placeholder' => randString(32),
  967. 'labelTranslate' => 'SICK_KEY',
  968. 'name' => 'sickrageKey',
  969. //'pattern' => '[a-zA-Z0-9]{32}',
  970. 'value' => SICKRAGEKEY,
  971. ),
  972. ),
  973. ),
  974. array(
  975. 'title' => 'Headphones',
  976. 'id' => 'headphones',
  977. 'image' => 'images/headphones.png',
  978. 'fields' => array(
  979. array(
  980. 'type' => 'text',
  981. 'placeholder' => 'http://hostname:8181',
  982. 'labelTranslate' => 'HEADPHONES_URL',
  983. 'assist' => 'http://hostname:8181',
  984. 'name' => 'headphonesURL',
  985. 'pattern' => $urlPattern,
  986. 'value' => HEADPHONESURL,
  987. ),
  988. array(
  989. 'type' => 'text',
  990. 'placeholder' => randString(32),
  991. 'labelTranslate' => 'HEADPHONES_KEY',
  992. 'name' => 'headphonesKey',
  993. //'pattern' => '[a-zA-Z0-9]{32}',
  994. 'value' => HEADPHONESKEY,
  995. ),
  996. ),
  997. ),
  998. array(
  999. 'title' => 'Sabnzbd',
  1000. 'id' => 'sabnzbd',
  1001. 'image' => 'images/sabnzbd.png',
  1002. 'fields' => array(
  1003. array(
  1004. 'type' => 'text',
  1005. 'placeholder' => 'http://hostname:8080/sabnzbd',
  1006. 'labelTranslate' => 'SABNZBD_URL',
  1007. 'assist' => 'http://hostname:8080 | http://hostname/sabnzbd | http://hostname:8080/sabnzbd',
  1008. 'name' => 'sabnzbdURL',
  1009. 'pattern' => $urlPattern,
  1010. 'value' => SABNZBDURL,
  1011. ),
  1012. array(
  1013. 'type' => 'text',
  1014. 'placeholder' => randString(32),
  1015. 'labelTranslate' => 'SABNZBD_KEY',
  1016. 'name' => 'sabnzbdKey',
  1017. //'pattern' => '[a-zA-Z0-9]{32}',
  1018. 'value' => SABNZBDKEY,
  1019. ),
  1020. ),
  1021. ),
  1022. array(
  1023. 'title' => 'nzbGET',
  1024. 'id' => 'nzbget',
  1025. 'image' => 'images/nzbget.png',
  1026. 'fields' => array(
  1027. array(
  1028. 'type' => 'text',
  1029. 'placeholder' => 'http://hostname:6789',
  1030. 'labelTranslate' => 'NZBGET_URL',
  1031. 'assist' => 'http://hostname:6789',
  1032. 'name' => 'nzbgetURL',
  1033. 'pattern' => $urlPattern,
  1034. 'value' => NZBGETURL,
  1035. ),
  1036. array(
  1037. 'type' => 'text',
  1038. 'labelTranslate' => 'USERNAME',
  1039. 'name' => 'nzbgetUsername',
  1040. //'pattern' => '[a-zA-Z0-9]{32}',
  1041. 'value' => NZBGETUSERNAME,
  1042. ),
  1043. array(
  1044. 'type' => 'password',
  1045. 'labelTranslate' => 'PASSWORD',
  1046. 'name' => 'nzbgetPassword',
  1047. //'pattern' => '[a-zA-Z0-9]{32}',
  1048. 'value' => (empty(NZBGETPASSWORD)?'':randString(20)),
  1049. ),
  1050. ),
  1051. ),
  1052. array(
  1053. 'title' => 'Calendar',
  1054. 'id' => 'calendar',
  1055. 'image' => 'images/calendar.png',
  1056. 'fields' => array(
  1057. array(
  1058. 'type' => 'select',
  1059. 'labelTranslate' => 'CALENDAR_START_DAY',
  1060. 'name' => 'calendarStart',
  1061. 'value' => CALENDARSTART,
  1062. 'options' => array(
  1063. explode('|', translate('DAYS'))[0] => '0',
  1064. explode('|', translate('DAYS'))[1] => '1',
  1065. explode('|', translate('DAYS'))[2] => '2',
  1066. explode('|', translate('DAYS'))[3] => '3',
  1067. explode('|', translate('DAYS'))[4] => '4',
  1068. explode('|', translate('DAYS'))[5] => '5',
  1069. explode('|', translate('DAYS'))[6] => '6',
  1070. ),
  1071. ),
  1072. array(
  1073. 'type' => 'select',
  1074. 'labelTranslate' => 'DEFAULT',
  1075. 'name' => 'calendarView',
  1076. 'value' => CALENDARVIEW,
  1077. 'options' => array(
  1078. translate('MONTH') => 'month',
  1079. translate('DAY') => 'basicDay',
  1080. translate('WEEK') => 'basicWeek',
  1081. ),
  1082. ),
  1083. array(
  1084. 'type' => 'select',
  1085. 'labelTranslate' => 'CALTIMEFORMAT',
  1086. 'name' => 'calTimeFormat',
  1087. 'value' => CALTIMEFORMAT,
  1088. 'options' => array(
  1089. '6p' => 'h(:mm)t',
  1090. '6:00p' => 'h:mmt',
  1091. '6:00' => 'h:mm',
  1092. '18' => 'H(:mm)',
  1093. '18:00' => 'H:mm',
  1094. ),
  1095. ),
  1096. array(
  1097. 'type' => 'number',
  1098. 'placeholder' => '10',
  1099. 'labelTranslate' => 'CALENDAR_START_DATE',
  1100. 'name' => 'calendarStartDay',
  1101. 'pattern' => '[1-9][0-9]+',
  1102. 'value' => CALENDARSTARTDAY,
  1103. ),
  1104. array(
  1105. 'type' => 'number',
  1106. 'placeholder' => '10',
  1107. 'labelTranslate' => 'CALENDAR_END_DATE',
  1108. 'name' => 'calendarEndDay',
  1109. 'pattern' => '[1-9][0-9]+',
  1110. 'value' => CALENDARENDDAY,
  1111. ),
  1112. ),
  1113. ),
  1114. ),
  1115. )
  1116. );
  1117. ?>
  1118. </div>
  1119. <div class="email-content advanced-box white-bg">
  1120. <?php
  1121. $backendOptions = array();
  1122. foreach (array_filter(get_defined_functions()['user'],function($v) { return strpos($v, 'plugin_auth_') === 0; }) as $value) {
  1123. $name = str_replace('plugin_auth_','',$value);
  1124. if (strpos($name, 'disabled') === false) {
  1125. $backendOptions[ucwords(str_replace('_',' ',$name))] = $name;
  1126. } else {
  1127. $backendOptions[$value()] = array(
  1128. 'value' => randString(),
  1129. 'disabled' => true,
  1130. );
  1131. }
  1132. }
  1133. $urlPattern = '.*'; // https?:\/\/([-a-zA-Z0-9@:%._\+~#=]{2,256}\.)+[a-z]{2,}\b(:\d{2,5})?[^?.\s]*
  1134. echo buildSettings(
  1135. array(
  1136. 'title' => 'Advanced Settings',
  1137. 'id' => 'advanced_settings',
  1138. 'fields' => array(
  1139. array(
  1140. 'type' => 'text',
  1141. 'labelTranslate' => 'REGISTER_PASSWORD',
  1142. 'name' => 'registerPassword',
  1143. //'pattern' => '[a-zA-Z0-9]{32}',
  1144. 'value' => REGISTERPASSWORD,
  1145. ),
  1146. array(
  1147. 'type' => 'checkbox',
  1148. 'labelTranslate' => 'MULTIPLE_LOGINS',
  1149. 'name' => 'multipleLogin',
  1150. //'pattern' => '[a-zA-Z0-9]{32}',
  1151. 'value' => MULTIPLELOGIN,
  1152. ),
  1153. array(
  1154. 'type' => 'text',
  1155. 'labelTranslate' => 'COOKIE_DOMAIN',
  1156. 'name' => 'domain',
  1157. //'pattern' => '[a-zA-Z0-9]{32}',
  1158. 'value' => DOMAIN,
  1159. ),
  1160. array(
  1161. 'type' => 'password',
  1162. 'labelTranslate' => 'COOKIE_PASSWORD',
  1163. 'name' => 'cookiePassword',
  1164. //'pattern' => '[a-zA-Z0-9]{32}',
  1165. 'value' => (empty(COOKIEPASSWORD)?'':randString(20)),
  1166. ),
  1167. ),
  1168. 'tabs' => array(
  1169. array(
  1170. 'title' => 'Backend Authentication',
  1171. 'id' => 'be_auth',
  1172. 'image' => 'images/security.png',
  1173. 'fields' => array(
  1174. array(
  1175. 'type' => 'select',
  1176. 'labelTranslate' => 'AUTHTYPE',
  1177. 'name' => 'authType',
  1178. 'value' => AUTHTYPE,
  1179. 'options' => array(
  1180. 'Organizr' => 'internal',
  1181. 'Organizr & Backend' => 'both',
  1182. // 'Backend' => 'external',
  1183. ),
  1184. ),
  1185. array(
  1186. 'type' => 'select',
  1187. 'labelTranslate' => 'AUTHBACKEND',
  1188. 'name' => 'authBackend',
  1189. 'value' => AUTHBACKEND,
  1190. 'options' => $backendOptions,
  1191. ),
  1192. array(
  1193. 'type' => 'select',
  1194. 'labelTranslate' => 'AUTHBACKENDCREATE',
  1195. 'name' => 'authBackendCreate',
  1196. 'value' => AUTHBACKENDCREATE,
  1197. 'options' => array(
  1198. translate('YES_CREATE') => 'true',
  1199. translate('NO_CREATE') => 'false',
  1200. ),
  1201. ),
  1202. array(
  1203. 'type' => 'text',
  1204. 'placeholder' => 'http://hostname:8181',
  1205. 'labelTranslate' => 'AUTHBACKENDHOST',
  1206. 'assist' => 'http(s)://hostname:8181 | Ldap(s)://localhost:389 | ftp(s)://localhost:21',
  1207. 'name' => 'authBackendHost',
  1208. 'pattern' => $urlPattern,
  1209. 'value' => AUTHBACKENDHOST,
  1210. ),
  1211. array(
  1212. 'type' => 'text',
  1213. 'placeholder' => 'DEPRECIATED',
  1214. 'labelTranslate' => 'AUTHBACKENDPORT',
  1215. 'assist' => 'DEPRECIATED',
  1216. 'name' => 'authBackendPort',
  1217. 'value' => AUTHBACKENDPORT,
  1218. ),
  1219. array(
  1220. 'type' => 'text',
  1221. 'placeholder' => 'domain',
  1222. 'labelTranslate' => 'AUTHBACKENDDOMAIN',
  1223. 'name' => 'authBackendDomain',
  1224. 'value' => AUTHBACKENDDOMAIN,
  1225. ),
  1226. array(
  1227. 'type' => 'text',
  1228. 'placeholder' => randString(32),
  1229. 'labelTranslate' => 'EMBY_TOKEN',
  1230. 'name' => 'plexToken',
  1231. 'pattern' => '[a-zA-Z0-9]{32}',
  1232. 'value' => EMBYTOKEN,
  1233. ),
  1234. array(
  1235. 'type' => 'text',
  1236. 'labelTranslate' => 'PLEX_USERNAME',
  1237. 'name' => 'plexUsername',
  1238. //'pattern' => '[a-zA-Z0-9]{32}',
  1239. 'value' => PLEXUSERNAME,
  1240. ),
  1241. array(
  1242. 'type' => 'password',
  1243. 'labelTranslate' => 'PLEX_PASSWORD',
  1244. 'name' => 'plexPassword',
  1245. //'pattern' => '[a-zA-Z0-9]{32}',
  1246. 'value' => (empty(PLEXPASSWORD)?'':randString(20)),
  1247. ),
  1248. ),
  1249. ),
  1250. array(
  1251. 'title' => 'Super Advanced',
  1252. 'id' => 'super_advanced',
  1253. 'image' => 'images/gear.png',
  1254. 'fields' => array(
  1255. array(
  1256. 'type' => 'text',
  1257. 'placeholder' => '/home/www-data/',
  1258. 'labelTranslate' => 'DATABASE_PATH',
  1259. 'name' => 'database_Location',
  1260. 'value' => DATABASE_LOCATION,
  1261. ),
  1262. array(
  1263. 'type' => 'select',
  1264. 'labelTranslate' => 'SET_TIMEZONE',
  1265. 'name' => 'timezone',
  1266. 'value' => TIMEZONE,
  1267. 'options' => timezoneOptions(),
  1268. ),
  1269. ),
  1270. ),
  1271. array(
  1272. 'title' => 'Mail Settings',
  1273. 'id' => 'mail_settings',
  1274. 'image' => 'images/mail.png',
  1275. 'fields' => array(
  1276. array(
  1277. 'type' => 'text',
  1278. 'placeholder' => 'mail.provider.com',
  1279. 'labelTranslate' => 'SMTP_HOST',
  1280. 'name' => 'smtpHost',
  1281. 'pattern' => $urlPattern,
  1282. 'value' => SMTPHOST,
  1283. ),
  1284. array(
  1285. 'type' => 'number',
  1286. 'placeholder' => '465',
  1287. 'labelTranslate' => 'SMTP_HOST_PORT',
  1288. 'name' => 'smtpHostPort',
  1289. 'value' => SMTPHOSTPORT,
  1290. ),
  1291. array(
  1292. 'type' => 'text',
  1293. 'labelTranslate' => 'SMTP_HOST_USERNAME',
  1294. 'name' => 'smtpHostUsername',
  1295. //'pattern' => '[a-zA-Z0-9]{32}',
  1296. 'value' => SMTPHOSTUSERNAME,
  1297. ),
  1298. array(
  1299. 'type' => 'password',
  1300. 'labelTranslate' => 'SMTP_HOST_PASSWORD',
  1301. 'name' => 'smtpHostPassword',
  1302. //'pattern' => '[a-zA-Z0-9]{32}',
  1303. 'value' => (empty(SMTPHOSTPASSWORD)?'':randString(20)),
  1304. ),
  1305. array(
  1306. 'type' => 'text',
  1307. 'labelTranslate' => 'SMTP_HOST_SENDER_NAME',
  1308. 'name' => 'smtpHostSenderName',
  1309. 'value' => SMTPHOSTSENDERNAME,
  1310. ),
  1311. array(
  1312. 'type' => 'text',
  1313. 'labelTranslate' => 'SMTP_HOST_SENDER_EMAIL',
  1314. 'name' => 'smtpHostSenderEmail',
  1315. //'pattern' => '[a-zA-Z0-9]{32}',
  1316. 'value' => SMTPHOSTSENDEREMAIL,
  1317. ),
  1318. array(
  1319. array(
  1320. 'type' => 'checkbox',
  1321. 'labelTranslate' => 'SMTP_HOST_AUTH',
  1322. 'name' => 'smtpHostAuth',
  1323. 'value' => SMTPHOSTAUTH,
  1324. ),
  1325. array(
  1326. 'type' => 'checkbox',
  1327. 'labelTranslate' => 'ENABLE_MAIL',
  1328. 'name' => 'enableMail',
  1329. 'value' => ENABLEMAIL,
  1330. ),
  1331. ),
  1332. ),
  1333. ),
  1334. array(
  1335. 'title' => 'Advanced Visual',
  1336. 'id' => 'advanced_visual',
  1337. 'image' => 'images/paint.png',
  1338. 'fields' => array(
  1339. array(
  1340. 'type' => 'text',
  1341. 'placeholder' => 'images/organizr.png',
  1342. 'labelTranslate' => 'LOADING_ICON_URL',
  1343. 'name' => 'loadingIcon',
  1344. 'value' => LOADINGICON,
  1345. ),
  1346. array(
  1347. 'type' => 'text',
  1348. 'placeholder' => 'images/organizr.png',
  1349. 'labelTranslate' => 'LOGO_URL_TITLE',
  1350. 'name' => 'titleLogo',
  1351. 'value' => TITLELOGO,
  1352. ),
  1353. array(
  1354. 'type' => 'select',
  1355. 'labelTranslate' => 'NOTIFICATION_TYPE',
  1356. 'name' => 'notifyEffect',
  1357. 'value' => explode("-", NOTIFYEFFECT)[1],
  1358. 'options' => array(
  1359. 'Slide From Top' => 'bar-slidetop',
  1360. 'Exploader From Top' => 'bar-exploader',
  1361. 'Flip' => 'attached-flip',
  1362. 'Bouncy Flip' => 'attached-bouncyflip',
  1363. 'Growl Scale' => 'growl-scale',
  1364. 'Growl Genie' => 'growl-genie',
  1365. 'Growl Jelly' => 'growl-jelly',
  1366. 'Growl Slide' => 'growl-slide',
  1367. 'Spinning Box' => 'other-boxspinner',
  1368. 'Sliding' => 'other-thumbslider',
  1369. ),
  1370. ),
  1371. array(
  1372. array(
  1373. 'type' => 'checkbox',
  1374. 'labelTranslate' => 'ENABLE_LOADING_SCREEN',
  1375. 'name' => 'loadingScreen',
  1376. 'value' => LOADINGSCREEN,
  1377. ),
  1378. array(
  1379. 'type' => 'checkbox',
  1380. 'labelTranslate' => 'ENABLE_SLIMBAR',
  1381. 'name' => 'slimBar',
  1382. 'value' => SLIMBAR,
  1383. ),
  1384. array(
  1385. 'type' => 'checkbox',
  1386. 'labelTranslate' => 'GRAVATAR',
  1387. 'name' => 'gravatar',
  1388. 'value' => GRAVATAR,
  1389. ),
  1390. ),
  1391. ),
  1392. ),
  1393. ),
  1394. )
  1395. );
  1396. ?>
  1397. </div>
  1398. <div class="email-content info-box white-bg">
  1399. <div class="email-body">
  1400. <div class="email-header gray-bg">
  1401. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1402. <h1>About Organizr</h1>
  1403. </div>
  1404. <div class="email-inner small-box">
  1405. <div class="email-inner-section">
  1406. <div class="small-box fade in" id="about">
  1407. <h4><img src="images/organizr-logo-h-d.png" height="50px"></h4>
  1408. <p id="version"></p>
  1409. <p id="submitFeedback">
  1410. <a href='https://reddit.com/r/organizr' target='_blank' type='button' style="background: #AD80FD" class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-reddit'></i></span>SUBREDDIT</a>
  1411. <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>
  1412. <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>
  1413. <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>
  1414. <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>
  1415. <button id="deleteToggle" type="button" class="class='btn waves btn-labeled btn-danger btn text-uppercase waves-effect waves-float" ><span class='btn-label'><i class='fa fa-trash'></i></span><?php echo $language->translate("DELETE_DATABASE");?></button>
  1416. </p>
  1417. <div class="modal fade Help-Me-modal-lg" tabindex="-1" role="dialog">
  1418. <div class="modal-dialog modal-lg" role="document">
  1419. <div class="modal-content" style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;">
  1420. <div class="modal-header">
  1421. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  1422. <h4 class="modal-title"><?php echo $language->translate("HELP");?>!</h4>
  1423. </div>
  1424. <div class="modal-body" style="background: <?php echo $sidebar;?> !important;">
  1425. <div style="margin-bottom: 0px;" class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  1426. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1427. <div class="panel-heading" role="tab" id="headingOne">
  1428. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
  1429. <?php echo $language->translate("ADDING_TABS");?>
  1430. </h4>
  1431. </div>
  1432. <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true">
  1433. <div class="panel-body">
  1434. <p><?php echo $language->translate("START_ADDING_TABS");?></p>
  1435. <ul>
  1436. <li><strong><?php echo $language->translate("TAB_URL");?></strong> <?php echo $language->translate("TAB_URL_ABOUT");?></li>
  1437. <li><strong><?php echo $language->translate("ICON_URL");?></strong> <?php echo $language->translate("ICON_URL_ABOUT");?></li>
  1438. <li><strong><?php echo $language->translate("DEFAULT");?></strong> <?php echo $language->translate("DEFAULT_ABOUT");?></li>
  1439. <li><strong><?php echo $language->translate("ACTIVE");?></strong> <?php echo $language->translate("ACTIVE_ABOUT");?></li>
  1440. <li><strong><?php echo $language->translate("USER");?></strong> <?php echo $language->translate("USER_ABOUT");?></li>
  1441. <li><strong><?php echo $language->translate("GUEST");?></strong> <?php echo $language->translate("GUEST_ABOUT");?></li>
  1442. <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>
  1443. </ul>
  1444. </div>
  1445. </div>
  1446. </div>
  1447. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1448. <div class="panel-heading" role="tab" id="headingTwo">
  1449. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
  1450. <?php echo $language->translate("QUICK_ACCESS");?>
  1451. </h4>
  1452. </div>
  1453. <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true">
  1454. <div class="panel-body">
  1455. <p><?php echo $language->translate("QUICK_ACCESS_ABOUT");?> <mark><?php echo getServerPath(); ?>#Sonarr</mark></p>
  1456. </div>
  1457. </div>
  1458. </div>
  1459. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1460. <div class="panel-heading" role="tab" id="headingThree">
  1461. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
  1462. <?php echo $language->translate("SIDE_BY_SIDE");?>
  1463. </h4>
  1464. </div>
  1465. <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree" aria-expanded="true">
  1466. <div class="panel-body">
  1467. <p><?php echo $language->translate("SIDE_BY_SIDE_ABOUT");?></p>
  1468. <ul>
  1469. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS1");?></li>
  1470. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS2");?> [<i class='mdi mdi-refresh'></i>]</li>
  1471. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS3");?></li>
  1472. </ul>
  1473. </div>
  1474. </div>
  1475. </div>
  1476. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1477. <div class="panel-heading" role="tab" id="headingFour">
  1478. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
  1479. <?php echo $language->translate("KEYBOARD_SHORTCUTS");?>
  1480. </h4>
  1481. </div>
  1482. <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour" aria-expanded="true">
  1483. <div class="panel-body">
  1484. <p><?php echo $language->translate("KEYBOARD_SHORTCUTS_ABOUT");?></p>
  1485. <ul>
  1486. <li><keyboard class="key"><span>S</span></keyboard> + <keyboard class="key"><span>S</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS1");?></li>
  1487. <li><keyboard class="key"><span>F</span></keyboard> + <keyboard class="key"><span>F</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS6");?></li>
  1488. <li><keyboard class="key"><span>P</span></keyboard> + <keyboard class="key"><span>P</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS7");?></li>
  1489. <li><keyboard class="key"><span>M</span></keyboard> + <keyboard class="key"><span>M</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS8");?></li>
  1490. <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>
  1491. <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>
  1492. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>1</span></keyboard> - <keyboard class="key"><span>9</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS5");?></li>
  1493. <li><keyboard class="key wide"><span>Esc</span></keyboard> + <keyboard class="key wide"><span>Esc</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS4");?></li>
  1494. </ul>
  1495. </div>
  1496. </div>
  1497. </div>
  1498. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1499. <div class="panel-heading" role="tab" id="headingFive">
  1500. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
  1501. <?php echo $language->translate("TAB_NOT_LOADING");?>
  1502. </h4>
  1503. </div>
  1504. <div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive" aria-expanded="true">
  1505. <div class="panel-body">
  1506. <p><?php echo $language->translate("TAB_NOT_LOADING_ABOUT");?></p>
  1507. <?php
  1508. 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>";
  1509. 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>";
  1510. else : echo "Sorry, currently there is no other alternative for " . get_browser_name(); endif;
  1511. ?>
  1512. </div>
  1513. </div>
  1514. </div>
  1515. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1516. <div class="panel-heading" role="tab" id="headingSix">
  1517. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="true" aria-controls="collapseSix">
  1518. <?php echo $language->translate("USER_ICONS");?>
  1519. </h4>
  1520. </div>
  1521. <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix" aria-expanded="true">
  1522. <div class="panel-body">
  1523. <p><?php echo $language->translate("USER_ICONS_ABOUT");?> <a href="http://gravatar.com" target="_blank">gravatar.com</a></p>
  1524. </div>
  1525. </div>
  1526. </div>
  1527. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1528. <div class="panel-heading" role="tab" id="headingSeven">
  1529. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSeven" aria-expanded="true" aria-controls="collapseSeven">
  1530. <?php echo $language->translate("TRANSLATIONS");?>
  1531. </h4>
  1532. </div>
  1533. <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven" aria-expanded="true">
  1534. <div class="panel-body">
  1535. <p><?php echo $language->translate("TRANSLATIONS_ABOUT");?> <a href="https://github.com/causefx/Organizr/tree/develop/lang" target="_blank">Github Develop Branch</a></p>
  1536. </div>
  1537. </div>
  1538. </div>
  1539. </div>
  1540. </div>
  1541. <div class="modal-footer">
  1542. <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo $language->translate("CLOSE");?></button>
  1543. </div>
  1544. </div>
  1545. </div>
  1546. </div>
  1547. <p id="whatsnew"></p>
  1548. <p id="downloadnow"></p>
  1549. <div id="deleteDiv" style="display: none;" class="panel panel-danger">
  1550. <div class="panel-heading">
  1551. <h3 class="panel-title"><?php echo $language->translate("DELETE_DATABASE");?></h3>
  1552. </div>
  1553. <div class="panel-body">
  1554. <div class="">
  1555. <p><?php echo $language->translate("DELETE_WARNING");?></p>
  1556. <form id="deletedb" method="post">
  1557. <input type="hidden" name="action" value="deleteDB" />
  1558. <button class="btn waves btn-labeled btn-danger pull-right text-uppercase waves-effect waves-float" type="submit">
  1559. <span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("DELETE_DATABASE");?>
  1560. </button>
  1561. </form>
  1562. </div>
  1563. </div>
  1564. </div>
  1565. <div class="timeline-container">
  1566. <div class="row">
  1567. <div class="col-lg-12">
  1568. <ul class="cbp_tmtimeline" id="versionHistory">
  1569. </ul>
  1570. <div class="btn-group-sm btn-group btn-group-justified">
  1571. <div id="loadMore" class="btn-group" role="group">
  1572. <button type="button" class="btn waves btn-primary waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_MORE");?></button>
  1573. </div>
  1574. <div id="showLess" class="btn-group" role="group">
  1575. <button type="button" class="btn waves btn-warning waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_LESS");?></button>
  1576. </div>
  1577. </div>
  1578. </div>
  1579. </div>
  1580. </div>
  1581. </div>
  1582. </div>
  1583. </div>
  1584. </div>
  1585. </div>
  1586. <div class="email-content users-box white-bg">
  1587. <div class="email-body">
  1588. <div class="email-header gray-bg">
  1589. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1590. <h1>Users Management</h1>
  1591. </div>
  1592. <div class="email-inner small-box">
  1593. <div class="email-inner-section">
  1594. <div class="small-box fade in" id="useredit">
  1595. <div class="row">
  1596. <div class="col-lg-12">
  1597. <div class="small-box">
  1598. <form class="content-form form-inline" name="new user registration" id="registration" action="" method="POST">
  1599. <input type="hidden" name="op" value="register"/>
  1600. <input type="hidden" name="sha1" value=""/>
  1601. <input type="hidden" name="settings" value="true"/>
  1602. <div class="form-group">
  1603. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" value="">
  1604. </div>
  1605. <div class="form-group">
  1606. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  1607. </div>
  1608. <div class="form-group">
  1609. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  1610. </div>
  1611. <div class="form-group">
  1612. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  1613. </div>
  1614. <button type="submit" onclick="User.processRegistration()" class="btn waves btn-labeled btn-primary btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  1615. <span class="btn-label"><i class="fa fa-user-plus"></i></span><?php echo $language->translate("CREATE_USER");?>
  1616. </button>
  1617. </form>
  1618. </div>
  1619. </div>
  1620. </div>
  1621. <div class="small-box">
  1622. <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
  1623. <p id="inputUsername"></p>
  1624. <div class="table-responsive">
  1625. <table class="table table-striped">
  1626. <thead>
  1627. <tr>
  1628. <th>#</th>
  1629. <th><?php echo $language->translate("USERNAME");?></th>
  1630. <th><?php echo $language->translate("EMAIL");?></th>
  1631. <th><?php echo $language->translate("LOGIN_STATUS");?></th>
  1632. <th><?php echo $language->translate("LAST_SEEN");?></th>
  1633. <th><?php echo $language->translate("USER_GROUP");?></th>
  1634. <th><?php echo $language->translate("USER_ACTIONS");?></th>
  1635. </tr>
  1636. </thead>
  1637. <tbody>
  1638. <?php $countUsers = 1;
  1639. foreach($gotUsers as $row) :
  1640. if($row['role'] == "admin" && $countUsers == 1) :
  1641. $userColor = "red";
  1642. $disableAction = "disabled=\"disabled\"";
  1643. else :
  1644. $userColor = "blue";
  1645. $disableAction = "";
  1646. endif;
  1647. if($row['active'] == "true") :
  1648. $userActive = $language->translate("LOGGED_IN");
  1649. $userActiveColor = "primary";
  1650. else :
  1651. $userActive = $language->translate("LOGGED_OUT");
  1652. $userActiveColor = "danger";
  1653. endif;
  1654. $userpic = md5( strtolower( trim( $row['email'] ) ) );
  1655. if(!empty($row["last"])) :
  1656. $lastActive = date("Y-m-d H:i", intval($row["last"]));
  1657. else :
  1658. $lastActive = "";
  1659. endif;
  1660. ?>
  1661. <tr id="<?=$row['username'];?>">
  1662. <th scope="row"><?=$countUsers;?></th>
  1663. <td><?php if(GRAVATAR == "true") : ?><i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=25&d=mm" class="img-circle"></i> &nbsp; <?php endif; ?><?=$row['username'];?></td>
  1664. <td><?=$row['email'];?></td>
  1665. <td><span class="label label-<?=$userActiveColor;?>"><?=$userActive;?></span></td>
  1666. <td><?=$lastActive;?></td>
  1667. <td><span class="text-uppercase <?=$userColor;?>"><?=$row['role'];?></span></td>
  1668. <td id="<?=$row['username'];?>">
  1669. <button <?=$disableAction;?> class="btn waves btn-labeled btn-danger btn btn-sm text-uppercase waves-effect waves-float deleteUser">
  1670. <span class="btn-label"><i class="fa fa-user-times"></i></span><?php echo $language->translate("DELETE");?>
  1671. </button>
  1672. <?php if ($row['role'] == "user") : ?>
  1673. <button class="btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  1674. <span class="btn-label"><i class="fa fa-arrow-up"></i></span><?php echo $language->translate("PROMOTE");?>
  1675. </button>
  1676. <?php endif; ?>
  1677. <?php if ($row['role'] == "admin") : ?>
  1678. <button <?=$disableAction;?> class="btn waves btn-labeled btn-warning btn btn-sm text-uppercase waves-effect waves-float demoteUser">
  1679. <span class="btn-label"><i class="fa fa-arrow-down"></i></span><?php echo $language->translate("DEMOTE");?>
  1680. </button>
  1681. <?php endif; ?>
  1682. </td>
  1683. </tr>
  1684. <?php $countUsers++; endforeach; ?>
  1685. </tbody>
  1686. </table>
  1687. </div>
  1688. </form>
  1689. </div>
  1690. </div>
  1691. </div>
  1692. </div>
  1693. </div>
  1694. </div>
  1695. <div class="email-content logs-box white-bg">
  1696. <div class="email-body">
  1697. <div class="email-header gray-bg">
  1698. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1699. <h1>Logs</h1>
  1700. </div>
  1701. <div class="email-inner small-box">
  1702. <div class="email-inner-section">
  1703. <div class="small-box" id="loginlog">
  1704. <div class="table-responsive">
  1705. <?php if(file_exists(FAIL_LOG)) : ?>
  1706. <div id="loginStats">
  1707. <div class="content-box ultra-widget">
  1708. <div class="w-progress">
  1709. <span id="goodCount" class="w-amount green"></span>
  1710. <span id="badCount" class="w-amount red pull-right">3</span>
  1711. <br>
  1712. <span class="text-uppercase w-name"><?php echo $language->translate("GOOD_LOGINS");?></span>
  1713. <span class="text-uppercase w-name pull-right"><?php echo $language->translate("BAD_LOGINS");?></span>
  1714. </div>
  1715. <div class="progress progress-bar-sm zero-m">
  1716. <div id="goodPercent" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"></div>
  1717. <div id="badPercent" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"></div>
  1718. </div>
  1719. <div class="w-status clearfix">
  1720. <div id="goodTitle" class="w-status-title pull-left text-uppercase">20%</div>
  1721. <div id="badTitle" class="w-status-number pull-right text-uppercase">80%</div>
  1722. </div>
  1723. </div>
  1724. </div>
  1725. <table id="datatable" class="display">
  1726. <thead>
  1727. <tr>
  1728. <th><?php echo $language->translate("DATE");?></th>
  1729. <th><?php echo $language->translate("USERNAME");?></th>
  1730. <th><?php echo $language->translate("IP_ADDRESS");?></th>
  1731. <th><?php echo $language->translate("TYPE");?></th>
  1732. </tr>
  1733. </thead>
  1734. <tbody>
  1735. <?php
  1736. $getFailLog = str_replace("\r\ndate", "date", file_get_contents(FAIL_LOG));
  1737. $gotFailLog = json_decode($getFailLog, true);
  1738. $goodLogin = 0;
  1739. $badLogin = 0;
  1740. function getColor($colorTest){
  1741. if($colorTest == "bad_auth") :
  1742. $gotColorTest = "danger";
  1743. elseif($colorTest == "good_auth") :
  1744. $gotColorTest = "primary";
  1745. endif;
  1746. echo $gotColorTest;
  1747. }
  1748. foreach (array_reverse($gotFailLog["auth"]) as $key => $val) :
  1749. if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif;
  1750. ?>
  1751. <tr>
  1752. <td><?=$val["date"];?></td>
  1753. <td><?=$val["username"];?></td>
  1754. <td><?=$val["ip"];?></td>
  1755. <td><span class="label label-<?php getColor($val["auth_type"]);?>"><?=$val["auth_type"];?></span></td>
  1756. </tr>
  1757. <?php endforeach; ?>
  1758. </tbody>
  1759. </table>
  1760. <?php
  1761. $totalLogin = $goodLogin + $badLogin;
  1762. $goodPercent = round(($goodLogin / $totalLogin) * 100);
  1763. $badPercent = round(($badLogin / $totalLogin) * 100);
  1764. endif;
  1765. if(!file_exists(FAIL_LOG)) :
  1766. echo $language->translate("NOTHING_LOG");
  1767. endif;
  1768. ?>
  1769. </div>
  1770. </div>
  1771. </div>
  1772. </div>
  1773. </div>
  1774. </div>
  1775. </div>
  1776. <!--End Content-->
  1777. </div>
  1778. <script>
  1779. $(function () {
  1780. //Data Tables
  1781. $('#datatable').DataTable({
  1782. displayLength: 10,
  1783. dom: 'T<"clear">lfrtip',
  1784. responsive: true,
  1785. "order": [[ 0, 'desc' ]],
  1786. "language": {
  1787. "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);?>",
  1788. "infoEmpty": "<?php echo $language->translate('NO_ENTRIES');?>",
  1789. "infoFiltered": "<?php echo explosion($language->translate('FILTERED'), 0);?> _MAX_ <?php echo explosion($language->translate('FILTERED'), 1);?>",
  1790. "lengthMenu": "<?php echo $language->translate('SHOW');?> _MENU_ <?php echo $language->translate('ENTRIES');?>",
  1791. "search": "",
  1792. "searchPlaceholder": "<?php echo $language->translate('SEARCH');?>",
  1793. "searchClass": "<?php echo $language->translate('SEARCH');?>",
  1794. "zeroRecords": "<?php echo $language->translate('NO_MATCHING');?>",
  1795. "paginate": {
  1796. "next": "<?php echo $language->translate('NEXT');?>",
  1797. "previous": "<?php echo $language->translate('PREVIOUS');?>",
  1798. }
  1799. }
  1800. });
  1801. });
  1802. </script>
  1803. <?php if($_POST['op']) : ?>
  1804. <script>
  1805. parent.notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1806. <?php if(!empty($USER->error_log)) : ?>
  1807. parent.notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1808. <?php endif; ?>
  1809. </script>
  1810. <?php endif; ?>
  1811. <?php if($action == "addTabz") : ?>
  1812. <script>
  1813. if(!window.location.hash) {
  1814. window.location = window.location + '#loaded';
  1815. window.location.reload();
  1816. }else{
  1817. parent.notify("<strong><?php echo $language->translate('TABS_SAVED');?></strong> <?php echo $language->translate('APPLY_RELOAD');?>","floppy-o","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1818. }
  1819. </script>
  1820. <?php endif; ?>
  1821. <?php if($action == "addOptionz") : ?>
  1822. <script>
  1823. parent.notify("<strong><?php echo $language->translate('COLORS_SAVED');?></strong> <?php echo $language->translate('APPLY_RELOAD');?>","floppy-o","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1824. </script>
  1825. <?php endif; ?>
  1826. <script>
  1827. (function($) {
  1828. function startTrigger(e,data) {
  1829. var $elem = $(this);
  1830. $elem.data('mouseheld_timeout', setTimeout(function() {
  1831. $elem.trigger('mouseheld');
  1832. }, e.data));
  1833. }
  1834. function stopTrigger() {
  1835. var $elem = $(this);
  1836. clearTimeout($elem.data('mouseheld_timeout'));
  1837. }
  1838. var mouseheld = $.event.special.mouseheld = {
  1839. setup: function(data) {
  1840. var $this = $(this);
  1841. $this.bind('mousedown', +data || mouseheld.time, startTrigger);
  1842. $this.bind('mouseleave mouseup', stopTrigger);
  1843. },
  1844. teardown: function() {
  1845. var $this = $(this);
  1846. $this.unbind('mousedown', startTrigger);
  1847. $this.unbind('mouseleave mouseup', stopTrigger);
  1848. },
  1849. time: 200 // default to 750ms
  1850. };
  1851. })(jQuery);
  1852. $(function () {
  1853. //$(".todo ul").sortable();
  1854. $(".todo ul").sortable({
  1855. 'opacity': 0.9,
  1856. });
  1857. $("#add_tab").on('submit', function (e) {
  1858. e.preventDefault();
  1859. var $toDo = $(this).find('.name-of-todo');
  1860. toDo_name = $toDo.val();
  1861. if (toDo_name.length >= 3) {
  1862. var newid = $('.list-group-item').length + 1;
  1863. $(".todo ul").append(
  1864. '<li id="item-' + newid + '" class="list-group-item 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 style="font: normal normal normal 30px/1 FontAwesome;" 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-trash"></span></a></div></tab></li>'
  1865. );
  1866. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  1867. var eventObject = {
  1868. title: $.trim($("#" + newid).text()),
  1869. className: $("#" + newid).attr("data-bg"),
  1870. stick: true
  1871. };
  1872. $("#" + newid).data('eventObject', eventObject);
  1873. $toDo.val('').focus();
  1874. } else {
  1875. $toDo.focus();
  1876. }
  1877. });
  1878. count();
  1879. $(".list-group-item").addClass("list-item");
  1880. //Remove one completed item
  1881. $(document).on('click', '.trash', function (e) {
  1882. var listItemRemove = $(this).closest(".list-group-item");
  1883. var animation = "zoomOutRight";
  1884. var container = $(this).closest(".list-group-item");
  1885. //container.attr('class', 'list-group-item gray-bg animation-container');
  1886. container.addClass('animated ' + animation);
  1887. setTimeout(function() {
  1888. var clearedCompItem = listItemRemove.remove();
  1889. console.log("removed");
  1890. e.preventDefault();
  1891. count();
  1892. }, 800);
  1893. });
  1894. //Count items
  1895. function count() {
  1896. var active = $('.list-group-item').length;
  1897. $('.total-tabs span').text(active);
  1898. };
  1899. $("#submitTabs").on('submit', function (e) {
  1900. console.log("submitted");
  1901. $("div.radio").each(function(i) {
  1902. $(this).find('input').attr('name', 'default-' + i);
  1903. console.log(i);
  1904. });
  1905. $('form input[type="radio"]').not(':checked').each(function() {
  1906. $(this).prop('checked', true);
  1907. $(this).prop('value', "false");
  1908. console.log("found unchecked");
  1909. });
  1910. });
  1911. $('#apply').on('click touchstart', function(){
  1912. window.parent.location.reload();
  1913. });
  1914. });
  1915. </script>
  1916. <script>
  1917. function rememberTabSelection(tabPaneSelector, useHash) {
  1918. var key = 'selectedTabFor' + tabPaneSelector;
  1919. if(get(key))
  1920. $(tabPaneSelector).find('a[href=' + get(key) + ']').tab('show');
  1921. $(tabPaneSelector).on("click", 'a[data-toggle]', function(event) {
  1922. set(key, this.getAttribute('href'));
  1923. });
  1924. function get(key) {
  1925. return useHash ? location.hash: localStorage.getItem(key);
  1926. }
  1927. function set(key, value){
  1928. if(useHash)
  1929. location.hash = value;
  1930. else
  1931. localStorage.setItem(key, value);
  1932. }
  1933. }
  1934. $("#notifyTest").click(function(){
  1935. var notifySplit = $("#notifyValue").val().split("-");
  1936. console.log(notifySplit[0]);
  1937. parent.notify("<?php echo $language->translate('TEST_MESSAGE');?>","flask","notice","5000", notifySplit[0], notifySplit[1]);
  1938. });
  1939. $("#iconHide").click(function(){
  1940. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).toggle();
  1941. });
  1942. $("#iconAll").click(function(){
  1943. $( "div[id^='viewAllIcons']" ).toggle();
  1944. });
  1945. $("#deleteToggle").click(function(){
  1946. $( "#deleteDiv" ).toggle();
  1947. });
  1948. $("#editCssButton").click(function(){
  1949. $( "#add_optionz" ).toggle();
  1950. $( "#editCssForm" ).toggle();
  1951. });
  1952. $("#backToThemeButton").click(function(){
  1953. $( "#add_optionz" ).toggle();
  1954. $( "#editCssForm" ).toggle();
  1955. });
  1956. $(".deleteUser").click(function(){
  1957. var parent_id = $(this).parent().attr('id');
  1958. editUsername = $('#unregister').find('#inputUsername');
  1959. $(editUsername).html('<input type="hidden" name="op" value="unregister"/><input type="hidden" name="username"value="' + parent_id + '" />');
  1960. });
  1961. $(".promoteUser").click(function(){
  1962. var parent_ids = $(this).parent().attr('id');
  1963. editUsername = $('#unregister').find('#inputUsername');
  1964. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="admin"/><input type="hidden" name="username"value="' + parent_ids + '" />');
  1965. });
  1966. $(".demoteUser").click(function(){
  1967. var parent_idz = $(this).parent().attr('id');
  1968. editUsername = $('#unregister').find('#inputUsername');
  1969. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="user"/><input type="hidden" name="username"value="' + parent_idz + '" />');
  1970. });
  1971. $('#showLess').hide();
  1972. $('#loadMore').click(function () {
  1973. x= (x+5 <= size_li) ? x+5 : size_li;
  1974. $('#versionHistory li:lt('+x+')').show();
  1975. $('#showLess').show();
  1976. if(x == size_li){
  1977. $('#loadMore').hide();
  1978. }
  1979. });
  1980. $('#showLess').click(function () {
  1981. $('#versionHistory li').not(':lt(2)').hide();
  1982. $('#loadMore').show();
  1983. $('#showLess').hide();
  1984. });
  1985. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  1986. $("li[class^='list-group-item']").bind('mouseheld', function(e) {
  1987. $(this).find("span[class^='fa fa-hand-paper-o']").attr("class", "fa fa-hand-grab-o");
  1988. $(this).addClass("dragging");
  1989. $(this).find("div[class^='action-btns tabIconView']").addClass("animated swing");
  1990. $(this).mouseup(function() {
  1991. $(this).find("span[class^='fa fa-hand-grab-o']").attr("class", "fa fa-hand-paper-o");
  1992. $(this).removeClass("dragging");
  1993. $(this).find("div[class^='action-btns tabIconView']").removeClass("animated swing");
  1994. });
  1995. });
  1996. function copyToClipboard(elem) {
  1997. // create hidden text element, if it doesn't already exist
  1998. var targetId = "_hiddenCopyText_";
  1999. var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
  2000. var origSelectionStart, origSelectionEnd;
  2001. if (isInput) {
  2002. // can just use the original source element for the selection and copy
  2003. target = elem;
  2004. origSelectionStart = elem.selectionStart;
  2005. origSelectionEnd = elem.selectionEnd;
  2006. } else {
  2007. // must use a temporary form element for the selection and copy
  2008. target = document.getElementById(targetId);
  2009. if (!target) {
  2010. var target = document.createElement("textarea");
  2011. target.style.position = "absolute";
  2012. target.style.left = "-9999px";
  2013. target.style.top = "0";
  2014. target.id = targetId;
  2015. document.body.appendChild(target);
  2016. }
  2017. target.textContent = elem.textContent;
  2018. }
  2019. // select the content
  2020. var currentFocus = document.activeElement;
  2021. target.focus();
  2022. target.setSelectionRange(0, target.value.length);
  2023. // copy the selection
  2024. var succeed;
  2025. try {
  2026. succeed = document.execCommand("copy");
  2027. } catch(e) {
  2028. succeed = false;
  2029. }
  2030. // restore original focus
  2031. if (currentFocus && typeof currentFocus.focus === "function") {
  2032. //currentFocus.focus();
  2033. }
  2034. if (isInput) {
  2035. // restore prior selection
  2036. elem.setSelectionRange(origSelectionStart, origSelectionEnd);
  2037. } else {
  2038. // clear temporary content
  2039. target.textContent = "";
  2040. }
  2041. return succeed;
  2042. }
  2043. $("img[class^='allIcons']").click(function(){
  2044. $("textarea[id^='copyTarget']").val($(this).attr("src"));
  2045. copyToClipboard(document.getElementById("copyTarget"));
  2046. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2047. $( "div[id^='viewAllIcons']" ).toggle();
  2048. });
  2049. $('body').on('click', 'b.allIcons', function() {
  2050. $("textarea[id^='copyTarget2']").val($(this).attr("title"));
  2051. copyToClipboard(document.getElementById("copyTarget2"));
  2052. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2053. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  2054. });
  2055. </script>
  2056. <script>
  2057. //Custom Themes
  2058. function changeColor(elementName, elementColor) {
  2059. var definedElement = document.getElementById(elementName);
  2060. definedElement.focus();
  2061. definedElement.value = elementColor;
  2062. definedElement.style.backgroundColor = elementColor;
  2063. }
  2064. $('#plexTheme').on('click touchstart', function(){
  2065. changeColor("topbartext", "#E49F0C");
  2066. changeColor("topbar", "#000000");
  2067. changeColor("bottombar", "#000000");
  2068. changeColor("sidebar", "#121212");
  2069. changeColor("hoverbg", "#FFFFFF");
  2070. changeColor("activetabBG", "#E49F0C");
  2071. changeColor("activetabicon", "#FFFFFF");
  2072. changeColor("activetabtext", "#FFFFFF");
  2073. changeColor("inactiveicon", "#949494");
  2074. changeColor("inactivetext", "#B8B8B8");
  2075. changeColor("loading", "#E49F0C");
  2076. changeColor("hovertext", "#000000");
  2077. });
  2078. $('#embyTheme').on('click touchstart', function(){
  2079. changeColor("topbartext", "#52B54B");
  2080. changeColor("topbar", "#212121");
  2081. changeColor("bottombar", "#212121");
  2082. changeColor("sidebar", "#121212");
  2083. changeColor("hoverbg", "#FFFFFF");
  2084. changeColor("activetabBG", "#52B54B");
  2085. changeColor("activetabicon", "#FFFFFF");
  2086. changeColor("activetabtext", "#FFFFFF");
  2087. changeColor("inactiveicon", "#949494");
  2088. changeColor("inactivetext", "#B8B8B8");
  2089. changeColor("loading", "#52B54B");
  2090. changeColor("hovertext", "#000000");
  2091. });
  2092. $('#bookTheme').on('click touchstart', function(){
  2093. changeColor("topbartext", "#FFFFFF");
  2094. changeColor("topbar", "#3B5998");
  2095. changeColor("bottombar", "#3B5998");
  2096. changeColor("sidebar", "#8B9DC3");
  2097. changeColor("hoverbg", "#FFFFFF");
  2098. changeColor("activetabBG", "#3B5998");
  2099. changeColor("activetabicon", "#FFFFFF");
  2100. changeColor("activetabtext", "#FFFFFF");
  2101. changeColor("inactiveicon", "#DFE3EE");
  2102. changeColor("inactivetext", "#DFE3EE");
  2103. changeColor("loading", "#FFFFFF");
  2104. changeColor("hovertext", "#000000");
  2105. });
  2106. $('#spaTheme').on('click touchstart', function(){
  2107. changeColor("topbartext", "#5B391E");
  2108. changeColor("topbar", "#66BBAE");
  2109. changeColor("bottombar", "#66BBAE");
  2110. changeColor("sidebar", "#C3EEE7");
  2111. changeColor("hoverbg", "#66BBAE");
  2112. changeColor("activetabBG", "#C6C386");
  2113. changeColor("activetabicon", "#FFFFFF");
  2114. changeColor("activetabtext", "#FFFFFF");
  2115. changeColor("inactiveicon", "#5B391E");
  2116. changeColor("inactivetext", "#5B391E");
  2117. changeColor("loading", "#5B391E");
  2118. changeColor("hovertext", "#000000");
  2119. });
  2120. $('#darklyTheme').on('click touchstart', function(){
  2121. changeColor("topbartext", "#FFFFFF");
  2122. changeColor("topbar", "#375A7F");
  2123. changeColor("bottombar", "#375A7F");
  2124. changeColor("sidebar", "#222222");
  2125. changeColor("hoverbg", "#464545");
  2126. changeColor("activetabBG", "#FFFFFF");
  2127. changeColor("activetabicon", "#464545");
  2128. changeColor("activetabtext", "#464545");
  2129. changeColor("inactiveicon", "#0CE3AC");
  2130. changeColor("inactivetext", "#0CE3AC");
  2131. changeColor("loading", "#FFFFFF");
  2132. changeColor("hovertext", "#000000");
  2133. });
  2134. $('#slateTheme').on('click touchstart', function(){
  2135. changeColor("topbartext", "#C8C8C8");
  2136. changeColor("topbar", "#272B30");
  2137. changeColor("bottombar", "#272B30");
  2138. changeColor("sidebar", "#32383E");
  2139. changeColor("hoverbg", "#58C0DE");
  2140. changeColor("activetabBG", "#3E444C");
  2141. changeColor("activetabicon", "#C8C8C8");
  2142. changeColor("activetabtext", "#FFFFFF");
  2143. changeColor("inactiveicon", "#C8C8C8");
  2144. changeColor("inactivetext", "#C8C8C8");
  2145. changeColor("loading", "#C8C8C8");
  2146. changeColor("hovertext", "#000000");
  2147. });
  2148. $('#defaultTheme').on('click touchstart', function(){
  2149. changeColor("topbartext", "#FFFFFF");
  2150. changeColor("topbar", "#eb6363");
  2151. changeColor("bottombar", "#eb6363");
  2152. changeColor("sidebar", "#000000");
  2153. changeColor("hoverbg", "#eb6363");
  2154. changeColor("activetabBG", "#eb6363");
  2155. changeColor("activetabicon", "#FFFFFF");
  2156. changeColor("activetabtext", "#FFFFFF");
  2157. changeColor("inactiveicon", "#FFFFFF");
  2158. changeColor("inactivetext", "#FFFFFF");
  2159. changeColor("loading", "#FFFFFF");
  2160. changeColor("hovertext", "#000000");
  2161. });
  2162. $('#redTheme').on('click touchstart', function(){
  2163. changeColor("topbartext", "#FFFFFF");
  2164. changeColor("topbar", "#eb6363");
  2165. changeColor("bottombar", "#eb6363");
  2166. changeColor("sidebar", "#000000");
  2167. changeColor("hoverbg", "#eb6363");
  2168. changeColor("activetabBG", "#eb6363");
  2169. changeColor("activetabicon", "#FFFFFF");
  2170. changeColor("activetabtext", "#FFFFFF");
  2171. changeColor("inactiveicon", "#FFFFFF");
  2172. changeColor("inactivetext", "#FFFFFF");
  2173. changeColor("loading", "#FFFFFF");
  2174. changeColor("hovertext", "#000000");
  2175. });
  2176. $('#monokaiTheme').on('click touchstart', function(){
  2177. changeColor("topbartext", "#66D9EF");
  2178. changeColor("topbar", "#333333");
  2179. changeColor("bottombar", "#333333");
  2180. changeColor("sidebar", "#393939");
  2181. changeColor("hoverbg", "#AD80FD");
  2182. changeColor("activetabBG", "#F92671");
  2183. changeColor("activetabicon", "#FFFFFF");
  2184. changeColor("activetabtext", "#FFFFFF");
  2185. changeColor("inactiveicon", "#66D9EF");
  2186. changeColor("inactivetext", "#66D9EF");
  2187. changeColor("loading", "#66D9EF");
  2188. changeColor("hovertext", "#000000");
  2189. });
  2190. $('#thejokerTheme').on('click touchstart', function(){
  2191. changeColor("topbartext", "#CCCCCC");
  2192. changeColor("topbar", "#000000");
  2193. changeColor("bottombar", "#000000");
  2194. changeColor("sidebar", "#121212");
  2195. changeColor("hoverbg", "#CCC6CC");
  2196. changeColor("activetabBG", "#A50CB0");
  2197. changeColor("activetabicon", "#FFFFFF");
  2198. changeColor("activetabtext", "#FFFFFF");
  2199. changeColor("inactiveicon", "#949494");
  2200. changeColor("inactivetext", "#B8B8B8");
  2201. changeColor("loading", "#CCCCCC");
  2202. changeColor("hovertext", "#000000");
  2203. });
  2204. $('#newPlexTheme').on('click touchstart', function(){
  2205. changeColor("topbartext", "#E5A00D");
  2206. changeColor("topbar", "#282A2D");
  2207. changeColor("bottombar", "#282A2D");
  2208. changeColor("sidebar", "#3F4245");
  2209. changeColor("hoverbg", "#E5A00D");
  2210. changeColor("activetabBG", "#282A2D");
  2211. changeColor("activetabicon", "#E5A00D");
  2212. changeColor("activetabtext", "#E5A00D");
  2213. changeColor("inactiveicon", "#F9F9F9");
  2214. changeColor("inactivetext", "#F9F9F9");
  2215. changeColor("loading", "#E5A00D");
  2216. changeColor("hovertext", "#E0E3E6");
  2217. });
  2218. $('textarea').numberedtextarea({
  2219. // font color for line numbers
  2220. color: null,
  2221. // border color
  2222. borderColor: 'null',
  2223. // CSS class to be added to the line numbers
  2224. class: null,
  2225. // if true Tab key creates indentation
  2226. allowTabChar: true,
  2227. });
  2228. $(".email-header .close-button").click(function () {
  2229. $(".email-content").removeClass("email-active");
  2230. $('html').removeClass("overhid");
  2231. $("#settings-list").find("li").removeClass("active");
  2232. });
  2233. $(document).mouseup(function (e)
  2234. {
  2235. var container = $(".email-content");
  2236. if (!container.is(e.target) && container.has(e.target).length === 0) {
  2237. $(".email-content").removeClass("email-active");
  2238. $('html').removeClass("overhid");
  2239. $("#settings-list").find("li").removeClass("active");
  2240. }
  2241. });
  2242. $( document ).on( 'keydown', function ( e ) {
  2243. if ( e.keyCode === 27 ) { // ESC
  2244. var container = $(".email-content");
  2245. if (!container.is(e.target) && container.has(e.target).length === 0) {
  2246. $(".email-content").removeClass("email-active");
  2247. $('html').removeClass("overhid");
  2248. $("#settings-list").find("li").removeClass("active");
  2249. }
  2250. }
  2251. });
  2252. $("#open-tabs").on("click",function (e) {
  2253. $(".email-content").removeClass("email-active");
  2254. $('html').removeClass("overhid");
  2255. if($(window).width() < 768){
  2256. $('html').addClass("overhid");
  2257. }
  2258. var settingsBox = $('.tab-box');
  2259. settingsBox.addClass("email-active");
  2260. $(this).parent().addClass("active");
  2261. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2262. setTimeout(function(){
  2263. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2264. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2265. refreshMailPreloader.remove();
  2266. });
  2267. },600);
  2268. e.preventDefault();
  2269. });
  2270. $("#open-colors").on("click",function (e) {
  2271. $(".email-content").removeClass("email-active");
  2272. $('html').removeClass("overhid");
  2273. if($(window).width() < 768){
  2274. $('html').addClass("overhid");
  2275. }
  2276. var settingsBox = $('.color-box');
  2277. settingsBox.addClass("email-active");
  2278. $(this).parent().addClass("active");
  2279. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2280. setTimeout(function(){
  2281. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2282. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2283. refreshMailPreloader.remove();
  2284. });
  2285. },600);
  2286. e.preventDefault();
  2287. });
  2288. $("#open-homepage").on("click",function (e) {
  2289. $(".email-content").removeClass("email-active");
  2290. $('html').removeClass("overhid");
  2291. if($(window).width() < 768){
  2292. $('html').addClass("overhid");
  2293. }
  2294. var settingsBox = $('.homepage-box');
  2295. settingsBox.addClass("email-active");
  2296. $(this).parent().addClass("active");
  2297. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2298. setTimeout(function(){
  2299. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2300. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2301. refreshMailPreloader.remove();
  2302. });
  2303. },600);
  2304. e.preventDefault();
  2305. });
  2306. $("#open-advanced").on("click",function (e) {
  2307. $(".email-content").removeClass("email-active");
  2308. $('html').removeClass("overhid");
  2309. if($(window).width() < 768){
  2310. $('html').addClass("overhid");
  2311. }
  2312. var settingsBox = $('.advanced-box');
  2313. settingsBox.addClass("email-active");
  2314. $(this).parent().addClass("active");
  2315. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2316. setTimeout(function(){
  2317. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2318. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2319. refreshMailPreloader.remove();
  2320. });
  2321. },600);
  2322. e.preventDefault();
  2323. });
  2324. $("#open-info").on("click",function (e) {
  2325. $(".email-content").removeClass("email-active");
  2326. $('html').removeClass("overhid");
  2327. if($(window).width() < 768){
  2328. $('html').addClass("overhid");
  2329. }
  2330. var settingsBox = $('.info-box');
  2331. settingsBox.addClass("email-active");
  2332. $(this).parent().addClass("active");
  2333. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2334. setTimeout(function(){
  2335. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2336. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2337. refreshMailPreloader.remove();
  2338. });
  2339. },600);
  2340. e.preventDefault();
  2341. });
  2342. $("#open-users").on("click",function (e) {
  2343. $(".email-content").removeClass("email-active");
  2344. $('html').removeClass("overhid");
  2345. if($(window).width() < 768){
  2346. $('html').addClass("overhid");
  2347. }
  2348. var settingsBox = $('.users-box');
  2349. settingsBox.addClass("email-active");
  2350. $(this).parent().addClass("active");
  2351. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2352. setTimeout(function(){
  2353. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2354. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2355. refreshMailPreloader.remove();
  2356. });
  2357. },600);
  2358. e.preventDefault();
  2359. });
  2360. $("#open-logs").on("click",function (e) {
  2361. $(".email-content").removeClass("email-active");
  2362. $('html').removeClass("overhid");
  2363. if($(window).width() < 768){
  2364. $('html').addClass("overhid");
  2365. }
  2366. var settingsBox = $('.logs-box');
  2367. settingsBox.addClass("email-active");
  2368. $(this).parent().addClass("active");
  2369. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2370. setTimeout(function(){
  2371. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2372. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2373. refreshMailPreloader.remove();
  2374. });
  2375. },600);
  2376. e.preventDefault();
  2377. });
  2378. </script>
  2379. <script>
  2380. $( document ).ready(function() {
  2381. //Hide Icon box on load
  2382. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  2383. //Set Some Scrollbars
  2384. $(".scroller-body").niceScroll({
  2385. railpadding: {top:0,right:0,left:0,bottom:0}
  2386. });
  2387. $(".email-content").niceScroll({
  2388. railpadding: {top:0,right:0,left:0,bottom:0}
  2389. });
  2390. //Stop Div behind From Scrolling
  2391. $( '.email-content' ).on( 'mousewheel', function ( e ) {
  2392. e.preventDefault();
  2393. }, false);
  2394. //Set Hide Function
  2395. if (0) {
  2396. var authTypeFunc = function() {
  2397. // Hide Everything
  2398. $('#host-selected, #host-other, #host-plex, #host-emby, #host-ldap').hide();
  2399. // Qualify Auth Type
  2400. if($('#authType').val() !== "internal"){
  2401. $( '#host-selected' ).show();
  2402. // Qualify aithBackend
  2403. if($('#authBackend').val() === "plex"){
  2404. $('#host-selected, #host-plex').show();
  2405. }else if($('#authBackend').val().indexOf("emby")>=0){
  2406. $('#host-selected, #host-other, #host-emby').show();
  2407. }else if($('#authBackend').val() === "ldap"){
  2408. $('#host-selected, #host-other, #host-ldap').show();
  2409. }else {
  2410. $('#host-selected, #host-other').show();
  2411. }
  2412. }
  2413. }
  2414. //Hide Settings on selection
  2415. $('#authType, #authBackend').on('change', authTypeFunc);
  2416. //Hide Settings on Load
  2417. authTypeFunc();
  2418. } else { console.log() }
  2419. //Simulate Edit Tabs Click
  2420. $("#open-tabs").trigger("click");
  2421. //Append Delete log to User Logs
  2422. $("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>')
  2423. $("a[id^='ToolTables_datatable_0'] span").html('<?php echo $language->translate("PRINT");?>')
  2424. //Enable Tooltips
  2425. $('[data-toggle="tooltip"]').tooltip();
  2426. //Tab save on reload - might need to delete as we changed tab layout
  2427. //rememberTabSelection('#settingsTabs', !localStorage);
  2428. //AJAX call to github to get version info
  2429. $.ajax({
  2430. type: "GET",
  2431. url: "https://api.github.com/repos/causefx/Organizr/releases",
  2432. dataType: "json",
  2433. success: function(github) {
  2434. var currentVersion = "<?php echo INSTALLEDVERSION;?>";
  2435. infoTabVersion = $('#about').find('#version');
  2436. infoTabVersionHistory = $('#about').find('#versionHistory');
  2437. infoTabNew = $('#about').find('#whatsnew');
  2438. infoTabDownload = $('#about').find('#downloadnow');
  2439. $.each(github, function(i,v) {
  2440. if(i === 0){
  2441. console.log(v.tag_name);
  2442. githubVersion = v.tag_name;
  2443. githubDescription = v.body;
  2444. githubName = v.name;
  2445. }
  2446. $(infoTabVersionHistory).append('<li style="display: none"><time class="cbp_tmtime" datetime="' + v.published_at + '"><span>' + v.published_at.substring(0,10) + '</span> <span>' + v.tag_name + '</span></time><div class="cbp_tmicon animated jello"><i class="fa fa-github-alt"></i></div><div class="cbp_tmlabel"><h2 class="text-uppercase">' + v.name + '</h2><p>' + v.body + '</p></div></li>');
  2447. size_li = $("#versionHistory li").size();
  2448. x=2;
  2449. $('#versionHistory li:lt('+x+')').show();
  2450. });
  2451. if(currentVersion < githubVersion){
  2452. console.log("You Need To Upgrade");
  2453. parent.notify("<strong><?php echo $language->translate("NEW_VERSION");?></strong> <?php echo $language->translate("CLICK_INFO");?>","arrow-circle-o-down","warning","50000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2454. $(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);
  2455. $(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>");
  2456. $( "p[id^='upgrade']" ).toggle();
  2457. }else if(currentVersion === githubVersion){
  2458. console.log("You Are on Current Version");
  2459. }else{
  2460. console.log("something went wrong");
  2461. }
  2462. $(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);?>");
  2463. }
  2464. });
  2465. //Edit Info tab with Github info
  2466. <?php if(file_exists(FAIL_LOG)) : ?>
  2467. goodCount = $('#loginStats').find('#goodCount');
  2468. goodPercent = $('#loginStats').find('#goodPercent');
  2469. goodTitle = $('#loginStats').find('#goodTitle');
  2470. badCount = $('#loginStats').find('#badCount');
  2471. badPercent = $('#loginStats').find('#badPercent');
  2472. badTitle = $('#loginStats').find('#badTitle');
  2473. $(goodCount).html("<?php echo $goodLogin;?>");
  2474. $(goodTitle).html("<?php echo $goodPercent;?>%");
  2475. $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");
  2476. $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");
  2477. $(badCount).html("<?php echo $badLogin;?>");
  2478. $(badTitle).html("<?php echo $badPercent;?>%");
  2479. $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");
  2480. $(badPercent).attr('style', "width: <?php echo $badPercent;?>%");
  2481. <?php endif; ?>
  2482. });
  2483. </script>
  2484. </body>
  2485. </html>