X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/2697173721db10cd600539beed661a06bb9a3f2b..05252a1458855a3a9a3909601e1e894dc1aae590:/Classes/class-rpc.php diff --git a/Classes/class-rpc.php b/Classes/class-rpc.php index 3823db6..7e2b80d 100644 --- a/Classes/class-rpc.php +++ b/Classes/class-rpc.php @@ -1,9 +1,9 @@ content['body']); + curl_setopt($curl, CURLOPT_POSTFIELDS, $this->content['body']); //for debug only! @@ -140,6 +143,7 @@ function rpc_pop_lists() if ($key == "result") foreach($value['list'] as $r) { + RPC_List::$user[] = $r; if (strpos($r['user']['modes'],"o") !== false && strpos($r['user']['modes'],"S") == false) RPC_List::$opercount++; @@ -261,7 +265,20 @@ function rpc_sf_del($name, $mtype, $targets, $action) : bool else { $r = $result['result']['tkl']; - Message::Success($r['name']." [type: ".$r['match_type']."] [targets: ".$r['spamfilter_targets']. "] [action: ".$r['ban_action']."] [reason: ".$r['reason']."] [set by: ".$r['set_by']."]"); + Message::Success("Deleted spamfilter entry: ".$r['name']." [type: ".$r['match_type']."] [targets: ".$r['spamfilter_targets']. "] [action: ".$r['ban_action']."] [reason: ".$r['reason']."] [set by: ".$r['set_by']."]"); } return true; +} + +/** Convert the duration_string */ +function rpc_convert_duration_string($str) +{ + $tok = explode("w", $str); + $weeks = $tok[0]; + $tok = explode("d", $tok[1]); + $days = $tok[0]; + $tok = explode("h", $tok[1]); + $hours = $tok[0]; + return "$weeks weeks, $days days and $hours hours"; + } \ No newline at end of file