Пример #1
0
function user_permissions_form()
{
    global $special_user_bitfield;
    page_head('Manage user privileges');
    start_table();
    row1("Current special users", 99);
    echo "<tr><th>User</th>";
    for ($i = 0; $i < S_NFLAGS; $i++) {
        echo "<th>" . $special_user_bitfield[$i] . "</th>\n";
    }
    echo "<th> </th></tr>";
    $result = _mysql_query("SELECT prefs.userid, prefs.special_user, user.id, user.name \n        FROM forum_preferences as prefs, user \n        WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id");
    $i = 0;
    while ($foo = _mysql_fetch_object($result)) {
        echo "<tr class=row{$i}>\n            <td>{$foo->name} ({$foo->id})</td>\n            <form action=\"user_permissions.php\" method=\"POST\">\n            <input type=\"hidden\" name=\"userid\" value=\"{$foo->userid}\">\n        ";
        for ($j = 0; $j < S_NFLAGS; $j++) {
            $bit = substr($foo->special_user, $j, 1);
            $c = $bit == 1 ? "checked" : "";
            echo "<td>\n                <input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\" {$c}>\n                </td>\n            ";
        }
        echo "<td><input class=\"btn btn-default\" type=\"submit\" value=\"Update\"></td>";
        echo "</form></tr>\n";
        $i = 1 - $i;
    }
    echo "\n        <tr class=row{$i}>\n        <form action=\"user_permissions.php\" method=\"POST\">\n        <td>Add User ID:<input type=\"text\" name=\"userid\" size=\"6\"></td>\n    ";
    for ($j = 0; $j < S_NFLAGS; $j++) {
        echo "<td>\n            <input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\">\n            </td>\n        ";
    }
    echo "<td>\n        <input class=\"btn btn-default\" type=\"submit\" value=\"Update\">\n        </td>\n        </form>\n        </tr>\n    ";
    end_table();
    page_tail();
}
Пример #2
0
function show_admins($user, $teamid)
{
    page_head("Add or remove Team Admins");
    echo "\n\t\tYou can select team members as 'Team Admins'.\n\t\tTeam Admins can:\n\t\t<ul>\n\t\t<li>Edit team information (name, URL, description, country).</li>\n\t\t<li>View the team's join/quit history.</li>\n\t\t<li>Moderate the team forum, if any (admins get emails notification of moderation events and red X reports).</li>\n\t\t</ul>\n\t\tTeam Admins cannot:\n\t\t<ul>\n\t\t<li>Change the team founder.</li>\n\t\t<li>Remove members.</li>\n\t\t<li>Add or remove Team Admins.</li>\n\t\t</ul>\n\t\tIf a Team Admin quits the team, they cease to be a Team Admin.\n\t\t<p>\n\t\tWe recommend that you select only people\n\t\tyou know and trust very well as Team Admins.\n\t";
    $admins = BoincTeamAdmin::enum("teamid={$teamid}");
    start_table();
    if (count($admins) == 0) {
        row1("There are currently no Team Admins");
    } else {
        row1("Current Team Admins", 3);
        table_header("Name", "Became Team Admin on", "");
        foreach ($admins as $admin) {
            show_admin($user, $admin);
        }
    }
    end_table();
    echo '
		<p>
		<form action="team_admins.php">
		<input type="hidden" name="action" value="add">
		<input type="hidden" name="teamid" value="$teamid">
	';
    echo form_tokens($user->authenticator);
    start_table();
    row1("Add Team Admin");
    row2('Email address of team member:', '<input name="email_addr">');
    row2('', '<input type="submit" action value="Add">');
    end_table();
    echo "</form>";
    page_tail();
}
Пример #3
0
function show_installed_page($user)
{
    $url = concierge_url($user, false);
    page_head("Add project");
    echo "\n        <iframe width=0 height=0 frameborder=0 src={$url}></iframe>\n        To start running " . PROJECT . " on this computer:\n        <ul>\n        <li> Open the BOINC Manager.\n        <li> Select <b>Add Project</b>.\n        <li> You should see a welcome message; click OK.\n        </ul>\n    ";
    page_tail();
}
Пример #4
0
function show_stats($brand)
{
    switch ($brand) {
        case 1:
            $x = "HTC Power to Give";
            break;
        default:
            error_page("invalid brand");
    }
    $hosts = BoincHost::enum("os_name='Android' and serialnum like '%{$x}%'");
    $n = 0;
    $t = 0;
    $a = 0;
    foreach ($hosts as $h) {
        $t += $h->total_credit;
        $a += $h->expavg_credit;
        if ($h->expavg_credit > 0.1) {
            $n++;
        }
    }
    page_head("Stats for {$x}");
    start_table();
    row2("Active devices", $n);
    row2("Average daily credit", $a);
    row2("Total credit", $t);
    end_table();
    page_tail();
}
Пример #5
0
function show_admins($user, $teamid)
{
    page_head(tra("Add or remove Team Admins"));
    echo tra("You can select team members as 'Team Admins'. Team Admins can:") . "\n        <ul>\n        <li>" . tra("Edit team information (name, URL, description, country)") . "\n        <li>" . tra("View the team's join/quit history") . "\n        <li>" . tra("Moderate the team forum, if any (admins get email notification of moderation events and red X reports)") . "\n        </ul>\n        " . tra("Team Admins cannot:") . "\n        <ul>\n        <li>" . tra("Change the team founder") . "\n        <li>" . tra("Remove members") . "\n        <li>" . tra("Add or remove Team Admins") . "\n        </ul>\n        " . tra("If a Team Admin quits the team, they cease to be a Team Admin.") . "\n        <br /><br />" . tra("We recommend that you select only people you know and trust very well as Team Admins.");
    $admins = BoincTeamAdmin::enum("teamid={$teamid}");
    start_table();
    if (count($admins) == 0) {
        row1(tra("There are currently no Team Admins"));
    } else {
        row1(tra("Current Team Admins"), 3);
        table_header(tra("Name"), tra("Became Team Admin on"), "");
        foreach ($admins as $admin) {
            show_admin($user, $admin);
        }
    }
    end_table();
    echo "\n        <p>\n        <form action=team_admins.php>\n        <input type=hidden name=action value=add>\n        <input type=hidden name=teamid value={$teamid}>\n    ";
    echo form_tokens($user->authenticator);
    start_table();
    row1(tra("Add Team Admin"));
    row2(tra("Email address of team member:"), "<input name=email_addr>");
    row2("", "<input type=submit action value=\"" . tra("Add") . "\">");
    end_table();
    echo "</form>";
    page_tail();
}
Пример #6
0
function show_result_page($success, $post, $thread, $choice)
{
    if ($success) {
        if ($choice) {
            page_head('Input Recorded');
            echo "<p>Your input has been successfully recorded.  Thank you for your help.</p>";
        } else {
            page_head('Vote Registered');
            echo "<span class=\"title\">Vote Registered</span>";
            echo "<p>Your rating has been successfully recorded.  Thank you for your input.</p>";
        }
        echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
    } else {
        page_head('Vote Submission Problem');
        echo "<span class=\"title\">Vote submission failed</span>";
        if ($post) {
            echo "<p>There was a problem recording your vote in our database.  Please try again later.</p>";
            echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
        } else {
            echo "<p>There post you specified does not exist, or your rating was invalid.</p>";
        }
    }
    page_tail();
    exit;
}
Пример #7
0
function select_profile($cmd)
{
    // Request for a random profile.
    //
    if ($cmd == "rand") {
        $profiles = array();
        $pic = get_int('pic');
        if ($pic == 0) {
            $profiles = BoincProfile::enum("has_picture=0", "limit 1000");
        } else {
            if ($pic == 1) {
                $profiles = BoincProfile::enum("has_picture=1", "limit 1000");
            } else {
                if ($pic == -1) {
                    $profiles = BoincProfile::enum(null, "limit 1000");
                }
            }
        }
        if (count($profiles) == 0) {
            page_head(tra("No profiles"));
            echo tra("No profiles matched your query.");
            page_tail();
            exit;
        }
        shuffle($profiles);
        $userid = $profiles[0]->userid;
        header("Location: " . URL_BASE . "view_profile.php?userid={$userid}");
        exit;
    }
}
Пример #8
0
function show_item($y)
{
    $d = gmdate("g:i A \\U\\T\\C, F d Y", $y[7]);
    $file = $y[0];
    if (strstr($file, 'http://')) {
        $url = $file;
    } else {
        $url = "http://boinc.berkeley.edu/addons/{$file}";
    }
    page_head($y[1]);
    list_start();
    list_item("Name<br><font size=-2>Click to download</font>", "<a href=\"{$url}\">" . $y[1] . '</a>');
    if ($y[2]) {
        list_item("Version", $y[2]);
    }
    if ($y[3]) {
        list_item("Summary", $y[3]);
    }
    if ($y[4]) {
        list_item("Origin", '<a href=' . $y[4] . '>' . $y[4] . '</a>');
    }
    if ($y[5]) {
        list_item("Platform", $y[5]);
    }
    if ($y[6]) {
        list_item("Description", $y[6]);
    }
    list_item("Date", $d);
    list_end();
    page_tail();
}
Пример #9
0
function qcn_host_edit_error_page($errheader, $errtext)
{
    page_head($errheader);
    echo "<BR>" . $errtext . "<BR><BR>";
    echo "<FORM><INPUT TYPE=\"button\" VALUE=\"Back\" onClick=\"history.go(-1);return true;\"> </FORM>";
    page_tail();
    exit;
}
Пример #10
0
function main()
{
    page_head("Bossa apps");
    start_table();
    show_apps();
    end_table();
    page_tail();
}
Пример #11
0
function email_password($vol)
{
    page_head("Emailing password");
    echo "We're emailing your Help Volunteer password to {$vol->email_addr}.";
    page_tail();
    $body = "Your BOINC Help Volunteer password is:\n{$vol->password}\n";
    mail($vol->email_addr, "Help Volunteer info", $body, "From: BOINC");
}
Пример #12
0
function render_page_html()
{
    scripts_i18n();
    page_head();
    display_filters();
    display_content();
    page_foot();
}
Пример #13
0
function render_page()
{
    global $ss;
    $origin = isset($_GET['origin']) && $_GET['origin'] != 'overview' ? $_GET['origin'] : '';
    $failed_login = false;
    // process login request
    if (isset($_POST['simple-stats-login'])) {
        if ($_POST['username'] == $ss->options['username'] && $ss->hash(trim($_POST['password'])) == $ss->options['password']) {
            @setcookie('simple_stats', $ss->hash($ss->options['username'] . $ss->options['password']), time() + 31536000, '/', '');
            header('Location: ./' . ($origin ? './?p=' . $origin : ''), true, 302);
            exit;
        } else {
            $failed_login = true;
        }
    }
    page_head();
    ?>
<div id="main">
<?php 
    if ($origin == 'logout') {
        echo '<p>You have logged out of Simple Stats. You can <a href="./?p=login">login again</a> if you like.';
    } else {
        ?>
<h2><?php 
        echo __('Login');
        ?>
</h2>
<?php 
        if ($failed_login) {
            echo '<p class="center">' . __('Sorry, the username and password combination that you entered was incorrect.');
        }
        ?>
<form action="./?p=login&amp;origin=<?php 
        echo $origin;
        ?>
" method="post">
<table>
<tr><th><label for="username"><?php 
        echo __('User name');
        ?>
</label><td><input type="text" name="username" value="" tabindex="1">
<tr><th><label for="password"><?php 
        echo __('Password');
        ?>
</label><td><input type="password" name="password" value="" tabindex="2">
</table>
<p class="center"><input type="submit" name="simple-stats-login" value="<?php 
        echo __('Submit');
        ?>
" tabindex="3">
</form>
<?php 
    }
    ?>
</div>
<?php 
    page_foot();
}
Пример #14
0
function show_error($str)
{
    page_head("Can't create account");
    echo "{$str}<br>\n";
    echo BoincDb::error();
    echo "<p>Click your browser's <b>Back</b> button to try again.\n<p>\n";
    page_tail();
    exit;
}
Пример #15
0
function email_sent_message($email_addr)
{
    if (defined('EMAIL_FROM')) {
        $email_from = EMAIL_FROM;
    } else {
        $email_from = secure_url_base();
    }
    page_head("Email sent");
    echo "\n        Instructions have been emailed to {$email_addr}.\n        <p>\n        If the email doesn't arrive in a few minutes,\n        your ISP may be blocking it as spam.\n        In this case please contact your ISP and\n        ask them to not block email from {$email_from}.\n    ";
}
Пример #16
0
function email_sent_message($email_addr)
{
    if (defined('EMAIL_FROM')) {
        $email_from = EMAIL_FROM;
    } else {
        $email_from = URL_BASE;
    }
    page_head("Email sent");
    echo "\r\n\t\tInstructions have been emailed to {$email_addr}.\r\n\t\t<p>\r\n\t\tIf the email doesn't arrive in a few minutes,\r\n\t\tyour ISP may be blocking it as spam.\r\n\t\tIn this case please contact your ISP and\r\n\t\task them to not block email from {$email_from}.\r\n\t";
}
Пример #17
0
function show_batches($user)
{
    $batches = BoincBatch::enum("user_id={$user->id}");
    page_head("Batches");
    start_table();
    table_header("Batch ID", "Submitted", "# jobs");
    foreach ($batches as $batch) {
        echo "<tr>\n            <td><a href=submit_status.php?action=show_batch&batch_id={$batch->id}>{$batch->id}</a></td>\n            <td>" . time_str($batch->create_time) . "</td>\n            <td>{$batch->njobs}</td>\n            </tr>\n        ";
    }
    end_table();
    page_tail();
}
Пример #18
0
function delete_profile($user)
{
    $result = BoincProfile::delete_aux("userid = {$user->id}");
    if (!$result) {
        error_page("couldn't delete profile - please try again later");
    }
    delete_user_pictures($user->id);
    page_head("Delete Confirmation");
    $user->update("has_profile=0");
    echo "Your profile has been deleted<br />";
    page_tail();
}
Пример #19
0
function unsubscribe($forum, $thread, $user)
{
    BoincSubscription::delete($user->id, $thread->id);
    if (!BoincSubscription::lookup($user->id, $thread->id)) {
        page_head(tra("Unsubscription successful"));
        show_forum_header($user);
        show_title($forum, $thread);
        echo "<p>" . tra("You are no longer subscribed to %1. You will no longer receive notifications for this thread.", "<b>" . cleanup_title($thread->title) . "</b>");
    } else {
        page_head(tra("Unsubscription failed"));
        echo "<p>" . tra("We are currently unable to unsubscribe you from %1. Please try again later..", "<b>" . cleanup_title($thread->title) . "</b>");
    }
    echo "</p><p><br /><a href=\"forum_thread.php?id=" . $thread->id . "\">" . tra("Return to thread") . "</a></p>";
    page_tail();
}
Пример #20
0
function login_with_auth($authenticator, $next_url, $perm)
{
    $user = BoincUser::lookup_auth($authenticator);
    if (!$user) {
        page_head("Login failed");
        echo "There is no account with that authenticator.\n            Please <a href=get_passwd.php>try again</a>.\n        ";
        page_tail();
    } else {
        if (substr($user->authenticator, 0, 1) == 'x') {
            error_page("This account has been administratively disabled.");
        } else {
            Header("Location: {$next_url}");
            send_cookie('auth', $authenticator, $perm);
        }
    }
}
Пример #21
0
function reg_form()
{
    $config = get_config();
    $disable_acct = parse_bool($config, "disable_account_creation");
    page_head("Register");
    start_table();
    echo "<tr><td>";
    echo "<h3>Create an account</h3>";
    create_account_form(0, "download.php");
    echo "</td><td>";
    echo "<h3>If you already have an account, log in</h3>";
    login_form("download.php");
    echo "</td></tr>";
    end_table();
    page_tail();
}
Пример #22
0
function list_files($user, $err_msg)
{
    $dir = sandbox_dir($user);
    $d = opendir($dir);
    if (!$d) {
        error_page("Can't open sandbox directory");
    }
    page_head("file sandbox for {$user->name}");
    echo "\n        <form action=sandbox.php method=post ENCTYPE=\"multipart/form-data\">\n        <input type=hidden name=action value=upload_file>\n        Upload a file to your sandbox:\n        <p><input size=80 type=file name=new_file>\n        <p> <input type=submit value=Upload>\n        </form>\n        <hr>\n    ";
    if (strcmp($err_msg, "") != 0) {
        echo "<p>{$err_msg}<hr>";
    }
    $files = array();
    while (($f = readdir($d)) !== false) {
        if ($f == '.') {
            continue;
        }
        if ($f == '..') {
            continue;
        }
        $files[] = $f;
    }
    if (count($files) == 0) {
        echo "Your sandbox is currently empty.";
    } else {
        sort($files);
        start_table();
        table_header("Name<br><span class=note>(click to view)</span>", "Modified", "Size (bytes)", "MD5", "Delete", "Download");
        foreach ($files as $f) {
            $path = "{$dir}/{$f}";
            list($error, $size, $md5) = sandbox_parse_link_file($path);
            if ($error) {
                table_row($f, "Can't parse link file", "", "<a href=sandbox.php?action=delete_files&name={$f}>delete</a>");
                continue;
            }
            $p = sandbox_physical_path($user, $md5);
            if (!is_file($p)) {
                table_row($f, "Physical file not found", "", "");
                continue;
            }
            $ct = time_str(filemtime($path));
            table_row("<a href=sandbox.php?action=view_file&name={$f}>{$f}</a>", $ct, $size, $md5, button_text("sandbox.php?action=delete_file&name={$f}", "Delete"), button_text("sandbox.php?action=download_file&name={$f}", "Download"));
        }
        end_table();
    }
    page_tail();
}
Пример #23
0
function show_admin_page($user, $team)
{
    page_head("Team administration for {$team->name}");
    echo "\r\n\t\t<ul>\r\n\t\t<li><a href=team_edit_form.php?teamid={$team->id}>Edit team info</a>\r\n\t\t\t<br><span class=note>Change team name, URL, description, type, or country</span>\r\n\t\t<li>\r\n\t\t\tMember list:\r\n\t\t<a href=team_email_list.php?teamid={$team->id}>HTML</a>\r\n\t\t| <a href=team_email_list.php?teamid={$team->id}&plain=1>text</a>\r\n\t\t\t<br><span class=note> View member names and email addresses </span>\r\n\t\t<li>View change history:\r\n\t\t\t<a href=team_delta.php?teamid={$team->id}>HTML</a>\r\n\t\t\t| <a href=team_delta.php?teamid={$team->id}&xml=1>XML</a>\r\n\t\t\t<br><span class=note>See when members joined or quit this team</span>\r\n\t";
    // founder-only stuff follows
    //
    if ($team->userid == $user->id) {
        $tokens = url_tokens($user->authenticator);
        if ($team->ping_user > 0) {
            $user2 = BoincUser::lookup_id($team->ping_user);
            $deadline = date_str(transfer_ok_time($team));
            echo "<li>\r\n\t\t\t\t<a href=team_change_founder_form.php?teamid={$team->id}><font color=red><b>Respond to foundership request</b></font></a>.  If you don't respond by {$deadline}, {$user2->name} may assume foundership of this team.\r\n\t\t\t";
        }
        echo "\r\n\t\t\t<li><a href=team_remove_inactive_form.php?teamid={$team->id}>Remove members</a>\r\n\t\t\t\t<br><span class=note>Remove inactive or unwanted members from this team</span>\r\n\t\t\t<li><a href=team_change_founder_form.php?teamid={$team->id}>Change founder</a>\r\n\t\t\t\t<br><span class=note>Transfer foundership to another member</span>\r\n\t\t\t<li><a href=team_admins.php?teamid={$team->id}>Add/remove Team Admins</a>\r\n\t\t\t\t<br><span class=note>Give selected team members Team Admin privileges</span>\r\n\r\n\t\t\t<li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>Remove team</a>\r\n\t\t\t\t<br><span class=note>Allowed only if team has no members</a>\r\n\t\t\t<li><a href=team_forum.php?teamid={$team->id}&cmd=manage>Message board</a>\r\n\t\t\t\t<br><span class=note>Create or manage team message board</span>\r\n\t\t";
    }
    echo "\r\n\r\n\t\t<p>\r\n\t\t<li>\r\n\t\t\tTo have this team created on all BOINC projects\r\n\t\t\t(current and future) you can make it into a\r\n\t\t\t<a href=http://boinc.berkeley.edu/teams/>BOINC-wide team</a>.\r\n\t\t<li>\r\n\t\t\tTeam admins are encouraged to join and participate in the Google\r\n\t\t\t<a href=http://groups.google.com/group/boinc-team-founders>boinc-team-founders</a> group.\r\n\t\t<li>\r\n\t\t\tOther resources for BOINC team admins\r\n\t\t\tare available from a third-party site,\r\n\t\t\t<a href=http://www.boincteams.com>www.boincteams.com</a>.\r\n\t</ul>\r\n\t";
    page_tail();
}
Пример #24
0
function show_admin_page($user, $team)
{
    page_head(tra("Team administration for %1", $team->name));
    echo "\n        <ul>\n        <li><a href=team_edit_form.php?teamid={$team->id}>" . tra("Edit team info") . "</a>\n            <br><p class=\"text-muted\">" . tra("Change team name, URL, description, type, or country") . "</p>\n        <li>\n            " . tra("Member list:") . "\n        <a href=team_email_list.php?teamid={$team->id}>" . tra("HTML") . "</a>\n        &middot; <a href=team_email_list.php?teamid={$team->id}&plain=1>" . tra("text") . "</a>\n            <br><p class=\"text-muted\">" . tra("View member names and email addresses") . "</p>\n        <li>" . tra("View change history:") . "\n            <a href=team_delta.php?teamid={$team->id}>" . tra("HTML") . "</a>\n            &middot; <a href=team_delta.php?teamid={$team->id}&xml=1>" . tra("XML") . "</a>\n            <br><p class=\"text-muted\">" . tra("See when members joined or quit this team") . "</p>\n    ";
    // founder-only stuff follows
    //
    if ($team->userid == $user->id) {
        $tokens = url_tokens($user->authenticator);
        if ($team->ping_user > 0) {
            $user2 = BoincUser::lookup_id($team->ping_user);
            $deadline = date_str(transfer_ok_time($team));
            echo "<li>\n                <a href=team_change_founder_form.php?teamid={$team->id}><font color=red><strong>" . tra("Respond to foundership request.") . "</strong></font></a>  " . tra("If you don't respond by %1, %2 may assume foundership of this team.", $deadline, $user2->name);
        }
        echo "\n            <li><a href=team_remove_inactive_form.php?teamid={$team->id}>" . tra("Remove members") . "</a>\n                <br><p class=\"text-muted\">" . tra("Remove inactive or unwanted members from this team") . "</p>\n            <li><a href=team_change_founder_form.php?teamid={$team->id}>" . tra("Change founder") . "</a>\n                <br><p class=\"text-muted\">" . tra("Transfer foundership to another member") . "</p>\n            <li><a href=team_admins.php?teamid={$team->id}>" . tra("Add/remove Team Admins") . "</a>\n                <br><p class=\"text-muted\">" . tra("Give selected team members Team Admin privileges") . "</p>\n\n            <li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>" . tra("Remove team") . "</a>\n                <br><p class=\"text-muted\">" . tra("Allowed only if team has no members") . "</p>\n            <li><a href=team_forum.php?teamid={$team->id}&cmd=manage>" . tra("Message board") . "</a>\n                <br><p class=\"text-muted\">" . tra("Create or manage a team message board") . "</p>\n        ";
    }
    echo "\n\n        <p>\n        <li>\n            " . tra("To have this team created on all BOINC projects (current and future) you can make it into a %1BOINC-wide team%2.", "<a href=http://boinc.berkeley.edu/teams/>", "</a>") . "\n        <li>\n            " . tra("Team admins are encouraged to join and participate in the Google %1boinc-team-founders%2 group.", "<a href=http://groups.google.com/group/boinc-team-founders>", "</a>") . "\n    </ul>\n    ";
    page_tail();
}
Пример #25
0
function handle_create_form()
{
    global $project, $auth;
    page_head("Create app");
    echo "\n        This form lets you specify parameters for a new application.\n\n        <p>\n        <form action=submit_example_app.php>\n        <input type=hidden name=action value=create_action>\n    ";
    start_table();
    row2("Application name", "<input name=app_name value=\"enter name\">");
    row2("Replication level", "<input name=replication_level value=1>");
    row2("Beta flag", "<input name=is_beta type=checkbox checked=1>");
    row2("Validator", "<select name=validator_type><option value=1 selected=1>Trivial</option>\n                       <option value=2>Bitwise</option></select>");
    end_table();
    start_table();
    row2("Version number", "<input name=app_version value=\"1.0\">");
    //Get list of registered platforms
    //---
    //(tested on a local server)
    $link = mysql_connect("localhost", "boincadm", "") or die("Could not connect: " . mysql_error());
    $q = mysql_query("use test24");
    $q = mysql_query("select id,name from platform order by id");
    $options_platforms = "";
    while ($f = mysql_fetch_row($q)) {
        $options_platforms .= "<option value={$f['0']}>{$f['1']}</option>";
    }
    //---
    row2("Platform", "<select name=app_platform>" . $options_platforms . "</select>");
    row2("Plan class", "<input name=plan_class value=\"(none)\">");
    row2("Main program", "<input name=main_program type=file> <br/>\n                          <input name=is_boincapp type=checkbox checked> Native BOINC application");
    if (isset($_GET['add_file'])) {
        $add_file = $_GET['add_file'] + 1;
    } else {
        $add_file = 1;
    }
    for ($i = 0; $i < $add_file; $i++) {
        row2("Additional file", "<input name=additional_file_{$i} type=file><br/>\n                                 <input name=is_copyfile_{$i} type=checkbox checked>Copyfile");
    }
    row2("", "<a href=?action=create_form&add_file={$add_file}>(more additional files)</a>");
    row2("", "<input type=submit name=submit value=Submit>");
    end_table();
    echo "</form>\n";
    echo "<p><a href=submit_example.php>Return to job control page</a>\n";
    page_tail();
}
Пример #26
0
function show_cpu_list($data)
{
    page_head("CPU performance");
    echo "\n        This table shows peak CPU speed\n        (based on Whetstone benchmarks)\n        of computers participating in this project.\n        <p>\n    ";
    start_table();
    row_heading_array(array("CPU model", "Number of computers", "Avg. cores/computer", "GFLOPS/core", "GFLOPs/computer"));
    $i = 0;
    $total_nhosts = 0;
    $total_gflops = 0;
    foreach ($data->cpus as $d) {
        row_array(array($d->model, $d->nhosts, number_format($d->mean_ncores, 2), number_format($d->p_fpops / 1000000000.0, 2), number_format($d->mean_ncores * $d->p_fpops / 1000000000.0, 2)), "row{$i}");
        $total_nhosts += $d->nhosts;
        $total_gflops += $d->nhosts * $d->mean_ncores * $d->p_fpops / 1000000000.0;
        $i = 1 - $i;
    }
    row_array(array("Total", number_format($total_nhosts, 0) . " computers", "", "", number_format($total_gflops / 1000.0, 2) . " TeraFLOPS"), "row{$i}");
    end_table();
    echo "Generated " . time_str($data->time);
    page_tail();
}
function validate()
{
    $x = get_str("x");
    $u = get_int("u");
    $user = lookup_user_id($u);
    if (!$user) {
        error_page(tra("No such user."));
    }
    $x2 = $user->signature;
    if ($x2 != $x) {
        error_page(tra("Error in URL data - can't validate email address"));
    }
    $result = $user->update("email_validated=1");
    if (!$result) {
        error_page(tra("Database update failed - please try again later."));
    }
    page_head(tra("Validate email address"));
    echo tra("The email address of your account has been validated.");
    page_tail();
}
Пример #28
0
function show_result_page($success, $post, $thread, $choice)
{
    if ($success) {
        if ($choice) {
            page_head(tra("Input Recorded"));
            echo tra("Your input has been recorded. Thanks for your help.");
        } else {
            page_head(tra("Vote Registered"));
            echo tra("Your rating has been recorded. Thanks for your input.");
        }
        echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">" . tra("Return to thread") . "</a>";
    } else {
        page_head(tra("Vote Submission Problem"));
        if ($post) {
            echo "There was a problem recording your vote in our database. Please try again later.";
            echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">" . tra("Return to thread") . "</a>";
        } else {
            echo "The post you specified does not exist, or your rating was invalid.";
        }
    }
    page_tail();
    exit;
}
Пример #29
0
include "../html/inc/stats_sites.inc";
function language($lang, $sites)
{
    echo "<tr><td bgcolor=eeeeee valign=top width=250>{$lang}</td><td>\n";
    shuffle($sites);
    foreach ($sites as $s) {
        echo "{$s}<br>\n";
    }
    echo "</td></tr>\n";
}
function site($url, $name)
{
    return "<a href={$url}>{$name}</a>";
}
$info_sites = array(array("http://www.pkcarlisle.com/smboinc.html", "Running BOINC over a Samba Server", "(in English)"), array("http://www.overclock.net/f/365/overclock-net-boinc-team", "Overclock.net", "(in English)"), array("http://projekty.czechnationalteam.cz/", "BOINC projects", "(in Czech)"), array("http://www.hyper.net/dc-howto.html", "How to participate in grid computing projects that benefit humanity", "(survey of volunteer computing, including non-BOINC projects)"), array("http://www.rechenkraft.net/wiki/", "Rechenkraft.net wiki", "(German, English, Portuguese)"), array("http://www.kd-web.info/#%21/boinc", "Flash-based BOINC tutorials", "(in Czech, English, and Slovak)"), array("http://boincfaq.mundayweb.com/", "The BOINC FAQ Service", "(English, German, Dutch, Spanish and French)"), array("http://www.seti-argentina.com.ar/instrucciones-boinc-manager", "BOINC Argentina", "(in Spanish)"), array("http://www.angelfire.com/jkoulouris-boinc/", "The Big BOINC! Projects and Chronology Page", "(by John Koulouris)"));
page_head("Web resources for BOINC participants");
echo "\n<h3>Contents</h3>\n<ul>\n<li> <a href=#info>Help and Information</a>\n<li> <a href=#stats>Credit statistics</a>\n<li> <a href=#sigs>Signature images</a>\n<li> <a href=#team_stats>Team statistics</a>\n";
//<li> <a href=#status>Project status</a>
echo "\n<li> <a href=#misc>Miscellaneous</a>\n<li> <a href=#skins>Skins for the BOINC Manager</a>\n<li> <a href=#sites>Other BOINC-related sites</a>\n(Information, message boards, and teams)\n<li> <a href=#video>BOINC-related videos</a>\n</ul>\n<a name=info></a>\n<h3>Help and Information</h3>\nSites with information and documentation about BOINC.\n";
shuffle($info_sites);
site_list($info_sites);
echo "\n<a name=stats></a>\n<h3>Credit statistics</h3>\n<p>\nThe following web sites show statistics for one or more BOINC projects.\nThese sites use XML-format data exported by BOINC projects,\nas described\n<a href=http://boinc.berkeley.edu/trac/wiki/CreditStats>here</a>.\nIf you're interested in running your own site or\nparticipating in the development efforts,\nplease contact the people listed below.\n";
shuffle($stats_sites);
site_list($stats_sites);
echo "\n<a name=sigs></a>\n<h3>Signature images</h3>\n<p>\nThe following sites offer dynamically-generated\nimages showing your statistics in BOINC projects,\nand/or news from projects.\nUse these in your email or message-board signature.\n";
shuffle($sig_sites);
site_list($sig_sites);
echo "\n<a name=team_stats></a>\n<h3>Team statistics</h3>\n";
shuffle($team_stats_sites);
site_list($team_stats_sites);
if (0) {
Пример #30
0
<?php

require_once "docutil.php";
page_head("BOINC Menubar");
echo "\n\n<h1>Introduction</h1>\n<p>\nBOINC Menubar is a graphical interface for BOINC.\nIt does not have a main window, application menu, or dock icon.\nInstead, everything is controlled from a small icon which\nappears in the upper right hand corner of your screen.\nClicking on this icon produces a menu which provides\naccess to all the features of BOINC Menubar.\n\n<p> <img src=screenshots/menu.jpg width=299 height=474><br>\n  (Figure 1)\n  \n<h1>Getting Started</h1>\n<h3>First-time BOINC Participants</h3>\n<p>\nIf you are new to BOINC,\nthen you need to create accounts for projects\nin which you would like to participate.\nPlease visit the main BOINC site\n(<a href=https://boinc.berkeley.edu/>https://boinc.berkeley.edu/</a>)\nfor a list of popular projects.\n<p>\nWhen you create an account, you will be sent an email containing a URL\nand Account Key.\nCollect this information and skip down to the 'Project Manager'\nsection for information on how to set up BOINC Menubar to run these projects.\n\n<h3>Returning BOINC Participants</h3>\n<p>\nIf you already have a BOINC account and have run the 'boinc'\ncommand-line program on this computer,\nyou will need to move files to a new location.\nLocate the folder which served as the launch path when you ran the 'boinc'\ncommand.\nIt should contain such files and folders as 'client_state.xml',\n'slots', and 'projects'.\n    \n<p>\nCopy all these files (not the enclosing folder itself)\ninto '~/Library/Application Support/BOINC Data/'\n  \n<p>\nNow when you run BOINC Menubar and select 'Manage Projects...' from the\nstatus menu,\nyou should find a list of the projects in which you are currently participating.\n\n<h1>Managing Projects</h1>\n<h3>Adding Projects</h3>\n<p>\nBefore adding projects, collect the emails containing the URLs\nand Account Keys for each project.\n  \n<p>\nSelect 'Manage Projects...' from the status menu.\n  \n<p>\n<img src=screenshots/menuMouseOnManageProjects.jpg width=300 height=473><br>\n (Figure 2)\n<p>\nThis will open up the 'Project Manager'.\n<p>\n<img src=screenshots/projectManager.jpg width=499 height=262><br> (Figure 3)\n<p>\nClick the 'Add' button.\nThis will produce a new sheet in which you can paste in a URL and Account Key.\n  \n<p>\n<img src=screenshots/projectManagerWithAddProjectSheet.jpg width=502 height=263><br>\n (Figure 4)\n<p>\nAfter you have finished, click 'OK' and the project will be added.\n<p>\n<strong>Note: </strong>Please be patient as it can take a few moments for a project to be added.\n  \n<h3>Updating, Resetting, and Removing Projects:</h3>\n\n<p>\nSelect 'Manage Projects...' from the status menu (Figure 2).\nThis will open up the 'Project Manager' (Figure 3).\n<p>\nHighlight the project you wish to update, reset, or remove\nby clicking its name.\nThe 'Remove', 'Reset', and 'Update' buttons\nat the bottom of the project manager window will be enabled.\n<p>\n<img src=screenshots/projectManagerButtonsEnabled.jpg width=498 height=261><br>\n   (Figure 5)\n  \n<p>\nClicking 'Update' causes BOINC to contact a project's web site\nto obtain new preferences.\nThis will also report completed results and get new work if needed.\n<p>\nClicking 'Reset' clears all pending work for a project.\nUse this if there is a problem that is preventing your computer from working.\n<p>\nClicking 'Remove' will remove the selected project.\n<p>\n<strong>Hint:</strong> As indicated in the project manager,\ndouble clicking a project's name or URL will take you to a projects web site.\nThis is particularly convenient if you want to change\na project's preferences or view statistics.\n  \n<h1>The Status Menu</h1>\n<p>\n<img src=screenshots/menu.jpg width=299 height=474><br>\n  (Figure 6)\n<h3>&nbsp;</h3>\n<h3>Controlling BOINC Using BOINC Menubar</h3>\n<p>\nOnce BOINC Menubar has some projects to run,\nyou can now use the menu to start and stop BOINC.\n<p>\nTo start BOINC running, simply select 'Start' from the status menu.\nBOINC will start running in the background.\n  \n<p>\nIf you wish to see exactly what BOINC is doing while it is running,\nselect 'Display Log' from the status menu.\nThis will display a window containing all the output produced by BOINC.\n<p>\n<img src=screenshots/logWindow.jpg width=685 height=332><br>\n  (Figure 7)\n<p>\nIf you want to stop BOINC running for any reason, simply select 'Stop'.\nQuitting BOINC Menubar automatically stops BOINC if it is running.\n<p>\nYou may force BOINC to run CPU benchmarks by selecting\n'Run CPU Benchmarks' from the status menu.\nNote that you only need to do this if you have recently modified\nyour computer's hardware.\n\n<h3>Menu Statistics</h3>\n<p>\nThe status menu contains four pieces of information:\n<p>\nThe 'Current Project' is simply the project or projects currently\nbeing run by BOINC.\nThe current project will change from time to time\nas BOINC stops and starts other projects.\n<p>\nThe 'Work Completed' indicates what percentage of the current work\nunit has been completed for the current project.\n<p>\nThe 'Project Credit' is the amount of credit you have received\nfor the project which is currently running.\nThis is the same amount as appears on the project's web site\nand includes credit which you have received by running BOINC\non other computers as well.\n<p>\nThe 'Total Credit' is the amount of credit you have received\nfor all projects which BOINC Menubar knows about.\nThat is, if you are participating in four projects on this computer,\nthen the total credit will be the sum of all four project credits.\n  \n<p>\n<strong>Note: </strong>The amount of credit displayed by BOINC Menubar\nmay not be <em>exactly</em> the same as you find on project web sites.\nThis is because credit is only updated when a computer contacts\nthe projects web site to send results or receive new data.\nIf the amount of credit differs from what you see on the web,\nthe amount will be updated next time the project contacts its web site.\n\n<h3>Menubar Statistics</h3>\n<p>\nThe menubar contains two pieces of information:</p>\n<p>\nA small icon indicates the current project or projects. Listed below are  the most common projects and their corresponding icons.</p>\n<p><img src=screenshots/CPIcon.jpg width=15 height=15> - climateprediction.net\n<p><img src=screenshots/EAHIcon.jpg width=15 height=15> - Einstein@home\n<p><img src=screenshots/PPAHIcon.jpg width=15 height=15> - Predictor@home\n<p><img src=screenshots/SAHIcon.jpg width=15 height=15> - SETI@home\n<p><img src=screenshots/BOINCIcon.jpg width=15 height=15> - Default icon for all other projects\n<p>\nThe menubar also displays a graphical representation of the completed percentage of the current work unit as a vertical 'progress bar'.</p>\n\n<h1>Preferences</h1>\n<p> <img src=screenshots/preferencesWindow.jpg width=534 height=296><br>\n  (Figure 8)\n\n<h3>General Settings: </h3>\n<p>\nSelect 'Start BOINC On Application Launch' if you want BOINC to\nstart running every time you open BOINC Menubar.\nYou might find this particularly useful if you want BOINC\nto be running all the time.\n    \n<p>\n<strong>Hint:</strong> You can set BOINC Menubar to auto-launch\nwhenever you login by adding BOINC Menubar to the login items\nin the 'Accounts' pane in 'System Preferences'.\nCombining this with 'Start BOINC On Application Launch'\nwill ensure that BOINC is running at all times.\n<p>\nSelect 'Display Log On Application Launch' if you wish the Log window to\nopen automatically every time you open BOINC Menubar.\n<p>\nSelect 'Share Data With Other Users' if you wish data to be shared\nwith other users running BOINC Menubar on your computer.\nThe data will be moved to a location where other users can access\nand contribute to it.\n<p>\n<strong>Note:</strong> Only administrative users can set up BOINC Menubar\nto share data with other users, but all users can contribute.\n<p>\nSelect 'Unlimited Scrollback' if you would like to keep all\nthe output produced by BOINC.\nBy default, the BOINC Menubar keeps the last 10,000 lines output by BOINC.\n\n<h3>Proxy Settings:</h3>\n<p>\nIf you need to use a proxy, first select the type of proxy you are using:\nHTTP or SOCKS.\nNext, enter the address of the proxy.\nIf the proxy requires a username and password,\nclick the &quot;Set password...&quot; button.\nThis will produce a new sheet in which you can enter your username\nand password (Figure 9).\n\n<p><img src=screenshots/preferencesWindowWithProxyPasswordSheet.jpg width=528 height=294><br>\n(Figure 9)\n\n<p>Click &quot;OK&quot; to save\n\n";
page_tail();