Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Marin <alex.ukf@gmail.com>2012-06-22 12:43:54 +0400
committerAlex Marin <alex.ukf@gmail.com>2012-06-22 12:43:54 +0400
commit0565b0e12aef4456f0172669659d63ebb1659c4f (patch)
treeba0a944e8d001f894d309a2d9b6ab3b0f0140d06 /user_password.php
parent1df5cc8eae24a6f45707fc43939de2ab07ac4063 (diff)
oop: integrate authentication plugins
Diffstat (limited to 'user_password.php')
-rw-r--r--user_password.php27
1 files changed, 21 insertions, 6 deletions
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 '<h1>' . __('Change password') . '</h1>' . "\n\n";
echo PMA_getMessage($message, $sql_query, 'success');
- echo '<a href="index.php'.PMA_generate_common_url($_url_params).' target="_parent">'. "\n"
- .'<strong>'.__('Back').'</strong></a>';
+ echo '<a href="index.php'.PMA_generate_common_url($_url_params)
+ .' target="_parent">'. "\n"
+ .'<strong>'.__('Back').'</strong></a>';
exit;
}
?>