Added user $username."; $username = ''; $pass = ''; $pass2 = ''; $action = ''; } } elseif($action == 'delete') { if($username != '') { unset($users["$username"]); write_htpasswd_file($pw_files[$pw_file_num], $users); echo "Deleted user $username."; $username = ''; $action = ''; } } ?> <?= $title ?>

1) { ?>

Working on file: ""

Please choose a password file to work on from the list below:

$pass) { echo "$user / $pass
"; } */ if($err_msgs) { echo "ERROR: There was a problem while processing your request:
"; foreach ($err_msgs as $error) { echo "   * $error
"; } echo "
"; } ?> 1) { ?>
Password file:

Add new user or change user password:

Username:
Password:
Confirm Password:

Delete User:

Username:
$pass) { fputs($pw_handle, "$user:$pass\n"); } flock($pw_handle, LOCK_UN); } else { $err_msgs[] = "Can't lock $file_name, aborting write."; } } fclose($pw_handle); } function read_htpasswd_file($file_name) { global $err_msgs; $pw_handle = fopen($file_name, "r"); if ($pw_handle && flock($pw_handle, LOCK_SH)) { while (!feof($pw_handle)) { $line = fgets($pw_handle, 4096); $line = rtrim($line); if((! $line) || preg_match('/^#/', $line)) { continue; } list($user, $pass) = explode(":", $line); $users["$user"] = $pass; } flock($pw_handle, LOCK_UN); fclose($pw_handle); } else { $err_msgs[] = "Can't lock $file_name for reading, something is wrong."; } return $users; } function str_match($str, $match) { $return = ''; if(eregi('(.*)', $match, $class)) { $match = '['.$regs[1].']'; for($i = 0; $i < strlen($str); $i++) if(ereg('[' . $class[1] . ']', $str[$i])) $return .= $str{$i}; return $return; } else return false; } ?>