2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /***********************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require (AT_INCLUDE_PATH.'vitals.inc.php');
16 include (AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php'); //clr_dir()
17 //include (AT_INCLUDE_PATH.'lib/filemanager.inc.php'); //clr_dir()
18 include (AT_PA_INCLUDE.'lib.inc.php'); //album_filepath
19 include (AT_PA_INCLUDE.'classes/PhotoAlbum.class.php');
21 //validates if this is me/have the privilege to delete.
22 $pid = intval($_GET['pid']);
23 $aid = intval($_GET['aid']);
26 $pa = new PhotoAlbum($aid);
28 if ($pid<1 || $aid <1){
29 $msg->addError('PA_PHOTO_NOT_FOUND'); //no such picture
30 header('Location: index.php');
32 } elseif (!$pa->checkPhotoPriv($pid, $_SESSION['member_id'])){
33 $msg->addError('ACCESS_DENIED');
34 header('Location: albums.php?id='.$aid);
38 if ($pa->deletePhoto($pid)){
39 header('HTTP/1.1 200 OK');
41 header('HTTP/1.1 500 Internal Server Error');