2 require 'include/head.inc';
3 require 'include/common.inc';
5 if(isset($_POST['submit']) && $_POST['password']!="") {
7 $fh_pass = fopen(".htpasswd", 'w');
8 fwrite($fh_pass, "admin:" . crypt($_POST['password'], base64_encode($_POST['password'])) . "\n");
11 $fh_access = fopen(".htaccess", 'w');
12 fwrite($fh_access, "AuthUserFile " . getcwd() . "/.htpasswd\n");
13 fwrite($fh_access, "AuthGroupFile /dev/null\n");
14 fwrite($fh_access, "AuthName \"Banana Admin\"\n");
15 fwrite($fh_access, "AuthType Basic\n");
16 fwrite($fh_access, "require user admin\n");
19 block("lightgreen", "admin password set");
24 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
25 <table bgcolor="black">
26 <tr><th><b><font color="white">set admin password</font></b></th><tr>
31 <th align="left">Password:</th> <th><input type="text" name="password"></th>
35 <th></th><th align="right" columnspan=2><input type="submit" name="submit" value="Set"></th>