• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with bans on the webiste

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hey, I have problem with Gesior AAC 2012. When someone has temporary ban then on the website it should be shown as:
Code:
(Banished until '.date("j F Y, G:i", $account->getBanTime()).')
but there is:
Code:
Account Status: Premium Account (Banished forever)

and at the bottom (the same warning is in account managment when someone is logged on banned acc):
Code:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\classes\account.php on line 176


characters.php
Code:
            if($account->isBanned())
            {
                if($account->getBanTime() > 0)
                    $main_content .= '<font color="red"><b> (Banished until '.date("j F Y, G:i", $account->getBanTime()).')</b></font>';
                else
                    $main_content .= '<font color="red"><b> (Banished forever)</b></font>';
            }


classes/account.php (from line 160)
Code:
    public function isBanned($forceReload = false)
    {
        $this->loadBans($forceReload);
        $isBanned = false;
        foreach($this->bans as $ban)
        {
            if($ban->getExpires() <= 0 || $ban->getExpires() > time())
                $isBanned = true;
        }
        return $isBanned;
    }

    public function getBanTime($forceReload = false)
    {
        $this->loadBans($forceReload);
        $lastExpires = 0;
        foreach($bans as $ban)
        {
            if($ban->getExpires() <= 0)
            {
                $lastExpires = 0;
                break;
            }
            if($ban->getExpires() > time() && $ban->getExpires() > $lastExpires)
                $lastExpires = $ban->getExpires();
        }
        return $lastExpires;
    }

How can I fix it? :)
 
Back
Top