コード例 #1
0
ファイル: user_permissions.php プロジェクト: CalvinZhu/boinc
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
ファイル: download.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #3
0
ファイル: brand_stats.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #4
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();
}
コード例 #5
0
ファイル: addon_item.php プロジェクト: ChristianBeer/boinc
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();
}
コード例 #6
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;
    }
}
コード例 #7
0
ファイル: forum_rate.php プロジェクト: Turante/boincweb
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;
}
コード例 #8
0
ファイル: team_admins.php プロジェクト: Turante/boincweb
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();
}
コード例 #9
0
ファイル: edit_host_info_action.php プロジェクト: happyj/qcn
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
ファイル: help_vol_edit.php プロジェクト: CalvinZhu/boinc
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");
}
コード例 #11
0
ファイル: bossa_apps.php プロジェクト: Turante/boincweb
function main()
{
    page_head("Bossa apps");
    start_table();
    show_apps();
    end_table();
    page_tail();
}
コード例 #12
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;
}
コード例 #13
0
ファイル: delete_profile.php プロジェクト: Turante/boincweb
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();
}
コード例 #14
0
ファイル: submit_status.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #15
0
ファイル: forum_subscribe.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #16
0
ファイル: login_action.php プロジェクト: aggroskater/boinc
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);
        }
    }
}
コード例 #17
0
ファイル: register.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #18
0
ファイル: sandbox.php プロジェクト: nicolas17/boincgit-test
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();
}
コード例 #19
0
ファイル: team_manage.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #20
0
ファイル: team_manage.php プロジェクト: Turante/boincweb
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();
}
コード例 #21
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();
}
コード例 #22
0
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();
}
コード例 #23
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;
}
コード例 #24
0
ファイル: links.php プロジェクト: privat1/boinc
language("Dutch", array(site("http://www.dutchpowercows.org/", "Dutch Power Cows\n        </a>(also <a href=http://gathering.tweakers.net/forum/list_topics/5>forums</a>)"), site("http://www.seti.nl/content.php?c=boincmain", "SETI@Netherlands"), site("http://www.boinc.be", "www.boinc.be")));
language("English", array(site("http://www.overclock.net/f/365/overclock-net-boinc-team", "Overclock.net"), site("http://z15.invisionfree.com/The_Boinc_Bar/index.php?act=idx", "The BOINC Bar"), site("http://www.s15.invisionfree.com/Crunchers_Inc/index.php?act=idx", "Crunchers Inc."), site("http://www.calmchaosonline.com/", "Calm Chaos"), site("http://www.teamphoenixrising.net/", "Team Phoenix Rising"), site("http://www.unitedmacs.com/", "United Macs"), site("http://www.ukboincteam.org.uk/", "UK BOINC Team"), site("http://www.bc-team.org/", "BOINC Confederation"), site("http://www.free-dc.org/", "Free-DC"), site("http://forums.anandtech.com/categories.aspx?catid=39&entercat=y", "TeAm Anandtech"), site("http://www.boinc-australia.net", "BOINC@Australia"), site("http://www.boincuk.com/", "BOINC UK and Team Lookers"), site("http://www.boincsynergy.com/", "BOINC Synergy"), site("http://www.tswb.org", "Team Starfire World BOINC")));
//language("Estonian", array(
//site("http://boinc.tmac.pri.ee", "boinc.tmac.pri.ee"),
//site("http://setimehed.net/", "setimehed.net"),
//));
language("Finnish", array(site("http://www.universe-examiners.org/", "Universe Examiners")));
language("French", array(site("http://boinc.starwars-holonet.com/", "Star Wars [FR]"), site("http://www.boinc-af.org", "L'Alliance Francophone")));
language("German", array(site("http://www.crunchers-freiburg.de/", "crunchers@freiburg"), site("http://www.unitedmacs.com/", "United Macs"), site("http://www.rechenkraft.net/", "Rechenkraft"), site("http://www.seti-leipzig.de/", "SETI-Leipzig"), site("http://www.dc-gemeinschaft.com/", "DC - Gemeinschaft"), site("http://boinccast.podhost.de/", "BOINCcast (Podcast)"), site("http://www.boinc-team.de/", "BOINC@Heidelberg"), site("http://www.boinc.at/", "www.boinc.at"), site("http://www.boinc-halle-saale.de", "BOINC@Halle/Saale"), site("http://www.bc-team.org/", "BOINC Confederation"), site("http://www.seti-germany.de", "SETI.Germany"), site("http://www.sar-hessen.org", "Team Science and Research Hessen"), site("http://www.boinc.de/", "www.boinc.de")));
//language("Hungarian", array(
//site("http://seti.hwsw.hu/", "HWSW SETI@home Team")
//));
language("Italian", array(site("http://www.calcolodistribuito.it/", "Calcolo Distribuito"), site("http://www.boincitaly.org/", "BOINC.Italy"), site("http://gaming.ngi.it/forum/forumdisplay.php?f=73", "NGI forum"), site("http://it.groups.yahoo.com/group/BOINC-ITALIA/", "BOINC-ITALIA")));
language("Japanese", array(site("http://boinc.oocp.org/", "translation by Komori Hitoshi")));
language("Korean", array(site("http://cafe.naver.com/setikah", "SETIKAH@KOREA")));
language("Polish", array(site("http://www.boincatpoland.org", "BOINC@Poland"), site("http://boinc.pl", "BOINC Polish National Team"), site("http://www.tomaszpawel.republika.pl/", "TomaszPawelTeam")));
language("Portuguese", array(site("http://www.setibr.org/", "SETIBR")));
//language("Romanian", array(
//    site( "http://www.boinc.ro/", "SETI@home Romania")
//));
language("Russian", array(site("http://vkontakte.ru/club11963359", "BOINC group on vkontakte.ru"), site("http://www.boinc.ru", "BOINC.ru"), site("http://distributed.ru", "distributed.ru")));
language("Slovak", array(site("http://www.boinc.sk/", "www.boinc.sk")));
language("Spanish", array(site("http://www.titanesdc.com/", "Foros TitanesDC"), site("http://www.seti.cl/", "BOINC SETI Chile"), site("http://www.easyboinc.org/", "Computación Distribuida"), site("http://foro.noticias3d.com/vbulletin/showthread.php?t=192297", "Noticias3D"), site("http://www.boinc-ecuador.com/", "BOINC - Ecuador"), site("http://www.hispaseti.org/", "HispaSeti")));
//language("Turkish", array(
//site("http://www.turksetiteam.org/", "www.turksetiteam.org"),
//site("http://www.boinctr.com/", "www.boinctr.com")
//));
language("Ukrainian", array(site("http://distributed.org.ua/", "Ukraine - Distributed Computing")));
echo "\n</table>\n<p>\nIf you'd like to add a web site to this list, please\n<a href=mailto:davea@ssl.berkeley.edu>contact us</a>.\n\n<a name=video>\n<h2>BOINC-related videos</h2>\n\n<ul>\n<li> <a href=http://www.youtube.com/watch?v=8iSRLIK-x6A>David Anderson talks about BOINC</a> (2006)\n<li> <a href=http://www.youtube.com/watch?v=GzATbET3g54>David Baker talks about Rosetta@home</a>\n</ul>\n";
page_tail();
コード例 #25
0
ファイル: index.php プロジェクト: aggroskater/boinc
}
function show_create()
{
    echo "\n        <tr><td class=heading_left>\n        <center>\n        <span class=section_title>" . tra("Compute with BOINC") . "</span>\n        <br>\n        <b><a class=heading href=\"trac/wiki/ProjectMain\">" . tra("Documentation") . "</a></b>\n        &middot; <b><a class=heading href=\"trac/wiki/ServerUpdates\">" . tra("Software updates") . "</a></b>\n        </center>\n        </td></tr>\n        <tr><td>\n        <ul>\n        <li>\n    ", tra("%1Scientists%2: use BOINC to create a %3volunteer computing project%4, giving you the power of thousands of CPUs and GPUs.", "<b>", "</b>", "<a href=volunteer.php>", "</a>"), "<li>", tra("%1Universities%2: use BOINC to create a %3Virtual Campus Supercomputing Center%4.", "<b>", "</b>", "<a href=\"trac/wiki/VirtualCampusSupercomputerCenter\">", "</a>"), "<li>", tra("%1Companies%2: use BOINC for %3desktop Grid computing%4.", "<b>", "</b>", "<a href=dg.php>", "</a>"), " </ul>\n        </td></tr>\n    ";
}
function show_other()
{
    echo "\n        <tr><td class=heading_left>\n        <center>\n        <span class=section_title>" . tra("About BOINC") . "</span>\n        </center>\n        </td></tr>\n        <tr><td>\n            <table width=100%>\n            <tr valign=top> <td>\n            <center><font size=+1>Project</font></center>\n                <ul>\n                <li> <a href=\"dev/\">" . tra("Message boards") . "</a>\n                <li> <a href=\"trac/wiki/EmailLists\">" . tra("Email lists") . "</a>\n                <li> <a href=\"trac/wiki/BoincEvents\">" . tra("Events") . "</a>\n                <li> <a href=logo.php>Logos and graphics</a>\n                <li> <a href=\"trac/wiki/ProjectGovernance\">Governance</a>\n                <li> <a href=\"trac/wiki/ProjectPeople\">Contact</a>\n                </ul>\n            </td><td>\n            <center><font size=+1>Software</font></center>\n                <ul>\n                <li> <a href=trac/wiki/SourceCodeGit>" . tra("Source code") . "</a>\n                <li> <a href=https://github.com/BOINC/boinc/issues>Report bugs</a>\n                <li> <a href=\"trac/wiki/SoftwareBuilding\">" . tra("Building BOINC") . "</a>\n                <li> <a href=\"trac/wiki/SoftwareDevelopment\">" . tra("Design documents") . "</a>\n                <li> <a href=\"trac/wiki/DevProcess\">" . tra("Development process") . "</a>\n                <li> <a href=\"trac/wiki/DevProjects\">" . tra("Volunteer") . "</a>\n                <li> <a href=\"trac/wiki/SoftwareAddon\">" . tra("APIs") . "</a>\n                </ul>\n            </td><td valign=top>\n\n            <center><font size=+1>Contribute</font></center>\n                <ul>\n                <li> <a href=trac/wiki/ContributePage>Overview</a>\n                <li> <a href=\"trac/wiki/DevProjects\">" . tra("Programming") . "</a>\n                <li> <a href=\"trac/wiki/TranslateIntro\">" . tra("Translation") . "</a>\n                <li> <a href=\"trac/wiki/AlphaInstructions\">" . tra("Testing") . "</a>\n                <li> <a href=\"trac/wiki/WikiMeta\">" . tra("Documentation") . "</a>\n                <li> <a href=\"http://boinc.berkeley.edu/wiki/Publicizing_BOINC\">" . tra("Publicity") . "</a>\n                </ul>\n            </td></tr></table>\n        </td></tr>\n    ";
}
function show_nsf()
{
    echo "\n        <tr><td>\n        <img align=left hspace=8 src=nsf.gif alt=\"NSF logo\">\n        BOINC is supported by the\n        <a href=\"http://nsf.gov\">National Science Foundation</a>\n        through awards SCI-0221529, SCI-0438443, SCI-0506411,\n                PHY/0555655, and OCI-0721124.\n        <span class=note>\n        Any opinions, findings, and conclusions or recommendations expressed in\n        this material are those of the author(s)\n        and do not necessarily reflect the views of the National Science Foundation.\n        </span>\n        </td></tr>\n    ";
}
header("Content-type: text/html; charset=utf-8");
html_tag();
$rh_col_width = 390;
echo "\n    <head>\n    <link rel=\"shortcut icon\" href=\"logo/favicon.gif\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"white.css\">\n    <link href=\"https://plus.google.com/117150698502685192946\" rel=\"publisher\" />\n    <title>BOINC</title>\n    <meta name=description content=\"BOINC is an open-source software platform for computing using volunteered resources\">\n    <meta name=keywords content=\"distributed scientific computing supercomputing grid SETI@home public computing volunteer computing \">\n    </head>\n    <body>\n    <table width=\"100%\" border=0><tr>\n    <td valign=top>\n    <img hspace=20 vspace=6 align=left src=\"logo/www_logo.gif\" alt=\"BOINC logo\">\n    </td>\n    <td align=center>\n    <span class=\"title\">\n    " . sprintf(tra("Open-source software for volunteer computing")) . "\n    </span><br><br>\n    </td>\n    <td width={$rh_col_width} align=right>\n";
search_form();
language_form();
echo "\n    </td></tr>\n    </table>\n\n    <table width=\"100%\" border=0 cellspacing=0 cellpadding=4>\n    <tr>\n    <td valign=top>\n    <table width=\"100%\" border=0 cellspacing=0 cellpadding=8>\n";
show_participate();
show_create();
show_other();
//show_nsf();
echo "\n    </table>\n    </td>\n";
echo " <td valign=top width=390>\n";
show_participant();
show_news_items();
echo "\n    </td></tr>\n    </table>\n";
page_tail(true, true);
コード例 #26
0
ファイル: host_edit_action.php プロジェクト: Turante/boincweb
function fail($msg)
{
    echo "Error: {$msg}";
    page_tail();
    exit;
}
コード例 #27
0
ファイル: sim_web.php プロジェクト: nicolas17/boincgit-test
function show_simulation()
{
    $scen = get_str("scen");
    $sim = get_str("sim");
    $dir = "scenarios/{$scen}/simulations/{$sim}";
    if (!is_dir($dir)) {
        error_page("No such simulation");
    }
    page_head("Simulation {$sim}");
    start_table();
    $userid = (int) file_get_contents("{$dir}/userid");
    $user = BoincUser::lookup_id($userid);
    $date = date_str(filemtime($dir));
    row2("Scenario", "<a href=sim_web.php?action=show_scenario&name={$scen}>{$scen}</a>");
    row2("Who", $user->name);
    row2("When", $date);
    row2("Parameters", "<pre>" . file_get_contents("{$dir}/inputs.txt") . "</pre>");
    row2("Results", "<pre>" . file_get_contents("{$dir}/results.txt") . "</pre>");
    $x = file_get_contents("{$dir}/index.html");
    $x = str_replace("<h3>Output files</h3>", "", $x);
    $x = str_replace("href=", "href=scenarios/{$scen}/simulations/{$sim}/", $x);
    row2("Output files", $x);
    $x = get_comments($dir);
    if ($x) {
        row2("Comments", $x);
    }
    echo "<form action=sim_web.php>\n        <input type=hidden name=scen value={$scen}>\n        <input type=hidden name=sim value={$sim}>\n        <input type=hidden name=action value=add_comment>\n    ";
    row2("<input type=submit value=\"Add comment\">", "<textarea name=comment></textarea>");
    echo "</form>";
    end_table();
    page_tail();
}
コード例 #28
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();
}
コード例 #29
0
ファイル: team_forum.php プロジェクト: Turante/boincweb
function edit_action($forum)
{
    $title = strip_tags(post_str('title'));
    $title = BoincDb::escape_string($title);
    $description = strip_tags(post_str('description'));
    $description = BoincDb::escape_string($description);
    $post_min_interval = post_int('post_min_interval');
    $post_min_total_credit = post_int('post_min_total_credit');
    $post_min_expavg_credit = post_int('post_min_expavg_credit');
    $ret = $forum->update("title='{$title}', description='{$description}', post_min_interval={$post_min_interval}, post_min_total_credit={$post_min_total_credit}, post_min_expavg_credit={$post_min_expavg_credit}");
    if ($ret) {
        page_head("Team Message Board Updated");
        echo "Update successful";
        page_tail();
    } else {
        error_page("update failed");
    }
}
コード例 #30
0
function handle_add_form()
{
    page_head("Add user");
    echo "\n        <form action=manage_project.php>\n        <input type=hidden name=action value=add_action>\n        User ID: <input name=user_id>\n        <br>\n        <input type=submit value=OK>\n        </form>\n    ";
    page_tail();
}