diff --git a/checkin_notes b/checkin_notes index fa389e413a..6dacfd814f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2815,3 +2815,11 @@ Rytis 24 Mar 2007 forum_moderate_post_action.php inc/ forum_email.inc + +David 24 Mar 2007 + - admin web: added script to banish user for various periods, + independently of forum tools (from Eric Myers) + + html/ops/ + index.php + manage_user.php diff --git a/html/ops/index.php b/html/ops/index.php index fe54188dc5..7b8b90f780 100644 --- a/html/ops/index.php +++ b/html/ops/index.php @@ -79,6 +79,11 @@ echo "
  • Repair a validator problem
  • Email user with misconfigured host
  • Cancel workunits
  • +
  • + + ID: +
    +
  • Clear Host: diff --git a/html/ops/manage_user.php b/html/ops/manage_user.php new file mode 100644 index 0000000000..6eac082cd8 --- /dev/null +++ b/html/ops/manage_user.php @@ -0,0 +1,276 @@ + 0 && empty($reason) ) { + error_page("You must supply a reason for a suspension. +

    Try again"); + } else { + if( is_numeric($dt) ) { + $t = time()+$dt; + $q = "UPDATE forum_preferences SET banished_until=$t WHERE userid=$id"; + mysql_query($q); + + /* put a timestamp in wiki to trigger re-validation of credentials */ + + if( function_exists('touch_wiki_user') ){ + touch_wiki_user($user); + } + + /* Send suspension e-mail to user and administrators */ + + if($dt>0){ + $subject = PROJECT." posting privileges suspended for ". $user->name; + $body = " +Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" +have been suspended for " .time_diff($dt). " by ".$logged_in_user->name.". +The reason given was: + + $reason + +The suspension will end at " .time_str($t)."\n"; + } + else { + $subject = PROJECT." user ". $user->name. " unsuspended"; + $body = " +Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" +have been restored by ".$logged_in_user->name."\n"; + if($reason) $body.="The reason given was:\n\n $reason\n"; + } + + send_email($user, $subject, $body); + + $emails = explode(",", POST_REPORT_EMAILS); + foreach ($emails as $email) { + $admin->email_addr = $email; + send_email($admin, $subject, $body); + } + + }// + } + } +}// suspend_submit + + + +// Now update from whatever was set + +$user=getForumPreferences($user); + + +/******************************** + * Output: + */ + +admin_page_head("User Management: $user->name"); +echo "\n\n"; +echo "\n\n"; + +if (!defined("POST_REPORT_EMAILS")) { + echo "

    + There is no addministrative e-mail address defined for reporting problems +or abuse in the forums. Please define POST_REPORT_EMAILS in project.inc +

    \n"; + } + +echo " + \n"; + +start_table(); +row1("User: ".$user->name + . "
    +
    "); +show_user_summary_public($user); +show_profile_link($user); +project_user_summary($user); +//row2("E-mail:", $user->email_addr); +end_table(); +project_user_page_private($user); + +echo "
    \n"; + + +/********************** + * Special User status: + */ + +echo "\n\n

    + + \n"; +for($i=0;$i<$Nbf;$i++) { + $bit = substr($user->special_user, $i, 1); + echo "\n"; +} +echo ""; + +echo "\n"; +end_table(); +echo "\n"; + +echo "\n\n\n"; + +end_table(); +echo "\n"; + +echo " +
    \n"; + +echo "
    + \n"; + +start_table(); +row1("Special User Status: $user->name", $Nbf ); + +echo "
    ". $special_user_bitfield[$i] ."
    + +
    \n\n"; + + + +/********************** + * Suspended posting privileges + */ + +//function suspend_user_form($user) { + +echo "
    + \n"; +start_table(); +row1("Suspension: $user->name"); + +if( $user->banished_until ) { + $dt = $user->banished_until - time(); + if( $dt > 0 ) { + $x = " Suspended until " . time_str($user->banished_until) + ."
    (Expires in " . time_diff($dt) .")" ; + } + else { + $x = " last suspended " . time_str($user->banished_until); + } + row1($x); +} + +echo "
    +Suspend user for: +
    + 1 hour
    + 2 hours
    + 5 hours
    + 10 hours
    + 24 hours
    + 48 hours
    "; + +if( is_Administrator($logged_in_user) ){ // in case we are only a moderator + echo " + 1 week
    + 2 weeks
    +"; +} + + +if($dt>0) { + echo " + unsuspend
    "; +} +echo " +
    + +"; + +echo "

    Reason (required):\n"; +echo ""; +echo "
    The reason will be sent to both the user + and to the project administrators.\n"; + + +echo "

    \n"; +echo "
    \n"; + + +if($q) { + echo "

    Query: $q "; +} + + + +admin_page_tail(); + +$cvs_version_tracker[]= //Generated automatically - do not edit + "\$Id$"; +?>