Skip to content

Commit 94635f1

Browse files
committed
add default auth
1 parent c27df86 commit 94635f1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ phpwpinfo
44
phpwpinfo provides an equivalent to the phpinfo() function that reports WordPress Requirements information about the PHP/MySQL/Apache environment, and offers suggestions for improvement.
55

66
This tool allows you to quickly test environment server where you want to install WordPress.
7+
The default credentials for display the result are :
8+
9+
Login : wordpress
10+
Password : wordpress
11+
12+
This script can, if your server allow it, delete itself.
713

814
It tests various elements such as :
915

phpwpinfo.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
define('LOGIN', 'wordpress');
20+
define('PASSWORD', 'wordpress');
21+
22+
if( !isset($_SERVER['PHP_AUTH_USER']) || ($_SERVER['PHP_AUTH_PW'] != PASSWORD || $_SERVER['PHP_AUTH_USER'] != LOGIN) ) {
23+
header('WWW-Authenticate: Basic realm="Authentification"');
24+
header('HTTP/1.0 401 Unauthorized');
25+
echo 'Authentification failed';
26+
exit();
27+
}
28+
1929
function phpwpinfo( ) {
2030
$info = new PHP_WP_Info( );
2131
$info->init_all_tests( );

0 commit comments

Comments
 (0)