mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Updates mainly for removal of extension + header comment ... moved some aspects of ucp around, further work to be done on these areas ... not commiting search for time being
git-svn-id: file:///svn/phpbb/trunk@4473 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : ucp_main.php
|
||||
// STARTED : Sat Feb 21, 2003
|
||||
// COPYRIGHT : <20> 2003 phpBB Group
|
||||
// STARTED : Mon May 19, 2003
|
||||
// COPYRIGHT : <20> 2001, 2003 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
|
@@ -43,23 +43,23 @@ class ucp_prefs extends ucp
|
||||
{
|
||||
$data = array();
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'dateformat'=> '3,15',
|
||||
'lang' => '2,5',
|
||||
),
|
||||
'int' => array('dst', 'style'),
|
||||
'float' => array('tz'),
|
||||
'bool' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm')
|
||||
'i' => array('dst', 'style'),
|
||||
'f' => array('tz'),
|
||||
'b' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm')
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
$validate = array(
|
||||
'reqd' => array('lang', 'tz', 'dateformat', 'style'),
|
||||
'match' => array(
|
||||
'r' => array('lang', 'tz', 'dateformat', 'style'),
|
||||
'm' => array(
|
||||
'lang' => ($data['lang']) ? '#^[a-z_]+$#i' : '',
|
||||
),
|
||||
);
|
||||
$this->validate_data($data, $validate);
|
||||
validate_data($data, $validate);
|
||||
|
||||
if (!sizeof($this->error))
|
||||
{
|
||||
@@ -147,14 +147,14 @@ class ucp_prefs extends ucp
|
||||
{
|
||||
$data = array();
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'sk' => '1,1',
|
||||
'sd' => '1,1',
|
||||
),
|
||||
'int' => array('st', 'minkarma'),
|
||||
'bool' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'),
|
||||
'i' => array('st', 'minkarma'),
|
||||
'b' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'),
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
if (!sizeof($this->error))
|
||||
{
|
||||
@@ -257,9 +257,9 @@ class ucp_prefs extends ucp
|
||||
{
|
||||
$data = array();
|
||||
$normalise = array(
|
||||
'bool' => array('bbcode', 'html', 'smilies', 'sig', 'notify'),
|
||||
'b' => array('bbcode', 'html', 'smilies', 'sig', 'notify'),
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
if (!sizeof($this->error))
|
||||
{
|
||||
|
@@ -37,11 +37,12 @@ class ucp_profile extends ucp
|
||||
{
|
||||
case 'reg_details':
|
||||
|
||||
if (isset($_POST['submit']))
|
||||
if ($submit)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'],
|
||||
'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
|
||||
'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
|
||||
@@ -50,27 +51,29 @@ class ucp_profile extends ucp
|
||||
'email_confirm' => '7,60',
|
||||
)
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
// md5 current password for checking
|
||||
$data['cur_password'] = md5($data['cur_password']);
|
||||
|
||||
$validate = array(
|
||||
'reqd' => array('username', 'email'),
|
||||
'compare' => array(
|
||||
'r' => array('username', 'email'),
|
||||
'c' => array(
|
||||
'password_confirm' => ($data['new_password']) ? $data['new_password'] : '',
|
||||
'cur_password' => ($data['new_password'] || $data['email'] != $user->data['user_email'] || $data['username'] != $user->data['username']) ? $user->data['user_password'] : '',
|
||||
'email_confirm' => ($data['email'] != $user->data['user_email']) ? $data['email'] : '',
|
||||
),
|
||||
'match' => array(
|
||||
'm' => array(
|
||||
'username' => ($data['username'] != $user->data['username']) ? '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu' : '',
|
||||
),
|
||||
'function' => array(
|
||||
'f' => array(
|
||||
'username' => ($data['username'] != $user->data['username']) ? 'validate_username' : '',
|
||||
'email' => ($data['email'] != $user->data['user_email']) ? 'validate_email' : '',
|
||||
),
|
||||
);
|
||||
$this->validate_data($data, $validate);
|
||||
validate_data($data, $validate);
|
||||
|
||||
|
||||
|
||||
if (!sizeof($this->error))
|
||||
{
|
||||
@@ -128,7 +131,7 @@ class ucp_profile extends ucp
|
||||
{
|
||||
$data = array();
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'icq' => '3,15',
|
||||
'aim' => '5,255',
|
||||
'msn' => '5,255',
|
||||
@@ -139,17 +142,17 @@ class ucp_profile extends ucp
|
||||
'occupation'=> '2,500',
|
||||
'interests' => '2,500',
|
||||
),
|
||||
'int' => array('bday_day', 'bday_month', 'bday_year')
|
||||
'i' => array('bday_day', 'bday_month', 'bday_year')
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
$validate = array(
|
||||
'match' => array(
|
||||
'm' => array(
|
||||
'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '',
|
||||
'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i' : '',
|
||||
),
|
||||
);
|
||||
$this->validate_data($data, $validate);
|
||||
validate_data($data, $validate);
|
||||
|
||||
if (!sizeof($this->error))
|
||||
{
|
||||
@@ -261,7 +264,7 @@ class ucp_profile extends ucp
|
||||
$message_parser = new parse_message();
|
||||
$message_parser->message = $signature;
|
||||
$message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies);
|
||||
echo ">>" . $signature = $message_parser->message;
|
||||
$signature = $message_parser->message;
|
||||
|
||||
$sql_ary = array(
|
||||
'user_sig' => $signature,
|
||||
@@ -269,7 +272,7 @@ class ucp_profile extends ucp
|
||||
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
|
||||
);
|
||||
|
||||
echo $sql = 'UPDATE ' . USERS_TABLE . '
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
@@ -356,24 +359,24 @@ class ucp_profile extends ucp
|
||||
else if (!empty($_POST['uploadurl']) && $can_upload)
|
||||
{
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'uploadurl' => '1,255',
|
||||
)
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
$this->error = avatar_upload($data);
|
||||
}
|
||||
else if (!empty($_POST['remotelink']) && $auth->acl_get('u_chgavatar') && $config['allow_avatar_remote'])
|
||||
{
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'remotelink' => '1,255',
|
||||
'width' => '1,3',
|
||||
'height' => '1,3',
|
||||
)
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
$this->error = avatar_remote($data);
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ class ucp_register extends ucp
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$normalise = array(
|
||||
'string' => array(
|
||||
's' => array(
|
||||
'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'],
|
||||
'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
|
||||
'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
|
||||
@@ -81,25 +81,25 @@ class ucp_register extends ucp
|
||||
'email' => '7,60',
|
||||
'email_confirm' => '7,60',
|
||||
),
|
||||
'float' => array('tz')
|
||||
'f' => array('tz')
|
||||
);
|
||||
$data = $this->normalise_data($_POST, $normalise);
|
||||
$data = normalise_data($_POST, $normalise);
|
||||
|
||||
$validate = array(
|
||||
'reqd' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'),
|
||||
'compare' => array(
|
||||
'r' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'),
|
||||
'c' => array(
|
||||
'password_confirm' => $data['new_password'],
|
||||
'email_confirm' => $data['email'],
|
||||
),
|
||||
'match' => array(
|
||||
'm' => array(
|
||||
'username' => '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu',
|
||||
),
|
||||
'function' => array(
|
||||
'f' => array(
|
||||
'username' => 'validate_username',
|
||||
'email' => 'validate_email',
|
||||
),
|
||||
);
|
||||
$this->validate_data($data, $validate);
|
||||
validate_data($data, $validate);
|
||||
|
||||
// Visual Confirmation handling
|
||||
if ($config['enable_confirm'])
|
||||
|
Reference in New Issue
Block a user