[Rt-commit] rt branch, 4.0/session-cleaner-warning-cleanup, created. rt-4.0.2-190-g7262d8e

Alex Vandiver alexmv at bestpractical.com
Thu Oct 13 16:38:15 EDT 2011


The branch, 4.0/session-cleaner-warning-cleanup has been created
        at  7262d8e459cdcc18a7767db70b3d6b7cbd9ce1f2 (commit)

- Log -----------------------------------------------------------------
commit 7262d8e459cdcc18a7767db70b3d6b7cbd9ce1f2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Oct 13 16:08:11 2011 -0400

    Warnings avoidance when the session cleaner is run with --older
    
    If --older is passed, the 'or' short-circuits the assignment of
    $alogoff, causing "Use of uninitialized value" warnings when it is later
    used.  Solve this by always pulling the AutoLogoff value before the 'if'
    statement.

diff --git a/sbin/rt-clean-sessions.in b/sbin/rt-clean-sessions.in
index 9abd855..1c1ca1a 100644
--- a/sbin/rt-clean-sessions.in
+++ b/sbin/rt-clean-sessions.in
@@ -112,7 +112,8 @@ RT::InitLogging();
 
 require RT::Interface::Web::Session;
 
-if( $opt{'older'} or my $alogoff = int RT->Config->Get('AutoLogoff') ) {
+my $alogoff = int RT->Config->Get('AutoLogoff');
+if ( $opt{'older'} or $alogoff ) {
     my $min;
     foreach ($alogoff*60, $opt{'older'}) {
         next unless $_;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list