Audit module: audit log and address bans
This commit is contained in:
1 parent
b75403e5ea
commit
d2ea1bacac
41 files changed
+2137
-5
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace IriksIT\Manager\Models;
|
||||
|
||||
/**
|
||||
* What someone wrote down about an address: who or what it is, or why it was banned, and the
|
||||
* group it belongs to (`group_name`: addresses with the same name are banned and let back in
|
||||
* together). One note per address, kept until it is removed: unlike the audit log and an ended
|
||||
* ban it is never deleted by the prune command, so a privacy policy has to say so.
|
||||
*/
|
||||
class IpNote extends Model
|
||||
{
|
||||
/** One spelling per address, so the note of an IPv6 address is found however it is written. */
|
||||
public static function spell(string $ip): string
|
||||
{
|
||||
$packed = @inet_pton(trim($ip));
|
||||
$spelled = $packed === false ? false : inet_ntop($packed);
|
||||
|
||||
return $spelled === false ? trim($ip) : $spelled;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user