Browse Source

admin: make mkpassword.php easier for noob

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1375 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
tags/3.1.0-rc1
Xuefer 7 years ago
parent
commit
03f13d37cf
3 changed files with 25 additions and 9 deletions
  1. +2
    -0
      ChangeLog
  2. +20
    -6
      htdocs/cacher/mkpassword.php
  3. +3
    -3
      xcache.ini

+ 2
- 0
ChangeLog View File

@@ -9,6 +9,8 @@ ChangeLog
* disassembler:
* fixed crash with nested sandbox
* improved support for PHP_4 ~ PHP_5_4, adds support for PHP_5_5
* admin
* make mkpassword.php easier for noob

3.0.4 2013-09-??
ChangeLog


+ 20
- 6
htdocs/cacher/mkpassword.php View File

@@ -1,23 +1,37 @@
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
?>
<html>
<head>
<title>Simple MD5 password generator</title>
<style stype="text/css">
code pre { display: block; border: 1px dashed black; padding: 10px; }
</style>
</head>
<body>
<h1>Simple MD5 password generator</h1>
<form method="post">
<fieldset>
md5: <input type="password" name="password"> <input type="submit"><br>
<div>
<?php
Name:<br />
<input type="text" name="username"><br />
Password:<br />
<input type="password" name="password"><br />
<input type="submit"><br />
The INI settings you need is:
<code>
<pre><?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$md5 = md5(@ $_POST['password']);
$offs = mt_rand(0 + 1, 31 - 1);
$md5_1 = substr($md5, 0, $offs);
$md5_2 = substr($md5, $offs);
echo "Result: <span>$md5_1</span><span>$md5_2</span>";
$username = htmlspecialchars($_POST['username']);
echo "xcache.admin.user=\"$username\"\n";
echo "xcache.admin.pass=\"<span>$md5_1</span><span>$md5_2</span>\"\n";
}
?>
</div>
?></pre>
</code>
</fieldset>
</form>
</body>


+ 3
- 3
xcache.ini View File

@@ -7,10 +7,10 @@ extension = xcache.so

[xcache.admin]
xcache.admin.enable_auth = On

; use http://xcache.lighttpd.net/demo/cacher/mkpassword.php to generate your encrypted password
xcache.admin.user = "mOo"
; set xcache.admin.pass = md5($your_password)
; login use $your_password
xcache.admin.pass = ""
xcache.admin.pass = "md5 encrypted password"

[xcache]
; ini only settings, all the values here is default unless explained


Loading…
Cancel
Save