Просмотр исходного кода

Merge pull request #328 from causefx/develop

Develop
causefx 9 лет назад
Родитель
Сommit
e38fa910f7
100 измененных файлов с 1380 добавлено и 656 удалено
  1. 2 0
      .gitignore
  2. 81 20
      ajax.php
  3. 2 0
      config/.htaccess
  4. 15 2
      config/configDefaults.php
  5. 57 0
      css/settings.css
  6. 0 185
      downloader.php
  7. 38 131
      error.php
  8. 1072 52
      functions.php
  9. 93 244
      homepage.php
  10. BIN
      images/ajenti.png
  11. BIN
      images/alert.png
  12. BIN
      images/arduino.png
  13. BIN
      images/asusrouter.png
  14. BIN
      images/booksonic.png
  15. BIN
      images/calendar.png
  16. BIN
      images/confused.png
  17. BIN
      images/couchpotato.png
  18. BIN
      images/deluge.png
  19. BIN
      images/emby.png
  20. BIN
      images/favicon/android-chrome-192x192.png
  21. BIN
      images/favicon/android-chrome-512x512.png
  22. BIN
      images/favicon/apple-touch-icon.png
  23. BIN
      images/favicon/favicon-16x16.png
  24. BIN
      images/favicon/favicon-32x32.png
  25. BIN
      images/favicon/favicon.ico
  26. BIN
      images/favicon/mstile-150x150.png
  27. 20 22
      images/favicon/safari-pinned-tab.svg
  28. BIN
      images/freenas-logo.png
  29. BIN
      images/gear.png
  30. BIN
      images/gitlab.png
  31. BIN
      images/gitter.png
  32. BIN
      images/grafana.png
  33. BIN
      images/haproxy.png
  34. BIN
      images/headphones.png
  35. BIN
      images/home.png
  36. BIN
      images/homeassitant.png
  37. BIN
      images/hydra.png
  38. BIN
      images/hydra2.png
  39. BIN
      images/jackett.png
  40. BIN
      images/lazylibrarian.png
  41. BIN
      images/login.png
  42. BIN
      images/madsonic.png
  43. BIN
      images/mail.png
  44. BIN
      images/mcmap.png
  45. BIN
      images/meraki.png
  46. BIN
      images/minecraft.png
  47. BIN
      images/motherboard.png
  48. BIN
      images/mumble.png
  49. BIN
      images/mylar.png
  50. BIN
      images/nadaplaying.jpg
  51. BIN
      images/netdata.png
  52. BIN
      images/nzbget.png
  53. BIN
      images/nzbhydra.png
  54. BIN
      images/ombi.png
  55. BIN
      images/openvpn.png
  56. BIN
      images/organizr-load-w-thick.gif
  57. BIN
      images/organizr-logo-h-d.png
  58. BIN
      images/organizr-logo-h.png
  59. BIN
      images/organizr.png
  60. BIN
      images/organizr_logo.png
  61. BIN
      images/organizr_logo_d.png
  62. BIN
      images/owncloud.png
  63. BIN
      images/paint.png
  64. BIN
      images/phpsysinfo.png
  65. BIN
      images/pimpmylog.png
  66. BIN
      images/plex.png
  67. BIN
      images/plexpy.png
  68. BIN
      images/power.png
  69. BIN
      images/proxmox.png
  70. BIN
      images/pvr.png
  71. BIN
      images/pydio.png
  72. BIN
      images/pydio2.png
  73. BIN
      images/pyload.png
  74. BIN
      images/qnap.png
  75. BIN
      images/radarr.png
  76. BIN
      images/resilio.png
  77. BIN
      images/rsscrawler.png
  78. BIN
      images/rutorrent.png
  79. BIN
      images/sabnzbd.png
  80. BIN
      images/security.png
  81. BIN
      images/settings.png
  82. BIN
      images/shellinabox.png
  83. BIN
      images/sickbeard.png
  84. BIN
      images/sickrage.png
  85. BIN
      images/sonarr.png
  86. BIN
      images/sort-btns/sort_asc.png
  87. BIN
      images/sort-btns/sort_both.png
  88. BIN
      images/sort-btns/sort_desc.png
  89. BIN
      images/sowwy.png
  90. BIN
      images/subsonic.png
  91. BIN
      images/sugarcrm.png
  92. BIN
      images/syncthing.png
  93. BIN
      images/synology.png
  94. BIN
      images/teamspeak.png
  95. BIN
      images/themes/darkly.png
  96. BIN
      images/themes/emby.png
  97. BIN
      images/themes/facebook.png
  98. BIN
      images/themes/joker.png
  99. BIN
      images/themes/monokai.png
  100. BIN
      images/themes/newplex.png

+ 2 - 0
.gitignore

@@ -57,8 +57,10 @@ _config.yml
 test.php
 users.db
 config/config.php
+config/config.bak.php
 config/users/
 config/users
 config/users.db
+config/users.bak.db
 
 

+ 81 - 20
ajax.php

@@ -1,84 +1,145 @@
 <?php
-// Include functions if not already included
+// Include functions and user
 require_once('functions.php');
+require_once("user.php");
+$GLOBALS['USER'] = new User('registration_callback');
 
 // Upgrade environment
 upgradeCheck();
 
-// Define Version
- define('INSTALLEDVERSION', '1.31');
-
 // Lazyload settings
 $databaseConfig = configLazy('config/config.php');
 
-// Authorization
-	# Check if user is currently active and allowed to access resource
-	//require_once("user.php");
-	# ^^ I think adding this does that?
-	
 // Get Action
 if (isset($_POST['submit'])) { $action = $_POST['submit']; }
 if (isset($_POST['action'])) { $action = $_POST['action']; }
 if (isset($_GET['action'])) { $action = $_GET['action']; }
 if (isset($_GET['a'])) { $action = $_GET['a']; }
+unset($_POST['action']);
 
 // No Action
 if (!isset($action)) {
-	debug_out('No Action Specified!',1);
+	sendNotification(false, 'No Action Specified!');
 }
 
 // Process Request
+$response = array();
 switch ($_SERVER['REQUEST_METHOD']) {
 	case 'GET':
 		switch ($action) {
 			case 'emby-image':
+				qualifyUser(EMBYHOMEAUTH, true);
 				getEmbyImage();
+				die();
 				break;
 			case 'plex-image':
+				qualifyUser(PLEXHOMEAUTH, true);
 				getPlexImage();
+				die();
 				break;
 			case 'emby-streams':
+				qualifyUser(EMBYHOMEAUTH, true);
 				echo getEmbyStreams(12);
+				die();
 				break;
 			case 'plex-streams':
+				qualifyUser(PLEXHOMEAUTH, true);
 				echo getPlexStreams(12);
+				die();
 				break;
 			case 'emby-recent':
+				qualifyUser(EMBYHOMEAUTH, true);
 				echo getEmbyRecent($_GET['type'], 12);
+				die();
 				break;
 			case 'plex-recent':
+				qualifyUser(PLEXHOMEAUTH, true);
 				echo getPlexRecent($_GET['type'], 12);
+				die();
+				break;
+			case 'sabnzbd-update':
+				qualifyUser(SABNZBDHOMEAUTH, true);
+				echo sabnzbdConnect($_GET['list'] ? $_GET['list'] : die('Error!'));
+				die();
+				break;
+			case 'nzbget-update':
+				qualifyUser(NZBGETHOMEAUTH, true);
+				echo nzbgetConnect($_GET['list'] ? $_GET['list'] : die('Error!'));
+				die();
 				break;
-			
 			default:
-				debug_out('Unsupported Action!',1);
+				sendNotification(false, 'Unsupported Action!');
 		}
 		break;
 	case 'POST':
+		// Check if the user is an admin and is allowed to commit values
+		qualifyUser('admin', true);
 		switch ($action) {
 			case 'upload-images':
 				uploadFiles('images/', array('jpg', 'png', 'svg', 'jpeg', 'bmp'));
+				sendNotification(true);
 				break;
 			case 'remove-images':
 				removeFiles('images/'.(isset($_POST['file'])?$_POST['file']:''));
+				sendNotification(true);
+				break;
+			case 'update-config':
+				sendNotification(updateConfig($_POST));
+				break;
+			case 'update-appearance':
+				// Custom CSS Special Case START
+				if (isset($_POST['customCSS'])) {
+					if ($_POST['customCSS']) {
+						write_ini_file($_POST['customCSS'], 'custom.css');
+					} else {
+						unlink('custom.css');
+					}
+					$response['parent']['reload'] = true;
+				}
+				unset($_POST['customCSS']);
+				// Custom CSS Special Case END
+				$response['notify'] = sendNotification(updateDBOptions($_POST),false,false);
+				break;
+			case 'deleteDB':
+				deleteDatabase();
+				sendNotification(true, 'Database Deleted!');
 				break;
-			case 'editCSS':
-				write_ini_file($_POST["css-show"], "custom.css");
-				echo '<script>window.top.location = window.top.location.href.split(\'#\')[0];</script>';
+			case 'upgradeInstall':
+				upgradeInstall();
+				$response['notify'] = sendNotification(true, 'Performing Checks', false);
+				$response['tab']['goto'] = 'updatedb.php';
+				break;
+			case 'forceBranchInstall':
+				upgradeInstall(GIT_BRANCH);
+				$response['notify'] = sendNotification(true, 'Performing Checks', false);
+				$response['tab']['goto'] = 'updatedb.php';
+				break;
+			case 'deleteLog':
+				sendNotification(unlink(FAIL_LOG));
+				break;
+			case 'submit-tabs':
+				$response['notify'] = sendNotification(updateTabs($_POST) , false, false);
+				$response['show_apply'] = true;
 				break;
 			default:
-				debug_out('Unsupported Action!',1);
+				sendNotification(false, 'Unsupported Action!');
 		}
 		break;
 	case 'PUT':
-		
+		sendNotification(false, 'Unsupported Action!');
 		break;
 	case 'DELETE':
-		
+		sendNotification(false, 'Unsupported Action!');
 		break;
 	default:
-		debug_out('Unknown Request Type!',1);
+		sendNotification(false, 'Unknown Request Type!');
 }
 
-
+if ($response) {
+	header('Content-Type: application/json');
+	echo json_encode($response);
+	die();
+} else {
+	sendNotification(false, 'Error: No Output Specified!');
+}
 

+ 2 - 0
config/.htaccess

@@ -0,0 +1,2 @@
+order deny,allow
+deny from all

+ 15 - 2
config/configDefaults.php

@@ -9,25 +9,33 @@ return array(
 	"plexRecentTV" => "false",
 	"plexRecentMusic" => "false",
 	"plexPlayingNow" => "false",
+	"plexHomeAuth" => false,
 	"embyURL" => "",
 	"embyToken" => "",
 	"embyRecentMovie" => "false",
 	"embyRecentTV" => "false",
 	"embyRecentMusic" => "false",
 	"embyPlayingNow" => "false",
+	"embyHomeAuth" => false,
 	"sonarrURL" => "",
 	"sonarrKey" => "",
+	"sonarrHomeAuth" => false,
 	"sickrageURL" => "",
 	"sickrageKey" => "",
+	"sickrageHomeAuth" => false,
 	"radarrURL" => "",
 	"radarrKey" => "",
+	"radarrHomeAuth" => false,
 	"nzbgetURL" => "",
 	"nzbgetUsername" => "",
 	"nzbgetPassword" => "",
+	"nzbgetHomeAuth" => false,
 	"sabnzbdURL" => "",
 	"sabnzbdKey" => "",
+	"sabnzbdHomeAuth" => false,
 	"headphonesURL" => "",
 	"headphonesKey" => "",
+	"headphonesHomeAuth" => false,
 	"calendarStart" => "0",
 	"calendarView" => "basicWeek",
 	"calendarStartDay" => "30",
@@ -36,7 +44,6 @@ return array(
 	"authBackend" => "",
 	"authBackendCreate" => "true",
 	"authBackendHost" => "",
-	"authBackendPort" => "",
 	"authBackendDomain" => "",
 	"plexUsername" => "",
 	"plexPassword" => "",
@@ -57,5 +64,11 @@ return array(
 	"loadingScreen" => "true",
 	"enableMail" => "false",
 	"slimBar" => "true",
-	"gravatar" => "true"
+	"gravatar" => "true",
+	"calTimeFormat" => "h(:mm)t",
+	"homePageAuthNeeded" => false,
+	"homepageCustomHTML1" => "",
+	"homepageCustomHTML1Auth" => false,
+	"git_branch" => "master",
+	"git_check" => true,
 );

+ 57 - 0
css/settings.css

@@ -0,0 +1,57 @@
+div.colour-field {
+    border: 1px solid #cbd3d5;
+    border-radius: 5px;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    margin-bottom: 15px;
+}
+
+div.colour-field input {
+	color: #000;
+}
+
+input.invalid {
+	background-color: #ffb5b5 !important;
+}
+
+input.invalid + p.help-text::after {
+	content: " - Does not match pattern!";
+}
+
+
+div.form-content input:not([type=radio]) {
+	width: 100% !important;
+}
+
+tab > div.row {
+	padding: 0px 10px 0px 10px;
+}
+
+tab > div.row > div {
+	padding: 1px 5px !important;
+}
+
+tab > div.row > div:first-child {
+	max-width: 42px;
+}
+
+tab > div.row > div:first-child .tabIconView {
+	width: 100% !important;
+	margin: 7px 0px !important;
+}
+
+tab > div.row button {
+	margin: 9px 0px !important;
+}
+
+tab > div.row div.custom-field {
+	margin: 8px 0px !important;
+}
+
+tab p.help-text {
+	margin: 0px !important;
+}
+
+#submitTabs ul > li {
+	padding: 0px 10px !important;
+}

+ 0 - 185
downloader.php

@@ -1,185 +0,0 @@
-<?php
-
-$auth = strpos($_SERVER['HTTP_REFERER'], "homepage.php");
-
-if ($auth === false) { die("WTF? Bro!"); }
-
-require_once("user.php");
-
-isset($_GET['downloader']) ? $downloader = $_GET['downloader'] : die("Error");
-isset($_GET['list']) ? $list = $_GET['list'] : die("Error");
-    
-if($downloader == "nzbget"){
-    
-    $url = NZBGETURL;
-    $username = NZBGETUSERNAME;
-    $password = NZBGETPASSWORD;
-
-    $urlCheck = stripos($url, "http");
-
-    if ($urlCheck === false) {
-
-        $url = "http://" . $url;
-
-    }
-
-    $address = $url;
-
-    $api = file_get_contents("$url/$username:$password/jsonrpc/$list");
-
-    $api = json_decode($api, true);
-
-    $i = 0;
-
-    $gotNZB = "";
-
-    foreach ($api['result'] AS $child) {
-
-        $i++;
-
-        $downloadName = $child['NZBName'];
-        $downloadStatus = $child['Status'];
-        $downloadCategory = $child['Category'];
-
-        if($list == "history"){ 
-            
-            $downloadPercent = "100"; 
-            $progressBar = ""; 
-        
-        }
-        
-        if($list == "listgroups"){ $downloadPercent = (($child['FileSizeMB'] - $child['RemainingSizeMB']) / $child['FileSizeMB']) * 100; $progressBar = "progress-bar-striped active"; }
-        
-        if($child['Health'] <= "750"){ 
-            $downloadHealth = "danger"; 
-        }elseif($child['Health'] <= "900"){ 
-            $downloadHealth = "warning"; 
-        }elseif($child['Health'] <= "1000"){ 
-            $downloadHealth = "success"; 
-        }
-
-        $gotNZB .= '<tr>
-
-                        <td>'.$downloadName.'</td>
-                        <td>'.$downloadStatus.'</td>
-                        <td>'.$downloadCategory.'</td>
-
-                        <td>
-
-                            <div class="progress">
-
-                                <div class="progress-bar progress-bar-'.$downloadHealth.' '.$progressBar.'" role="progressbar" aria-valuenow="'.$downloadPercent.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$downloadPercent.'%">
-
-                                    <p class="text-center">'.round($downloadPercent).'%</p>
-                                    <span class="sr-only">'.$downloadPercent.'% Complete</span>
-
-                                </div>
-
-                            </div>
-
-                        </td>
-
-                    </tr>';
-
-
-    }
-
-    if($i > 0){ echo $gotNZB; }
-    if($i == 0){ echo '<tr><td colspan="4"><p class="text-center">No Results</p></td></tr>'; }
-    
-}
-    
-if($downloader == "sabnzbd"){
-    
-    $url = SABNZBDURL;
-    $key = SABNZBDKEY;
-    
-    $urlCheck = stripos($url, "http");
-
-    if ($urlCheck === false) {
-        
-        $url = "http://" . $url;
-    
-    }
-    
-    $address = $url;
-
-    $api = file_get_contents("$url/api?mode=$list&output=json&apikey=$key&limit=40");
-                    
-    $api = json_decode($api, true);
-    
-    $i = 0;
-    
-    $gotNZB = "";
-    
-    foreach ($api[$list]['slots'] AS $child) {
-        
-        $i++;
-        
-        if($list == "queue"){ 
-            
-            $downloadName = $child['filename']; 
-            $downloadCategory = $child['cat']; 
-            $downloadPercent = (($child['mb'] - $child['mbleft']) / $child['mb']) * 100; 
-            $progressBar = "progress-bar-striped active"; 
-            
-            if($child['missing'] > "400"){ 
-                
-                $downloadHealth = "danger"; 
-            
-            }elseif($child['missing'] <= "200"){ 
-            
-                $downloadHealth = "success"; 
-            
-            }elseif($child['missing'] <= "400"){ 
-            
-                $downloadHealth = "warning"; 
-            
-            }
-
-        } 
-        
-        if($list == "history"){ 
-            
-            $downloadName = $child['name'];
-            $downloadCategory = $child['category']; 
-            $downloadPercent = "100"; 
-            $progressBar = ""; 
-            $downloadHealth = "success"; 
-        
-        }
-        
-        $downloadStatus = $child['status'];
-        
-        $gotNZB .= '<tr>
-
-                        <td>'.$downloadName.'</td>
-                        <td>'.$downloadStatus.'</td>
-                        <td>'.$downloadCategory.'</td>
-
-                        <td>
-
-                            <div class="progress">
-
-                                <div class="progress-bar progress-bar-'.$downloadHealth.' '.$progressBar.'" role="progressbar" aria-valuenow="'.$downloadPercent.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$downloadPercent.'%">
-
-                                    <p class="text-center">'.round($downloadPercent).'%</p>
-                                    <span class="sr-only">'.$downloadPercent.'% Complete</span>
-
-                                </div>
-
-                            </div>
-
-                        </td>
-
-                    </tr>';
-        
-        
-    }
-    
-    if($i > 0){ echo $gotNZB; }
-    if($i == 0){ echo '<tr><td colspan="4"><p class="text-center">No Results</p></td></tr>'; }
-
-}
-
-?>

+ 38 - 131
error.php

@@ -1,19 +1,39 @@
 <?php
+// Include functions if not already included
+require_once('functions.php');
 
-$requested = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+// Upgrade environment
+upgradeCheck();
+
+// Lazyload settings
+$databaseConfig = configLazy('config/config.php');
+
+// Load USER
+require_once("user.php");
+$USER = new User("registration_callback");
+
+// Create Database Connection
+$file_db = new PDO('sqlite:'.DATABASE_LOCATION.'users.db');
+$file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
-if (isset($_GET['error'])) {
-    
-    $status = $_GET['error'];
-    
-}else{
-    
-    $status = "";
-    
+// Some PHP config stuff
+ini_set("display_errors", 1);
+ini_set("error_reporting", E_ALL | E_STRICT);
+
+// Load User List
+$gotUsers = $file_db->query('SELECT * FROM users');
+
+// Load Colours/Appearance
+foreach(loadAppearance() as $key => $value) {
+	$$key = $value;
 }
 
+
+$requested = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+
+$status = (isset($_GET['error'])?$_GET['error']:404);
+
 $codes = array(  
-    
        400 => array('Bad Request', 'The server cannot or will not process the request due to an apparent client error.', 'sowwy'),
        401 => array('Unauthorized', 'You do not have access to this page.', 'sowwy'),
        403 => array('Forbidden', 'The server has refused to fulfill your request.', 'sowwy'),
@@ -25,99 +45,18 @@ $codes = array(
        503 => array('Service Unavailable', 'The server is currently unavailable (because it is overloaded or down for maintenance).', 'confused'),
        504 => array('Gateway Timeout', 'The upstream server failed to send a request in the time allowed by the server.', 'confused'),
        999 => array('Not Logged In', 'You need to be logged in to access this page.', 'confused'),
-    
 );
 
-@$errorTitle = $codes[$status][0];
-@$message = $codes[$status][1];
-@$errorImage = $codes[$status][2];
-
-if ($errorTitle == false || strlen($status) != 3) {
-    
-    $message = 'Please supply a valid status code.';
-    $errorTitle = "Error";
-    $errorImage = "confused";
-
-}
-
-$data = false;
-
-ini_set("display_errors", 1);
-ini_set("error_reporting", E_ALL | E_STRICT);
-
-require_once("user.php");
-require_once("functions.php");
-$USER = new User("registration_callback");
-
-$dbfile = DATABASE_LOCATION.'users.db';
-
-$file_db = new PDO("sqlite:" . $dbfile);
-$file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-
-$dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
-
-$hasOptions = "No";
-
-foreach($dbOptions as $row) :
-
-    if (in_array("options", $row)) :
-    
-        $hasOptions = "Yes";
-    
-    endif;
-
-endforeach;
-
-if($hasOptions == "No") :
-
-    $title = "Organizr";
-    $topbar = "#333333"; 
-    $topbartext = "#66D9EF";
-    $bottombar = "#333333";
-    $sidebar = "#393939";
-    $hoverbg = "#AD80FD";
-    $activetabBG = "#F92671";
-    $activetabicon = "#FFFFFF";
-    $activetabtext = "#FFFFFF";
-    $inactiveicon = "#66D9EF";
-    $inactivetext = "#66D9EF";
-    $loading = "#66D9EF";
-    $hovertext = "#000000";
-
-endif;
-
-if($hasOptions == "Yes") :
-
-    $resulto = $file_db->query('SELECT * FROM options'); 
-                                    
-    foreach($resulto as $row) : 
-
-        $title = isset($row['title']) ? $row['title'] : "Organizr";
-        $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF";
-        $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333";
-        $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333";
-        $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939";
-        $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD";
-        $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671";
-        $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF";
-        $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF";
-        $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF";
-        $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF";
-        $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF";
-        $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000";
-
-    endforeach;
-
-endif;
+$errorTitle = $codes[$status][0];
+$message = $codes[$status][1];
+$errorImage = $codes[$status][2];
 
 ?>
 
 <!DOCTYPE html>
 
 <html lang="en" class="no-js">
-
     <head>
-        
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -125,64 +64,32 @@ endif;
 
         <title><?=$errorTitle;?></title>
 
-        <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
-        <link rel="stylesheet" href="/bower_components/Waves/dist/waves.min.css"> 
-        <link rel="stylesheet" href="/css/style.css">
-        
+        <link rel="stylesheet" href="<?php echo dirname($_SERVER['SCRIPT_NAME']); ?>/bower_components/bootstrap/dist/css/bootstrap.min.css">
+        <link rel="stylesheet" href="<?php echo dirname($_SERVER['SCRIPT_NAME']); ?>/bower_components/Waves/dist/waves.min.css"> 
+        <link rel="stylesheet" href="<?php echo dirname($_SERVER['SCRIPT_NAME']); ?>/css/style.css">
     </head>
-
     <body class="gray-bg" style="padding: 0;">
-
         <div class="main-wrapper" style="position: initial;">
-
             <div style="margin:0 20px; overflow:hidden">
-                
                 <div class="table-wrapper" style="background:<?=$sidebar;?>;">
-                
                     <div class="table-row">
-                
                         <div class="table-cell text-center">
-                        
                             <div class="login i-block">
-                                
                                 <div class="content-box">
-                                    
                                     <div class="biggest-box" style="background:<?=$topbar;?>;">
-                
                                         <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>; font-size: 40px;"><?=$errorTitle;?></h1>
-                
                                     </div>
-                
                                     <div class="big-box text-left">
-                
-                                        <center><img src="/images/<?=$errorImage;?>.png" style="height: 200px;"></center>
+                                        <center><img src="images/<?=$errorImage;?>.png" style="height: 200px;"></center>
                                         <h4 style="color: <?=$topbar;?>;" class="text-center"><?php echo $message;?></h4>
-
-                                        <button style="background:<?=$topbar;?>;" onclick="goBack()" type="button" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("GO_BACK");?></text></button>					                                    
+                                        <button style="background:<?=$topbar;?>;" onclick="window.history.back();" type="button" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
                                     </div>
-                                
                                 </div>
-                            
                             </div>
-                        
                         </div>
-                    
                     </div>
-                
                 </div>
-
             </div>
-
         </div>
-        
-        <script>
-            
-            function goBack() {
-                window.history.back();
-            }
-            
-        </script>
-
     </body>
-
 </html>

Разница между файлами не показана из-за своего большого размера
+ 1072 - 52
functions.php


+ 93 - 244
homepage.php

@@ -14,6 +14,9 @@ $radarr = new Sonarr(RADARRURL, RADARRKEY);
 $sickrage = new SickRage(SICKRAGEURL, SICKRAGEKEY);
 $USER = new User("registration_callback");
 
+// Check if connection to homepage is allowed
+qualifyUser(HOMEPAGEAUTHNEEDED, true);
+
 $dbfile = DATABASE_LOCATION.'users.db';
 
 $file_db = new PDO("sqlite:" . $dbfile);
@@ -26,9 +29,7 @@ $hasOptions = "No";
 foreach($dbOptions as $row) :
 
     if (in_array("options", $row)) :
-    
         $hasOptions = "Yes";
-    
     endif;
 
 endforeach;
@@ -54,7 +55,6 @@ endif;
 if($hasOptions == "Yes") :
 
     $resulto = $file_db->query('SELECT * FROM options'); 
-                                    
     foreach($resulto as $row) : 
 
         $title = isset($row['title']) ? $row['title'] : "Organizr";
@@ -85,7 +85,6 @@ $endDate = date('Y-m-d',strtotime("+".CALENDARENDDAY." days"));
 <html lang="en" class="no-js">
 
     <head>
-        
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -96,7 +95,6 @@ $endDate = date('Y-m-d',strtotime("+".CALENDARENDDAY." days"));
         <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
         <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
         <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css"> 
-        
         <script src="js/menu/modernizr.custom.js"></script>
 
         <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
@@ -105,11 +103,27 @@ $endDate = date('Y-m-d',strtotime("+".CALENDARENDDAY." days"));
 
         <link rel="stylesheet" href="css/style.css">
 
+        <!--Scripts-->
+        <script src="bower_components/jquery/dist/jquery.min.js"></script>
+        <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
+        <script src="bower_components/moment/min/moment.min.js"></script>
+        <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
+        <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
+        <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
+        <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
+        <script src="bower_components/cta/dist/cta.min.js"></script>
+        <script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
+
+        <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
+	    <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
+		
+		<!--Other-->
+		<script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
+		
         <!--[if lt IE 9]>
         <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
         <script src="bower_components/respondJs/dest/respond.min.js"></script>
         <![endif]-->
-        
         <style>
             sort {
                 display: none;
@@ -182,249 +196,153 @@ echo fread($file_handle, filesize($template_file));
 fclose($file_handle);
 echo "\n";
 endif; ?>        
-        
         </style>
-        
     </head>
 
     <body class="scroller-body" style="padding: 0px;">
-
         <div class="main-wrapper" style="position: initial;">
-            
             <div id="content" class="container-fluid">
 <!-- <button id="numBnt">Numerical</button> -->
                 <br/>
-                <?php if(($USER->authenticated && $USER->role == "admin") && (NZBGETURL != "" || SABNZBDURL != "" )) : ?>
+                <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))) { ?>
                 <div id="downloadClientRow" class="row">
                     <sort>2</sort>
-
                     <div class="col-xs-12 col-md-12">
-                        
                         <div class="content-box">
-
                             <div class="tabbable panel with-nav-tabs panel-default">
-
                                 <div class="panel-heading">
-
                                     <div class="content-tools i-block pull-right">
-
                                         <a id="getDownloader" class="repeat-btn">
-
                                             <i class="fa fa-repeat"></i>
-
                                         </a>
-
                                         <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
-                                          
                                             <i class="fa fa-chevron-down"></i>
-                                        
                                         </a>
-                                        
+										<!-- Lets Move This To Homepage Settings
                                         <ul id="downloaderSeconds" class="dropdown-menu" style="top: 32px !important">
-
                                             <li data-value="5000"><a>Refresh every 5 seconds</a></li>
                                             <li data-value="10000"><a>Refresh every 10 seconds</a></li>
                                             <li data-value="30000"><a>Refresh every 30 seconds</a></li>
                                             <li data-value="60000"><a>Refresh every 60 seconds</a></li>
-
                                         </ul>
-
+										-->
                                     </div>
-
                                     <h3 class="pull-left"><?php if(NZBGETURL != ""){ echo "NZBGet "; } if(SABNZBDURL != ""){ echo "SABnzbd "; } ?></h3>
-
                                     <ul class="nav nav-tabs pull-right">
-
                                         <li class="active"><a href="#downloadQueue" data-toggle="tab" aria-expanded="true"><?php echo $language->translate("QUEUE");?></a></li>
-
                                         <li class=""><a href="#downloadHistory" data-toggle="tab" aria-expanded="false"><?php echo $language->translate("HISTORY");?></a></li>
-
                                     </ul>
-
                                     <div class="clearfix"></div>
-
                                 </div>
-
                                 <div class="panel-body">
-
                                     <div class="tab-content">
-
                                         <div class="tab-pane fade active in" id="downloadQueue">
-
                                             <div class="table-responsive" style="max-height: 300px">
-
                                                 <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
-
                                                     <thead>
-
                                                         <tr>
-
                                                             <th><?php echo $language->translate("FILE");?></th>
                                                             <th><?php echo $language->translate("STATUS");?></th>
                                                             <th><?php echo $language->translate("CATEGORY");?></th>
                                                             <th><?php echo $language->translate("PROGRESS");?></th>
-
                                                         </tr>
-
                                                     </thead>
-
-                                                    <tbody id="downloaderQueue">                               
-
-                                                    </tbody>
-
+                                                    <tbody class="dl-queue sabnzbd"></tbody>
+                                                    <tbody class="dl-queue nzbget"></tbody>
                                                 </table>
-
                                             </div>
-
                                         </div>
-
                                         <div class="tab-pane fade" id="downloadHistory">
-
                                             <div class="table-responsive" style="max-height: 300px">
-
                                                 <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
-
                                                     <thead>
-
                                                         <tr>
-
-                                                            <th>File</th>
-                                                            <th>Status</th>
-                                                            <th>Category</th>
-                                                            <th>Progress</th>
-
+                                                            <th><?php echo $language->translate("FILE");?></th>
+                                                            <th><?php echo $language->translate("STATUS");?></th>
+                                                            <th><?php echo $language->translate("CATEGORY");?></th>
+                                                            <th><?php echo $language->translate("PROGRESS");?></th>
                                                         </tr>
-
                                                     </thead>
-
-                                                    <tbody id="downloaderHistory">                                      
-
-                                                    </tbody>
-
+                                                    <tbody class="dl-history sabnzbd"></tbody>
+                                                    <tbody class="dl-history nzbget"></tbody>
                                                 </table>
-
                                             </div>
-
                                         </div>
-
                                     </div>
-
                                 </div>
-
                             </div>
-                            
                         </div>
-
                     </div>
-
                 </div>
-                <?php endif; ?>
-
+                <?php } ?>
+				<?php if (qualifyUser(PLEXHOMEAUTH) && PLEXTOKEN) { ?>
                 <div id="plexRow" class="row">
-                    
                     <sort>3</sort>
 
                     <?php
-                    $plexSize = 0;
-                    if(PLEXRECENTMOVIE == "true"){ $plexSize++; }
-                    if(PLEXRECENTTV == "true"){ $plexSize++; }
-                    if(PLEXRECENTMUSIC == "true"){ $plexSize++; }
-                    if(PLEXPLAYINGNOW == "true"){ $plexSize++; }
-                    if($plexSize >= 4){ $plexSize = 3; }elseif($plexSize == 3){ $plexSize = 4; }elseif($plexSize == 2){ $plexSize = 6; }elseif($plexSize == 1){ $plexSize = 12; }
-                    
-                    if(PLEXRECENTMOVIE == "true"){ echo getPlexRecent("movie", $plexSize); }
-                    if(PLEXRECENTTV == "true"){ echo getPlexRecent("season", $plexSize); }
-                    if(PLEXRECENTMUSIC == "true"){ echo getPlexRecent("album", $plexSize); }
-                    if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams($plexSize); }
+                    $plexSize = (PLEXRECENTMOVIE == "true") + (PLEXRECENTTV == "true") + (PLEXRECENTMUSIC == "true") + (PLEXPLAYINGNOW == "true");
+                    if(PLEXRECENTMOVIE == "true"){ echo getPlexRecent("movie", 12/$plexSize); }
+                    if(PLEXRECENTTV == "true"){ echo getPlexRecent("season", 12/$plexSize); }
+                    if(PLEXRECENTMUSIC == "true"){ echo getPlexRecent("album", 12/$plexSize); }
+                    if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams(12/$plexSize); }
                     ?>
 
                 </div>
-                
+				<?php } ?>
+				<?php if (qualifyUser(EMBYHOMEAUTH) && EMBYTOKEN) { ?>
                 <div id="embyRow" class="row">
-                    
                     <sort>3</sort>
 
                     <?php
-                    $embySize = 0;
-                    if(EMBYRECENTMOVIE == "true"){ $embySize++; }
-                    if(EMBYRECENTTV == "true"){ $embySize++; }
-                    if(EMBYRECENTMUSIC == "true"){ $embySize++; }
-                    if(EMBYPLAYINGNOW == "true"){ $embySize++; }
-                    if($embySize >= 4){ $embySize = 3; }elseif($embySize == 3){ $embySize = 4; }elseif($embySize == 2){ $embySize = 6; }elseif($embySize == 1){ $embySize = 12; }
-                    
-                    if(EMBYRECENTMOVIE == "true"){ echo getEmbyRecent("movie", $embySize); }
-                    if(EMBYRECENTTV == "true"){ echo getEmbyRecent("season", $embySize); }
-                    if(EMBYRECENTMUSIC == "true"){ echo getEmbyRecent("album", $embySize); }
-                    if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams($embySize); }
+                    $embySize = (EMBYRECENTMOVIE == "true") + (EMBYRECENTTV == "true") + (EMBYRECENTMUSIC == "true") + (EMBYPLAYINGNOW == "true");
+                    if(EMBYRECENTMOVIE == "true"){ echo getEmbyRecent("movie", 12/$embySize); }
+                    if(EMBYRECENTTV == "true"){ echo getEmbyRecent("season", 12/$embySize); }
+                    if(EMBYRECENTMUSIC == "true"){ echo getEmbyRecent("album", 12/$embySize); }
+                    if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams(12/$embySize); }
                     ?>
 
                 </div>
-		    
-                <?php if(SONARRURL != "" || RADARRURL != "" || HEADPHONESURL != "" || SICKRAGEURL != "") : ?>
+				<?php } ?>
+                <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
                 <div id="calendarLegendRow" class="row" style="padding: 0 0 10px 0;">
-                    
                     <sort>1</sort>
-                    
                     <div class="col-lg-12 content-form form-inline">
-                        
                         <div class="form-group">
-                        
                             <select class="form-control" id="imagetype_selector" style="width: auto !important; display: inline-block">
-
                                 <option value="all">View All</option>
                                 <?php if(RADARRURL != ""){ echo '<option value="film">Movies</option>'; }?>
                                 <?php if(SONARRURL != "" || SICKRAGEURL != ""){ echo '<option value="tv">TV Shows</option>'; }?>
                                 <?php if(HEADPHONESURL != ""){ echo '<option value="music">Music</option>'; }?>
-
                             </select>
 
                             <span class="label label-primary well-sm">Available</span>
                             <span class="label label-danger well-sm">Unavailable</span>
                             <span class="label indigo-bg well-sm">Unreleased</span>
                             <span class="label light-blue-bg well-sm">Premier</span>
-                            
                         </div>
-                    
                     </div>
-                    
                 </div>
-                
                 <div id="calendarRow" class="row">
-                    
                     <sort>1</sort>
-        
                     <div class="col-lg-12">
-                    
                         <div id="calendar" class="fc-calendar box-shadow fc fc-ltr fc-unthemed"></div>
-                                        
                     </div>
-                                        
                 </div>
-                <?php endif; ?>
-
+                <?php } ?>
+				
+                <?php if (qualifyUser(HOMEPAGECUSTOMHTML1AUTH) && HOMEPAGECUSTOMHTML1) { ?>
+				<div>
+					<?php echo HOMEPAGECUSTOMHTML1; ?>
+				</div>
+                <?php } ?>
             </div>    
-                
         </div>
-        
-        <!--Scripts-->
-        <script src="bower_components/jquery/dist/jquery.min.js"></script>
-        <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
-        <script src="bower_components/moment/min/moment.min.js"></script>
-        <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
-        <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
-        <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
-        <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
-        <script src="bower_components/cta/dist/cta.min.js"></script>
-        
-        <script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
-
-        <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
-	    <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
-        
         <script>
-        
+		function localStorageSupport() {
+			return (('localStorage' in window) && window['localStorage'] !== null)
+		}
+		
         $( document ).ready(function() {
-            
              $('.repeat-btn').click(function(){
                 var refreshBox = $(this).closest('div.content-box');
                 $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
@@ -443,105 +361,50 @@ endif; ?>
                 scrollspeed: 30,
                 mousescrollstep: 60
             });
-            
             $(".table-responsive").niceScroll({
                 railpadding: {top:0,right:0,left:0,bottom:0},
                 scrollspeed: 30,
                 mousescrollstep: 60
             });
-            
             /*$(".carousel-caption").niceScroll({
                 railpadding: {top:0,right:0,left:0,bottom:0},
                 scrollspeed: 30,
                 mousescrollstep: 60
             });*/
-            
             // check if browser support HTML5 local storage
-            function localStorageSupport() {
-                return (('localStorage' in window) && window['localStorage'] !== null)
-            }
-            
-            <?php if(($USER->authenticated && $USER->role == "admin") && (NZBGETURL != "" || SABNZBDURL != "")){ ?>
-            
-            var downloaderSeconds = localStorage.getItem("downloaderSeconds");
-            var myInterval = undefined;
-            $("ul").find("[data-value='" + downloaderSeconds + "']").addClass("active");
-            
-            if(  downloaderSeconds === null ) {
-                localStorage.setItem("downloaderSeconds",'60000');
-                var downloaderSeconds = "60000";
-            }
-            
-            $('#downloaderSeconds li').click(function() {
-                
-                $('#downloaderSeconds li').removeClass("active");
-                $(this).addClass("active");
-
-                var newDownloaderSeconds = $(this).attr('data-value');
-                console.log('New Time is ' + newDownloaderSeconds + ' Old Time was ' + downloaderSeconds);
-                
-                if (localStorageSupport) {
-                    localStorage.setItem("downloaderSeconds",newDownloaderSeconds);
-                }
-                
-                if(typeof myInterval != 'undefined'){ clearInterval(myInterval); }
-                refreshDownloader(newDownloaderSeconds);
-                
-            });
-            
+			
+            <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))){ ?>
+			var queueRefresh = 30000;
+			var historyRefresh = 120000; // This really doesn't need to happen that often
+			
+			var queueLoad = function() {
+				<?php if(SABNZBDURL != "") { echo '$("tbody.dl-queue.sabnzbd").load("ajax.php?a=sabnzbd-update&list=queue");'; } ?>
+				<?php if(NZBGETURL != "") { echo '$("tbody.dl-queue.nzbget").load("ajax.php?a=nzbget-update&list=listgroups");'; } ?>
+			};
+			
+			var historyLoad = function() {
+				<?php if(SABNZBDURL != "") { echo '$("tbody.dl-history.sabnzbd").load("ajax.php?a=sabnzbd-update&list=history");'; } ?>
+				<?php if(NZBGETURL != "") { echo '$("tbody.dl-history.nzbget").load("ajax.php?a=nzbget-update&list=history");'; } ?>
+			};
+			
+			// Initial Loads
+			queueLoad();
+			historyLoad();
+			
+			// Interval Loads
+			var queueInterval = setInterval(queueLoad, queueRefresh);
+			var historyInterval = setInterval(historyLoad, historyRefresh);
+			
+			// Manual Load
+			$("#getDownloader").click(function() {
+				queueLoad();
+				historyLoad();
+			});
             <?php } ?>
-            
-            
-            <?php if(($USER->authenticated && $USER->role == "admin") && NZBGETURL != ""){ ?>
-            
-            $("#downloaderHistory").load("downloader.php?downloader=nzbget&list=history");
-            $("#downloaderQueue").load("downloader.php?downloader=nzbget&list=listgroups");
-            
-            refreshDownloader = function(secs){
-                myInterval = setInterval(function(){
-                    $("#downloaderHistory").load("downloader.php?downloader=nzbget&list=history");
-                    $("#downloaderQueue").load("downloader.php?downloader=nzbget&list=listgroups");
-                }, secs);                
-            }
-
-            refreshDownloader(downloaderSeconds);
-
-            $("#getDownloader").click(function(){
-                $("#downloaderHistory").load("downloader.php?downloader=nzbget&list=history");
-                $("#downloaderQueue").load("downloader.php?downloader=nzbget&list=listgroups");
-                console.log('completed'); 
-            });
-
-            <?php } ?>
-            
-            <?php if(($USER->authenticated && $USER->role == "admin") && SABNZBDURL != ""){ ?>
-            
-            $("#downloaderHistory").load("downloader.php?downloader=sabnzbd&list=history");
-            $("#downloaderQueue").load("downloader.php?downloader=sabnzbd&list=queue");
-            
-            refreshDownloader = function(secs){
-                myInterval = setInterval(function(){
-                    $("#downloaderHistory").load("downloader.php?downloader=sabnzbd&list=history");
-                    $("#downloaderQueue").load("downloader.php?downloader=sabnzbd&list=queue");
-                }, secs);                
-            }
-
-            refreshDownloader(downloaderSeconds);
-
-            $("#getDownloader").click(function(){
-                $("#downloaderHistory").load("downloader.php?downloader=sabnzbd&list=history");
-                $("#downloaderQueue").load("downloader.php?downloader=sabnzbd&list=queue");
-                console.log('completed'); 
-            });
-
-            <?php } ?>
-                        
         });
-             
         </script>
-        <?php if(SONARRURL != "" || RADARRURL != "" || HEADPHONESURL != "" || SICKRAGEURL != "") : ?>
+        <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
         <script>
-            
             $(function () {
 
                 var date = new Date();
@@ -550,52 +413,39 @@ endif; ?>
                 var y = date.getFullYear();
 
                 $('#calendar').fullCalendar({
-                    
                     eventLimit: false, 
                     firstDay: <?php echo CALENDARSTART;?>,
-                  
                     height: "auto",
                     defaultView: '<?php echo CALENDARVIEW;?>',
-                
                     header: {
-                  
                         left: 'prev,next,',
                         center: 'title',
                         right: 'today, month, basicDay,basicWeek,'
-                
                     },
-                
                     views: {
-                    
                         basicDay: { buttonText: '<?php echo $language->translate("DAY");?>', eventLimit: false },
                         basicWeek: { buttonText: '<?php echo $language->translate("WEEK");?>', eventLimit: false },
                         month: { buttonText: '<?php echo $language->translate("MONTH");?>', eventLimit: false },
                         today: { buttonText: '<?php echo $language->translate("TODAY");?>' },
-                
                     },
-                
                     events: [
-<?php if(SICKRAGEURL != ""){ echo getSickrageCalendarWanted($sickrage->future()); echo getSickrageCalendarHistory($sickrage->history("100","downloaded")); } ?>
-<?php if(SONARRURL != ""){ echo getSonarrCalendar($sonarr->getCalendar($startDate, $endDate)); } ?>
-<?php if(RADARRURL != ""){ echo getRadarrCalendar($radarr->getCalendar($startDate, $endDate)); } ?>                 
-<?php if(HEADPHONESURL != ""){ echo getHeadphonesCalendar(HEADPHONESURL, HEADPHONESKEY, "getHistory"); echo getHeadphonesCalendar(HEADPHONESURL, HEADPHONESKEY, "getWanted"); } ?>                                
+<?php if (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH)){ echo getSickrageCalendarWanted($sickrage->future()); echo getSickrageCalendarHistory($sickrage->history("100","downloaded")); } ?>
+<?php if (SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)){ echo getSonarrCalendar($sonarr->getCalendar($startDate, $endDate)); } ?>
+<?php if (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)){ echo getRadarrCalendar($radarr->getCalendar($startDate, $endDate)); } ?>                 
+<?php if (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)){ echo getHeadphonesCalendar(HEADPHONESURL, HEADPHONESKEY, "getHistory"); echo getHeadphonesCalendar(HEADPHONESURL, HEADPHONESKEY, "getWanted"); } ?>                                
                     ],
-                                            
                     eventRender: function eventRender( event, element, view ) {
                         return ['all', event.imagetype].indexOf($('#imagetype_selector').val()) >= 0
                     },
 
                     editable: false,
                     droppable: false,
-
+					timeFormat: '<?php echo CALTIMEFORMAT; ?>',
                 });
-            
             });
-            
             $('#imagetype_selector').on('change',function(){
                 $('#calendar').fullCalendar('rerenderEvents');
             })
-            
             var $divs = $("div.row");
 
             $('#numBnt').on('click', function () {
@@ -604,9 +454,8 @@ endif; ?>
                 });
                 $("#content").html(numericallyOrderedDivs);
             });
-        
         </script>
-        <?php endif; ?>
+        <?php } ?>
 
     </body>
 

BIN
images/ajenti.png


BIN
images/alert.png


BIN
images/arduino.png


BIN
images/asusrouter.png


BIN
images/booksonic.png


BIN
images/calendar.png


BIN
images/confused.png


BIN
images/couchpotato.png


BIN
images/deluge.png


BIN
images/emby.png


BIN
images/favicon/android-chrome-192x192.png


BIN
images/favicon/android-chrome-512x512.png


BIN
images/favicon/apple-touch-icon.png


BIN
images/favicon/favicon-16x16.png


BIN
images/favicon/favicon-32x32.png


BIN
images/favicon/favicon.ico


BIN
images/favicon/mstile-150x150.png


+ 20 - 22
images/favicon/safari-pinned-tab.svg

@@ -2,32 +2,30 @@
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
 <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
- width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
+ width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
  preserveAspectRatio="xMidYMid meet">
 <metadata>
 Created by potrace 1.11, written by Peter Selinger 2001-2013
 </metadata>
-<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
+<g transform="translate(0.000000,16.000000) scale(0.002667,-0.002667)"
 fill="#000000" stroke="none">
-<path d="M4755 9824 c-382 -38 -510 -57 -745 -109 -391 -87 -861 -273 -1235
--488 -185 -106 -464 -304 -655 -462 -127 -106 -458 -432 -587 -578 -168 -190
--401 -516 -532 -742 -239 -411 -443 -976 -524 -1450 -163 -945 -54 -1940 300
--2754 376 -865 1078 -1664 1914 -2176 504 -309 1097 -524 1684 -609 331 -49
-857 -65 1175 -37 812 72 1503 312 2165 754 434 290 828 662 1187 1122 411 527
-708 1177 837 1835 142 722 126 1510 -45 2180 -171 668 -452 1221 -903 1775
--210 258 -628 657 -896 855 -526 389 -1107 655 -1715 784 -366 78 -563 98
--1010 101 -206 1 -393 1 -415 -1z m355 -1508 l0 -603 -127 -7 c-401 -22 -702
--100 -1028 -266 -267 -135 -443 -265 -665 -489 -233 -235 -370 -423 -495 -676
--158 -322 -231 -596 -257 -972 l-12 -173 -605 0 -604 0 6 183 c21 626 194
-1214 515 1747 162 270 323 472 581 731 250 250 449 414 686 566 435 278 962
-470 1460 533 203 25 237 28 388 29 l157 1 0 -604z m525 574 c88 -11 226 -34
-307 -50 708 -145 1367 -516 1898 -1067 686 -712 1035 -1518 1076 -2483 l7
--160 -605 0 -605 0 -7 133 c-18 365 -98 679 -251 992 -150 306 -351 567 -617
-802 -118 104 -258 213 -274 213 -5 0 -156 -854 -335 -1897 l-326 -1898 27 -55
-c89 -179 118 -378 85 -590 -32 -211 -120 -376 -286 -535 -186 -178 -402 -265
--659 -265 -311 0 -579 136 -772 390 -64 84 -132 224 -158 325 -42 159 -37 375
-12 534 89 291 361 557 651 636 l63 17 747 1712 c411 941 750 1721 753 1732 6
-24 -42 52 -226 131 -282 122 -557 184 -877 199 l-143 7 0 605 0 605 178 -6
-c97 -3 249 -15 337 -27z"/>
+<path d="M2907 5424 c-1 -2 -15 -5 -30 -8 -109 -19 -208 -126 -223 -240 -7
+-48 -9 -49 -90 -62 -57 -9 -265 -70 -342 -100 -84 -33 -302 -141 -323 -160 -8
+-8 -18 -14 -22 -14 -8 0 -85 -52 -175 -118 -281 -206 -546 -548 -685 -882 -66
+-159 -142 -444 -147 -550 0 -17 -13 -34 -40 -52 -78 -54 -117 -147 -114 -268
+2 -78 12 -225 18 -257 2 -10 7 -38 10 -63 13 -96 52 -257 91 -375 74 -227 207
+-479 354 -670 242 -316 600 -595 941 -734 30 -12 64 -26 75 -31 73 -32 280
+-92 380 -110 33 -5 73 -13 89 -16 17 -3 47 -21 69 -41 69 -62 117 -77 242 -77
+106 0 293 12 304 18 3 2 28 7 56 11 265 35 610 161 865 315 93 56 224 146 256
+175 7 5 31 25 55 44 81 64 313 306 385 401 215 286 353 577 438 925 14 55 27
+120 31 145 3 25 8 56 10 70 20 101 28 392 14 519 -41 387 -180 773 -394 1101
+-187 287 -478 566 -780 750 -147 90 -471 235 -545 245 -3 0 -11 4 -17 8 -7 5
+-13 6 -13 2 0 -3 -8 -2 -17 4 -19 10 -223 56 -288 66 -23 3 -50 7 -60 9 -64
+12 -369 28 -378 20z m235 -1128 c438 -51 807 -307 1008 -700 97 -190 142 -373
+142 -581 0 -127 -7 -185 -38 -311 -73 -299 -245 -557 -492 -737 -57 -41 -186
+-120 -202 -123 -3 0 -26 -10 -52 -22 -48 -21 -190 -68 -230 -76 -36 -6 -89
+-15 -133 -21 -47 -7 -248 -7 -285 -1 -14 3 -43 7 -65 11 -541 81 -985 525
+-1069 1070 -17 110 -14 347 5 425 4 19 10 46 13 60 32 181 138 398 272 556
+172 204 417 356 674 419 91 23 85 22 190 31 47 3 86 7 87 8 4 3 127 -3 175 -8z"/>
 </g>
 </svg>

BIN
images/freenas-logo.png


BIN
images/gear.png


BIN
images/gitlab.png


BIN
images/gitter.png


BIN
images/grafana.png


BIN
images/haproxy.png


BIN
images/headphones.png


BIN
images/home.png


BIN
images/homeassitant.png


BIN
images/hydra.png


BIN
images/hydra2.png


BIN
images/jackett.png


BIN
images/lazylibrarian.png


BIN
images/login.png


BIN
images/madsonic.png


BIN
images/mail.png


BIN
images/mcmap.png


BIN
images/meraki.png


BIN
images/minecraft.png


BIN
images/motherboard.png


BIN
images/mumble.png


BIN
images/mylar.png


BIN
images/nadaplaying.jpg


BIN
images/netdata.png


BIN
images/nzbget.png


BIN
images/nzbhydra.png


BIN
images/ombi.png


BIN
images/openvpn.png


BIN
images/organizr-load-w-thick.gif


BIN
images/organizr-logo-h-d.png


BIN
images/organizr-logo-h.png


BIN
images/organizr.png


BIN
images/organizr_logo.png


BIN
images/organizr_logo_d.png


BIN
images/owncloud.png


BIN
images/paint.png


BIN
images/phpsysinfo.png


BIN
images/pimpmylog.png


BIN
images/plex.png


BIN
images/plexpy.png


BIN
images/power.png


BIN
images/proxmox.png


BIN
images/pvr.png


BIN
images/pydio.png


BIN
images/pydio2.png


BIN
images/pyload.png


BIN
images/qnap.png


BIN
images/radarr.png


BIN
images/resilio.png


BIN
images/rsscrawler.png


BIN
images/rutorrent.png


BIN
images/sabnzbd.png


BIN
images/security.png


BIN
images/settings.png


BIN
images/shellinabox.png


BIN
images/sickbeard.png


BIN
images/sickrage.png


BIN
images/sonarr.png


BIN
images/sort-btns/sort_asc.png


BIN
images/sort-btns/sort_both.png


BIN
images/sort-btns/sort_desc.png


BIN
images/sowwy.png


BIN
images/subsonic.png


BIN
images/sugarcrm.png


BIN
images/syncthing.png


BIN
images/synology.png


BIN
images/teamspeak.png


BIN
images/themes/darkly.png


BIN
images/themes/emby.png


BIN
images/themes/facebook.png


BIN
images/themes/joker.png


BIN
images/themes/monokai.png


BIN
images/themes/newplex.png


Некоторые файлы не были показаны из-за большого количества измененных файлов