raeburn Tue Jul 15 15:43:18 2008 EDT
Modified files:
/loncom/interface coursecatalog.pm
Log:
Provide syllabus page with means to construct breadcrumbs to facilitate return to Catalog after viewing syllabus.
- new subroutine: &syllabus_javascript() includes javascrript to dynamically set form action to URL for syllabus page and to submit form (includes catalog search parameters as hidden input).
- Replace call to &Apache::loncommon::syllabuswrapper() for syllabus link with link including call to javascript:ToSyllabus(cdom,cnum).
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.39 loncom/interface/coursecatalog.pm:1.40
--- loncom/interface/coursecatalog.pm:1.39 Mon Jul 14 06:24:27 2008
+++ loncom/interface/coursecatalog.pm Tue Jul 15 15:43:15 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.39 2008/07/14 10:24:27 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.40 2008/07/15 19:43:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -106,12 +106,14 @@
document.$formname.sortby.value = caller;
document.$formname.submit();
}
+
function setCourseId(caller) {
document.$formname.coursenum.value = caller;
document.$formname.submit();
}
ENDSCRIPT
+ $catjs .= &syllabus_javascript();
my $numtitles;
if ($env{'form.currcat_0'} eq 'instcode::0') {
$numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc,
@@ -155,8 +157,10 @@
my $output;
my %add_entries = (topmargin => "0",
marginheight => "0",);
+ my $js = ''."\n";
my $start_page =
- &Apache::loncommon::start_page('Course Catalog','',
+ &Apache::loncommon::start_page('Course Catalog',$js,
{
'add_entries' => \%add_entries,
'no_inline_link' => 1,});
@@ -172,16 +176,33 @@
{text=>"Course details"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Details'));
$r->print(' '.&mt('Detailed course information:').' '.
- '');
+ return;
+}
+
+sub syllabus_javascript {
+ return <<"END";
+
+function ToSyllabus(cdom,cnum) {
+ if (cdom == '' || cdom == null) {
+ return;
+ }
+ if (cnum == '' || cnum == null) {
+ return;
+ }
+ document.syllabuslaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus";
+ document.syllabuslaunch.submit();
+}
+
+END
}
+
sub instcode_course_selector {
my ($r,$codedom,$formname,$domdesc,$catlinks,$catjs) = @_;
my %coursecodes = ();
@@ -734,9 +755,9 @@
my %domconfig =
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
$output .= &construct_data_table($knownuser,\%courses,$details,undef,$now,\%domconfig,$trails,$allitems);
- if ($env{'form.coursenum'} ne '') {
- $output .= &Apache::lonhtmlcommon::echo_form_input(['coursenum','state','catalogfilter','sortby','showdetails']);
- }
+ $output .= "\n".''.
+ ' '.
+ &Apache::lonhtmlcommon::echo_form_input(['catalogfilter']).' ';
return $output;
}
@@ -1039,7 +1060,7 @@
''.$xlist_items.' '.
''.$title.' ';
if ($showsyllabus) {
- $output .= &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$cnum,$cdom);
+ $output .= ''.&mt('Syllabus').' ';
} else {
$output .= ' ';
}
From lon-capa-cvs-allow@mail.lon-capa.org Tue Jul 15 20:50:40 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Tue, 15 Jul 2008 19:50:40 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface lonsyllabus.pm
Message-ID:
raeburn Tue Jul 15 15:50:40 2008 EDT
Modified files:
/loncom/interface lonsyllabus.pm
Log:
When syllabus page was reached from link in Course Catalog, display breadcrumbs to facilitate return to the Course Catalog after viewing the syllabus.
- javascript function: ToCatalog(caller) added in called from Course Catalog.
- backtocat form (which includes course catalog search settings as hidden input) included if called from Course Catalog.
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.64 loncom/interface/lonsyllabus.pm:1.65
--- loncom/interface/lonsyllabus.pm:1.64 Fri Jul 11 10:55:21 2008
+++ loncom/interface/lonsyllabus.pm Tue Jul 15 15:50:39 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.64 2008/07/11 14:55:21 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.65 2008/07/15 19:50:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -110,14 +110,58 @@
# ----------------------------------------------------------------- Make header
if ($target ne 'tex') {
my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom);
+ my $js;
+ if ($env{'form.backto'} eq 'coursecatalog') {
+ $js .= <<"ENDSCRIPT";
+
+
+
+ENDSCRIPT
+ }
my $start_page =
- &Apache::loncommon::start_page("Syllabus", $rss_link,
+ &Apache::loncommon::start_page("Syllabus", $rss_link.$js,
{'function' => $forcestudent,
'domain' => $cdom,
'force_register' =>
$env{'form.register'},});
- $r->print($start_page.''.$courseenv{'description'}.' '.
+ $r->print($start_page);
+ if ($env{'form.backto'} eq 'coursecatalog') {
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:ToCatalog()",
+ text=>"Course Catalog"});
+ if ($env{'form.coursenum'} ne '') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:ToCatalog('details')",
+ text=>"Course details"});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>$r->uri,
+ text=>"Course syllabus"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs());
+ }
+ $r->print(''.$courseenv{'description'}.' '.
&Apache::lonnet::domain($cdom,'description').' ');
} else {
$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'.
@@ -347,6 +391,11 @@
if ($target ne 'tex') {$r->print('');}
}
if ($target ne 'tex') {
+ if ($env{'form.backto'} eq 'coursecatalog') {
+ $r->print(' '.
+ &Apache::lonhtmlcommon::echo_form_input(['backto']).
+ ' ');
+ }
$r->print(&Apache::loncommon::end_page());
} else {
$r->print('\end{document}');
From lon-capa-cvs-allow@mail.lon-capa.org Tue Jul 15 21:01:00 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Tue, 15 Jul 2008 20:01:00 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
Message-ID:
raeburn Tue Jul 15 16:01:00 2008 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- Suppress display of self-enrollment settings in course (these are set from "Manage Users" menu).
- Suppress display of course type (ultimately, this is expected to be set by a DC; however it's not used currently).
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.404 loncom/interface/lonparmset.pm:1.405
--- loncom/interface/lonparmset.pm:1.404 Wed Jul 9 07:10:06 2008
+++ loncom/interface/lonparmset.pm Tue Jul 15 16:00:58 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.404 2008/07/09 11:10:06 bisitz Exp $
+# $Id: lonparmset.pm,v 1.405 2008/07/15 20:00:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2399,7 +2399,9 @@
'disableexampointprint',
'task_messages','task_grading'));
foreach my $parameter (sort(keys(%values))) {
- unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) {
+ unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) ||
+ ($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/)
+ || ($parameter eq 'type')) {
if (! $descriptions{$parameter}) {
$descriptions{$parameter}=$parameter;
push(@Display_Order,$parameter);
From lon-capa-cvs-allow@mail.lon-capa.org Wed Jul 16 13:06:32 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Wed, 16 Jul 2008 12:06:32 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
Message-ID:
This is a MIME encoded message
--raeburn1216209992
Content-Type: text/plain
raeburn Wed Jul 16 08:06:32 2008 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- &visible_in_cat() added to determine whether a course is currently visible in the Course Catalog, and if not, to provide advice on how to change this.
- Messages about visibility in catalog are displayed on the Self-enrollment configuration screen, and also after making modifications to self-enrollment config.
- Some wording changes in row titles for self-enrollment configuration data table.
- Course Coordinators should understand that changes to access dates apply to future users self-enrolling, not retroactively to users who previously self-erolled.
--raeburn1216209992
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20080716080632.txt"
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.255 loncom/interface/loncreateuser.pm:1.256
--- loncom/interface/loncreateuser.pm:1.255 Mon Jul 14 06:35:00 2008
+++ loncom/interface/loncreateuser.pm Wed Jul 16 08:06:28 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.255 2008/07/14 10:35:00 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.256 2008/07/16 12:06:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3400,14 +3400,32 @@
return -1;
}
ENDSCRIPT
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+
my $output = ''."\n".
- ''.$lt->{'selfenroll'}.' '."\n".
- ''."\n".
- &Apache::lonhtmlcommon::start_pick_box();
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'},'.num'};
+ ''.$lt->{'selfenroll'}.' '."\n";
+ my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum);
+ if (ref($visactions) eq 'HASH') {
+ if ($visible) {
+ $output .= ''.$visactions->{'vis'}.'
';
+ } else {
+ $output .= $visactions->{'miss'}.' '.$visactions->{'yous'}.
+ ''.$visactions->{'gen'}.' '.$visactions->{'coca'};
+ if (ref($vismsgs) eq 'ARRAY') {
+ $output .= ' '.$visactions->{'make'}.'
';
+ foreach my $item (@{$vismsgs}) {
+ $output .= ''.$visactions->{$item}.' ';
+ }
+ $output .= ' ';
+ }
+ $output .= '';
+ }
+ }
+ $output .= ' '."\n".
+ &Apache::lonhtmlcommon::start_pick_box();
if (ref($row) eq 'ARRAY') {
foreach my $item (@{$row}) {
my $title = $item;
@@ -3559,6 +3577,128 @@
return;
}
+sub visible_in_cat {
+ my ($cdom,$cnum) = @_;
+ my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
+ my ($cathash,%settable,@vismsgs,$cansetvis);
+ my %visactions = &Apache::lonlocal::texthash(
+ vis => 'Your course currently appears in the Course Catalog for this domain.',
+ gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',
+ miss => 'Your course does not currently appear in the Course Catalog for this domain.',
+ yous => 'You should remedy this if you plan to allow self-enrollment, otherwise students will have difficulty finding your course.',
+ coca => 'Courses can be absent from the Catalog, because they do not have an institutional code, have no assigned category, or have been specifically excluded.',
+ make => 'Make any changes to self-enrollment settings below, click "Save changes", then take action to include the course in the Catalog:',
+ take => 'Take the following action to ensure the course appears in the Catalog:',
+ dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
+ dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',
+ dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',
+ dc_catalog => 'Ask a domain coordinator to enable or create at least one course category in the domain.',
+ dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',
+ dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
+ dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
+ );
+ $visactions{'unhide'} = &mt('Use [_1]Set course environment[_2] to change the "Exclude from course catalog" setting.','',' ');
+ $visactions{'chgcat'} = &mt('Use [_1]Set course environment[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','',' ');
+ $visactions{'addcat'} = &mt('Use [_1]Set course environment[_2] to assign a category to the course.','',' ');
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') {
+ $settable{'togglecats'} = 1;
+ }
+ if ($domconf{'coursecategories'}{'categorize'} eq 'crs') {
+ $settable{'categorize'} = 1;
+ }
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ }
+ if ($settable{'togglecats'} && $settable{'categories'}) {
+ $cansetvis = &mt('You are able to both assign a course category and choose to exclude this course from the catalog.');
+ } elsif ($settable{'togglecats'}) {
+ $cansetvis = &mt('You are able to choose to exclude this course from the catalog, but only a Domain Coordinator may assign a course category.');
+ } elsif ($settable{'categories'}) {
+ $cansetvis = &mt('You may assign a course category, but only a Domain Coordinator may choose to exclude this course from the catalog.');
+ } else {
+ $cansetvis = &mt('Only a Domain Coordinator may assign a course category or choose to exclude this course from the catalog.');
+ }
+
+ my %currsettings =
+ &Apache::lonnet::get('environment',['hidefromcat','categories','internal.coursecode'],
+ $cdom,$cnum);
+ my $visible = 0;
+ if ($currsettings{'internal.coursecode'} ne '') {
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ if (ref($cathash) eq 'HASH') {
+ if ($cathash->{'instcode::0'} eq '') {
+ push(@vismsgs,'dc_addinst');
+ } else {
+ $visible = 1;
+ }
+ } else {
+ $visible = 1;
+ }
+ } else {
+ $visible = 1;
+ }
+ } else {
+ if (ref($cathash) eq 'HASH') {
+ if ($cathash->{'instcode::0'} ne '') {
+ push(@vismsgs,'dc_instcode');
+ }
+ } else {
+ push(@vismsgs,'dc_instcode');
+ }
+ }
+ if ($currsettings{'categories'} ne '') {
+ my $cathash;
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ if (ref($cathash) eq 'HASH') {
+ if (keys(%{$cathash}) == 0) {
+ push(@vismsgs,'dc_catalog');
+ } elsif ((keys(%{$cathash}) == 1) && ($cathash->{'instcode::0'} ne '')) {
+ push(@vismsgs,'dc_categories');
+ } else {
+ my @currcategories = split('&',$currsettings{'categories'});
+ my $matched = 0;
+ foreach my $cat (@currcategories) {
+ if ($cathash->{$cat} ne '') {
+ $visible = 1;
+ $matched = 1;
+ last;
+ }
+ }
+ if (!$matched) {
+ if ($settable{'categories'}) {
+ push(@vismsgs,'chgcat');
+ } else {
+ push(@vismsgs,'dc_chgcat');
+ }
+ }
+ }
+ }
+ }
+ } else {
+ if (ref($cathash) eq 'HASH') {
+ if ((keys(%{$cathash}) > 1) ||
+ (keys(%{$cathash}) == 1) && ($cathash->{'instcode::0'} eq '')) {
+ if ($settable{'categories'}) {
+ push(@vismsgs,'addcat');
+ } else {
+ push(@vismsgs,'dc_addcat');
+ }
+ }
+ }
+ }
+ if ($currsettings{'hidefromcat'} eq 'yes') {
+ $visible = 0;
+ if ($settable{'togglecats'}) {
+ unshift(@vismsgs,'unhide');
+ } else {
+ unshift(@vismsgs,'dc_unhide')
+ }
+ }
+ return ($visible,$cansetvis,\@vismsgs,\%visactions);
+}
+
sub new_selfenroll_dom_row {
my ($newdom,$num) = @_;
my $domdesc = &Apache::lonnet::domain($newdom);
@@ -4717,6 +4857,21 @@
} else {
$r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));
}
+ my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum);
+ if (ref($visactions) eq 'HASH') {
+ if (!$visible) {
+ $r->print(' '.$visactions->{'miss'}.' '.$visactions->{'yous'}.
+ ' ');
+ if (ref($vismsgs) eq 'ARRAY') {
+ $r->print(' '.$visactions->{'take'}.'');
+ foreach my $item (@{$vismsgs}) {
+ $r->print(''.$visactions->{$item}.' ');
+ }
+ $r->print(' ');
+ }
+ $r->print($cansetvis);
+ }
+ }
return;
}
@@ -4726,8 +4881,8 @@
types => 'Users allowed to self-enroll in this course',
registered => 'Restrict self-enrollment to students officially registered for the course',
enroll_dates => 'Dates self-enrollment available',
- access_dates => 'Course access dates for self-enrolled users',
- section => 'Section assigned to self-enrolled users',
+ access_dates => 'Course access dates assigned to self-enrolling users',
+ section => 'Section assigned to self-enrolling users',
);
return (\@row,\%lt);
}
--raeburn1216209992--
From lon-capa-cvs-allow@mail.lon-capa.org Wed Jul 16 13:32:14 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Wed, 16 Jul 2008 12:32:14 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(version_2_7_X) /interface loncreateuser.pm
Message-ID:
This is a MIME encoded message
--raeburn1216211534
Content-Type: text/plain
raeburn Wed Jul 16 08:32:14 2008 EDT
Modified files: (Branch: version_2_7_X)
/loncom/interface loncreateuser.pm
Log:
- backport 1.256.
--raeburn1216211534
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20080716083214.txt"
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.249.2.3 loncom/interface/loncreateuser.pm:1.249.2.4
--- loncom/interface/loncreateuser.pm:1.249.2.3 Mon Jul 14 06:36:24 2008
+++ loncom/interface/loncreateuser.pm Wed Jul 16 08:32:11 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.249.2.3 2008/07/14 10:36:24 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.249.2.4 2008/07/16 12:32:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3400,14 +3400,32 @@
return -1;
}
ENDSCRIPT
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+
my $output = ''."\n".
- ''.$lt->{'selfenroll'}.' '."\n".
- ''."\n".
- &Apache::lonhtmlcommon::start_pick_box();
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'},'.num'};
+ ''.$lt->{'selfenroll'}.' '."\n";
+ my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum);
+ if (ref($visactions) eq 'HASH') {
+ if ($visible) {
+ $output .= ''.$visactions->{'vis'}.'
';
+ } else {
+ $output .= $visactions->{'miss'}.' '.$visactions->{'yous'}.
+ ''.$visactions->{'gen'}.' '.$visactions->{'coca'};
+ if (ref($vismsgs) eq 'ARRAY') {
+ $output .= ' '.$visactions->{'make'}.'
';
+ foreach my $item (@{$vismsgs}) {
+ $output .= ''.$visactions->{$item}.' ';
+ }
+ $output .= ' ';
+ }
+ $output .= '';
+ }
+ }
+ $output .= ' '."\n".
+ &Apache::lonhtmlcommon::start_pick_box();
if (ref($row) eq 'ARRAY') {
foreach my $item (@{$row}) {
my $title = $item;
@@ -3559,6 +3577,128 @@
return;
}
+sub visible_in_cat {
+ my ($cdom,$cnum) = @_;
+ my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
+ my ($cathash,%settable,@vismsgs,$cansetvis);
+ my %visactions = &Apache::lonlocal::texthash(
+ vis => 'Your course currently appears in the Course Catalog for this domain.',
+ gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',
+ miss => 'Your course does not currently appear in the Course Catalog for this domain.',
+ yous => 'You should remedy this if you plan to allow self-enrollment, otherwise students will have difficulty finding your course.',
+ coca => 'Courses can be absent from the Catalog, because they do not have an institutional code, have no assigned category, or have been specifically excluded.',
+ make => 'Make any changes to self-enrollment settings below, click "Save changes", then take action to include the course in the Catalog:',
+ take => 'Take the following action to ensure the course appears in the Catalog:',
+ dc_unhide => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
+ dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',
+ dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',
+ dc_catalog => 'Ask a domain coordinator to enable or create at least one course category in the domain.',
+ dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',
+ dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
+ dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
+ );
+ $visactions{'unhide'} = &mt('Use [_1]Set course environment[_2] to change the "Exclude from course catalog" setting.','',' ');
+ $visactions{'chgcat'} = &mt('Use [_1]Set course environment[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','',' ');
+ $visactions{'addcat'} = &mt('Use [_1]Set course environment[_2] to assign a category to the course.','',' ');
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') {
+ $settable{'togglecats'} = 1;
+ }
+ if ($domconf{'coursecategories'}{'categorize'} eq 'crs') {
+ $settable{'categorize'} = 1;
+ }
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ }
+ if ($settable{'togglecats'} && $settable{'categories'}) {
+ $cansetvis = &mt('You are able to both assign a course category and choose to exclude this course from the catalog.');
+ } elsif ($settable{'togglecats'}) {
+ $cansetvis = &mt('You are able to choose to exclude this course from the catalog, but only a Domain Coordinator may assign a course category.');
+ } elsif ($settable{'categories'}) {
+ $cansetvis = &mt('You may assign a course category, but only a Domain Coordinator may choose to exclude this course from the catalog.');
+ } else {
+ $cansetvis = &mt('Only a Domain Coordinator may assign a course category or choose to exclude this course from the catalog.');
+ }
+
+ my %currsettings =
+ &Apache::lonnet::get('environment',['hidefromcat','categories','internal.coursecode'],
+ $cdom,$cnum);
+ my $visible = 0;
+ if ($currsettings{'internal.coursecode'} ne '') {
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ if (ref($cathash) eq 'HASH') {
+ if ($cathash->{'instcode::0'} eq '') {
+ push(@vismsgs,'dc_addinst');
+ } else {
+ $visible = 1;
+ }
+ } else {
+ $visible = 1;
+ }
+ } else {
+ $visible = 1;
+ }
+ } else {
+ if (ref($cathash) eq 'HASH') {
+ if ($cathash->{'instcode::0'} ne '') {
+ push(@vismsgs,'dc_instcode');
+ }
+ } else {
+ push(@vismsgs,'dc_instcode');
+ }
+ }
+ if ($currsettings{'categories'} ne '') {
+ my $cathash;
+ if (ref($domconf{'coursecategories'}) eq 'HASH') {
+ $cathash = $domconf{'coursecategories'}{'cats'};
+ if (ref($cathash) eq 'HASH') {
+ if (keys(%{$cathash}) == 0) {
+ push(@vismsgs,'dc_catalog');
+ } elsif ((keys(%{$cathash}) == 1) && ($cathash->{'instcode::0'} ne '')) {
+ push(@vismsgs,'dc_categories');
+ } else {
+ my @currcategories = split('&',$currsettings{'categories'});
+ my $matched = 0;
+ foreach my $cat (@currcategories) {
+ if ($cathash->{$cat} ne '') {
+ $visible = 1;
+ $matched = 1;
+ last;
+ }
+ }
+ if (!$matched) {
+ if ($settable{'categories'}) {
+ push(@vismsgs,'chgcat');
+ } else {
+ push(@vismsgs,'dc_chgcat');
+ }
+ }
+ }
+ }
+ }
+ } else {
+ if (ref($cathash) eq 'HASH') {
+ if ((keys(%{$cathash}) > 1) ||
+ (keys(%{$cathash}) == 1) && ($cathash->{'instcode::0'} eq '')) {
+ if ($settable{'categories'}) {
+ push(@vismsgs,'addcat');
+ } else {
+ push(@vismsgs,'dc_addcat');
+ }
+ }
+ }
+ }
+ if ($currsettings{'hidefromcat'} eq 'yes') {
+ $visible = 0;
+ if ($settable{'togglecats'}) {
+ unshift(@vismsgs,'unhide');
+ } else {
+ unshift(@vismsgs,'dc_unhide')
+ }
+ }
+ return ($visible,$cansetvis,\@vismsgs,\%visactions);
+}
+
sub new_selfenroll_dom_row {
my ($newdom,$num) = @_;
my $domdesc = &Apache::lonnet::domain($newdom);
@@ -4717,6 +4857,21 @@
} else {
$r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));
}
+ my ($visible,$cansetvis,$vismsgs,$visactions) = &visible_in_cat($cdom,$cnum);
+ if (ref($visactions) eq 'HASH') {
+ if (!$visible) {
+ $r->print(' '.$visactions->{'miss'}.' '.$visactions->{'yous'}.
+ ' ');
+ if (ref($vismsgs) eq 'ARRAY') {
+ $r->print(' '.$visactions->{'take'}.'');
+ foreach my $item (@{$vismsgs}) {
+ $r->print(''.$visactions->{$item}.' ');
+ }
+ $r->print(' ');
+ }
+ $r->print($cansetvis);
+ }
+ }
return;
}
@@ -4726,8 +4881,8 @@
types => 'Users allowed to self-enroll in this course',
registered => 'Restrict self-enrollment to students officially registered for the course',
enroll_dates => 'Dates self-enrollment available',
- access_dates => 'Course access dates for self-enrolled users',
- section => 'Section assigned to self-enrolled users',
+ access_dates => 'Course access dates assigned to self-enrolling users',
+ section => 'Section assigned to self-enrolling users',
);
return (\@row,\%lt);
}
--raeburn1216211534--
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 06:50:25 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (www)
Date: Thu, 17 Jul 2008 05:50:25 -0000
Subject: [LON-CAPA-cvs] cvs: loncom / production_dns_domain.tab production_dns_hosts.tab
Message-ID:
www Thu Jul 17 01:50:25 2008 EDT
Modified files:
/loncom production_dns_domain.tab production_dns_hosts.tab
Log:
Alexander School District
Index: loncom/production_dns_domain.tab
diff -u loncom/production_dns_domain.tab:1.38 loncom/production_dns_domain.tab:1.39
--- loncom/production_dns_domain.tab:1.38 Wed Jul 9 12:59:16 2008
+++ loncom/production_dns_domain.tab Thu Jul 17 01:50:24 2008
@@ -93,6 +93,7 @@
fsuK12:Florida State University - K12:::en-US:Tallahassee, FL:-84.28:30.438:fsuk12l1
brs:Beaverton Rural Schools:::::::brsl2
+alexander:Alexander School District:::en-US:Albany,OH:-82.1:39.329:alexanderl1
athens:Athens Public Schools:::en-US:Athens, OH:-82.1:39.329:athensl1
vinton:Vinton County Public Schools:::en-US:Athens, OH:-82.1:39.329:vintonl1
pickerington:Pickerington Public Schools:::en-US:Athens, OH:-82.1:39.329:pickeringtonl1
Index: loncom/production_dns_hosts.tab
diff -u loncom/production_dns_hosts.tab:1.40 loncom/production_dns_hosts.tab:1.41
--- loncom/production_dns_hosts.tab:1.40 Wed Jul 9 12:59:16 2008
+++ loncom/production_dns_hosts.tab Thu Jul 17 01:50:24 2008
@@ -113,6 +113,7 @@
sarasotal1:sarasota:library:shs-dunk-lin.shs.sarasota.k12.fl.us
#ohio u hosted
+alexanderl1:alexander:library:capa4.phy.ohiou.edu
athensl1:athens:library:capa4.phy.ohiou.edu
vintonl1:vinton:library:capa4.phy.ohiou.edu
trimblel1:trimble:library:capa4.phy.ohiou.edu
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 13:00:28 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 12:00:28 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm
Message-ID:
raeburn Thu Jul 17 08:00:28 2008 EDT
Modified files:
/loncom/interface coursecatalog.pm
Log:
- Change link to "Enroll in course" to javascript:ToSelfenroll() which submits linklaunch form.
- Filters used in coursecatalog display passed to selfenroll to allow breadcrumbs there.
- syllabuslaunch form renamed linklaunch form (no longer used for just syllabus).
- &syllabus_javascript() renamed courselink_javascript() - broader use.
- 'courseid' added as another element to exclude from echo of form input to avoid duplicate
when coming from breadcrumb trail link in self-enroll.
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.40 loncom/interface/coursecatalog.pm:1.41
--- loncom/interface/coursecatalog.pm:1.40 Tue Jul 15 15:43:15 2008
+++ loncom/interface/coursecatalog.pm Thu Jul 17 08:00:28 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.40 2008/07/15 19:43:15 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.41 2008/07/17 12:00:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -113,7 +113,7 @@
}
ENDSCRIPT
- $catjs .= &syllabus_javascript();
+ $catjs .= &courselink_javascript();
my $numtitles;
if ($env{'form.currcat_0'} eq 'instcode::0') {
$numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc,
@@ -158,7 +158,7 @@
my %add_entries = (topmargin => "0",
marginheight => "0",);
my $js = ''."\n";
+ &courselink_javascript().''."\n";
my $start_page =
&Apache::loncommon::start_page('Course Catalog',$js,
{
@@ -181,11 +181,12 @@
$r->print(''.
''.
&mt('Back to course listing').' '.
- &Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter','showdetails']).' ');
+ &Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter',
+ 'showdetails','courseid']).' ');
return;
}
-sub syllabus_javascript {
+sub courselink_javascript {
return <<"END";
function ToSyllabus(cdom,cnum) {
@@ -195,8 +196,17 @@
if (cnum == '' || cnum == null) {
return;
}
- document.syllabuslaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus";
- document.syllabuslaunch.submit();
+ document.linklaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus";
+ document.linklaunch.submit();
+}
+
+function ToSelfenroll(courseid) {
+ if (courseid == '') {
+ return;
+ }
+ document.linklaunch.action = "/adm/selfenroll";
+ document.linklaunch.courseid.value = courseid;
+ document.linklaunch.submit();
}
END
@@ -755,9 +765,10 @@
my %domconfig =
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
$output .= &construct_data_table($knownuser,\%courses,$details,undef,$now,\%domconfig,$trails,$allitems);
- $output .= "\n".''.
+ $output .= "\n".' '.
' '.
- &Apache::lonhtmlcommon::echo_form_input(['catalogfilter']).' ';
+ ' '.
+ &Apache::lonhtmlcommon::echo_form_input(['catalogfilter','courseid']).' ';
return $output;
}
@@ -1084,7 +1095,7 @@
if (($info->{'selfenroll_start'} > 0) && ($info->{'selfenroll_start'} > $now)) {
$output .= ''.&mt('Starts: [_1]',''.$showstart.' ').' '.&mt('Ends: [_1]',''.$showend.' ').' ';
} else {
- $output .= ''.&mt('Enroll in course').' ';
+ $output .= ''.&mt('Enroll in course').' ';
}
$selfenroll = 1;
}
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 13:01:49 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 12:01:49 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface lonsyllabus.pm
Message-ID:
raeburn Thu Jul 17 08:01:49 2008 EDT
Modified files:
/loncom/interface lonsyllabus.pm
Log:
- 'courseid' added as another element to exclude from echo of form input in backtocat form.
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.65 loncom/interface/lonsyllabus.pm:1.66
--- loncom/interface/lonsyllabus.pm:1.65 Tue Jul 15 15:50:39 2008
+++ loncom/interface/lonsyllabus.pm Thu Jul 17 08:01:46 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.65 2008/07/15 19:50:39 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.66 2008/07/17 12:01:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -393,7 +393,7 @@
if ($target ne 'tex') {
if ($env{'form.backto'} eq 'coursecatalog') {
$r->print(''.
- &Apache::lonhtmlcommon::echo_form_input(['backto']).
+ &Apache::lonhtmlcommon::echo_form_input(['backto','courseid']).
' ');
}
$r->print(&Apache::loncommon::end_page());
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 13:10:09 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 12:10:09 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface createaccount.pm
Message-ID:
This is a MIME encoded message
--raeburn1216296609
Content-Type: text/plain
raeburn Thu Jul 17 08:10:09 2008 EDT
Modified files:
/loncom/interface createaccount.pm
Log:
- Breadcrumbs added to facilitate retreat to earlier pages during account creation process.
- &catreturn_js() added to provide javascript functions used in breadcrumb trail to jump back to
course catalog or first self-enrollment screen, when account creation occuring in context of self-rnrollment
- &print_footer() added to provide backupcrumbs form where coursecatalog search terms are stored so breadcrumb links can jump back to entry point from course catalog in self-enroll context.
- &selfenroll_crumbs() added to provide additional breadcrumbs in selfe-ennroll context.
- &login_failure_msg() added to put messages displayed when authentication fails in one place, with a link back to try again.
- form element cid renamed courseid (and $cid renamed $courseid) to avoid confusing this with the cid form element used for entering a studentID in loncreateuser:personal_data_display().
--raeburn1216296609
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20080717081009.txt"
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.21 loncom/interface/createaccount.pm:1.22
--- loncom/interface/createaccount.pm:1.21 Mon Jul 14 06:17:42 2008
+++ loncom/interface/createaccount.pm Thu Jul 17 08:10:05 2008
@@ -3,7 +3,7 @@
# institutional log-in ID (institutional authentication required - localauth
# or kerberos) or an e-mail address.
#
-# $Id: createaccount.pm,v 1.21 2008/07/14 10:17:42 raeburn Exp $
+# $Id: createaccount.pm,v 1.22 2008/07/17 12:10:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -52,7 +52,7 @@
if ($r->header_only) {
return OK;
}
-
+
my $domain;
my $sso_username = $r->subprocess_env->get('REDIRECT_SSOUserUnknown');
@@ -90,35 +90,41 @@
return OK;
}
- my $courseid;
+ my ($js,$courseid,$title);
if (defined($env{'form.courseid'})) {
$courseid = &validate_course($env{'form.courseid'});
}
+ if ($courseid ne '') {
+ $js = &catreturn_js();
+ $title = 'Self-enroll in a LON-CAPA course';
+ } else {
+ $title = 'Create a user account in LON-CAPA';
+ }
if ($env{'form.phase'} eq 'selfenroll_login') {
+ $title = 'Self-enroll in a LON-CAPA course';
if ($env{'form.udom'} ne '') {
$domain = $env{'form.udom'};
}
my ($result,$output) =
&username_validation($r,$env{'form.uname'},$domain,$domdesc,
-
$contact_name,$contact_email,$courseid,
$lonhost);
if ($result eq 'existingaccount') {
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
} else {
$start_page =
- &Apache::loncommon::start_page('Self-enroll in a LON-CAPA course','',
+ &Apache::loncommon::start_page($title,$js,
{'no_inline_link' => 1,});
- &print_header($r,$start_page);
- $r->print($output.&Apache::loncommon::end_page());
+ &print_header($r,$start_page,$courseid);
+ $r->print($output);
+ &print_footer($r);
return OK;
}
}
-
$start_page =
- &Apache::loncommon::start_page('Create a user account in LON-CAPA','',
+ &Apache::loncommon::start_page($title,$js,
{'no_inline_link' => 1,});
my @cancreate;
my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
@@ -134,17 +140,17 @@
}
if (@cancreate == 0) {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
my $output = ''.&mt('Account creation unavailable').' '.
''.
&mt('Creation of a new user account using an e-mail address or an institutional log-in ID as username is not permitted at this institution ([_1]).',$domdesc).' ';
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
}
if ($sso_username ne '') {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
my ($msg,$sso_logout);
$sso_logout = &sso_logout_frag($r,$domain);
if (grep(/^sso$/,@cancreate)) {
@@ -159,7 +165,7 @@
$sso_logout;
}
$r->print($msg);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
}
@@ -174,13 +180,13 @@
return OK;
} else {
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
}
} else {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
}
}
@@ -194,9 +200,9 @@
return OK;
}
}
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
} elsif ($env{'form.phase'} eq 'username_validation') {
(my $result,$output) =
@@ -205,19 +211,19 @@
$lonhost);
if ($result eq 'existingaccount') {
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
} else {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
}
} elsif ($env{'form.create_with_email'}) {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
$output = &process_email_request($env{'form.useremail'},$domain,$domdesc,
$contact_name,$contact_email,\@cancreate,
$lonhost,$domconfig{'usercreation'},
$courseid);
} elsif (!$token) {
- &print_header($r,$start_page);
+ &print_header($r,$start_page,$courseid);
my $now=time;
if (grep(/^login$/,@cancreate)) {
my $jsh=Apache::File->new($include."/londes.js");
@@ -228,17 +234,21 @@
$r->print(&javascript_validmail());
}
$output = &print_username_form($domain,$domdesc,\@cancreate,$now,$lonhost,
- $courseid);
+ $courseid);
}
$r->print($output);
- $r->print(&Apache::loncommon::end_page());
+ &print_footer($r);
return OK;
}
sub print_header {
- my ($r,$start_page) = @_;
+ my ($r,$start_page,$courseid) = @_;
$r->print($start_page);
&Apache::lonhtmlcommon::clear_breadcrumbs();
+ if ($courseid ne '') {
+ my %coursehash = &Apache::lonnet::coursedescription($courseid);
+ &selfenroll_crumbs($r,$courseid,$coursehash{'description'});
+ }
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/createuser",
text=>"New username"});
@@ -246,6 +256,42 @@
return;
}
+sub print_footer {
+ my ($r) = @_;
+ if ($env{'form.courseid'} ne '') {
+ $r->print(''.
+ &Apache::lonhtmlcommon::echo_form_input(['backto','logtoken',
+ 'token','serverid','uname','upass','phase','create_with_email',
+ 'code','useremail','crypt','cfirstname','clastname',
+ 'cmiddlename','cgeneration','cpermanentemail','cid]).
+ ' ');
+ }
+ $r->print(&Apache::loncommon::end_page());
+}
+
+sub selfenroll_crumbs {
+ my ($r,$courseid,$desc) = @_;
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:ToCatalog('backupcrumbs','')",
+ text=>"Course Catalog"});
+ if ($env{'form.coursenum'} ne '') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:ToCatalog('backupcrumbs','details')",
+ text=>"Course details"});
+ }
+ my $last_crumb;
+ if ($desc ne '') {
+ $last_crumb = &mt('Self-enroll in [_1]',''.$desc.' ');
+ } else {
+ $last_crumb = &mt('Self-enroll');
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:ToSelfenroll('backupcrumbs')",
+ text=>$last_crumb,
+ no_mt=>"1"});
+ return;
+}
+
sub validate_course {
my ($courseid) = @_;
my ($cdom,$cnum) = ($courseid =~ /^($match_domain)_($match_courseid)$/);
@@ -346,7 +392,7 @@
my $submit_text = &mt('Create LON-CAPA account');
$output .= &mt('If you already have a log-in ID at this institution,[_1] you may be able to use it for LON-CAPA.',' ').' '.&mt('Type in your log-in ID and password to find out.').' ';
$output .= &login_box($now,$lonhost,$courseid,$submit_text,
- $domain,'createaccount');
+ $domain,'createaccount').'';
}
}
if (grep(/^email$/,@{$cancreate})) {
@@ -374,8 +420,11 @@
$output .= ' '.
&Apache::lonhtmlcommon::row_closure(1).
- &Apache::lonhtmlcommon::end_pick_box().' '.
- '';
+ &Apache::lonhtmlcommon::end_pick_box().' ';
+ if ($courseid ne '') {
+ $output .= &Apache::lonhtmlcommon::echo_form_input(['courseid']);
+ }
+ $output .= '';
}
}
if ($output eq '') {
@@ -424,7 +473,7 @@
&Apache::lonhtmlcommon::end_pick_box().' '."\n".
' '."\n".
' '."\n".
- '';
+ '';
return $output;
}
@@ -608,7 +657,7 @@
$courseid = &validate_course($courseid);
if ($courseid ne '') {
$form{'courseid'} = $courseid;
- $firsturl = '/adm/selfenroll?cid='.$courseid;
+ $firsturl = '/adm/selfenroll?courseid='.$courseid;
}
}
if ($r->dir_config('lonBalancer') eq 'yes') {
@@ -730,7 +779,7 @@
&mt('Return to previous page').''.
&Apache::loncommon::end_page();
if ($retrieved eq 'ok') {
- if ($env{'form.cid'} ne '') {
+ if ($env{'form.courseid'} ne '') {
my ($result,$userchkmsg) = &check_id($username,$domain,$domdesc);
if ($result eq 'fail') {
$output = $error.&mt('Invalid ID format').$end.
@@ -775,10 +824,7 @@
$output = ' '.&mt('A LON-CAPA account already exists for username [_1] at this institution ([_2]).',''.$username.' ',$domdesc).' '.&mt('The password entered was also correct so you have been logged in.');
return ('existingaccount',$output);
} else {
- $output = ''.
- &mt('Username and/or password could not be authenticated.').
- '
'.
- &mt('Please check the username and password.');
+ $output = &login_failure_msg($courseid);
}
} else {
my $primlibserv = &Apache::lonnet::domain($domain,'primary');
@@ -795,15 +841,28 @@
$output = &username_check($username,$domain,$domdesc,$courseid,$lonhost,
$contact_email,$contact_name);
} else {
- $output = ''.
- &mt('Username and/or password could not be authenticated.').
- '
'.
- &mt('Please check the username and password.');
+ $output = &login_failure_msg($courseid);
}
}
return ('ok',$output);
}
+sub login_failure_msg {
+ my ($courseid) = @_;
+ my $url;
+ if ($courseid ne '') {
+ $url = "/adm/selfenroll?courseid=".$courseid;
+ } else {
+ $url = "/adm/createaccount";
+ }
+ my $output = ''.&mt('Authentication failed').' '.
+ &mt('Username and/or password could not be authenticated.').
+ '
'.
+ &mt('Please check the username and password.').' ';
+ ''.&mt('Try again').' ';
+ return $output;
+}
+
sub username_check {
my ($username,$domain,$domdesc,$courseid,$lonhost,$contact_email,$contact_name,
$sso_logout) = @_;
@@ -877,12 +936,21 @@
&mt('Create LON-CAPA account').'" />';
if ($rowcount) {
if ($editable) {
- $msg = &mt('To create one, use the table below to provide information about yourself, then click the [_1]Create LON-CAPA account[_2] button.','',' ').' ';
+ if ($courseid ne '') {
+ $msg = ''.&mt('User information').' ';
+ }
+ $msg .= &mt('To create one, use the table below to provide information about yourself, then click the [_1]Create LON-CAPA account[_2] button.','',' ').' ';
} else {
- $msg = &mt('A user account will be created with information displayed in the table below, when you click the [_1]Create LON-CAPA account[_2] button.','',' ').' ';
+ if ($courseid ne '') {
+ $msg = ''.&mt('Review user information').' ';
+ }
+ $msg .= &mt('A user account will be created with information displayed in the table below, when you click the [_1]Create LON-CAPA account[_2] button.','',' ').' ';
}
} else {
- $msg = ' '.&mt('Confirm that you wish to create an account.');
+ if ($courseid ne '') {
+ $msg = ''.&mt('Confirmation').' ';
+ }
+ $msg .= &mt('Confirm that you wish to create an account.');
}
$msg .= $output;
}
@@ -922,7 +990,7 @@
if ((($domdefaults{'auth_def'} =~/^krb(4|5)$/) &&
($domdefaults{'auth_arg_def'} ne '')) ||
($domdefaults{'auth_def'} eq 'localauth')) {
- if ($env{'form.cid'} ne '') {
+ if ($env{'form.courseid'} ne '') {
my ($result,$userchkmsg) = &check_id($username,$domain,$domdesc);
if ($result eq 'fail') {
$output = $error.&mt('Invalid ID format').$end.
@@ -932,7 +1000,7 @@
}
# Call modifyuser
my $result =
- &Apache::lonnet::modifyuser($domain,$username,$env{'form.cid'},
+ &Apache::lonnet::modifyuser($domain,$username,$env{'form.courseid'},
$domdefaults{'auth_def'},
$domdefaults{'auth_arg_def'},$env{'form.cfirstname'},
$env{'form.cmiddlename'},$env{'form.clastname'},
@@ -1056,11 +1124,15 @@
sub serverform {
my ($logtoken,$lonhost,$mailtoken,$courseid,$context) = @_;
- my $phase = 'username_validation"';
+ my $phase = 'username_validation';
+ my $catalog_elements;
if ($context eq 'selfenroll') {
$phase = 'selfenroll_login';
}
- my $output .= <
@@ -1069,6 +1141,7 @@
+ $catalog_elements
ENDSERVERFORM
return $output;
@@ -1153,4 +1226,61 @@
return $endsessionmsg;
}
+sub catreturn_js {
+ return <<"ENDSCRIPT";
+
+ENDSCRIPT
+
+}
+
1;
--raeburn1216296609--
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 13:22:28 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 12:22:28 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface selfenroll.pm
Message-ID:
This is a MIME encoded message
--raeburn1216297348
Content-Type: text/plain
raeburn Thu Jul 17 08:22:28 2008 EDT
Modified files:
/loncom/interface selfenroll.pm
Log:
- Breadcrumbs added to facilitate retreat to course catalog or initial self-enrollment page.
- &page_footer() added to provide backupcrumba form used to store catalog filters used originally.
- &Apache::createaccount::catreturn_js() used to generate getFormByName() and getIndexByName() javascript.
- &Apache::createaccount::selfenroll_crumbs() used to generate breadcrumbs.
- setPath() javascript function takes new first argument - formname - now page can have multiple forms.
- logmein form now includes echo of catalog search form elements so subsequent screens generated by createaccount.pm can include irteurn to course catalog in breadcrumbs.
- form element cid renamed courseid (and $cid renamed $courseid) to avoid confusing this with the cid form element used for entering a studentID in loncreateuser:personal_data_display().
--raeburn1216297348
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20080717082228.txt"
Index: loncom/interface/selfenroll.pm
diff -u loncom/interface/selfenroll.pm:1.11 loncom/interface/selfenroll.pm:1.12
--- loncom/interface/selfenroll.pm:1.11 Mon Jul 14 06:25:25 2008
+++ loncom/interface/selfenroll.pm Thu Jul 17 08:22:28 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Allow users to self-enroll in a course
#
-# $Id: selfenroll.pm,v 1.11 2008/07/14 10:25:25 raeburn Exp $
+# $Id: selfenroll.pm,v 1.12 2008/07/17 12:22:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,34 +51,35 @@
}
&Apache::lonacc::get_posted_cgi($r);
&Apache::lonlocal::get_language_handle($r);
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cid']);
- my ($coursechk,$cid) = &validate_course_id($env{'form.cid'});
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['courseid']);
+ my $js = &Apache::createaccount::catreturn_js();
+ my $desc;
+ my ($coursechk,$courseid) = &validate_course_id($env{'form.courseid'});
if ($coursechk ne 'ok') {
- &page_header($r,$cid);
+ &page_header($r,$courseid,$js);
$r->print(''.&mt('Self-enrollment error').' '.
''.
&mt('Invalid domain or course number').' ');
- $r->print(&Apache::loncommon::end_page());
+ &page_footer($r);
return OK;
}
my $now = time;
- my $js;
if ($env{'form.phase'} eq 'login') {
- $js = &Apache::createaccount::javascript_setforms($now);
+ $js .= "\n".&Apache::createaccount::javascript_setforms($now);
}
- &page_header($r,$cid,$js);
+ my %coursehash = &Apache::lonnet::coursedescription($courseid);
+ my $cdom = $coursehash{'domain'};
+ my $cnum = $coursehash{'num'};
+ my $desc = $coursehash{'description'};
+ &page_header($r,$courseid,$js,$desc);
my $include = $r->dir_config('lonIncludes');
if ($env{'form.phase'} eq 'login') {
my $jsh=Apache::File->new($include."/londes.js");
$r->print(<$jsh>);
}
- my ($cdom,$cnum,$desc,$canenroll,$selfenroll_types,$selfenroll_registered,
- @cancreate,$knownuser,$selfenroll_access_start,$selfenroll_access_end,
- $selfenroll_section,$selfenroll_future,%curr_role,%coursehash,$cdomdesc);
- %coursehash = &Apache::lonnet::coursedescription($cid);
- $cdom = $coursehash{'domain'};
- $cnum = $coursehash{'num'};
- $desc = $coursehash{'description'};
+ my ($canenroll,$selfenroll_types,$selfenroll_registered,@cancreate,
+ $knownuser,$selfenroll_access_start,$selfenroll_access_end,
+ $selfenroll_section,$selfenroll_future,%curr_role,$cdomdesc);
$selfenroll_types = $coursehash{'internal.selfenroll_types'};
$selfenroll_registered = $coursehash{'internal.selfenroll_registered'};
$selfenroll_section = $coursehash{'internal.selfenroll_section'};
@@ -167,13 +168,14 @@
if (keys(%curr_role)) {
$r->print(&has_role(%curr_role));
}
- $r->print(&Apache::loncommon::end_page());
+ &page_footer($r);
return OK;
}
@cancreate = &can_create($cdom);
- my ($login_path,$firsturl,$create_path,$sso_url,$missing_formitem);
+ my ($form,$login_path,$firsturl,$create_path,$sso_url,$missing_formitem);
+ $form = 'logmein';
$login_path = '/adm/login';
- $firsturl= '/adm/selfenroll?cid='.$cid;
+ $firsturl= '/adm/selfenroll?courseid='.$courseid;
$create_path = '/adm/createaccount';
$sso_url = $r->dir_config('lonSSOReloginServer');
if ($sso_url eq '') {
@@ -184,7 +186,7 @@
if (keys(%curr_role)) {
$r->print(''.&mt('Self-enrollment unavailable').' '.
''.&has_role(%curr_role).' ');
- $r->print(&Apache::loncommon::end_page());
+ &page_footer($r);
return OK;
}
&process_self_enroll($r,$cdom,$cnum,$selfenroll_types,$selfenroll_registered,
@@ -194,41 +196,36 @@
my $submit_text = &mt('Log in');
$r->print(''.&mt('Log-in to LON-CAPA').' ');
my $udom = &Apache::lonnet::default_login_domain();
- $r->print(&Apache::createaccount::login_box($now,$lonhost,$cid,
+ $r->print(&Apache::createaccount::login_box($now,$lonhost,$courseid,
$submit_text,$udom,'selfenroll'));
- $r->print(&mt('You will be able to self-enroll in the course you selected ([_1]) after you have successfully logged in.',''.$desc.' ').
- &Apache::loncommon::end_page());
+ $r->print(&mt('You will be able to self-enroll in the course you selected ([_1]) after you have successfully logged in.',''.$desc.' '));
+ &page_footer($r);
return OK;
} elsif (@cancreate > 0) {
$r->print(<
-function setPath(formaction,item,arg) {
- if (formaction != '') {
- document.forms.logmein.action = formaction;
- }
- var itemid = getIndexByName("setting");
- if (itemid > -1) {
- document.logmein.elements[itemid].name = item;
- document.logmein.elements[itemid].value = arg;
- document.logmein.submit();
- } else {
- alert("$missing_formitem");
+function setPath(formname,formaction,item,arg) {
+ var formidx = getFormByName(formname);
+ if (formidx > -1) {
+ if (formaction != '') {
+ document.forms[formidx].action = formaction;
+ }
+ var itemid = getIndexByName(formidx,'setting');
+ if (itemid > -1) {
+ document.forms[formidx].elements[itemid].name = item;
+ document.forms[formidx].elements[itemid].value = arg;
+ document.forms[formidx].submit();
+ } else {
+ alert("$missing_formitem");
+ }
}
return;
}
-function getIndexByName(item) {
- for (var i=0;i
END
$r->print(''.&mt('LON-CAPA account required').' '.
- &mt('You need to be logged into LON-CAPA to self-enroll in a course.').''.&mt('If you have an account in LON-CAPA, [_1]log-in[_2].','',' ').' ');
+ &mt('You need to be logged into LON-CAPA to self-enroll in a course.').''.&mt('If you have an account in LON-CAPA, [_1]log-in[_2].','',' ').' ');
if (@cancreate > 1) {
$r->print(''.&mt('Otherwise:').' ');
my $count = 0;
@@ -238,11 +235,11 @@
}
if (grep(/^$type$/,@cancreate)) {
if ($type eq 'sso') {
- $r->print(' '.&mt("if you have an institutional log-in, use your institution's [_1]single sign on page[_2] to log-in, then create an account",'',' '));
+ $r->print(' '.&mt("if you have an institutional log-in, use your institution's [_1]single sign on page[_2] to log-in, then create an account",'',' '));
} elsif ($type eq 'login') {
- $r->print(' '.&mt('if you have an institutional login, [_1]create an account[_2]','',' '));
+ $r->print(' '.&mt('if you have an institutional login, [_1]create an account[_2]','',' '));
} elsif ($type eq 'email') {
- $r->print(' '.&mt('you can use an e-mail address to [_1]create an account[_2]','',' '));
+ $r->print(' '.&mt('you can use an e-mail address to [_1]create an account[_2]','',' '));
}
$count ++;
}
@@ -250,11 +247,11 @@
$r->print('. ');
} else {
if ($cancreate[0] eq 'login') {
- $r->print(' '.&mt('Otherwise, if you have an institutional login, [_1]create an account[_2].','',' '));
+ $r->print(' '.&mt('Otherwise, if you have an institutional login, [_1]create an account[_2].','',' '));
} elsif ($cancreate[0] eq 'email') {
- $r->print(' '.&mt('Otherwise, you will use an e-mail address to [_1]create an account[_2].','',' '));
+ $r->print(' '.&mt('Otherwise, you will use an e-mail address to [_1]create an account[_2].','',' '));
} elsif ($cancreate[0] eq 'sso') {
- $r->print(' '.&mt("Otherwise, use your institution's [_1]single sign on page[_2] to log-in, then create an account.",'',' '));
+ $r->print(' '.&mt("Otherwise, use your institution's [_1]single sign on page[_2] to log-in, then create an account.",'',' '));
}
}
if ($selfenroll_types eq '*') {
@@ -277,34 +274,41 @@
my $displayurl = &escape($firsturl);
$r->print(&mt('Submit a request to the LON-CAPA [_1]helpdesk[_2] for [_3] if you require assistance.','',' ',$cdomdesc));
}
- $r->print(''."\n".
- ' '."\n".
+ $r->print("\n".' '."\n".
+ ' '."\n".
' '."\n".
- ' '."\n".
- &Apache::loncommon::end_page());
+ &Apache::lonhtmlcommon::echo_form_input(['backto','courseid','context','phase'])."\n".
+ ''."\n");
+ &page_footer($r);
return OK;
}
sub page_header {
- my ($r,$cid,$js) = @_;
+ my ($r,$courseid,$js,$desc) = @_;
my $start_page =
&Apache::loncommon::start_page('Self-enroll in a LON-CAPA course',$js,
{'no_inline_link' => 1,});
$r->print($start_page);
&Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/selfenroll?cid=$cid",
- text=>"Self-enroll"});
+ &Apache::createaccount::selfenroll_crumbs($r,$courseid,$desc);
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Self-enroll in course'));
return;
}
+sub page_footer {
+ my ($r) = @_;
+ $r->print(''."\n".
+ &Apache::lonhtmlcommon::echo_form_input(['backto','courseid','phase','context']).
+ ' '.&Apache::loncommon::end_page());
+ return;
+}
+
sub validate_course_id {
- my ($cid) = @_;
- my ($cdom,$cnum) = ($env{'form.cid'} =~ /^($match_domain)_($match_courseid)$/);
+ my ($courseid) = @_;
+ my ($cdom,$cnum) = ($env{'form.courseid'} =~ /^($match_domain)_($match_courseid)$/);
if ($cdom ne '' && $cnum ne '') {
if (&Apache::lonnet::is_course($cdom,$cnum)) {
- return ('ok',$cid);
+ return ('ok',$courseid);
}
}
return;
@@ -552,14 +556,14 @@
$output = &mt('Self-enrollment is not currently available for this course for users affiliated with [_1].',$domdesc);
}
} elsif (keys(%{$longtypes}) > 0) {
- $output = &mt('Self-enrollment in this course is only available to users affiliated with the following institutions, and who have the required status:').' ';
+ $output = &mt('Self-enrollment in this course is only available to users affiliated with the following institutions, and who have the required status:').' '."\n";
foreach my $selfdom (sort(keys(%{$longtypes}))) {
my $selfdomdesc = &Apache::lonnet::domain($selfdom,'description');
if (ref($longtypes->{$selfdom}) eq 'ARRAY') {
- $output .= ''.$selfdomdesc.': '.join(', ',@{$longtypes->{$selfdom}}).' ';
+ $output .= ''.$selfdomdesc.': '.join(', ',@{$longtypes->{$selfdom}}).' '."\n";
}
}
- $output .= ' ';
+ $output .= ' '."\n";
} else {
$output = &mt('Self-enrollment is not currently available for this course.');
}
--raeburn1216297348--
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 15:27:16 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 14:27:16 -0000
Subject: [LON-CAPA-cvs] cvs: loncom / development_dns_domain.tab
Message-ID:
raeburn Thu Jul 17 10:27:16 2008 EDT
Modified files:
/loncom development_dns_domain.tab
Log:
- Primary library server for sfud needs to be consistent with development_dns_hosts.tab.
Index: loncom/development_dns_domain.tab
diff -u loncom/development_dns_domain.tab:1.9 loncom/development_dns_domain.tab:1.10
--- loncom/development_dns_domain.tab:1.9 Tue May 6 16:55:57 2008
+++ loncom/development_dns_domain.tab Thu Jul 17 10:27:14 2008
@@ -21,6 +21,6 @@
conference:2006 Conference:krb4:MSU.EDU:en-US:East Lansing, MI:-84.483:42.737:conferencel1
bridge:Bridge Tasks Test:krb4:MSU.EDU:en-US:East Lansing, MI:-84.483:42.737:btl1
vlernen:Vernetztes Lernen:::de:Hagen
-sfud:Simon Fraser University Development:::en-US:Vancouver, BC:-123.078:49.316:sfud1
+sfud:Simon Fraser University Development:::en-US:Vancouver, BC:-123.078:49.316:sfudl1
banghart:Development domain::banghartl1:::::banghartl1
hope:Hope College Chemistry Development Server::tea01:::::tea01
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 21:05:16 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 20:05:16 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
Message-ID:
raeburn Thu Jul 17 16:05:16 2008 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- Moving evaluation of modifiable user information fields in selfcreate context to &selfcreate_canmodify().
- Escaping institutional status types in form elements included in self-enrollment configuration screen.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.256 loncom/interface/loncreateuser.pm:1.257
--- loncom/interface/loncreateuser.pm:1.256 Wed Jul 16 08:06:28 2008
+++ loncom/interface/loncreateuser.pm Thu Jul 17 16:05:14 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.256 2008/07/16 12:06:28 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.257 2008/07/17 20:05:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1397,30 +1397,24 @@
sub personal_data_display {
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_;
- my ($output,$showforceid,%userenv,%canmodify,@inststatuses);
+ my ($output,$showforceid,%userenv,%canmodify);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
my $rowcount = 0;
my $editable = 0;
- if ($context eq 'selfcreate') {
- if (ref($inst_results) eq 'HASH') {
- @inststatuses = &get_inststatuses($inst_results);
- if (@inststatuses == 0) {
- @inststatuses = ('default');
- }
- $rolesarray = \@inststatuses;
- }
- }
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
}
- if ((!$newuser) || ($context eq 'selfcreate')) {
+ if (!$newuser) {
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
\@userinfo,$rolesarray);
+ } elsif ($context eq 'selfcreate') {
+ %canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
+ $inst_results,$rolesarray);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1506,6 +1500,21 @@
}
}
+sub selfcreate_canmodify {
+ my ($context,$dom,$userinfo,$inst_results,$rolesarray) = @_;
+ if (ref($inst_results) eq 'HASH') {
+ my @inststatuses = &get_inststatuses($inst_results);
+ if (@inststatuses == 0) {
+ @inststatuses = ('default');
+ }
+ $rolesarray = \@inststatuses;
+ }
+ my %canmodify =
+ &Apache::lonuserutils::can_modify_userinfo($context,$dom,$userinfo,
+ $rolesarray);
+ return %canmodify;
+}
+
sub get_inststatuses {
my ($insthashref) = @_;
my @inststatuses = ();
@@ -3738,13 +3747,14 @@
$output .= '';
}
if (defined($usertypes->{$type})) {
+ my $esc_type = &escape($type);
$output .= ' 0) {
if (grep(/^any$/,@{$currinsttypes})) {
$output .= 'checked="checked"';
- } elsif (grep(/^\Q$type\E$/,@{$currinsttypes})) {
+ } elsif (grep(/^\Q$esc_type\E$/,@{$currinsttypes})) {
$output .= 'checked="checked"';
}
} else {
@@ -4734,8 +4744,9 @@
my $othervalue = 'any';
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
if (@{$types} > 0) {
+ my @esc_types = map { &escape($_); } @{$types};
$othervalue = 'other';
- $typestr = join(',',(@{$types},$othervalue));
+ $typestr = join(',',($othervalue,@esc_types));
}
$typestr = $othervalue;
} else {
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 21:08:17 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 20:08:17 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface selfenroll.pm
Message-ID:
raeburn Thu Jul 17 16:08:17 2008 EDT
Modified files:
/loncom/interface selfenroll.pm
Log:
- lonnet::userenvironment() takes items to be retrieved (last arg) as an array, not a ref to an array.
- institutional status types allowed to self-enroll stored in an escape form, need to unescape before
creating string to display which types are permitted to self-enroll.
Index: loncom/interface/selfenroll.pm
diff -u loncom/interface/selfenroll.pm:1.12 loncom/interface/selfenroll.pm:1.13
--- loncom/interface/selfenroll.pm:1.12 Thu Jul 17 08:22:28 2008
+++ loncom/interface/selfenroll.pm Thu Jul 17 16:08:17 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Allow users to self-enroll in a course
#
-# $Id: selfenroll.pm,v 1.12 2008/07/17 12:22:28 raeburn Exp $
+# $Id: selfenroll.pm,v 1.13 2008/07/17 20:08:17 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -453,14 +453,12 @@
sub user_can_selfenroll {
my ($udom,$uname,$domenrolltypes) = @_;
my $selfenroll = 0;
- my @info = ['inststatus'];
- my %userhash = &Apache::lonnet::userenvironment($udom,$uname,@info);
+ my %userhash = &Apache::lonnet::userenvironment($udom,$uname,'inststatus');
my @inststatuses;
if ($userhash{'inststatus'} eq '') {
push(@inststatuses,'other');
} else {
- my @esc_statuses = split(/:/,$userhash{'inststatus'});
- @inststatuses = map { &unescape($_); } (@esc_statuses);
+ @inststatuses = split(':',$userhash{'inststatus'});
}
foreach my $type (@inststatuses) {
if (ref($domenrolltypes) eq 'ARRAY') {
@@ -508,12 +506,13 @@
if ($selfdom =~ /^$match_domain$/) {
if (&Apache::lonnet::domain($selfdom) ne '') {
my @types = split(/,/,$type_str);
+ my @unesc_types = map { &unescape($_); } @types;
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($selfdom);
if (ref($usertypes) eq 'HASH') {
my $anytype = 1;
foreach my $key (keys(%{$usertypes})) {
- if (!grep(/^\Q$key\E$/,@types)) {
+ if (!grep(/^\Q$key\E$/,@unesc_types)) {
$anytype = 0;
last;
}
@@ -525,13 +524,16 @@
}
$usertypes->{'any'} = &mt('Any users');
$usertypes->{'other'} = &mt('Others');
+ my @showtypes;
if ($anytype) {
@{$enrolltypes{$selfdom}} = ('any');
+ @showtypes = ('any');
} else {
@{$enrolltypes{$selfdom}} = @types;
+ @showtypes = @unesc_types;
}
@{$longtypes{$selfdom}} =
- map {$usertypes->{$_}} @{$enrolltypes{$selfdom}}
+ map {$usertypes->{$_}} @showtypes;
}
}
}
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 21:19:43 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 20:19:43 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface createaccount.pm
Message-ID:
raeburn Thu Jul 17 16:19:43 2008 EDT
Modified files:
/loncom/interface createaccount.pm
Log:
- Fix typo (missing quote after cid in call to echo_form_output().
- Checking of username against institutional rules moved to &call_rulecheck() routine.
- Institutional ststus types including as final arg in call to Apache::lonnet::modifyuser().
- Sanity checking so unmodifiable fields use institutional data for the new user.
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.22 loncom/interface/createaccount.pm:1.23
--- loncom/interface/createaccount.pm:1.22 Thu Jul 17 08:10:05 2008
+++ loncom/interface/createaccount.pm Thu Jul 17 16:19:43 2008
@@ -3,7 +3,7 @@
# institutional log-in ID (institutional authentication required - localauth
# or kerberos) or an e-mail address.
#
-# $Id: createaccount.pm,v 1.22 2008/07/17 12:10:05 raeburn Exp $
+# $Id: createaccount.pm,v 1.23 2008/07/17 20:19:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -263,7 +263,7 @@
&Apache::lonhtmlcommon::echo_form_input(['backto','logtoken',
'token','serverid','uname','upass','phase','create_with_email',
'code','useremail','crypt','cfirstname','clastname',
- 'cmiddlename','cgeneration','cpermanentemail','cid]).
+ 'cmiddlename','cgeneration','cpermanentemail','cid']).
'');
}
$r->print(&Apache::loncommon::end_page());
@@ -517,17 +517,13 @@
$contact_email,$captcha_hash{$captcha_chk});
return $output;
}
- my (%rulematch,%inst_results,%curr_rules,%got_rules,%alerts);
my $uhome=&Apache::lonnet::homeserver($useremail,$domain);
if ($uhome eq 'no_host') {
- my $checkhash;
- my $checks = { 'username' => 1 };
- $checkhash->{$useremail.':'.$domain} = { 'newuser' => 1, };
- &Apache::loncommon::user_rule_check($checkhash,$checks,
- \%alerts,\%rulematch,\%inst_results,\%curr_rules,
- \%got_rules);
- if (ref($alerts{'useremail'}) eq 'HASH') {
- if (ref($alerts{'useremail'}{$domain}) eq 'HASH') {
+ my (%rulematch,%inst_results,%curr_rules,%got_rules,%alerts);
+ &call_rulecheck($useremail,$domain,\%alerts,\%rulematch,
+ \%inst_results,\%curr_rules,%got_rules,'username');
+ if (ref($alerts{'username'}) eq 'HASH') {
+ if (ref($alerts{'username'}{$domain}) eq 'HASH') {
if ($alerts{'username'}{$domain}{$useremail}) {
$output = &invalid_state('userrules',$domdesc,
$contact_name,$contact_email);
@@ -552,6 +548,20 @@
return $output;
}
+sub call_rulecheck {
+ my ($uname,$udom,$alerts,$rulematch,$inst_results,$curr_rules,
+ $got_rules,$tocheck) = @_;
+ my ($checkhash,$checks);
+ $checkhash->{$uname.':'.$udom} = { 'newuser' => 1, };
+ if ($tocheck eq 'username') {
+ $checks = { 'username' => 1 };
+ }
+ &Apache::loncommon::user_rule_check($checkhash,$checks,
+ $alerts,$rulematch,$inst_results,$curr_rules,
+ $got_rules);
+ return;
+}
+
sub send_token {
my ($domain,$email,$server,$domdesc,$contact_name,$contact_email,$courseid) = @_;
my $msg = ''.&mt('Account creation status').' '.
@@ -866,14 +876,10 @@
sub username_check {
my ($username,$domain,$domdesc,$courseid,$lonhost,$contact_email,$contact_name,
$sso_logout) = @_;
- my (%rulematch,%inst_results,$newuser,$checkfail,$rowcount,$editable,$output,$msg,
+ my (%rulematch,%inst_results,$checkfail,$rowcount,$editable,$output,$msg,
%alerts,%curr_rules,%got_rules);
- $newuser = 1;
- my $checkhash;
- my $checks = { 'username' => 1 };
- $checkhash->{$username.':'.$domain} = { 'newuser' => $newuser };
- &Apache::loncommon::user_rule_check($checkhash,$checks,\%alerts,\%rulematch,
- \%inst_results,\%curr_rules,\%got_rules);
+ &call_rulecheck($username,$domain,\%alerts,\%rulematch,
+ \%inst_results,\%curr_rules,%got_rules,'username');
if (ref($alerts{'username'}) eq 'HASH') {
if (ref($alerts{'username'}{$domain}) eq 'HASH') {
if ($alerts{'username'}{$domain}{$username}) {
@@ -999,13 +1005,32 @@
}
}
# Call modifyuser
+ my (%rulematch,%inst_results,%curr_rules,%got_rules,%alerts,%info);
+ &call_rulecheck($username,$domain,\%alerts,\%rulematch,
+ \%inst_results,\%curr_rules,%got_rules);
+ my @userinfo = ('firstname','middlename','lastname','generation',
+ 'permanentemail','id');
+ my %canmodify =
+ &Apache::loncreateuser::selfcreate_canmodify('selfcreate',$domain,
+ \@userinfo,\%inst_results);
+ foreach my $item (@userinfo) {
+ if ($canmodify{$item}) {
+ $info{$item} = $env{'form.c'.$item};
+ } else {
+ $info{$item} = $inst_results{$username.':'.$domain}{$item};
+ }
+ }
+ if (ref($inst_results{$username.':'.$domain}{'inststatus'}) eq 'ARRAY') {
+ my @inststatuses = @{$inst_results{$username.':'.$domain}{'inststatus'}};
+ $info{'inststatus'} = join(':',map { &escape($_); } @inststatuses);
+ }
my $result =
- &Apache::lonnet::modifyuser($domain,$username,$env{'form.courseid'},
+ &Apache::lonnet::modifyuser($domain,$username,$env{'form.cid'},
$domdefaults{'auth_def'},
- $domdefaults{'auth_arg_def'},$env{'form.cfirstname'},
- $env{'form.cmiddlename'},$env{'form.clastname'},
- $env{'form.cgeneration'},undef,undef,
- $env{'form.cpermanentemail'});
+ $domdefaults{'auth_arg_def'},$info{'firstname'},
+ $info{'middlename'},$info{'lastname'},
+ $info{'generation'},undef,undef,
+ $info{'permanentemail'},$info{'inststatus'});
if ($result eq 'ok') {
my $delete = &Apache::lonnet::tmpdel($env{'form.authtoken'});
$output = &mt('A LON-CAPA account has been created for username: [_1] in domain: [_2].',$username,$domain);
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 22:22:52 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 21:22:52 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
Message-ID:
raeburn Thu Jul 17 17:22:52 2008 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- &modifyuser() takes additional arg - $inststatus -- this is a : separated string of escaped institutional status types assigned to the user.
- Message logged by modifyuser() incorporates email and inststatus.
- Message logged by modifyuser() displays who performed the modification, unless this
was a self-creation event, in which case self-creation is recorded.
- Now CCs can modify permenent e-mail, no longer automatically set notification -mail
and critical notification e-mail to the same, to avoid overwriting user preference.
- Update documentation for modifyuser().
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.962 loncom/lonnet/perl/lonnet.pm:1.963
--- loncom/lonnet/perl/lonnet.pm:1.962 Thu Jun 26 15:54:19 2008
+++ loncom/lonnet/perl/lonnet.pm Thu Jul 17 17:22:51 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.962 2008/06/26 19:54:19 raeburn Exp $
+# $Id: lonnet.pm,v 1.963 2008/07/17 21:22:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5558,7 +5558,7 @@
my ($udom, $uname, $uid,
$umode, $upass, $first,
$middle, $last, $gene,
- $forceid, $desiredhome, $email)=@_;
+ $forceid, $desiredhome, $email, $inststatus)=@_;
$udom= &LONCAPA::clean_domain($udom);
$uname=&LONCAPA::clean_username($uname);
&logthis('Call to modify user '.$udom.', '.$uname.', '.$uid.', '.
@@ -5619,7 +5619,7 @@
# -------------------------------------------------------------- Add names, etc
my @tmp=&get('environment',
['firstname','middlename','lastname','generation','id',
- 'permanentemail'],
+ 'permanentemail','inststatus'],
$udom,$uname);
my %names;
if ($tmp[0] =~ m/^error:.*/) {
@@ -5637,19 +5637,23 @@
if (defined($gene)) { $names{'generation'} = $gene; }
if ($email) {
$email=~s/[^\w\@\.\-\,]//gs;
- if ($email=~/\@/) { $names{'notification'} = $email;
- $names{'critnotification'} = $email;
- $names{'permanentemail'} = $email; }
+ if ($email=~/\@/) { $names{'permanentemail'} = $email; }
}
if ($uid) { $names{'id'} = $uid; }
+ if (defined($inststatus)) { $names{'inststatus'} = $inststatus; }
my $reply = &put('environment', \%names, $udom,$uname);
if ($reply ne 'ok') { return 'error: '.$reply; }
my $sqlresult = &update_allusers_table($uname,$udom,\%names);
&devalidate_cache_new('namescache',$uname.':'.$udom);
- &logthis('Success modifying user '.$udom.', '.$uname.', '.$uid.', '.
- $umode.', '.$first.', '.$middle.', '.
- $last.', '.$gene.' by '.
- $env{'user.name'}.' at '.$env{'user.domain'});
+ my $logmsg = 'Success modifying user '.$udom.', '.$uname.', '.$uid.', '.
+ $umode.', '.$first.', '.$middle.', '.
+ $last.', '.$gene.', '.$email.', '.$inststatus;
+ if ($env{'user.name'} ne '' && $env{'user.domain'}) {
+ $logmsg .= ' by '.$env{'user.name'}.' at '.$env{'user.domain'};
+ } else {
+ $logmsg .= ' during self creation';
+ }
+ &logthis($logmsg);
return 'ok';
}
@@ -9147,7 +9151,8 @@
=item *
-modifyuser($udom,$uname,$uid,$umode,$upass,$first,$middle,$last,$gene) :
+modifyuser($udom,$uname,$uid,$umode,$upass,$first,$middle,$last,$gene,
+ $forceid,$desiredhome,$email,$inststatus) :
modify user
=item *
@@ -9198,13 +9203,15 @@
=item B<$type> Type of enrollment (auto or manual)
-=item B<$locktype>
+=item B<$locktype> boolean - enrollment type locked to prevent Autoenroll.pl changing manual to auto
+
+=item B<$cid> courseID - needed if a course role is assigned by a user whose current role is DC
-=item B<$cid>
+=item B<$selfenroll> boolean - 1 if user role change occurred via self-enrollment
-=item B<$selfenroll>
+=item B<$context> role change context (shown in User Management Logs display in a course)
-=item B<$context>
+=item B<$inststatus> institutional status of user - : separated string of escaped status types
=back
From lon-capa-cvs-allow@mail.lon-capa.org Thu Jul 17 23:45:50 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 22:45:50 -0000
Subject: [LON-CAPA-cvs] cvs: modules /msu/sentinel install_mod_sentinel
Message-ID:
raeburn Thu Jul 17 18:45:50 2008 EDT
Modified files:
/modules/msu/sentinel install_mod_sentinel
Log:
- Add extra step required with gsoap 2.7.10.
Index: modules/msu/sentinel/install_mod_sentinel
diff -u modules/msu/sentinel/install_mod_sentinel:1.4 modules/msu/sentinel/install_mod_sentinel:1.5
--- modules/msu/sentinel/install_mod_sentinel:1.4 Wed Jan 16 21:52:50 2008
+++ modules/msu/sentinel/install_mod_sentinel Thu Jul 17 18:45:47 2008
@@ -11,6 +11,16 @@
make
make install
+#
+# Note: a newer version of goap (gsoap_2.7.10) is available
+# If you install this version you need to do the following
+# otherwise make for mod_sentinel (below) will fail
+#
+# cd /usr/src/gsoap-2.7
+# mkdir soapcpp2/gsoap-palm
+# cp /usr/src/gsoap-2.7/gsoap/stdsoap2.c /usr/src/gsoap-2.7/soapcpp2/gsoap-palm/stdsoap2.c
+#
+
# get, build and install mod_sentinel
cd /usr/src
wget http://install.loncapa.org/msu/mod_sentinel-2.3.tgz
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:01:48 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:01:48 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn procedures.txt
Message-ID:
raeburn Thu Jul 17 19:01:48 2008 EDT
Added files:
/modules/raeburn procedures.txt
Log:
- Starting to document procedures at MSU.
Index: modules/raeburn/procedures.txt
+++ modules/raeburn/procedures.txt
Regular maintenance tasks
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:03:11 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:03:11 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn procedures.txt
Message-ID:
raeburn Thu Jul 17 19:03:11 2008 EDT
Modified files:
/modules/raeburn procedures.txt
Log:
- update scope of document
Index: modules/raeburn/procedures.txt
diff -u modules/raeburn/procedures.txt:1.1 modules/raeburn/procedures.txt:1.2
--- modules/raeburn/procedures.txt:1.1 Thu Jul 17 19:01:48 2008
+++ modules/raeburn/procedures.txt Thu Jul 17 19:03:11 2008
@@ -1 +1 @@
-Regular maintenance tasks
+Regular maintenance tasks and Disaster Recovery.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:18:24 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:18:24 -0000
Subject: [LON-CAPA-cvs] cvs: CVSROOT / loginfo.pl
Message-ID:
raeburn Thu Jul 17 19:18:24 2008 EDT
Modified files:
/CVSROOT loginfo.pl
Log:
- Keep updates committed here out of CVS mail.
Index: CVSROOT/loginfo.pl
diff -u CVSROOT/loginfo.pl:1.6 CVSROOT/loginfo.pl:1.7
--- CVSROOT/loginfo.pl:1.6 Mon Feb 11 15:00:15 2008
+++ CVSROOT/loginfo.pl Thu Jul 17 19:18:24 2008
@@ -122,7 +122,8 @@
if ($file =~ m|TexConvert/tt.dynamic| ||
$file =~ m|foxr/londtest| ||
$file =~ m|purdue| ||
- $file =~ m|vcu/| ) {
+ $file =~ m|vcu/| ||
+ $file =~ m|raeburn/private| ) {
$diffmsg='Diffs for '.$file.' not shown.'."\n";
next;
}
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:20:58 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:20:58 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 19:20:58 2008 EDT
Added files:
/modules/raeburn/private procedures.txt
Log:
- Moving MSU procedures document to a quiet place.
Index: modules/raeburn/private/procedures.txt
+++ modules/raeburn/private/procedures.txt
Regular maintenance tasks and Disaster Recovery.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:22:05 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:22:05 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn procedures.txt
Message-ID:
raeburn Thu Jul 17 19:22:05 2008 EDT
Removed files:
/modules/raeburn procedures.txt
Log:
- No longer here.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:24:10 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:24:10 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 19:24:10 2008 EDT
Modified files:
/modules/raeburn/private procedures.txt
Log:
- Add a line.
Index: modules/raeburn/private/procedures.txt
diff -u modules/raeburn/private/procedures.txt:1.1 modules/raeburn/private/procedures.txt:1.2
--- modules/raeburn/private/procedures.txt:1.1 Thu Jul 17 19:20:55 2008
+++ modules/raeburn/private/procedures.txt Thu Jul 17 19:24:09 2008
@@ -1 +1,3 @@
Regular maintenance tasks and Disaster Recovery.
+
+Information about servers used by the LON-CAPA project at MSU is here:
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:28:25 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:28:25 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 19:28:25 2008 EDT
Modified files:
/modules/raeburn/private procedures.txt
Log:
- Add URL.
Index: modules/raeburn/private/procedures.txt
diff -u modules/raeburn/private/procedures.txt:1.2 modules/raeburn/private/procedures.txt:1.3
--- modules/raeburn/private/procedures.txt:1.2 Thu Jul 17 19:24:09 2008
+++ modules/raeburn/private/procedures.txt Thu Jul 17 19:28:25 2008
@@ -1,3 +1,4 @@
Regular maintenance tasks and Disaster Recovery.
Information about servers used by the LON-CAPA project at MSU is here:
+http://loncapa.msu.edu/
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 00:42:25 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Thu, 17 Jul 2008 23:42:25 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 19:42:25 2008 EDT
Modified files:
/modules/raeburn/private procedures.txt
Log:
- More URLs
Diffs for modules/raeburn/private/procedures.txt not shown.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 01:01:14 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 00:01:14 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 20:01:14 2008 EDT
Modified files:
/modules/raeburn/private procedures.txt
Log:
- URLs complete.
Diffs for modules/raeburn/private/procedures.txt not shown.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 01:05:29 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 00:05:29 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private procedures.txt
Message-ID:
raeburn Thu Jul 17 20:05:29 2008 EDT
Modified files:
/modules/raeburn/private procedures.txt
Log:
- Regular Maintenance
Diffs for modules/raeburn/private/procedures.txt not shown.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 02:46:10 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 01:46:10 -0000
Subject: [LON-CAPA-cvs] cvs: modules /raeburn/private remote_access_iptables
Message-ID:
raeburn Thu Jul 17 21:46:10 2008 EDT
Added files:
/modules/raeburn/private remote_access_iptables
Log:
- Start of iptables
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 03:12:40 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 02:12:40 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
Message-ID:
raeburn Thu Jul 17 22:12:40 2008 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- combine blocks for !$newuser.
- change order of values for join to create $typestr.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.257 loncom/interface/loncreateuser.pm:1.258
--- loncom/interface/loncreateuser.pm:1.257 Thu Jul 17 16:05:14 2008
+++ loncom/interface/loncreateuser.pm Thu Jul 17 22:12:39 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.257 2008/07/17 20:05:14 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.258 2008/07/18 02:12:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1407,8 +1407,6 @@
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
- }
- if (!$newuser) {
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
\@userinfo,$rolesarray);
@@ -4746,7 +4744,7 @@
if (@{$types} > 0) {
my @esc_types = map { &escape($_); } @{$types};
$othervalue = 'other';
- $typestr = join(',',($othervalue,@esc_types));
+ $typestr = join(',',(@esc_types,$othervalue));
}
$typestr = $othervalue;
} else {
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 03:15:33 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 02:15:33 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(version_2_7_X) /interface loncreateuser.pm
Message-ID:
raeburn Thu Jul 17 22:15:33 2008 EDT
Modified files: (Branch: version_2_7_X)
/loncom/interface loncreateuser.pm
Log:
- backport 1.27, 1.258
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.249.2.4 loncom/interface/loncreateuser.pm:1.249.2.5
--- loncom/interface/loncreateuser.pm:1.249.2.4 Wed Jul 16 08:32:11 2008
+++ loncom/interface/loncreateuser.pm Thu Jul 17 22:15:32 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.249.2.4 2008/07/16 12:32:11 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.249.2.5 2008/07/18 02:15:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1397,30 +1397,22 @@
sub personal_data_display {
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_;
- my ($output,$showforceid,%userenv,%canmodify,@inststatuses);
+ my ($output,$showforceid,%userenv,%canmodify);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
my $rowcount = 0;
my $editable = 0;
- if ($context eq 'selfcreate') {
- if (ref($inst_results) eq 'HASH') {
- @inststatuses = &get_inststatuses($inst_results);
- if (@inststatuses == 0) {
- @inststatuses = ('default');
- }
- $rolesarray = \@inststatuses;
- }
- }
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
- }
- if ((!$newuser) || ($context eq 'selfcreate')) {
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
\@userinfo,$rolesarray);
+ } elsif ($context eq 'selfcreate') {
+ %canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
+ $inst_results,$rolesarray);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1506,6 +1498,21 @@
}
}
+sub selfcreate_canmodify {
+ my ($context,$dom,$userinfo,$inst_results,$rolesarray) = @_;
+ if (ref($inst_results) eq 'HASH') {
+ my @inststatuses = &get_inststatuses($inst_results);
+ if (@inststatuses == 0) {
+ @inststatuses = ('default');
+ }
+ $rolesarray = \@inststatuses;
+ }
+ my %canmodify =
+ &Apache::lonuserutils::can_modify_userinfo($context,$dom,$userinfo,
+ $rolesarray);
+ return %canmodify;
+}
+
sub get_inststatuses {
my ($insthashref) = @_;
my @inststatuses = ();
@@ -3738,13 +3745,14 @@
$output .= ' ';
}
if (defined($usertypes->{$type})) {
+ my $esc_type = &escape($type);
$output .= ' 0) {
if (grep(/^any$/,@{$currinsttypes})) {
$output .= 'checked="checked"';
- } elsif (grep(/^\Q$type\E$/,@{$currinsttypes})) {
+ } elsif (grep(/^\Q$esc_type\E$/,@{$currinsttypes})) {
$output .= 'checked="checked"';
}
} else {
@@ -4734,8 +4742,9 @@
my $othervalue = 'any';
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
if (@{$types} > 0) {
+ my @esc_types = map { &escape($_); } @{$types};
$othervalue = 'other';
- $typestr = join(',',(@{$types},$othervalue));
+ $typestr = join(',',(@esc_types,$othervalue));
}
$typestr = $othervalue;
} else {
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 04:27:48 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 03:27:48 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonupload.pm
Message-ID:
raeburn Thu Jul 17 23:27:48 2008 EDT
Modified files:
/loncom/publisher lonupload.pm
Log:
- fix perldoc
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.37 loncom/publisher/lonupload.pm:1.38
--- loncom/publisher/lonupload.pm:1.37 Mon Jun 16 22:20:08 2008
+++ loncom/publisher/lonupload.pm Thu Jul 17 23:27:48 2008
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# Handler to upload files into construction space
#
-# $Id: lonupload.pm,v 1.37 2008/06/17 02:20:08 raeburn Exp $
+# $Id: lonupload.pm,v 1.38 2008/07/18 03:27:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -453,7 +453,7 @@
upfile_store() : Store contents of uploaded file into temporary space. Invoked
by phaseone subroutine.
-= item *
+=item *
check_extension() : Checks if filename extension is permitted and checks type
of file - if html file, calls parser to check for embedded objects.
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 13:36:14 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 12:36:14 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface lonpreferences.pm
Message-ID:
raeburn Fri Jul 18 08:36:14 2008 EDT
Modified files:
/loncom/interface lonpreferences.pm
Log:
- Only show "Restrict Domain Coordinator Access" link if user has an active author role.
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.124 loncom/interface/lonpreferences.pm:1.125
--- loncom/interface/lonpreferences.pm:1.124 Tue Jun 10 10:49:07 2008
+++ loncom/interface/lonpreferences.pm Fri Jul 18 08:36:11 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.124 2008/06/10 14:49:07 www Exp $
+# $Id: lonpreferences.pm,v 1.125 2008/07/18 12:36:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1929,7 +1929,8 @@
text => 'Register Clicker'},
printmenu => 'yes',
}));
- if ($env{'user.adv'}) {
+ my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']);
+ if (keys(%author_roles) > 0) {
push (@Options,({ action => 'changedomcoord',
linktext => 'Restrict Domain Coordinator Access',
href => '/adm/preferences',
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 14:09:33 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 13:09:33 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /xml lontexconvert.pm
Message-ID:
raeburn Fri Jul 18 09:09:33 2008 EDT
Modified files:
/loncom/xml lontexconvert.pm
Log:
- Problem testing in CSTR - if blank was selected for "math rendering" option, don't return, otherwise tex engine set in user preference will be ignored.
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.87 loncom/xml/lontexconvert.pm:1.88
--- loncom/xml/lontexconvert.pm:1.87 Wed Feb 6 05:16:00 2008
+++ loncom/xml/lontexconvert.pm Fri Jul 18 09:09:33 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.87 2008/02/06 10:16:00 foxr Exp $
+# $Id: lontexconvert.pm,v 1.88 2008/07/18 13:09:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -219,7 +219,9 @@
sub tex_engine {
if (exists($env{'form.texengine'})) {
- return $env{'form.texengine'};
+ if ($env{'form.texengine'} ne '') {
+ return $env{'form.texengine'};
+ }
}
if ($env{'request.course.id'}
&& exists($env{'course.'.$env{'request.course.id'}.'.texengine'})) {
From lon-capa-cvs-allow@mail.lon-capa.org Fri Jul 18 17:17:39 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Fri, 18 Jul 2008 16:17:39 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /auth lonroles.pm
Message-ID:
raeburn Fri Jul 18 12:17:39 2008 EDT
Modified files:
/loncom/auth lonroles.pm
Log:
- If user has only one active role do not show "Select a Course to Enter" header line.
- If user has only one active role do not show "No role specified" line, since automatic role selection for users with a single role means role type "cm" is inaccessible.
- If user has a single active role, and that role is au, ca or aa, only do automatic role selection if user's session is on home server for corresponding author; display a switch server link if not (we don't automatically switch in case the home server is overloaded and we could get into an infinite loop of switching/offloading).
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.201 loncom/auth/lonroles.pm:1.202
--- loncom/auth/lonroles.pm:1.201 Mon Jul 14 06:21:52 2008
+++ loncom/auth/lonroles.pm Fri Jul 18 12:17:39 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.201 2008/07/14 10:21:52 raeburn Exp $
+# $Id: lonroles.pm,v 1.202 2008/07/18 16:17:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -714,19 +714,31 @@
$r->print(&Apache::loncommon::end_page());
return OK;
# Is there only one choice?
- } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
- $r->print(''.&mt('Please stand by.').' '.
- ' '.
+ } elsif ($countactive==1) {
+ my $needs_switchserver;
+ if ($env{'user.author'}) {
+ $needs_switchserver = &check_needs_switchserver($possiblerole);
+ }
+ if ((!$needs_switchserver) && ($env{'request.role'} eq 'cm')) {
+ $r->print(''.&mt('Please stand by.').' '.
+ ' '.
' ');
- $r->print("\n");
- $r->rflush();
- $r->print('');
- $r->print(&Apache::loncommon::end_page());
- return OK;
+ $r->print("\n");
+ $r->rflush();
+ $r->print('');
+ $r->print(&Apache::loncommon::end_page());
+ return OK;
+ }
+ if ($needs_switchserver) {
+ $r->print("".&mt('Server Switch Required')." \n".
+ &mt('Construction Space access is only available from '.
+ 'the home server of the corresponding Author.').' '.
+ &mt("Click the 'Switch Server' link to go there.").' ');
+ }
}
# More than one possible role
# ----------------------------------------------------------------------- Table
- unless ((!&Apache::lonmenu::show_course()) || ($nochoose)) {
+ unless ((!&Apache::lonmenu::show_course()) || ($nochoose) || ($countactive==1)) {
$r->print("".&mt('Select a Course to Enter')." \n");
}
my $doheaders = &roletable_headers($r,\%roleclass,\%sortrole,$nochoose);
@@ -761,27 +773,28 @@
&Apache::loncommon::authorbrowser_javascript());
}
&print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles,\%roletext);
- my $tremark='';
- my $tfont='#003300';
- if ($env{'request.role'} eq 'cm') {
- $r->print('');
- $tremark=&mt('Currently selected. ');
- $tfont='#002200';
- } else {
- $r->print(' ');
- }
- unless ($nochoose) {
- if ($env{'request.role'} ne 'cm') {
- $r->print(' ');
- } else {
- $r->print(' ');
- }
- }
- $r->print(''.&mt('No role specified').
- ' '.$tremark.
- ' '."\n");
-
+ if ($countactive > 1) {
+ my $tremark='';
+ my $tfont='#003300';
+ if ($env{'request.role'} eq 'cm') {
+ $r->print('');
+ $tremark=&mt('Currently selected. ');
+ $tfont='#002200';
+ } else {
+ $r->print(' ');
+ }
+ unless ($nochoose) {
+ if ($env{'request.role'} ne 'cm') {
+ $r->print(' ');
+ } else {
+ $r->print(' ');
+ }
+ }
+ $r->print(''.&mt('No role specified').
+ ' '.$tremark.
+ ' '."\n");
+ }
$r->print('');
unless ($nochoose) {
$r->print("\n");
@@ -1019,6 +1032,24 @@
return $roletext;
}
+sub check_needs_switchserver {
+ my ($possiblerole) = @_;
+ my $needs_switchserver;
+ my ($role,$where) = split(/\./,$possiblerole,2);
+ my (undef,$tdom,$twho) = split(/\//,$where);
+ my ($server_status,$home);
+ if (($role eq 'ca') || ($role eq 'aa')) {
+ ($server_status,$home) = &check_author_homeserver($twho,$tdom);
+ } else {
+ ($server_status,$home) = &check_author_homeserver($env{'user.name'},
+ $env{'user.domain'});
+ }
+ if ($server_status eq 'switchserver') {
+ $needs_switchserver = 1;
+ }
+ return $needs_switchserver;
+}
+
sub check_author_homeserver {
my ($uname,$udom)=@_;
if (($uname eq '') || ($udom eq '')) {
From lon-capa-cvs-allow@mail.lon-capa.org Sat Jul 19 03:28:45 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Sat, 19 Jul 2008 02:28:45 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
Message-ID:
raeburn Fri Jul 18 22:28:45 2008 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Set value of $colspan once only when creating data tables.
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.63 loncom/interface/domainprefs.pm:1.64
--- loncom/interface/domainprefs.pm:1.63 Sat Jul 12 20:00:50 2008
+++ loncom/interface/domainprefs.pm Fri Jul 18 22:28:44 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.63 2008/07/13 00:00:50 raeburn Exp $
+# $Id: domainprefs.pm,v 1.64 2008/07/19 02:28:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -393,7 +393,10 @@
if (($action eq 'autoupdate') || ($action eq 'rolecolors') ||
($action eq 'usercreation') || ($action eq 'usermodification') ||
($action eq 'coursecategories')) {
- my $colspan = ($action eq 'rolecolors')?' colspan="2"':'';
+ my $colspan = '';
+ if (($action eq 'rolecolors') || ($action eq 'coursecategories')) {
+ $colspan = ' colspan="2"';
+ }
$output .= '
@@ -423,7 +426,6 @@
'.&mt($item->{'header'}->[1]->{'col1'}).' ';
- my $colspan = ($action eq 'coursecategories')?' colspan="2"':'';
$output .= '
'.&mt($item->{'header'}->[1]->{'col2'}).'
';
From lon-capa-cvs-allow@mail.lon-capa.org Sat Jul 19 14:01:51 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (lon-capa-cvs-allow@mail.lon-capa.org)
Date: Sat, 19 Jul 2008 09:01:51 -0400
Subject: [LON-CAPA-cvs] Anjelina Jolie XXX Video Free.
Message-ID: <20080229070206.3019.qmail@bcs-1986ddf93d5>
Free Video Nude Anjelia Jolie
About this mailing:
You are receiving this e-mail because you subscribed to MSN Featured Offers. Microsoft respects your privacy. If you do not wish to receive this MSN Featured Offers e-mail, please click the "Unsubscribe" link below. This will not unsubscribe
you from e-mail communications from third-party advertisers that may appear in MSN Feature Offers. This shall not constitute an offer by MSN. MSN shall not be responsible or liable for the advertisers' content nor any of the goods or service
advertised. Prices and item availability subject to change without notice.
©2008 Microsoft | Unsubscribe | More Newsletters | Privacy
Microsoft Corporation, One Microsoft Way, Redmond, WA 98052
From lon-capa-cvs-allow@mail.lon-capa.org Sat Jul 19 15:51:14 2008
From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn)
Date: Sat, 19 Jul 2008 14:51:14 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface lonhelpmenu.pm
Message-ID:
raeburn Sat Jul 19 10:51:14 2008 EDT
Modified files:
/loncom/interface lonhelpmenu.pm
Log:
- This is inside an <