From 87539d2c27001eca642e14c26141dfcd69200570 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 25 Feb 2003 19:25:53 +0000 Subject: [PATCH] admin page password protection svn path=/trunk/boinc/; revision=970 --- test/make_project_ap.php | 1 + test/make_project_sah.php | 1 + test/test.inc | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/test/make_project_ap.php b/test/make_project_ap.php index ac80fcae5e..04888fea55 100644 --- a/test/make_project_ap.php +++ b/test/make_project_ap.php @@ -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"; diff --git a/test/make_project_sah.php b/test/make_project_sah.php index e54a233841..4644ce4fcd 100644 --- a/test/make_project_sah.php +++ b/test/make_project_sah.php @@ -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(); ?> diff --git a/test/test.inc b/test/test.inc index 7cd12bd5e9..2795e59351 100644 --- a/test/test.inc +++ b/test/test.inc @@ -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. //