settings.php 159 KB

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