#!/usr/bin/perl use strict; # NOTE! # this file is modified for use in the createCourse.sh script my $course = shift; # # ################################################################################ ## ## File: course_webwork_setup.pl (for WeBWorK course installation) ## ## this file changes the permissions to the correct ones in each of the ## subdirectories and the main course directory. It also creates the ## webworkCourse.ph file. ## It prompts the user to enter the correct cgiURL and htmlURL ## The default values for these variables and for the variables pointing ## to the main directory can be set in the file defaults.cws. ## ############################################################################### my $course_setup_mode = 'working'; my $file_creation_mode = 'working'; ################## read + process defaults file ###################### my ($htmlurldefault,$cgiurldefault,$courselinkdefault); open(DEFAULTS, "defaults.cws"); while() { chomp($_); $_ =~ s/^ //g; if($_ =~ /^#/ || $_ eq "") ## comment line or blank line {} else { $_ =~ /^\s*(\w+)\s*=\s*([-,\s\/\w\.:]*)/; ## does this include everything that can be in a filename or a URL??? if ($1 eq "htmlURL") {$htmlurldefault = $2;} if ($1 eq "cgiURL") {$cgiurldefault = $2;} if ($1 eq "courseLink") {$courselinkdefault = $2;} } } close(DEFAULTS); # done with defaults ################### Create directories if they don't exist. ################### my $ans='y'; if ($ans eq 'y') { print "\n"; unless(-e 'scoring') { mkdir('scoring', 0770); chmod(0770, 'scoring') || die "Can't do chmod on scoring directory"; print 'directory scoring'.", 0770 created.\n"; } unless(-e 'scoring/scoring.log') { open(TEMPCREATEFILE, ">scoring/scoring.log") || die "Can't open scoring/scoring.log"; close(TEMPCREATEFILE); chmod(0660,"scoring/scoring.log") || die "Can't do chmod(0660, scoring/scoring.log)"; print 'file scoring/scoring.log'.", 0660 created.\n"; } unless(-e 'DATA') { mkdir('DATA', 0770); chmod(0770, 'DATA') || die "Can't do chmod on DATA directory"; print 'directory DATA'.", 0770 created.\n"; } unless(-e 'DATA/.auth') { mkdir('DATA/.auth', 0770); chmod(0770, 'DATA/.auth') || die "Can't do chmod on DATA/.auth directory"; print 'directory DATA/.auth'.", 0770 created.\n"; } unless(-e 'html') { mkdir('html', 0750); chmod(0750, 'html') || die "Can't do chmod on html directory"; print 'directory html'.", 0750 created.\n"; } unless(-e 'html/images') { mkdir('html/images', 0770); chmod(0770, 'html/images') || die "Can't do chmod on html/images/ directory"; print 'directory html/images'.", 0770 created.\n"; } unless(-e 'html/tmp') { mkdir('html/tmp', 0770); chmod(0770, 'html/tmp') || die "Can't do chmod on html/tmp/ directory"; print 'directory html/tmp'.", 0770 created.\n"; } unless(-e 'html/tmp/l2h') { mkdir('html/tmp/l2h', 0770); chmod(0770, 'html/tmp/l2h') || die "Can't do chmod on html/tmp/l2h directory"; print 'directory html/tmp/l2h'.", 0770 created.\n"; } unless(-e 'html/tmp/eps') { mkdir('html/tmp/eps', 0770); chmod(0770, 'html/tmp/eps') || die "Can't do chmod on html/tmp/eps directory"; print 'directory html/tmp/eps'.", 0770 created.\n"; } unless(-e 'html/tmp/images') { mkdir('html/tmp/images', 0770); chmod(0770, 'html/tmp/images') || die "Can't do chmod on html/tmp/images directory"; print 'directory html/tmp/images'.", 0770 created.\n"; } unless(-e 'html/tmp/gif') { mkdir('html/tmp/gif', 0770); chmod(0770, 'html/tmp/gif') || die "Can't do chmod on html/tmp/gif directory"; print 'directory html/tmp/gif'.", 0770 created.\n"; } unless(-e 'html/tmp/html') { mkdir('html/tmp/html', 0770); chmod(0770, 'html/tmp/html') || die "Can't do chmod on html/tmp/html directory"; print 'directory html/tmp/html'.", 0770 created.\n"; } unless(-e 'courseScripts') { mkdir('courseScripts', 0750); chmod(0750, 'courseScripts') || die "Can't do chmod on courseScripts directory"; print 'directory courseScripts'.", 0750 created.\n"; } unless(-e 'templates') { mkdir('templates', 0770); chmod(0770, 'templates') || die "Can't do chmod on templates directory"; print 'directory templates'.", 0770 created.\n"; } unless(-e 'templates/email') { mkdir('templates/email', 0770); chmod(0770, 'templates/email') || die "Can't do chmod on templates/email directory"; print 'directory templates/email'.", 0770 created.\n"; } unless(-e 'templates/macros') { mkdir('templates/macros', 0750); chmod(0750, 'templates/macros') || die "Can't do chmod on templates/macros directory"; print 'directory templates/macros'.", 0750 created.\n"; } unless(-e 'logs') { mkdir('logs', 0770); chmod(0770, 'logs') || die "Can't do chmod on logs directory"; print 'logs'.", 0770 created.\n"; } unless(-e 'logs/login.log') { open(TEMPCREATEFILE, ">logs/login.log") || die "Can't open logs/login.log"; close(TEMPCREATEFILE); chmod(0660,"logs/login.log") || die "Can't do chmod(0660, logs/login.log)"; print 'file logs/login.log'.", 0660 created.\n"; } } ##################### get base directory ############################### use Cwd; ## module for getting current wording directory my $current_dir = cwd(); $current_dir .= '/' unless $current_dir =~ m|/$|; $current_dir =~ m|([^/]+/)$|; my $courseDirectory = $1; ####################### Prompt for htmlURL ############################### my $HTML_URL="/webwork/".$course."/"; print qq(\nhtmlURL set to: "$HTML_URL"\n); #################### Prompt for cgiURL ################################### my $CGI_URL="/cgi-bin/webwork/system/"; print qq(\ncgiURL set to: "$CGI_URL"\n); ################## Prompt for courseLink ############################### my $CLASS_ID=$course; print qq(\ncourse link (i.e. the classID) set to: "$CLASS_ID"\n); ################## Prompt for group ############################### my ($name, $passwd, $gid, $members, @info,$groupName); if ($course_setup_mode eq 'demo') { @info = getpwuid($<); $gid =$info[3]; $groupName = (getgrgid($gid))[0]; } else { $groupName = "demogrp"; #; unless ((defined($groupName)) and ($groupName =~ /\w+/)){ my @info = getpwuid($<); $gid =$info[3]; $groupName = (getgrgid($gid))[0]; } print qq(\ngroup will be set to: "$groupName"\n); ($name, $passwd, $gid, $members) = getgrnam ($groupName); # check that the group name is valid # should probably check that the webserver is also a member of this group XXXXXXX $members = " ".$members." "; ## put a spaces arround string my $username = getpwuid($<); if($members =~ /\s+$username\s+/) { print "\n\nGood. $username is a member of the group $groupName.\n\n"; } else { print "\n\nSorry. $username is NOT a member of the group $groupName.\n"; print "The group for all directories and files will not be changed.\n"; print "Ask your system administrator to set up the group. Then you can\n"; print "change the group by hand (see instructions) or run this script again.\n\n"; die; } } ################## BEGIN new webworkCourse.ph ######################### open(COURSETMP, ">webworkCourse.ph.tmp"); print COURSETMP <<"ENDCOURSETMP"; # file webworkCourse.ph # contains variables specific to a course # The variables defined in Global.pm set defaults and # parameters for the whole WeBWorK system. These defaults can # be over ridden for this individual course by redefining # the variables in this webworkCourse.ph file. # For example the default feedback address set in Global.pm as: # \$feedbackAddress = 'webwork\@math.rochester.edu'; # can (and should) be over ridden by entering # \$Global::feedbackAddress = 'apizer\@math.rochester.edu,gage\@math.rochester.edu'; # below where of course you should substitute your own email address # for that of Pizer and Gage (and uncomment the line). \$Global::feedbackAddress = 'tgao\@csulb.edu,wziemer\@csulb.edu'; ## In addition, you should customize the following three items for your course # If you want to write essay type problems or questionnaires where the results are # emailed back, you have to authorize the email addresses here by uncommenting and # editing the next line. # \$PG_environment{'ALLOW_MAIL_TO'} = ['apizer\@math.rochester.edu','gage\@math.rochester.edu']; # On the Professor page, one can view statistical data on problem sets for # the whole course and section by section or by recitation. You may want to # exclude certain sections or recitations (e.g. those containing practice users, # TA's, or professors) from the overall statistics. Statistics for excluded # sections are reported separately. List the names of all sections and # recitations to be excluded in a coma separated list, e.g. # \@excluse_these_sections_from_overall_statistics = ('', 'T.A.', 'Prof section'); # \@excluse_these_recitations_from_overall_statistics = (''); # If this list is empty or commented out, no sections will be excluded. \@excluse_these_sections_from_overall_statistics = (''); \@excluse_these_recitations_from_overall_statistics = (''); # If the following line is uncommented, when the user(s) listed view # a problem or download a set, the file names of the source files will be # listed. Replace 'leeza', etc. by appropiate login names \$PG_environment{'PRINT_FILE_NAMES_FOR'} = ['wziemer','tgao']; ###################################################################################### ###################################################################################### # NORMALLY, THERE SHOULD BE NO NEED FOR CHANGES BELOW THIS LINE. RUN THE SCRIPT # course_webwork_setup.pl AND EVERYTHING SHOULD BE SETUP CORRECTLY. IF YOU DO # EDIT THIS FILE BY HAND, WORK CAREFULLY. REMEMBER THAT ALL DIRECTORY NAMES MUST # END IN A TRALING DIRECTORY DELIMITER. # To make it easier to edit and change these directories we define # the classDirectory. This variable is not used outside this file # and while it is common for all of these directories to reside inside # one directory, it is not necessary. \$classDirectory = "\${mainDirectory}courses/$courseDirectory"; # The database directory contains data describing the students in the course # and their scores on homework. The cgi scripts run by the webserver must # be able to access the contents of this directory. \$databaseDirectory = "\${classDirectory}DATA/"; # The templates directory contains the class list, the problem set definition # files and the problem templates. \$templateDirectory = "\${classDirectory}templates/"; # The email directory contains (templates of) emails which can be sent to everyone # on the classlist. \$emailDirectory = "\${templateDirectory}email/"; # The macros directory contains macros for the problems # files and the problem templates. If it is commented out, the macro files in # "\${mainDirectory}courseScripts/" are used by default. # \$macroDirectory = "\${templateDirectory}macros/"; # The scoring directory contains files used by the scoring programs. These # files contain scoring information for the whole class and are used for # calculating semester grades, etc. \$scoringDirectory = "\${classDirectory}scoring/"; # The html directory contains the first page for the course (index.html), # course documentation, and also subdirectories (e.g. tmp/) # (e.g. tmp/) containing latex2html problems, gifs, etc. The webserver has # direct access to the html directory and the courseURL points to this # directory. \$htmlDirectory = "\${classDirectory}html/"; # The logs directory contains log fies, e.g. login.log, backup psvn # logs and logs of datamunger activity. \$logsDirectory = "\${classDirectory}logs/"; # This is the temp directory used by downloadPS, etc \$courseTempDirectory = "\${classDirectory}html/tmp/"; # The courseScripts directory contains perl scripts local to the course, # e.g. displauMacros.pl . If it is commented out, the macro files in # "\${mainDirectory}courseScripts/" are used by default. # \$courseScriptsDirectory = "\${classDirectory}courseScripts/"; # This is the URL of the course html directory. It points to the \$htmlDirectory # above and it should have been set up correctly by the course_webwork_setup.pl # script. See the documentatiom (run the script or read # .../docs/techdescription/settingupcourse.html). Note that the URL depends on # links in you webserver's htdocs directory and must end in a trailing directory # delimiter (/ for unix). \$htmlURL = "$HTML_URL"; # This is the URL of the course tmp directory. This is for temporary storage of # html files, images, etc that have to accessible to the webserver. This directory # contains the subdirectories l2h, gif, eps, and html (not the \${classDirectory}html # directory). All these subdirectories and their files will be recreated if deleted # (althought recreating l2h files is time consuminmg). The location of this directory # may be changed fast disk which is not backed up. \$courseTempURL = "\${htmlURL}tmp/"; # This is the classID, i.e the symbolic link (or directory) that points to the base # course directory. It appears in the courses subdirectory of the main WeBWorK system. \$classID = "$CLASS_ID"; # This is the name of the default classlist file which resides in the # templateDirectory. This default name is used when students change their # own email addresses and also to edit the classlist file over the web. \$classlistFilename = "\${classID}.lst"; # This is the name of the group and the numerical gid. (some) Files created by # the WeBWorK system will have their group set to "\$groupID". Normally this # group will contain the webserver, your loginID, and the loginID's of anyone # else who will creating and editing WeBWorK problems for your course. If you # are editing this file by hand and know the \$groupID but not the \$numericalGroupID, # ask your systems administrator or run course_webwork_setup.pl and look at the # webworkCourse.ph it produces. You may also be able to get this information by # looking at the group file usually: /etc/group # Finally, if you have set up a "demo" version, the "\$numericalGroupID" will be # set to -1 which means maintain the current (default) group. ENDCOURSETMP if ($file_creation_mode eq 'demo') { print COURSETMP <<"ENDCOURSETMP"; \$groupID = "$groupName"; \$numericalGroupID = -1; ## this sets the header file over riding the Global setting \$Global::SET_HEADER = "paperSetHeader.pg"; ENDCOURSETMP } else { print COURSETMP <<"ENDCOURSETMP"; \$groupID = "$groupName"; \$numericalGroupID = $gid; ## this sets the header file over riding the Global setting \$Global::SET_HEADER = "paperSetHeader.pg"; ## If uncommented, this sets the default mode for displayed problems ## over riding the Global setting. #\$htmlModeDefault = 'HTML_tth'; # The default mode for displayed problems # (either 'HTML','Latex2HTML', or 'HTML_tth') # This sets the default for grading multipart problems. The choices at present are # std_problem_grader or avg_problem_grader. The std_problem_grader gives credit for # a mutipart problem only if all parts are answers correctly. The avg_problem_grader # gives partial credit for a mutipart problems. \$PG_environment{PROBLEM_GRADER_TO_USE} = 'avg_problem_grader'; #\$PG_environment{PROBLEM_GRADER_TO_USE} = 'std_problem_grader'; # This allows or dissallows Destroy and Rebuild. Set to 0 or 1. If set to 1 a # professor can destroy and rebuild problems sets in one operation. This is very # convenient and powerful, but also very dangerous. Usually this is not allowed # in courses students are using. It is often set to 1 in a private course being # used only for developing problem sets. \$allowDestroyRebuildProbSets = 0; ENDCOURSETMP } if ($file_creation_mode eq 'demo') { print COURSETMP <<"ENDCOURSETMP"; ## File and Directory permissions ## These permissions over ride the permissions set in ## Global.pm ## e.g. S1-1521.sco in (base course directory)/DATA \$sco_files_permission = 0666; ## tie permissions (used in tie commands) ## The database, password, and permissions files ## always take their permissions from the Global ## vaiables below. The important keys file ## takes its permission from \$restricted_tie_permission. \$restricted_tie_permission = 0666; \$standard_tie_permission = 0666; ## webwork-database in (base course directory)/DATA \$webwork_database_permission = 0666; ## password in (base course directory)/DATA/.auth \$password_permission = 0666; ## permissions in (base course directory)/DATA/.auth \$permissions_permission = 0666; ## e.g. s1ful.csv in (base course directory)/scoring \$scoring_files_permission = 0666; ## e.g. s1bak1.csv in (base course directory)/scoring \$scoring_bak_files_permission = 0666; ## e.g. 8587l2h.log in (base course directory)/html/tmp/l2h \$l2h_logs_permission = 0666; ## e.g set1/ in (base course directory)/html/tmp/l2h \$l2h_set_directory_permission = 0777; ## e.g. 1-1082/ in (base course directory)/html/tmp/l2h/set1 \$l2h_prob_directory_permission = 0777; ## e.g. 1082output.html in (base course directory)/html/tmp/l2h/set1/1-1082 \$l2h_data_permission = 0777; ENDCOURSETMP } print COURSETMP <<"ENDCOURSETMP"; ## This (if uncommented) overrides the setting in Global.pm. Use 'db_tie.pl' for the ## DB database and 'gdbm_tie.pl' for the GDBM database. For a "new" database type, ## you will have to write a 'newdb_tie.pl' file. These reside in the scripts directory. #\$Global::DBtie_file = 'db_tie.pl'; ## This tells WeBWorK where to find the file that connects it to a physical database. require "\${Global::scriptDirectory}\$Global::DBtie_file"; ## These are the file names for the various databases associated with this course. ## These names override the generic names given in Global.pm \$CL_Database = "\${classID}_classlist_DB"; \$passwordFilename = "\${classID}_password_DB"; \$permissionsFilename = "\${classID}_permissions_DB"; \$database = "\${classID}_webwork_DB"; # The following line is required by perl 1; ENDCOURSETMP close(COURSETMP); ############# END new webworkCourse.ph ######################### ###################### BEGIN new index.html ######################### open(INDEXTMP, ">index.html.tmp"); print INDEXTMP <<"ENDINDEXTMP"; Welcome to WeBWorK

WeBWorK Logo

WeBWorK Login Page


You may test out WeBWorK by logging in as a "practice" user.
Use practice1 as your username and password.
practice2 ... practice5 also work if practice1 is taken.


For more information on WeBWorK: Webwork docs.
Last updated: 22 January 2003
${HTML_URL}index.html
ENDINDEXTMP close(INDEXTMP); ############# END new index.html ######################### #################### prompt for creating webworkCourse.ph ################# if (-e 'webworkCourse.ph') { print "new webworkCourse.ph\n"; rename('webworkCourse.ph.bak1', 'webworkCourse.ph.bak2'); rename('webworkCourse.ph', 'webworkCourse.ph.bak1'); rename('webworkCourse.ph.tmp', 'webworkCourse.ph') || die "Can't rename webworkCourse.ph.tmp"; chmod 0644, 'webworkCourse.ph'; } else { rename('webworkCourse.ph.tmp', 'webworkCourse.ph') || die "Can't rename webworkCourse.ph.tmp. Fix the problem and run the setup script again. Stopped "; chmod 0644, 'webworkCourse.ph'; } #################### prompt for creating index.html ################# if (-e 'html/index.html') { print "new index.html\n"; rename('html/index.html.bak1', 'html/index.html.bak2'); rename('html/index.html', 'html/index.html.bak1'); rename('index.html.tmp', 'html/index.html') || die "Can't rename index.html.tmp. Fix the problem and run the setup script again. Stopped "; chmod 0644, 'html/index.html'; } else { rename('index.html.tmp', 'html/index.html') || die "Can't rename index.html.tmp. Fix the problem and run the setup script again. Stopped "; chmod 0644, 'html/index.html'; } ################### Prompt to change the group ########################## { ## bare block to make breaking out easy chown(-1, $gid, '.'); chown(-1, $gid, <*>); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); chown(-1, $gid, ); print qq(\n The group has been set to "$groupName"\n\n); } ##end of bare block ######################### Prompt file permission changes ###################### $ans= 'y'; if ($ans eq 'y') {if ($course_setup_mode eq "demo") { ####demo mode chmod(0755, '.') || die "Can't set permissions correctly for base directory. Fix the problem and run the setup script again. Stopped "; chmod(0755, <*.pl>); ## perl files chmod(0644, <*.ph>); ## ph files chmod(0777, 'scoring') || die "Can't set permissions correctly for scoring directory. Fix the problem and run the setup script again. Stopped "; chmod(0666, ) ; # files in scoring - 600, there may be no files chmod(0777, 'logs') || die "Can't set permissions correctly for logs directory. Fix the problem and run the setup script again. Stopped "; chmod(0666, ) ; # files in logs - 660, there may be no files chmod(0777, 'DATA') || die "Can't set permissions correctly for DATA directory. Fix the problem and run the setup script again. Stopped "; chmod(0666, ) ; # files in DATA - 660, there may be no files chmod(0777, 'DATA/.auth') || die "Can't set permissions correctly for DATA/.auth directory. Fix the problem and run the setup script again. Stopped "; chmod(0666, ) ; # files in DATA/.auth - 660, there may be no files chmod(0755, 'html') || die "Can't set permissions correctly for html directory. Fix the problem and run the setup script again. Stopped "; # html subdir - 750 chmod(0644, ) ; chmod(0777, 'html/images') || die "Can't set permissions correctly for html/images/ directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/ subdir - 775 chmod(0777, 'html/tmp') || die "Can't set permissions correctly for html/tmp/ directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/ subdir - 775 chmod(0777, 'html/tmp/l2h') || die "Can't set permissions correctly for html/tmp/l2h directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0777, ); # html/tmp/l2h/ subdir - 775 chmod(0777, ) ; # html/tmp/l2h/ subdir - 775 chmod(0777, ) ; # html/tmp/l2h/ subdir - 775 chmod(0777, 'html/tmp/eps') || die "Can't set permissions correctly for html/tmp/eps directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0777, 'html/tmp/images') || die "Can't set permissions correctly for html/tmp/images directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0777, 'html/tmp/gif') || die "Can't set permissions correctly for html/tmp/gif directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0777, 'html/tmp/html') || die "Can't set permissions correctly for html/tmp/html directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0755, 'courseScripts') || die "Can't set permissions correctly for courseScripts directory. Fix the problem and run the setup script again. Stopped "; # courseScripts subdir - 750 chmod(0755, ) ; chmod(0777, 'templates') || die "Can't set permissions correctly for templates directory. Fix the problem and run the setup script again. Stopped "; # templates subdir - 750 chmod(0777, ) ; # files and directories in templates - 777, there may be no files chmod(0777, ) ; # files and directories in templates - 777, there may be no files chmod(0777, ) ; # files and directories in templates - 777, there may be no files chmod(0755, 'templates/macros') || die "Can't set permissions correctly for templates/macros directory. Fix the problem and run the setup script again. Stopped "; # templates/macros subdir - 750 chmod(0755, ) ; # files in templates/macros - 640, there may be no files print "\n Permissions set to default values.\n"; } else #####working mode { chmod(0750, '.') || die "Can't set permissions correctly for base directory. Fix the problem and run the setup script again. Stopped "; chmod(0750, <*.pl>); ## perl files chmod(0640, <*.ph>); ## ph files chmod(0770, 'scoring') || die "Can't set permissions correctly for scoring directory. Fix the problem and run the setup script again. Stopped "; chmod(0660, ) ; # files in scoring - 600, there may be no files chmod(0770, 'logs') || die "Can't set permissions correctly for logs directory. Fix the problem and run the setup script again. Stopped "; chmod(0660, ) ; # files in logs - 660, there may be no files chmod(0770, 'DATA') || die "Can't set permissions correctly for DATA directory. Fix the problem and run the setup script again. Stopped "; chmod(0660, ) ; # files in DATA - 660, there may be no files chmod(0770, 'DATA/.auth') || die "Can't set permissions correctly for DATA/.auth directory. Fix the problem and run the setup script again. Stopped "; chmod(0660, ) ; # files in DATA/.auth - 660, there may be no files chmod(0750, 'html') || die "Can't set permissions correctly for html directory. Fix the problem and run the setup script again. Stopped "; # html subdir - 750 chmod(0640, ) ; chmod(0770, 'html/images') || die "Can't set permissions correctly for html/images/ directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/ subdir - 775 chmod(0770, 'html/tmp') || die "Can't set permissions correctly for html/tmp/ directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/ subdir - 775 chmod(0770, 'html/tmp/l2h') || die "Can't set permissions correctly for html/tmp/l2h directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0770, ); # html/tmp/l2h/ subdir - 775 chmod(0770, ) ; # html/tmp/l2h/ subdir - 775 chmod(0770, ) ; # html/tmp/l2h/ subdir - 775 chmod(0770, 'html/tmp/eps') || die "Can't set permissions correctly for html/tmp/eps directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0770, 'html/tmp/images') || die "Can't set permissions correctly for html/tmp/images directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0770, 'html/tmp/gif') || die "Can't set permissions correctly for html/tmp/gif directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0770, 'html/tmp/html') || die "Can't set permissions correctly for html/tmp/html directory. Fix the problem and run the setup script again. Stopped "; # html/tmp/l2h/ subdir - 775 chmod(0750, 'courseScripts') || die "Can't set permissions correctly for courseScripts directory. Fix the problem and run the setup script again. Stopped "; # courseScripts subdir - 750 chmod(0750, ) ; chmod(0770, 'templates') || die "Can't set permissions correctly for templates directory. Fix the problem and run the setup script again. Stopped "; # templates subdir - 750 chmod(0770, ) ; # files and directories in templates - 770, there may be no files chmod(0770, ) ; # files and directories in templates - 770, there may be no files chmod(0770, ) ; # files and directories in templates - 770, there may be no files chmod(0750, 'templates/macros') || die "Can't set permissions correctly for templates/macros directory. Fix the problem and run the setup script again. Stopped "; # templates/macros subdir - 750 chmod(0750, ) ; # files in templates/macros - 640, there may be no files print "\n Permissions set to default values.\n"; } } if (-e 'DATA/.auth/keys') { unlink 'DATA/.auth/keys' || warn "Can't remove the DATA/.auth/keys file. You do not have to run the setup script again, but you should remove this file by hand/n"; }; sub check_URL { my ($name_URL,$var_URL) = @_; my $response = 'y'; while ($response eq 'y') { if (($var_URL =~ m|^/|) or ($var_URL =~ m|^http://|)) { $response = 'n'; } else { print qq{\nThe $name_URL you entered, $var_URL , does not begin with either \n a slash (/) or with http:// . This is almost certainly an error. \n Do you want to enter the $name_URL again? (y or n)}; $response =&getAns; if ($response ne 'n') { print "\n Enter the $name_URL:\n"; $var_URL=; chomp($var_URL); $response = 'y'; } else { $response = 'n'; } } } $var_URL; }