]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - Classes/class-rpc.php
Merge branch 'main' of https://github.com/ValwareIRC/unrealircd-webpanel
[irc/unrealircd/unrealircd-webpanel.git] / Classes / class-rpc.php
index a7770259a65cc45981754737506c024554e1aeaf..7e2b80dd0582f4a98c216a8aa751e0de3940ce65 100644 (file)
@@ -143,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++;
@@ -267,4 +268,17 @@ function rpc_sf_del($name, $mtype, $targets, $action) : bool
                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