default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / rt / sbin / rt-clean-sessions.in
index 1d6e1cf..ac82eae 100644 (file)
@@ -3,7 +3,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -50,27 +50,20 @@ use strict;
 use warnings;
 
 # fix lib paths, some may be relative
-BEGIN {
+BEGIN { # BEGIN RT CMD BOILERPLATE
     require File::Spec;
+    require Cwd;
     my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
     my $bin_path;
 
     for my $lib (@libs) {
         unless ( File::Spec->file_name_is_absolute($lib) ) {
-            unless ($bin_path) {
-                if ( File::Spec->file_name_is_absolute(__FILE__) ) {
-                    $bin_path = ( File::Spec->splitpath(__FILE__) )[1];
-                }
-                else {
-                    require FindBin;
-                    no warnings "once";
-                    $bin_path = $FindBin::Bin;
-                }
-            }
+            $bin_path ||= ( File::Spec->splitpath(Cwd::abs_path(__FILE__)) )[1];
             $lib = File::Spec->catfile( $bin_path, File::Spec->updir, $lib );
         }
         unshift @INC, $lib;
     }
+
 }
 
 use Getopt::Long;
@@ -102,9 +95,9 @@ require RT;
 RT::LoadConfig();
 
 if( $opt{'debug'} ) {
-    RT->Config->Set( LogToScreen => 'debug' );
+    RT->Config->Set( LogToSTDERR => 'debug' );
 } else {
-    RT->Config->Set( LogToScreen => undef );
+    RT->Config->Set( LogToSTDERR => undef );
 }
 
 RT::ConnectToDatabase();