| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.33 2004/12/21 04:40:56 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.34 2005/05/20 16:28:25 gage Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 56 | unless ($authz->hasPermissions($user, "create_and_delete_courses")) { |
56 | unless ($authz->hasPermissions($user, "create_and_delete_courses")) { |
| 57 | $self->addmessage( CGI::div({class=>'ResultsWithError'},"$user is not authorized to create or delete courses") ); |
57 | $self->addmessage( CGI::div({class=>'ResultsWithError'},"$user is not authorized to create or delete courses") ); |
| 58 | return; |
58 | return; |
| 59 | } |
59 | } |
| 60 | |
60 | |
|
|
61 | # get result and send to message |
|
|
62 | my $status_message = $r->param("status_message"); |
|
|
63 | $self->addmessage(CGI::p("$status_message")) if $status_message; |
|
|
64 | |
| 61 | ## if the user is asking for the downloaded database... |
65 | ## if the user is asking for the downloaded database... |
| 62 | #if (defined $r->param("download_exported_database")) { |
66 | #if (defined $r->param("download_exported_database")) { |
| 63 | # my $courseID = $r->param("export_courseID"); |
67 | # my $courseID = $r->param("export_courseID"); |
| 64 | # my $random_chars = $r->param("download_exported_database"); |
68 | # my $random_chars = $r->param("download_exported_database"); |
| 65 | # |
69 | # |
| … | |
… | |
| 686 | |
690 | |
| 687 | # copy users from current (admin) course if desired |
691 | # copy users from current (admin) course if desired |
| 688 | if ($add_admin_users ne "") { |
692 | if ($add_admin_users ne "") { |
| 689 | foreach my $userID ($db->listUsers) { |
693 | foreach my $userID ($db->listUsers) { |
| 690 | if ($userID eq $add_initial_userID) { |
694 | if ($userID eq $add_initial_userID) { |
| 691 | warn "User '$userID' will not be copied from admin course as it is the initial instructor."; |
695 | $self->addbadmessage( "User '$userID' will not be copied from admin course as it is the initial instructor."); |
| 692 | next; |
696 | next; |
| 693 | } |
697 | } |
| 694 | my $User = $db->getUser($userID); |
698 | my $User = $db->getUser($userID); |
| 695 | my $Password = $db->getPassword($userID); |
699 | my $Password = $db->getPassword($userID); |
| 696 | my $PermissionLevel = $db->getPermissionLevel($userID); |
700 | my $PermissionLevel = $db->getPermissionLevel($userID); |