mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2773
This commit is contained in:
parent
7ca0094112
commit
76ce035063
|
@ -8317,3 +8317,25 @@ Karl 2003-12-09
|
|||
|
||||
sched/
|
||||
main.C
|
||||
|
||||
David 9 Dec 2003
|
||||
- scheduler returns message if "../stop_servers" exists
|
||||
NOTE SPELLING; "stop_server" was error
|
||||
- web site main page checks for "stop_servers" file,
|
||||
shows "project down" message if so
|
||||
TODO: have all DB-driven pages do this
|
||||
- don't show link to main page on main page
|
||||
- turned off "rate message" control (wasn't being used)
|
||||
|
||||
html_user/
|
||||
index.php
|
||||
time.inc
|
||||
util.inc
|
||||
forum/
|
||||
forum.inc
|
||||
post.php
|
||||
text_search_action.php
|
||||
thread.php
|
||||
sched/
|
||||
main.C
|
||||
sched_util.C,h
|
||||
|
|
|
@ -194,7 +194,7 @@ function createThread($forumID, $ownerID, $title, $content) {
|
|||
$title = addslashes(sanitize_html($title));
|
||||
$content = addslashes(sanitize_html($content));
|
||||
|
||||
$sql = "INSERT INTO thread (forum, owner, title, create_time) VALUES (" . $forumID . ", " . $ownerID . ", '" . $title . "', UNIX_TIMESTAMP())";
|
||||
$sql = "INSERT INTO thread (forum, owner, title, create_time, timestamp) VALUES (" . $forumID . ", " . $ownerID . ", '" . $title . "', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())";
|
||||
$result = mysql_query($sql);
|
||||
if (!$result) return false;
|
||||
$threadID = mysql_insert_id();
|
||||
|
@ -330,9 +330,9 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS
|
|||
echo "</p>\n</td>\n";
|
||||
|
||||
if ($controls == FORUM_CONTROLS) {
|
||||
echo "<td align=\"right\" style=\"border:0px\">Rate this post:";
|
||||
show_select_from_array("rating", $post_ratings, "0");
|
||||
echo "<input type=\"submit\" value=\"Rate\"></td>";
|
||||
//echo "<td align=\"right\" style=\"border:0px\">Rate this post:";
|
||||
//show_select_from_array("rating", $post_ratings, "0");
|
||||
//echo "<input type=\"submit\" value=\"Rate\"></td>";
|
||||
} else if ($controls == HELPDESK_CONTROLS && $separate) {
|
||||
echo "
|
||||
<td align=\"right\" style=\"border:0px\">
|
||||
|
|
|
@ -62,9 +62,9 @@ if ($category->is_helpdesk) {
|
|||
echo "<form action=\"post.php?id=", $_GET['id'], "\" method=POST>";
|
||||
|
||||
if ($category->is_helpdesk) {
|
||||
$cell = "Post a New Question";
|
||||
$cell = "Submit a new question/problem";
|
||||
} else {
|
||||
$cell = "Post a New Thread / Question";
|
||||
$cell = "Create a new thread";
|
||||
}
|
||||
start_forum_table(array($cell), 2);
|
||||
|
||||
|
@ -102,7 +102,7 @@ echo "
|
|||
</tr>
|
||||
";
|
||||
row2("", "<input name=add_signature value=add_it checked=true type=checkbox>Add my signature to this post");
|
||||
row2("", "<input type=submit value=\"Post message\">");
|
||||
row2("", "<input type=submit value=\"OK\">");
|
||||
|
||||
end_forum_table();
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ if ($n==$count) {
|
|||
$s = urlencode($search_string);
|
||||
$offset += $count;
|
||||
echo "
|
||||
<a href=text_search_action.php?titles=1&search_string=$s&offset=$offset>Next $count</a>
|
||||
<a href=text_search_action.php?bodies=1&search_string=$s&offset=$offset>Next $count</a>
|
||||
";
|
||||
|
||||
}
|
||||
|
|
|
@ -88,9 +88,9 @@ echo "<td align=right style=\"border:0px\">";
|
|||
if ($category->is_helpdesk) {
|
||||
show_select_from_array("sort", $answer_sort_styles, $sort_styles);
|
||||
} else {
|
||||
echo "Sort/filter ";
|
||||
echo "Sort ";
|
||||
show_select_from_array("sort", $thread_sort_styles, $sort_style);
|
||||
show_select_from_array("filter", $thread_filter_styles, $filter_min);
|
||||
//show_select_from_array("filter", $thread_filter_styles, $filter_min);
|
||||
}
|
||||
echo "<input type=submit value=OK>\n</td>";
|
||||
|
||||
|
|
|
@ -17,37 +17,39 @@
|
|||
echo "
|
||||
<br><br>
|
||||
<table cellpadding=8>
|
||||
<tr><td width=40%>
|
||||
<h3>Join ".PROJECT." </h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."info.php>Rules and policies <b>[read this first]</b></a>
|
||||
<li><a href=".URL_BASE."create_account_form.php>Create account</a>
|
||||
</ul>
|
||||
<tr><td valign=top width=40%>
|
||||
";
|
||||
if (project_is_stopped()) {
|
||||
echo "
|
||||
<b>".PROJECT." is temporarily shut down for maintenance.
|
||||
Please try again later.
|
||||
";
|
||||
} else {
|
||||
echo "
|
||||
<h3>Join ".PROJECT." </h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."info.php>Rules and policies <b>[read this first]</b></a>
|
||||
<li><a href=".URL_BASE."create_account_form.php>Create account</a>
|
||||
</ul>
|
||||
|
||||
<h3>Returning participants</h3>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."login_form.php>Log in</a>
|
||||
<li><a href=".URL_BASE."home.php>User page</a> - view stats, modify preferences
|
||||
<li><a href=".URL_BASE."team.php>Teams</a> - create or join a team
|
||||
<li><a href=".URL_BASE."download.php>Download BOINC</a>
|
||||
</ul>
|
||||
<h3>Community</h3>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."profile_menu.php>User profiles</a>
|
||||
<li><a href=".URL_BASE."forum/>Message boards</a>
|
||||
<li><a href=".URL_BASE."forum/help_desk.php>Questions and problems</a>
|
||||
</ul>
|
||||
<h3><a href=stats.php>Project totals and leader boards</a></h3>
|
||||
<!-- Deprecated
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."totals.php>Project totals</a>
|
||||
<li><a href=".URL_BASE."top_users.php>Top users</a>
|
||||
<li><a href=".URL_BASE."top_hosts.php>Top computers</a>
|
||||
<li><a href=".URL_BASE."top_teams.php>Top teams</a>
|
||||
<li><a href=".URL_BASE."stats.php>XML statistics data</a>
|
||||
</ul>
|
||||
-->
|
||||
<h3>Returning participants</h3>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."login_form.php>Log in</a>
|
||||
<li><a href=".URL_BASE."home.php>User page</a> - view stats, modify preferences
|
||||
<li><a href=".URL_BASE."team.php>Teams</a> - create or join a team
|
||||
<li><a href=".URL_BASE."download.php>Download BOINC</a>
|
||||
</ul>
|
||||
<h3>Community</h3>
|
||||
<ul>
|
||||
<li><a href=".URL_BASE."profile_menu.php>User profiles</a>
|
||||
<li><a href=".URL_BASE."forum/>Message boards</a>
|
||||
<li><a href=".URL_BASE."forum/help_desk.php>Questions and problems</a>
|
||||
</ul>
|
||||
<h3><a href=stats.php>Project totals and leader boards</a></h3>
|
||||
";
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
<td valign=top bgcolor=dddddd>
|
||||
<center>
|
||||
|
@ -65,6 +67,6 @@ include 'schedulers.txt';
|
|||
|
||||
echo "-->\n";
|
||||
|
||||
page_tail();
|
||||
page_tail(true);
|
||||
|
||||
?>
|
||||
|
|
|
@ -38,6 +38,6 @@ function time_diff_str($t1, $t2) {
|
|||
if ($diff == 1) {
|
||||
return "1 second ago";
|
||||
}
|
||||
return $x." seconds ago";
|
||||
return $diff." seconds ago";
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -137,12 +137,15 @@ function page_head($title, $user=null, $fd=null, $styleSheet=null) {
|
|||
project_banner($user, $fd);
|
||||
}
|
||||
|
||||
function page_tail($fd=null) {
|
||||
write_fd($fd, "<br><hr noshade size=1><center><a href=".MASTER_URL.">Return to ".PROJECT." main page</a><br>\n");
|
||||
function page_tail($is_main=false) {
|
||||
echo "<br><hr noshade size=1><center>";
|
||||
if (!$is_main) {
|
||||
echo "<a href=".MASTER_URL.">Return to ".PROJECT." main page</a><br>\n";
|
||||
}
|
||||
|
||||
// put your copyright notice etc. here
|
||||
|
||||
write_fd($fd, "<br><br>Copyright © 2003 ".COPYRIGHT_HOLDER."</center>\n</body>\n</html>");
|
||||
echo "<br><br>Copyright © 2003 ".COPYRIGHT_HOLDER."</center>\n</body>\n</html>";
|
||||
}
|
||||
|
||||
function db_error_page() {
|
||||
|
@ -448,4 +451,8 @@ function doError($msg, $info = '') {
|
|||
function format_credit($cobblestones) {
|
||||
return sprintf("%.2f", $cobblestones);
|
||||
}
|
||||
|
||||
function project_is_stopped() {
|
||||
return file_exists("../stop_servers");
|
||||
}
|
||||
?>
|
||||
|
|
26
sched/main.C
26
sched/main.C
|
@ -43,8 +43,6 @@ using namespace std;
|
|||
|
||||
#define DEBUG_LEVEL 999
|
||||
|
||||
//#define STDERR_FILENAME "cgi_out"
|
||||
|
||||
void get_log_path(char* p) {
|
||||
char buf[256];
|
||||
gethostname(buf, 256);
|
||||
|
@ -58,6 +56,15 @@ bool use_files = false; // use disk files for req/reply msgs (for debugging)
|
|||
DB_PROJECT gproject;
|
||||
SCHED_CONFIG config;
|
||||
|
||||
void send_shut_message() {
|
||||
printf(
|
||||
"Content-type: text/plain\n\n"
|
||||
"<scheduler_reply>\n"
|
||||
" <message priority=\"low\">Project is temporarily shut down for maintenance</message>\n"
|
||||
"</scheduler_reply>\n"
|
||||
);
|
||||
}
|
||||
|
||||
int main() {
|
||||
FILE* fin, *fout;
|
||||
int i, retval, pid;
|
||||
|
@ -77,14 +84,17 @@ int main() {
|
|||
|
||||
log_messages.set_debug_level(DEBUG_LEVEL);
|
||||
|
||||
if (is_stopfile_present()) {
|
||||
send_shut_message();
|
||||
goto done;
|
||||
}
|
||||
|
||||
retval = config.parse_file("..");
|
||||
if (retval) {
|
||||
log_messages.printf(SchedMessages::CRITICAL, "Can't parse config file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
check_stop_trigger();
|
||||
|
||||
sprintf(path, "%s/code_sign_public", config.key_dir);
|
||||
retval = read_file_malloc(path, code_sign_key);
|
||||
if (retval) {
|
||||
|
@ -141,15 +151,11 @@ int main() {
|
|||
while(FCGI_Accept() >= 0) {
|
||||
counter++;
|
||||
#endif
|
||||
printf("Content-type: text/plain\n\n");
|
||||
if (project_stopped) {
|
||||
printf(
|
||||
"<scheduler_reply>\n"
|
||||
" <message priority=\"low\">Project is temporarily shut down for maintenance</message>\n"
|
||||
"</scheduler_reply>\n"
|
||||
);
|
||||
send_shut_message();
|
||||
goto done;
|
||||
}
|
||||
printf("Content-type: text/plain\n\n");
|
||||
if (use_files) {
|
||||
// the code below is convoluted because,
|
||||
// instead of going from stdin to stdout directly,
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace std;
|
|||
#include "sched_util.h"
|
||||
#include "server_types.h"
|
||||
|
||||
const char* STOP_TRIGGER_FILENAME = "../stop_server";
|
||||
const char* STOP_TRIGGER_FILENAME = "../stop_servers";
|
||||
|
||||
void write_pid_file(const char* filename) {
|
||||
FILE* fpid = fopen(filename, "w");
|
||||
|
@ -66,6 +66,15 @@ void check_stop_trigger() {
|
|||
}
|
||||
}
|
||||
|
||||
bool is_stopfile_present() {
|
||||
FILE* f = fopen(STOP_TRIGGER_FILENAME, "r");
|
||||
if (f) {
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// decay an exponential average of credit per day,
|
||||
// and possibly add an increment for new credit
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
extern void write_pid_file(const char* filename);
|
||||
extern void set_debug_level(int);
|
||||
extern void check_stop_trigger();
|
||||
extern bool is_stopfile_present();
|
||||
extern void update_average(double, double, double&, double&);
|
||||
extern void install_sigint_handler();
|
||||
extern bool caught_sig_int;
|
||||
|
|
Loading…
Reference in New Issue