Преглед изворни кода

Merge pull request #557 from causefx/cero-dev

Show File fix
causefx пре 8 година
родитељ
комит
e57620e8a3
3 измењених фајлова са 10 додато и 23 уклоњено
  1. 3 3
      ajax.php
  2. 1 3
      functions.php
  3. 6 17
      homepage.php

+ 3 - 3
ajax.php

@@ -16,7 +16,6 @@ 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)) {
 	sendNotification(false, 'No Action Specified!');
@@ -28,11 +27,12 @@ switch ($_SERVER['REQUEST_METHOD']) {
 	case 'GET':
 		switch ($action) {
 			case 'get-calendar':
-				echo json_encode(getCalendar(),JSON_UNESCAPED_SLASHES);
-				//prettyPrint(getcalendar());
+				echo json_encode(getCalendar());
 				die();
 				break;
 			case 'show-file':
+				$auth = ($_SERVER['HTTP_REFERER'] ? true : false);
+				if ($auth === false) { die("WTF? Bro!  This is an internal function only"); }
 				showFile();
 				die();
 				break;

+ 1 - 3
functions.php

@@ -3766,7 +3766,7 @@ function getPlexPlaylists(){
 }
 
 function readExternalLog($type,$filename,$name = null){
-    $log = file($filename);
+    $log = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
     $log = array_reverse($log);
     foreach($log as $line){
 		if(!empty($line) && $line[0] != " "){
@@ -3807,8 +3807,6 @@ function getExtension($string) {
 }
 
 function showFile(){
-	$auth = strpos($_SERVER['HTTP_REFERER'], ".php");
-	if ($auth === false) { die("WTF? Bro!  This is an internal function only"); }
 	$file = $_GET['file'];
 	$fileType = getExtension($file);
 	if($fileType != 'php'){

+ 6 - 17
homepage.php

@@ -363,17 +363,6 @@ foreach(loadAppearance() as $key => $value) {
                                         <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">
@@ -528,7 +517,8 @@ foreach(loadAppearance() as $key => $value) {
 				}
 				e.preventDefault();
 			}else{
-				console.log("nope");
+                var source = $(this).attr("href");
+				window.open(source, '_blank');
 			}
 
         });
@@ -830,9 +820,9 @@ foreach(loadAppearance() as $key => $value) {
                 success: function(data)
                 {
                     newData =  $.parseJSON(data);
-                    console.log(newData);
                     $('#calendar').fullCalendar('removeEvents');
-                    $('#calendar').fullCalendar('addEventSource', newData);         
+                    $('#calendar').fullCalendar('addEventSource', newData);   
+                    console.log('Calendar Entries Added');      
                 }
             });
             setInterval(function() {
@@ -842,12 +832,11 @@ foreach(loadAppearance() as $key => $value) {
                     success: function(data)
                     {
                         newData =  $.parseJSON(data);
-                        console.log(newData);
                         $('#calendar').fullCalendar('removeEvents');
-                        $('#calendar').fullCalendar('addEventSource', newData);         
+                        $('#calendar').fullCalendar('addEventSource', newData);  
+                        console.log('Calendar refreshed');       
                     }
                 });
-                console.log('Calendar updated');
             }, 60000);
         </script>
         <?php } ?>