|
@@ -18,6 +18,7 @@ class ServeradminParser {
|
|
|
|
|
|
|
|
private $data = Array();
|
|
private $data = Array();
|
|
|
private $result;
|
|
private $result;
|
|
|
|
|
+ private $serveradmin = "/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin";
|
|
|
|
|
|
|
|
// Funkcja inicjujaca objekt
|
|
// Funkcja inicjujaca objekt
|
|
|
public function serveradminParser($key = "") {
|
|
public function serveradminParser($key = "") {
|
|
@@ -26,7 +27,7 @@ class ServeradminParser {
|
|
|
|
|
|
|
|
// Funkcja pobierajaca dane z serveradmin i wywolujaca funkcje parsujaca dane tekstowe do arraya
|
|
// Funkcja pobierajaca dane z serveradmin i wywolujaca funkcje parsujaca dane tekstowe do arraya
|
|
|
private function getData($key) {
|
|
private function getData($key) {
|
|
|
- $conf = shell_exec("sudo serveradmin set ".$key);
|
|
|
|
|
|
|
+ $conf = shell_exec("sudo ".$this->serveradmin." settings ".$key." 2>&1");
|
|
|
$this->data = $this->txtToArr($conf);
|
|
$this->data = $this->txtToArr($conf);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -73,7 +74,7 @@ class ServeradminParser {
|
|
|
// Funkcja wprowadzajaca zmiany w zycie
|
|
// Funkcja wprowadzajaca zmiany w zycie
|
|
|
public function applyConf() {
|
|
public function applyConf() {
|
|
|
$conf = $this->getConf();
|
|
$conf = $this->getConf();
|
|
|
- $result = shell_exec("echo '".$conf."' | serveradmin set");
|
|
|
|
|
|
|
+ $result = shell_exec("echo '".$conf."' | sudo ".$this->serveradmin." settings");
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
|
|
|