diff options
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | database.sql | 3 | ||||
-rw-r--r-- | include/api.php | 2 | ||||
-rw-r--r-- | include/auth.php | 4 | ||||
-rw-r--r-- | mod/openid.php | 2 | ||||
-rw-r--r-- | update.php | 9 |
6 files changed, 16 insertions, 6 deletions
@@ -9,7 +9,7 @@ require_once("include/pgettext.php"); define ( 'FRIENDIKA_VERSION', '2.3.1108' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1088 ); +define ( 'DB_UPDATE_VERSION', 1089 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 444b05faa..ba52d9f35 100644 --- a/database.sql +++ b/database.sql @@ -413,6 +413,9 @@ CREATE TABLE IF NOT EXISTS `user` ( `pwdreset` char(255) NOT NULL, `maxreq` int(11) NOT NULL DEFAULT '10', `expire` int(11) unsigned NOT NULL DEFAULT '0', + `account_expired` tinyint( 1 ) NOT NULL DEFAULT '0', + `account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, diff --git a/include/api.php b/include/api.php index 5d008c290..74b4aaf6e 100644 --- a/include/api.php +++ b/include/api.php @@ -55,7 +55,7 @@ // process normal login request $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) - AND `password` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1", + AND `password` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `verified` = 1 LIMIT 1", dbesc(trim($user)), dbesc(trim($user)), dbesc($encrypted) diff --git a/include/auth.php b/include/auth.php index b7b96bdc0..1f16b3504 100644 --- a/include/auth.php +++ b/include/auth.php @@ -49,7 +49,7 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p } $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` - FROM `user` WHERE `uid` = %d LIMIT 1", + FROM `user` WHERE `uid` = %d AND `blocked` = 0 AND `account_expired` = 0 AND `verified` = 1 LIMIT 1", intval($_SESSION['uid']) ); @@ -186,7 +186,7 @@ else { $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) - AND `password` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1", + AND `password` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `verified` = 1 LIMIT 1", dbesc(trim($_POST['openid_url'])), dbesc(trim($_POST['openid_url'])), dbesc($encrypted) diff --git a/mod/openid.php b/mod/openid.php index 3c3293147..b8734f023 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -56,7 +56,7 @@ function openid_content(&$a) { $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` - FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1", + FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `verified` = 1 LIMIT 1", dbesc($_SESSION['openid']) ); if(! count($r)) { diff --git a/update.php b/update.php index 82ae05872..6101efea6 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1088 ); +define( 'UPDATE_VERSION' , 1089 ); /** * @@ -743,3 +743,10 @@ function update_1087() { } } } + +function update_1088() { + q("ALTER TABLE `user` ADD `account_expired` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `expire` , + ADD `account_expires_on` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `account_expired` , + ADD `expire_notification_sent` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `account_expires_on` "); +} + |