From 0565b0e12aef4456f0172669659d63ebb1659c4f Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Fri, 22 Jun 2012 11:43:54 +0300 Subject: oop: integrate authentication plugins --- user_password.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'user_password.php') diff --git a/user_password.php b/user_password.php index 69086d7e5b..1dc9145a07 100644 --- a/user_password.php +++ b/user_password.php @@ -25,7 +25,9 @@ if (! $cfg['ShowChgPassword']) { $cfg['ShowChgPassword'] = PMA_DBI_select_db('mysql'); } if ($cfg['Server']['auth_type'] == 'config' || ! $cfg['ShowChgPassword']) { - PMA_Message::error(__('You don\'t have sufficient privileges to be here right now!'))->display(); + PMA_Message::error( + __('You don\'t have sufficient privileges to be here right now!') + )->display(); exit; } // end if @@ -164,7 +166,9 @@ function PMA_changePassHashingFunction() function PMA_ChangePassUrlParamsAndSubmitQuery($password, $_url_params, $sql_query, $hashing_function) { $err_url = 'user_password.php' . PMA_generate_common_url($_url_params); - $local_query = 'SET password = ' . (($password == '') ? '\'\'' : $hashing_function . '(\'' . PMA_sqlAddSlashes($password) . '\')'); + $local_query = 'SET password = ' . (($password == '') + ? '\'\'' + : $hashing_function . '(\'' . PMA_sqlAddSlashes($password) . '\')'); $result = @PMA_DBI_try_query($local_query) or PMA_mysqlDie(PMA_DBI_getError(), $sql_query, false, $err_url); } @@ -181,12 +185,22 @@ function PMA_changePassAuthType($_url_params, $password) { /** * Changes password cookie if required - * Duration = till the browser is closed for password (we don't want this to be saved) + * Duration = till the browser is closed for password + * (we don't want this to be saved) */ + + // include_once "libraries/plugins/auth/AuthenticationCookie.class.php"; + // $auth_plugin = new AuthenticationCookie(); + // the $auth_plugin is already defined in common.lib.php when this is used + global $auth_plugin; + if ($GLOBALS['cfg']['Server']['auth_type'] == 'cookie') { $GLOBALS['PMA_Config']->setCookie( 'pmaPass-' . $GLOBALS['server'], - PMA_blowfish_encrypt($password, $GLOBALS['cfg']['blowfish_secret']) + $auth_plugin->blowfishEncrypt( + $password, + $GLOBALS['cfg']['blowfish_secret'] + ) ); } /** @@ -212,8 +226,9 @@ function PMA_changePassDisplayPage($message, $sql_query, $_url_params) { echo '

' . __('Change password') . '

' . "\n\n"; echo PMA_getMessage($message, $sql_query, 'success'); - echo ''. "\n" - .''.__('Back').''; + echo ''. "\n" + .''.__('Back').''; exit; } ?> -- cgit v1.2.3