projects
/
ZNCAdmin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a002a07
)
fixed some PHP Warnings
author
pk910
<philipp@zoelle1.de>
Sat, 29 Jun 2013 23:11:39 +0000
(
01:11
+0200)
committer
pk910
<philipp@zoelle1.de>
Sat, 29 Jun 2013 23:11:39 +0000
(
01:11
+0200)
zncadmin/ZNCServerV1.class.php
patch
|
blob
|
history
diff --git
a/zncadmin/ZNCServerV1.class.php
b/zncadmin/ZNCServerV1.class.php
index 1cac8e1c0e7586859597f08d561939e6314cdeb5..59bbfd6e25f602d688b59b9ed44315f94d65e52e 100644
(file)
--- a/
zncadmin/ZNCServerV1.class.php
+++ b/
zncadmin/ZNCServerV1.class.php
@@
-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)) {
$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, $other)) {
+ if(!$this->addNetwork($username, $settings, $servers, $other
s
)) {
return false;
}
return !preg_match("/Invalid Submission/i", $html);
return false;
}
return !preg_match("/Invalid Submission/i", $html);
@@
-136,7
+136,7
@@
class ZNCServerV1 {
return !preg_match("/Invalid Submission/i", $html);
}
return !preg_match("/Invalid Submission/i", $html);
}
- public function addNetwork($username, $settings, $servers, $other) {
+ public function addNetwork($username, $settings, $servers, $other
s
) {
$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]);
$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]);
@@
-303,19
+303,25
@@
class ZNCServerV1 {
if($new_servers) {
$post['servers'] = implode("\n", $new_servers);
}
if($new_servers) {
$post['servers'] = implode("\n", $new_servers);
}
- foreach($add_modules as $name => $args) {
- $post['loadmod'][] = $name;
- if($args != "")
- $post['modargs_'.$name] = $args;
+ if($add_modules) {
+ foreach($add_modules as $name => $args) {
+ $post['loadmod'][] = $name;
+ if($args != "")
+ $post['modargs_'.$name] = $args;
+ }
}
}
- foreach($del_modules as $name => $args) {
- foreach($post['loadmod'] as $index => $mod) {
- if(strtolower($mod) == strtolower($name))
- unset($post['loadmod'][$index]);
+ if($del_modules) {
+ foreach($del_modules as $name => $args) {
+ foreach($post['loadmod'] as $index => $mod) {
+ if(strtolower($mod) == strtolower($name))
+ unset($post['loadmod'][$index]);
+ }
}
}
}
}
- foreach($others as $name => $value) {
- $post[$name] = $value;
+ if($others) {
+ foreach($others as $name => $value) {
+ $post[$name] = $value;
+ }
}
$html = $this->connector->post("http://".$this->host.":".$this->port."/mods/global/webadmin/edituser?user=".$username, $post);
return !preg_match("/Invalid Submission/i", $html);
}
$html = $this->connector->post("http://".$this->host.":".$this->port."/mods/global/webadmin/edituser?user=".$username, $post);
return !preg_match("/Invalid Submission/i", $html);