Author: dgoette
Date: Sun Apr 19 12:36:59 2009
New Revision: 381

URL: http://svn.reactos.org/svn/reactos?rev=381&view=rev
Log:
remove preference for setting duration of sessions (it's asked at login every 
time)

Modified:
    branches/danny-web/www/www.reactos.org/roscms/convert3to4.sql
    branches/danny-web/www/www.reactos.org/roscms/lib/om/Login.class.php
    
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_Login.class.php
    
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_ProfileEdit.class.php

Modified: branches/danny-web/www/www.reactos.org/roscms/convert3to4.sql
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/roscms/convert3to4.sql?rev=381&r1=380&r2=381&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/roscms/convert3to4.sql [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/roscms/convert3to4.sql [iso-8859-1] 
Sun Apr 19 12:36:59 2009
@@ -585,7 +585,6 @@
   match_session tinyint(1) NOT NULL default '1',
   match_browseragent tinyint(1) NOT NULL default '0',
   match_ip tinyint(1) NOT NULL default '0',
-  match_session_expire tinyint(1) NOT NULL default '1',
   activation varchar(200) collate utf8_unicode_ci NOT NULL COMMENT 'account / 
email',
   activation_password varchar(50) collate utf8_unicode_ci NOT NULL COMMENT 
'code to activate the new password',
   created datetime NOT NULL,
@@ -618,7 +617,6 @@
   u.user_setting_multisession,
   u.user_setting_browseragent,
   u.user_setting_ipaddress,
-  u.user_setting_timeout,
   CONCAT(u.user_register_activation,u.user_email_activation) AS activation,
   u.user_roscms_getpwd_id,
   u.user_register,

Modified: branches/danny-web/www/www.reactos.org/roscms/lib/om/Login.class.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/roscms/lib/om/Login.class.php?rev=381&r1=380&r2=381&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/roscms/lib/om/Login.class.php 
[iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/roscms/lib/om/Login.class.php 
[iso-8859-1] Sun Apr 19 12:36:59 2009
@@ -83,7 +83,7 @@
         $stmt=&DBConnection::getInstance()->prepare("SELECT s.user_id, 
s.expires FROM ".ROSCMST_SESSIONS." s JOIN ".ROSCMST_USERS." u ON u.id = 
s.user_id WHERE s.id = :session_id AND (u.match_ip IS FALSE OR s.ip=:ip ) AND 
(u.match_browseragent IS FALSE OR s.browseragent = :agent) AND u.disabled IS 
FALSE LIMIT 1");
       }
       else{
-        $stmt=&DBConnection::getInstance()->prepare("SELECT m.subsys_user_id 
AS user_id, s.expires FROM ".ROSCMST_SESSIONS." s JOIN ".ROSCMST_USERS." u ON 
u.id = s.user_id JOIN ".ROSCMST_SUBSYS." m ON m.user_id = s.user_id WHERE s.id 
= :session_id AND (u.match_ip IS FALSE OR s.ip = :ip) AND (u.match_browseragent 
IS FALSE OR s.browseragent = :agent) AND m.subsys = :subsys AND u.disabled IS 
FALSE LIMIT 1");
+        $stmt=&DBConnection::getInstance()->prepare("SELECT s.user_id, 
s.expires FROM ".ROSCMST_SESSIONS." s JOIN ".ROSCMST_USERS." u ON u.id = 
s.user_id JOIN ".ROSCMST_SUBSYS." m ON m.user_id = s.user_id WHERE s.id = 
:session_id AND (u.match_ip IS FALSE OR s.ip = :ip) AND (u.match_browseragent 
IS FALSE OR s.browseragent = :agent) AND m.subsys = :subsys AND u.disabled IS 
FALSE LIMIT 1");
         $stmt->bindParam('subsys',$subsys,PDO::PARAM_STR);
       }
       $stmt->bindParam('session_id',$session_id,PDO::PARAM_INT);
@@ -203,7 +203,7 @@
     }
 
     // register granted access rights
-    $stmt=&DBConnection::getInstance()->prepare(" SELECT a.name_short FROM 
".ROSCMST_AREA." a JOIN ".ROSCMST_AREA_ACCESS." r ON r.area_id = a.id JOIN 
".ROSCMST_MEMBERSHIPS." m ON m.group_id = r.group_id WHERE m.user_id 
=:user_id");
+    $stmt=&DBConnection::getInstance()->prepare("SELECT a.name_short FROM 
".ROSCMST_AREA." a JOIN ".ROSCMST_AREA_ACCESS." r ON r.area_id = a.id JOIN 
".ROSCMST_MEMBERSHIPS." m ON m.group_id = r.group_id WHERE m.user_id 
=:user_id");
     $stmt->bindparam('user_id',$user['id'],PDO::PARAM_INT);
     $stmt->execute();
 

Modified: 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_Login.class.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_Login.class.php?rev=381&r1=380&r2=381&view=diff
==============================================================================
--- 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_Login.class.php
 [iso-8859-1] (original)
+++ 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_Login.class.php
 [iso-8859-1] Sun Apr 19 12:36:59 2009
@@ -112,7 +112,7 @@
       }
 
       // get user data
-      $stmt=&DBConnection::getInstance()->prepare("SELECT id, password, 
logins, disabled, match_session, match_session_expire FROM ".ROSCMST_USERS." 
WHERE name = :user_name LIMIT 1");
+      $stmt=&DBConnection::getInstance()->prepare("SELECT id, password, 
logins, disabled, match_session FROM ".ROSCMST_USERS." WHERE name = :user_name 
LIMIT 1");
       $stmt->bindParam('user_name',$user_name,PDO::PARAM_STR);
       $stmt->execute() or die('DB error (user login #1)!');
       $user = $stmt->fetchOnce(); 
@@ -170,12 +170,12 @@
       }
 
       // expire = NULL
-      if (isset($_POST['loginoption2']) && $_POST['loginoption2'] == 
'notimeout' && $user['match_session_expire'] == true) {
-        $stmt=&DBConnection::getInstance()->prepare("INSERT INTO 
".ROSCMST_SESSIONS." (id, user_id, expires, browseragent, ipaddress) VALUES 
(:session_id, :user_id, NULL, :useragent, :ip)");
+      if (isset($_POST['loginoption2']) && $_POST['loginoption2'] == 
'notimeout') {
+        $stmt=&DBConnection::getInstance()->prepare("INSERT INTO 
".ROSCMST_SESSIONS." (id, user_id, expires, browseragent, ip) VALUES 
(:session_id, :user_id, NULL, :useragent, :ip)");
         $cookie_time = 0x7fffffff; // 31.12.1969
       }
 
-      // expire = 'DATE_ADD(NOW(), INTERVAL 60 MINUTE)';
+      // expire = 'DATE_ADD(NOW(), INTERVAL 30 MINUTE)';
       else {
         $stmt=&DBConnection::getInstance()->prepare("INSERT INTO 
".ROSCMST_SESSIONS." (id, user_id, expires, browseragent, ip) VALUES 
(:session_id, :user_id, DATE_ADD(NOW(), INTERVAL 30 MINUTE), :useragent, :ip)");
         $cookie_time = time() + 30 * 60;

Modified: 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_ProfileEdit.class.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_ProfileEdit.class.php?rev=381&r1=380&r2=381&view=diff
==============================================================================
--- 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_ProfileEdit.class.php
 [iso-8859-1] (original)
+++ 
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_User_ProfileEdit.class.php
 [iso-8859-1] Sun Apr 19 12:36:59 2009
@@ -73,7 +73,7 @@
             <div class="corner_TR"></div>
           </div>');
 
-    $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, fullname, 
email, activation, homepage, country_id, lang_id, timezone_id, occupation, 
match_session, match_browseragent, match_ip, match_session_expire FROM 
".ROSCMST_USERS." WHERE id = :user_id LIMIT 1");
+    $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, fullname, 
email, activation, homepage, country_id, lang_id, timezone_id, occupation, 
match_session, match_browseragent, match_ip FROM ".ROSCMST_USERS." WHERE id = 
:user_id LIMIT 1");
     $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT);
     $stmt->execute();
     $profile = $stmt->fetchOnce();
@@ -145,7 +145,7 @@
       }
 
       // update account data
-      $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_USERS." 
SET modified = NOW( ) , fullname = :fullname, homepage = :website, lang_id = 
:language, country_id = :country, timezone_id = :timezone, occupation = 
:occupation, match_session = :setting_multisession, match_browseragent = 
:setting_browser, match_ip = :setting_ip, match_session_expire = 
:setting_timeout WHERE id = :user_id LIMIT 1");
+      $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_USERS." 
SET modified = NOW( ) , fullname = :fullname, homepage = :website, lang_id = 
:language, country_id = :country, timezone_id = :timezone, occupation = 
:occupation, match_session = :setting_multisession, match_browseragent = 
:setting_browser, match_ip = :setting_ip WHERE id = :user_id LIMIT 1");
       
$stmt->bindParam('fullname',htmlspecialchars($_POST['userfullname']),PDO::PARAM_STR);
       $stmt->bindParam('website',$_POST['userwebsite'],PDO::PARAM_STR);
       $stmt->bindParam('language',$_POST['language'],PDO::PARAM_INT);
@@ -155,7 +155,6 @@
       
$stmt->bindValue('setting_multisession',isset($_POST['loginoption1']),PDO::PARAM_BOOL);
       
$stmt->bindValue('setting_browser',isset($_POST['loginoption2']),PDO::PARAM_BOOL);
       
$stmt->bindValue('setting_ip',isset($_POST['loginoption3']),PDO::PARAM_BOOL);
-      
$stmt->bindValue('setting_timeout',isset($_POST['loginoption4']),PDO::PARAM_BOOL);
       $stmt->bindParam('user_id',$profile['id'],PDO::PARAM_INT);
       $stmt->execute();
 
@@ -338,9 +337,6 @@
           <br />
           <input name="loginoption3" style="width:auto;" type="checkbox" 
id="loginoption3" value="true"'.((isset($_POST['loginoption3']) || 
(empty($_POST['registerpost']) && $profile['match_ip'] == true)) ? ' 
checked="checked"' : '').' tabindex="13" /> 
           <label style="display:inline;" for="loginoption3">IP Address 
Check</label>
-          <br />
-          <input name="loginoption4" style="width:auto;" type="checkbox" 
id="loginoption4" value="true"'.((isset($_POST['loginoption4']) || 
(empty($_POST['registerpost']) && $profile['match_session_expire'] == true)) ? 
' checked="checked"' : '').' tabindex="14" /> 
-          <label style="display:inline;" for="loginoption4">Log me on 
automatically</label>
         </fieldset>
 
         <div class="field">

Reply via email to