Created
July 30, 2012 21:44
-
-
Save anonymous/3210550 to your computer and use it in GitHub Desktop.
Appfog PHPMyadmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$secret = "supersecret"; | |
if(isset($_COOKIE['secret']) && $_COOKIE['secret'] == $secret) | |
{ | |
} | |
else | |
{ | |
if(!isset($_GET['secret'])) | |
{ | |
die('pwd mismatch.1'); | |
} | |
if($_GET['secret'] == $secret) | |
{ | |
setcookie('secret', $secret, 60 * 60 * 24 * 60 + time()); | |
} | |
else | |
{ | |
die('pwd mismatch.2'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* vim: set expandtab sw=4 ts=4 sts=4: */ | |
/** | |
* phpMyAdmin sample configuration, you can use it as base for | |
* manual configuration. For easier setup you can use setup/ | |
* | |
* All directives are explained in Documentation.html and on phpMyAdmin | |
* wiki <http://wiki.phpmyadmin.net>. | |
* | |
* @package PhpMyAdmin | |
*/ | |
/* | |
* This is needed for cookie based authentication to encrypt password in | |
* cookie | |
*/ | |
$cfg['blowfish_secret'] = 'afaff8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ | |
/* | |
* Servers configuration | |
*/ | |
$i = 0; | |
$services_json = json_decode(getenv("VCAP_SERVICES"),true); | |
foreach($services_json["mysql-5.1"] as $E) | |
{ | |
$mysql_config = $E["credentials"]; | |
/* | |
* First server | |
*/ | |
$i++; | |
$g = $i-1; | |
/* Authentication type */ | |
$cfg['Servers'][$i]['auth_type'] = 'config'; | |
/* Server parameters */ | |
$cfg['Servers'][$i]['host'] = $mysql_config["hostname"]; | |
$cfg['Servers'][$i]['connect_type'] = 'tcp'; | |
$cfg['Servers'][$i]['compress'] = false; | |
/* Select mysql if your server does not have mysqli */ | |
$cfg['Servers'][$i]['extension'] = 'mysqli'; | |
$cfg['Servers'][$i]['AllowNoPassword'] = false; | |
$cfg['Servers'][$i]['user'] = $mysql_config["username"]; | |
$cfg['Servers'][$i]['password'] = $mysql_config["password"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment