mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
A few changes to the User Admin code (much cleaner) and also this time, I ran fix_files.sh! *cheer* ;)
git-svn-id: file:///svn/phpbb/trunk@990 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9c9c428cd0
commit
ca233d7fa3
3 changed files with 84 additions and 341 deletions
|
@ -99,11 +99,12 @@ if ( isset($HTTP_GET_VARS['submit']) ) {
|
||||||
$user_timezone = $userdata['user_timezone'];
|
$user_timezone = $userdata['user_timezone'];
|
||||||
$user_template = $userdata['user_template'];
|
$user_template = $userdata['user_template'];
|
||||||
$user_dateformat = $userdata['user_dateformat'];
|
$user_dateformat = $userdata['user_dateformat'];
|
||||||
|
$user_status = $userdata['user_active'];
|
||||||
|
$user_allowavatar = $userdata['user_allowavatar'];
|
||||||
|
$user_allowpm = $userdata['user_allow_pm'];
|
||||||
|
|
||||||
if(!isset($coppa))
|
|
||||||
{
|
$COPPA = false;
|
||||||
$coppa = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isset($user_template))
|
if(!isset($user_template))
|
||||||
{
|
{
|
||||||
|
@ -151,14 +152,18 @@ if ( isset($HTTP_GET_VARS['submit']) ) {
|
||||||
"ALWAYS_ALLOW_HTML_NO" => (!$allowhtml) ? "checked=\"checked\"" : "",
|
"ALWAYS_ALLOW_HTML_NO" => (!$allowhtml) ? "checked=\"checked\"" : "",
|
||||||
"ALWAYS_ALLOW_SMILIES_YES" => ($allowsmilies) ? "checked=\"checked\"" : "",
|
"ALWAYS_ALLOW_SMILIES_YES" => ($allowsmilies) ? "checked=\"checked\"" : "",
|
||||||
"ALWAYS_ALLOW_SMILIES_NO" => (!$allowsmilies) ? "checked=\"checked\"" : "",
|
"ALWAYS_ALLOW_SMILIES_NO" => (!$allowsmilies) ? "checked=\"checked\"" : "",
|
||||||
"ALLOW_AVATAR" => $board_config['allow_avatar_upload'],
|
"AVATAR" => ($user_avatar != "") ? "<img src=\"../" . $board_config['avatar_path'] . "/" . stripslashes($user_avatar) . "\" alt=\"\" />" : "",
|
||||||
"AVATAR" => ($user_avatar != "") ? "<img src=\"" . $board_config['avatar_path'] . "/" . stripslashes($user_avatar) . "\" alt=\"\" />" : "",
|
|
||||||
"AVATAR_SIZE" => $board_config['avatar_filesize'],
|
|
||||||
"TIMEZONE_SELECT" => tz_select($user_timezone),
|
"TIMEZONE_SELECT" => tz_select($user_timezone),
|
||||||
"DATE_FORMAT" => stripslashes($user_dateformat),
|
"DATE_FORMAT" => stripslashes($user_dateformat),
|
||||||
"HTML_STATUS" => $html_status,
|
"HTML_STATUS" => $html_status,
|
||||||
"BBCODE_STATUS" => $bbcode_status,
|
"BBCODE_STATUS" => $bbcode_status,
|
||||||
"SMILIES_STATUS" => $smilies_status,
|
"SMILIES_STATUS" => $smilies_status,
|
||||||
|
"ALLOWPM_YES" => ($user_allowpm) ? "checked=\"checked\"" : "",
|
||||||
|
"ALLOWAVATAR_YES" => ($user_allowavatar) ? "checked=\"checked\"" : "",
|
||||||
|
"STATUS_YES" => ($user_status) ? "checked=\"checked\"" : "",
|
||||||
|
"ALLOWPM_NO" => (!$user_allowpm) ? "checked=\"checked\"" : "",
|
||||||
|
"ALLOWAVATAR_NO" => (!$user_allowavatar) ? "checked=\"checked\"" : "",
|
||||||
|
"STATUS_NO" => (!$user_status) ? "checked=\"checked\"" : "",
|
||||||
|
|
||||||
"L_PASSWORD_IF_CHANGED" => $lang['password_if_changed'],
|
"L_PASSWORD_IF_CHANGED" => $lang['password_if_changed'],
|
||||||
"L_PASSWORD_CONFIRM_IF_CHANGED" => $lang['password_confirm_if_changed'],
|
"L_PASSWORD_CONFIRM_IF_CHANGED" => $lang['password_confirm_if_changed'],
|
||||||
|
@ -186,15 +191,14 @@ if ( isset($HTTP_GET_VARS['submit']) ) {
|
||||||
"L_HIDE_USER" => $lang['Hide_user'],
|
"L_HIDE_USER" => $lang['Hide_user'],
|
||||||
"L_ALWAYS_ADD_SIGNATURE" => $lang['Always_add_sig'],
|
"L_ALWAYS_ADD_SIGNATURE" => $lang['Always_add_sig'],
|
||||||
|
|
||||||
|
"L_SPECIAL" => $lang['User_special'],
|
||||||
|
"L_SPECIAL_EXPLAIN" => $lang['User_specail_explain'],
|
||||||
|
"L_STATUS" => $lang['User_status'],
|
||||||
|
"L_ALLOWPM" => $lang['User_allowpm'],
|
||||||
|
"L_ALLOWAVATAR" => $lang['User_allowavatar'],
|
||||||
|
|
||||||
"L_AVATAR_PANEL" => $lang['Avatar_panel'],
|
"L_AVATAR_PANEL" => $lang['Avatar_panel'],
|
||||||
"L_AVATAR_EXPLAIN" => $lang['Avatar_explain'],
|
"L_AVATAR_EXPLAIN" => $lang['Admin_avatar_explain'],
|
||||||
"L_UPLOAD_AVATAR_FILE" => $lang['Upload_Avatar_file'],
|
|
||||||
"L_UPLOAD_AVATAR_URL" => $lang['Upload_Avatar_URL'],
|
|
||||||
"L_UPLOAD_AVATAR_URL_EXPLAIN" => $lang['Upload_Avatar_URL_explain'],
|
|
||||||
"L_AVATAR_GALLERY" => $lang['Select_from_gallery'],
|
|
||||||
"L_SHOW_GALLERY" => $lang['Avatar_gallery'],
|
|
||||||
"L_LINK_REMOTE_AVATAR" => $lang['Link_remote_Avatar'],
|
|
||||||
"L_LINK_REMOTE_AVATAR_EXPLAIN" => $lang['Link_remote_Avatar_explain'],
|
|
||||||
"L_DELETE_AVATAR" => $lang['Delete_Image'],
|
"L_DELETE_AVATAR" => $lang['Delete_Image'],
|
||||||
"L_CURRENT_IMAGE" => $lang['Current_Image'],
|
"L_CURRENT_IMAGE" => $lang['Current_Image'],
|
||||||
|
|
||||||
|
@ -217,36 +221,10 @@ if ( isset($HTTP_GET_VARS['submit']) ) {
|
||||||
"L_DELETE_USER" => $lang['User_delete'],
|
"L_DELETE_USER" => $lang['User_delete'],
|
||||||
"L_DELETE_USER_EXPLAIN" => $lang['User_delete_explain'],
|
"L_DELETE_USER_EXPLAIN" => $lang['User_delete_explain'],
|
||||||
|
|
||||||
"S_ALLOW_AVATAR_UPLOAD" => $board_config['allow_avatar_upload'],
|
|
||||||
"S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'],
|
|
||||||
"S_ALLOW_AVATAR_REMOTE" => $board_config['allow_avatar_remote'],
|
|
||||||
"S_HIDDEN_FIELDS" => $s_hidden_fields,
|
"S_HIDDEN_FIELDS" => $s_hidden_fields,
|
||||||
"S_PROFILE_ACTION" => append_sid("admin_users.$phpEx"))
|
"S_PROFILE_ACTION" => append_sid("admin_users.$phpEx"))
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
// This is another cheat using the block_var capability
|
|
||||||
// of the templates to 'fake' an IF...ELSE...ENDIF solution
|
|
||||||
// it works well :)
|
|
||||||
//
|
|
||||||
if( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] )
|
|
||||||
{
|
|
||||||
$template->assign_block_vars("avatarblock", array() );
|
|
||||||
|
|
||||||
if($board_config['allow_avatar_upload'])
|
|
||||||
{
|
|
||||||
$template->assign_block_vars("avatarblock.avatarupload", array() );
|
|
||||||
}
|
|
||||||
if($board_config['allow_avatar_remote'])
|
|
||||||
{
|
|
||||||
$template->assign_block_vars("avatarblock.avatarremote", array() );
|
|
||||||
}
|
|
||||||
if($board_config['allow_avatar_local'])
|
|
||||||
{
|
|
||||||
$template->assign_block_vars("avatarblock.avatargallery", array() );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
include('page_header_admin.'.$phpEx);
|
include('page_header_admin.'.$phpEx);
|
||||||
$template->pparse("body");
|
$template->pparse("body");
|
||||||
}
|
}
|
||||||
|
@ -298,12 +276,9 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
$user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
|
$user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
|
||||||
$user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
|
$user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
|
||||||
|
|
||||||
$user_avatar_url = (!empty($HTTP_POST_VARS['avatarurl'])) ? $HTTP_POST_VARS['avatarurl'] : "";
|
$user_status = (!empty($HTTP_POST_VARS['user_status'])) ? $HTTP_POST_VARS['user_status'] : 0;
|
||||||
$user_avatar_loc = ($HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : "";
|
$user_allowpm = (!empty($HTTP_POST_VARS['user_allowpm'])) ? $HTTP_POST_VARS['usr_allowpm'] : 0;
|
||||||
$user_avatar_name = (!empty($HTTP_POST_FILES['avatar']['name'])) ? $HTTP_POST_FILES['avatar']['name'] : "";
|
$user_allowavatar = (!empty($HTTP_POST_VARS['usr_allowavatar'])) ? $HTTP_POST_VARS['user_allowavatar'] : 0;
|
||||||
$user_avatar_size = (!empty($HTTP_POST_FILES['avatar']['size'])) ? $HTTP_POST_FILES['avatar']['size'] : 0;
|
|
||||||
$user_avatar_type = (!empty($HTTP_POST_FILES['avatar']['type'])) ? $HTTP_POST_FILES['avatar']['type'] : "";
|
|
||||||
$user_avatar = (empty($user_avatar_loc) && $mode == "editprofile") ? $userdata['user_avatar'] : "";
|
|
||||||
|
|
||||||
if(isset($HTTP_POST_VARS['submit']))
|
if(isset($HTTP_POST_VARS['submit']))
|
||||||
{
|
{
|
||||||
|
@ -311,30 +286,6 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
$passwd_sql = "";
|
$passwd_sql = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Do a ban check on this email address
|
|
||||||
//
|
|
||||||
$sql = "SELECT ban_email
|
|
||||||
FROM " . BANLIST_TABLE;
|
|
||||||
if(!$result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
$ban_email_list = $db->sql_fetchrowset($result);
|
|
||||||
for($i = 0; $i < count($ban_email_list); $i++)
|
|
||||||
{
|
|
||||||
$match_email = str_replace("*@", ".*@", $ban_email_list[$i]['ban_email']);
|
|
||||||
if( preg_match("/^" . $match_email . "$/is", $email) )
|
|
||||||
{
|
|
||||||
$error = TRUE;
|
|
||||||
if(isset($error_msg))
|
|
||||||
{
|
|
||||||
$error_msg .= "<br />";
|
|
||||||
}
|
|
||||||
$error_msg .= $lang['Sorry_banned_email'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!empty($password) && !empty($password_confirm))
|
if(!empty($password) && !empty($password_confirm))
|
||||||
{
|
{
|
||||||
// Awww, the user wants to change their password, isn't that cute..
|
// Awww, the user wants to change their password, isn't that cute..
|
||||||
|
@ -355,8 +306,6 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
$error_msg = $lang['Password_mismatch'];
|
$error_msg = $lang['Password_mismatch'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($board_config['allow_namechange'] || $mode == "register")
|
|
||||||
{
|
|
||||||
if($username != $userdata['username'] || $mode == "register")
|
if($username != $userdata['username'] || $mode == "register")
|
||||||
{
|
{
|
||||||
if(!validate_username($username))
|
if(!validate_username($username))
|
||||||
|
@ -373,22 +322,6 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
$username_sql = "username = '$username', ";
|
$username_sql = "username = '$username', ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if($board_config['allow_avatar_upload'] && !$error)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Only allow one type of upload, either a
|
|
||||||
// filename or a URL
|
|
||||||
//
|
|
||||||
if(!empty($user_avatar_loc) && !empty($user_avatar_url))
|
|
||||||
{
|
|
||||||
$error = TRUE;
|
|
||||||
if(isset($error_msg))
|
|
||||||
{
|
|
||||||
$error_msg .= "<br />";
|
|
||||||
}
|
|
||||||
$error_msg .= $lang['Only_one_avatar'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($HTTP_POST_VARS['avatardel']) && $mode == "editprofile")
|
if(isset($HTTP_POST_VARS['avatardel']) && $mode == "editprofile")
|
||||||
{
|
{
|
||||||
|
@ -398,213 +331,6 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
$avatar_sql = ", user_avatar = ''";
|
$avatar_sql = ", user_avatar = ''";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!empty($user_avatar_loc))
|
|
||||||
{
|
|
||||||
if($board_config['allow_avatar_upload'])
|
|
||||||
{
|
|
||||||
if(file_exists($user_avatar_loc) && ereg(".jpg$|.gif$|.png$", $user_avatar_name))
|
|
||||||
{
|
|
||||||
if($user_avatar_size <= $board_config['avatar_filesize'] && $avatar_size > 0)
|
|
||||||
{
|
|
||||||
$error_type = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Opera appends the image name after the type, not big, not clever!
|
|
||||||
//
|
|
||||||
preg_match("'(image\/[a-z]+)'", $user_avatar_type, $user_avatar_type);
|
|
||||||
$user_avatar_type = $user_avatar_type[1];
|
|
||||||
|
|
||||||
switch($user_avatar_type)
|
|
||||||
{
|
|
||||||
case "image/jpeg":
|
|
||||||
$imgtype = '.jpg';
|
|
||||||
break;
|
|
||||||
case "image/pjpeg":
|
|
||||||
$imgtype = '.jpg';
|
|
||||||
break;
|
|
||||||
case "image/gif":
|
|
||||||
$imgtype = '.gif';
|
|
||||||
break;
|
|
||||||
case "image/png":
|
|
||||||
$imgtype = '.png';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$error)
|
|
||||||
{
|
|
||||||
list($width, $height) = getimagesize($user_avatar_loc);
|
|
||||||
|
|
||||||
if( $width <= $board_config['avatar_max_width'] &&
|
|
||||||
$height <= $board_config['avatar_max_height'] )
|
|
||||||
{
|
|
||||||
$user_id = ($mode == "register") ? $new_user_id : $userdata['user_id'];
|
|
||||||
$avatar_filename = $user_id . $imgtype;
|
|
||||||
if($mode == "editprofile")
|
|
||||||
{
|
|
||||||
if(file_exists("./" . $board_config['avatar_path'] . "/" . $user_id))
|
|
||||||
{
|
|
||||||
@unlink("./" . $board_config['avatar_path'] . "/" . $user_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@copy($user_avatar_loc, "./" . $board_config['avatar_path'] . "/$avatar_filename");
|
|
||||||
$avatar_sql = ", user_avatar = '$avatar_filename'";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_imagesize'] : $lang['Avatar_imagesize'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filesize'] : $lang['Avatar_filesize'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
|
|
||||||
}
|
|
||||||
} // if ... allow_avatar_upload
|
|
||||||
}
|
|
||||||
else if(!empty($user_avatar_url))
|
|
||||||
{
|
|
||||||
if($board_config['allow_avatar_upload'])
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// First check what port we should connect
|
|
||||||
// to, look for a :[xxxx]/ or, if that doesn't
|
|
||||||
// exist assume port 80 (http)
|
|
||||||
//
|
|
||||||
preg_match("/^(http:\/\/)?([^\/]+?)\:?([0-9]*)\/(.*)$/", $user_avatar_url, $url_ary);
|
|
||||||
if(!empty($url_ary[4]))
|
|
||||||
{
|
|
||||||
$port = (!empty($url_ary[3])) ? $url_ary[3] : 80;
|
|
||||||
$fsock = fsockopen($url_ary[2], $port, $errno, $errstr);
|
|
||||||
if($fsock)
|
|
||||||
{
|
|
||||||
$base_get = "/" . $url_ary[4];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Uses HTTP 1.1, could use HTTP 1.0 ...
|
|
||||||
//
|
|
||||||
|
|
||||||
fputs($fsock, "GET $base_get HTTP/1.1\r\n");
|
|
||||||
fputs($fsock, "HOST: " . $url_ary[2] . "\r\n");
|
|
||||||
fputs($fsock, "Connection: close\r\n\r\n");
|
|
||||||
unset($avatar_data);
|
|
||||||
while(!feof($fsock))
|
|
||||||
{
|
|
||||||
$avatar_data .= fread($fsock, $board_config['avatar_filesize']);
|
|
||||||
}
|
|
||||||
fclose($fsock);
|
|
||||||
|
|
||||||
if(preg_match("/Content-Length\: ([0-9]+)[^\/]+Content-Type\: (image\/[a-z]+)[\s]+/i", $avatar_data, $file_data))
|
|
||||||
{
|
|
||||||
$file_size = $file_data[1];
|
|
||||||
$file_type = $file_data[2];
|
|
||||||
|
|
||||||
switch($file_type)
|
|
||||||
{
|
|
||||||
case "image/jpeg":
|
|
||||||
$imgtype = '.jpg';
|
|
||||||
break;
|
|
||||||
case "image/pjpeg":
|
|
||||||
$imgtype = '.jpg';
|
|
||||||
break;
|
|
||||||
case "image/gif":
|
|
||||||
$imgtype = '.gif';
|
|
||||||
break;
|
|
||||||
case "image/png":
|
|
||||||
$imgtype = '.png';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$error && $file_size > 0 && $file_size < $board_config['avatar_filesize'])
|
|
||||||
{
|
|
||||||
$avatar_data = substr($avatar_data, strlen($avatar_data) - $file_size, $file_size);
|
|
||||||
|
|
||||||
$tmp_filename = tempnam ("/tmp", $userdata['user_id'] . "-");
|
|
||||||
$fptr = fopen($tmp_filename, "wb");
|
|
||||||
$bytes_written = fwrite($fptr, $avatar_data, $file_size);
|
|
||||||
fclose($fptr);
|
|
||||||
|
|
||||||
if($bytes_written == $file_size)
|
|
||||||
{
|
|
||||||
list($width, $height) = getimagesize($tmp_filename);
|
|
||||||
|
|
||||||
if( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
|
|
||||||
{
|
|
||||||
$user_id = ($mode == "register") ? $new_user_id : $userdata['user_id'];
|
|
||||||
|
|
||||||
$avatar_filename = $user_id . $imgtype;
|
|
||||||
|
|
||||||
if($mode == "editprofile")
|
|
||||||
{
|
|
||||||
if(file_exists("./" . $board_config['avatar_path'] . "/" . $user_id))
|
|
||||||
{
|
|
||||||
@unlink("./" . $board_config['avatar_path'] . "/" . $user_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
copy($tmp_filename, "./" . $board_config['avatar_path'] . "/$avatar_filename");
|
|
||||||
$avatar_sql = ", user_avatar = '$avatar_filename'";
|
|
||||||
@unlink($tmp_filename);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Image too large
|
|
||||||
//
|
|
||||||
@unlink($tmp_filename);
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_imagesize'] : $lang['Avatar_imagesize'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Error writing file
|
|
||||||
//
|
|
||||||
@unlink($tmp_filename);
|
|
||||||
message_die(GENERAL_ERROR, "Could not write avatar file to local storage. Please contact the board administrator with this message", "", __LINE__, __FILE__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// No data
|
|
||||||
//
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['File_no_data'] : $lang['File_no_data'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// No connection
|
|
||||||
//
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['No_connection_URL'] : $lang['No_connection_URL'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = true;
|
|
||||||
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Incomplete_URL'] : $lang['Incomplete_URL'];
|
|
||||||
}
|
|
||||||
} // if ... allow_avatar_upload
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$error)
|
if(!$error)
|
||||||
|
@ -627,24 +353,17 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
|
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
if( $result = $db->sql_query($sql) )
|
$result = @$db->sql_query($sql)
|
||||||
{
|
include('page_header_admin.'. $phpEx);
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"body" => "admin/admin_message_body.tpl")
|
||||||
|
);
|
||||||
|
|
||||||
include('page_header_admin.'. $phpEx);
|
$template->assign_vars(array(
|
||||||
$template->set_filenames(array(
|
"MESSAGE_TITLE" => $lang['User'] . $lang['User_admin'],
|
||||||
"body" => "admin/admin_message_body.tpl")
|
"MESSAGE_TEXT" => $lang['User_deleted'])
|
||||||
);
|
);
|
||||||
|
$template->pparse("body");
|
||||||
$template->assign_vars(array(
|
|
||||||
"MESSAGE_TITLE" => $lang['User'] . $lang['User_admin'],
|
|
||||||
"MESSAGE_TEXT" => $lang['User_deleted'])
|
|
||||||
);
|
|
||||||
$template->pparse("body");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -663,13 +382,22 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
|
|
||||||
if( $error == TRUE )
|
if( $error == TRUE )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Could not update user table", "", __LINE__, __FILE__, $sql);
|
include('page_header_admin.' . $phpEx);
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"body" => "admin/admin_message_body.tpl")
|
||||||
|
);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"MESSAGE_TITLE" => $lang['User'] . $lang['User_admin'],
|
||||||
|
"MESSAGE_TEXT" => "Could not update user table")
|
||||||
|
);
|
||||||
|
$template->pparse("body");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = "UPDATE " . USERS_TABLE . "
|
$sql = "UPDATE " . USERS_TABLE . "
|
||||||
SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_active = '1', user_actkey = '$user_actkey'" . $avatar_sql . "
|
SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_allow_pm = $user_allowpm user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_active = $user_status, user_actkey = '$user_actkey'" . $avatar_sql . "
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
if($result = $db->sql_query($sql))
|
if($result = $db->sql_query($sql))
|
||||||
{
|
{
|
||||||
|
@ -686,13 +414,31 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id'])
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Could not update users table", "", __LINE__, __FILE__, $sql);
|
include('page_header_admin.' . $phpEx);
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"body" => "admin/admin_message_body.tpl")
|
||||||
|
);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"MESSAGE_TITLE" => $lang['User'] . $lang['User_admin'],
|
||||||
|
"MESSAGE_TEXT" => "Error updating user profile")
|
||||||
|
);
|
||||||
|
$template->pparse("body");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, $error_msg, "", __LINE__, __FILE__, "");
|
include('page_header_admin.' . $phpEx);
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"body" => "admin/admin_message_body.tpl")
|
||||||
|
);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"MESSAGE_TITLE" => $lang['User'] . $lang['User_admin'],
|
||||||
|
"MESSAGE_TEXT" => $error_msg)
|
||||||
|
);
|
||||||
|
$template->pparse("body");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -837,10 +837,16 @@ $lang['Emotion'] = "Emotion";
|
||||||
|
|
||||||
// User Management
|
// User Management
|
||||||
$lang['User_admin'] = "Administration";
|
$lang['User_admin'] = "Administration";
|
||||||
$lang['User_admin_explain'] = "Here you can change your user's information. Do not abuse this power. Changing admin status is not provided here. Use the user permission pages for this. <br />Developer To-Do: <br />Add support to modify \"invisible\" fields.";
|
$lang['User_admin_explain'] = "Here you can change your user's information. Do not abuse this power. Changing admin status is not provided here. Use the user permission pages for this.";
|
||||||
$lang['User_delete'] = "Delete this user";
|
$lang['User_delete'] = "Delete this user";
|
||||||
$lang['User_delete_explain'] = "Click here to delete this user. This cannot be undone.";
|
$lang['User_delete_explain'] = "Click here to delete this user. This cannot be undone.";
|
||||||
$lang['User_deleted'] = "User was successfully deleted.";
|
$lang['User_deleted'] = "User was successfully deleted.";
|
||||||
|
$lang['User_status'] = "User active";
|
||||||
|
$lang['User_allowpm'] = "Allow PM";
|
||||||
|
$lang['User_allowavatar'] = "Allow Avatar";
|
||||||
|
$lang['Admin_avatar_explain'] = "Here you can see and delete the user's current avatar.";
|
||||||
|
$lang['User_special'] = "Special admin-only fields";
|
||||||
|
$lang['User_special_explain'] = "These fields are not able to be modified by the users. Here you can set their status and other options that are not given to users.";
|
||||||
|
|
||||||
// Group Management
|
// Group Management
|
||||||
$lang['Group_admin_explain'] = "Here you can administer all your groups, including deleting, adding, as well as editing groups. You may choose moderators, toggle open/closed group status, and set the name and description.";
|
$lang['Group_admin_explain'] = "Here you can administer all your groups, including deleting, adding, as well as editing groups. You may choose moderators, toggle open/closed group status, and set the name and description.";
|
||||||
|
|
|
@ -105,7 +105,6 @@
|
||||||
<td class="row1"><span class="gen">{L_DATE_FORMAT}:</span><br /><span class="gensmall">{L_DATE_FORMAT_EXPLAIN}</span></td>
|
<td class="row1"><span class="gen">{L_DATE_FORMAT}:</span><br /><span class="gensmall">{L_DATE_FORMAT_EXPLAIN}</span></td>
|
||||||
<td class="row2"><input type="text" name="dateformat" value="{DATE_FORMAT}" maxlength="16" /></td>
|
<td class="row2"><input type="text" name="dateformat" value="{DATE_FORMAT}" maxlength="16" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN avatarblock -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2"><span class="cattitle"><b>{L_AVATAR_PANEL}</b></span></td>
|
<td class="cat" colspan="2"><span class="cattitle"><b>{L_AVATAR_PANEL}</b></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -117,29 +116,26 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN avatarupload -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><span class="gen">{L_UPLOAD_AVATAR_FILE}:</span></td>
|
<td class="cat" colspan="2"><span class="cattitle"><B>{L_SPECIAL}</b></span></td>
|
||||||
<td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input type="file" name="avatar" /></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><span class="gen">{L_UPLOAD_AVATAR_URL}:</span><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
|
<td class="row1" colspan="2" align="center">
|
||||||
<td class="row2"><input type="text" name="avatarurl" size="40" /></td>
|
<span class="gensmall">{L_SPECIAL_EXPLAIN}</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END avatarupload -->
|
|
||||||
<!-- BEGIN avatarremote -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><span class="gen">{L_LINK_REMOTE_AVATAR}:</span><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
|
<td class="row1"><span class="gen">{L_STATUS}:</span></td>
|
||||||
<td class="row2"><input type="text" name="avatarremoteurl" size="40" /></td>
|
<td class="row2"><input type="radio" name="user_status" value="1" {STATUS_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="user_status" value="0" {STSTUS_NO} /> <span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END avatarremote -->
|
|
||||||
<!-- BEGIN avatargallery -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><span class="gen">{L_AVATAR_GALLERY}:</span></td>
|
<td class="row1"><span class="gen">{L_ALLOWPM}:</span></td>
|
||||||
<td class="row2"><input type="submit" name="avatargallery" value="{L_SHOW_GALLERY}" /></td>
|
<td class="row2"><input type="radio" name="user_allowpm" value="1" {ALLOWPM_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="user_allowpm" value="0" {ALLOWPM_NO} /> <span class="gen">{L_NO}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><span class="gen">{L_ALLOWAVATAR}:</span></td>
|
||||||
|
<td class="row2"><input type="radio" name="user_allowavatar" value="1" {ALLOWAVATAR_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="user_allowavatar" value="0" {ALLOWAVATAR_NO} /> <span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END avatargallery -->
|
|
||||||
<!-- END avatarblock -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><span class="gen">{L_DELETE_USER}?</span></td>
|
<td class="row1"><span class="gen">{L_DELETE_USER}?</span></td>
|
||||||
<td class="row2"><input type="checkbox" name="deleteuser">{L_DELETE_USER_EXPLAIN}</td>
|
<td class="row2"><input type="checkbox" name="deleteuser">{L_DELETE_USER_EXPLAIN}</td>
|
||||||
|
@ -150,8 +146,3 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
<!-- IF $S_ALLOW_AVATAR_UPLOAD eq TRUE || $S_ALLOW_AVATAR_LOCAL eq TRUE || $S_ALLOW_AVATAR_REMOTE eq TRUE -->
|
|
||||||
<!-- IF $S_ALLOW_AVATAR_LOCAL eq TRUE -->
|
|
||||||
<!-- IF $S_ALLOW_AVATAR_REMOTE eq TRUE -->
|
|
||||||
<!-- IF $S_ALLOW_AVATAR_UPLOAD eq TRUE -->
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue