Changeset 682
- Timestamp:
- Aug 5, 2014, 10:49:06 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r680 r682 1 1 <?php 2 2 3 $Revision = 68 0; // Subversion revision3 $Revision = 682; // Subversion revision 4 4 $DatabaseRevision = 679; // SQL structure revision 5 $ReleaseTime = strtotime('2014-0 7-27');5 $ReleaseTime = strtotime('2014-08-05'); -
trunk/Common/Global.php
r679 r682 433 433 return($PathItems); 434 434 } 435 436 function RepeatFunction($Period, $Function) 437 { 438 while(1) 439 { 440 $StartTime = time(); 441 $Function(); 442 $EndTime = time(); 443 $Delay = $Period - ($EndTime - $StartTime); 444 if($Delay < 0) $Delay = 0; 445 446 echo('Waiting '.$Delay.' seconds...'."\n"); 447 sleep($Delay); 448 } 449 } -
trunk/Modules/Error/Error.php
r586 r682 6 6 var $ShowError; 7 7 var $UserErrors; 8 8 9 9 function __construct($System) 10 10 { … … 21 21 $this->UserErrors = E_ALL; //E_ERROR | E_WARNING | E_PARSE; 22 22 } 23 23 24 24 function DoInstall() 25 25 { … … 28 28 function DoUnInstall() 29 29 { 30 } 31 30 } 31 32 32 function DoStart() 33 33 { … … 36 36 set_exception_handler(array($this, 'ExceptionHandler')); 37 37 } 38 38 39 39 function Stop() 40 40 { … … 43 43 parent::Stop(); 44 44 } 45 45 46 46 function ErrorHandler($Number, $Message, $FileName, $LineNumber, $Variables) 47 47 { … … 60 60 1024 => 'User Notice' 61 61 ); 62 62 63 63 if(($this->UserErrors & $Number)) 64 64 { 65 // Error was suppressed with the @-operator 66 if(0 === error_reporting()) 67 { 68 return false; 69 } 65 70 $Backtrace = debug_backtrace(); 66 71 $Backtrace[0]['function'] = $Message; … … 69 74 $Backtrace[0]['line'] = $LineNumber; 70 75 $this->Report($Backtrace); 71 if((E_ERROR | E_PARSE) & $Number) die(); 76 if((E_ERROR | E_PARSE) & $Number) die(); 72 77 } 73 78 } 74 75 function ExceptionHandler(Exception $Exception) 79 80 function ExceptionHandler(Exception $Exception) 76 81 { 77 $Backtrace = $Exception->getTrace(); 82 $Backtrace = $Exception->getTrace(); 78 83 array_unshift($Backtrace, array( 79 84 'function' => $Exception->getMessage(), … … 84 89 die(); 85 90 } 86 91 87 92 function Report($Backtrace) 88 93 { 89 $Date = date('Y-m-d H:i:s'); 94 $Date = date('Y-m-d H:i:s'); 90 95 $Error = '# '.$Date."\n"; 91 96 foreach($Backtrace as $Item) … … 93 98 if(!array_key_exists('line', $Item)) $Item['line'] = ''; 94 99 if(!array_key_exists('file', $Item)) $Item['file'] = ''; 95 100 96 101 $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function']; 97 102 $Arguments = ''; … … 107 112 } 108 113 $Error .= "\n"; 109 114 110 115 $this->System->ModuleManager->Modules['Log']->NewRecord('Error', 'Log', $Error); 111 116 112 117 //if($Config['Web']['ErrorLogFile'] != '') 113 118 // error_log($Error, 3, $Config['Web']['ErrorLogFile']); … … 117 122 if($this->ShowError == true) 118 123 { 119 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n". 124 if(array_key_exists('REMOTE_ADDR', $_SERVER)) 125 { 126 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n". 120 127 '<meta http-equiv="Content-Language" content="cs">'."\n". 121 128 '<meta http-equiv="Content-Type" content="text/html; charset='.$this->Encoding.'"></head><body>'."\n". 122 129 'Došlo k vnitřní chybě!<br/> O chybě byl uvědoměn správce webu a chybu brzy odstraní.<br/><br/>'); 123 echo('<pre>'.$Error.'</pre><br/>'); // V případě ladění chybu i zobraz 124 echo('</body></html>'); 125 } 130 echo('<pre>'.$Error.'</pre><br/>'); // V případě ladění chybu i zobraz 131 echo('</body></html>'); 132 } else 133 { 134 echo($Error); 135 } 136 } 126 137 } 127 138 } -
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r667 r682 7 7 $System->Run(); 8 8 9 $Path = array('tool', 'netwatch'); 10 $Period = 60; // every 60 seconds 9 function NetwatchImport() 10 { 11 global $System, $Config; 11 12 12 13 while(1)14 {15 13 $StartTime = time(); 16 14 … … 27 25 { 28 26 echo($Subnet['AddressRange'].'/'.$Subnet['Mask'].' on router '.$Subnet['DHCP']."\n"); 29 $Routerboard = new Routerboard(); 30 $Routerboard->UserName = $Config['MainRouter']['UserName']; 31 $Routerboard->Timeout = $Config['MainRouter']['ConnectTimeout']; 32 $Routerboard->HostName = $Subnet['DHCP']; 33 $List = $Routerboard->ListGetPrint($Path, array('host', 'status')); 27 $Routerboard = new RouterosAPI(); 28 $Routerboard->Connect($Subnet['DHCP'], $Config['API']['UserName'], $Config['API']['Password']); 29 if(!$Routerboard->Connected) continue; 30 $Routerboard->Write('/tool/netwatch/getall', false); 31 $Routerboard->Write('=.proplist=host,status'); 32 $Read = $Routerboard->Read(false); 33 $List = $Routerboard->ParseResponse($Read); 34 34 foreach($List as $Properties) 35 35 { … … 96 96 else $System->Database->query('UPDATE `NetworkInterfaceStat` SET `PingCount` = `PingCount` + 1 WHERE (`NetworkInterface`="'.$Interface['Id'].'") AND (`Time` = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 97 97 } 98 99 $EndTime = time();100 $Delay = $Period - ($EndTime - $StartTime);101 if($Delay < 0) $Delay = 0;102 103 echo('Waiting '.$Delay.' seconds...'."\n");104 sleep($Delay);105 98 } 106 99 100 RepeatFunction(60, 'NetwatchImport'); -
trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php
r679 r682 7 7 $System->Run(); 8 8 9 function RepeatFunction($Period, $Function)10 {11 while(1)12 {13 $StartTime = time();14 $Function();15 $EndTime = time();16 $Delay = $Period - ($EndTime - $StartTime);17 if($Delay < 0) $Delay = 0;18 19 echo('Waiting '.$Delay.' seconds...'."\n");20 sleep($Delay);21 }22 }23 24 9 function ReadWirelessRegistration() 25 10 { 26 11 global $System, $Config; 27 12 28 $Path = array('interface', 'wireless', 'registration-table');29 13 $Time = time(); 30 14 … … 40 24 //$Routerboard->Port = 8729; 41 25 $Routerboard->Connect($Device['LocalIP'], $Config['API']['UserName'], $Config['API']['Password']); 26 if(!$Routerboard->Connected) continue; 42 27 $Routerboard->Write('/interface/wireless/registration-table/getall', false); 43 28 $Routerboard->Write('=.proplist=signal-strength,mac-address,rx-rate,tx-rate', false); -
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r677 r682 50 50 $IP = 'ssl://'.$IP; 51 51 } 52 53 52 $this->Socket = @fsockopen($IP, $this->Port, $this->ErrorNo, $this->ErrorStr, $this->Timeout); 54 53 if($this->Socket) … … 146 145 function Read($Parse = true) 147 146 { 147 $Line = ''; 148 148 $Response = array(); 149 149 while (true) { -
trunk/style/new/style.css
r607 r682 178 178 width: auto; 179 179 } 180 181 180 182 181 .SystemMessage h3
Note:
See TracChangeset
for help on using the changeset viewer.