Code: Select all
ALTER TABLE `phpbb_users` ADD `user_disabled_profile` TINYINT NOT NULL;
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
admin/users.php
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
Code: Select all
<select name="user_disable_profile">
<option value="1">{L_YES}</option>
<option value="0">{L_NO}</option>
</select></td>
Code: Select all
'DISABLE_CHECKED' => $user_profile_disable, // Disable Profile Mod
Code: Select all
'DISABLE_CHECKED' => $user_disable_profile, // Disable Profile Mod
Code: Select all
##############################################################
## MOD Title: Disable Profile
## MOD Author: Fubonis < php@fubonis.com > (JW Frazier) http://www.fubonis.com
## MOD Description: Allows an administrator to disable a user's prpfile. The user cannot update their profile.
## MOD Version: Beta 1.0.2
##
## Installation Level: Moderate
## Installation Time: 10 Minutes
## Files To Edit: admin/admin_users.php, includes/constants.php, includes/usercp_register.php, language/lang_english/lang_admin.php, language/lang_english/lang_main.php, templates/subSilver/admin/user_edit_body.tpl
## Included Files: N/A
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
## You need to run this SQL command. Add your prefix if neccessary.
## ALTER TABLE users ADD user_disabled_profile TINYINT(1) UNSIGNED NOT NULL
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
$user_allowavatar = ( !empty($HTTP_POST_VARS['user_allowavatar']) ) ? intval( $HTTP_POST_VARS['user_allowavatar'] ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_disabled_profile = ( !empty($HTTP_POST_VARS['user_disabled_profile']) ) ? intval( $HTTP_POST_VARS['user_disabled_profile'] ) : 0; // Disable Profile Mod
#
#-----[ FIND ]------------------------------------------
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_disabled_profile = $user_disabled_profile
#
#----[ FIND ]------------------------------------------
#
$user_allowavatar = $this_userdata['user_allowavatar'];
$user_allowpm = $this_userdata['user_allow_pm'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_disabled_profile = $this_userdata['user_disabled_profile'];
#
#----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_status" value="' . $user_status . '" />';
$s_hidden_fields .= '<input type="hidden" name="user_allowpm" value="' . $user_allowpm . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_disabled_profile" value="' . $user_disabled_profile . '" />';
#
#----[ FIND ]------------------------------------------
#
'S_FORM_ENCTYPE' => $form_enctype,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_DISABLE_PROFILE' => $lang['Disable_Profile'], // Disable Profile Mod
'DISABLE_CHECKED_YES' => ($user_disabled_profile) ? 'checked="checked"' : '', // Disable Profile Mod
'DISABLE_CHECKED_NO' => (!$user_disabled_profile) ? 'checked="checked"' : '', // Disable Profile Mod
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#----[ FIND ]------------------------------------------
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('PROFILE_DISABLED', 1); // Disable Profile Mod
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#----[ FIND ]------------------------------------------
#
if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
{
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
show_coppa();
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Disable Profile Mod
if ( $mode == 'editprofile' && $userdata['user_disabled_profile'] == PROFILE_DISABLED )
{
message_die(GENERAL_ERROR, $lang['Profile_Disable_Message']);
}
#
#----[ FIND ]------------------------------------------
#
//
// Did the user submit? In this case build a query to update the users profile in the DB
//
if ( isset($HTTP_POST_VARS['submit']) )
{
include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
$passwd_sql = '';
if ( $mode == 'editprofile' )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Disable Profile Mod
if ( $userdata['user_disabled_profile'] == PROFILE_DISABLED )
{
message_die(GENERAL_ERROR, $lang['Profile_Disable_Message']);
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Disable Profile Mod
$lang['Disable_Profile'] = 'Disable Profile';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Disable Profile Mod
$lang['Profile_Disable_Message'] = 'Your ability to edit your profile has been disabled by the administrator.';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_DELETE_USER}?</span></td>
<td class="row2">
<input type="checkbox" name="deleteuser">
{L_DELETE_USER_EXPLAIN}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_DISABLE_PROFILE}</span></td>
<td class="row2">
<input type="radio" name="user_disabled_profile" value="1" {DISABLE_CHECKED_YES} />
<span class="gen">{L_YES}</span>&&
<input type="radio" name="user_disabled_profile" value="0" {DISABLE_CHECKED_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM