diff --git a/boot.php b/boot.php index 226bc3d019..c73ab3d6ea 100644 --- a/boot.php +++ b/boot.php @@ -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', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 444b05faa9..ba52d9f35d 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 5d008c2909..74b4aaf6e1 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 b7b96bdc0b..1f16b35047 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 3c32931471..b8734f0234 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 82ae058729..6101efea6d 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@