Add API support for starting and stopping ZM

This commit is contained in:
Kyle Johnson 2015-01-17 12:23:58 -05:00
parent 432c3c9d82
commit 7af0cadd67
1 changed files with 22 additions and 1 deletions

View File

@ -93,4 +93,25 @@ public $components = array('RequestHandler');
} else {
return $this->flash(__('The state could not be deleted. Please, try again.'), array('action' => 'index'));
}
}}
}
public function change() {
$newState = $this->request->params['pass'][0];
$blah = $this->packageControl($newState);
$this->set(array(
'blah' => $blah,
'_serialize' => array('blah')
));
}
public function packageControl( $command ) {
$zm_path_bin = Configure::read('ZM_PATH_BIN');
$string = $zm_path_bin.'/zmpkg.pl '.escapeshellarg( $command );
$status = exec( $string );
return $status;
}
}