<?php
-
/**
* RPC Functionality for UnrealIRCd Admin Webpanel
* License: GPLv3 or later
- * Author: Valware
+ * Author: ValwareIRC
+ * GitHub URI: ValwareIRC/unrealircd-webpanel
* 2023
*/
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
+ if (UNREALIRCD_DEBUG)
+ do_log("SENDING JSON:", $this->content['body']);
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $this->content['body']);
//for debug only!
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++;
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