diff options
author | Sebastian Mendel <cybot_tm@users.sourceforge.net> | 2007-10-17 14:42:33 +0400 |
---|---|---|
committer | Sebastian Mendel <cybot_tm@users.sourceforge.net> | 2007-10-17 14:42:33 +0400 |
commit | 9a510cabf37eff4b6938a74b20ef4b2b54dfc010 (patch) | |
tree | dad1ed70a972865ba2c55e892465ef53abb3d7dd /user_password.php | |
parent | 1454a3e5991a58f1a6b1aa2375c2f493df7ff861 (diff) |
make use of PMA_Message
Diffstat (limited to 'user_password.php')
-rw-r--r-- | user_password.php | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/user_password.php b/user_password.php index addef92945..b144f542a0 100644 --- a/user_password.php +++ b/user_password.php @@ -49,10 +49,7 @@ if (!$cfg['ShowChgPassword']) { } if ($cfg['Server']['auth_type'] == 'config' || !$cfg['ShowChgPassword']) { require_once './libraries/header.inc.php'; - echo '<div class="error">' . "\n"; - echo '<h1>' . $GLOBALS['strError'] . '</h1>' . "\n"; - echo PMA_sanitize($strNoRights); - echo '</div>'; + PMA_Message::error('strNoRights')->display(); require_once './libraries/footer.inc.php'; } // end if @@ -63,19 +60,21 @@ if ($cfg['Server']['auth_type'] == 'config' || !$cfg['ShowChgPassword']) { */ if (isset($_REQUEST['nopass'])) { // similar logic in server_privileges.php - $error_msg = ''; + $_error = false; if ($_REQUEST['nopass'] == '1') { $password = ''; } elseif (empty($_REQUEST['pma_pw']) || empty($_REQUEST['pma_pw2'])) { - $error_msg = $strPasswordEmpty; + $message = PMA_Message::error('strPasswordEmpty'); + $_error = true; } elseif ($_REQUEST['pma_pw'] != $_REQUEST['pma_pw2']) { - $error_msg = $strPasswordNotSame; + $message = PMA_Message::error('strPasswordNotSame'); + $_error = true; } else { $password = $_REQUEST['pma_pw']; } - if (empty($error_msg)) { + if (! $_error) { // Defines the url to return to in case of error in the sql statement $_url_params = array(); @@ -128,11 +127,8 @@ require_once './libraries/header.inc.php'; echo '<h1>' . $strChangePassword . '</h1>' . "\n\n"; // Displays an error message if required -if (!empty($error_msg)) { - echo '<div class="error">' . "\n"; - echo '<h1>' . $GLOBALS['strError'] . '</h1>' . "\n"; - echo PMA_sanitize($error_msg); - echo '</div>'; +if (isset($message)) { + $message->display(); } require_once './libraries/display_change_password.lib.php'; |