Author Topic: [module] PhpMyAdmin auto login  (Read 2378 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 »