* fixed creating account :(

* fixed showing premium account status
This commit is contained in:
slawkens1 2017-10-20 21:15:46 +02:00
parent c6b6638705
commit 5951fe21ec
2 changed files with 7 additions and 1 deletions

View File

@ -334,6 +334,9 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
throw new E_OTS_NotLoaded(); throw new E_OTS_NotLoaded();
} }
if(fieldExist('premdays', 'accounts'))
return $this->data['premdays'];
if($this->data['lastday'] == 0) if($this->data['lastday'] == 0)
return 0; return 0;
@ -345,6 +348,9 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
{ {
global $config; global $config;
if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return true; if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return true;
if(fieldExist('premdays', 'accounts'))
return $this->data['premdays'] > 0;
return $this->data['lastday'] > time(); return $this->data['lastday'] > time();
//return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0); //return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0);
} }

View File

@ -123,7 +123,7 @@ Also you have to agree to the terms presented below. If you have done so, your a
<table border="0" cellspacing="0" cellpadding="0" > <table border="0" cellspacing="0" cellpadding="0" >
<tr> <tr>
<td style="border:0px;" > <td style="border:0px;" >
<input type="hidden" name="step" value="save" > <input type="hidden" name="save" value="1" >
{{ include('buttons.submit.html.twig') }} {{ include('buttons.submit.html.twig') }}
</td> </td>
</tr> </tr>