Now loading...
').appendTo(ql.info.find('.elfinder-quicklook-info'));
53 |
54 | node = $(''),n.request({data:{cmd:"url",target:r.hash},preventDefault:!0}).always(function(){$(this).html("")}).done(function(i){var t=n.file(r.hash);e.value.url=t.url=i.url||"",e.value.url&&o.trigger($.Event("update",{file:e.value}))})}),""!==r.url&&"1"!=r.url&&(i.stopImmediatePropagation(),o.one("change",function(){l.remove(),t.off("load").remove()}),l=$(' Now loading...
').appendTo(e.info.find(".elfinder-quicklook-info")),t=$('').css("background-color","transparent").appendTo(o).on("load",function(){e.hideinfo(),l.remove(),$(this).css("background-color","#fff").show()}).attr("src",n.url(r.hash).replace("/edit","/embed"))))})})}catch(n){}});
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/elfinder.fallback.js:
--------------------------------------------------------------------------------
1 | (function(factory) {
2 | if (typeof define === 'function' && define.amd) {
3 | define(factory);
4 | } else if (typeof exports !== 'undefined') {
5 | module.exports = factory();
6 | } else {
7 | factory();
8 | }
9 | }(this, function() {
10 | return void 0;
11 | }));
12 |
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/help/cs.html.js:
--------------------------------------------------------------------------------
1 | Tipy na obsluhu
2 | Obsluha na uživatelském rozhraní je podobná standardnímu správci souborů operačního systému. Drag and Drop však není možné používat s mobilními prohlížeči.
3 |
4 | Kliknutím pravým tlačítkem nebo dlouhým klepnutím zobrazíte kontextové menu.
5 | Přetáhněte do stromu složek nebo do aktuálního pracovního prostoru a přetáhněte / kopírujte položky.
6 | Výběr položky v pracovním prostoru můžete rozšířit pomocí kláves Shift nebo Alt (Možnost).
7 | Přemístěte soubory a složky do cílové složky nebo do pracovního prostoru.
8 | Dialog předávání může přijímat data schránky nebo seznamy adres URL a přitáhnout a odejít z jiných prohlížečů nebo správců souborů.
9 | Zatažením spusťte stisknutím klávesy Alt (Možnost) přetáhněte do vnějšího prohlížeče. Tato funkce se převezme pomocí prohlížeče Google Chrome.
10 |
11 |
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/help/en.html.js:
--------------------------------------------------------------------------------
1 | Operation Tips
2 | Operation on the UI is similar to operating system's standard file manager. However, Drag and Drop is not possible with mobile browsers.
3 |
4 | Right click or long tap to show the context menu.
5 | Drag and drop into the folder tree or the current workspace to move/copy items.
6 | Item selection in the workspace can be extended selection with Shift or Alt (Option) key.
7 | Drag and Drop to the destination folder or workspace to upload files and folders.
8 | The upload dialog can accept paste/drop clipboard data or URL lists and Drag and Drop from other browser or file managers etc.
9 | Drag start with pressing Alt(Option) key to drag out to outside browser. It will became download operation with Google Chrome.
10 |
11 |
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/help/jp.html.js:
--------------------------------------------------------------------------------
1 | 操作のヒント
2 | UIの操作は、オペレーティングシステムの標準ファイルマネージャにほぼ準拠しています。ただし、モバイルブラウザではドラッグ&ドロップはできません。
3 |
4 | 右クリックまたはロングタップでコンテキストメニューを表示します。
5 | アイテムを移動/コピーするには、フォルダツリーまたはワークスペースにドラッグ&ドロップします。
6 | ワークスペース内のアイテムの選択は、ShiftキーまたはAltキー(Optionキー)で選択範囲を拡張できます。
7 | コピー先のフォルダまたはワークスペースにドラッグアンドドロップして、ファイルとフォルダをアップロードします。
8 | アップロードダイアログでは、クリップボードのデータやURLリストのペースト/ドロップ、他のブラウザやファイルマネージャからのドラッグ&ドロップなどを受け入れることができます。
9 | Altキー(Optionキー)を押しながらドラッグすると、ブラウザの外にドラッグできます。Google Chromeでダウンロード操作になります。
10 |
11 |
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/help/pl.html.js:
--------------------------------------------------------------------------------
1 | Wskazówki Obsługi
2 | Działanie w interfejsie użytkownika jest podobne do standardowego menedżera plików systemu operacyjnego. Jednak Przeciąganie i Upuszczanie nie jest możliwe w przeglądarkach mobilnych.
3 |
4 | Kliknij prawym przyciskiem myszy lub dłużej, aby wyświetlić menu kontekstowe.
5 | Przeciągnij i upuść w drzewie folderów lub bieżącym obszarze roboczym, aby przenieść/kopiować elementy.
6 | Wybór elementu w obszarze roboczym można rozszerzyć wybór z klawiszem Shift lub Alt(Opcja).
7 | Przeciągnij i Upuść do folderu docelowego lub obszaru roboczego, aby przesłać pliki i foldery.
8 | W oknie dialogowym przesyłania można zaakceptować wklejanie/upuszczanie danych schowka lub listy adresów URL, i Przeciągnij i Upuść z innych przeglądarek lub menedżerów plików, itp.
9 | Rozpocznij Przeciąganie naciskając Alt (Opcja), aby przeciągnąć na zewnątrz przeglądarki. Stanie się operacją pobierania z Google Chrome.
10 |
11 |
--------------------------------------------------------------------------------
/assets/elfinder/js/i18n/help/sk.html.js:
--------------------------------------------------------------------------------
1 | Tipy na obsluhu
2 | Obsluha na používateľskom rozhraní je podobná štandardnému správcovi súborov operačného systému. Drag and Drop však nie je možné používať s mobilnými prehliadačmi.
3 |
4 | Kliknutím pravým tlačidlom alebo dlhým klepnutím zobrazíte kontextové menu.
5 | Presuňte myšou do stromu priečinkov alebo do aktuálneho pracovného priestoru a presuňte / kopírujte položky.
6 | Výber položky v pracovnom priestore môžete rozšíriť pomocou klávesov Shift alebo Alt (Možnosť).
7 | Premiestnite súbory a priečinky do cieľovej zložky alebo do pracovného priestoru.
8 | Dialog odovzdávania môže prijímať dáta schránky alebo zoznamy adries URL a pritiahnuť a odísť z iných prehliadačov alebo správcov súborov.
9 | Potiahnutím spustite stlačením klávesu Alt (Možnosť) pretiahnite do vonkajšieho prehliadača. Táto funkcia sa prevezme pomocou prehliadača Google Chrome.
10 |
11 |
--------------------------------------------------------------------------------
/assets/elfinder/php/.tmp/.htaccess:
--------------------------------------------------------------------------------
1 | order deny,allow
2 | deny from all
3 |
--------------------------------------------------------------------------------
/assets/elfinder/php/MySQLStorage.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `elfinder_file`;
2 | CREATE TABLE IF NOT EXISTS `elfinder_file` (
3 | `id` int(7) unsigned NOT NULL auto_increment,
4 | `parent_id` int(7) unsigned NOT NULL,
5 | `name` varchar(256) NOT NULL,
6 | `content` longblob NOT NULL,
7 | `size` int(10) unsigned NOT NULL default '0',
8 | `mtime` int(10) unsigned NOT NULL default '0',
9 | `mime` varchar(256) NOT NULL default 'unknown',
10 | `read` enum('1', '0') NOT NULL default '1',
11 | `write` enum('1', '0') NOT NULL default '1',
12 | `locked` enum('1', '0') NOT NULL default '0',
13 | `hidden` enum('1', '0') NOT NULL default '0',
14 | `width` int(5) NOT NULL default '0',
15 | `height` int(5) NOT NULL default '0',
16 | PRIMARY KEY (`id`),
17 | UNIQUE KEY `parent_name` (`parent_id`, `name`),
18 | KEY `parent_id` (`parent_id`)
19 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
20 |
21 | INSERT INTO `elfinder_file`
22 | (`id`, `parent_id`, `name`, `content`, `size`, `mtime`, `mime`, `read`, `write`, `locked`, `hidden`, `width`, `height`) VALUES
23 | ('1', '0', 'DATABASE', '', '0', '0', 'directory', '1', '1', '0', '0', '0', '0');
24 |
--------------------------------------------------------------------------------
/assets/elfinder/php/autoload.php:
--------------------------------------------------------------------------------
1 | ELFINDER_PHP_ROOT_PATH . '/elFinder.class.php',
8 | 'elFinderConnector' => ELFINDER_PHP_ROOT_PATH . '/elFinderConnector.class.php',
9 | 'elFinderLibGdBmp' => ELFINDER_PHP_ROOT_PATH . '/libs/GdBmp.php',
10 | 'elFinderPlugin' => ELFINDER_PHP_ROOT_PATH . '/elFinderPlugin.php',
11 | 'elFinderPluginAutoResize' => ELFINDER_PHP_ROOT_PATH . '/plugins/AutoResize/plugin.php',
12 | 'elFinderPluginAutoRotate' => ELFINDER_PHP_ROOT_PATH . '/plugins/AutoRotate/plugin.php',
13 | 'elFinderPluginNormalizer' => ELFINDER_PHP_ROOT_PATH . '/plugins/Normalizer/plugin.php',
14 | 'elFinderPluginSanitizer' => ELFINDER_PHP_ROOT_PATH . '/plugins/Sanitizer/plugin.php',
15 | 'elFinderPluginWatermark' => ELFINDER_PHP_ROOT_PATH . '/plugins/Watermark/plugin.php',
16 | 'elFinderSession' => ELFINDER_PHP_ROOT_PATH . '/elFinderSession.php',
17 | 'elFinderSessionInterface' => ELFINDER_PHP_ROOT_PATH . '/elFinderSessionInterface.php',
18 | 'elFinderVolumeDriver' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeDriver.class.php',
19 | 'elFinderVolumeDropbox2' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeDropbox2.class.php',
20 | 'elFinderVolumeFTP' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeFTP.class.php',
21 | 'elFinderVolumeFlysystemGoogleDriveCache' => ELFINDER_PHP_ROOT_PATH . '/elFinderFlysystemGoogleDriveNetmount.php',
22 | 'elFinderVolumeFlysystemGoogleDriveNetmount' => ELFINDER_PHP_ROOT_PATH . '/elFinderFlysystemGoogleDriveNetmount.php',
23 | 'elFinderVolumeGoogleDrive' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeGoogleDrive.class.php',
24 | 'elFinderVolumeGroup' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeGroup.class.php',
25 | 'elFinderVolumeLocalFileSystem' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeLocalFileSystem.class.php',
26 | 'elFinderVolumeMySQL' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeMySQL.class.php',
27 | 'elFinderVolumeTrash' => ELFINDER_PHP_ROOT_PATH . '/elFinderVolumeTrash.class.php',
28 | );
29 | if (isset($map[$name])) {
30 | return include_once($map[$name]);
31 | }
32 | $prefix = substr($name, 0, 14);
33 | if (substr($prefix, 0, 8) === 'elFinder') {
34 | if ($prefix === 'elFinderVolume') {
35 | $file = ELFINDER_PHP_ROOT_PATH . '/' . $name . '.class.php';
36 | return (is_file($file) && include_once($file));
37 | } else if ($prefix === 'elFinderPlugin') {
38 | $file = ELFINDER_PHP_ROOT_PATH . '/plugins/' . substr($name, 14) . '/plugin.php';
39 | return (is_file($file) && include_once($file));
40 | }
41 | }
42 | return false;
43 | }
44 |
45 | if (version_compare(PHP_VERSION, '5.3', '<')) {
46 | spl_autoload_register('elFinderAutoloader');
47 | } else {
48 | spl_autoload_register('elFinderAutoloader', true, true);
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/assets/elfinder/php/connector.minimal.php-dist:
--------------------------------------------------------------------------------
1 | true,
97 | 'roots' => array(
98 | // Items volume
99 | array(
100 | 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
101 | 'path' => '../files/', // path to files (REQUIRED)
102 | 'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
103 | 'trashHash' => 't1_Lw', // elFinder's hash of trash folder
104 | 'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
105 | 'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
106 | 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
107 | 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
108 | 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
109 | ),
110 | // Trash volume
111 | array(
112 | 'id' => '1',
113 | 'driver' => 'Trash',
114 | 'path' => '../files/.trash/',
115 | 'tmbURL' => dirname($_SERVER['PHP_SELF']) . '/../files/.trash/.tmb/',
116 | 'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
117 | 'uploadDeny' => array('all'), // Recomend the same settings as the original volume that uses the trash
118 | 'uploadAllow' => array('image', 'text/plain'),// Same as above
119 | 'uploadOrder' => array('deny', 'allow'), // Same as above
120 | 'accessControl' => 'access', // Same as above
121 | )
122 | )
123 | );
124 |
125 | // run elFinder
126 | $connector = new elFinderConnector(new elFinder($opts));
127 | $connector->run();
128 |
129 |
--------------------------------------------------------------------------------
/assets/elfinder/php/elFinderConnector.class.php:
--------------------------------------------------------------------------------
1 | elFinder = $elFinder;
55 | $this->reqMethod = strtoupper($_SERVER["REQUEST_METHOD"]);
56 | if ($debug) {
57 | self::$contentType = 'Content-Type: text/plain; charset=utf-8';
58 | }
59 | }
60 |
61 | /**
62 | * Execute elFinder command and output result
63 | *
64 | * @return void
65 | * @author Dmitry (dio) Levashov
66 | **/
67 | public function run() {
68 | $isPost = $this->reqMethod === 'POST';
69 | $src = $isPost ? $_POST : $_GET;
70 | $maxInputVars = (! $src || isset($src['targets']))? ini_get('max_input_vars') : null;
71 | if ((! $src || $maxInputVars) && $rawPostData = file_get_contents('php://input')) {
72 | // for max_input_vars and supports IE XDomainRequest()
73 | $parts = explode('&', $rawPostData);
74 | if (! $src || $maxInputVars < count($parts)) {
75 | $src = array();
76 | foreach($parts as $part) {
77 | list($key, $value) = array_pad(explode('=', $part), 2, '');
78 | $key = rawurldecode($key);
79 | if (preg_match('/^(.+?)\[([^\[\]]*)\]$/', $key, $m)) {
80 | $key = $m[1];
81 | $idx = $m[2];
82 | if (!isset($src[$key])) {
83 | $src[$key] = array();
84 | }
85 | if ($idx) {
86 | $src[$key][$idx] = rawurldecode($value);
87 | } else {
88 | $src[$key][] = rawurldecode($value);
89 | }
90 | } else {
91 | $src[$key] = rawurldecode($value);
92 | }
93 | }
94 | $_POST = $this->input_filter($src);
95 | $_REQUEST = $this->input_filter(array_merge_recursive($src, $_REQUEST));
96 | }
97 | }
98 |
99 | if (isset($src['targets']) && $this->elFinder->maxTargets && count($src['targets']) > $this->elFinder->maxTargets) {
100 | $error = $this->elFinder->error(elFinder::ERROR_MAX_TARGTES);
101 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_MAX_TARGTES)));
102 | }
103 |
104 | $cmd = isset($src['cmd']) ? $src['cmd'] : '';
105 | $args = array();
106 |
107 | if (!function_exists('json_encode')) {
108 | $error = $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_JSON);
109 | $this->output(array('error' => '{"error":["'.implode('","', $error).'"]}', 'raw' => true));
110 | }
111 |
112 | if (!$this->elFinder->loaded()) {
113 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_VOL), 'debug' => $this->elFinder->mountErrors));
114 | }
115 |
116 | // telepat_mode: on
117 | if (!$cmd && $isPost) {
118 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UPLOAD, elFinder::ERROR_UPLOAD_TOTAL_SIZE), 'header' => 'Content-Type: text/html'));
119 | }
120 | // telepat_mode: off
121 |
122 | if (!$this->elFinder->commandExists($cmd)) {
123 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UNKNOWN_CMD)));
124 | }
125 |
126 | // collect required arguments to exec command
127 | $hasFiles = false;
128 | foreach ($this->elFinder->commandArgsList($cmd) as $name => $req) {
129 | if ($name === 'FILES') {
130 | if (isset($_FILES)) {
131 | $hasFiles = true;
132 | } elseif ($req) {
133 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_INV_PARAMS, $cmd)));
134 | }
135 | } else {
136 | $arg = isset($src[$name])? $src[$name] : '';
137 |
138 | if (!is_array($arg) && $req !== '') {
139 | $arg = trim($arg);
140 | }
141 | if ($req && $arg === '') {
142 | $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_INV_PARAMS, $cmd)));
143 | }
144 | $args[$name] = $arg;
145 | }
146 | }
147 |
148 | $args['debug'] = isset($src['debug']) ? !!$src['debug'] : false;
149 |
150 | $args = $this->input_filter($args);
151 | if ($hasFiles) {
152 | $args['FILES'] = $_FILES;
153 | }
154 |
155 | try {
156 | $this->output($this->elFinder->exec($cmd, $args));
157 | } catch (elFinderAbortException $e) {
158 | // aborted
159 | exit();
160 | }
161 | }
162 |
163 | /**
164 | * Output json
165 | *
166 | * @param array data to output
167 | * @return void
168 | * @author Dmitry (dio) Levashov
169 | **/
170 | protected function output(array $data) {
171 | // unlock session data for multiple access
172 | $this->elFinder->getSession()->close();
173 | // client disconnect should abort
174 | ignore_user_abort(false);
175 |
176 | if ($this->header) {
177 | self::sendHeader($this->header);
178 | }
179 |
180 | if (isset($data['pointer'])) {
181 | // set time limit to 0
182 | elFinder::extendTimeLimit(0);
183 |
184 | // send optional header
185 | if (!empty($data['header'])) {
186 | self::sendHeader($data['header']);
187 | }
188 |
189 | // clear output buffer
190 | while(ob_get_level() && ob_end_clean()){}
191 |
192 | $toEnd = true;
193 | $fp = $data['pointer'];
194 | $sendData = !($this->reqMethod === 'HEAD' || !empty($data['info']['xsendfile']));
195 | if (($this->reqMethod === 'GET' || !$sendData)
196 | && elFinder::isSeekableStream($fp)
197 | && (array_search('Accept-Ranges: none', headers_list()) === false)) {
198 | header('Accept-Ranges: bytes');
199 | $psize = null;
200 | if (!empty($_SERVER['HTTP_RANGE'])) {
201 | $size = $data['info']['size'];
202 | $start = 0;
203 | $end = $size - 1;
204 | if (preg_match('/bytes=(\d*)-(\d*)(,?)/i', $_SERVER['HTTP_RANGE'], $matches)) {
205 | if (empty($matches[3])) {
206 | if (empty($matches[1]) && $matches[1] !== '0') {
207 | $start = $size - $matches[2];
208 | } else {
209 | $start = intval($matches[1]);
210 | if (!empty($matches[2])) {
211 | $end = intval($matches[2]);
212 | if ($end >= $size) {
213 | $end = $size - 1;
214 | }
215 | $toEnd = ($end == ($size - 1));
216 | }
217 | }
218 | $psize = $end - $start + 1;
219 |
220 | header('HTTP/1.1 206 Partial Content');
221 | header('Content-Length: ' . $psize);
222 | header('Content-Range: bytes ' . $start . '-' . $end . '/' . $size);
223 |
224 | // Apache mod_xsendfile dose not support range request
225 | if (isset($data['info']['xsendfile']) && strtolower($data['info']['xsendfile']) === 'x-sendfile') {
226 | if (function_exists('header_remove')) {
227 | header_remove($data['info']['xsendfile']);
228 | } else {
229 | header($data['info']['xsendfile'] . ':');
230 | }
231 | unset($data['info']['xsendfile']);
232 | if ($this->reqMethod !== 'HEAD') {
233 | $sendData = true;
234 | }
235 | }
236 |
237 | $sendData && fseek($fp, $start);
238 | }
239 | }
240 | }
241 | if ($sendData && is_null($psize)){
242 | elFinder::rewind($fp);
243 | }
244 | } else {
245 | header('Accept-Ranges: none');
246 | if (isset($data['info']) && ! $data['info']['size']) {
247 | if (function_exists('header_remove')) {
248 | header_remove('Content-Length');
249 | } else {
250 | header('Content-Length:');
251 | }
252 | }
253 | }
254 |
255 | if ($sendData) {
256 | if ($toEnd) {
257 | fpassthru($fp);
258 | } else {
259 | $out = fopen('php://output', 'wb');
260 | stream_copy_to_stream($fp, $out, $psize);
261 | fclose($out);
262 | }
263 | }
264 |
265 | if (!empty($data['volume'])) {
266 | $data['volume']->close($data['pointer'], $data['info']['hash']);
267 | }
268 | exit();
269 | } else {
270 | self::outputJson($data);
271 | exit(0);
272 | }
273 | }
274 |
275 | /**
276 | * Remove null & stripslashes applies on "magic_quotes_gpc"
277 | *
278 | * @param mixed $args
279 | * @return mixed
280 | * @author Naoki Sawada
281 | */
282 | protected function input_filter($args) {
283 | static $magic_quotes_gpc = NULL;
284 |
285 | if ($magic_quotes_gpc === NULL)
286 | $magic_quotes_gpc = (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc());
287 |
288 | if (is_array($args)) {
289 | return array_map(array(& $this, 'input_filter'), $args);
290 | }
291 | $res = str_replace("\0", '', $args);
292 | $magic_quotes_gpc && ($res = stripslashes($res));
293 | return $res;
294 | }
295 |
296 | /**
297 | * Send HTTP header
298 | *
299 | * @param string|array $header optional header
300 | */
301 | protected static function sendHeader($header = null) {
302 | if ($header) {
303 | if (is_array($header)) {
304 | foreach ($header as $h) {
305 | header($h);
306 | }
307 | } else {
308 | header($header);
309 | }
310 | }
311 | }
312 |
313 | /**
314 | * Output JSON
315 | *
316 | * @param array $data
317 | */
318 | public static function outputJson($data) {
319 | // send header
320 | $header = isset($data['header']) ? $data['header'] : self::$contentType;
321 | self::sendHeader($header);
322 |
323 | unset($data['header']);
324 |
325 | if (!empty($data['raw']) && !empty($data['error'])) {
326 | $out = $data['error'];
327 | } else {
328 | if (isset($data['debug']) && isset($data['debug']['phpErrors'])) {
329 | $data['debug']['phpErrors'] = array_merge($data['debug']['phpErrors'], elFinder::$phpErrors);
330 | }
331 | $out = json_encode($data);
332 | }
333 |
334 | // clear output buffer
335 | while(ob_get_level() && ob_end_clean()){}
336 |
337 | header('Content-Length: ' . strlen($out));
338 |
339 | echo $out;
340 |
341 | flush();
342 | }
343 | }// END class
344 |
--------------------------------------------------------------------------------
/assets/elfinder/php/elFinderPlugin.php:
--------------------------------------------------------------------------------
1 | opts;
27 | if (is_object($volume)) {
28 | $volOpts = $volume->getOptionsPlugin($name);
29 | if (is_array($volOpts)) {
30 | $opts = array_merge($opts, $volOpts);
31 | }
32 | }
33 | return $opts;
34 | }
35 |
36 | /**
37 | * Is enabled with options
38 | *
39 | * @param array $opts
40 | * @return boolean
41 | */
42 | protected function iaEnabled($opts) {
43 | if (! $opts['enable']) {
44 | return false;
45 | }
46 |
47 | if (isset($opts['offDropWith']) && ! is_null($opts['offDropWith']) && isset($_REQUEST['dropWith'])) {
48 | $offDropWith = $opts['offDropWith'];
49 | $action = (int)$_REQUEST['dropWith'];
50 | if (! is_array($offDropWith)) {
51 | $offDropWith = array($offDropWith);
52 | }
53 | $res = true;
54 | foreach($offDropWith as $key) {
55 | $key = (int)$key;
56 | if ($key === 0) {
57 | if ($action === 0) {
58 | $res = false;
59 | break;
60 | }
61 | } else {
62 | if (($action & $key) === $key) {
63 | $res = false;
64 | break;
65 | }
66 | }
67 | }
68 | if (! $res) {
69 | return false;
70 | }
71 | }
72 |
73 | return true;
74 | }
75 | }
--------------------------------------------------------------------------------
/assets/elfinder/php/elFinderSession.php:
--------------------------------------------------------------------------------
1 | false,
21 | 'keys' => array(
22 | 'default' => 'elFinderCaches',
23 | 'netvolume' => 'elFinderNetVolumes'
24 | )
25 | );
26 |
27 | public function __construct($opts)
28 | {
29 | $this->opts = array_merge($this->opts, $opts);
30 | $this->base64encode = !empty($this->opts['base64encode']);
31 | $this->keys = $this->opts['keys'];
32 |
33 | return $this;
34 | }
35 |
36 | /**
37 | * {@inheritdoc}
38 | */
39 | public function start()
40 | {
41 | if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
42 | if (session_status() !== PHP_SESSION_ACTIVE) {
43 | session_start();
44 | }
45 | } else {
46 | set_error_handler(array($this, 'session_start_error'), E_NOTICE);
47 | session_start();
48 | restore_error_handler();
49 | }
50 | $this->started = session_id()? true : false;
51 |
52 | return $this;
53 | }
54 |
55 | /**
56 | * {@inheritdoc}
57 | */
58 | public function close()
59 | {
60 | if ($this->started) {
61 | session_write_close();
62 | }
63 | $this->started = false;
64 |
65 | return $this;
66 | }
67 |
68 | /**
69 | * {@inheritdoc}
70 | */
71 | public function get($key, $empty = null)
72 | {
73 | $closed = false;
74 | if (! $this->started) {
75 | $closed = true;
76 | $this->start();
77 | }
78 |
79 | $data = null;
80 |
81 | if ($this->started) {
82 | $session =& $this->getSessionRef($key);
83 | $data = $session;
84 | if ($data && $this->base64encode) {
85 | $data = $this->decodeData($data);
86 | }
87 | }
88 |
89 | $checkFn = null;
90 | if (! is_null($empty)) {
91 | if (is_string($empty)) {
92 | $checkFn = 'is_string';
93 | } elseif (is_array($empty)) {
94 | $checkFn = 'is_array';
95 | } elseif (is_object($empty)) {
96 | $checkFn = 'is_object';
97 | } elseif (is_float($empty)) {
98 | $checkFn = 'is_float';
99 | } elseif (is_int($empty)) {
100 | $checkFn = 'is_int';
101 | }
102 | }
103 |
104 | if (is_null($data) || ($checkFn && ! $checkFn($data))) {
105 | $session = $data = $empty;
106 | }
107 |
108 | if ($closed) {
109 | $this->close();
110 | }
111 |
112 | return $data;
113 | }
114 |
115 | /**
116 | * {@inheritdoc}
117 | */
118 | public function set($key, $data)
119 | {
120 | $closed = false;
121 | if (! $this->started) {
122 | $closed = true;
123 | $this->start();
124 | }
125 | $session =& $this->getSessionRef($key);
126 | if ($this->base64encode) {
127 | $data = $this->encodeData($data);
128 | }
129 | $session = $data;
130 |
131 | if ($closed) {
132 | $this->close();
133 | }
134 |
135 | return $this;
136 | }
137 |
138 | /**
139 | * {@inheritdoc}
140 | */
141 | public function remove($key)
142 | {
143 | $closed = false;
144 | if (! $this->started) {
145 | $closed = true;
146 | $this->start();
147 | }
148 |
149 | list($cat, $name) = array_pad(explode('.', $key, 2), 2, null);
150 | if (is_null($name)) {
151 | if (! isset($this->keys[$cat])) {
152 | $name = $cat;
153 | $cat = 'default';
154 | }
155 | }
156 | if (isset($this->keys[$cat])) {
157 | $cat = $this->keys[$cat];
158 | } else {
159 | $name = $cat . '.' . $name;
160 | $cat = $this->keys['default'];
161 | }
162 | if (is_null($name)) {
163 | unset($_SESSION[$cat]);
164 | } else {
165 | if (isset($_SESSION[$cat]) && is_array($_SESSION[$cat])) {
166 | unset($_SESSION[$cat][$name]);
167 | }
168 | }
169 |
170 | if ($closed) {
171 | $this->close();
172 | }
173 |
174 | return $this;
175 | }
176 |
177 | protected function & getSessionRef($key)
178 | {
179 | $session = null;
180 | if ($this->started) {
181 | list($cat, $name) = array_pad(explode('.', $key, 2), 2, null);
182 | if (is_null($name)) {
183 | if (! isset($this->keys[$cat])) {
184 | $name = $cat;
185 | $cat = 'default';
186 | }
187 | }
188 | if (isset($this->keys[$cat])) {
189 | $cat = $this->keys[$cat];
190 | } else {
191 | $name = $cat . '.' . $name;
192 | $cat = $this->keys['default'];
193 | }
194 | if (is_null($name)) {
195 | if (! isset($_SESSION[$cat])) {
196 | $_SESSION[$cat] = null;
197 | }
198 | $session =& $_SESSION[$cat];
199 | } else {
200 | if (! isset($_SESSION[$cat]) || ! is_array($_SESSION[$cat])) {
201 | $_SESSION[$cat] = array();
202 | }
203 | if (! isset($_SESSION[$cat][$name])) {
204 | $_SESSION[$cat][$name] = null;
205 | }
206 | $session =& $_SESSION[$cat][$name];
207 | }
208 | }
209 | return $session;
210 | }
211 |
212 | protected function encodeData($data)
213 | {
214 | if ($this->base64encode) {
215 | $data = base64_encode(serialize($data));
216 | }
217 | return $data;
218 | }
219 |
220 | protected function decodeData($data)
221 | {
222 | if ($this->base64encode) {
223 | if (is_string($data)) {
224 | if (($data = base64_decode($data)) !== false) {
225 | $data = unserialize($data);
226 | } else {
227 | $data = null;
228 | }
229 | } else {
230 | $data = null;
231 | }
232 | }
233 | return $data;
234 | }
235 |
236 | protected function session_start_error($errno , $errstr) {}
237 | }
238 |
--------------------------------------------------------------------------------
/assets/elfinder/php/elFinderSessionInterface.php:
--------------------------------------------------------------------------------
1 | options['type'] = 'group';
26 | $this->options['path'] = '/';
27 | $this->options['dirUrlOwn'] = true;
28 | $this->options['syncMinMs'] = 0;
29 | $this->options['tmbPath'] = '';
30 | $this->options['disabled'] = array(
31 | 'archive',
32 | 'cut',
33 | 'duplicate',
34 | 'edit',
35 | 'empty',
36 | 'extract',
37 | 'getfile',
38 | 'mkdir',
39 | 'mkfile',
40 | 'paste',
41 | 'rename',
42 | 'resize',
43 | 'rm',
44 | 'upload'
45 | );
46 | }
47 |
48 | /*********************************************************************/
49 | /* FS API */
50 | /*********************************************************************/
51 |
52 | /*********************** paths/urls *************************/
53 |
54 | /**
55 | * @inheritdoc
56 | **/
57 | protected function _dirname($path) {
58 | return '/';
59 | }
60 |
61 | /**
62 | * {@inheritDoc}
63 | **/
64 | protected function _basename($path) {
65 | return '';
66 | }
67 |
68 | /**
69 | * {@inheritDoc}
70 | **/
71 | protected function _joinPath($dir, $name) {
72 | return '/' . $name;
73 | }
74 |
75 | /**
76 | * {@inheritDoc}
77 | **/
78 | protected function _normpath($path) {
79 | return '/';
80 | }
81 |
82 | /**
83 | * {@inheritDoc}
84 | **/
85 | protected function _relpath($path) {
86 | return '/';
87 | }
88 |
89 | /**
90 | * {@inheritDoc}
91 | **/
92 | protected function _abspath($path) {
93 | return '/';
94 | }
95 |
96 | /**
97 | * {@inheritDoc}
98 | **/
99 | protected function _path($path) {
100 | return '/';
101 | }
102 |
103 | /**
104 | * {@inheritDoc}
105 | **/
106 | protected function _inpath($path, $parent) {
107 | return false;
108 | }
109 |
110 |
111 |
112 | /***************** file stat ********************/
113 |
114 | /**
115 | * {@inheritDoc}
116 | **/
117 | protected function _stat($path) {
118 | if ($path === '/') {
119 | return array(
120 | 'size' => 0,
121 | 'ts' => 0,
122 | 'mime' => 'directory',
123 | 'read' => true,
124 | 'write' => false,
125 | 'locked' => true,
126 | 'hidden' => false,
127 | 'dirs' => 0
128 | );
129 | }
130 | return false;
131 | }
132 |
133 | /**
134 | * {@inheritDoc}
135 | **/
136 | protected function _subdirs($path) {
137 | $dirs = false;
138 | if ($path === '/') {
139 | return true;
140 | }
141 | return $dirs;
142 | }
143 |
144 | /**
145 | * {@inheritDoc}
146 | **/
147 | protected function _dimensions($path, $mime) {
148 | return false;
149 | }
150 | /******************** file/dir content *********************/
151 |
152 | /**
153 | * {@inheritDoc}
154 | **/
155 | protected function readlink($path) {
156 | return null;
157 | }
158 |
159 | /**
160 | * {@inheritDoc}
161 | **/
162 | protected function _scandir($path) {
163 | return array();
164 | }
165 |
166 | /**
167 | * {@inheritDoc}
168 | **/
169 | protected function _fopen($path, $mode='rb') {
170 | return false;
171 | }
172 |
173 | /**
174 | * {@inheritDoc}
175 | **/
176 | protected function _fclose($fp, $path='') {
177 | return true;
178 | }
179 |
180 | /******************** file/dir manipulations *************************/
181 |
182 | /**
183 | * {@inheritDoc}
184 | **/
185 | protected function _mkdir($path, $name) {
186 | return false;
187 | }
188 |
189 | /**
190 | * {@inheritDoc}
191 | **/
192 | protected function _mkfile($path, $name) {
193 | return false;
194 | }
195 |
196 | /**
197 | * {@inheritDoc}
198 | **/
199 | protected function _symlink($source, $targetDir, $name) {
200 | return false;
201 | }
202 |
203 | /**
204 | * {@inheritDoc}
205 | **/
206 | protected function _copy($source, $targetDir, $name) {
207 | return false;
208 | }
209 |
210 | /**
211 | * {@inheritDoc}
212 | **/
213 | protected function _move($source, $targetDir, $name) {
214 | return false;
215 | }
216 |
217 | /**
218 | * {@inheritDoc}
219 | **/
220 | protected function _unlink($path) {
221 | return false;
222 | }
223 |
224 | /**
225 | * {@inheritDoc}
226 | **/
227 | protected function _rmdir($path) {
228 | return false;
229 | }
230 |
231 | /**
232 | * {@inheritDoc}
233 | **/
234 | protected function _save($fp, $dir, $name, $stat) {
235 | return false;
236 | }
237 |
238 | /**
239 | * {@inheritDoc}
240 | **/
241 | protected function _getContents($path) {
242 | return false;
243 | }
244 |
245 | /**
246 | * {@inheritDoc}
247 | **/
248 | protected function _filePutContents($path, $content) {
249 | return false;
250 | }
251 |
252 | /**
253 | * {@inheritDoc}
254 | **/
255 | protected function _checkArchivers() {
256 | return;
257 | }
258 |
259 | /**
260 | * {@inheritDoc}
261 | **/
262 | protected function _chmod($path, $mode) {
263 | return false;
264 | }
265 |
266 | /**
267 | * {@inheritDoc}
268 | **/
269 | protected function _findSymlinks($path) {
270 | return false;
271 | }
272 |
273 | /**
274 | * {@inheritDoc}
275 | **/
276 | protected function _extract($path, $arc) {
277 | return false;
278 | }
279 |
280 | /**
281 | * {@inheritDoc}
282 | **/
283 | protected function _archive($dir, $files, $name, $arc) {
284 | return false;
285 | }
286 | }
287 |
288 |
--------------------------------------------------------------------------------
/assets/elfinder/php/elFinderVolumeTrash.class.php:
--------------------------------------------------------------------------------
1 | options['lockEverything'] = false; // Lock all items in the trash to disable delete, move, rename.
23 |
24 | // common options as the volume driver
25 | $this->options['alias'] = 'Trash';
26 | $this->options['quarantine'] = '';
27 | $this->options['rootCssClass'] = 'elfinder-navbar-root-trash';
28 | $this->options['copyOverwrite'] = false;
29 | $this->options['uiCmdMap'] = array('paste' => 'hidden', 'mkdir' => 'hidden', 'copy' => 'restore');
30 | $this->options['disabled'] = array('archive', 'duplicate', 'edit', 'extract', 'mkfile', 'places', 'put', 'rename', 'resize', 'upload');
31 | }
32 |
33 | public function mount(array $opts)
34 | {
35 | if ($this->options['lockEverything']) {
36 | if (!is_array($opts['attributes'])) {
37 | $opts['attributes'] = array();
38 | }
39 | $attr = array(
40 | 'pattern' => '/./',
41 | 'locked' => true,
42 | );
43 | array_unshift($opts['attributes'], $attr);
44 | }
45 | // force set `copyJoin` to true
46 | $opts['copyJoin'] = true;
47 |
48 | return parent::mount($opts);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/assets/elfinder/php/plugins/AutoResize/plugin.php:
--------------------------------------------------------------------------------
1 | array(
10 | * 'upload.presave' => array(
11 | * 'Plugin.AutoResize.onUpLoadPreSave'
12 | * )
13 | * ),
14 | * // global configure (optional)
15 | * 'plugin' => array(
16 | * 'AutoResize' => array(
17 | * 'enable' => true, // For control by volume driver
18 | * 'maxWidth' => 1024, // Path to Water mark image
19 | * 'maxHeight' => 1024, // Margin right pixel
20 | * 'quality' => 95, // JPEG image save quality
21 | * 'preserveExif' => false, // Preserve EXIF data (Imagick only)
22 | * 'forceEffect' => false, // For change quality of small images
23 | * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
24 | * 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
25 | * // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
26 | * // In case of using any key, specify it as an array
27 | * )
28 | * ),
29 | * // each volume configure (optional)
30 | * 'roots' => array(
31 | * array(
32 | * 'driver' => 'LocalFileSystem',
33 | * 'path' => '/path/to/files/',
34 | * 'URL' => 'http://localhost/to/files/'
35 | * 'plugin' => array(
36 | * 'AutoResize' => array(
37 | * 'enable' => true, // For control by volume driver
38 | * 'maxWidth' => 1024, // Path to Water mark image
39 | * 'maxHeight' => 1024, // Margin right pixel
40 | * 'quality' => 95, // JPEG image save quality
41 | * 'preserveExif' => false, // Preserve EXIF data (Imagick only)
42 | * 'forceEffect' => false, // For change quality of small images
43 | * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
44 | * 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
45 | * // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
46 | * // In case of using any key, specify it as an array
47 | * )
48 | * )
49 | * )
50 | * )
51 | * );
52 | *
53 | * @package elfinder
54 | * @author Naoki Sawada
55 | * @license New BSD
56 | */
57 | class elFinderPluginAutoResize extends elFinderPlugin {
58 |
59 | public function __construct($opts) {
60 | $defaults = array(
61 | 'enable' => true, // For control by volume driver
62 | 'maxWidth' => 1024, // Path to Water mark image
63 | 'maxHeight' => 1024, // Margin right pixel
64 | 'quality' => 95, // JPEG image save quality
65 | 'preserveExif' => false, // Preserve EXIF data (Imagick only)
66 | 'forceEffect' => false, // For change quality of small images
67 | 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
68 | 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
69 | // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
70 | // In case of using any key, specify it as an array
71 | );
72 |
73 | $this->opts = array_merge($defaults, $opts);
74 |
75 | }
76 |
77 | public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume) {
78 | $opts = $this->getCurrentOpts($volume);
79 |
80 | if (! $this->iaEnabled($opts)) {
81 | return false;
82 | }
83 |
84 | $imageType = null;
85 | $srcImgInfo = null;
86 | if (extension_loaded('fileinfo') && function_exists('mime_content_type')) {
87 | $mime = mime_content_type($src);
88 | if (substr($mime, 0, 5) !== 'image') {
89 | return false;
90 | }
91 | }
92 | if (extension_loaded('exif') && function_exists('exif_imagetype')) {
93 | $imageType = exif_imagetype($src);
94 | } else {
95 | $srcImgInfo = getimagesize($src);
96 | if ($srcImgInfo === false) {
97 | return false;
98 | }
99 | $imageType = $srcImgInfo[2];
100 | }
101 |
102 | // check target image type
103 | $imgTypes = array(
104 | IMAGETYPE_GIF => IMG_GIF,
105 | IMAGETYPE_JPEG => IMG_JPEG,
106 | IMAGETYPE_PNG => IMG_PNG,
107 | IMAGETYPE_BMP => IMG_WBMP,
108 | IMAGETYPE_WBMP => IMG_WBMP
109 | );
110 | if (! isset($imgTypes[$imageType]) || ! ($opts['targetType'] & $imgTypes[$imageType])) {
111 | return false;
112 | }
113 |
114 | if (! $srcImgInfo) {
115 | $srcImgInfo = getimagesize($src);
116 | }
117 |
118 | if ($opts['forceEffect'] || $srcImgInfo[0] > $opts['maxWidth'] || $srcImgInfo[1] > $opts['maxHeight']) {
119 | return $this->resize($volume, $src, $srcImgInfo, $opts['maxWidth'], $opts['maxHeight'], $opts['quality'], $opts['preserveExif']);
120 | }
121 |
122 | return false;
123 | }
124 |
125 | private function resize($volume, $src, $srcImgInfo, $maxWidth, $maxHeight, $jpgQuality, $preserveExif) {
126 | $zoom = min(($maxWidth/$srcImgInfo[0]),($maxHeight/$srcImgInfo[1]));
127 | $width = round($srcImgInfo[0] * $zoom);
128 | $height = round($srcImgInfo[1] * $zoom);
129 | $unenlarge = true;
130 | $checkAnimated = true;
131 |
132 | return $volume->imageUtil('resize', $src, compact('width', 'height', 'jpgQuality', 'preserveExif', 'unenlarge', 'checkAnimated'));
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/assets/elfinder/php/plugins/AutoRotate/plugin.php:
--------------------------------------------------------------------------------
1 | array(
10 | * 'upload.presave' => array(
11 | * 'Plugin.AutoRotate.onUpLoadPreSave'
12 | * )
13 | * ),
14 | * // global configure (optional)
15 | * 'plugin' => array(
16 | * 'AutoRotate' => array(
17 | * 'enable' => true, // For control by volume driver
18 | * 'quality' => 95, // JPEG image save quality
19 | * 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
20 | * // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
21 | * // In case of using any key, specify it as an array
22 | * )
23 | * ),
24 | * // each volume configure (optional)
25 | * 'roots' => array(
26 | * array(
27 | * 'driver' => 'LocalFileSystem',
28 | * 'path' => '/path/to/files/',
29 | * 'URL' => 'http://localhost/to/files/'
30 | * 'plugin' => array(
31 | * 'AutoRotate' => array(
32 | * 'enable' => true, // For control by volume driver
33 | * 'quality' => 95, // JPEG image save quality
34 | * 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
35 | * // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
36 | * // In case of using any key, specify it as an array
37 | * )
38 | * )
39 | * )
40 | * )
41 | * );
42 | *
43 | * @package elfinder
44 | * @author Naoki Sawada
45 | * @license New BSD
46 | */
47 | class elFinderPluginAutoRotate extends elFinderPlugin {
48 |
49 | public function __construct($opts) {
50 | $defaults = array(
51 | 'enable' => true, // For control by volume driver
52 | 'quality' => 95, // JPEG image save quality
53 | 'offDropWith' => null // To disable it if it is dropped with pressing the meta key
54 | // Alt: 8, Ctrl: 4, Meta: 2, Shift: 1 - sum of each value
55 | // In case of using any key, specify it as an array
56 | );
57 |
58 | $this->opts = array_merge($defaults, $opts);
59 |
60 | }
61 |
62 | public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume) {
63 | $opts = $this->getCurrentOpts($volume);
64 |
65 | if (! $this->iaEnabled($opts)) {
66 | return false;
67 | }
68 |
69 | $imageType = null;
70 | $srcImgInfo = null;
71 | if (extension_loaded('fileinfo') && function_exists('mime_content_type')) {
72 | $mime = mime_content_type($src);
73 | if (substr($mime, 0, 5) !== 'image') {
74 | return false;
75 | }
76 | }
77 | if (extension_loaded('exif') && function_exists('exif_imagetype')) {
78 | $imageType = exif_imagetype($src);
79 | } else {
80 | $srcImgInfo = getimagesize($src);
81 | if ($srcImgInfo === false) {
82 | return false;
83 | }
84 | $imageType = $srcImgInfo[2];
85 | }
86 |
87 | // check target image type
88 | if ($imageType !== IMAGETYPE_JPEG) {
89 | return false;
90 | }
91 |
92 | if (! $srcImgInfo) {
93 | $srcImgInfo = getimagesize($src);
94 | }
95 |
96 | return $this->rotate($volume, $src, $srcImgInfo, $opts['quality']);
97 | }
98 |
99 | private function rotate($volume, $src, $srcImgInfo, $quality) {
100 | if (! function_exists('exif_read_data')) {
101 | return false;
102 | }
103 | $degree = 0;
104 | $exif = exif_read_data($src);
105 | if($exif && !empty($exif['Orientation'])) {
106 | switch($exif['Orientation']) {
107 | case 8:
108 | $degree = 270;
109 | break;
110 | case 3:
111 | $degree = 180;
112 | break;
113 | case 6:
114 | $degree = 90;
115 | break;
116 | }
117 | }
118 | $opts = array(
119 | 'degree' => $degree,
120 | 'jpgQuality' => $quality,
121 | 'checkAnimated' => true
122 | );
123 | return $volume->imageUtil('rotate', $src, $opts);
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/assets/elfinder/php/plugins/Normalizer/plugin.php:
--------------------------------------------------------------------------------
1 | = 5.3.0, PECL intl >= 1.0.0)
10 | * or PEAR package "I18N_UnicodeNormalizer"
11 | *
12 | * ex. binding, configure on connector options
13 | * $opts = array(
14 | * 'bind' => array(
15 | * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre ls.pre' => array(
16 | * 'Plugin.Normalizer.cmdPreprocess'
17 | * ),
18 | * 'ls' => array(
19 | * 'Plugin.Normalizer.cmdPostprocess'
20 | * ),
21 | * 'upload.presave' => array(
22 | * 'Plugin.Normalizer.onUpLoadPreSave'
23 | * )
24 | * ),
25 | * // global configure (optional)
26 | * 'plugin' => array(
27 | * 'Normalizer' => array(
28 | * 'enable' => true,
29 | * 'nfc' => true,
30 | * 'nfkc' => true,
31 | * 'umlauts' => false,
32 | * 'lowercase' => false,
33 | * 'convmap' => array()
34 | * )
35 | * ),
36 | * // each volume configure (optional)
37 | * 'roots' => array(
38 | * array(
39 | * 'driver' => 'LocalFileSystem',
40 | * 'path' => '/path/to/files/',
41 | * 'URL' => 'http://localhost/to/files/'
42 | * 'plugin' => array(
43 | * 'Normalizer' => array(
44 | * 'enable' => true,
45 | * 'nfc' => true,
46 | * 'nfkc' => true,
47 | * 'umlauts' => false,
48 | * 'lowercase' => false,
49 | * 'convmap' => array()
50 | * )
51 | * )
52 | * )
53 | * )
54 | * );
55 | *
56 | * @package elfinder
57 | * @author Naoki Sawada
58 | * @license New BSD
59 | */
60 | class elFinderPluginNormalizer extends elFinderPlugin
61 | {
62 | private $replaced = array();
63 | private $keyMap = array(
64 | 'ls' => 'intersect',
65 | 'upload' => 'renames'
66 | );
67 |
68 | public function __construct($opts) {
69 | $defaults = array(
70 | 'enable' => true, // For control by volume driver
71 | 'nfc' => true, // Canonical Decomposition followed by Canonical Composition
72 | 'nfkc' => true, // Compatibility Decomposition followed by Canonical
73 | 'umlauts' => false, // Convert umlauts with their closest 7 bit ascii equivalent
74 | 'lowercase' => false, // Make chars lowercase
75 | 'convmap' => array()// Convert map ('FROM' => 'TO') array
76 | );
77 |
78 | $this->opts = array_merge($defaults, $opts);
79 | }
80 |
81 | public function cmdPreprocess($cmd, &$args, $elfinder, $volume) {
82 | $opts = $this->getCurrentOpts($volume);
83 | if (! $opts['enable']) {
84 | return false;
85 | }
86 | $this->replaced[$cmd] = array();
87 | $key = (isset($this->keyMap[$cmd]))? $this->keyMap[$cmd] : 'name';
88 |
89 | if (isset($args[$key])) {
90 | if (is_array($args[$key])) {
91 | foreach($args[$key] as $i => $name) {
92 | $this->replaced[$cmd][$name] = $args[$key][$i] = $this->normalize($name, $opts);
93 | }
94 | } else {
95 | $name = $args[$key];
96 | $this->replaced[$cmd][$name] = $args[$key] = $this->normalize($name, $opts);
97 | }
98 | }
99 | return true;
100 | }
101 |
102 | public function cmdPostprocess($cmd, &$result, $args, $elfinder) {
103 | if ($cmd === 'ls') {
104 | if (! empty($result['list']) && ! empty($this->replaced['ls'])) {
105 | foreach($result['list'] as $hash => $name) {
106 | if ($keys = array_keys($this->replaced['ls'], $name)) {
107 | if (count($keys) === 1) {
108 | $result['list'][$hash] = $keys[0];
109 | } else {
110 | $result['list'][$hash] = $keys;
111 | }
112 | }
113 | }
114 | }
115 | }
116 | }
117 |
118 | // NOTE: $thash is directory hash so it unneed to process at here
119 | public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume) {
120 | $opts = $this->getCurrentOpts($volume);
121 | if (! $opts['enable']) {
122 | return false;
123 | }
124 |
125 | $name = $this->normalize($name, $opts);
126 | return true;
127 | }
128 |
129 | private function normalize($str, $opts) {
130 | if ($opts['nfc'] || $opts['nfkc']) {
131 | if (class_exists('Normalizer', false)) {
132 | if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C))
133 | $str = Normalizer::normalize($str, Normalizer::FORM_C);
134 | if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC))
135 | $str = Normalizer::normalize($str, Normalizer::FORM_KC);
136 | } else {
137 | if (! class_exists('I18N_UnicodeNormalizer', false)) {
138 | include_once 'I18N/UnicodeNormalizer.php';
139 | }
140 | if (class_exists('I18N_UnicodeNormalizer', false)) {
141 | $normalizer = new I18N_UnicodeNormalizer();
142 | if ($opts['nfc'])
143 | $str = $normalizer->normalize($str, 'NFC');
144 | if ($opts['nfkc'])
145 | $str = $normalizer->normalize($str, 'NFKC');
146 | }
147 | }
148 | }
149 | if ($opts['umlauts']) {
150 | if (strpos($str = htmlentities($str, ENT_QUOTES, 'UTF-8'), '&') !== false) {
151 | $str = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $str), ENT_QUOTES, 'utf-8');
152 | }
153 | }
154 | if ($opts['convmap'] && is_array($opts['convmap'])) {
155 | $str = strtr($str, $opts['convmap']);
156 | }
157 | if ($opts['lowercase']) {
158 | if (function_exists('mb_strtolower')) {
159 | $str = mb_strtolower($str, 'UTF-8');
160 | } else {
161 | $str = strtolower($str);
162 | }
163 | }
164 | return $str;
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/assets/elfinder/php/plugins/Sanitizer/plugin.php:
--------------------------------------------------------------------------------
1 | array(
10 | * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre ls.pre' => array(
11 | * 'Plugin.Sanitizer.cmdPreprocess'
12 | * ),
13 | * 'ls' => array(
14 | * 'Plugin.Sanitizer.cmdPostprocess'
15 | * ),
16 | * 'upload.presave' => array(
17 | * 'Plugin.Sanitizer.onUpLoadPreSave'
18 | * )
19 | * ),
20 | * // global configure (optional)
21 | * 'plugin' => array(
22 | * 'Sanitizer' => array(
23 | * 'enable' => true,
24 | * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars
25 | * 'replace' => '_' // replace to this
26 | * )
27 | * ),
28 | * // each volume configure (optional)
29 | * 'roots' => array(
30 | * array(
31 | * 'driver' => 'LocalFileSystem',
32 | * 'path' => '/path/to/files/',
33 | * 'URL' => 'http://localhost/to/files/'
34 | * 'plugin' => array(
35 | * 'Sanitizer' => array(
36 | * 'enable' => true,
37 | * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars
38 | * 'replace' => '_' // replace to this
39 | * )
40 | * )
41 | * )
42 | * )
43 | * );
44 | *
45 | * @package elfinder
46 | * @author Naoki Sawada
47 | * @license New BSD
48 | */
49 | class elFinderPluginSanitizer extends elFinderPlugin
50 | {
51 | private $replaced = array();
52 | private $keyMap = array(
53 | 'ls' => 'intersect',
54 | 'upload' => 'renames'
55 | );
56 |
57 | public function __construct($opts) {
58 | $defaults = array(
59 | 'enable' => true, // For control by volume driver
60 | 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars
61 | 'replace' => '_', // replace to this
62 | 'pathAllows' => array('/') // Characters allowed in path name of characters in `targets` array
63 | );
64 |
65 | $this->opts = array_merge($defaults, $opts);
66 | }
67 |
68 | public function cmdPreprocess($cmd, &$args, $elfinder, $volume) {
69 | $opts = $this->getCurrentOpts($volume);
70 | if (! $opts['enable']) {
71 | return false;
72 | }
73 | $this->replaced[$cmd] = array();
74 | $key = (isset($this->keyMap[$cmd]))? $this->keyMap[$cmd] : 'name';
75 |
76 | if (isset($args[$key])) {
77 | if (is_array($args[$key])) {
78 | foreach($args[$key] as $i => $name) {
79 | $this->replaced[$cmd][$name] = $args[$key][$i] = $this->sanitizeFileName($name, $opts);
80 | }
81 | } else {
82 | $name = $args[$key];
83 | $this->replaced[$cmd][$name] = $args[$key] = $this->sanitizeFileName($name, $opts);
84 | }
85 | }
86 | return true;
87 | }
88 |
89 | public function cmdPostprocess($cmd, &$result, $args, $elfinder) {
90 | if ($cmd === 'ls') {
91 | if (! empty($result['list']) && ! empty($this->replaced['ls'])) {
92 | foreach($result['list'] as $hash => $name) {
93 | if ($keys = array_keys($this->replaced['ls'], $name)) {
94 | if (count($keys) === 1) {
95 | $result['list'][$hash] = $keys[0];
96 | } else {
97 | $result['list'][$hash] = $keys;
98 | }
99 | }
100 | }
101 | }
102 | }
103 | }
104 |
105 | // NOTE: $thash is directory hash so it unneed to process at here
106 | public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume) {
107 | $opts = $this->getCurrentOpts($volume);
108 | if (! $opts['enable']) {
109 | return false;
110 | }
111 |
112 | $name = $this->sanitizeFileName($name, $opts);
113 | return true;
114 | }
115 |
116 | private function sanitizeFileName($filename, $opts, $allows = array()) {
117 | $targets = $allows? array_diff($opts['targets'], $allows) : $opts['targets'];
118 | return str_replace($targets, $opts['replace'], $filename);
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/assets/elfinder/php/plugins/Watermark/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/elfinder/php/plugins/Watermark/logo.png
--------------------------------------------------------------------------------
/assets/elfinder/php/resources/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/elfinder/php/resources/image.png
--------------------------------------------------------------------------------
/assets/elfinder/php/resources/video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/elfinder/php/resources/video.png
--------------------------------------------------------------------------------
/assets/elfinder/sounds/rm.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/elfinder/sounds/rm.wav
--------------------------------------------------------------------------------
/assets/img/cron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/cron.png
--------------------------------------------------------------------------------
/assets/img/database.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/database.png
--------------------------------------------------------------------------------
/assets/img/dns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/dns.png
--------------------------------------------------------------------------------
/assets/img/email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/email.png
--------------------------------------------------------------------------------
/assets/img/emailf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/emailf.png
--------------------------------------------------------------------------------
/assets/img/filemanager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/filemanager.png
--------------------------------------------------------------------------------
/assets/img/ftp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/ftp.png
--------------------------------------------------------------------------------
/assets/img/sitebuilder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/sitebuilder.png
--------------------------------------------------------------------------------
/assets/img/subdomain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwispy/ispcfg3/46c40e53816c43230e7ba2f86b267937f2ddc6a3/assets/img/subdomain.png
--------------------------------------------------------------------------------
/assets/ispcfg3.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2019 crispy
3 |
4 | This program is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | This program is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with this program. If not, see .
16 | */
17 | .icon-ftp{
18 | background-image: url("img/ftp.png");
19 | }
20 | .icon-email{
21 | background-image: url("img/email.png");
22 | }
23 | .icon-email-forward{
24 | background-image: url("img/emailf.png");
25 | }
26 | .icon-database{
27 | background-image: url("img/database.png");
28 | }
29 | .icon-subdomain{
30 | background-image: url("img/subdomain.png");
31 | }
32 | .icon-filemanager{
33 | background-image: url("img/filemanager.png");
34 | }
35 | .icon-dns{
36 | background-image: url("img/dns.png");
37 | }
38 | .icon-sitebuilder{
39 | background-image: url("img/sitebuilder.png");
40 | }
41 | .icon-cron{
42 | background-image: url("img/cron.png");
43 | }
44 | .icon-header{
45 | background-repeat: no-repeat;
46 | width:64px;
47 | height:64px;
48 | display:block;
49 | }
50 | .container3 {
51 | width: 80%;
52 | margin: 10px auto 0px auto;
53 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
54 | color: #333;
55 | font-size: 14px;
56 | line-height: 16px;
57 | }
58 | /* .error-alert {
59 | padding: 15px;
60 | background-color: #F2DEDE;
61 | border: 1px solid #EBCCD1;
62 | border-radius: 4px;
63 | color: #A94442;
64 | margin: 10px 0;
65 | }*/
66 | .tbl-websites {
67 | border: none;
68 | border-collapse: collapse;
69 | width: 100%;
70 | }
71 | .tbl-websites th,
72 | .tbl-websites td {
73 | border: 1px solid #DDD;
74 | border-collapse: collapse;
75 | padding: 8px;
76 | text-align: left;
77 | }
78 |
--------------------------------------------------------------------------------
/assets/js/ajax.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * ISPConfig v3.1+ module for WHMCS v7.x or Higher
4 | * Copyright (C) 2014 - 2018 Shane Chrisp
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | *
19 | */
20 | function doAjaxPost(type,url,data,oResponse,oMessage,oLoading,extraData) {
21 | var loaderType = "";
22 | if (extraData != "" || extraData != "undefined") {
23 | loaderType = extraData['loader-type'];
24 | responseType = extraData['response-type'];
25 | }
26 |
27 | hideMessage(oMessage);
28 | showLoading(oLoading,loaderType);
29 |
30 | $.ajax({
31 | cache: false,
32 | timeout: 60000,
33 | type: type,
34 | url: url,
35 | data: data,
36 | dataType: "json",
37 | success: function(resp){
38 | hideLoading(oLoading,loaderType);
39 | if (oResponse != undefined && resp.data != undefined) {
40 | if (responseType == "prepend") {
41 | oResponse.prepend(resp.data);
42 | }
43 | else if (responseType == "append") {
44 | oResponse.append(resp.data);
45 | }
46 | else {
47 | oResponse.html(resp.data);
48 | }
49 | }
50 | if (resp.status == "error") {
51 | if (resp.message != undefined) {
52 | showMessage("error",resp.message,oMessage);
53 | }
54 |
55 | var callbackOnError = extraData['callback-on-error'];
56 | if (typeof(callbackOnError) !== undefined && callbackOnError != "") {
57 | eval(callbackOnError);
58 | }
59 |
60 | }
61 | else if (resp.status == "success") {
62 | if (resp.message != undefined && resp.message != "") {
63 | showMessage("success",resp.message,oMessage);
64 | }
65 |
66 | var callback = extraData['callback'];
67 | if (typeof(callback) !== undefined && callback != "") {
68 | eval(callback);
69 | }
70 |
71 | var callbackOnSuccess = extraData['callback-on-success'];
72 | if (typeof(callbackOnSuccess) !== undefined && callbackOnSuccess != "") {
73 | eval(callbackOnSuccess);
74 | }
75 |
76 | }
77 | if (resp.response_callback != undefined) {
78 | eval(resp.response_callback);
79 | }
80 | if (resp.goto != undefined) {
81 | document.location = resp.goto;
82 | }
83 | },
84 | error: function(xhr,textStatus,thrownError){
85 | if (textStatus == "timeout") {
86 | var instanceID = "ajaxID"+Math.floor((Math.random()*100)+1);
87 | showMessage("error","Request has taken too long. This is usually caused by slow internet connection. Try again ",oMessage);
88 | $(oMessage).find('#'+instanceID).click(function(){
89 | doAjaxPost(type,url,data,oResponse,oMessage,oLoading,extraData);
90 | });
91 | }
92 | else {
93 | alert(xhr.responseText);
94 | alert(thrownError);
95 | showMessage("error","There was an error processing your request. Please try again.",oMessage);
96 | }
97 | hideLoading(oLoading,loaderType);
98 | }
99 | });
100 | }
101 |
102 | function showLoading(oElement,loaderType) {
103 | oElement = (oElement != undefined && oElement != "" && oElement != null) ? oElement : $("body");
104 | if (loaderType == "inside-button") oElement.parent().attr("disabled",true);
105 | oElement.html(' ').show();
106 | }
107 |
108 | function hideLoading(oElement,loaderType) {
109 | if (oElement != undefined && oElement != "" && oElement != null) {
110 | oElement.find('#loading').html("").hide();
111 | if (loaderType == "inside-button") oElement.parent().attr("disabled",false);
112 | }
113 | }
114 |
115 | function showMessage(type,message,oElement) {
116 | oElement = (oElement != undefined && oElement != "" && oElement != null) ? oElement : $("#global-messages");
117 | if (type == "error") type = "danger";
118 | if (oElement.length > 0) {
119 | oElement.hide();
120 | oElement.html('');
121 | oElement.fadeIn('slow');
122 | $("html,body").animate({ scrollTop : oElement.offset().top-100 }, 1000);
123 | }
124 | }
125 |
126 | function hideMessage(oElement) {
127 | oElement = (oElement != undefined && oElement != "" && oElement != null) ? oElement : $("#global-messages");
128 | oElement.children().fadeOut('slow');
129 | }
130 |
131 | function doFormPost(frmName) {
132 | oElement = (oElement != undefined && oElement != "") ? oElement : ".error";
133 | $(oElement)
134 | .html(message)
135 | .slideDown('fast')
136 | }
137 |
138 | function ajaxify(mainContainer) {
139 | var oParams = mainContainer.find('#ajax-params');
140 |
141 | if (oParams.size() == 0) {
142 | return false;
143 | }
144 |
145 | var pMessages = oParams.attr('data-messages-position');
146 | var pResponse = oParams.attr('data-response-position');
147 | var pLoader = oParams.attr('data-loader-position');
148 |
149 | if (typeof(pMessages) === "undefined" || pMessages == "") pMessages = "inside";
150 | if (typeof(pResponse) === "undefined" || pResponse == "") pResponse = "inside";
151 | if (typeof(pLoader) === "undefined" || pLoader == "") pLoader = "inside";
152 |
153 | var jMessages = oParams.attr('data-messages');
154 | var jResponse = oParams.attr('data-response');
155 | var jLoader = oParams.attr('data-loader');
156 | if (typeof(jMessages) !== "undefined") {
157 | jMessages = (pMessages == "inside") ? mainContainer.find(jMessages) : $(jMessages);
158 | }
159 | if (typeof(jResponse) !== "undefined") {
160 | jResponse = (pResponse == "inside") ? mainContainer.find(jResponse) : $(jResponse);
161 | }
162 | if (typeof(jLoader) !== "undefined") {
163 | jLoader = (pLoader == "inside") ? mainContainer.find(jLoader) : $(jLoader);
164 | }
165 |
166 | var extraData = new Array();
167 | tLoader = oParams.attr('data-loader-type');
168 | tResponse = oParams.attr('data-response-type');
169 |
170 | if (typeof(tLoader) === "undefined" || tLoader == "") tLoader = "inside-button";
171 | if (typeof(tResponse) === "undefined" || tResponse == "") tResponse = "replace";
172 |
173 | extraData['loader-type'] = tLoader;
174 | extraData['response-type'] = tResponse;
175 | extraData['callback'] = oParams.attr('data-callback');
176 | extraData['callback-on-success'] = oParams.attr('data-callback-on-success');
177 | extraData['callback-on-error'] = oParams.attr('data-callback-on-error');
178 |
179 | var formAction = oParams.attr('data-action');
180 | var formData = oParams.attr('data-querystring');
181 | var formMethod = oParams.attr('data-method');
182 |
183 | if (typeof(formMethod) === "undefined") formMethod = "GET";
184 | formMethod.toUpperCase();
185 |
186 | var jConfirm = oParams.attr('data-confirm');
187 | if (typeof(jConfirm) !== "undefined") {
188 | if (jConfirm == "false") {
189 | return false;
190 | }
191 | else {
192 | strConfirm = (jConfirm != "true") ? jConfirm : "Do you really want to continue?";
193 | var rConfirm = confirm(strConfirm);
194 | if (!rConfirm) {
195 | return false;
196 | }
197 | }
198 | }
199 |
200 | doAjaxPost(formMethod,formAction,formData,jResponse,jMessages,jLoader,extraData);
201 |
202 | return false;
203 | }
204 |
205 | function ajaxifyForm(thisForm) {
206 | oParams = thisForm.find('#ajax-params');
207 | oParams.attr('data-querystring',thisForm.serialize());
208 | ajaxify(thisForm);
209 | }
210 |
211 | $(document).ready(function(){
212 | $('.ajaxifyMyForm').each(function(){
213 | var mainContainer = $(this);
214 | $(this).find('form').eq(0).submit(function(e){
215 | e.preventDefault();
216 | oParams = mainContainer.find('#ajax-params');
217 | oParams.attr('data-querystring',$(this).serialize());
218 | ajaxify(mainContainer);
219 | });
220 | });
221 |
222 | $('.ajaxifyMeNow').each(function(){
223 | var mainContainer = $(this);
224 | ajaxify(mainContainer);
225 | });
226 |
227 | $('.ajax-form').each(function(){
228 | $(this).submit(function(){
229 | ajaxifyForm($(this));
230 | return false;
231 | });
232 | });
233 |
234 | $('.ajaxifyButton').each(function(){
235 | var mainContainer = $(this);
236 | $(this).click(function(e){
237 | e.preventDefault();
238 | ajaxify(mainContainer);
239 | });
240 | });
241 | });
242 |
--------------------------------------------------------------------------------
/assets/js/script.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * ISPConfig v3.1+ module for WHMCS v7.x or Higher
4 | * Copyright (C) 2014 - 2018 Shane Chrisp
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | *
19 | */
20 | $(document).ready(function(){
21 | if (jQuery().dataTable) {
22 | if ($(".dataTable tr td[colspan]").size() == 0) {
23 | $(".dataTable").dataTable({paging:false,info:false,aaSorting:[]});
24 | }
25 | }
26 |
27 | $('.ihost-smart-table tr #btnAction').each(function(){
28 | $(this).on('click', function(e){
29 | var rawValues = $(this).attr('data-target-values');
30 | var target = $(this).attr('data-target');
31 | var values = {};
32 | rawValues.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"),function($0, $1, $2, $3) {values[$1] = $3;});
33 | if (rawValues.length > 0) {
34 | $.each(values, function(key, val){
35 | var elementTarget = $(target).find('#'+key);
36 | var elementTargetTagName = elementTarget.prop("tagName");
37 | var elementTargetType = elementTarget.attr("type");
38 | if (elementTargetTagName == 'INPUT' && ['text','password','hidden','number'].indexOf(elementTargetType) > -1) {
39 | elementTarget.val(val);
40 | }
41 | else if (elementTargetTagName == 'SELECT') {
42 | elementTarget.val(val);
43 | }
44 | else {
45 | elementTarget.html(val);
46 | }
47 | });
48 | }
49 | });
50 | });
51 |
52 | $('.ajaxCpLogin').each(function(){
53 | var url = $(this).attr('data-url');
54 | var username = $(this).attr('data-username');
55 | var password = $(this).attr('data-password');
56 | var destination = $(this).attr('data-redirect');
57 | doAjaxCpLogin(url, username, password, destination);
58 | });
59 |
60 |
61 |
62 |
63 |
64 |
65 | $('.elfinderInit').each(function(){
66 | var ftpData = $(this).attr('data-custom-ftp-data');
67 | $(this).elfinder({
68 | url : 'modules/servers/ispcfg3/elfinder.connector.php',
69 | customData: {ftp: ftpData}
70 | });
71 | });
72 |
73 | $('#common_settings').on('change', function(e){
74 | var common_settings_val = $(this).val();
75 | var group = $(this).attr('data-group');
76 |
77 | var children_container = (group == 'add') ? '#frmAdd' : '#frmEdit';
78 |
79 | $(children_container).find('#minute_val,#hour_val,#day_val,#month_val,#weekday_val,#minute_freq,#hour_freq,#day_freq,#month_freq,#weekday_freq').val('');
80 |
81 | var arrVals = common_settings_val.split(" ");
82 | if (arrVals.length == 5) {
83 | $(children_container).find('#minute_val').val(arrVals[0]);
84 | $(children_container).find('#hour_val').val(arrVals[1]);
85 | $(children_container).find('#day_val').val(arrVals[2]);
86 | $(children_container).find('#month_val').val(arrVals[3]);
87 | $(children_container).find('#weekday_val').val(arrVals[4]);
88 | }
89 | });
90 |
91 | $('#frmAdd,#frmEdit').find('#minute_freq,#hour_freq,#day_freq,#month_freq,#weekday_freq').on('change', function(e){
92 | var target = $(this).parent().siblings().find('input');
93 | var val = $(this).val();
94 | target.val(val);
95 | });
96 |
97 |
98 | $('[data-view="dns"] #modalAdd, [data-view="dns"] #modalEdit').on('shown.bs.modal', function(e){
99 | $('#frmAdd #zone, #frmEdit #zone').each(function(){
100 | updateZone($(this));
101 | });
102 |
103 | $('#frmAdd #zone, #frmEdit #zone').on('change',function(){
104 | updateZone($(this));
105 | });
106 | });
107 | });
108 |
109 | var updateZone = function(selector) {
110 | var selected = selector.find(':selected');
111 | var selectedVal = selected.length > 0 ? selected.html().slice(0, -1) : '';
112 | if (selectedVal) {
113 | var parentForm = selector.parents('form');
114 | parentForm.find('.zone-placeholder').html(selectedVal);
115 | }
116 | }
117 |
118 | var doAjaxCpLogin = function(url, username, password, destination) {
119 | $.ajax({
120 | type: "POST",
121 | url: url,
122 | data: "s_mod=login&s_pg=index&username=" + username + "&passwort=" + password,
123 | xhrFields: {withCredentials: true},
124 | success: function(data) {
125 | window.location.href = destination;
126 | },
127 | error: function(xhr,textStatus,thrownError){
128 | window.location.href = destination;
129 | }
130 | });
131 | }
132 |
--------------------------------------------------------------------------------
/elfinder.connector.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if(file_exists(dirname(dirname(dirname(dirname(__FILE__)))) .'/init.php')){
21 | require(dirname(dirname(dirname(dirname(__FILE__)))) .'/init.php');
22 | }
23 |
24 | include('functions/base.php');
25 |
26 | error_reporting(0); // Set E_ALL for debuging
27 |
28 | global $CONFIG;
29 |
30 | $whmcsurl = ($CONFIG['SystemSSLURL']) ? $CONFIG['SystemSSLURL'] : $CONFIG['SystemURL'];
31 |
32 | include_once ELFINDER_DIR.'php'.DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
33 | include_once ELFINDER_DIR.'php'.DIRECTORY_SEPARATOR.'elFinder.class.php';
34 | include_once ELFINDER_DIR.'php'.DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
35 | include_once ELFINDER_DIR.'php'.DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
36 | include_once ELFINDER_DIR.'php'.DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
37 |
38 | $ftpDataRaw = @$_REQUEST['ftp'];
39 | if ($ftpDataRaw) {
40 | $ftpData = json_decode(base64_decode($ftpDataRaw),true);
41 | }
42 |
43 | if (isset($ftpData) && $ftpData) {
44 | //$ip = gethostbyname($ftpData['host']);
45 | $opts = array(
46 | // 'debug' => true,
47 | 'roots' => array(
48 | array(
49 | 'driver' => 'FTP',
50 | //'host' => '',
51 | // 'user' => '',
52 | // 'pass' => '',
53 | 'host' => $ftpData['host'],
54 | 'user' => $ftpData['user'],
55 | 'pass' => $ftpData['pass'],
56 | 'uploadMaxSize' => '2M',
57 | 'alias' => 'Home',
58 | 'imgLib' => 'auto',
59 | 'mimeDetect' => 'internal',
60 | 'fileMode' => 0644, // new files mode
61 | 'dirMode' => 0755,
62 | 'uploadAllow' => array('all'),// Mimetype `image` and `text/plain` allowed to upload
63 | 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
64 | // 'uploadAllow' => array('image'), # allow any images
65 | 'dragUploadAllow' => 'auto',
66 | 'mode' => 'passive',
67 | 'tmbPath' => '/tmp2/',
68 | 'tmbURL' => '/tmp2/',
69 | 'tmpPath' => '/tmp/',
70 | 'tmbCrop' => false,
71 | 'owner' => true,
72 | 'path' => '/web/'
73 | )
74 | )
75 | );
76 |
77 | // run elFinder
78 | $connector = new elFinderConnector(new elFinder($opts));
79 | $connector->run();
80 | }
--------------------------------------------------------------------------------
/hooks.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 |
21 | use WHMCS\Database\Capsule;
22 |
23 | add_hook('ClientAreaSidebars', 1, function($vars) {
24 |
25 | /*
26 | * Get Site.pro and filemanager settings from Database.
27 | */
28 | $prodid = Capsule::table('tblhosting')
29 | ->select('packageid')
30 | ->where('id', $_GET['id'])
31 | ->get();
32 |
33 | $confd = Capsule::table('tblproducts')
34 | ->where('id', $prodid[0]->packageid)
35 | ->get();
36 |
37 | if (function_exists('cwispy_handle_view')) {
38 | $currentRequest = $_GET;
39 |
40 | $primarySidebar = Menu::primarySidebar();
41 | $secondarySidebar = Menu::secondarySidebar();
42 | //$submodsettings = explode( ',',$params['configoption11'] );
43 | //$submodsettings[0]
44 |
45 | $accountMenu = $primarySidebar->addChild(
46 | 'ispcfg3 ISPConfig Account Nav',
47 | array(
48 | 'label' => (Lang::trans('ispcfg3_product_tools')),
49 | 'order' => 10,
50 | 'icon' => 'fa-cog',
51 | )
52 | );
53 |
54 | $accountMenu->addChild('Overview')
55 | ->setUri(cwispy_create_url(array('view' => 'overview')))
56 | ->setLabel(Lang::trans('ispcfg3_product_details'))
57 | ->setOrder(1)
58 | ->setIcon('fa-info-circle')
59 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'overview')));
60 |
61 | if ( !empty( $confd[0]->configoption17 ) || ( $confd[0]->configoption17 != '' ) ) {
62 | $accountMenu->addChild('Site Builder')
63 | ->setUri(cwispy_create_url(array('view' => 'sitebuilder')))
64 | ->setLabel('Site Builder')
65 | ->setOrder(1)
66 | ->setIcon('fa-pencil-square-o')
67 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'sitebuilder')));
68 | }
69 | if ( !empty( $confd[0]->configoption18 ) || ( $confd[0]->configoption18 != '' ) ) {
70 | $accountMenu->addChild('File Manager')
71 | ->setUri(cwispy_create_url(array('view' => 'file-manager')))
72 | ->setLabel(Lang::trans('ispcfg3_file_manager'))
73 | ->setOrder(3)
74 | ->setIcon('fa-file')
75 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'file-manager')));
76 | }
77 | $accountMenu->addChild('Emails')
78 | ->setUri(cwispy_create_url(array('view' => 'emails')))
79 | ->setLabel(Lang::trans('ispcfg3_emails'))
80 | ->setOrder(4)
81 | ->setIcon('fa-envelope')
82 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'emails')));
83 |
84 |
85 | $accountMenu->addChild('Email Forwarders')
86 | ->setUri(cwispy_create_url(array('view' => 'email-forwarders')))
87 | ->setLabel(Lang::trans('ispcfg3_email_forwarders'))
88 | ->setOrder(5)
89 | ->setIcon('fa-forward')
90 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'email-forwarders')));
91 |
92 |
93 | $accountMenu->addChild('FTP Accounts')
94 | ->setUri(cwispy_create_url(array('view' => 'ftp-accounts')))
95 | ->setLabel(Lang::trans('ispcfg3_ftp_accounts'))
96 | ->setOrder(6)
97 | ->setIcon('fa-files-o')
98 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'ftp-accounts')));
99 |
100 |
101 | $accountMenu->addChild('Databases')
102 | ->setUri(cwispy_create_url(array('view' => 'databases')))
103 | ->setLabel(Lang::trans('ispcfg3_databases'))
104 | ->setOrder(7)
105 | ->setIcon('fa-database')
106 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'databases')));
107 |
108 | $accountMenu->addChild('Websites')
109 | ->setUri(cwispy_create_url(array('view' => 'websites')))
110 | ->setLabel(Lang::trans('ispcfg3_websites'))
111 | ->setOrder(8)
112 | ->setIcon('fa-desktop')
113 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'websites')));
114 |
115 | $accountMenu->addChild('Alias Domains')
116 | ->setUri(cwispy_create_url(array('view' => 'aliasdomains')))
117 | ->setLabel(Lang::trans('ispcfg3_alias_domains'))
118 | ->setOrder(9)
119 | ->setIcon('fa-plus-circle')
120 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'aliasdomains')));
121 |
122 |
123 | $accountMenu->addChild('Sub Domains')
124 | ->setUri(cwispy_create_url(array('view' => 'subdomains')))
125 | ->setLabel(Lang::trans('ispcfg3_sub_domains'))
126 | ->setOrder(10)
127 | ->setIcon('fa-sitemap')
128 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'subdomains')));
129 |
130 |
131 | $accountMenu->addChild('Cron Jobs')
132 | ->setUri(cwispy_create_url(array('view' => 'cron')))
133 | ->setLabel(Lang::trans('ispcfg3_cron_jobs'))
134 | ->setOrder(11)
135 | ->setIcon('fa-clock-o')
136 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'cron')));
137 |
138 |
139 | $accountMenu->addChild('DNS Records')
140 | ->setUri(cwispy_create_url(array('view' => 'dns')))
141 | ->setLabel(Lang::trans('ispcfg3_dns_records'))
142 | ->setOrder(12)
143 | ->setIcon('fa-external-link')
144 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'dns')));
145 |
146 |
147 | $accountMenu->addChild('Usage Statistics')
148 | ->setUri(cwispy_create_url(array('view' => 'usage')))
149 | ->setLabel(Lang::trans('ispcfg3_usage_stats'))
150 | ->setOrder(13)
151 | ->setIcon('fa-area-chart')
152 | ->setClass(cwispy_get_menu_item_class($currentRequest, array('view' => 'usage')));
153 |
154 |
155 | $loginMenu = $primarySidebar->addChild(
156 | 'iHost ISPConfig Login Nav',
157 | array(
158 | 'label' => (Lang::trans('ispcfg3_login_to')),
159 | 'order' => 14,
160 | 'icon' => 'fa-lock',
161 | )
162 | );
163 |
164 | $loginMenu->addChild('View Statistics')
165 | ->setUri(cwispy_create_url(array('view' => 'login', 'view_action' => 'stats')))
166 | ->setLabel(Lang::trans('ispcfg3_website_statistics'))
167 | ->setOrder(2)
168 | ->setIcon('fa-bar-chart')
169 | ->setAttribute('target', '_blank');
170 |
171 |
172 | $loginMenu->addChild('Webmail')
173 | ->setUri(cwispy_create_url(array('view' => 'login', 'view_action' => 'webmail')))
174 | ->setLabel('Webmail')
175 | ->setOrder(3)
176 | ->setIcon('fa-envelope')
177 | ->setAttribute('target', '_blank');
178 |
179 |
180 | $loginMenu->addChild('phpMyAdmin')
181 | ->setUri(cwispy_create_url(array('view' => 'login', 'view_action' => 'phpmyadmin')))
182 | ->setLabel('phpMyAdmin')
183 | ->setOrder(4)
184 | ->setIcon('fa-database')
185 | ->setAttribute('target', '_blank');
186 |
187 | }
188 | });
189 |
190 | add_hook('ClientAreaFooterOutput', 1, function($vars) {
191 | if (function_exists('cwispy_handle_view')) {
192 | $script = '
193 |
194 |
195 | ';
196 | return $script;
197 | }
198 | });
199 |
--------------------------------------------------------------------------------
/lang/english.php:
--------------------------------------------------------------------------------
1 | .
17 | */
18 | *}
19 |
20 | {$LANG.ispcfg3_manage_email_forwarders} ({$params.domain})
21 | {$LANG.ispcfg3_manage_email_forwarders_desc}
22 |
23 | {$LANG.ispcfg3_current_forwarders} ( {$variables.forwarders|@count} {$LANG.ispcfg3_of} {If $variables.client.limit_mailforward == -1} {$LANG.ispcfg3_unlimited} {else}{$variables.client.limit_mailforward}{/If} )
24 |
25 |
26 | {$LANG.ispcfg3_add_forwarder}
31 |
32 |
33 | {if is_array($variables.forwarders) && count($variables.forwarders) > 0}
34 |
35 | {$LANG.ispcfg3_source} {$LANG.ispcfg3_destination}
36 |
37 | {foreach $variables.forwarders as $forwarder}
38 |
39 | {$forwarder.source}
40 | {$forwarder.destination}
41 |
42 | {If $variables.client.locked == "y" || $variables.client.canceled == "y"}
43 |
44 | {else}
45 |
46 |
47 | {/If}
48 |
49 |
50 | {/foreach}
51 |
52 |
53 | {else}
54 | {$LANG.ispcfg3_no_email_forwarders_found}
55 | {*$variables|print_r*}
56 | {/if}
57 |
58 |
104 |
105 |
106 |
107 |
108 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
124 |
125 |
131 |
132 |
133 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
{$LANG.ispcfg3_delete_email_forwarder_desc}
155 |
156 |
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/templates/error.tpl:
--------------------------------------------------------------------------------
1 | {*
2 | /* ISPConfig v3.1+ module for WHMCS v7.x or Higher
3 | * Copyright (C) 2014 - 2018 Shane Chrisp
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | *}
19 | Oops! Something went wrong.
20 |
21 | {if is_array($usefulErrorHelper) && count($usefulErrorHelper) > 0}
22 | {foreach $usefulErrorHelper as $error}
23 |
{$error}
24 | {/foreach}
25 | {else}
26 |
{$usefulErrorHelper}
27 | {/if}
28 |
29 |
30 | Please go back and try again.
31 |
32 | If the problem persists, please contact support.
--------------------------------------------------------------------------------
/templates/file-manager.tpl:
--------------------------------------------------------------------------------
1 | {*
2 | /* ISPConfig v3.1+ module for WHMCS v6.x or Higher
3 | * Copyright (C) 2014 - 2018 Shane Chrisp
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | *}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | File Manager ({$params.domain})
30 | Here you can manage the files on your website. You can upload, edit or create new files and folders. You can drag and drop files from your desktop to thr current open folder. To edit a file or folder right click it to get the menu. If you are uploading many files do use an ftp program like Filezilla .
31 |
32 |
--------------------------------------------------------------------------------
/templates/login.tpl:
--------------------------------------------------------------------------------
1 | {*
2 | /* ISPConfig v3.1+ module for WHMCS v7.x or Higher
3 | * Copyright (C) 2014 - 2018 Shane Chrisp
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | *}
19 | {if $request.view_action eq "ispconfig"}
20 |
21 |
logging in to the control panel...
22 |
23 |
24 |
25 | {/if}
26 | {if $request.view_action eq "stats"}
27 |
28 |
logging in to the website statistics ...
29 |
30 |
31 |
32 |
33 | {/if}
--------------------------------------------------------------------------------
/templates/sitebuilder.tpl:
--------------------------------------------------------------------------------
1 | {*
2 | /* ISPConfig v3.1+ module for WHMCS v7.x or Higher
3 | * Copyright (C) 2014 - 2018 Shane Chrisp
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | *}
19 |
20 |
21 | {If $variables.sitepro.enabled == 1}
22 | Create or Edit your website - {$params.domain}
23 | SiteBuilder is a web publishing tool. It enables you to put information on
24 | your own websites quickly and easily. You can maintain your website through
25 | a web browser using SiteBuilder's editing tools. You don't need any
26 | specialist software or web programming skills.
27 |
28 |
29 |
30 |
31 |
My Website
32 |
33 |
34 |
35 |
36 | Website
37 | Functions
38 |
39 |
40 |
41 |
42 | {$params.domain}
43 | Create/Edit Website
44 |
45 |
46 |
47 |
48 |
49 | {else}
50 | Create or Edit your website - {$params.domain}
51 | Sorry this feature is not currently available.
52 |
53 | {/If}
--------------------------------------------------------------------------------
/templates/usage.tpl:
--------------------------------------------------------------------------------
1 | {*
2 | /* ISPConfig v3.1+ module for WHMCS v7.x or Higher
3 | * Copyright (C) 2014 - 2018 Shane Chrisp
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | *}
19 |
20 | Usage ({$params.domain})
21 | In this area you can see the data and bandwidth usage of your hosting.
22 |
23 | Add Email
24 |
25 | Website Harddisk Quota
26 |
27 |
28 |
29 | Domain/Website
30 | Used space
31 | Soft Limit
32 | Hard Limit
33 |
34 |
35 |
36 | {foreach $variables.disk as $siteusage}
37 |
38 | {$siteusage.domain}
39 |
40 | {{$siteusage.used /1024}|number_format:2} MB
41 |
42 |
43 | {{$siteusage.soft /1024}|number_format:2} MB
44 |
45 |
46 | {{$siteusage.hard /1024}|number_format:2} MB
47 |
48 |
49 |
50 |
51 |
52 | {/foreach}
53 |
54 |
55 |
56 |
57 | Mailbox Quota
58 |
59 |
60 |
61 | Email Address
62 | Name
63 | Used Space
64 | Quota
65 |
66 |
67 |
68 | {foreach $variables.maildisk as $mailusage}
69 |
70 | {$mailusage.email}
71 |
72 | {$mailusage.name}
73 |
74 |
75 | {{$mailusage.used / 1048576}|number_format:2} MB
76 |
77 |
78 | {{$mailusage.quota_raw / 1048576}|number_format:2} MB
79 |
80 |
81 |
82 |
83 |
84 | {/foreach}
85 |
86 |
87 |
88 |
89 | Database Quota
90 |
91 |
92 |
93 | Database Name
94 | Used Space
95 | Quota
96 |
97 |
98 |
99 | {foreach $variables.databasedisk as $databasedisk}
100 |
101 | {$databasedisk.database_name}
102 |
103 | {{$databasedisk.used / 1048576}|number_format:2} MB
104 |
105 |
106 | {If $databasedisk.quota_raw == ''||$databasedisk.quota_raw == '-1'}Unlimited{else}{$databasedisk.quota_raw} MB{/If}
107 |
108 |
109 |
110 |
111 |
112 | {/foreach}
113 |
114 |
115 |
--------------------------------------------------------------------------------
/views/SiteProApiClient.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 |
21 | namespace Profis\SitePro;
22 |
23 | use ErrorException;
24 |
25 | class SiteProApiClient {
26 |
27 | /** @var string */
28 | protected $apiUrl;
29 | protected $apiUser;
30 | protected $apiPass;
31 |
32 | public function __construct($apiUrl, $apiUsername, $apiPassword) {
33 | $this->apiUrl = $apiUrl;
34 | $this->apiUser = $apiUsername;
35 | $this->apiPass = $apiPassword;
36 | }
37 |
38 | public function remoteCall($method, $params) {
39 | $url = $this->apiUrl.$method;
40 |
41 | $ch = curl_init();
42 | curl_setopt($ch, CURLOPT_URL, $url);
43 | curl_setopt($ch, CURLOPT_USERAGENT, 'Site.pro API Client/1.0.1 (PHP '.phpversion().')');
44 | curl_setopt($ch, CURLOPT_POST, true);
45 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
46 | curl_setopt($ch, CURLOPT_HTTPHEADER, array(
47 | 'Connection: Close',
48 | 'Content-Type: application/json',
49 | ));
50 | curl_setopt($ch, CURLOPT_TIMEOUT, 300);
51 | curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
52 | curl_setopt($ch, CURLOPT_USERPWD, $this->apiUser.':'.$this->apiPass);
53 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
54 |
55 | $r = curl_exec($ch);
56 | $errNo = curl_errno($ch);
57 | $errMsg = curl_error($ch);
58 | $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
59 | curl_close($ch);
60 |
61 | if ($errNo) {
62 | $res = null;
63 | throw new ErrorException('Curl Error ('.$errNo.'): '.$errMsg);
64 | }
65 |
66 | if ($status != 200) {
67 | $res = json_decode($r);
68 | if (!$res) {
69 | $res = null;
70 | throw new ErrorException('Response Code ('.$status.')');
71 | }
72 | } else {
73 | $res = json_decode($r);
74 | }
75 |
76 | return $res;
77 | }
78 |
79 | }
--------------------------------------------------------------------------------
/views/aliasdomains.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['aliasdomain']) || !$_REQUEST['aliasdomain']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Aliasdomain is required'));
24 | }
25 | if ( (!isset($_REQUEST['aliasdomain'] ) ) || ( !$_REQUEST['aliasdomain'] ) ) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'From Domain is required'));
27 |
28 | } else if ( ( isset($_REQUEST['aliasdomain'] ) ) || ( $_REQUEST['aliasdomain'] ) ) {
29 | if ( ( checkdnsrr($_REQUEST['aliasdomain'], 'A') ) === FALSE ) {
30 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'You must enter a valid From Domain'));
31 | }
32 | }
33 |
34 | $document_root = '';
35 | if (isset($_REQUEST['directory']) && $_REQUEST['directory']) {
36 | $document_root .= '/'.$_REQUEST['directory'].'/';
37 | $document_root = str_replace("//","/",$document_root);
38 | }
39 |
40 | $options = array(
41 | 'server_id' => $_REQUEST['server_id'],
42 | 'domain' => $_REQUEST['aliasdomain'],
43 | 'parent_domain_id' => $_REQUEST['domain_id'],
44 | 'type' => 'alias',
45 | 'redirect_type' => $_REQUEST['redirect_type'],
46 | 'redirect_path' => $document_root,
47 | 'seo_redirect' => $_REQUEST['seo_redirect'],
48 | 'active' => 'y',
49 | 'ihost_zone_domain' => $_REQUEST['domain'].'.',
50 | );
51 |
52 | $create = cwispy_soap_request($params, 'sites_web_aliasdomain_add', $options);
53 | if ($create['status'] == 'success') {
54 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Aliasdomain created successfully'));
55 | }
56 | else {
57 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
58 | }
59 | }
60 | elseif ($_GET['view_action'] == 'edit') {
61 | if (!isset($_REQUEST['aliasdomain']) || !$_REQUEST['aliasdomain']) {
62 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Aliasdomain is required'));
63 | }
64 | if (!isset($_REQUEST['directory']) || !$_REQUEST['directory']) {
65 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'You must enter a Redirect Path.'));
66 | }
67 |
68 | $document_root = '';
69 | if (isset($_REQUEST['directory']) && $_REQUEST['directory']) {
70 | $document_root .= '/'.$_REQUEST['directory'].'/';
71 | $document_root = str_replace("//","/",$document_root);
72 | }
73 |
74 | $options = array(
75 | 'domain_id' => $_REQUEST['aliasdomain_id'],
76 | 'domain' => $_REQUEST['aliasdomain'],
77 | 'parent_domain_id' => $_REQUEST['domain_id'],
78 | 'server_id' => $_REQUEST['server_id'],
79 | 'type' => 'alias',
80 | 'redirect_type' => $_REQUEST['redirect_type'],
81 | 'redirect_path' => $document_root,
82 | 'seo_redirect' => $_REQUEST['seo_redirect'],
83 | 'active' => 'y'
84 | );
85 |
86 | $update = cwispy_soap_request($params, 'sites_web_aliasdomain_update', $options);
87 | if ($update['status'] == 'success') {
88 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Aliasdomain updated successfully'));
89 | }
90 | else {
91 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
92 | }
93 | }
94 | elseif ($_GET['view_action'] == 'delete') {
95 | $options = array(
96 | 'id' => $_REQUEST['aliasdomain_id']
97 | );
98 |
99 | $delete = cwispy_soap_request($params, 'sites_web_aliasdomain_delete', $options);
100 | if ($delete['status'] == 'success') {
101 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Aliasdomain deleted successfully'));
102 | }
103 | else {
104 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
105 | }
106 | }
107 | else {
108 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
109 | }
110 | }
111 | else {
112 | $domains = cwispy_soap_request($params, 'sites_web_domain_get');
113 | $client = cwispy_soap_request($params, 'client_get');
114 | $aliasdomains = cwispy_soap_request($params, 'sites_web_aliasdomain_get');
115 |
116 | $return = array_merge_recursive($domains, $aliasdomains, $client);
117 |
118 | if ($domains) {
119 | foreach($domains['response']['domains'] as $domain) {
120 | $return['response']['domains_processed'][$domain['domain_id']] = $domain;
121 | }
122 | }
123 |
124 | if (is_array($return['status'])) {
125 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
126 | }
127 |
128 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'aliasdomains', 'view_action' => 'add'));
129 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'aliasdomains', 'view_action' => 'edit'));
130 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'aliasdomains', 'view_action' => 'delete'));
131 | }
--------------------------------------------------------------------------------
/views/cron.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['minute_val']) || NULL == $_REQUEST['minute_val']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Minute is required'));
24 | }
25 | if (!isset($_REQUEST['hour_val']) || NULL == $_REQUEST['hour_val']) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Hour is required'));
27 | }
28 | if (!isset($_REQUEST['day_val']) || !$_REQUEST['day_val']) {
29 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Day is required'));
30 | }
31 | if (!isset($_REQUEST['month_val']) || !$_REQUEST['month_val']) {
32 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Month is required'));
33 | }
34 | if (!isset($_REQUEST['weekday_val']) || NULL == $_REQUEST['weekday_val']) {
35 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Weekday is required'));
36 | }
37 | if (!isset($_REQUEST['command']) || !$_REQUEST['command']) {
38 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Command is required'));
39 | }
40 |
41 | $options = array(
42 | 'server_id' => $_REQUEST['server_id'],
43 | 'command' => $_REQUEST['command'],
44 | 'run_min' => $_REQUEST['minute_val'],
45 | 'run_hour' => $_REQUEST['hour_val'],
46 | 'run_mday' => $_REQUEST['day_val'],
47 | 'run_month' => $_REQUEST['month_val'],
48 | 'run_wday' => $_REQUEST['weekday_val'],
49 | 'active' => 'y'
50 | );
51 |
52 | $create = cwispy_soap_request($params, 'sites_cron_add', $options);
53 | if ($create['status'] == 'success') {
54 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Cron job created successfully'));
55 | }
56 | else {
57 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
58 | }
59 | }
60 | elseif ($_GET['view_action'] == 'edit') {
61 | if (!isset($_REQUEST['minute_val']) || NULL == $_REQUEST['minute_val']) {
62 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Minute is required'));
63 | }
64 | if (!isset($_REQUEST['hour_val']) || NULL == $_REQUEST['hour_val']) {
65 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Hour is required'));
66 | }
67 | if (!isset($_REQUEST['day_val']) || !$_REQUEST['day_val']) {
68 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Day is required'));
69 | }
70 | if (!isset($_REQUEST['month_val']) || !$_REQUEST['month_val']) {
71 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Month is required'));
72 | }
73 | if (!isset($_REQUEST['weekday_val']) || NULL == $_REQUEST['weekday_val']) {
74 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Weekday is required'));
75 | }
76 | if (!isset($_REQUEST['command']) || !$_REQUEST['command']) {
77 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Command is required'));
78 | }
79 |
80 | $options = array(
81 | 'id' => $_REQUEST['cron_id'],
82 | 'server_id' => $_REQUEST['server_id'],
83 | 'command' => $_REQUEST['command'],
84 | 'run_min' => $_REQUEST['minute_val'],
85 | 'run_hour' => $_REQUEST['hour_val'],
86 | 'run_mday' => $_REQUEST['day_val'],
87 | 'run_month' => $_REQUEST['month_val'],
88 | 'run_wday' => $_REQUEST['weekday_val'],
89 | 'active' => 'y'
90 | );
91 |
92 | $update = cwispy_soap_request($params, 'sites_cron_update', $options);
93 | if ($update['status'] == 'success') {
94 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Cron job updated successfully'));
95 | }
96 | else {
97 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
98 | }
99 | }
100 | elseif ($_GET['view_action'] == 'delete') {
101 | $options = array(
102 | 'id' => $_REQUEST['cron_id']
103 | );
104 |
105 | $delete = cwispy_soap_request($params, 'sites_cron_delete', $options);
106 | if ($delete['status'] == 'success') {
107 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Cron job deleted successfully'));
108 | }
109 | else {
110 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
111 | }
112 | }
113 | else {
114 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
115 | }
116 | }
117 | else {
118 | $client = cwispy_soap_request($params, 'client_get');
119 | $crons = cwispy_soap_request($params, 'sites_cron_get');
120 |
121 | $return = array_merge_recursive($crons, $client);
122 |
123 | if (is_array($return['status'])) {
124 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
125 | }
126 |
127 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'cron', 'view_action' => 'add'));
128 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'cron', 'view_action' => 'edit'));
129 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'cron', 'view_action' => 'delete'));
130 | }
--------------------------------------------------------------------------------
/views/databases.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 |
22 |
23 | if ($_GET['view_action'] == 'db-add') {
24 | if (!isset($_REQUEST['database_name']) || !$_REQUEST['database_name']) {
25 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Database name is required'));
26 | }
27 | if (!isset($_REQUEST['database_user_id']) || !$_REQUEST['database_user_id']) {
28 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Database Read / Write User is required'));
29 | }
30 | if ( !isset($_REQUEST['parent_domain_id']) || $_REQUEST['parent_domain_id'] == '' ) {
31 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Site is required.'));
32 | }
33 | if ( ( $_REQUEST['database_quota'] >= $_REQUEST['old_database_quota'] ) && ($_REQUEST['limit_database_quota'] != "-1") ) {
34 | $used = ( $_REQUEST['limit_database_quota'] - $_REQUEST['hdtotalused'] );
35 | if ( $_REQUEST['database_quota'] > $used ) {
36 | cwispy_return_ajax_response(array('status' => 'error', 'message' => "Database Quota Error. Maximum available $used MB"));
37 | }
38 | }
39 |
40 | $create_options = array(
41 | 'server_id' => $_REQUEST['server_id'],
42 | 'parent_domain_id' => $_REQUEST['parent_domain_id'],
43 | 'database_name' => $_REQUEST['prefix'].$_REQUEST['database_name'],
44 | 'database_name_prefix' => $_REQUEST['prefix'],
45 | 'database_user_id' => $_REQUEST['database_user_id'],
46 | 'database_ro_user_id' => $_REQUEST['database_ro_user_id'],
47 | 'database_quota' => $_REQUEST['database_quota'],
48 | 'type' => 'mysql',
49 | 'active' => 'y'
50 | );
51 |
52 | $create = cwispy_soap_request($params, 'sites_database_add', $create_options);
53 | if ($create['status'] == 'success') {
54 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database created successfully'));
55 | }
56 | else {
57 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
58 | }
59 | }
60 | elseif ($_GET['view_action'] == 'db-edit') {
61 | if (!isset($_REQUEST['database_name']) || !$_REQUEST['database_name']) {
62 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Database name is required'));
63 | }
64 | if (!isset($_REQUEST['database_user_id']) || !$_REQUEST['database_user_id']) {
65 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Database user is required'));
66 | }
67 | if ( ( $_REQUEST['database_quota'] >= $_REQUEST['old_database_quota'] ) && ($_REQUEST['limit_database_quota'] != "-1") ) {
68 | $used = ( $_REQUEST['limit_database_quota'] - $_REQUEST['hdtotalused'] ) + $_REQUEST['old_database_quota'];
69 | if ( $_REQUEST['database_quota'] > $used ) {
70 | cwispy_return_ajax_response(array('status' => 'error', 'message' => "Database Quota Error. Maximum available $used MB"));
71 | }
72 | }
73 |
74 | $update_options = array(
75 | 'database_name' => $_REQUEST['database_name_prefix'].$_REQUEST['database_name'],
76 | 'database_name_prefix' => $_REQUEST['database_name_prefix'],
77 | 'database_user_id' => $_REQUEST['database_user_id'],
78 | 'database_ro_user_id' => $_REQUEST['database_ro_user_id'],
79 | 'database_quota' => $_REQUEST['database_quota'],
80 | 'id' => $_REQUEST['database_id'],
81 | );
82 |
83 | $update = cwispy_soap_request($params, 'sites_database_update', $update_options);
84 | if ($update['status'] == 'success') {
85 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database updated successfully'));
86 | }
87 | else {
88 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
89 | }
90 | }
91 | elseif ($_GET['view_action'] == 'db-delete') {
92 | $options = array(
93 | 'id' => $_REQUEST['database_id']
94 | );
95 |
96 | $delete = cwispy_soap_request($params, 'sites_database_delete', $options);
97 | if ($delete['status'] == 'success') {
98 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database deleted successfully'));
99 | }
100 | else {
101 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
102 | }
103 | }
104 | elseif ($_GET['view_action'] == 'db-user-add') {
105 | if (!isset($_REQUEST['username']) || !$_REQUEST['username']) {
106 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Username is required'));
107 | }
108 | if ( empty( $_REQUEST['password'] ) || empty( $_REQUEST['password2'] ) ) {
109 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords can not be blank'));
110 | }
111 | if ($_REQUEST['password'] != $_REQUEST['password2']) {
112 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match'));
113 | }
114 |
115 | $create_options = array(
116 | 'database_user' => $_REQUEST['prefix'].$_REQUEST['username'],
117 | 'database_user_prefix' => $_REQUEST['prefix'],
118 | 'database_password' => $_REQUEST['password'],
119 | );
120 |
121 | $create = cwispy_soap_request($params, 'sites_database_user_add', $create_options);
122 | if ($create['status'] == 'success') {
123 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database user created successfully'));
124 | }
125 | else {
126 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
127 | }
128 | }
129 | elseif ($_GET['view_action'] == 'db-user-edit') {
130 | if (!isset($_REQUEST['username']) || !$_REQUEST['username']) {
131 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Username name is required'));
132 | }
133 | if ( empty( $_REQUEST['password2'] ) || empty( $_REQUEST['password'] ) ) {
134 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords can not be blank'));
135 | }
136 |
137 | if (!isset($_REQUEST['password2']) || $_REQUEST['password2'] != $_REQUEST['password']) {
138 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match'));
139 | }
140 |
141 | $update_options = array(
142 | 'database_user' => $_REQUEST['prefix'].$_REQUEST['username'],
143 | 'database_user_prefix' => $_REQUEST['prefix'],
144 | 'id' => $_REQUEST['database_user_id'],
145 | );
146 | if ($_REQUEST['database_password']) $update_options['database_password'] = $_REQUEST['password'];
147 |
148 | $update = cwispy_soap_request($params, 'sites_database_user_update', $update_options);
149 | if ($update['status'] == 'success') {
150 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database user updated successfully'));
151 | }
152 | else {
153 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
154 | }
155 | }
156 | elseif ($_GET['view_action'] == 'db-user-delete') {
157 | $options = array(
158 | 'id' => $_REQUEST['database_user_id']
159 | );
160 |
161 | $delete = cwispy_soap_request($params, 'sites_database_user_delete', $options);
162 | if ($delete['status'] == 'success') {
163 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Database user deleted successfully'));
164 | }
165 | else {
166 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
167 | }
168 | }
169 | else {
170 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
171 | }
172 | }
173 | else {
174 | $dbs = cwispy_soap_request($params, 'sites_database_get');
175 | $db_users = cwispy_soap_request($params, 'sites_database_user_get');
176 | $domains = cwispy_soap_request($params, 'sites_web_domain_get');
177 | $clientP = cwispy_soap_request($params, 'client_get_by_username');
178 | $limits = cwispy_soap_request($params, 'client_get_quota');
179 | $client = cwispy_soap_request($params, 'client_get');
180 |
181 | // Create the Customer number based on the ISPConfig settings.
182 | // eg: C[CUSTOMER_NO] would become C45
183 | $cust = str_replace('[CUSTOMER_NO]',$client['response']['client']['client_id'],$client['response']['client']['customer_no_template']);
184 | // Strip the square bracket
185 | $client['response']['client']['customer_no'] = substr(strstr($cust, "]"), 1);
186 |
187 | $return = array_merge_recursive($dbs, $db_users, $clientP, $limits, $client, $domains);
188 |
189 | if (isset($db_users['response']['db_users']) && $db_users['response']['db_users']) {
190 | foreach($db_users['response']['db_users'] as $db_user) {
191 | $return['response']['db_users_o'][$db_user['database_user_id']] = $db_user;
192 | }
193 | }
194 |
195 | if (is_array($return['status'])) {
196 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
197 | }
198 |
199 | $return['action_urls']['db']['add'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-add'));
200 | $return['action_urls']['db']['edit'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-edit'));
201 | $return['action_urls']['db']['delete'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-delete'));
202 |
203 | $return['action_urls']['db_user']['add'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-user-add'));
204 | $return['action_urls']['db_user']['edit'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-user-edit'));
205 | $return['action_urls']['db_user']['delete'] = cwispy_create_url(array('view' => 'databases', 'view_action' => 'db-user-delete'));
206 | }
--------------------------------------------------------------------------------
/views/dns.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['zone']) || !$_REQUEST['zone']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Zone is required'));
24 | }
25 | if (!isset($_REQUEST['type']) || !$_REQUEST['type']) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Record type is required'));
27 | }
28 | if (!isset($_REQUEST['destination']) || !$_REQUEST['destination']) {
29 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Points to is required'));
30 | }
31 | if (!isset($_REQUEST['ttl']) || !$_REQUEST['ttl']) {
32 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'TTL is required'));
33 | }
34 |
35 | $options = array(
36 | 'server_id' => $_REQUEST['server_id'],
37 | 'zone' => $_REQUEST['zone'],
38 | 'name' => ($_REQUEST['host'] ? $_REQUEST['host'].'.' : '').$_REQUEST['zone_name'],
39 | 'type' => $_REQUEST['type'],
40 | 'data' => $_REQUEST['destination'],
41 | 'ttl' => $_REQUEST['ttl'],
42 | 'active' => 'y',
43 | 'ihost_dns_function' => 'dns_'.$_REQUEST['type'].'_add',
44 | );
45 |
46 | $create = cwispy_soap_request($params, 'dns_record_add', $options);
47 | if ($create['status'] == 'success') {
48 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'DNS record created successfully'));
49 | }
50 | else {
51 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
52 | }
53 | }
54 | elseif ($_GET['view_action'] == 'edit') {
55 | if (!isset($_REQUEST['zone']) || !$_REQUEST['zone']) {
56 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Zone is required'));
57 | }
58 | if (!isset($_REQUEST['type']) || !$_REQUEST['type']) {
59 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Record type is required'));
60 | }
61 | if (!isset($_REQUEST['destination']) || !$_REQUEST['destination']) {
62 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Points to is required'));
63 | }
64 | if (!isset($_REQUEST['ttl']) || !$_REQUEST['ttl']) {
65 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'TTL is required'));
66 | }
67 | $options = array(
68 | 'id' => $_REQUEST['record_id'],
69 | 'server_id' => $_REQUEST['server_id'],
70 | 'zone' => $_REQUEST['zone'],
71 | 'name' => ($_REQUEST['host'] ? $_REQUEST['host'].'.' : '').$_REQUEST['zone_name'],
72 | 'type' => $_REQUEST['type'],
73 | 'data' => $_REQUEST['destination'],
74 | 'ttl' => $_REQUEST['ttl'],
75 | 'active' => 'y',
76 | 'ihost_dns_function' => 'dns_'.$_REQUEST['type'].'_update',
77 | );
78 |
79 | $update = cwispy_soap_request($params, 'dns_record_update', $options);
80 | if ($update['status'] == 'success') {
81 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'DNS record updated successfully'));
82 | }
83 | else {
84 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
85 | }
86 | }
87 | elseif ($_GET['view_action'] == 'delete') {
88 | $options = array(
89 | 'id' => $_REQUEST['record_id'],
90 | );
91 |
92 | $delete = cwispy_soap_request($params, 'dns_a_delete', $options);
93 | if ($delete['status'] == 'success') {
94 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'DNS record deleted successfully'));
95 | }
96 | else {
97 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
98 | }
99 | }
100 | else {
101 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
102 | }
103 | }
104 | else {
105 | $records = cwispy_soap_request($params, 'dns_a_get');
106 | $client = cwispy_soap_request($params, 'client_get');
107 | $zones = cwispy_soap_request($params, 'dns_zone_get');
108 |
109 | $return = array_merge_recursive($records, $zones, $client);
110 |
111 | if ($zones) {
112 | foreach($zones['response']['zones'] as $zone) {
113 | $return['response']['zones_processed'][$zone['id']] = $zone;
114 | }
115 | }
116 |
117 | if (is_array($return['status'])) {
118 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
119 | }
120 |
121 | $return['response']['types'] = array('a','aaaa','alias','caa', 'cname','hinfo','mx','ns','ptr','rp','srv','txt');
122 |
123 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'dns', 'view_action' => 'add'));
124 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'dns', 'view_action' => 'edit'));
125 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'dns', 'view_action' => 'delete'));
126 | }
--------------------------------------------------------------------------------
/views/email-forwarders.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['email']) || !$_REQUEST['email']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Email is required'));
24 | }
25 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Domain is required'));
27 | }
28 | if (!isset($_REQUEST['destination']) || !$_REQUEST['destination']) {
29 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Destination is required'));
30 | }
31 |
32 | $domain_options = array(
33 | 'source' => $_REQUEST['email'].'@'.$_REQUEST['domain'],
34 | 'destination' => $_REQUEST['destination'].'@'.$_REQUEST['domain'],
35 | 'server_id' => $_REQUEST['svrid'],
36 | 'type' => 'forward',
37 | 'active' => 'y'
38 | );
39 | $create = cwispy_soap_request($params, 'mail_forward_add', $domain_options);
40 | if ($create['status'] == 'success') {
41 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email forwarder created successfully'));
42 | }
43 | else {
44 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
45 | }
46 | }
47 | elseif ($_GET['view_action'] == 'edit') {
48 | if (!isset($_REQUEST['destination']) || !$_REQUEST['destination']) {
49 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Destination is required'));
50 | }
51 | $domain_options = array(
52 | 'source' => $_REQUEST['source'],
53 | 'destination' => $_REQUEST['destination'],
54 | 'id' => $_REQUEST['forwarder_id'],
55 | );
56 |
57 | $update = cwispy_soap_request($params, 'mail_forward_update', $domain_options);
58 | if ($update['status'] == 'success') {
59 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email forwarder updated successfully'));
60 | }
61 | else {
62 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
63 | }
64 | }
65 | elseif ($_GET['view_action'] == 'delete') {
66 | $domain_options = array(
67 | 'id' => $_REQUEST['forwarder_id']
68 | );
69 |
70 | $delete = cwispy_soap_request($params, 'mail_forward_delete', $domain_options);
71 | if ($delete['status'] == 'success') {
72 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email forwarder deleted successfully'));
73 | }
74 | else {
75 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
76 | }
77 | }
78 | else {
79 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
80 | }
81 | }
82 | else {
83 | $client = cwispy_soap_request($params, 'client_get');
84 | $domains = cwispy_soap_request($params, 'mail_domain_get');
85 | $forwarders = cwispy_soap_request($params, 'mail_forward_get');
86 |
87 | $return = array_merge_recursive($domains, $forwarders, $client);
88 |
89 | if (is_array($return['status'])) {
90 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
91 | }
92 |
93 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'email-forwarders', 'view_action' => 'add'));
94 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'email-forwarders', 'view_action' => 'edit'));
95 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'email-forwarders', 'view_action' => 'delete'));
96 | }
--------------------------------------------------------------------------------
/views/emails.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['email']) || !$_REQUEST['email']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Email is required'));
24 | }
25 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Domain is required'));
27 | }
28 | if (!isset($_REQUEST['password']) || !$_REQUEST['password']) {
29 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Password is required'));
30 | }
31 | if (!isset($_REQUEST['password2']) || $_REQUEST['password2'] != $_REQUEST['password']) {
32 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match'));
33 | }
34 |
35 |
36 |
37 | $domain_options = array(
38 | 'email' => $_REQUEST['email'].'@'.$_REQUEST['domain'],
39 | 'login' => $_REQUEST['email'].'@'.$_REQUEST['domain'],
40 | 'password' => $_REQUEST['password'],
41 | 'quota' => intval($_REQUEST['quota']) * 1048576,
42 | 'server_id' => intval($_REQUEST['svrid']),
43 | 'uid' => 5000,
44 | 'gid' => 5000,
45 | 'homedir' => '/var/vmail',
46 | 'maildir' => '/var/vmail/'.$_REQUEST['domain'].'/'.$_REQUEST['email'],
47 | 'maildir_format' => 'maildir',
48 | 'postfix' => 'y',
49 | 'access' => 'y'
50 | );
51 | $create = cwispy_soap_request($params, 'mail_user_add', $domain_options);
52 | if ($create['status'] == 'success') {
53 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email account created successfully'));
54 | }
55 | else {
56 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
57 | }
58 | }
59 | elseif ($_GET['view_action'] == 'edit') {
60 | if (!isset($_REQUEST['password2']) || $_REQUEST['password2'] != $_REQUEST['password']) {
61 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match'));
62 | }
63 |
64 | if ( ($_REQUEST['quota'] > $_REQUEST['old_quota'] ) && ($_REQUEST['totalquota'] != "-1")) {
65 | $availablequota = ( ( $_REQUEST['totalquota'] - $_REQUEST['emailtotal'] ) + $_REQUEST['old_quota'] );
66 | if ( $_REQUEST['quota'] > $availablequota ) {
67 | cwispy_return_ajax_response(array("status" => "error", "message" => "Email Quota Error. Maximum available $availablequota MB"));
68 | }
69 | }
70 |
71 | $domain_options = array(
72 | 'email' => $_REQUEST['email'],
73 | 'login' => $_REQUEST['email'],
74 | 'quota' => intval($_REQUEST['quota']) * 1048576,
75 | 'id' => $_REQUEST['mail_id']
76 | );
77 | if ($_REQUEST['password']) $domain_options['password'] = $_REQUEST['password'];
78 |
79 | $update = cwispy_soap_request($params, 'mail_user_update', $domain_options);
80 | if ($update['status'] == 'success') {
81 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email account updated successfully'));
82 | }
83 | else {
84 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
85 | }
86 | }
87 | elseif ($_GET['view_action'] == 'delete') {
88 | $domain_options = array(
89 | 'id' => $_REQUEST['mail_id']
90 | );
91 |
92 | $delete = cwispy_soap_request($params, 'mail_user_delete', $domain_options);
93 | if ($delete['status'] == 'success') {
94 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Email account deleted successfully'));
95 | }
96 | else {
97 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
98 | }
99 | }
100 | else {
101 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
102 | }
103 | }
104 | else {
105 | $client = cwispy_soap_request($params, 'client_get');
106 | $domains = cwispy_soap_request($params, 'mail_domain_get');
107 | $mails = cwispy_soap_request($params, 'mail_user_get');
108 | $limits = cwispy_soap_request($params, 'client_get_quota');
109 | $return = array_merge_recursive($domains, $mails, $limits, $client);
110 |
111 | if (is_array($return['status'])) {
112 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
113 | }
114 |
115 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'emails', 'view_action' => 'add'));
116 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'emails', 'view_action' => 'edit'));
117 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'emails', 'view_action' => 'delete'));
118 | }
--------------------------------------------------------------------------------
/views/file-manager.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | $elfinder_dir = ELFINDER_DIR;
21 | if (file_exists($elfinder_dir)) {
22 | $elfinder_options['host'] = $params['domain'];
23 | //$elfinder_options['host'] = str_replace(':8080', '', $params['configoption3']);
24 | $elfinder_options['user'] = $params['username'].$params['configoption12'];
25 | $elfinder_options['pass'] = $params['password'];
26 |
27 | change_ftp_password($params, $elfinder_options['user'], $elfinder_options['pass']);
28 |
29 | $return = array('status' => 'success', 'ajax' => 'false', 'response' => array('elfinder_ftp' => base64_encode(json_encode($elfinder_options))));
30 | }
31 | else {
32 | $return = array('status' => 'error', 'response' => 'Elfinder not found');
33 | }
--------------------------------------------------------------------------------
/views/ftp-accounts.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if ( isset( $_GET['view_action'] ) ) {
21 | if ( $_GET['view_action'] == 'add' ) {
22 | if ( !isset( $_REQUEST['parent_domain_id'] ) || empty( $_REQUEST['parent_domain_id'] ) ) {
23 | cwispy_return_ajax_response( array( 'status' => 'error', 'message' => 'Site is required' ) );
24 | } else {
25 | $a = explode( ':', $_REQUEST['parent_domain_id'] );
26 | $parent_domain_id = $a[0];
27 | $uid = $a[1];
28 | $gid = $a[2];
29 | $dir_prefix = $a[3];
30 | $server_id = $a[4];
31 | }
32 | if ( !isset( $_REQUEST['username'] ) || !$_REQUEST['username'] ) {
33 | cwispy_return_ajax_response( array( 'status' => 'error', 'message' => 'Username is required' ) );
34 | }
35 | if ( !isset($_REQUEST['password']) || !$_REQUEST['password']) {
36 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Password is required' ) );
37 | }
38 | if ( !isset( $_REQUEST['password2'] ) || $_REQUEST['password2'] != $_REQUEST['password'] ) {
39 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match' ) );
40 | }
41 | $options = array(
42 | 'server_id' => $server_id,
43 | 'username' => $_REQUEST['username_prefix'].$_REQUEST['username'],
44 | 'password' => $_REQUEST['password'],
45 | 'quota_size' => isset($_REQUEST['quota_size']) ? intval($_REQUEST['quota_size']) : -1,
46 | 'dir' => $dir_prefix,
47 | 'uid' => $uid,
48 | 'gid' => $gid,
49 | 'parent_domain_id' => $parent_domain_id,
50 | 'active' => 'y'
51 | );
52 | if ($_REQUEST['directory']) $options['dir'] .= '/'.$_REQUEST['directory'];
53 |
54 | $create = cwispy_soap_request($params, 'sites_ftp_user_add', $options);
55 | if ($create['status'] == 'success') {
56 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'FTP account created successfully'));
57 | }
58 | else {
59 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
60 | }
61 | }
62 | elseif ($_GET['view_action'] == 'edit') {
63 | if (!isset($_REQUEST['username']) || !$_REQUEST['username']) {
64 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Username is required'));
65 | }
66 | if (!isset($_REQUEST['password2']) || $_REQUEST['password2'] != $_REQUEST['password']) {
67 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Passwords do not match'));
68 | }
69 | $options = array(
70 | 'server_id' => $_REQUEST['server_id'],
71 | 'username' => $_REQUEST['username_prefix'].$_REQUEST['username'],
72 | 'quota_size' => isset($_REQUEST['quota_size']) ? intval($_REQUEST['quota_size']) : -1,
73 | 'dir' => $_REQUEST['dir_prefix'],
74 | 'uid' => $_REQUEST['uid'],
75 | 'gid' => $_REQUEST['gid'],
76 | 'parent_domain_id' => $_REQUEST['parent_domain_id'],
77 | 'active' => 'y',
78 | 'id' => $_REQUEST['ftp_user_id']
79 | );
80 | if ($_REQUEST['directory']) $options['dir'] .= '/'.$_REQUEST['directory'];
81 | if ($_REQUEST['password']) $options['password'] = $_REQUEST['password'];
82 |
83 | $update = cwispy_soap_request($params, 'sites_ftp_user_update', $options);
84 | if ($update['status'] == 'success') {
85 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'FTP account updated successfully'));
86 | }
87 | else {
88 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
89 | }
90 | }
91 | elseif ($_GET['view_action'] == 'delete') {
92 | $options = array(
93 | 'id' => $_REQUEST['ftp_user_id']
94 | );
95 |
96 | $delete = cwispy_soap_request($params, 'sites_ftp_user_delete', $options);
97 | if ($delete['status'] == 'success') {
98 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'FTP account deleted successfully'));
99 | }
100 | else {
101 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
102 | }
103 | }
104 | else {
105 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
106 | }
107 | }
108 | else {
109 | $client = cwispy_soap_request($params, 'client_get');
110 | $ftpusers = cwispy_soap_request($params, 'sites_ftp_user_get');
111 | $webdomain = cwispy_soap_request($params, 'sites_web_domain_get');
112 | $return = array_merge_recursive($ftpusers, $client, $webdomain);
113 |
114 | if (is_array($return['status'])) {
115 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
116 | }
117 |
118 | if (isset($webdomain['response']['domains']) && $webdomain['response']['domains']) {
119 | foreach($webdomain['response']['domains'] as $domain) {
120 | $return['response']['domains_o'][$domain['domain_id']] = $domain;
121 | }
122 | }
123 |
124 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'ftp-accounts', 'view_action' => 'add'));
125 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'ftp-accounts', 'view_action' => 'edit'));
126 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'ftp-accounts', 'view_action' => 'delete'));
127 | }
--------------------------------------------------------------------------------
/views/login.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'ispconfig') {
22 | //$return = array('status' => 'success', 'ajax' => 'false', 'response' => array('server_url' => $domain_url));
23 | $return = array('status' => 'success', 'ajax' => 'false', 'response' => array('server_url' => $server_url));
24 | }
25 | elseif ($_GET['view_action'] == 'stats') {
26 | $return = array('status' => 'success', 'ajax' => 'false', 'response' => array('server_url' => $domain_url));
27 | //$return = array('status' => 'success', 'ajax' => 'false', 'response' => array('server_url' => $server_url));
28 | }
29 | elseif ($_GET['view_action'] == 'webmail') {
30 | header('Location: '.$domain_url.'/webmail/');
31 | exit;
32 | }
33 | elseif ($_GET['view_action'] == 'phpmyadmin') {
34 | header('Location: '.$domain_url.'/phpmyadmin/');
35 | exit;
36 | }
37 | }
--------------------------------------------------------------------------------
/views/sitebuilder.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 |
21 | global $variables;
22 | if (isset($_GET['view_action'])) {
23 |
24 | } else {
25 |
26 | $domains = cwispy_soap_request($params, 'sites_web_domain_get');
27 | $subdomains = cwispy_soap_request($params, 'sites_web_aliasdomain_get');
28 | $ftpuser = cwispy_soap_request($params, 'sites_ftp_user_get');
29 | if ( ( empty($params['configoption15']) ) && ( empty($params['configoption16']) ) ) {
30 | $sitepro['response']['sitepro']['enabled'] = '0';
31 | } else {
32 | $sitepro['response']['sitepro']['enabled'] = '1';
33 | }
34 | $return = array_merge_recursive($domains, $subdomains, $ftpuser, $sitepro);
35 | $theftpuser = $return["response"]["accounts"][0]["username"];
36 | $theftppass = $params['password'];
37 | $siteprouser = $params['configoption15'];
38 | $sitepropass = $params['configoption16'];
39 |
40 | if ($domains) {
41 | foreach($domains['response']['domains'] as $domain) {
42 | $return['response']['domains_processed'][$domain['domain_id']] = $domain;
43 | }
44 | }
45 |
46 | if (is_array($return['status'])) {
47 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
48 | }
49 | }
50 | $username = $params['username'];
51 | $password = $params['password'];
52 | $domain = $params["domain"];
53 | $serverip = $params["serverip"];
54 | $siteprouser = $params['configoption15'];
55 | $sitepropass = $params['configoption16'];
56 |
57 |
58 | include __DIR__.'/SiteProApiClient.php';
59 |
60 | use Profis\SitePro\SiteProApiClient;
61 |
62 | $builderError = null;
63 | if (isset($_GET['editWebsite']) && $_GET['editWebsite']) {
64 | // get "your_api_username" and "our_api_password" from your license and enter them here
65 | // use this for premium/free licenses
66 | //$api = new SiteProApiClient("http://eu.site.pro/api/", $siteprouser, $sitepropass);
67 | $api = new SiteProApiClient('http://site.pro/api/', 'apikey0', '.r9doye/7FELEjutsxa..9yS/bJDUGew6zD/sJBHOLWV9gu.');
68 | // use this for enterprise licenses and change 'your-bulder-domain.com' to your builder domain
69 | //$api = new SiteProApiClient('http://your-bulder-domain.com/api/', 'your_api_username', 'your_api_password');
70 |
71 | try {
72 | // this call is used to open builder, so you need to set correct parameters to represent users website you want to open
73 | // this data usually comes from your user/hosting manager system
74 | $res = $api->remoteCall('requestLogin', array(
75 | 'type' => 'external', ////(required) 'external'
76 | 'domain' => "$domain", // (required) domain of the user website you want to edit
77 | 'lang' => 'en', // (optional) 2-letter language code, set language code you whant builder to open in
78 | 'username' => "$theftpuser", // (required) user websites FTP username
79 | 'password' => "$theftppass", // (required) user websites FTP password
80 | //'apiUrl' => "$serverip", // (required) user websites FTP server IP address
81 | 'apiUrl' => "$domain",
82 | 'uploadDir' => '/web/', // (required) user websites FTP folder where website files need to be uploaded to
83 | 'hostingPlan' => '', // (optional) hosting plan that user uses
84 | 'panel' => '' // (optional) user/hosting management panel name that this script will be run in
85 | ));
86 | if (!$res || !is_object($res)) {
87 | // handle errors
88 | throw new ErrorException('Response format error');
89 | } else if (isset($res->url) && $res->url) {
90 | // on success redirect to builder URL
91 | header('Location: '.$res->url, true);
92 | exit();
93 | } else {
94 | // handle errors
95 | throw new ErrorException((isset($res->error->message) && $res->error->message) ? $res->error->message : 'Unknown error');
96 | }
97 | } catch(ErrorException $ex) {
98 | // handle errors
99 | $builderError = 'Request error: '.$ex->getMessage();
100 | }
101 | }
--------------------------------------------------------------------------------
/views/subdomains.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['subdomain']) || !$_REQUEST['subdomain']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Subdomain is required'));
24 | }
25 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
26 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'You must select a parent domain'));
27 | }
28 |
29 | $document_root = '';
30 | if (isset($_REQUEST['directory']) && $_REQUEST['directory']) {
31 | $document_root .= '/'.$_REQUEST['directory'].'/';
32 | $document_root = str_replace("//","/",$document_root);
33 | }
34 |
35 | $options = array(
36 | 'server_id' => $_REQUEST['server_id'],
37 | 'domain' => $_REQUEST['subdomain'].'.'.$_REQUEST['domain'],
38 | 'parent_domain_id' => $_REQUEST['domain_id'],
39 | 'type' => 'subdomain',
40 | 'redirect_type' => $_REQUEST['redirect_type'],
41 | 'redirect_path' => $document_root,
42 | 'active' => 'y',
43 | 'ihost_zone_domain' => $_REQUEST['domain'].'.',
44 | );
45 |
46 | $create = cwispy_soap_request($params, 'sites_web_subdomain_add', $options);
47 | if ($create['status'] == 'success') {
48 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Subdomain created successfully'));
49 | }
50 | else {
51 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
52 | }
53 | }
54 | elseif ($_GET['view_action'] == 'edit') {
55 | if (!isset($_REQUEST['subdomain']) || !$_REQUEST['subdomain']) {
56 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Subdomain is required'));
57 | }
58 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
59 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'You must select a parent domain'));
60 | }
61 |
62 | $document_root = '';
63 | if (isset($_REQUEST['directory']) && $_REQUEST['directory']) {
64 | $document_root = '/'.$_REQUEST['directory'].'/';
65 | $document_root = str_replace("//","/",$document_root);
66 | }
67 |
68 | $options = array(
69 | 'id' => $_REQUEST['subdomain_id'],
70 | 'server_id' => $_REQUEST['server_id'],
71 | 'domain' => $_REQUEST['subdomain'].'.'.$_REQUEST['domain'],
72 | 'parent_domain_id' => $_REQUEST['domain_id'],
73 | 'type' => 'subdomain',
74 | 'redirect_type' => $_REQUEST['redirect_type'],
75 | 'redirect_path' => $document_root,
76 | 'active' => 'y'
77 | );
78 |
79 | $update = cwispy_soap_request($params, 'sites_web_subdomain_update', $options);
80 | if ($update['status'] == 'success') {
81 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Subdomain updated successfully'));
82 | }
83 | else {
84 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
85 | }
86 | }
87 | elseif ($_GET['view_action'] == 'delete') {
88 | $options = array(
89 | 'id' => $_REQUEST['subdomain_id']
90 | );
91 |
92 | $delete = cwispy_soap_request($params, 'sites_web_subdomain_delete', $options);
93 | if ($delete['status'] == 'success') {
94 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Subdomain deleted successfully'));
95 | }
96 | else {
97 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
98 | }
99 | }
100 | else {
101 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
102 | }
103 | }
104 | else {
105 | $domains = cwispy_soap_request($params, 'sites_web_domain_get');
106 | $client = cwispy_soap_request($params, 'client_get');
107 | $subdomains = cwispy_soap_request($params, 'sites_web_subdomain_get');
108 |
109 | $return = array_merge_recursive($domains, $subdomains, $client);
110 |
111 | if ($domains) {
112 | foreach($domains['response']['domains'] as $domain) {
113 | $return['response']['domains_processed'][$domain['domain_id']] = $domain;
114 | }
115 | }
116 |
117 | if (is_array($return['status'])) {
118 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
119 | }
120 |
121 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'subdomains', 'view_action' => 'add'));
122 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'subdomains', 'view_action' => 'edit'));
123 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'subdomains', 'view_action' => 'delete'));
124 | }
--------------------------------------------------------------------------------
/views/usage.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 |
22 | }
23 | else {
24 |
25 | $disk = cwispy_soap_request($params, 'quota_get_by_user');
26 | $traffic = cwispy_soap_request($params, 'trafficquota_get_by_user');
27 | $ftptraffic = cwispy_soap_request($params, 'ftptrafficquota_data');
28 | $databasedisk = cwispy_soap_request($params, 'databasequota_get_by_user');
29 | $maildisk = cwispy_soap_request($params, 'mailquota_get_by_user');
30 |
31 |
32 | $return = array_merge_recursive($disk, $traffic, $ftptraffic, $databasedisk, $maildisk);
33 |
34 |
35 | if (is_array($return['status'])) {
36 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
37 | }
38 | }
--------------------------------------------------------------------------------
/views/websites.php:
--------------------------------------------------------------------------------
1 | .
18 | *
19 | */
20 | if (isset($_GET['view_action'])) {
21 | if ($_GET['view_action'] == 'add') {
22 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
23 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Domain is required'));
24 | }
25 |
26 | $cgi = isset($_REQUEST['cgi']) ? $_REQUEST['cgi'] : 'n';
27 | $ssi = isset($_REQUEST['ssi']) ? $_REQUEST['ssi'] : 'n';
28 | $suexec = isset($_REQUEST['suexec']) ? $_REQUEST['suexec'] : 'n';
29 | $errordocs = isset($_REQUEST['errordocs']) ? $_REQUEST['errordocs'] : '0';
30 | $ruby = isset($_REQUEST['ruby']) ? $_REQUEST['ruby'] : 'n';
31 | $python = isset($_REQUEST['python']) ? $_REQUEST['python'] : 'n';
32 | $perl = isset($_REQUEST['perl']) ? $_REQUEST['perl'] : 'n';
33 |
34 | $options = array(
35 | 'server_id' => $_REQUEST['server_id'],
36 | 'ip_address' => $_REQUEST['ip_address'],
37 | 'ipv6_address' => $_REQUEST['ipv6_address'],
38 | 'domain' => $_REQUEST['domain'],
39 | 'parent_domain_id' => 0,
40 | 'type' => 'vhost',
41 | 'hd_quota' => $_REQUEST['hd_quota'],
42 | 'traffic_quota' => $_REQUEST['traffic_quota'],
43 | 'cgi' => $cgi,
44 | 'ssi' => $ssi,
45 | 'suexec' => $suexec,
46 | 'errordocs' => $errordocs,
47 | 'is_subdomainwww' => 1,
48 | 'subdomain' => $_REQUEST['subdomain'],
49 | 'php' => $_REQUEST['php'],
50 | 'ruby' => $ruby,
51 | 'python' => $python,
52 | 'perl' => $perl,
53 | 'redirect_type' => '',
54 | 'redirect_path' => '',
55 | 'http_port' => 80,
56 | 'https_port' => 443,
57 | 'pm_max_requests' => 0,
58 | 'pm_process_idle_timeout' => 10,
59 | 'allow_override' => 'All',
60 | 'active' => 'y',
61 | 'traffic_quota_lock' => 'n'
62 | );
63 | $create = cwispy_soap_request($params, 'sites_web_domain_add', $options);
64 | if ($create['status'] == 'success') {
65 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Website created successfully'));
66 | }
67 | else {
68 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $create['response']));
69 | }
70 | }
71 | elseif ($_GET['view_action'] == 'edit') {
72 | if (!isset($_REQUEST['domain']) || !$_REQUEST['domain']) {
73 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'Website is required'));
74 | }
75 | if ( ( ( $_REQUEST['old_hd_quota'] < $_REQUEST['hd_quota'] ) && ( $_REQUEST['client_hd_quota'] != "-1" ) ) ||
76 | ( ( $_REQUEST['old_traffic_quota'] < $_REQUEST['traffic_quota'] ) && ( $_REQUEST['old_traffic_quota'] != "-1" ) ) ) {
77 | //$website = cwispy_soap_request($params, 'sites_web_domain_get');
78 | //print_r($_REQUEST);
79 |
80 | $availablehdquota = ( ($_REQUEST['client_hd_quota'] - $_REQUEST['client_hd_used']) + $_REQUEST['old_hd_quota'] );
81 | //print_r($_REQUEST['hd_quota']." ".$availablehdquota);
82 | if ( ( $_REQUEST['hd_quota']) > $availablehdquota ) {
83 | cwispy_return_ajax_response(array("status" => "error", "message" => "Disk Quota Error. Maximum available $availablehdquota MB"));
84 | }
85 |
86 | $availablewebquota = ( ($_REQUEST['client_traffic_quota'] - $_REQUEST['client_traffic_used']) + $_REQUEST['old_traffic_quota'] );
87 | if ( ( $_REQUEST['traffic_quota']) > $availablewebquota ) {
88 | cwispy_return_ajax_response(array("status" => "error", "message" => "Web Quota Error. Maximum available $availablewebquota MB"));
89 | }
90 | }
91 |
92 |
93 | $cgi = isset($_REQUEST['cgi']) ? $_REQUEST['cgi'] : 'n';
94 | $ssi = isset($_REQUEST['ssi']) ? $_REQUEST['ssi'] : 'n';
95 | $suexec = isset($_REQUEST['suexec']) ? $_REQUEST['suexec'] : 'n';
96 | $errordocs = isset($_REQUEST['errordocs']) ? $_REQUEST['errordocs'] : '0';
97 | $ruby = isset($_REQUEST['ruby']) ? $_REQUEST['ruby'] : 'n';
98 | $python = isset($_REQUEST['python']) ? $_REQUEST['python'] : 'n';
99 | $perl = isset($_REQUEST['perl']) ? $_REQUEST['perl'] : 'n';
100 |
101 | $options = array(
102 | 'domain_id' => $_REQUEST['domain_id'],
103 | 'server_id' => $_REQUEST['server_id'],
104 | 'ip_address' => $_REQUEST['ip_address'],
105 | 'ipv6_address' => $_REQUEST['ipv6_address'],
106 | 'domain' => $_REQUEST['domain'],
107 | 'parent_domain_id' => 0,
108 | 'type' => 'vhost',
109 | 'hd_quota' => $_REQUEST['hd_quota'],
110 | 'traffic_quota' => $_REQUEST['traffic_quota'],
111 | 'cgi' => $cgi,
112 | 'ssi' => $ssi,
113 | 'suexec' => $suexec,
114 | 'errordocs' => $errordocs,
115 | 'is_subdomainwww' => 1,
116 | 'subdomain' => $_REQUEST['subdomain'],
117 | 'php' => $_REQUEST['php'],
118 | 'ruby' => $ruby,
119 | 'python' => $python,
120 | 'perl' => $perl,
121 | 'redirect_type' => '',
122 | 'redirect_path' => '',
123 | 'http_port' => 80,
124 | 'https_port' => 443,
125 | 'pm_max_requests' => 0,
126 | 'pm_process_idle_timeout' => 10,
127 | 'allow_override' => 'All',
128 | 'active' => 'y',
129 | 'traffic_quota_lock' => 'n'
130 | );
131 |
132 | $update = cwispy_soap_request($params, 'sites_web_domain_update', $options);
133 | if ($update['status'] == 'success') {
134 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Website updated successfully'));
135 | }
136 | else {
137 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $update['response']));
138 | }
139 | }
140 | elseif ($_GET['view_action'] == 'delete') {
141 | $options = array(
142 | 'domain_id' => $_REQUEST['domain_id']
143 | );
144 |
145 | $delete = cwispy_soap_request($params, 'sites_web_domain_delete', $options);
146 | if ($delete['status'] == 'success') {
147 | cwispy_return_ajax_response(array('status' => 'success', 'message' => 'Website deleted successfully'));
148 | }
149 | else {
150 | cwispy_return_ajax_response(array('status' => 'error', 'message' => $delete['response']));
151 | }
152 | }
153 | else {
154 | cwispy_return_ajax_response(array('status' => 'error', 'message' => 'View action missing'));
155 | }
156 | }
157 | else {
158 |
159 | $websites = cwispy_soap_request($params, 'sites_web_domain_get');
160 | $client = cwispy_soap_request($params, 'client_get');
161 | $return = array_merge_recursive($client, $websites);
162 |
163 | if ($websites) {
164 | foreach($websites['response']['websites'] as $websites) {
165 | $return['response']['websites_processed'][$websites['domain_id']] = $websites;
166 | }
167 | }
168 |
169 | if (is_array($return['status'])) {
170 | $return['status'] = (in_array('error', $return['status'])) ? 'error' : 'success';
171 | }
172 |
173 | $return['action_urls']['add'] = cwispy_create_url(array('view' => 'websites', 'view_action' => 'add'));
174 | $return['action_urls']['edit'] = cwispy_create_url(array('view' => 'websites', 'view_action' => 'edit'));
175 | $return['action_urls']['delete'] = cwispy_create_url(array('view' => 'websites', 'view_action' => 'delete'));
176 | }
--------------------------------------------------------------------------------