Custom port for PMA_single_signon

View: New views
3 Messages — Rating Filter:   Alert me  

Custom port for PMA_single_signon

by Gary Smith-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

We have a situation where we have mysql running on different non-stantard ports on some servers.  When we implemented the single signon script, it worked just fine for all of the servers that used the same port.  Looking into the single signon information, I found nothing regarding port, just host.

So, I just into the code to find out where host is being set and just hand jammed a quick patch to also use port.  

1) my obsveration is that port is not currently support for PMA_single_signon.  Can you confirm

2) is there a simple way of doing this instead of hand jamming the code?

Anyway, I have included my patch with what I did to make it work.  Maybe this is something you might want to include in the main code.  I'm sure someone else might have a use for it.

diff -urN html.20091008/libraries/auth/signon.auth.lib.php html/libraries/auth/signon.auth.lib.php
--- html.20091008/libraries/auth/signon.auth.lib.php    2009-06-30 06:55:45.000000000 -0400
+++ html/libraries/auth/signon.auth.lib.php     2009-10-08 18:48:43.000000000 -0400
@@ -61,6 +61,9 @@
     /* Current host */
     $single_signon_host = $GLOBALS['cfg']['Server']['host'];
 
+    /* Current port */
+    $single_signon_port = $GLOBALS['cfg']['Server']['port'];
+
     /* Are we requested to do logout? */
     $do_logout = !empty($_REQUEST['old_usr']);
 
@@ -94,6 +97,12 @@
         if (isset($_SESSION['PMA_single_signon_host'])) {
                $single_signon_host = $_SESSION['PMA_single_signon_host'];
         }
+
+       if (isset($_SESSION['PMA_single_signon_port'])) {
+                $single_signon_port = $_SESSION['PMA_single_signon_port'];
+        }
+
+
         /* Also get token as it is needed to access subpages */
         if (isset($_SESSION['PMA_single_signon_token'])) {
             /* No need to care about token on logout */
@@ -113,6 +122,8 @@
         /* Set the single signon host */
         $GLOBALS['cfg']['Server']['host']=$single_signon_host;
 
+       /* Set the single signon port */
+       $GLOBALS['cfg']['Server']['port'] = $single_signon_port;
         /* Restore our token */
         if (!empty($pma_token)) {
             $_SESSION[' PMA_token '] = $pma_token;

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Phpmyadmin-users mailing list
Phpmyadmin-users@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-users

Re: Custom port for PMA_single_signon

by Marc Delisle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gary Smith a écrit :
> Hello,
>
> We have a situation where we have mysql running on different non-stantard ports on some servers.  When we implemented the single signon script, it worked just fine for all of the servers that used the same port.  Looking into the single signon information, I found nothing regarding port, just host.
>
> So, I just into the code to find out where host is being set and just hand jammed a quick patch to also use port.  
>
> 1) my obsveration is that port is not currently support for PMA_single_signon.  Can you confirm

Yes I can ;)
>
> 2) is there a simple way of doing this instead of hand jamming the code?

Your patch looks great, I'll merge it for version 3.3; I'll also update
scripts/signon.php and the doc if appropriate.

thanks!
>
> Anyway, I have included my patch with what I did to make it work.  Maybe this is something you might want to include in the main code.  I'm sure someone else might have a use for it.


--
Marc Delisle
http://infomarc.info

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Phpmyadmin-users mailing list
Phpmyadmin-users@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-users

Re: Custom port for PMA_single_signon

by Gary Smith-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Your patch looks great, I'll merge it for version 3.3; I'll also update
> scripts/signon.php and the doc if appropriate.
>
> thanks!
> >

You're welcome.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Phpmyadmin-users mailing list
Phpmyadmin-users@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-users