r718: Refactoring $message->phrase to $message->list
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Jan 2006 04:50:57 +0000 (04:50 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Jan 2006 04:50:57 +0000 (04:50 +0000)
includes/class_message_reporter.php
register.php
userctrl.php

index b54c788b715421ecef72976d5c109b1e7056460d..7698b258b48f9ba103530a8830d5886287d84433 100755 (executable)
@@ -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<ol style=\"list-style-type: decimal\">";
-               foreach ($this->phrase AS $phrase)
+               foreach ($this->list AS $phrase)
                {
                        $this->process .= "\n\t<li>" . $phrase . "</li>";
                }
index d2eea5f70eb5d6bae937e1d47f0018b587b3a009..2c0798ffd50dace602f6f86b961622b8cf590492 100755 (executable)
@@ -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();
index 1f150d9d8c1b03eedc8e9bea0a65cc52039877e5..112e87ad6610b92e70e976e9c18b9ac341dfc5a4 100644 (file)
@@ -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();