corrade-http-templates – Rev 29
?pathlinks?
<?php
###########################################################################
## Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 ##
###########################################################################
## A small script that will delete a conversation from the configured ##
## conversation directory. ##
###########################################################################
###########################################################################
## CONFIGURATION ##
###########################################################################
require_once('config.php');
require_once('functions.php');
###########################################################################
## INTERNALS ##
###########################################################################
# Bail if "firstname" or "lastname" are blank.
if(!isset($_POST['firstname']) ||
!isset($_POST['lastname'])) return;
####
# I. Get the path to the configured chat directory.
$chatPath = realpath($CHAT_DIRECTORY);
####
# II. Get the user path.
$userPath = join(
DIRECTORY_SEPARATOR,
array(
$CHAT_DIRECTORY,
ucfirst(
strtolower(
$_POST['firstname']
)
) .' '.
ucfirst(
strtolower(
$_POST['lastname']
)
).'.log'
)
);
####
# III. Check that the file will be placed within the chat directory.
$pathPart = pathinfo($userPath);
if(realpath($pathPart['dirname']) != $chatPath)
die;
####
# IV. Remove the conversation.
unlink($userPath);
?>
Generated by GNU Enscript 1.6.5.90.