Author Topic: [module] PhpMyAdmin auto login  (Read 5108 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
[module] PhpMyAdmin auto login
« on: May 18, 2015, 02:53:40 PM »
This helps you to login directly to phpMyAdmin with one click
Note: You might also be interested on: http://forum.centos-webpanel.com/new-modules/%28module%29-favorites-top-bar/msg2604/#msg2604

Please give a support message if you use this module :)



Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
Quote
<li><a href="index.php?module=phpMyAdmin_autologin" target="_blank"><span class="icon16 icomoon-icon-arrow-right-3"></span>PhpMyAdmin auto login</a></li>


Then create a new file called "phpMyAdmin_autologin.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:

Quote
<h3>Redirecting to phpMyAdmin...</h3>
This might take a few seconds.<br>
Click <a href="#" onclick="location.reload();">here</a> to try again.

<form method="post" id="phpMyAdmin_Form" action="http://<?php echo $_SERVER["SERVER_NAME"];?>/phpMyAdmin/" name="login_form" style="display:none">
<input type="text" name="pma_username" id="input_username" value="root" size="24" class="textfield"/>
<input type="password" name="pma_password" id="input_password" value="<?php echo $db_pass ?>" size="24" class="textfield" />
<input type="hidden" name="server" value="1" />

<input value="Exec" type="submit" id="input_go" />
<input type="hidden" name="target" value="index.php" />
</form>

<script>
$('#phpMyAdmin_Form').submit();
</script>

If you want to avoid that "unsecured access" message that pops up on your browser, just activate SSL on your phpmyadmin and also change the "action" in the form and you are ready to go :)
« Last Edit: May 18, 2015, 02:57:42 PM by pedromidiasf »

Offline
*
Re: [module] PhpMyAdmin auto login
« Reply #1 on: January 08, 2019, 01:52:41 PM »
This does not seem to work with pma 4.8.3 it just displays the login page and does nothing.

Offline
***
Re: [module] PhpMyAdmin auto login
« Reply #2 on: January 14, 2019, 11:13:33 PM »
@ekgrad
Replace:
Code: [Select]
action="http://<?php echo $_SERVER["SERVER_NAME"];?>/phpMyAdmin/"with:
Code: [Select]
action="/pma/"

Offline
***
Re: [module] PhpMyAdmin auto login
« Reply #3 on: January 15, 2019, 02:16:06 AM »
Its a great feature and This should be added to CWP by default.

Offline
*
Re: [module] PhpMyAdmin auto login
« Reply #4 on: January 23, 2019, 11:12:24 AM »
The default login form has a hidden field

<input type="hidden" name="token" value="&amp;|)3qM3+5GUlsEqN">

where the value of token keeps on changing with every refresh of the page. Without this the auto login does not seem to work.

Offline
***
Re: [module] PhpMyAdmin auto login
« Reply #5 on: January 25, 2019, 12:12:46 AM »
This works fine for me, I only had to replace that form action url to fix broken link cos cwp got new url format.
That hidden field is useless, you'll get that token anyway later once you login. Adblockers can be reason why it don't work...adblockers are known to corrupt js libraries like jquery. Try in the new browser.

Offline
*
Re: [module] PhpMyAdmin auto login
« Reply #6 on: January 25, 2019, 08:51:12 AM »
I have tried it without adblock but still all i get is the phpMyAdmin login page.

Offline
***
Re: [module] PhpMyAdmin auto login
« Reply #7 on: January 25, 2019, 12:03:28 PM »
Ok, 4.8.4. doesn't work for me anymore. Seems there are some session thing changes in pma. If I find the solution it'll be posted here.