Example #1
0
        $community_links = $data->clo;
    } else {
        // No data was found, generate new data for the cache and store it
        $user = lookup_user_id($id);
        BoincForumPrefs::lookup($user);
        $user = @get_other_projects($user);
        $community_links = get_community_links_object($user);
        $data->user = $user;
        $data->clo = $community_links;
        set_cached_data(USER_PAGE_TTL, serialize($data), $cache_args);
    }
    if (!$user->id) {
        error_page("No such user");
    }
    $logged_in_user = get_logged_in_user(false);
    page_head($user->name);
    start_table();
    echo "<tr><td valign=top>";
    start_table();
    show_user_summary_public($user);
    end_table();
    project_user_summary($user);
    show_other_projects($user, false);
    echo "</td><td valign=top>";
    start_table();
    show_profile_link($user);
    community_links($community_links, $logged_in_user);
    end_table();
    echo "</td></tr></table>";
    page_tail(true);
}
Example #2
0
function show_manage_user_form($user)
{
    global $special_user_bitfield;
    $Nbf = sizeof($special_user_bitfield);
    admin_page_head("Management {$user->name}");
    if (!defined("POST_REPORT_EMAILS")) {
        echo "<p><font color='RED'>\n       There is no administrative email address defined for reporting problems\n    or abuse in the forums.  Please define POST_REPORT_EMAILS in project.inc\n            </font></p>\n";
    }
    echo "<form name='manage_user' action=manage_user.php method='POST'>\n        <input type='hidden' name='userid' value='" . $user->id . "'>\n    ";
    start_table();
    row1("<b>User: </b> {$user->name} <div align='right'>\n            <input name=\"delete_user\" type=\"submit\" value=\"Delete user\">\n            </div>");
    show_user_summary_public($user);
    show_profile_link_ops($user);
    row2("Email:", "{$user->email_addr}");
    project_user_summary($user);
    end_table();
    project_user_page_private($user);
    echo "</form>\n";
    // Special User status:
    echo "\n\n<P>\n       <table width='100%'><tr>\n       <td width='50%' valign='TOP'> \n";
    echo "<form name='special_user' action=manage_user.php method=\"POST\">\n        <input type='hidden' name='userid' value='" . $user->id . "'>\n    ";
    start_table();
    row1("Special User Status");
    echo "<tr>\n";
    for ($i = 0; $i < $Nbf; $i++) {
        $bit = substr($user->prefs->special_user, $i, 1);
        echo "<tr><td><input type='checkbox'' name='special_user_" . $i . "' value='1'";
        if ($bit == 1) {
            echo " checked='checked'";
        }
        echo ">" . $special_user_bitfield[$i] . "</td></tr>\n";
    }
    echo "</tr>";
    echo "</tr><td colspan={$Nbf} align='RIGHT'>\n        <input name='special_user' type='SUBMIT' value='Update'>\n        </td></tr>\n    ";
    end_table();
    echo "</form>\n";
    echo "\n\n</td><td valign='TOP'>\n\n";
    // Suspended posting privileges
    echo "<form name='banishment' action=manage_user.php method=\"POST\">\n        <input type='hidden' name='userid' value='" . $user->id . "'>\n    ";
    start_table();
    row1("Suspension");
    if ($user->prefs->banished_until) {
        $dt = $user->prefs->banished_until - time();
        if ($dt > 0) {
            $x = " Suspended until " . time_str($user->prefs->banished_until) . "<br/> (Expires in " . time_diff($dt) . ")";
        } else {
            $x = " last suspended " . time_str($user->prefs->banished_until);
        }
        row1($x);
    } else {
        $dt = 0;
    }
    echo "<tr><td>\n    Suspend user for:\n     <blockquote>\n            <input type='radio' name='suspend_for' value='3600'> 1 hour   <br/>\n            <input type='radio' name='suspend_for' value='7200'> 2 hours  <br/>\n            <input type='radio' name='suspend_for' value='18000'> 6 hours  <br/>\n            <input type='radio' name='suspend_for' value='36000'> 12 hours  <br/>\n            <input type='radio' name='suspend_for' value='86400'> 24 hours  <br/>\n    ";
    echo "\n        <input type='radio' name='suspend_for' value='172800'> 48 hours  <br/>\n        <input type='radio' name='suspend_for' value='", 86400 * 7, "'> 1 week  <br/>\n        <input type='radio' name='suspend_for' value='", 86400 * 14, "'> 2 weeks  <br/>\n    ";
    if ($dt > 0) {
        echo "\n            <input type='radio' name='suspend_for' value='-1'>  <b>unsuspend</b>   <br/>";
    }
    echo "\n     </blockquote>\n\n    ";
    echo "<P>Reason (required):\n";
    echo "<textarea name='suspend_reason' cols='40' rows='4'></textarea>";
    echo "<br><font size='-2' >The reason will be sent to both the user\n            and to the project administrators.</font>\n";
    echo "<p align='RIGHT'><input name='suspend_submit' type='SUBMIT' value='Update'></P>\n";
    echo " </td></tr>\n";
    end_table();
    echo "</form>\n";
    echo "</td></tr> </table>\n";
    admin_page_tail();
}