]> git.mxchange.org Git - friendica.git/commitdiff
account expiration structures
authorFriendika <info@friendika.com>
Mon, 19 Sep 2011 02:53:45 +0000 (19:53 -0700)
committerFriendika <info@friendika.com>
Mon, 19 Sep 2011 02:53:45 +0000 (19:53 -0700)
boot.php
database.sql
include/api.php
include/auth.php
mod/openid.php
update.php

index 226bc3d0199c6327d2057e77b550be7b227c511e..c73ab3d6ea32d4a122b5f051cdfba2a093290184 100644 (file)
--- 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',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
index 444b05faa9f6bc2d18e5da8a513d955c9ca4f28e..ba52d9f35df7625eb19b3813df3af72b79e88185 100644 (file)
@@ -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, 
index 5d008c290955cc58caa6b84d4f6e17530e9bff3b..74b4aaf6e1d85e5cedbf998194c7c57c2813f1bc 100644 (file)
@@ -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)
index b7b96bdc0bb7f3f047c2ede73dd29a8eeb3a075e..1f16b350479a9074da639249f35cb336eee229bc 100644 (file)
@@ -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)
index 3c32931471025ee3ca2ecf4d257151ffcdebbdde..b8734f02342810d390a89747f4a6d7919d8b0d71 100644 (file)
@@ -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)) {
index 82ae0587296f5a43098a274603c966f36e4615ef..6101efea6d1e4d70f64da66d3119948ed307c494 100644 (file)
@@ -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` ");
+}
+