[PATCH] Fixed bug 3068
koha (none)
koha at lmig-iw-test.
Wed Sep 2 21:52:22 CEST 2009
---
C4/Auth.pm | 5 +++++
.../prog/en/modules/help/admin/branches.tmpl | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/C4/Auth.pm b/C4/Auth.pm
index afe5fbf..6ae3541 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -680,6 +680,9 @@ sub checkauth {
if (C4::Context->boolean_preference('IndependantBranch=
es') && C4::Context->boolean_preference('Autolocation')){
# we have to check they are coming from the right =
ip range
my $domain =3D $branches->{$branchcode}->{'branchi=
p'};
+ # escape '.', and replace '*' with 1-3 digits
+ $domain =3D~ s/./\./g;
+ $domain =3D~ s/*/\d{1-3}/g;
if ($ip !~ /^$domain/){
$loggedin=3D0;
$info{'wrongip'} =3D 1;
@@ -690,6 +693,8 @@ sub checkauth {
foreach my $br ( keys %$branches ) {
# now we work with the treatment of ip
my $domain =3D $branches->{$br}->{'branchip'};
+ $domain =3D~ s/./\./g;
+ $domain =3D~ s/*/\d{1-3}/g;
if ( $domain && $ip =3D~ /^$domain/ ) {
$branchcode =3D $branches->{$br}->{'branchcode=
'};
=20
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branches.tm=
pl b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branches.tmpl
index bf397d0..5db9a97 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branches.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branches.tmpl
@@ -4,4 +4,5 @@
=20
<p>Fill in information about your library service outlets on this page.</p>
<p>Begin by defining your branch categories. If, for example, you have one=
main library and several branch libraries, you might set up an "M&quo=
t; (Main) category and a "B" (Branch) category, with descriptions=
"Main Library" and "Branch Library."</p>
-<p>Now add the names and addresses, phone numbers, etc of your libraries i=
n the "Branches" section. (All of your libraries should be descri=
bed here, not just the branch libraries.) Give each library a unique and ea=
sily-remembered code (maximum of four characters). This code will be used i=
n Koha's database to identify each library. When libraries are listed in Ko=
ha, they will be listed in alphabetical order by code.</p><!-- TMPL_INCLUDE=
NAME=3D"help-bottom.inc" -->
\ No newline at end of file
+<p>Now add the names and addresses, phone numbers, etc of your libraries i=
n the "Branches" section. (All of your libraries should be descri=
bed here, not just the branch libraries.) Give each library a unique and ea=
sily-remembered code (maximum of four characters). This code will be used i=
n Koha's database to identify each library. When libraries are listed in Ko=
ha, they will be listed in alphabetical order by code.</p>
+<p>An IP address or range can be specified for a Branch; use '*' to indica=
te a wildcard in any octet.<!-- TMPL_INCLUDE NAME=3D"help-bottom.inc" -->
--=20
1.5.4.3
------------------------------------------------------------
This email message, including any attachments, is for the sole use of the i=
ntended recipient(s) and may contain information that is proprietary, confi=
dential, and exempt from disclosure under applicable law. Any unauthorized =
review, use, disclosure, or distribution is prohibited. If you have receive=
d this email in error please notify the sender by return email and delete t=
he original message. Please note, the recipient should check this email and=
any attachments for the presence of viruses. The organization accepts no l=
iability for any damage caused by any virus transmitted by this email.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
More information about the Koha-patches
mailing list