version 1.4, 2008/01/03 21:16:11
|
version 1.5, 2011/03/28 14:18:22
|
Line 152 my $rolesref=&LONCAPA::locking_hash_tie(
|
Line 152 my $rolesref=&LONCAPA::locking_hash_tie(
|
if (!$rolesref) { |
if (!$rolesref) { |
die('unable to tie roles db: '."$udpath/roles.db"); |
die('unable to tie roles db: '."$udpath/roles.db"); |
} |
} |
|
my $status; |
|
my $now = time; |
if (exists($rolesref->{'/'.$add_domain.'/_dc'})) { |
if (exists($rolesref->{'/'.$add_domain.'/_dc'})) { |
my ($role,$end,$start) = split('_',$rolesref->{'/'.$add_domain.'/_dc'}); |
my ($role,$end,$start) = split('_',$rolesref->{'/'.$add_domain.'/_dc'}); |
print(&mt("[_1] already has a dc privilege for [_2].", |
print(&mt("[_1] already has a dc privilege for [_2].", |
Line 161 if (exists($rolesref->{'/'.$add_domain.'
|
Line 163 if (exists($rolesref->{'/'.$add_domain.'
|
"\n"); |
"\n"); |
if (!$end) { |
if (!$end) { |
print(&mt("No planned end date.")."\n"); |
print(&mt("No planned end date.")."\n"); |
} |
} else { |
if ($start < time() && (!$end || $end > time())) { |
print(&mt("End date: [_1]",&Apache::lonlocal::locallocaltime($end)). |
print(&mt("It is currently active.")); |
"\n"); |
exit(0); |
} |
|
if (($start <= $now) && (!$end || $end > $now)) { |
|
print(&mt("It is currently active.")."\n"); |
|
$status = 'active'; |
} |
} |
} elsif ($end) { |
} elsif ($end) { |
print(&mt("End date: [_1]",&Apache::lonlocal::locallocaltime($end)). |
print(&mt("End date: [_1]",&Apache::lonlocal::locallocaltime($end)). |
"\n"); |
"\n"); |
if ($end > time()) { |
if ($end > $now) { |
print(&mt("It is currently active.")."\n"); |
print(&mt("It is currently active.")."\n"); |
exit(0); |
$status = 'active'; |
} |
} |
} |
} |
if (!$start and !$end) { |
if ((!$start) && (!$end)) { |
print(&mt("It is currently active.")."\n"); |
print(&mt("It is currently active.")."\n"); |
exit(0); |
$status = 'active'; |
} |
} |
print(&mt("It is currently not active. Proceeding to re-enable")."\n"); |
unless ($status eq 'active') { |
|
print(&mt("It is currently not active. Proceeding to make role active now.")."\n"); |
|
} |
|
} |
|
|
|
if ($status eq 'active') { |
|
&LONCAPA::locking_hash_untie($rolesref); |
|
exit(0); |
} |
} |
|
|
my $now = time; |
my $now = time; |
Line 221 by going to http://MACHINENAME/adm/creat
|
Line 233 by going to http://MACHINENAME/adm/creat
|
|
|
# Output success message, and inform sysadmin about how to further proceed. |
# Output success message, and inform sysadmin about how to further proceed. |
print("$username is now a domain coordinator for $add_domain\n"); |
print("$username is now a domain coordinator for $add_domain\n"); |
my $hostname=`hostname`; chomp($hostname); # Read in hostname. |
|
print("http://$hostname/adm/createuser will allow you to further define". |
|
" this user.\n"); # Output a suggested URL. |
|
|
|