koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Auth.pm,1.4,1.5


From: Steve Tonnesen
Subject: [Koha-cvs] CVS: koha/C4 Auth.pm,1.4,1.5
Date: Thu, 04 Jul 2002 22:03:39 -0700

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

Modified Files:
        Auth.pm 
Log Message:
Minor changes to authentication routines.


Index: Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Auth.pm     4 Jul 2002 21:22:21 -0000       1.4
--- Auth.pm     5 Jul 2002 05:03:37 -0000       1.5
***************
*** 37,41 ****
      if ($sth->rows) {
        my ($userid, $ip, $lasttime) = $sth->fetchrow;
!       if ($lasttime<time()-20) {
            # timed logout
            warn "$sessionID logged out due to inactivity.";
--- 37,41 ----
      if ($sth->rows) {
        my ($userid, $ip, $lasttime) = $sth->fetchrow;
!       if ($lasttime<time()-20 && $userid ne 'tonnesen') {
            # timed logout
            warn "$sessionID logged out due to inactivity.";
***************
*** 44,48 ****
            $sti->execute($sessionID);
            open L, ">>/tmp/sessionlog";
!           print L "$userid from $ip logged out at ".localtime(time())." 
(inactivity).\n";
            close L;
        } elsif ($ip ne $ENV{'REMOTE_ADDR'}) {
--- 44,49 ----
            $sti->execute($sessionID);
            open L, ">>/tmp/sessionlog";
!           my $time=localtime(time());
!           printf L "%20s from %16s logged out at %30s (inactivity).\n", 
$userid, $ip, $time;
            close L;
        } elsif ($ip ne $ENV{'REMOTE_ADDR'}) {
***************
*** 73,88 ****
        my $userid=$query->param('userid');
        my $password=$query->param('password');
!       if ($userid eq 'librarian' && $password eq 'koha') {
            my $sti=$dbh->prepare("insert into sessions (sessionID, userid, 
ip,lasttime) values (?, ?, ?, ?)");
            $sti->execute($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time());
            open L, ">>/tmp/sessionlog";
!           print L "$userid from ".$ENV{'REMOTE_ADDR'}." logged in at 
".localtime(time()).".\n";
!           close L;
!           return ($userid, $sessionID, $sessionID);
!       } elsif ($userid eq 'patron' && $password eq 'koha') {
!           my $sti=$dbh->prepare("insert into sessions (sessionID, userid, 
ip,lasttime) values (?, ?, ?, ?)");
!           $sti->execute($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time());
!           open L, ">>/tmp/sessionlog";
!           print L "$userid from ".$ENV{'REMOTE_ADDR'}." at 
".localtime(time()).".\n";
            close L;
            return ($userid, $sessionID, $sessionID);
--- 74,83 ----
        my $userid=$query->param('userid');
        my $password=$query->param('password');
!       if (($userid eq 'librarian' || $userid eq 'tonnesen' || $userid eq 
'patron') && $password eq 'koha') {
            my $sti=$dbh->prepare("insert into sessions (sessionID, userid, 
ip,lasttime) values (?, ?, ?, ?)");
            $sti->execute($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time());
            open L, ">>/tmp/sessionlog";
!           my $time=localtime(time());
!           printf L "%20s from %16s logged in  at %30s.\n", $userid, 
$ENV{'REMOTE_ADDR'}, $time;
            close L;
            return ($userid, $sessionID, $sessionID);
***************
*** 104,113 ****
  <center>
  <h2>$message</h2>
  <form method=post>
! <table border=1>
! <tr><th colspan=2><font size=+2>Koha Login</font></th></tr>
! <tr><td>Name:</td><td><input name=userid></td></tr>
! <tr><td>Password:</td><td><input type=password name=password></td></tr>
! <tr><td colspan=2 align=center><input type=submit value=login></td></tr>
  </table>
  </form>
--- 99,128 ----
  <center>
  <h2>$message</h2>
+ 
  <form method=post>
! <table border=0 cellpadding=10 width=60%>
!     <tr><td align=center valign=top>
!     <table border=0 bgcolor=#dddddd cellpadding=10>
!     <tr><th colspan=2 background=/images/background-mem.gif><font 
size=+2>Koha Login</font></th></tr>
!     <tr><td>Name:</td><td><input name=userid></td></tr>
!     <tr><td>Password:</td><td><input type=password name=password></td></tr>
!     <tr><td colspan=2 align=center><input type=submit value=login></td></tr>
!     </table>
!     
!     </td><td align=center valign=top>
! 
!     <table border=0 bgcolor=#dddddd cellpadding=10>
!     <tr><th background=/images/background-mem.gif><font size=+2>Demo 
Information</font></th></tr>
!     <td>
!     Log in as librarian/koha or patron/koha.  The timeout is set to 20 
seconds of
!     inactivity for the purposes of this demo.  You can navigate to the 
Circulation
!     or Acquisitions modules and you should see an indicator in the upper left 
of
!     the screen saying who you are logged in as.  If you want to try it out 
with
!     a longer timout period, log in as tonnesen/koha and the timeout period 
will
!     be 10 minutes.
!     </td>
!     </tr>
!     </table>
!     </td></tr>
  </table>
  </form>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]