1 ) { while( $row = mysql_fetch_object($result) ){ if( !empty($matches) ) $matches .= ", "; $matches .= $row->name; } mysql_free_result($result); } } } } /** * Look up the user */ $id = get_int("userid", true); if( empty($id) ) $id = post_int("userid", true); if( !empty($id) ){ $user = lookup_user_id($id); } // but clear if page was reset (forcing search form) if( isset($_POST['reset_page']) ){ unset($user); } /** * Process special user settings */ if( isset($_POST['special_user']) && $user && $is_admin ){ $bits=""; for($i=0;$i<$Nbf;$i++) { $bits .= $_POST['special_user_'.$i] ? "1" : "0" ; } $q = "UPDATE forum_preferences SET special_user=\"$bits\" WHERE userid=$id"; mysql_query($q); } /** * Process a suspension: */ if( isset($_POST['suspend_submit']) && !empty($user) && $is_admin ){ $dt = post_int('suspend_for',true); if( $is_admin || ($is_mod && $dt < 86400) ){ $reason = $_POST['suspend_reason']; if( $dt > 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); } }//numerical($dt) } } }// suspend_submit // Now update from whatever might have been set above if( !empty($user) ) { $user=getForumPreferences($user); } /******************************** * Output: */ admin_page_head("User Management: $user->name"); 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"; admin_page_tail(); exit(); } row1("User: ".$user->name. "
\n"; echo " | \n"; } end_table(); echo "\n"; echo "\n\n | \n\n"; /********************** * Suspended posting privileges */ echo "\n"; echo " |
Query: $q "; } admin_page_tail(); $cvs_version_tracker[]= //Generated automatically - do not edit "\$Id$"; ?>