aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-09-07 13:46:51 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-09-07 13:46:51 +0000
commit8ac06a256b841d2249264ce9ac67885b9849d80f (patch)
treebaf91a347bdc40ac8334a2a84c1703895c7704a3 /phpBB/includes/ucp
parente1ba6d3c5247debfd65011117059ac38202ba4fe (diff)
downloadforums-8ac06a256b841d2249264ce9ac67885b9849d80f.tar
forums-8ac06a256b841d2249264ce9ac67885b9849d80f.tar.gz
forums-8ac06a256b841d2249264ce9ac67885b9849d80f.tar.bz2
forums-8ac06a256b841d2249264ce9ac67885b9849d80f.tar.xz
forums-8ac06a256b841d2249264ce9ac67885b9849d80f.zip
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
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_main.php4
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php28
-rw-r--r--phpBB/includes/ucp/ucp_profile.php43
-rw-r--r--phpBB/includes/ucp/ucp_register.php16
4 files changed, 47 insertions, 44 deletions
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 30dd590f9f..ddf5b907b9 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -4,8 +4,8 @@
// $Id$
//
// FILENAME : ucp_main.php
-// STARTED : Sat Feb 21, 2003
-// COPYRIGHT : © 2003 phpBB Group
+// STARTED : Mon May 19, 2003
+// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index c6e2e52328..78fc12c06e 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -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))
{
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 21d18ae338..8db52ed593 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -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);
}
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 5ed69cf542..de1d619117 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -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'])