[system] / branches / rel-2-4-patches / webwork-modperl / lib / WeBWorK / ContentGenerator / CourseAdmin.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-4-patches/webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2298 Revision 2299
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.14 2004/06/02 18:21:38 gage Exp $ 4# $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.16 2004/06/06 00:20:14 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.
208 my $add_initial_userID = $r->param("add_initial_userID") || ""; 208 my $add_initial_userID = $r->param("add_initial_userID") || "";
209 my $add_initial_password = $r->param("add_initial_password") || ""; 209 my $add_initial_password = $r->param("add_initial_password") || "";
210 my $add_initial_password_confirm = $r->param("add_initial_password_confirm") || ""; 210 my $add_initial_password_confirm = $r->param("add_initial_password_confirm") || "";
211 my $add_feedback_email = $r->param("add_feedback_email") || ""; 211 my $add_feedback_email = $r->param("add_feedback_email") || "";
212 my $add_templates_course = $r->param("add_templates_course") || ""; 212 my $add_templates_course = $r->param("add_templates_course") || "";
213 my $add_contact_person = $r->param("add_contact_person") || ""; 213 my $add_contact_first_name = $r->param("add_contact_first_name") || "";
214 my $add_contact_last_name = $r->param("add_contact_last_name") || "";
214 my $add_contact_institution = $r->param("add_contact_institution") || ""; 215 my $add_contact_institution = $r->param("add_contact_institution") || "";
215 my $add_course_title = $r->param("add_course_title") || ""; 216 my $add_course_title = $r->param("add_course_title") || "";
216 my $add_contact_email = $r->param("add_contact_email") || ""; 217 my $add_contact_email = $r->param("add_contact_email") || "";
217 my $add_admin_userID = $r->param("add_admin_userID") || $r->param("user") || ""; 218 my $add_admin_userID = $r->param("add_admin_userID") || $r->param("user") || "";
218 my $add_admin_password = $r->param("add_admin_password") || ""; 219 my $add_admin_password = $r->param("add_admin_password") || "";
279 CGI::td(CGI::password_field("add_initial_password_confirm", $add_initial_password_confirm, 25)), 280 CGI::td(CGI::password_field("add_initial_password_confirm", $add_initial_password_confirm, 25)),
280 281
281 ), 282 ),
282 283
283 CGI::Tr( 284 CGI::Tr(
285 CGI::th({class=>"CenterHeader"}, "First name"),
284 CGI::th({class=>"CenterHeader"}, "Contact name"), 286 CGI::th({class=>"CenterHeader"}, "Last name"),
287 CGI::th({class=>"CenterHeader"}, " "),
288 ),
289 CGI::Tr(
290 CGI::td(CGI::textfield("add_contact_first_name", $add_contact_first_name, 20)),
291 CGI::td(CGI::textfield("add_contact_last_name", $add_contact_last_name, 20)),
292 CGI::th({class=>"CenterHeader"}, " "),
293 ),
294 CGI::Tr(
285 CGI::th({class=>"CenterHeader"}, "Contact institution"), 295 CGI::th({class=>"CenterHeader"}, "Contact institution"),
286 CGI::th({class=>"CenterHeader"}, "Contact e-mail"), 296 CGI::th({class=>"CenterHeader"}, "Contact e-mail"),
297 CGI::th({class=>"CenterHeader"}, " "),
287 ), 298 ),
288 CGI::Tr( 299 CGI::Tr(
289 CGI::td(CGI::textfield("add_contact_person", $add_contact_person, 35)),
290 CGI::td(CGI::textfield("add_contact_institution", $add_contact_institution, 35)), 300 CGI::td(CGI::textfield("add_contact_institution", $add_contact_institution, 35)),
291 CGI::td(CGI::textfield("add_contact_email", $add_contact_email, 35)), 301 CGI::td(CGI::textfield("add_contact_email", $add_contact_email, 35)),
302 CGI::th({class=>"CenterHeader"}, " "),
292 ), 303 ),
293 CGI::Tr( 304 CGI::Tr(
294 CGI::th({class=>"CenterHeader"}, "Administrator ID"), 305 CGI::th({class=>"CenterHeader"}, "Administrator ID"),
295 CGI::th({class=>"CenterHeader"}, "Administrator Password"), 306 CGI::th({class=>"CenterHeader"}, "Administrator Password"),
296 CGI::th({class=>"CenterHeader"}, "Feedback e-mail"), 307 CGI::th({class=>"CenterHeader"}, "Feedback e-mail"),
298 ), 309 ),
299 CGI::Tr( 310 CGI::Tr(
300 CGI::td(CGI::textfield("add_admin_userID", $add_admin_userID, 25)), 311 CGI::td(CGI::textfield("add_admin_userID", $add_admin_userID, 25)),
301 CGI::td(CGI::password_field("add_admin_password", $add_admin_password, 25)), 312 CGI::td(CGI::password_field("add_admin_password", $add_admin_password, 25)),
302 CGI::td(CGI::textfield("add_feedback_email", $add_feedback_email, 25)), 313 CGI::td(CGI::textfield("add_feedback_email", $add_feedback_email, 25)),
314
303 ), 315 ),
304 ); 316 );
305 317
306 print CGI::p("Select an existing course from which to copy templates:"); 318 print CGI::p("Select an existing course from which to copy templates:");
307 319
444 my $add_gdbm_globalUserID = $r->param("add_gdbm_globalUserID") || ""; 456 my $add_gdbm_globalUserID = $r->param("add_gdbm_globalUserID") || "";
445 my $add_initial_userID = $r->param("add_initial_userID") || ""; 457 my $add_initial_userID = $r->param("add_initial_userID") || "";
446 my $add_initial_password = $r->param("add_initial_password") || ""; 458 my $add_initial_password = $r->param("add_initial_password") || "";
447 my $add_initial_password_confirm = $r->param("add_initial_password_confirm") || ""; 459 my $add_initial_password_confirm = $r->param("add_initial_password_confirm") || "";
448 my $add_templates_course = $r->param("add_templates_course") || ""; 460 my $add_templates_course = $r->param("add_templates_course") || "";
449 my $add_contact_person = $r->param("add_contact_person") || ""; 461 my $add_contact_first_name = $r->param("add_contact_first_name") || "";
462 my $add_contact_last_name = $r->param("add_contact_last_name") || "";
450 my $add_contact_institution = $r->param("add_contact_institution") || ""; 463 my $add_contact_institution = $r->param("add_contact_institution") || "";
451 my $add_contact_email = $r->param("add_contact_email") || ""; 464 my $add_contact_email = $r->param("add_contact_email") || "";
452 my $add_course_title = $r->param("add_course_title") || ""; 465 my $add_course_title = $r->param("add_course_title") || "";
453 my $add_admin_userID = $r->param("add_admin_userID") || ""; 466 my $add_admin_userID = $r->param("add_admin_userID") || "";
454 my $add_admin_password = $r->param("add_admin_password") || ""; 467 my $add_admin_password = $r->param("add_admin_password") || "";
459 push @errors, "You must specify a course name."; 472 push @errors, "You must specify a course name.";
460 } 473 }
461 if ($add_contact_institution eq "") { 474 if ($add_contact_institution eq "") {
462 push @errors, "You must specify a contact institution." ; 475 push @errors, "You must specify a contact institution." ;
463 } 476 }
464 if ($add_contact_person eq "") { 477 if ($add_contact_last_name eq "") {
465 push @errors, "You must specify a contact person."; 478 push @errors, "You must specify a contact person.";
466 } 479 }
467 if ($add_contact_email eq "") { 480 if ($add_contact_email eq "") {
468 push @errors, "You must specify an email address for the contact person." ; 481 push @errors, "You must specify an email address for the contact person." ;
469 } 482 }
508 my $ce = $r->ce; 521 my $ce = $r->ce;
509 my $db = $r->db; 522 my $db = $r->db;
510 #my $authz = $r->authz; 523 #my $authz = $r->authz;
511 my $urlpath = $r->urlpath; 524 my $urlpath = $r->urlpath;
512 525
513 my $add_courseID = $r->param("add_courseID") || ""; 526 my $add_courseID = $r->param("add_courseID") || "";
514 my $add_dbLayout = $r->param("add_dbLayout") || ""; 527 my $add_dbLayout = $r->param("add_dbLayout") || "";
515 my $add_sql_host = $r->param("add_sql_host") || ""; 528 my $add_sql_host = $r->param("add_sql_host") || "";
516 my $add_sql_port = $r->param("add_sql_port") || ""; 529 my $add_sql_port = $r->param("add_sql_port") || "";
517 my $add_sql_username = $r->param("add_sql_username") || ""; 530 my $add_sql_username = $r->param("add_sql_username") || "";
518 my $add_sql_password = $r->param("add_sql_password") || ""; 531 my $add_sql_password = $r->param("add_sql_password") || "";
519 my $add_sql_database = $r->param("add_sql_database") || ""; 532 my $add_sql_database = $r->param("add_sql_database") || "";
520 my $add_sql_wwhost = $r->param("add_sql_wwhost") || ""; 533 my $add_sql_wwhost = $r->param("add_sql_wwhost") || "";
521 my $add_gdbm_globalUserID = $r->param("add_gdbm_globalUserID") || ""; 534 my $add_gdbm_globalUserID = $r->param("add_gdbm_globalUserID") || "";
522 my $add_initial_userID = $r->param("add_initial_userID") || ""; 535 my $add_initial_userID = $r->param("add_initial_userID") || "";
523 my $add_initial_password = $r->param("add_initial_password") || ""; 536 my $add_initial_password = $r->param("add_initial_password") || "";
524 my $add_templates_course = $r->param("add_templates_course") || ""; 537 my $add_templates_course = $r->param("add_templates_course") || "";
525 my $add_contact_person = $r->param("add_contact_person") || ""; 538 my $add_contact_first_name = $r->param("add_contact_first_name") || "";
539 my $add_contact_last_name = $r->param("add_contact_last_name") || "";
526 my $add_contact_institution = $r->param("add_contact_institution") || ""; 540 my $add_contact_institution = $r->param("add_contact_institution") || "";
527 my $add_contact_email = $r->param("add_contact_email") || ""; 541 my $add_contact_email = $r->param("add_contact_email") || "";
528 my $add_course_title = $r->param("add_course_title") || ""; 542 my $add_course_title = $r->param("add_course_title") || "";
529 my $add_admin_userID = $r->param("add_admin_userID") || $r->param("user") || ""; 543 my $add_admin_userID = $r->param("add_admin_userID") || $r->param("user") || "";
530 my $add_admin_password = $r->param("add_admin_password") || ""; 544 my $add_admin_password = $r->param("add_admin_password") || "";
531 545
532 my $ce2 = WeBWorK::CourseEnvironment->new( 546 my $ce2 = WeBWorK::CourseEnvironment->new(
533 $ce->{webworkDirs}->{root}, 547 $ce->{webworkDirs}->{root},
534 $ce->{webworkURLs}->{root}, 548 $ce->{webworkURLs}->{root},
535 $ce->{pg}->{directories}->{root}, 549 $ce->{pg}->{directories}->{root},
620 writeLog($ce, "hosted_courses", join("\t", 634 writeLog($ce, "hosted_courses", join("\t",
621 "\tAdded", 635 "\tAdded",
622 $add_contact_institution, 636 $add_contact_institution,
623 $add_course_title, 637 $add_course_title,
624 $add_courseID, 638 $add_courseID,
625 $add_contact_person, 639 $add_contact_first_name,
640 $add_contact_last_name,
626 $add_contact_email, 641 $add_contact_email,
627 )); 642 ));
628 # add contact to admin course as student? 643 # add contact to admin course as student?
629 # FIXME -- should we do this? 644 # FIXME -- should we do this?
630 print CGI::div({class=>"ResultsWithoutError"}, 645 print CGI::div({class=>"ResultsWithoutError"},
635 my $newCourseURL = $self->systemLink($newCoursePath, authen => 0); 650 my $newCourseURL = $self->systemLink($newCoursePath, authen => 0);
636 print CGI::div({style=>"text-align: center"}, 651 print CGI::div({style=>"text-align: center"},
637 CGI::a({href=>$newCourseURL}, "Log into $add_courseID"), 652 CGI::a({href=>$newCourseURL}, "Log into $add_courseID"),
638 ); 653 );
639 } 654 }
655
640} 656}
641 657
642################################################################################ 658################################################################################
643 659
644sub delete_course_form { 660sub delete_course_form {

Legend:
Removed from v.2298  
changed lines
  Added in v.2299

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9