Skip to content

Improvement: BanCreate options #23

@MajorOli

Description

@MajorOli

Description and goal

The current method of Server->banCreate there are missing a few options there we can define with API options.
So to define a Ruleset with Regex sounds very good and we should implement these options.

Also extend:

    public function banCreate(array $rules, int $timeseconds = null, string $reason = null): int
    {
        $rules['time'] = $timeseconds;
        $rules['banreason'] = $reason;

        $banid = $this->execute('banadd', $rules)->toList();

        return $banid['banid'];
    }

with API options

Usage: banadd [ip={regexp}] [name={regexp}] [uid={clientUID}] [mytsid=({mytsid}|empty)]
       [time={timeInSeconds}] [banreason={text}] [lastnickname={nickname}]

Permissions:
  b_client_ban_create

Description:
  Adds a new ban rule on the selected virtual server. All parameters are
  optional but at least one of the following must be set: `ip`, `name`, `uid`, or `mytsid`.

Parameters:
  ip : regex matching the client ip
  name : regex matching the client nickname
  uid : Uid of client
  mytsid : myTS id of client
  time : integer : time in seconds the ban will be active
  banreason : text describing the reason
  lastnickname :

Example:
  banadd ip=1.2.3.4 banreason=just\s4\sfun
  banid=1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions