aboutsummaryrefslogtreecommitdiffstats
path: root/include/account.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-08 20:35:15 -0700
committerfriendica <info@friendica.com>2014-09-08 20:35:15 -0700
commitc6d07feff575862b5db8d05e02be6375e51034c7 (patch)
tree8d1bf75a545075753033c47ee28f4d4ae2a96517 /include/account.php
parent8fbeb370db7d1ec16a2f221fb7f022aebe7be109 (diff)
downloadvolse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.tar.gz
volse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.tar.bz2
volse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.zip
This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00'
Diffstat (limited to 'include/account.php')
-rw-r--r--include/account.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/account.php b/include/account.php
index 6cc203dc8..9b4dc409c 100644
--- a/include/account.php
+++ b/include/account.php
@@ -108,7 +108,7 @@ function create_account($arr) {
$parent = ((x($arr,'parent')) ? intval($arr['parent']) : 0 );
$flags = ((x($arr,'account_flags')) ? intval($arr['account_flags']) : ACCOUNT_OK);
$roles = ((x($arr,'account_roles')) ? intval($arr['account_roles']) : 0 );
- $expires = ((x($arr,'expires')) ? intval($arr['expires']) : '0000-00-00 00:00:00');
+ $expires = ((x($arr,'expires')) ? intval($arr['expires']) : NULL_DATE);
$default_service_class = get_config('system','default_service_class');
@@ -511,8 +511,9 @@ function user_approve($hash) {
function downgrade_accounts() {
$r = q("select * from account where not ( account_flags & %d )
- and account_expires != '0000-00-00 00:00:00'
+ and account_expires != '%s'
and account_expires < UTC_TIMESTAMP() ",
+ dbesc(NULL_DATE),
intval(ACCOUNT_EXPIRED)
);
@@ -528,7 +529,7 @@ function downgrade_accounts() {
$x = q("UPDATE account set account_service_class = '%s', account_expires = '%s'
where account_id = %d limit 1",
dbesc($basic),
- dbesc('0000-00-00 00:00:00'),
+ dbesc(NULL_DATE),
intval($rr['account_id'])
);
$ret = array('account' => $rr);