[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6539] trunk
- Subject: SF.net SVN: ledger-smb:[6539] trunk
- From: ..hidden..
- Date: Sun, 19 Jan 2014 02:55:31 +0000
Revision: 6539
http://sourceforge.net/p/ledger-smb/code/6539
Author: einhverfr
Date: 2014-01-19 02:55:30 +0000 (Sun, 19 Jan 2014)
Log Message:
-----------
Autotimeout of sessions now works, defaults to yes. Can be disabled by setting 'only timeout locks' to 'yes' in system/defaults
Modified Paths:
--------------
trunk/LedgerSMB/Scripts/configuration.pm
trunk/LedgerSMB/Session.pm
trunk/old-handler.pl
trunk/sql/modules/Session.sql
Modified: trunk/LedgerSMB/Scripts/configuration.pm
===================================================================
--- trunk/LedgerSMB/Scripts/configuration.pm 2014-01-19 02:16:07 UTC (rev 6538)
+++ trunk/LedgerSMB/Scripts/configuration.pm 2014-01-19 02:55:30 UTC (rev 6539)
@@ -57,8 +57,8 @@
label => $locale->text('Password Duration') },
{ name => 'session_timeout',
label => $locale->text('Session Timeout'), },
- { name => 'auto_logout',
- label => $locale->text('Automatically Logout'),
+ { name => 'never_logout',
+ label => $locale->text('Only Timeout Locks'),
type => 'YES_NO', },
{ name => 'separate_duties',
label => $locale->text('Separate Duties'),
Modified: trunk/LedgerSMB/Session.pm
===================================================================
--- trunk/LedgerSMB/Session.pm 2014-01-19 02:16:07 UTC (rev 6538)
+++ trunk/LedgerSMB/Session.pm 2014-01-19 02:55:30 UTC (rev 6539)
@@ -18,6 +18,7 @@
use LedgerSMB::Sysconfig;
use Log::Log4perl;
use LedgerSMB::Auth;
+use CGI::Simple;
use strict;
my $logger = Log::Log4perl->get_logger('LedgerSMB');
@@ -36,8 +37,7 @@
my $path = ($ENV{SCRIPT_NAME});
$path =~ s|[^/]*$||;
my $secure;
-
- if ($cookie eq 'Login'){
+ if (($cookie eq 'Login') or ($cookie =~ /^::/)){
return create($form);
}
my $timeout;
@@ -109,9 +109,8 @@
if ($ENV{SERVER_PORT} == 443){
$secure = ' Secure;';
}
- print qq|Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=; path=$path;$secure\n|;
- LedgerSMB::Auth::credential_prompt();
- return 0;
+ destroy($form);
+ LedgerSMB::Auth::credential_prompt;
}
}
@@ -256,8 +255,9 @@
if ($ENV{SERVER_PORT} == 443){
$secure = ' Secure;';
}
- print qq|Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=; path=$path;$secure\n|;
-
+ print qq|Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=::$form->{company}; path=$path;$secure\n|;
+ $dbh->commit; # called before anything else on the page, make sure the
+ # session is really gone. -CT
}
1;
Modified: trunk/old-handler.pl
===================================================================
--- trunk/old-handler.pl 2014-01-19 02:16:07 UTC (rev 6538)
+++ trunk/old-handler.pl 2014-01-19 02:55:30 UTC (rev 6539)
@@ -161,6 +161,7 @@
"$msg1 <p><a href=\"login.pl\" target=\"_top\">$msg2</a></p>");
}
+try {
$form->db_init( \%myconfig );
&check_password;
@@ -178,7 +179,6 @@
$LedgerSMB::App_State::Locale = $locale;
# pull in the main code
-try {
#eval {
$logger->trace("requiring bin/$form->{script}");
require "bin/$form->{script}";
Modified: trunk/sql/modules/Session.sql
===================================================================
--- trunk/sql/modules/Session.sql 2014-01-19 02:16:07 UTC (rev 6538)
+++ trunk/sql/modules/Session.sql 2014-01-19 02:55:30 UTC (rev 6539)
@@ -119,9 +119,9 @@
PERFORM *
FROM defaults
- WHERE setting_key = 'auto_logout' and value = '1';
+ WHERE setting_key = 'never_logout' and value = '0';
- IF FOUND THEN
+ IF NOT FOUND THEN
RAISE NOTICE 'auto logout';
RETURN NULL;
ELSE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits