version 1.367, 2012/11/30 15:09:17
|
version 1.369, 2012/12/21 14:49:50
|
Line 111 sub initialize_authen_forms {
|
Line 111 sub initialize_authen_forms {
|
|
|
sub auth_abbrev { |
sub auth_abbrev { |
my %abv_auth = ( |
my %abv_auth = ( |
krb5 => 'krb', |
krb5 => 'krb', |
krb4 => 'krb', |
krb4 => 'krb', |
internal => 'int', |
internal => 'int', |
localuth => 'loc', |
localauth => 'loc', |
unix => 'fsys', |
unix => 'fsys', |
); |
); |
return %abv_auth; |
return %abv_auth; |
} |
} |
Line 3343 sub update_roles {
|
Line 3343 sub update_roles {
|
$env{'form.ccuname'}, |
$env{'form.ccuname'}, |
$scope,$role,'','',$context); |
$scope,$role,'','',$context); |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
&mt('Revoking [_1] in [_2]', &Apache::lonnet::plaintext($role), '"'.&cid_to_cname($scope).'"<br />'), |
&mt('Revoking [_1] in [_2]', |
$result ne "ok")); |
&Apache::lonnet::plaintext($role), |
|
'"'.&cid_to_cname($scope).'"'), |
|
$result ne "ok").'<br />'); |
|
if ($result ne "ok") { |
|
$r->print(&mt('Error: [_1]',$result).'<br />'); |
|
} |
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = |
my $result = |
&Apache::lonuserutils::classlist_drop($scope, |
&Apache::lonuserutils::classlist_drop($scope, |
Line 3358 sub update_roles {
|
Line 3363 sub update_roles {
|
} |
} |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}s) { |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}s) { |
# Revoke custom role |
# Revoke custom role |
|
my $result = &Apache::lonnet::revokecustomrole( |
|
$env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context); |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
&mt('Revoking custom role [_1] by [_2]:[_3] in [_4]',$4,$3,$2,'"'.&cid_to_cname($1).'"<br />'), |
&mt('Revoking custom role [_1] by [_2] in [_3]', |
&Apache::lonnet::revokecustomrole($env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context) ne 'ok')); |
$4,$3.':'.$2,'"'.&cid_to_cname($1).'"'), |
|
$result ne 'ok').'<br />'); |
|
if ($result ne "ok") { |
|
$r->print(&mt('Error: [_1]',$result).'<br />'); |
|
} |
if (!grep(/^cr$/,@rolechanges)) { |
if (!grep(/^cr$/,@rolechanges)) { |
push(@rolechanges,'cr'); |
push(@rolechanges,'cr'); |
} |
} |
Line 3377 sub update_roles {
|
Line 3387 sub update_roles {
|
$context); |
$context); |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
&mt('Deleting [_1] in [_2]', |
&mt('Deleting [_1] in [_2]', |
&Apache::lonnet::plaintext($role),'"'.&cid_to_cname($scope).'"<br />'),$result ne 'ok')); |
&Apache::lonnet::plaintext($role), |
|
'"'.&cid_to_cname($scope).'"'), |
|
$result ne 'ok').'<br />'); |
|
if ($result ne "ok") { |
|
$r->print(&mt('Error: [_1]',$result).'<br />'); |
|
} |
|
|
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = |
my $result = |
&Apache::lonuserutils::classlist_drop($scope, |
&Apache::lonuserutils::classlist_drop($scope, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$now); |
$now); |
$r->print($result); |
$r->print(&Apache::lonhtmlcommon::confirm_success($result)); |
} |
} |
if (!grep(/^\Q$role\E$/,@rolechanges)) { |
if (!grep(/^\Q$role\E$/,@rolechanges)) { |
push(@rolechanges,$role); |
push(@rolechanges,$role); |
Line 3393 sub update_roles {
|
Line 3408 sub update_roles {
|
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4); |
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4); |
# Delete custom role |
# Delete custom role |
$r->print(&confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]', |
my $result = |
$rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"').'<br />')); |
&Apache::lonnet::assigncustomrole($env{'form.ccdomain'}, |
&Apache::lonnet::assigncustomrole($env{'form.ccdomain'}, |
$env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now, |
$env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now, |
0,1,$context); |
0,1,$context); |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]', |
|
$rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'), |
|
$result ne "ok").'<br />'); |
|
if ($result ne "ok") { |
|
$r->print(&mt('Error: [_1]',$result).'<br />'); |
|
} |
|
|
if (!grep(/^cr$/,@rolechanges)) { |
if (!grep(/^cr$/,@rolechanges)) { |
push(@rolechanges,'cr'); |
push(@rolechanges,'cr'); |
Line 3419 sub update_roles {
|
Line 3439 sub update_roles {
|
if ($result eq 'refused' && $logmsg) { |
if ($result eq 'refused' && $logmsg) { |
$output = $logmsg; |
$output = $logmsg; |
} else { |
} else { |
$output = "Error: $result\n"; |
$output = &mt('Error: [_1]',$result)."\n"; |
} |
} |
} else { |
} else { |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Assigning [_1] in [_2] starting [_3]',&Apache::lonnet::plaintext($role), |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Assigning [_1] in [_2] starting [_3]',&Apache::lonnet::plaintext($role), |
Line 3431 sub update_roles {
|
Line 3451 sub update_roles {
|
$env{'form.ccuname'},$url,$role,0,$now,'','', |
$env{'form.ccuname'},$url,$role,0,$now,'','', |
$context); |
$context); |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]', |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]', |
&Apache::lonnet::plaintext($role),'"'.&cid_to_cname($url).'"').'<br />',$result ne "ok"); |
&Apache::lonnet::plaintext($role),'"'.&cid_to_cname($url).'"'),$result ne "ok").'<br />'; |
} |
if ($result ne "ok") { |
|
$output .= &mt('Error: [_1]',$result).'<br />'; |
|
} |
|
} |
$r->print($output); |
$r->print($output); |
if (!grep(/^\Q$role\E$/,@rolechanges)) { |
if (!grep(/^\Q$role\E$/,@rolechanges)) { |
push(@rolechanges,$role); |
push(@rolechanges,$role); |
Line 3444 sub update_roles {
|
Line 3467 sub update_roles {
|
my $result = &Apache::lonnet::assigncustomrole( |
my $result = &Apache::lonnet::assigncustomrole( |
$env{'form.ccdomain'}, $env{'form.ccuname'}, |
$env{'form.ccdomain'}, $env{'form.ccuname'}, |
$url,$rdom,$rnam,$rolename,0,$now,undef,$context); |
$url,$rdom,$rnam,$rolename,0,$now,undef,$context); |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling custom role [_1] by [_2] in [_3]', |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"').'<br />'),$result ne "ok"); |
&mt('Re-enabling custom role [_1] by [_2] in [_3]', |
|
$rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'), |
|
$result ne "ok").'<br />'); |
|
if ($result ne "ok") { |
|
$r->print(&mt('Error: [_1]',$result).'<br />'); |
|
} |
if (!grep(/^cr$/,@rolechanges)) { |
if (!grep(/^cr$/,@rolechanges)) { |
push(@rolechanges,'cr'); |
push(@rolechanges,'cr'); |
} |
} |