Skip to content

Commit 9d2ebe5

Browse files
committed
file manager stuff
1 parent 99a403a commit 9d2ebe5

File tree

12 files changed

+419
-95
lines changed

12 files changed

+419
-95
lines changed

web/css/file_manager.css

Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@ body { margin: 0; padding: 0; }
22
.hidden { display: none; }
33

44
.l-logo {
5+
background-color: #7B7B7B;
56
background-image: url("/images/sprite.png");
6-
background-position: -118px -59px;
7+
background-position: -117px -57px;
78
background-repeat: no-repeat;
9+
border: 9px solid #7B7B7B;
810
display: inline-block;
911
float: left;
1012
height: 22px;
11-
margin-left: 10px;
12-
margin-top: 11px;
13-
width: 73px;
13+
margin-left: 0;
14+
margin-top: 0;
15+
width: 59px;
1416
}
1517

1618
#main{ display: inline-block; font-family: Arial; font-size: 15px; color: #777; width: 100%; }
1719

1820
.window { display: inline-block; float: left; /*border: 1px solid #eee;*/ width: 50%; height: 100%; background-color: #ececec; /*background: url(/images/background-dots.png) #ececec;*/ }
1921
.window.active { background: #fff; }
2022

21-
.pwd { background-color: #7b7b7b; height: 28px; padding: 12px 0 0 17px; color: #eee; font-size: 14px; }
22-
.window.active .pwd { background-color: #333; }
23+
.window.active .l-logo { background-color: #333; border-color: #333; }
24+
25+
26+
.pwd { background-color: #7b7b7b; height: 28px; padding: 12px 0 0 17px; color: #eee; font-size: 14px; overflow: hidden; }
27+
.window.active .pwd { background-color: #333; box-shadow: -2px 0 5px -3px rgba(0, 0, 0, 0.7); }
2328
.window.active .pwd a { color: #FFF; }
24-
.pwd a { color: #CFCFCF; margin-right: 6px; padding: 0 7px; cursor: pointer; text-decoration: none; }
29+
.pwd a { color: #CFCFCF; cursor: pointer; text-decoration: none; }
2530
.window.active .pwd a:hover, .pwd a:hover { color: #FFCC00; }
2631

2732

@@ -57,10 +62,14 @@ body { margin: 0; padding: 0; }
5762

5863

5964
.menu div.button.disabled:hover,
60-
.menu div.button { cursor: pointer; transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; box-shadow: none; color: #999
61-
}
65+
.menu div.button { cursor: pointer; transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; box-shadow: none; color: #999; }
6266
.window.active .menu div.button:hover,
63-
.menu div.button:hover { text-decoration: none; color: #1FB9CA; border-radius: 0; }
67+
.menu div.button:hover { text-decoration: none; color: #1FB9CA; }
68+
69+
.window.active .menu div.button.del:hover,
70+
.menu div.button.del:hover { color: #FF5A5A; }
71+
72+
6473

6574
.menu div.button.disabled:hover,
6675
.menu div.button.disabled { opacity: 0.5; cursor: default; text-decoration: none; }
@@ -92,16 +101,16 @@ body { margin: 0; padding: 0; }
92101
.menu .not-writable:hover { border: 1px solid #E2E2E0; }
93102

94103
ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; border-left: 1px solid #DDDDDD; overflow: auto; }
95-
.listing li { color: #999999; display: block; height: 32px; margin: 1px 0 0; line-height: 30px; border: 1px solid transparent; }
104+
.listing li { color: #999999; display: block; height: 34px; margin: 1px 0 0; line-height: 30px; padding: 0; }
96105
.listing li span { display: inline-block; float: right; }
97106
.listing li .marker { width: 4px; float: left; height: 100%; margin-right: 31px; }
98107
.listing li.back { }
99108
.listing li.file { }
100109

101110

102111
/* .listing li .icon { background: url("/images/document.png") no-repeat scroll -2px 6px; float: left; margin-left: -17px; width: 13px; height: 24px; }*/
103-
.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px/*-97px -100px*/; float: left; margin-left: -17px; width: 31px; height: 31px; }
104-
.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -99px /*-99px 0px 25px -69px */; }
112+
.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; float: left; margin-left: -17px; width: 31px; height: 31px; margin-top: 1px; }
113+
.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -98px; }
105114

106115
.listing li .icon.filetype-tif,
107116
.listing li .icon.filetype-gif,
@@ -113,7 +122,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
113122
.listing li .icon.filetype-yuv,
114123
.listing li .icon.filetype-ai,
115124
.listing li .icon.filetype-svg,
116-
.listing li .icon.filetype-png { background: url("/images/flat_icons.png") no-repeat scroll -138px -69px; }
125+
.listing li .icon.filetype-png { background: url("/images/flat_icons.png") no-repeat scroll -138px -68px; }
117126

118127
.listing li .icon.filetype-txt,
119128
.listing li .icon.filetype-csv,
@@ -125,12 +134,12 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
125134
.listing li .icon.filetype-ppt,
126135
.listing li .icon.filetype-sdf,
127136
.listing li .icon.filetype-vcf,
128-
.listing li .icon.filetype-db { background: url("/images/flat_icons.png") no-repeat scroll -97px -150px; }
137+
.listing li .icon.filetype-db { background: url("/images/flat_icons.png") no-repeat scroll -97px -149px; }
129138

130139

131140
.listing li .icon.filetype-xlr,
132141
.listing li .icon.filetype-xls,
133-
.listing li .icon.filetype-xlsx { background: url("/images/flat_icons.png") no-repeat scroll -138px -147px; }
142+
.listing li .icon.filetype-xlsx { background: url("/images/flat_icons.png") no-repeat scroll -138px -146px; }
134143

135144
.listing li .icon.filetype-jar,
136145
.listing li .icon.filetype-tar,
@@ -144,12 +153,12 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
144153
.listing li .icon.filetype-sitx,
145154
.listing li .icon.filetype-zip,
146155
.listing li .icon.filetype-zipx,
147-
.listing li .icon.filetype-jar { background: url("/images/flat_icons.png") no-repeat scroll -176px -34px; }
156+
.listing li .icon.filetype-jar { background: url("/images/flat_icons.png") no-repeat scroll -176px -33px; }
148157

149158
.listing li .icon.filetype-fnt,
150159
.listing li .icon.filetype-otf,
151160
.listing li .icon.filetype-ttf,
152-
.listing li .icon.filetype-fon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; }
161+
.listing li .icon.filetype-fon { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; }
153162

154163
.listing li .icon.filetype-3g2,
155164
.listing li .icon.filetype-3gp,
@@ -164,7 +173,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
164173
.listing li .icon.filetype-rm,
165174
.listing li .icon.filetype-swf,
166175
.listing li .icon.filetype-vob,
167-
.listing li .icon.filetype-wmv { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; }
176+
.listing li .icon.filetype-wmv { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; }
168177

169178
.listing li .icon.filetype-aif,
170179
.listing li .icon.filetype-iff,
@@ -175,23 +184,23 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
175184
.listing li .icon.filetype-mpa,
176185
.listing li .icon.filetype-ra,
177186
.listing li .icon.filetype-wav,
178-
.listing li .icon.filetype-wma { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; }
187+
.listing li .icon.filetype-wma { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; }
179188

180189

181190
.listing li .icon.filetype-rtf,
182191
.listing li .icon.filetype-doc,
183-
.listing li .icon.filetype-docx { background: url("/images/flat_icons.png") no-repeat scroll -138px -123px; }
184-
.listing li .icon.filetype-pdf { background: url("/images/flat_icons.png") no-repeat scroll -138px -96px; }
192+
.listing li .icon.filetype-docx { background: url("/images/flat_icons.png") no-repeat scroll -138px -122px; }
193+
.listing li .icon.filetype-pdf { background: url("/images/flat_icons.png") no-repeat scroll -138px -95px; }
185194

186-
.listing li .icon.filetype-js { background: url("/images/flat_icons.png") no-repeat scroll -138px -204px; }
187-
.listing li .icon.filetype-css { background: url("/images/flat_icons.png") no-repeat scroll -138px -254px; }
188-
.listing li .icon.filetype-php { background: url("/images/flat_icons.png") no-repeat scroll -138px -179px; }
195+
.listing li .icon.filetype-js { background: url("/images/flat_icons.png") no-repeat scroll -138px -203px; }
196+
.listing li .icon.filetype-css { background: url("/images/flat_icons.png") no-repeat scroll -138px -253px; }
197+
.listing li .icon.filetype-php { background: url("/images/flat_icons.png") no-repeat scroll -138px -178px; }
189198
.listing li .icon.filetype-html,
190199
.listing li .icon.filetype-htm,
191-
.listing li .icon.filetype-xhtml { background: url("/images/flat_icons.png") no-repeat scroll -138px -228px; }
200+
.listing li .icon.filetype-xhtml { background: url("/images/flat_icons.png") no-repeat scroll -138px -227px; }
192201

193202

194-
.listing li .filename { color: #555; cursor: pointer; height: 32px; max-width: 40%; overflow: hidden; float: left; padding: 0 7px 0 7px; border-radius: 3px; transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; }
203+
.listing li .filename { color: #555; cursor: pointer; height: 32px; max-width: 40%; overflow: hidden; float: left; padding: 2px 7px 0 7px; border-radius: 3px; transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; }
195204
/* .listing li .filename { background: url("/images/folder_.png") no-repeat scroll -2px 6px; color: #555; cursor: pointer; float: left; margin-left: -27px; padding-left: 19px; }*/
196205

197206
.listing li .filename:hover { color: #333; background-color: #D1D0CF; }
@@ -202,48 +211,62 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
202211
.listing li.active.selected .filename:hover { color: #FFF; background-color: #60A885; }
203212
*/
204213
.listing li .filename a { color: #7D7D7D; text-decoration: none; }
205-
.listing li .mode { width: 51px; font-size: 11px; }
206-
.listing li .owner { width: 11%; font-style: italic; color: #81A64F; font-size: 12px; }
207-
.listing li .size-value { width: 70px; color: #44a8b3; font-size: 12px; padding-right: 7px; text-align: right; }
208-
.listing li .size-unit { width: 30px; font-size: 11px; font-weight: bold; color: #A7A7A7; text-align: left; }
209-
.listing li .date { width: 50px; font-size: 11px; }
210-
.listing li .time { width: 50px; font-size: 11px; }
214+
.listing li .mode { width: 51px; font-size: 11px; padding-top: 2px; }
215+
.listing li .owner { width: 11%; font-style: italic; color: #81A64F; font-size: 12px; padding-top: 2px; }
216+
.listing li .size-value { width: 70px; color: #44a8b3; font-size: 12px; padding-right: 7px; text-align: right; padding-top: 2px; }
217+
.listing li .size-unit { width: 30px; font-size: 11px; font-weight: bold; color: #A7A7A7; text-align: left; padding-top: 2px; }
218+
.listing li .date { width: 50px; font-size: 11px; padding-top: 2px; }
219+
.listing li .time { width: 50px; font-size: 11px; padding-top: 2px; }
220+
221+
.window.active .listing li.selected .mode { color: #7F7550; }
222+
.window.active .listing li.selected .owner { /* color: #7F7550; */ }
223+
.window.active .listing li.selected .size-value { color: #7F7550; }
224+
.window.active .listing li.selected .size-unit { color: #7F7550; }
225+
.window.active .listing li.selected .date { color: #7F7550; }
226+
.window.active .listing li.selected .time { color: #7F7550; }
211227

228+
229+
/*
212230
.listing li.selected-inactive.selected { background-color: #e9e9e9; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }
213231
.listing li.selected-inactive .mode,
214232
.listing li.selected-inactive .time,
215233
.listing li.selected-inactive .date { color: #999 !important; }
216-
.window.active .listing li.selected.active { background-color: #73CAA0; }
234+
*/
217235

218-
.listing li.selected { background-color: #777 /*#7FD5D9*/; }
236+
.listing li.selected { background-color: #DEDEDE; }
219237
.listing.active li.selected { background-color: #ffd437 /*#7FD5D9*/; }
220238
.listing li.selected .filename:hover { color: #333; background-color: #F0B607; }
221239

222240

223241

224242

225-
.listing li.selected-inactive.selected.active { background-color: #dfc891; border-top: 1px solid #cdb885; border-bottom: 1px solid #cdb885; }
226-
.listing li.active { background-color: #e7cf96; }
227-
.window.active .listing li.active { background-color: #ffe06c; }
228-
.listing li.active .filename{ color: #31775A; }
243+
/* ///.listing li.selected-inactive.selected.active { background-color: #dfc891; border-top: 1px solid #cdb885; border-bottom: 1px solid #cdb885; }*/
244+
245+
/*
229246
.listing li.selected .filename { color: #333; }
230247
.listing li.selected .date,
231248
.listing li.selected .mode,
232249
.listing li.selected .time { color: #777; }
233250
.listing li.selected .owner { color: #31775A; }
234251
.listing li.selected .size { color: #31775A; }
252+
*/
253+
.window.active .listing li.active { background-color: #FFDC5A; }
254+
.window.active .listing li.active .marker { background-color: #C2A84B; }
255+
.listing li.active { background-color: #DEDEDE; }
256+
.listing li.active .marker { background-color: #C2C2C2; }
235257

236-
.listing li.selected.active .filename { color: #fff29c; }
258+
/* ///.listing li.selected.active .filename { color: #fff29c; } */
237259
.listing li.selected.active .marker { background-color: #3a8a96; }
238-
.listing li.selected-inactive .marker { background-color: #7FD5D9; }
239-
.listing li.selected-inactive .filename { color: #54A9A9; }
260+
.listing li.selected-inactive { background-color: #DEDEDE; }
261+
/*///.listing li.selected-inactive .marker { background-color: #7FD5D9; }
262+
.listing li.selected-inactive .filename { color: #54A9A9; } */
240263

241264

242265
.listing li .filename a:hover { color: #3399FF; }
243266
.listing li:hover { background-color: #E5E5E5; cursor: pointer; }
244-
.listing li.active:hover { background-color: #FFD63F; }
267+
.window.active .listing li.active:hover { background-color: #FFE570; }
245268
.listing li.selected:hover { background-color: /*#89E6EA*/#FFE570; }
246-
.listing li.selected.active:hover { background-color: #77D1A6; }
269+
.listing li.selected.active:hover { background-color: #FFE570; }
247270

248271

249272

@@ -358,10 +381,13 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
358381

359382
.warning-box { width: 60%; background-color: #ff9f89; border-bottom: 5px solid #ff6c6e; color: #FFF; font-family: arial; margin-left: auto; margin-right: auto; padding-bottom: 30px; margin-bottom: 50px; left: 20%; position: absolute; top: 0; box-shadow: 0 2px 11px 0 rgba(0, 0, 0, 0.5); }
360383
.warning-box.inform { background-color: #72c5b2; border-color: #019174; }
384+
.warning-box.reload { width: 100px; background-color: #333; border-color: #222; z-index: 5000; left: 45%; opacity: 0.9; padding: 17px 27px; border-radius: 0 0 6px 6px; border: none; opacity: 0.9; }
361385
.warning-box .message { width: 100%; padding: 30px 0 5px; text-align: center; font-size: 14px; text-transform: uppercase; font-weight: bold; }
386+
.warning-box.reload .message-small { color: #ccc; }
387+
.warning-box.reload .message-small span { color: #72C5B2; font-weight: bold; }
362388
.warning-box .message-small { width: 100%; text-align: center; font-size: 13px; color: #9D3407; }
363389
.warning-box.inform .message-small { color: #555; }
364-
.warning-box .close { width: 30px; height: 30px; top: 5px; right: -5px; background-color: #FFF; float: right; cursor: pointer; background: url("/images/flat_icons.png") repeat scroll -258px -174px; }
390+
.warning-box .close { width: 30px; height: 30px; top: 5px; right: -5px; background-color: #FFF; float: right; cursor: pointer; background: url("/images/flat_icons.png") repeat scroll -382px -174px; }
365391
.warning-box .close:hover { background-color: #DC5D5F; }
366392
.warning-box.inform .close:hover { background-color: #019174; }
367393

@@ -432,7 +458,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
432458
}
433459

434460
.progress-container .progress-elm .progress {
435-
background: #ebebeb url("/images/progress.gif") no-repeat scroll -60px 0;
461+
background: #ebebeb url("/images/progress.gif") no-repeat scroll 0px 0;
436462
border-color: #8a9079;
437463
border-radius: 3px;
438464
color: transparent;

web/edit/package/index.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
$v_ns2 = $nameservers[1];
5151
$v_ns3 = $nameservers[2];
5252
$v_ns4 = $nameservers[3];
53+
$v_ns5 = $nameservers[4];
54+
$v_ns6 = $nameservers[5];
55+
$v_ns7 = $nameservers[6];
56+
$v_ns8 = $nameservers[7];
5357
$v_backups = $data[$v_package]['BACKUPS'];
5458
$v_date = $data[$v_package]['DATE'];
5559
$v_time = $data[$v_package]['TIME'];
@@ -155,9 +159,17 @@
155159
$v_ns2 = trim($_POST['v_ns2'], '.');
156160
$v_ns3 = trim($_POST['v_ns3'], '.');
157161
$v_ns4 = trim($_POST['v_ns4'], '.');
162+
$v_ns5 = trim($_POST['v_ns5'], '.');
163+
$v_ns6 = trim($_POST['v_ns6'], '.');
164+
$v_ns7 = trim($_POST['v_ns7'], '.');
165+
$v_ns8 = trim($_POST['v_ns8'], '.');
158166
$v_ns = $v_ns1.",".$v_ns2;
159167
if (!empty($v_ns3)) $v_ns .= ",".$v_ns3;
160168
if (!empty($v_ns4)) $v_ns .= ",".$v_ns4;
169+
if (!empty($v_ns5)) $v_ns .= ",".$v_ns5;
170+
if (!empty($v_ns6)) $v_ns .= ",".$v_ns6;
171+
if (!empty($v_ns7)) $v_ns .= ",".$v_ns7;
172+
if (!empty($v_ns8)) $v_ns .= ",".$v_ns8;
161173
$v_ns = escapeshellarg($v_ns);
162174
$v_time = escapeshellarg(date('H:i:s'));
163175
$v_date = escapeshellarg(date('Y-m-d'));

web/edit/user/index.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
$v_ns2 = $nameservers[1];
4444
$v_ns3 = $nameservers[2];
4545
$v_ns4 = $nameservers[3];
46+
$v_ns5 = $nameservers[4];
47+
$v_ns6 = $nameservers[5];
48+
$v_ns7 = $nameservers[6];
49+
$v_ns8 = $nameservers[7];
50+
4651
$v_suspended = $data[$v_username]['SUSPENDED'];
4752
if ( $v_suspended == 'yes' ) {
4853
$v_status = 'suspended';
@@ -142,17 +147,35 @@
142147
}
143148

144149
// Change NameServers
145-
if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) {
150+
if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) || ($v_ns5 != $_POST['v_ns5'])
151+
|| ($v_ns6 != $_POST['v_ns6']) || ($v_ns7 != $_POST['v_ns7']) || ($v_ns8 != $_POST['v_ns8']) && (empty($_SESSION['error_msg']))) {
146152
$v_ns1 = escapeshellarg($_POST['v_ns1']);
147153
$v_ns2 = escapeshellarg($_POST['v_ns2']);
148154
$v_ns3 = escapeshellarg($_POST['v_ns3']);
149155
$v_ns4 = escapeshellarg($_POST['v_ns4']);
156+
$v_ns5 = escapeshellarg($_POST['v_ns5']);
157+
$v_ns6 = escapeshellarg($_POST['v_ns6']);
158+
$v_ns7 = escapeshellarg($_POST['v_ns7']);
159+
$v_ns8 = escapeshellarg($_POST['v_ns8']);
150160
$ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2;
151161
if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3;
152162
if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4;
163+
if (!empty($_POST['v_ns5'])) $ns_cmd = $ns_cmd." ".$v_ns5;
164+
if (!empty($_POST['v_ns6'])) $ns_cmd = $ns_cmd." ".$v_ns6;
165+
if (!empty($_POST['v_ns7'])) $ns_cmd = $ns_cmd." ".$v_ns7;
166+
if (!empty($_POST['v_ns8'])) $ns_cmd = $ns_cmd." ".$v_ns8;
153167
exec ($ns_cmd, $output, $return_var);
154168
check_return_code($return_var,$output);
155169
unset($output);
170+
171+
$v_ns1 = str_replace("'","", $v_ns1);
172+
$v_ns2 = str_replace("'","", $v_ns2);
173+
$v_ns3 = str_replace("'","", $v_ns3);
174+
$v_ns4 = str_replace("'","", $v_ns4);
175+
$v_ns5 = str_replace("'","", $v_ns5);
176+
$v_ns6 = str_replace("'","", $v_ns6);
177+
$v_ns7 = str_replace("'","", $v_ns7);
178+
$v_ns8 = str_replace("'","", $v_ns8);
156179
}
157180

158181
// Set success message

web/file_manager/fm_api.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//error_reporting(NULL);
55

66

7-
session_start();
8-
97
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
108
include($_SERVER['DOCUMENT_ROOT']."/file_manager/fm_core.php");
119

web/inc/main.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
session_start();
23

34
// Check system settings
45
if ((!isset($_SESSION['VERSION'])) && (!defined('NO_AUTH_REQUIRED'))) {
@@ -101,6 +102,30 @@ function _translate() {
101102
$user = $_SESSION['look'];
102103
}
103104

105+
get_favorites();
106+
107+
108+
function get_favorites(){
109+
exec (VESTA_CMD."v-list-user-favourites ".$_SESSION['user']." json", $output, $return_var);
110+
// $data = json_decode(implode('', $output).'}', true);
111+
$data = json_decode(implode('', $output), true);
112+
$data = array_reverse($data,true);
113+
$favourites = array();
114+
115+
foreach($data['Favourites'] as $key => $favourite){
116+
$favourites[$key] = array();
117+
118+
$items = explode(',', $favourite);
119+
foreach($items as $item){
120+
if($item)
121+
$favourites[$key][trim($item)] = 1;
122+
}
123+
}
124+
125+
$_SESSION['favourites'] = $favourites;
126+
}
127+
128+
104129

105130
function check_error($return_var) {
106131
if ( $return_var > 0 ) {
@@ -144,6 +169,7 @@ function humanize_time($usage) {
144169
$usage = $usage / 60;
145170
if ( $usage > 24 ) {
146171
$usage = $usage / 24;
172+
147173
$usage = number_format($usage);
148174
if ( $usage == 1 ) {
149175
$usage = $usage." ".__('day');

0 commit comments

Comments
 (0)