mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Added support for lighttpd server port. Resolves #146
This commit is contained in:
		| @@ -65,7 +65,6 @@ function DisplaySystem() | ||||
|     $status = new StatusMessages(); | ||||
|     $system = new System(); | ||||
|  | ||||
|  | ||||
|     if (isset($_POST['SaveLanguage'])) { | ||||
|         if (isset($_POST['locale'])) { | ||||
|             $_SESSION['locale'] = $_POST['locale']; | ||||
| @@ -73,6 +72,24 @@ function DisplaySystem() | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (isset($_POST['SaveServerPort'])) { | ||||
|         if (isset($_POST['serverPort'])) { | ||||
|             if (strlen($_POST['serverPort']) > 4 || !is_numeric($_POST['serverPort'])) { | ||||
|                 $status->addMessage('Invalid value for port number', 'danger'); | ||||
|             } else { | ||||
|                 $serverPort = escapeshellarg($_POST['serverPort']); | ||||
|                 exec("sudo /etc/raspap/lighttpd/configport.sh $serverPort " .RASPI_LIGHTTPD_CONFIG. " ".$_SERVER['SERVER_NAME'], $return); | ||||
|                 foreach ($return as $line) { | ||||
|                     $status->addMessage($line, 'info'); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     exec('cat '. RASPI_LIGHTTPD_CONFIG, $return); | ||||
|     $conf = ParseConfig($return); | ||||
|     $ServerPort = $conf['server.port']; | ||||
|  | ||||
|     // define locales | ||||
|     $arrLocales = array( | ||||
|         'en_GB.UTF-8' => 'English', | ||||
| @@ -104,5 +121,5 @@ function DisplaySystem() | ||||
|         $result = shell_exec("sudo /sbin/shutdown -h now"); | ||||
|     } | ||||
|  | ||||
|     echo renderTemplate("system", compact("arrLocales", "status", "system")); | ||||
|     echo renderTemplate("system", compact("arrLocales", "status", "system", "ServerPort")); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user