version 1.20, 2006/06/05 20:44:12
|
version 1.27, 2014/12/11 01:48:54
|
Line 41 use Apache::lonlocal;
|
Line 41 use Apache::lonlocal;
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub header { |
sub header { |
my $start_page=&Apache::loncommon::start_page('Access Key Management'); |
# Breadcrumbs |
|
my $brcrum = [{'href' => '/adm/managekeys', |
|
'text' => 'Access Key Management'}]; |
|
|
|
my $start_page=&Apache::loncommon::start_page('Access Key Management', |
|
undef, |
|
{'bread_crumbs' => $brcrum,}); |
return(<<ENDHEAD); |
return(<<ENDHEAD); |
$start_page |
$start_page |
<form method="post" enctype="multipart/form-data" |
<form method="post" enctype="multipart/form-data" |
Line 72 sub show_key_list {
|
Line 78 sub show_key_list {
|
<th>Comments/Remarks/Notes</th> |
<th>Comments/Remarks/Notes</th> |
<th>Enter Additional Comments/Remarks/Notes<br /> |
<th>Enter Additional Comments/Remarks/Notes<br /> |
<input type="text" size="40" name="copyall" /> |
<input type="text" size="40" name="copyall" /> |
<input type="button" value="Copy to All" onClick="copyallcom(this.form);" /> |
<input type="button" value="Copy to All" onclick="copyallcom(this.form);" /> |
</th></tr> |
</th></tr> |
ENDTABLEHEADER |
ENDTABLEHEADER |
} |
} |
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>'); |
} elsif ($accesskeys{$_}=~/$comment/) { |
} elsif ($accesskeys{$_}=~/$comment/) { |
Line 153 sub addcom {
|
Line 159 sub addcom {
|
my %cenv=@_; |
my %cenv=@_; |
my %newcomment=(); |
my %newcomment=(); |
undef %newcomment; |
undef %newcomment; |
foreach (keys %env) { |
foreach (keys(%env)) { |
if ($_=~/^form\.com\_(.+)$/) { |
if ($_=~/^form\.com\_(.+)$/) { |
my $key=$1; |
my $key=$1; |
my $comment=$env{$_}; |
my $comment=$env{$_}; |
Line 193 sub handler {
|
Line 199 sub handler {
|
($cenv{'domain'},$cenv{'num'})=split(/\_/,$env{'form.cid'}); |
($cenv{'domain'},$cenv{'num'})=split(/\_/,$env{'form.cid'}); |
$keytype='auth'; |
$keytype='auth'; |
} elsif ($cenv{'keyauth'}) { |
} elsif ($cenv{'keyauth'}) { |
($cenv{'num'},$cenv{'domain'})=split(/\W/,$cenv{'keyauth'}); |
($cenv{'num'},$cenv{'domain'})=split(/:/,$cenv{'keyauth'}); |
$keytype='auth'; |
$keytype='auth'; |
} else { |
} else { |
$keytype='course'; |
$keytype='course'; |
Line 260 Comments/Remarks/Notes: <input type="tex
|
Line 266 Comments/Remarks/Notes: <input type="tex
|
<hr /><h3>List Keys</h3> |
<hr /><h3>List Keys</h3> |
Comments/Remarks/Notes/User/Batch Number Filter: |
Comments/Remarks/Notes/User/Batch Number Filter: |
<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 /> |
<label><input type="checkbox" name="newonly" /> Unused keys only</label><br /> |
<input type="checkbox" name="checkonly" /> Used keys only<br /> |
<label><input type="checkbox" name="checkonly" /> Used keys only</label><br /> |
<input type="submit" name="listkeys" value="List Keys/Add Comments" /> |
<input type="submit" name="listkeys" value="List Keys/Add Comments" /> |
<input type="submit" name="listkeyscsv" value="CSV List of Keys" /> |
<input type="submit" name="listkeyscsv" value="CSV List of Keys" /> |
ENDKEYMENU |
ENDKEYMENU |
Line 272 ENDKEYMENU
|
Line 278 ENDKEYMENU
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
$r->print(&header().&Apache::loncommon::coursebrowser_javascript()); |
$r->print(&header().&Apache::loncommon::coursebrowser_javascript()); |
$r->print( |
$r->print('<br />'); |
&mt('Course ID of Key Authority').': <input input type="text" size="25" name="course" value="" />'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box() |
$r->print(&mt('Domain').': '.&Apache::loncommon::select_dom_form( |
.&Apache::lonhtmlcommon::row_title(&mt('Course ID of Key Authority')) |
$env{'request.role.domain'},'domain')); |
.'<input input type="text" size="25" name="course" value="" />' |
$r->print(&Apache::loncommon::selectcourse_link( |
.' '.&Apache::loncommon::selectcourse_link( |
'keyform','course','domain', |
'keyform','course','domain', |
undef,undef,undef,'Course')); |
undef,undef,undef,'Course') |
$r->print('<br /><input type="submit" value="'.&mt('Manage Access Keys').'" />'); |
.&Apache::lonhtmlcommon::row_closure() |
$r->print('</form>'.&Apache::loncommon::end_page()); |
.&Apache::lonhtmlcommon::row_title(&mt('Domain')) |
|
.&Apache::loncommon::select_dom_form($env{'request.role.domain'},'domain') |
|
.&Apache::lonhtmlcommon::row_closure(1) |
|
.&Apache::lonhtmlcommon::end_pick_box() |
|
); |
|
$r->print('<input type="submit" value="'.&mt('Next').'" />' |
|
.'</form>' |
|
.&Apache::loncommon::end_page() |
|
); |
} |
} |
return OK; |
return OK; |
} |
} |