version 1.7, 2003/05/01 20:26:28
|
version 1.9, 2003/05/02 15:26:36
|
Line 58 sub show_key_list {
|
Line 58 sub show_key_list {
|
$comment=~s/\W/\./g; |
$comment=~s/\W/\./g; |
my %accesskeys=&Apache::lonnet::dump |
my %accesskeys=&Apache::lonnet::dump |
('accesskeys',$cenv{'domain'},$cenv{'num'}); |
('accesskeys',$cenv{'domain'},$cenv{'num'}); |
$r->print('<table border="2"><tr><th>Key</th><th>Checked Out</th><th>Comments/Remarks/Notes</th></tr>'); |
$r->print('<h3>List of Keys/Enter New Comments</h3><table border="2"><tr><th>Key</th><th>Checked Out</th><th>Comments/Remarks/Notes</th><th>Enter Additional Comments/Remarks/Notes</th></tr>'); |
foreach (keys %accesskeys) { |
foreach (keys %accesskeys) { |
if ($_=~/^error\:/) { |
if ($_=~/^error\:/) { |
$r->print('<tr><td>No keys have been generated yet.</td></tr>'); |
$r->print('<tr><td>No keys have been generated yet.</td></tr>'); |
Line 71 sub show_key_list {
|
Line 71 sub show_key_list {
|
} |
} |
$r->print("\n<tr><td><tt>".$_.'</tt></td><td>'.($checkout? |
$r->print("\n<tr><td><tt>".$_.'</tt></td><td>'.($checkout? |
$checkout:'-').'</td><td>'. |
$checkout:'-').'</td><td>'. |
join('<br />',split(/\s*\;\s*/,$com)).'</td></tr>'); |
join('<br />',split(/\s*\;\s*/,$com)). |
|
'</td><td><input type="text" size="40" name="com_'.$_. |
|
'" /></td></tr>'); |
} |
} |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
|
$r->print('<input type="submit" name="addcom" value="Add Above Comments to Keys" /><hr />'); |
return ''; |
return ''; |
# |
# |
# Junk below |
# Junk below |
Line 174 sub genkeys {
|
Line 177 sub genkeys {
|
$num.' access keys (Batch Number: '.$batchnumber.')',$batchnumber; |
$num.' access keys (Batch Number: '.$batchnumber.')',$batchnumber; |
} |
} |
|
|
|
# ---------------------------------------------------------------- Add comments |
|
|
|
sub addcom { |
|
my %cenv=@_; |
|
my %newcomment=(); |
|
undef %newcomment; |
|
foreach (keys %ENV) { |
|
if ($_=~/^form\.com\_(.+)$/) { |
|
my $key=$1; |
|
my $comment=$ENV{$_}; |
|
$comment=~s/^\s+//gs; |
|
if ($comment) { |
|
&Apache::lonnet::comment_access_key |
|
($key,$cenv{'domain'},$cenv{'num'},$comment); |
|
} |
|
} |
|
} |
|
return ''; |
|
} |
################################################################### |
################################################################### |
################################################################### |
################################################################### |
sub handler { |
sub handler { |
Line 229 sub handler {
|
Line 251 sub handler {
|
&show_key_list($r,$ENV{'form.listcom'}, |
&show_key_list($r,$ENV{'form.listcom'}, |
$ENV{'form.newonly'},$ENV{'form.checkonly'},%cenv); |
$ENV{'form.newonly'},$ENV{'form.checkonly'},%cenv); |
} |
} |
|
if ($ENV{'form.addcom'}) { |
|
&addcom(%cenv); |
|
} |
# --- Menu |
# --- Menu |
$r->print('<h3>Key Access</h3>'); |
$r->print('<h3>Key Access</h3>'); |
if ($cenv{'keyaccess'} eq 'yes') { |
if ($cenv{'keyaccess'} eq 'yes') { |
Line 245 Comments/Remarks/Notes: <input type="tex
|
Line 270 Comments/Remarks/Notes: <input type="tex
|
Comments/Remarks/Notes/User/Batch Number: |
Comments/Remarks/Notes/User/Batch Number: |
<input type="text" name="listcom" size="30" value="$batchnumber" /><br /> |
<input type="text" name="listcom" size="30" value="$batchnumber" /><br /> |
<input type="checkbox" name="newonly" /> Unused keys only<br /> |
<input type="checkbox" name="newonly" /> Unused keys only<br /> |
<input type="checkbox" name="checkonly" />Used keys only<br /> |
<input type="checkbox" name="checkonly" /> Used keys only<br /> |
<input type="submit" name="listkeys" value="List Keys" /> |
<input type="submit" name="listkeys" value="List Keys" /> |
ENDKEYMENU |
ENDKEYMENU |
$r->print('</form></body></html>'); |
$r->print('</form></body></html>'); |