HTML;
}
if ($action == "login") {
if ($pass == "$wm_pass") {
$section = "Logged In";
$content = <<< HTML
You are logged into the booker administative area.
View/Delete Entries
HTML;
}
if ($pass != "$wm_pass") {
$section = "Error";
$content = <<< HTML
Wrong login password. Please try again:
HTML;
}
}
if ($action == "signed" && $pass == "$wm_pass") {
$section = "All Entries - Front";
$content = "";
if ($max) {} else { $max="9"; }
if ($min) {} else { $min="0"; }
$gb = file ("entries.db");
$count = "0"; while (list ($key, $val) = each ($gb)) {
if ($key >= $min && $key <= $max) {
$tosplit = "|";
$contarr = explode($tosplit,$val);
$name = $contarr[0];
$comment = $contarr[1];
$website = $contarr[2];
$date = $contarr[3];
$ip = $contarr[4];
$content .= <<< HTML
$name - date - $ip - website
$comment
Delete
HTML;
}
$count++;
}
$content .= <<< HTML
________________________________________
HTML;
if ($min > 0) {
$n_max = $max - 10;
$n_min = $min - 10;
$content .= <<< HTML
previous
HTML;
}
if ($count > $max) {
$n_max = $max + 10;
$n_min = $min + 10;
$content .= <<< HTML
more
HTML;
$content .= <<< HTML
HTML;
}
}
if ($action == "delete" && $pass == $wm_pass) {
$datafile = "entries.db";
$file=file("$datafile");
while(list(,$value)=each($file)){
list($name, $comment, $website, $date, $address)=split( "\|", $value);
if ($id == "$address" && $id2 == "$comment") {
$old = "$name|$comment|$website|$date|$address|\n";
$new = "";
$fp = fopen("entries.db", "r");
$dat = fread($fp, filesize("entries.db"));
fclose($fp);
$data = str_replace($old, $new, $dat);
$dafile = fopen("entries.db", "w");
fputs($dafile, $data);
fclose($dafile);
$content = <<< HTML
Success, the entry from $name is now removed from the board
back
HTML;
}
}
}
// attempt to ban ip address
if ($action == "ban" && $pass == "$wm_pass") {
$old = fopen ("banned.db", "r");
$old2 = fread ($old, filesize ("banned.db"));
fclose ($old);
$new = "$id|";
$fp = fopen ("banned.db", "w");
fwrite ($fp, "$new\n$old2");
fclose ($fp);
echo "$id is now banned from the tagboard back";
}
// end ban ip attempt
echo "$section
$content";
?>