import rt 3.4.6
[freeside.git] / rt / html / Elements / SetupSessionCookie
index e72f458..bd78613 100644 (file)
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
 %# 
 %# COPYRIGHT:
 %#  
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
 %#                                          <jesse@bestpractical.com>
 %# 
 %# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
 %# works based on those contributions, and sublicense and distribute
 %# those contributions and any derivatives thereof.
 %# 
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
 <%init>
 return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook
 
@@ -75,18 +75,25 @@ my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm;
 
         # If the session is invalid, create a new session.
         if ( $@ =~ /Object does not/i ) {
-            tie %session, $session_class, undef,
-             $backends{$RT::DatabaseType} ? {
+            tie %session, $session_class, undef, $backends{$RT::DatabaseType}
+              ? {
                 Handle     => $RT::Handle->dbh,
                 LockHandle => $RT::Handle->dbh,
-              } : {
+              }
+              : {
                 Directory     => $RT::MasonSessionDir,
                 LockDirectory => $RT::MasonSessionDir,
               };
             undef $cookies{$cookiename};
         }
         else {
-            die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct.";
+            die loc("RT couldn't store your session.") . "\n"
+              . loc(
+"This may mean that that the directory '[_1]' isn't writable or a database table is missing or corrupt.",
+                $RT::MasonSessionDir
+              )
+              . "\n\n"
+              . $@;
         }
     }