HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/intranet.kauko.lt/wp-content/plugins/wise-chat/src/commands/WiseChatUnbanCommand.php
<?php

/**
 * WiseChat command: /unban
 *
 * @author Kainex <contact@kainex.pl>
 */
class WiseChatUnbanCommand extends WiseChatAbstractCommand {
	public function execute() {
		$ip = isset($this->arguments[0]) ? $this->arguments[0] : null;
		if ($ip === null) {
            $this->addMessage('Please specify the IP address');
            return;
        }

        $ban = $this->bansDAO->getByIp($ip);
        if ($ban !== null) {
            $this->bansDAO->deleteByIp($ban->getIp());
            $this->addMessage("Ban on IP address ".$ban->getIp()." has been removed");
        } else {
            $this->addMessage('This IP address has not been banned');
        }
	}
}