[LON-CAPA-cvs] cvs: loncom(loncapaMITrelate_1) /interface loncreateuser.pm
raeburn
raeburn at source.lon-capa.org
Sun Feb 5 23:50:52 EST 2012
raeburn Mon Feb 6 04:50:52 2012 EDT
Modified files: (Branch: loncapaMITrelate_1)
/loncom/interface loncreateuser.pm
Log:
- Customization for MITrelate
- Include part of changes in 1.329.2.4 for GCI_3.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.358 loncom/interface/loncreateuser.pm:1.358.4.1
--- loncom/interface/loncreateuser.pm:1.358 Sun Sep 25 23:07:49 2011
+++ loncom/interface/loncreateuser.pm Mon Feb 6 04:50:52 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.358 2011/09/25 23:07:49 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.358.4.1 2012/02/06 04:50:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -674,7 +674,7 @@
ENDBLOCK
if ($env{'form.phase'} eq '') {
my $defdom=$env{'request.role.domain'};
- my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
+ my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain','',1);
my %lt=&Apache::lonlocal::texthash(
'enro' => 'Enroll one student',
'enrm' => 'Enroll one member',
@@ -723,7 +723,7 @@
<table>
<tr>
<td>$lt{'usr'}:</td>
- <td><input type="text" size="15" name="srchterm" /></td>
+ <td><input type="text" size="25" name="srchterm" /></td>
<td> $lt{'dom'}:</td><td>$domform</td>
<td> $sellink </td>
<td> <input name="userrole" type="submit" value="$buttontext" /></td>
@@ -938,12 +938,18 @@
my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules);
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
if ($uhome eq 'no_host') {
- my $usertype;
+ my $lc_ccuname = lc($ccuname);
+ if ($lc_ccuname ne $ccuname) {
+ $uhome = &Apache::lonnet::homeserver($lc_ccuname,$ccdomain);
+ $ccuname = $lc_ccuname;
+ }
+ }
+ if ($uhome eq 'no_host') {
my ($rules,$ruleorder) =
&Apache::lonnet::inst_userrules($ccdomain,'username');
- $usertype =
- &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules,
- \%curr_rules,\%got_rules);
+ my $usertype =
+ &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules,
+ \%curr_rules,\%got_rules);
my $cancreate =
&Apache::lonuserutils::can_create_user($ccdomain,$context,
$usertype);
@@ -4100,7 +4106,9 @@
if ($env{'form.phase'} eq 'createnewuser') {
my $response;
if ($env{'form.srchterm'} !~ /^$match_username$/) {
- my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
+ my $response = '<p class="LC_warning">'.
+ &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @').
+ '</p>';
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response,$srch,undef,$crstype,$brcrum);
} else {
@@ -5614,7 +5622,9 @@
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) {
if (($srch->{'srchdomain'} eq '') ||
! (&Apache::lonnet::domain($srch->{'srchdomain'}))) {
- $response = &mt('You must specify a valid domain when searching in a domain or institutional directory.')
+ $response = '<p class="LC_warning">'.
+ &mt('You must specify a valid domain when searching in a domain or institutional directory.').
+ '</p>';
}
}
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') ||
@@ -5627,7 +5637,9 @@
}
}
if ($unamecheck !~ /^$match_username$/) {
- $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
+ $response = '<p class="LC_warning">'.
+ &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @').
+ '</p>';
}
}
}
@@ -5802,7 +5814,8 @@
($currstate,$response,$forcenewuser) =
&build_search_response($context,$srch,%srch_results);
} else {
- my $showdom = &display_domain_info($srch->{'srchdomain'}); $response = '<span class="LC_warning">'.
+ my $showdom = &display_domain_info($srch->{'srchdomain'});
+ $response = '<span class="LC_warning">'.
&mt('Institutional directory search is not available in domain: [_1]',$showdom).
'</span><br />'.
&mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').
More information about the LON-CAPA-cvs
mailing list