From 4b281481f6cf20c5e1f21c0f1c7313e58386c2e3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 Jan 2006 04:50:57 +0000 Subject: [PATCH] r718: Refactoring $message->phrase to $message->list --- includes/class_message_reporter.php | 8 ++++---- register.php | 18 +++++++++--------- userctrl.php | 18 +++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index b54c788..7698b25 100755 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -28,7 +28,7 @@ class Message_Reporter * Phrase array; null by default * @var array */ - var $phrase = null; + var $list = null; /** * The processed text for a message @@ -46,7 +46,7 @@ class Message_Reporter global $bugsys; global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - if (count($this->phrase) > 0 AND empty($this->process)) + if (count($this->list) > 0 AND empty($this->process)) { trigger_error('Message_Reporter->phrase is an array so please use Message_Reporter::error_list_process() to prepare it', E_USER_ERROR); } @@ -64,13 +64,13 @@ class Message_Reporter */ function error_list_process() { - if (!is_array($this->phrase) OR count($this->phrase) < 1) + if (!is_array($this->list) OR count($this->list) < 1) { return; } $this->process = "\n\n
    "; - foreach ($this->phrase AS $phrase) + foreach ($this->list AS $phrase) { $this->process .= "\n\t
  1. " . $phrase . "
  2. "; } diff --git a/register.php b/register.php index d2eea5f..2c0798f 100755 --- a/register.php +++ b/register.php @@ -59,45 +59,45 @@ if ($_POST['do'] == 'insert') if ($bugsys->in['email'] != $bugsys->in['confirmemail']) { - $message->phrase[] = $lang->string('The emails you entered do not match.'); + $message->list[] = $lang->string('The emails you entered do not match.'); } if (!$bugsys->in['email']) { - $message->phrase[] = $lang->string('The email you specified was blank.'); + $message->list[] = $lang->string('The email you specified was blank.'); } if ($bugsys->in['password'] != $bugsys->in['confirmpassword']) { - $message->phrase[] = $lang->string('The passwords you entered did not match.'); + $message->list[] = $lang->string('The passwords you entered did not match.'); } if (!$bugsys->in['password']) { - $message->phrase[] = $lang->string('The password you specified was blank.'); + $message->list[] = $lang->string('The password you specified was blank.'); } if (!$bugsys->in['displayname']) { - $message->phrase[] = $lang->string('The display name you specified was blank.'); + $message->list[] = $lang->string('The display name you specified was blank.'); } if (!$funct->is_valid_email($bugsys->in['email'])) { - $message->phrase[] = $lang->string('The specified email is invalid.'); + $message->list[] = $lang->string('The specified email is invalid.'); } if (is_array($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $bugsys->in['email'] . "'"))) { - $message->phrase[] = $lang->string('The specified email is already in use.'); + $message->list[] = $lang->string('The specified email is already in use.'); } if (is_array($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . $bugsys->in['displayname'] . "'"))) { - $message->phrase[] = $lang->string('That display name is already in use by another user.'); + $message->list[] = $lang->string('That display name is already in use by another user.'); } - if ($message->phrase) + if ($message->list) { $message->error_list_process(); $message->error(); diff --git a/userctrl.php b/userctrl.php index 1f150d9..112e87a 100644 --- a/userctrl.php +++ b/userctrl.php @@ -43,7 +43,7 @@ if ($_POST['do'] == 'update') $count = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . $bugsys->in['displayname'] . "' AND userid <> " . $bugsys->userinfo['userid']); if ($count) { - $message->phrase[] = $lang->string('That display name is already in use by another user'); + $message->list[] = $lang->string('That display name is already in use by another user'); } // ------------------------------------------------------------------- @@ -52,13 +52,13 @@ if ($_POST['do'] == 'update') { if (empty($bugsys->in['validate'])) { - $message->phrase[] = $lang->string('You need to enter your current password to change your email or password'); + $message->list[] = $lang->string('You need to enter your current password to change your email or password'); } else { if (md5(md5($bugsys->in['validate']) . md5($bugsys->userinfo['salt'])) != $bugsys->userinfo['password']) { - $message->phrase[] = $lang->string('Your authentication password does not match the one in our records'); + $message->list[] = $lang->string('Your authentication password does not match the one in our records'); } } } @@ -69,12 +69,12 @@ if ($_POST['do'] == 'update') { if (!empty($bugsys->in['email']) AND empty($bugsys->in['email_confirm'])) { - $message->phrase[] = $lang->string('You need to enter both the email and confirm email fields to change your address'); + $message->list[] = $lang->string('You need to enter both the email and confirm email fields to change your address'); } if ($bugsys->in['email'] != $bugsys->in['email_confirm']) { - $message->phrase[] = $lang->string('Your email and confirm email addresses do not match'); + $message->list[] = $lang->string('Your email and confirm email addresses do not match'); } if ($bugsys->in['email']) @@ -82,7 +82,7 @@ if ($_POST['do'] == 'update') $count = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $bugsys->in['email'] . "' AND userid <> " . $bugsys->userinfo['userid']); if ($count) { - $message->phrase[] = $lang->string('That email address is already in use'); + $message->list[] = $lang->string('That email address is already in use'); } } @@ -95,13 +95,13 @@ if ($_POST['do'] == 'update') { if (!empty($bugsys->in['password']) AND empty($bugsys->in['password_confirm'])) { - $message->phrase[] = $lang->string('You need to enter both the password and confirm password fields to change your password'); + $message->list[] = $lang->string('You need to enter both the password and confirm password fields to change your password'); } else { if ($bugsys->in['password'] != $bugsys->in['password_confirm']) { - $message->phrase[] = $lang->string('Your password and confirm password do not match'); + $message->list[] = $lang->string('Your password and confirm password do not match'); } } @@ -121,7 +121,7 @@ if ($_POST['do'] == 'update') // ------------------------------------------------------------------- // error handling - if ($message->phrase) + if ($message->list) { $message->error_list_process(); -- 2.43.5