mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2952
This commit is contained in:
parent
a214be1f6a
commit
ff7f711104
|
@ -9696,3 +9696,22 @@ David Feb 3 2004
|
|||
sched/
|
||||
handle_request.C
|
||||
sched_config.C,h
|
||||
|
||||
Karl 2004-02-03
|
||||
- updates for html directory structure change
|
||||
|
||||
tools/
|
||||
make_project
|
||||
|
||||
py/Boinc/
|
||||
setup_project.py
|
||||
|
||||
html/
|
||||
project.sample/ (new directory)
|
||||
project.inc (new)
|
||||
project_specific_prefs.inc (new)
|
||||
|
||||
html/
|
||||
user/
|
||||
project.inc.sample (removed)
|
||||
project_specific_prefs.inc (removed)
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
// This is a sample project file.
|
||||
// Modify it to suit your project.
|
||||
// Put your version in html_user/project_specific/project.inc
|
||||
|
||||
require_once("util.inc");
|
||||
|
||||
define("PROJECT", "Test Project");
|
||||
define("MASTER_URL", "http://boinc.berkeley.edu/");
|
||||
define("URL_BASE", "");
|
||||
define('IMAGE_PATH', 'images/user_profile/');
|
||||
define('PROFILE_PATH', 'user_profile/');
|
||||
define('LANGUAGE_FILE', 'languages.txt');
|
||||
define('STYLESHEET', 'white.css');
|
||||
define('COPYRIGHT_HOLDER', 'Test Group');
|
||||
|
||||
function project_intro() {
|
||||
echo"
|
||||
This is a test project of
|
||||
the Berkeley Open Infrastructure for Network Computing (BOINC)
|
||||
";
|
||||
}
|
||||
|
||||
function project_banner($user, $fd) {
|
||||
// Put your project title and logo here
|
||||
|
||||
write_fd($fd, "<table width=100%><tr><td><h2>".PROJECT."</h2></td><td align=right>\n");
|
||||
if ($user) {
|
||||
write_fd($fd, "Logged in as $user->name");
|
||||
} else {
|
||||
write_fd($fd, "<br>");
|
||||
}
|
||||
write_fd($fd, "</td></tr></table><hr>\n");
|
||||
}
|
||||
|
||||
// NOTE: These functions appear here and not in profile.inc because they contain
|
||||
// project-specific information that needs to be set by the project administrators.
|
||||
|
||||
function show_profile_heading1() {
|
||||
row1("Your personal background.");
|
||||
}
|
||||
|
||||
function show_profile_question1() {
|
||||
rowify("
|
||||
Tell us about yourself.
|
||||
You could tell us where you're from, your age, occupation, hobbies,
|
||||
or anything else about yourself.
|
||||
HTML formatting tags are allowed (other tags will be removed),
|
||||
and responses are limited to 2000 characters.
|
||||
");
|
||||
}
|
||||
|
||||
function show_profile_heading2() {
|
||||
row1("Your opinions about " . PROJECT);
|
||||
}
|
||||
|
||||
function show_profile_question2() {
|
||||
rowify("
|
||||
Tell us your thoughts about " . PROJECT . "<ol>
|
||||
<li>Why do you run " . PROJECT . "?
|
||||
<li>What are your views about the project?
|
||||
<li>Any suggestions?
|
||||
</ol>
|
||||
");
|
||||
}
|
||||
|
||||
function project_news() {
|
||||
echo "No news is good news\n";
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
// Place your version in project_specific/project_specific_presf.inc
|
||||
|
||||
// Functions to display and edit project-specific prefs go here
|
||||
|
||||
// The code here is a sample. Projects must supply their own.
|
||||
|
||||
function option($name, $val) {
|
||||
if ($name == $val) {
|
||||
$x = "selected";
|
||||
} else {
|
||||
$x = "";
|
||||
}
|
||||
return "<option name='$name' $x>$name\n";
|
||||
}
|
||||
|
||||
function project_specific_prefs_default() {
|
||||
return "<color_scheme>Tahiti Sunset</color_scheme>\n";
|
||||
}
|
||||
|
||||
// given struct, show form for editing
|
||||
//
|
||||
function project_specific_prefs_edit($prefs) {
|
||||
$x = $prefs->color_scheme;
|
||||
$y = "<select name=color_scheme>
|
||||
".option("Tahiti Sunset", $x)
|
||||
.option("Desert Sands", $x)."
|
||||
</select>
|
||||
";
|
||||
row2("Color scheme", $y);
|
||||
}
|
||||
|
||||
// Return XML version of project-specific prefs
|
||||
//
|
||||
function project_specific_prefs_parse_form() {
|
||||
$color_scheme = $_GET["color_scheme"];
|
||||
return "<color_scheme>$color_scheme</color_scheme>\n";
|
||||
}
|
||||
|
||||
// show non-editable version of prefs
|
||||
//
|
||||
function project_specific_prefs_show($prefs) {
|
||||
if ($prefs->color_scheme) {
|
||||
$x = $prefs->color_scheme;
|
||||
} else {
|
||||
$x = "None selected";
|
||||
}
|
||||
row2("Color scheme", $x);
|
||||
}
|
||||
|
||||
// parse XML, fill in struct
|
||||
//
|
||||
function project_specific_prefs_parse($prefs_xml) {
|
||||
$prefs->color_scheme = parse_element($prefs_xml, "<color_scheme>");
|
||||
return $prefs;
|
||||
}
|
|
@ -260,12 +260,14 @@ def install_boinc_files(dest_dir):
|
|||
def dir(*dirs):
|
||||
return apply(os.path.join,(dest_dir,)+dirs)
|
||||
|
||||
install_glob(srcdir('html_user/*.php'), dir('html_user/'))
|
||||
install_glob(srcdir('html_user/*.inc'), dir('html_user/'))
|
||||
install_glob(srcdir('html_user/class/*.inc'), dir('html_user/class/'))
|
||||
install_glob(srcdir('html_user/include/*.inc'), dir('html_user/include/'))
|
||||
install_glob(srcdir('html_ops/*.php'), dir('html_ops/'))
|
||||
install_glob(srcdir('html_ops/*.inc'), dir('html_ops/'))
|
||||
install_glob(srcdir('html/forum/*.php'), dir('html/forum/'))
|
||||
install_glob(srcdir('html/inc/*.inc'), dir('html/inc/'))
|
||||
install_glob(srcdir('html/ops/*.php'), dir('html/ops/'))
|
||||
install_glob(srcdir('html/ops/*.inc'), dir('html/ops/'))
|
||||
install_glob(srcdir('html/user/*.php'), dir('html/user/'))
|
||||
install_glob(srcdir('html/user/*.inc'), dir('html/user/'))
|
||||
install_glob(srcdir('html/user/*.css'), dir('html/user/'))
|
||||
install_glob(srcdir('html/user/*.txt'), dir('html/user/'))
|
||||
|
||||
# copy all the backend programs
|
||||
map(lambda (s): install(builddir('sched',s), dir('cgi-bin',s)),
|
||||
|
@ -316,8 +318,8 @@ class Project:
|
|||
if production:
|
||||
config.one_result_per_user_per_wu = '1'
|
||||
self.scheduler_url = os.path.join(config.cgi_url , 'cgi')
|
||||
self.project_php_file = srcdir('html_user/project.inc.sample')
|
||||
self.project_specific_prefs_php_file = srcdir('html_user/project_specific_prefs.inc.sample')
|
||||
self.project_php_file = srcdir('html/user/project.inc.sample')
|
||||
self.project_specific_prefs_php_file = srcdir('html/user/project_specific_prefs.inc.sample')
|
||||
|
||||
|
||||
def dir(self, *dirs):
|
||||
|
@ -359,8 +361,8 @@ class Project:
|
|||
# req/reply files somewhere else
|
||||
map(lambda dir: os.mkdir(self.dir(dir)),
|
||||
[ '', 'cgi-bin', 'bin', 'upload', 'download', 'apps', self.logdir(),
|
||||
'html_ops', 'html_user', 'html_user/project_specific',
|
||||
'html_user/class', 'html_user/include'
|
||||
'html', 'html/ops', 'html/user', 'html/project',
|
||||
'html/inc', 'html/stats', 'html/user_profile'
|
||||
])
|
||||
map(lambda dir: os.chmod(self.dir(dir), 0777),
|
||||
[ 'cgi-bin', 'upload', self.logdir() ])
|
||||
|
@ -378,13 +380,15 @@ class Project:
|
|||
|
||||
install_boinc_files(self.dir())
|
||||
|
||||
install_glob(srcdir('html_user/*.txt'), self.dir('html_user/'))
|
||||
install(self.project_php_file,
|
||||
self.dir('html_user', 'project_specific', 'project.inc'))
|
||||
self.dir('html', 'project', 'project.inc'))
|
||||
install(self.project_specific_prefs_php_file,
|
||||
self.dir('html_user', 'project_specific', 'project_specific_prefs.inc'))
|
||||
self.dir('html', 'project', 'project_specific_prefs.inc'))
|
||||
|
||||
my_symlink(self.config.config.download_dir, self.dir('html_user', 'download'))
|
||||
my_symlink(self.config.config.download_dir, self.dir('html', 'user', 'download'))
|
||||
my_symlink('../forum', self.dir('html/user/forum'))
|
||||
my_symlink('../stats', self.dir('html/user/stats'))
|
||||
my_symlink('../user_profile', self.dir('html/user/user_profile'))
|
||||
|
||||
|
||||
# Copy the sched server in the cgi directory with the cgi names given
|
||||
|
@ -393,7 +397,7 @@ class Project:
|
|||
|
||||
if scheduler_file:
|
||||
r = re.compile('<scheduler>([^<]+)</scheduler>', re.IGNORECASE)
|
||||
f = open(self.dir('html_user', scheduler_file))
|
||||
f = open(self.dir('html/user', scheduler_file))
|
||||
for line in f:
|
||||
# not sure if this is what the scheduler file is supposed to
|
||||
# mean
|
||||
|
@ -405,7 +409,7 @@ class Project:
|
|||
f.close()
|
||||
else:
|
||||
scheduler_file = 'schedulers.txt'
|
||||
f = open(self.dir('html_user', scheduler_file), 'w')
|
||||
f = open(self.dir('html/user', scheduler_file), 'w')
|
||||
print >>f, "<scheduler>" + self.scheduler_url.strip(), "</scheduler>"
|
||||
f.close()
|
||||
|
||||
|
@ -426,13 +430,13 @@ class Project:
|
|||
if options.__dict__.get('cgi_dir'):
|
||||
force_symlink(self.dir('cgi-bin'), os.path.join(options.cgi_dir, self.short_name))
|
||||
if options.__dict__.get('html_dir'):
|
||||
force_symlink(self.dir('html_user'), os.path.join(options.html_dir, self.short_name))
|
||||
force_symlink(self.dir('html_ops'), os.path.join(options.html_dir, self.short_name+'_admin'))
|
||||
force_symlink(self.dir('html/user'), os.path.join(options.html_dir, self.short_name))
|
||||
force_symlink(self.dir('html/ops'), os.path.join(options.html_dir, self.short_name+'_admin'))
|
||||
|
||||
def http_password(self, user, password):
|
||||
'Adds http password protection to the html_ops directory'
|
||||
passwd_file = self.dir('html_ops', '.htpassword')
|
||||
f = open(self.dir('html_ops', '.htaccess'), 'w')
|
||||
'Adds http password protection to the html/ops directory'
|
||||
passwd_file = self.dir('html/ops', '.htpassword')
|
||||
f = open(self.dir('html/ops', '.htaccess'), 'w')
|
||||
print >>f, "AuthName '%s Administration'" % self.long_name
|
||||
print >>f, "AuthType Basic"
|
||||
print >>f, "AuthUserFile %s" % passwd_file
|
||||
|
|
Loading…
Reference in New Issue