Viewing file: record.delatt.php (1.69 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
* $Id: record.delatt.php,v 1.2.2.3.2.3 2007/01/14 11:08:55 matteo Exp $
*
* Delete a faq attachment.
*
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Johannes Schlüter <johannes@php.net>
* @since 2003-02-24
* @copyright (c) 2001-2007 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
header('Location: http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']));
exit();
}
print "<h2>".$PMF_LANG["ad_entry_aor"]."</h2>\n";
if ($permission["delatt"]) {
$id = (int)$_REQUEST["id"];
$attDir = PMF_ROOT_DIR."/attachments/".$id;
$filename = $attDir."/".$_REQUEST["which"];
if (in_array($filename, PMF_glob($attDir."/*"))) {
if (@unlink($filename)) {
print "<p>".$PMF_LANG["ad_att_delsuc"]."</p>\n";
} else {
print "<p>".$PMF_LANG["ad_att_delfail"]."</p>\n";
}
} else {
print $PMF_LANG["ad_att_delfail"];
die();
}
print "<p><a href=\"".$_SERVER["PHP_SELF"].$linkext."&aktion=editentry&id=".$id."&lang=".$_REQUEST["lang"]."\">".$PMF_LANG["ad_entry_back"]."</a></p>";
} else {
print $PMF_LANG["err_NotAuth"];
}
?>
|