[Koha-cvs] koha/C4 Auth.pm

Henri-Damien LAURENT laurenthdl at alinto.com
Wed Jul 11 12:24:24 CEST 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Changes by:	Henri-Damien LAURENT <hdl>	07/07/11 10:24:24

Modified files:
	C4             : Auth.pm 

Log message:
	Adding KohaAdminEmailAdress
	Adding LoginBranchCode
	Adding a redirect to maintenance.pl for OPAC when installer required.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Auth.pm?cvsroot=koha&r1=1.68&r2=1.69

Patches:
Index: Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- Auth.pm	10 Jul 2007 14:21:41 -0000	1.68
+++ Auth.pm	11 Jul 2007 10:24:24 -0000	1.69
@@ -36,7 +36,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.68 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.69 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -119,7 +119,7 @@
         $in->{'authnotrequired'},
         $in->{'flagsrequired'},
         $in->{'type'}
-    );
+    ) unless ($in->{'template_name'}=~/maintenance/);
 
     my $borrowernumber;
     my $insecure = C4::Context->preference('insecure');
@@ -222,6 +222,7 @@
             TemplateEncoding   => C4::Context->preference("TemplateEncoding"),
             AmazonContent      => C4::Context->preference("AmazonContent"),
             LibraryName        => C4::Context->preference("LibraryName"),
+            LoginBranchcode    => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
             LoginBranchname    => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
             AutoLocation       => C4::Context->preference("AutoLocation"),
             hide_marc          => C4::Context->preference("hide_marc"),
@@ -231,6 +232,7 @@
             suggestion => C4::Context->preference("suggestion"),
             virtualshelves => C4::Context->preference("virtualshelves"),
             LibraryName => C4::Context->preference("LibraryName"),
+            KohaAdminEmailAddress     => "" . C4::Context->preference("KohaAdminEmailAddress"),
         );
     }
     else {
@@ -240,6 +242,7 @@
         $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
         $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
 	$template->param(
+            KohaAdminEmailAddress     => "" . C4::Context->preference("KohaAdminEmailAddress"),
             suggestion     => "" . C4::Context->preference("suggestion"),
             virtualshelves => "" . C4::Context->preference("virtualshelves"),
             OpacNav        => "" . C4::Context->preference("OpacNav"),
@@ -256,6 +259,7 @@
             AmazonContent => "" . C4::Context->preference("AmazonContent"),
             LibraryName   => "" . C4::Context->preference("LibraryName"),
             LibraryNameTitle   => "" . $LibraryNameTitle,
+            LoginBranchcode    => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
             LoginBranchname    => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"", 
             OpacPasswordChange => C4::Context->preference("OpacPasswordChange"),
             opacreadinghistory => C4::Context->preference("opacreadinghistory"),
@@ -344,13 +348,23 @@
     my $dbh     = C4::Context->dbh;
     # check that database and koha version are the same
     unless (C4::Context->preference('Version')){
+      if ($type ne 'opac'){
       warn "Install required, redirecting to Installer";
       print $query->redirect("/cgi-bin/koha/installer/install.pl");
+      } else {
+        warn "OPAC Install required, redirecting to maintenance";
+        print $query->redirect("/cgi-bin/koha/maintenance.pl");
+      }       
       exit;
     }
     if (C4::Context->preference('Version') < C4::Context->config("kohaversion")){
+      if ($type ne 'opac'){
       warn "Database update needed, redirecting to Installer. Database is ".C4::Context->preference('Version')." and Koha is : ".C4::Context->config("kohaversion");
       print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3");
+      } else {
+      warn "OPAC :Database update needed, redirecting to maintenance. Database is ".C4::Context->preference('Version')." and Koha is : ".C4::Context->config("kohaversion");
+        print $query->redirect("/cgi-bin/koha/maintenance.pl");
+      }       
       exit;
     }
     my $timeout = C4::Context->preference('timeout');





More information about the Koha-cvs mailing list