From d0d236fd6219bbfac03fab208010c23e839eeef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 2 Mar 2011 11:44:57 +0100 Subject: [PATCH] rfe #2936155 [auth] Allow to pass additional parameters using signon method. --- ChangeLog | 1 + libraries/auth/signon.auth.lib.php | 10 ++++++++++ scripts/signon.php | 2 ++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 95032049c..e0e68664a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -141,6 +141,7 @@ - patch #3176420 [Search] Ajaxify browse and delete criteria in DB Search, thanks to Thilanka Kaushalya - [interface] New default theme pmahomme, dropped darkblue_orange theme. +- rfe #2936155 [auth] Allow to pass additional parameters using signon method. 3.3.10.0 (not yet released) - patch #3147400 [structure] Aria table size printed as unknown, diff --git a/libraries/auth/signon.auth.lib.php b/libraries/auth/signon.auth.lib.php index 8480c46d0..6eb0ead93 100644 --- a/libraries/auth/signon.auth.lib.php +++ b/libraries/auth/signon.auth.lib.php @@ -63,6 +63,9 @@ function PMA_auth_check() /* Current port */ $single_signon_port = $GLOBALS['cfg']['Server']['port']; + /* No configuration updates */ + $single_signon_cfgupdate = array(); + /* Are we requested to do logout? */ $do_logout = !empty($_REQUEST['old_usr']); @@ -104,6 +107,10 @@ function PMA_auth_check() $single_signon_port = $_SESSION['PMA_single_signon_port']; } + if (isset($_SESSION['PMA_single_signon_cfgupdate'])) { + $single_signon_cfgupdate = $_SESSION['PMA_single_signon_cfgupdate']; + } + /* Also get token as it is needed to access subpages */ if (isset($_SESSION['PMA_single_signon_token'])) { @@ -127,6 +134,9 @@ function PMA_auth_check() /* Set the single signon port */ $GLOBALS['cfg']['Server']['port'] = $single_signon_port; + /* Configuration update */ + $GLOBALS['cfg']['Server'] = array_merge($GLOBALS['cfg']['Server'], $single_signon_cfgupdate); + /* Restore our token */ if (!empty($pma_token)) { $_SESSION[' PMA_token '] = $pma_token; diff --git a/scripts/signon.php b/scripts/signon.php index d2aac588a..ca50877b1 100644 --- a/scripts/signon.php +++ b/scripts/signon.php @@ -24,6 +24,8 @@ if (isset($_POST['user'])) { $_SESSION['PMA_single_signon_password'] = $_POST['password']; $_SESSION['PMA_single_signon_host'] = $_POST['host']; $_SESSION['PMA_single_signon_port'] = $_POST['port']; + /* Update another field of server configuration */ + $_SESSION['PMA_single_signon_cfgupdate'] = array('verbose' => 'Signon test'); $id = session_id(); /* Close that session */ session_write_close();