Permalink
Browse files

Merging from rel-1-2 to trunk

  • Loading branch information...
1 parent 08e46e6 commit f43a56dd15776dbe919d528a5440f55ff013970b tonnesen committed Oct 28, 2002
Showing with 190 additions and 3 deletions.
  1. +1 −1 admin-home.pl
  2. +1 −1 catalogue-home.pl
  3. +8 −0 charges.pl
  4. +9 −0 deletemem.pl
  5. +5 −0 delitem.pl
  6. +6 −1 groups.pl
  7. +80 −0 member-flags.pl
  8. +80 −0 member-password.pl
View
@@ -13,4 +13,4 @@
my $template = gettemplate("parameters/admin-home.tmpl");
$template->param(loggeninuser => $loggedinuser);
-print $query->header(-cookie => $cookie),$template->output;
+print $query->header(-cookie => $cookie),$template->output;
View
@@ -8,7 +8,7 @@
use HTML::Template;
my $query = new CGI;
-my ($loggedinuser, $cookie, $sessionID) = checkauth($query,1);
+my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
my $template = gettemplate("catalogue/catalogue-home.tmpl");
my $classlist='';
View
@@ -25,8 +25,16 @@
use CGI;
use C4::Context;
use C4::Output;
+use C4::Database;
+use C4::Auth;
my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{circulation}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+
print $input->header;
my $type=$input->param('type');
print startpage();
View
@@ -32,8 +32,17 @@
use C4::Output;
use C4::Circulation::Circ2;
#use C4::Acquisitions;
+use C4::Auth;
+
my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{borrower}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+
+
#print $input->header;
my $member=$input->param('member');
my %env;
View
@@ -29,8 +29,13 @@
use C4::Output;
use C4::Acquisitions;
use C4::Biblio;
+use C4::Auth;
my $input = new CGI;
+my $flagsrequired;
+$flagsrequired->{editcatalogue}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
#print $input->header;
my $item=$input->param('itemnum');
delitem($item);
View
@@ -29,6 +29,11 @@
use C4::Circulation::Circ2;
use C4::Print;
use DBI;
+use C4::Database;
+
+my $configfile=configfile();
+my $intranetdir=$configfile->{'intranetdir'};
+
my $input=new CGI;
my $time=$input->param('time');
@@ -233,7 +238,7 @@ sub printgroup {
my $type=shift;
$output= "<head><title>Overdue list for $groups->{$group}</title></head><body><center>\n";
my $members=groupmembers($env, $group);
- ($type eq 'overdues') && ($output.="<img src=/usr/local/koha/librarian/htdocs/images/overdues.jpg><br>\n");
+ ($type eq 'overdues') && ($output.="<img src=/images/overdues.jpg><br>\n");
$output.= "<table border=1 cellspacing=5 cellpadding=10>\n";
my $typetext='';
($type eq 'overdues') ? ($typetext="Overdues") : ($typetext="Issues");
View
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+
+# script to edit a member's flags
+# Written by Steve Tonnesen
+# July 26, 2002 (my birthday!)
+
+use strict;
+
+use C4::Search;
+use CGI;
+use C4::Output;
+use C4::Auth;
+use C4::Database;
+use C4::Circulation::Circ2;
+#use C4::Acquisitions;
+
+my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{borrowers}=1;
+$flagsrequired->{permissions}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+my $member=$input->param('member');
+my %env;
+$env{'nottodayissues'}=1;
+my %member2;
+$member2{'borrowernumber'}=$member;
+my $issues=currentissues(\%env,\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+ $i++;
+}
+if ($input->param('newflags')) {
+ my $dbh=C4Connect();
+ my $flags=0;
+ foreach ($input->param) {
+ if (/flag-(\d+)/) {
+ my $flag=$1;
+ $flags=$flags+2**$flag;
+ }
+ }
+ my $sth=$dbh->prepare("update borrowers set flags=? where borrowernumber=?");
+ $sth->execute($flags, $member);
+ print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$member");
+} else {
+ my ($bor,$flags,$accessflags)=getpatroninformation(\%env, $member,'');
+
+ my $dbh=C4Connect();
+ my $sth=$dbh->prepare("select bit,flag,flagdesc from userflags order by bit");
+ $sth->execute;
+ my $flagtext='';
+ while (my ($bit, $flag, $flagdesc) = $sth->fetchrow) {
+ my $checked='';
+ if ($accessflags->{$flag}) {
+ $checked='checked';
+ }
+ $flagtext.="<tr><td><input type=checkbox name=flag-$bit $checked></td><td>$flag</td><td>$flagdesc</td></tr>\n";
+ }
+ print $input->header(-cookie => $cookie);
+ print startpage();
+ print startmenu('member');
+ print qq|
+ <h2>$bor->{'surname'}, $bor->{'firstname'}</h2>
+ <form method=post>
+ <input type=hidden name=member value=$member>
+ <input type=hidden name=newflags value=1>
+ <table border=1>
+ <tr><th background=/koha/images/background-mem.gif colspan=3>FLAGS</th></tr>
+ $flagtext
+ </table>
+
+ <p>
+ <input type=submit value="Set Flags">
+ </form>
+ |;
+
+ print endmenu('member');
+ print endpage();
+}
View
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+
+#script to delete items
+#written 2/5/00
+#by chris@katipo.co.nz
+
+use strict;
+
+use C4::Search;
+use CGI;
+use Digest::MD5 qw(md5_base64);
+use C4::Output;
+use C4::Auth;
+use C4::Database;
+use C4::Circulation::Circ2;
+#use C4::Acquisitions;
+
+my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{borrowers}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+#print $input->header;
+my $member=$input->param('member');
+my %env;
+$env{'nottodayissues'}=1;
+my %member2;
+$member2{'borrowernumber'}=$member;
+my $issues=currentissues(\%env,\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+ $i++;
+}
+if ($input->param('newpassword')) {
+ my $digest=md5_base64($input->param('newpassword'));
+ my $uid = $input->param('newuserid');
+ my $dbh=C4Connect();
+ my $sth=$dbh->prepare("update borrowers set userid=?, password=? where borrowernumber=?");
+ $sth->execute($uid, $digest, $member);
+ print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$member");
+} else {
+ my ($bor,$flags)=getpatroninformation(\%env, $member,'');
+ my $userid = $bor->{'userid'};
+
+ my $chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+ my $length=int(rand(2))+4;
+ my $defaultnewpassword='';
+ for (my $i=0; $i<$length; $i++) {
+ $defaultnewpassword.=substr($chars, int(rand(length($chars))),1);
+ }
+ my $spellitout=$defaultnewpassword;
+ $spellitout=~s/l/\001/g;
+ $spellitout=~s/1/\002/g;
+ $spellitout=~s/O/\003/g;
+ $spellitout=~s/o/\004/g;
+ $spellitout=~s/0/\005/g;
+ $spellitout=~s/\001/ <b>el<\/b> /g;
+ $spellitout=~s/\002/ <b>one<\/b> /g;
+ $spellitout=~s/\003/ <b>Oh<\/b> /g;
+ $spellitout=~s/\004/ <b>oh<\/b> /g;
+ $spellitout=~s/\005/ <b>zero<\/b> /g;
+
+ print $input->header(-cookie => $cookie);
+ print startpage();
+ print startmenu('member');
+ print qq|
+ <h2>$bor->{'surname'}, $bor->{'firstname'}</h2>
+ <form method=post>
+ <input type=hidden name=member value=$member>
+ New UserID: <input name=newuserid size=20 value=$userid> <br>
+ New Password: <input name=newpassword size=20 value=$defaultnewpassword>
+ <p>
+ <input type=submit value="Confirm Password">
+ </form>
+ |;
+
+ print endmenu('member');
+ print endpage();
+}

0 comments on commit f43a56d

Please sign in to comment.