* fixed displaying premium account days

* function OTS_Account:getPremDays will now return -1 if there's
freePremium configurable enabled on the server
This commit is contained in:
slawkens1
2018-01-08 00:08:17 +01:00
parent 087988dde3
commit 85083f5979
2 changed files with 8 additions and 1 deletions

View File

@@ -358,6 +358,8 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
return round(($this->data['premend'] - time()) / (24 * 60 * 60), 2);
}
global $config;
if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return -1;
return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));
}