| 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.11 2004/05/21 20:55:38 sh002i Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.12 2004/05/22 01:08:09 sh002i 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. |
| … | |
… | |
| 606 | CGI::th({class=>"LeftHeader"}, "SQL Admin Password:"), |
606 | CGI::th({class=>"LeftHeader"}, "SQL Admin Password:"), |
| 607 | CGI::td(CGI::password_field("delete_sql_password", $delete_sql_password, 25)), |
607 | CGI::td(CGI::password_field("delete_sql_password", $delete_sql_password, 25)), |
| 608 | ); |
608 | ); |
| 609 | print CGI::Tr( |
609 | print CGI::Tr( |
| 610 | CGI::th({class=>"LeftHeader"}, "SQL Database Name:"), |
610 | CGI::th({class=>"LeftHeader"}, "SQL Database Name:"), |
|
|
611 | CGI::td( |
| 611 | CGI::td(CGI::textfield("delete_sql_database", $delete_sql_database, 25)), |
612 | CGI::textfield("delete_sql_database", $delete_sql_database, 25), |
|
|
613 | CGI::br(), |
|
|
614 | CGI::small("Leave blank to use the name ", CGI::tt("webwork_COURSENAME"), "."), |
|
|
615 | ), |
| 612 | ); |
616 | ); |
| 613 | print CGI::end_table(); |
617 | print CGI::end_table(); |
| 614 | |
618 | |
| 615 | print CGI::p({style=>"text-align: center"}, CGI::submit("delete_course", "Delete Course")); |
619 | print CGI::p({style=>"text-align: center"}, CGI::submit("delete_course", "Delete Course")); |
| 616 | |
620 | |
| … | |
… | |
| 647 | $delete_courseID, |
651 | $delete_courseID, |
| 648 | ); |
652 | ); |
| 649 | |
653 | |
| 650 | if ($ce2->{dbLayoutName} eq "sql") { |
654 | if ($ce2->{dbLayoutName} eq "sql") { |
| 651 | push @errors, "You must specify the SQL admin username." if $delete_sql_username eq ""; |
655 | push @errors, "You must specify the SQL admin username." if $delete_sql_username eq ""; |
| 652 | push @errors, "You must specify the SQL admin password." if $delete_sql_password eq ""; |
656 | #push @errors, "You must specify the SQL admin password." if $delete_sql_password eq ""; |
| 653 | push @errors, "You must specify the SQL database name." if $delete_sql_database eq ""; |
657 | #push @errors, "You must specify the SQL database name." if $delete_sql_database eq ""; |
| 654 | } |
658 | } |
| 655 | |
659 | |
| 656 | return @errors; |
660 | return @errors; |
| 657 | } |
661 | } |
| 658 | |
662 | |
| … | |
… | |
| 692 | CGI::th({class=>"LeftHeader"}, "SQL Server Port:"), |
696 | CGI::th({class=>"LeftHeader"}, "SQL Server Port:"), |
| 693 | CGI::td($delete_sql_port || "system default"), |
697 | CGI::td($delete_sql_port || "system default"), |
| 694 | ), |
698 | ), |
| 695 | CGI::Tr( |
699 | CGI::Tr( |
| 696 | CGI::th({class=>"LeftHeader"}, "SQL Database Name:"), |
700 | CGI::th({class=>"LeftHeader"}, "SQL Database Name:"), |
| 697 | CGI::td($delete_sql_database), |
701 | CGI::td($delete_sql_database || "webwork_$delete_courseID"), |
| 698 | ), |
702 | ), |
| 699 | ); |
703 | ); |
| 700 | } else { |
704 | } else { |
| 701 | print CGI::p("Are you sure you want to delete the course " . CGI::b($delete_courseID) |
705 | print CGI::p("Are you sure you want to delete the course " . CGI::b($delete_courseID) |
| 702 | . "? All course files and data will be destroyed. There is no undo available."); |
706 | . "? All course files and data will be destroyed. There is no undo available."); |
| … | |
… | |
| 742 | if ($ce2->{dbLayoutName} eq "sql") { |
746 | if ($ce2->{dbLayoutName} eq "sql") { |
| 743 | $dbOptions{host} = $delete_sql_host if $delete_sql_host ne ""; |
747 | $dbOptions{host} = $delete_sql_host if $delete_sql_host ne ""; |
| 744 | $dbOptions{port} = $delete_sql_port if $delete_sql_port ne ""; |
748 | $dbOptions{port} = $delete_sql_port if $delete_sql_port ne ""; |
| 745 | $dbOptions{username} = $delete_sql_username; |
749 | $dbOptions{username} = $delete_sql_username; |
| 746 | $dbOptions{password} = $delete_sql_password; |
750 | $dbOptions{password} = $delete_sql_password; |
| 747 | $dbOptions{database} = $delete_sql_database; |
751 | $dbOptions{database} = $delete_sql_database || "webwork_$delete_courseID"; |
| 748 | } |
752 | } |
| 749 | |
753 | |
| 750 | eval { |
754 | eval { |
| 751 | deleteCourse( |
755 | deleteCourse( |
| 752 | courseID => $delete_courseID, |
756 | courseID => $delete_courseID, |