http://wiki.bebot.link/index.php?title=Security_Tech_Notes&feed=atom&action=historySecurity Tech Notes - Revision history2024-03-28T21:38:04ZRevision history for this page on the wikiMediaWiki 1.35.1http://wiki.bebot.link/index.php?title=Security_Tech_Notes&diff=103&oldid=prevB3b0tUzR: Created page with '==== Expert use the Security System in your modules ==== The cache_mgr($action, $cache, $info, $more) function is used to add and remove information from the security cache. The…'2020-09-16T22:47:48Z<p>Created page with '==== Expert use the Security System in your modules ==== The cache_mgr($action, $cache, $info, $more) function is used to add and remove information from the security cache. The…'</p>
<p><b>New page</b></p><div>==== Expert use the Security System in your modules ==== <br />
The cache_mgr($action, $cache, $info, $more) function is used to add and remove information from the security cache. The advanced functions above all use the cache_mgr function to update information. If you are modifying the security database or roster directly in your module (something that in general should not be done) you must use the cache_mgr function to update the security cache as appropriate or your database modifications will not take effect until the bot is restarted. <br />
<br />
Description of function parameters:<br />
$action: add or rem<br />
$cache: Which cache to modify (groups, guests, members, banned, groupmem, orgranks)<br />
$info: The information to add (or remove)<br />
$more: Extra information needed for some actions. (Optional Parameter)<br />
<br />
* Add and remove a guest:<br />
<code php><br />
$this -> cache_mgr("add", "guests", "Glarawyn");<br />
$this -> cache_mgr("rem", "guests", "Glarawyn");<br />
</code><br />
* Add and remove a member:<br />
<code php><br />
$this -> cache_mgr("add", "members", "Glarawyn");<br />
$this -> cache_mgr("rem", "members", "Glarawyn");<br />
</code><br />
* Add and remove a ban:<br />
<code php><br />
$this -> cache_mgr("add", "banned", "Glarawyn");<br />
$this -> cache_mgr("rem", "banned", "Glarawyn");<br />
</code><br />
* Add a group: <br />
<code php><br />
$tmp = array("gid" => "10", "name" => "groupname", "description" = "Example Group", "access_level" => 2);<br />
$this -> cache_mgr("add", "groups", $tmp);<br />
</code><br />
* Remove a group: <br />
<code php><br />
$this -> cache_mgr("rem", "groups", $groupname);<br />
</code><br />
* Add and remove a group member:<br />
<code php><br />
$this -> cache_mgr("add", "groupmem", $groupname, $membername);<br />
$this -> cache_mgr("rem", "groupmem", $groupname, $membername);<br />
</code><br />
* Change an org rank's access level:<br />
<code php><br />
$this -> cache_mgr("add", "orgrank", "President", "255");<br />
</code></div>B3b0tUzR