--- loncom/interface/loncreateuser.pm 2009/08/05 13:40:10 1.303
+++ loncom/interface/loncreateuser.pm 2009/08/06 20:40:59 1.305
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.303 2009/08/05 13:40:10 bisitz Exp $
+# $Id: loncreateuser.pm,v 1.305 2009/08/06 20:40:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -248,13 +248,15 @@ sub build_tools_display {
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
$context);
if ($userenv{$context.'.'.$item} eq '') {
- $custom_access = 'default';
+ $custom_access =
+ &mt('Availability determined currently from default setting.');
if (!$curr_access) {
$tool_off = 'checked="checked" ';
$tool_on = '';
}
} else {
- $custom_access = 'custom';
+ $custom_access =
+ &mt('Availability determined currently from custom setting.');
$cust_on = ' checked="checked" ';
$cust_off = '';
if ($userenv{$context.'.'.$item} == 0) {
@@ -266,8 +268,7 @@ sub build_tools_display {
'
'.$lt{$item}.' | '."\n".
' '."\n".
&Apache::loncommon::start_data_table_row()."\n".
- ' '.&mt('Availability determined currently from [_1] setting.',$custom_access).
- ' '.$lt{'avai'}.': '.
+ ' | '.$custom_access.(' 'x5).$lt{'avai'}.': '.
($curr_access?&mt('Yes'):&mt('No')).' | '."\n".
&Apache::loncommon::end_data_table_row()."\n".
&Apache::loncommon::start_data_table_row()."\n".
@@ -835,6 +836,7 @@ ENDTITLE
&personal_data_display($ccuname,$ccdomain,$newuser,$context,
$inst_results{$ccuname.':'.$ccdomain});
$r->print($personal_table);
+#FIXME
my ($home_server_pick,$numlib) =
&Apache::loncommon::home_server_form_item($ccdomain,'hserver',
'default','hide');
@@ -846,6 +848,13 @@ $lt{'hs'}: $home_server_pick
} else {
$r->print($home_server_pick);
}
+ if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
+ $r->print('
'.&mt('User Can Request Creation of Courses in this Domain?').'
'.
+ &Apache::loncommon::start_data_table().
+ &build_tools_display($ccuname,$ccdomain,
+ 'requestcourses').
+ &Apache::loncommon::end_data_table());
+ }
$r->print(''."\n".''.
$lt{'lg'}.'
');
my ($fixedauth,$varauth,$authmsg);
@@ -5622,17 +5631,27 @@ sub build_search_response {
$response .= '
'.&mt('You may want to broaden your search to the selected LON-CAPA domain.');
}
}
- if (!($srch->{'srchby'} eq 'uname' && $srch->{'srchin'} eq 'dom' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchdomain'} eq $env{'request.role.domain'})) {
+ my $createdom = $env{'request.role.domain'};
+ if ($context eq 'requestcrs') {
+ if ($env{'form.coursedom'} ne '') {
+ $createdom = $env{'form.coursedom'};
+ }
+ }
+ if (!($srch->{'srchby'} eq 'uname' && $srch->{'srchin'} eq 'dom' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchdomain'} eq $createdom)) {
my $cancreate =
- &Apache::lonuserutils::can_create_user($env{'request.role.domain'},$context);
+ &Apache::lonuserutils::can_create_user($createdom,$context);
+ my $targetdom = '
'.$createdom.'';
if ($cancreate) {
- my $showdom = &display_domain_info($env{'request.role.domain'});
+ my $showdom = &display_domain_info($createdom);
$response .= '
'
.'
'.&mt('To add a new user:').''
- .'
'
- .&mt("(You can only create new users in your current role's domain - [_1])"
- ,'
'.$env{'request.role.domain'}.'')
- .'
- '
+ .'
';
+ if ($context eq 'requestcrs') {
+ $response .= &mt("(You can only define new users in the new course's domain - [_1])",$targetdom);
+ } else {
+ $response .= &mt("(You can only create new users in your current role's domain - [_1])",$targetdom);
+ }
+ $response .='- '
.&mt("Set 'Domain/institution to search' to: [_1]",''.$showdom.'')
.'
- '
.&mt("Set 'Search criteria' to: [_1]username is ..... in selected LON-CAPA domain[_2]",'','')
@@ -5643,14 +5662,17 @@ sub build_search_response {
.'
';
} else {
my $helplink = ' href="javascript:helpMenu('."'display'".')"';
- $response .= '
'
- .&mt("You are not authorized to create new users in your current role's domain - [_1]."
- ,''.$env{'request.role.domain'}.'')
- .'
'
- .&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.'
+ $response .= '
';
+ if ($context eq 'requestcrs') {
+ $response .= &mt("You are not authorized to defined new users in the new course's domain - [_1].",$targetdom);
+ } else {
+ $response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom);
+ }
+ $response .= '
'
+ .&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.'
,' '
,'')
- .'
';
+ .'
';
}
}
}