Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
524077 1 <?php
T 2
3 /*
4 Copyright (c) 2011, Till Brehm, projektfarm Gmbh
5 Modified 2009, Marius Cramer, pixcept KG
6 All rights reserved.
7
8 Redistribution and use in source and binary forms, with or without modification,
9 are permitted provided that the following conditions are met:
10
11     * Redistributions of source code must retain the above copyright notice,
12       this list of conditions and the following disclaimer.
13     * Redistributions in binary form must reproduce the above copyright notice,
14       this list of conditions and the following disclaimer in the documentation
15       and/or other materials provided with the distribution.
16     * Neither the name of ISPConfig nor the names of its contributors
17       may be used to endorse or promote products derived from this software without
18       specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 /******************************************
33 * Begin Form configuration
34 ******************************************/
35
36 $list_def_file = "list/web_folder.list.php";
37 $tform_def_file = "form/web_folder.tform.php";
38
39 /******************************************
40 * End Form configuration
41 ******************************************/
42
b1a6a5 43 require_once '../../lib/config.inc.php';
MC 44 require_once '../../lib/app.inc.php';
524077 45
T 46 //* Check permissions for module
47 $app->auth->check_module_permissions('sites');
48
49 $app->uses('tpl,tform,tform_actions');
50 $app->load('tform_actions');
51
52 class page_action extends tform_actions {
53     function onBeforeDelete() {
54         global $app; $conf;
b1a6a5 55
MC 56         if($app->tform->checkPerm($this->id, 'd') == false) $app->error($app->lng('error_no_delete_permission'));
57
524077 58         // Delete all users that belong to this folder.
cc7a82 59         $records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = ?", $this->id);
524077 60         foreach($records as $rec) {
b1a6a5 61             $app->db->datalogDelete('web_folder_user', 'web_folder_user_id', $rec['web_folder_user_id']);
524077 62         }
T 63         unset($records);
64     }
b1a6a5 65
524077 66 }
T 67
68 $page = new page_action;
69 $page->onDelete();
70
b1a6a5 71 ?>