root/trunk/gui/client/ftp_choose_dir.php

Revision 1327, 3.3 kB (checked in by rats, 4 months ago)

* Fixed: --scan-knownbad-files and --check-deleted are no longer supported by rkhunter
* Fixed #1471: chkrootkit should be in lenny / hardy
* Updated Chinese (simplified)
* Updated German
* Fixed #1475: typo on installation (ispcp-setup)
* Fixed: default user for rkhunter.log

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 require '../include/class.vfs.php';
22 require '../include/ispcp-lib.php';
23
24 check_login(__FILE__);
25
26 $tpl = new pTemplate();
27 $tpl->define_dynamic('page_message', 'page');
28 $tpl->define_dynamic('logged_from', 'page');
29 $tpl->define_dynamic('dir_item', 'page');
30 $tpl->define_dynamic('action_link', 'page');
31 $tpl->define_dynamic('list_item', 'page');
32 $tpl->define_dynamic('page', Config::get('CLIENT_TEMPLATE_PATH') . '/ftp_choose_dir.tpl');
33
34 $theme_color = Config::get('USER_INITIAL_THEME');
35
36 function gen_directories(&$tpl) {
37     $sql = Database::getInstance();
38     // Initialize variables
39     $path = isset($_GET['cur_dir']) ? $_GET['cur_dir'] : '';
40     $domain = $_SESSION['user_logged'];
41     // Create the virtual file system and open it so it can be used
42     $vfs = &new vfs($domain, $sql);
43     // Get the directory listing
44     $list = $vfs->ls($path);
45     if (!$list) {
46         set_page_message(tr('Can not open directory !<br>Please contact your administrator !'));
47         return;
48     }
49     // Show parent directory link
50     $parent = explode('/', $path);
51     array_pop($parent);
52     $parent = implode('/', $parent);
53     $tpl->assign('ACTION_LINK', '');
54     $tpl->assign(array('ACTION' => '',
55             'ICON' => "parent",
56             'DIR_NAME' => tr('Parent Directory'),
57             'LINK' => 'ftp_choose_dir.php?cur_dir=' . $parent,
58             ));
59     $tpl->parse('DIR_ITEM', '.dir_item');
60     // Show directories only
61     foreach ($list as $entry) {
62         // Skip non-directory entries
63         if ($entry['type'] != VFS_TYPE_DIR)
64             continue;
65         // Skip '.' and '..'
66         if ($entry['file'] == '.' || $entry['file'] == '..')
67             continue;
68         // Check for .htaccess existance to display another icon
69         $dr = $path . '/' . $entry['file'];
70         $tfile = $dr . '/.htaccess';
71         if ($vfs->exists($tfile)) {
72             $image = "locked";
73         } else {
74             $image = "folder";
75         }
76         // Create the directory link
77         $tpl->assign(array('ACTION' => tr('Protect it'),
78                 'PROTECT_IT' => "protected_areas_add.php?file=$dr",
79                 'ICON' => $image,
80                 'DIR_NAME' => $entry['file'],
81                 'CHOOSE_IT' => $dr,
82                 'LINK' => "ftp_choose_dir.php?cur_dir=$dr",
83                 ));
84         $tpl->parse('ACTION_LINK', 'action_link');
85         $tpl->parse('DIR_ITEM' , '.dir_item');
86     }
87 }
88 // functions end
89 $tpl->assign(
90     array('TR_CLIENT_WEBTOOLS_PAGE_TITLE' => tr('ispCP - Client/Webtools'),
91         'THEME_COLOR_PATH' => "../themes/$theme_color",
92         'THEME_CHARSET' => tr('encoding'),
93         'ISP_LOGO' => get_logo($_SESSION['user_id'])
94         )
95     );
96
97 gen_directories($tpl);
98
99 $tpl->assign(
100     array('TR_DIRECTORY_TREE' => tr('Directory tree'),
101         'TR_DIRS' => tr('Directories'),
102         'TR__ACTION' => tr('Action'),
103         'CHOOSE' => tr('Choose')
104         )
105     );
106
107 gen_page_message($tpl);
108
109 $tpl->parse('PAGE', 'page');
110 $tpl->prnt();
111
112 if (Config::get('DUMP_GUI_DEBUG'))
113     dump_gui_debug();
114
115 unset_messages();
116
117 ?>
Note: See TracBrowser for help on using the browser.