[Koha-cvs] CVS: koha installer.pl,1.2.2.47,1.2.2.48

Steve Tonnesen tonnesen at users.sourceforge.net
Fri Jun 28 19:05:00 CEST 2002


Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv9307

Modified Files:
      Tag: rel-1-2
	installer.pl 
Log Message:
Installer now offers to password protect the Intranet interface.
Uses basic authentication.


Index: installer.pl
===================================================================
RCS file: /cvsroot/koha/koha/installer.pl,v
retrieving revision 1.2.2.47
retrieving revision 1.2.2.48
diff -C2 -r1.2.2.47 -r1.2.2.48
*** installer.pl	27 Jun 2002 22:51:10 -0000	1.2.2.47
--- installer.pl	28 Jun 2002 17:04:58 -0000	1.2.2.48
***************
*** 509,513 ****
--- 509,562 ----
  EOP
  ;
+ 
+ 
+     print qq|
+ 
+ Intranet Authentication
+ =======================
+ 
+ I can set it up so that the Intranet/Librarian site is password protected.
+ |;
+ print "Would you like to do this? ([Y]/N): ";
+ chomp($input = <STDIN>);
+ 
+ my $apacheauthusername='librarian';
+ my $apacheauthpassword='';
+ unless ($input=~/^n/i) {
+     print "\nEnter a userid to login with [$apacheauthusername]: ";
+     chomp ($input = <STDIN>);
+     if ($input) {
+ 	$apacheauthusername=$input;
+ 	$apacheauthusername=~s/[^a-zA-Z0-9]//g;
+     }
+     while (! $apacheauthpassword) {
+ 	print "\nEnter a password for the $apacheauthusername user: ";
+ 	chomp ($input = <STDIN>);
+ 	if ($input) {
+ 	    $apacheauthpassword=$input;
+ 	}
+ 	if (!$apacheauthpassword) {
+ 	    print "\nPlease enter a password.\n";
+ 	}
+     }
+     open AUTH, ">/etc/kohaintranet.pass";
+     my $chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+     my $salt=substr($chars, int(rand(length($chars))),1);
+     $salt.=substr($chars, int(rand(length($chars))),1);
+     print AUTH $apacheauthusername.":".crypt($apacheauthpassword, $salt)."\n";
+     close AUTH;
+     print SITE <<EOP
+ 
+ <Directory $kohadir>
+     AuthUserFile /etc/kohaintranet.pass
+     AuthType Basic
+     AuthName "Koha Intranet (for librarians only)"
+     Require  valid-user
+ </Directory>
+ EOP
+ }
+ 
      close(SITE);
+ 
      print "Successfully updated Apache Configuration file.\n";
  }





More information about the Koha-cvs mailing list