X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=zncadmin%2FZNCServer.class.php;h=d001947fcf7c2f67f9a088919c805c99c870846a;hb=d5830d94902b927fe42edb37b0854b5d3ed6c067;hp=35724a1c1994628cfa283a2a8c4b84872a71ce1c;hpb=68a600683c091740094edc47f27286e9719f644a;p=ZNCAdmin.git diff --git a/zncadmin/ZNCServer.class.php b/zncadmin/ZNCServer.class.php index 35724a1..d001947 100644 --- a/zncadmin/ZNCServer.class.php +++ b/zncadmin/ZNCServer.class.php @@ -16,6 +16,11 @@ * along with this program. If not, see . */ +define("ERR_OK", 0); +define("ERR_UNKNOWN", 1); +define("ERR_MODULE_NOT_FOUND", 2); +define("ERR_USER_NOT_FOUND", 3); + class ZNCServer { private $host, $port; private $connector; @@ -135,11 +140,7 @@ class ZNCServer { $this->connector->post("http://".$this->host.":".$this->port."/mods/webadmin/deluser", $post); } - public function editZNC($username, $password = NULL, $new_servers = NULL, $add_modules = NULL, $del_modules = NULL, $others = NULL) { - $html = $this->connector->get("http://".$this->host.":".$this->port."/mods/webadmin/edituser?user=".$username); - if(preg_match("/No such username/i", $html)) return false; - $post = array(); - $post['loadmod'] = array(); + private function parseHTMLFields($html, &$post) { preg_match_all("]*)>", $html, $matches); foreach($matches[0] as $input) { $fields = array(0 => ""); @@ -208,6 +209,58 @@ class ZNCServer { $content = $content[0]; $post[$name] = $content; } + //select boxes + $selectboxes = explode("