admin page password protection

svn path=/trunk/boinc/; revision=970
This commit is contained in:
David Anderson 2003-02-25 19:25:53 +00:00
parent f7ee9c58b7
commit 87539d2c27
3 changed files with 14 additions and 0 deletions

View File

@ -43,6 +43,7 @@
$project->project_prefs_php_file = "project_specific_prefs_ap.inc";
$project->install();
$project->http_password("admin","mypass");
$work = new Work($app);
$work->wu_template = "pulse_wu";

View File

@ -49,6 +49,7 @@
$work->redundancy = 5;
array_push($work->input_files, "03au00ab_20575_00000.wu");
$work->install($project);
$project->http_password("admin","mypass");
$project->start_servers();
?>

View File

@ -415,6 +415,18 @@ class Project {
echo "Admin URL: $admin_url\n";
}
// Adds http password protection to the html_ops directory
//
function http_password($user,$password) {
$f = fopen($this->project_dir."/html_ops/.htaccess", "w");
fputs($f,"AuthName \"$this->long_name Administration\"\n");
fputs($f,"AuthType Basic\n");
fputs($f,"AuthUserFile $this->project_dir/html_ops/.htpasswd\n\n");
fputs($f,"require valid-user\n");
fclose($f);
PassThru("htpasswd -bc $this->project_dir/html_ops/.htpasswd $user $password");
}
// moves the master web page to temp
// This is used to test exponential backoff on the client side.
//