From 9a510cabf37eff4b6938a74b20ef4b2b54dfc010 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 17 Oct 2007 10:42:33 +0000 Subject: [PATCH] make use of PMA_Message --- db_operations.php | 12 ++++++------ user_password.php | 22 +++++++++------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/db_operations.php b/db_operations.php index 5eb6f8462..1ca2b299b 100644 --- a/db_operations.php +++ b/db_operations.php @@ -64,7 +64,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { $local_query .= ';'; $sql_query = $local_query; PMA_DBI_query($local_query); - + // rebuild the database list because PMA_Table::moveCopy // checks in this list if the target db exists $GLOBALS['PMA_List_Database']->build(); @@ -398,14 +398,14 @@ if (!$is_information_schema) { if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { + $message = PMA_Message::notice('strRelationNotWorking'); + $message->addParam(''); + $message->addParam(''); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { - echo '

' . $strError . '

'; - } else { - echo '
'; + $message->isError(true); } - printf($strRelationNotWorking, '', ''); - echo '
'; + $message->display(); } // end if } // end if (!$is_information_schema) diff --git a/user_password.php b/user_password.php index addef9294..b144f542a 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 '
' . "\n"; - echo '

' . $GLOBALS['strError'] . '

' . "\n"; - echo PMA_sanitize($strNoRights); - echo '
'; + 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 '

' . $strChangePassword . '

' . "\n\n"; // Displays an error message if required -if (!empty($error_msg)) { - echo '
' . "\n"; - echo '

' . $GLOBALS['strError'] . '

' . "\n"; - echo PMA_sanitize($error_msg); - echo '
'; +if (isset($message)) { + $message->display(); } require_once './libraries/display_change_password.lib.php';