X-Git-Url: http://git.pk910.de/?p=ZNCAdmin.git;a=blobdiff_plain;f=zncadmin%2FZNCServerV1.class.php;fp=zncadmin%2FZNCServerV1.class.php;h=674d612cfa091988d5f30a7cd21f6284b96a7bbd;hp=59bbfd6e25f602d688b59b9ed44315f94d65e52e;hb=20cd7f168efc290245a261ce8f916d4619897998;hpb=fbde9a30ca3827c5089dc6a64c99028d7065581e diff --git a/zncadmin/ZNCServerV1.class.php b/zncadmin/ZNCServerV1.class.php index 59bbfd6..674d612 100644 --- a/zncadmin/ZNCServerV1.class.php +++ b/zncadmin/ZNCServerV1.class.php @@ -98,7 +98,7 @@ class ZNCServerV1 { altnick ident */ - public function addZNC($username, $password, $settings, $servers, $modules, $others) { + public function addZNC($username, $password, $settings, $servers, $modules, $netmodules, $others) { $html = $this->connector->get("http://".$this->host.":".$this->port."/mods/global/webadmin/adduser"); $exp = explode('name="_CSRF_Check" value="', $html); $exp = explode('"', $exp[1]); @@ -128,7 +128,7 @@ class ZNCServerV1 { $html = $this->connector->post("http://".$this->host.":".$this->port."/mods/global/webadmin/adduser", $post); if(!preg_match("/Invalid Submission/i", $html)) { - if(!$this->addNetwork($username, $settings, $servers, $others)) { + if(!$this->addNetwork($username, $settings, $servers, $netmodules, $others)) { return false; } return !preg_match("/Invalid Submission/i", $html); @@ -136,7 +136,7 @@ class ZNCServerV1 { return !preg_match("/Invalid Submission/i", $html); } - public function addNetwork($username, $settings, $servers, $others) { + public function addNetwork($username, $settings, $servers, $modules, $others) { $html = $this->connector->get("http://".$this->host.":".$this->port."/mods/global/webadmin/addnetwork?user=".$username); $exp = explode('name="_CSRF_Check" value="', $html); $exp = explode('"', $exp[1]); @@ -154,6 +154,13 @@ class ZNCServerV1 { $post['floodrate'] = '1.0'; $post['floodburst'] = '4'; $post['user'] = $username; + + $post['loadmod'] = array(); + foreach($modules as $name => $args) { + $post['loadmod'][] = $name; + if($args != "") + $post['modargs_'.$name] = $args; + } foreach($others as $name => $value) { $post[$name] = $value;