Skip to content

Commit 42f6ced

Browse files
author
Serghey Rodin
committed
enable/disable softaculous plugin
1 parent fbc0cf5 commit 42f6ced

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

web/edit/server/index.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,33 @@
459459
}
460460
}
461461
}
462+
463+
// activating softaculous
464+
if (empty($_SESSION['error_msg'])) {
465+
if($_SESSION['SOFTACULOUS'] != $_POST['v_softaculous'] && $_POST['v_softaculous'] == 'yes'){
466+
exec (VESTA_CMD."v-add-sys-softaculous", $output, $return_var);
467+
check_return_code($return_var,$output);
468+
unset($output);
469+
if (empty($_SESSION['error_msg'])) {
470+
$_SESSION['ok_msg'] = __('Softaculous Activated');
471+
$_SESSION['SOFTACULOUS'] = 'yes';
472+
}
473+
}
474+
}
475+
476+
// disable softaculous
477+
if (empty($_SESSION['error_msg'])) {
478+
if($_SESSION['SOFTACULOUS'] != $_POST['v_softaculous'] && $_POST['v_softaculous'] == 'no'){
479+
exec (VESTA_CMD."v-delete-sys-softaculous", $output, $return_var);
480+
check_return_code($return_var,$output);
481+
unset($output);
482+
if (empty($_SESSION['error_msg'])) {
483+
$_SESSION['ok_msg'] = __('Softaculous Disabled');
484+
$_SESSION['SOFTACULOUS'] = '';
485+
}
486+
}
487+
}
488+
462489
}
463490

464491
// Check system configuration

web/js/pages/edit_server.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,20 @@ $(document).ready(function(){
1414
$('.sftp.description').hide();
1515
}
1616
});
17+
18+
$('select[name=v_softaculous]').change(function(){
19+
if($(this).val() == 'yes'){
20+
$('.softaculous.description').show();
21+
} else {
22+
$('.softaculous.description').hide();
23+
}
24+
});
25+
26+
$('input[name=v_mail_relay]').change(function(){
27+
if($(this).is(':checked')){
28+
$('.mail-relay').show();
29+
} else {
30+
$('.mail-relay').hide();
31+
}
32+
});
1733
});

web/templates/admin/edit_server.html

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,68 @@
280280
<br><br>
281281
</td>
282282
</tr>
283+
<tr>
284+
<td class="vst-text step-top">
285+
<label>
286+
<input type="checkbox" class="vst-checkbox use_relay" name="v_mail_relay"">
287+
<?=__('Use relay')?>
288+
</label>
289+
</td>
290+
</tr>
291+
292+
293+
<tr class="mail-relay" style="display: none;">
294+
<td>
295+
<table>
296+
<tr>
297+
<td class="vst-text step-left input-label">
298+
<?php print __('Hostname');?><br>
299+
<span style="font-size: 10pt; color:#777;"><?=__('enter hostname or IP address');?></span>
300+
</td>
301+
</tr>
302+
<tr>
303+
<td class="step-left">
304+
<input type="text" size="20" class="vst-input v-ftp-user" name="v_relay_hostname" value="<?=htmlentities(trim($v_relay_hostname, "'"))?>">
305+
</td>
306+
</tr>
307+
308+
309+
<tr>
310+
<td class="vst-text step-left input-label">
311+
<?php print __('Port');?><br>
312+
</td>
313+
</tr>
314+
<tr>
315+
<td class="step-left">
316+
<input type="text" size="20" class="vst-input v-ftp-user" name="v_relay_port" value="<?=htmlentities(trim($v_relay_port, "'"))?>">
317+
</td>
318+
</tr>
319+
320+
<tr>
321+
<td class="vst-text step-left input-label">
322+
<?php print __('Username');?><br>
323+
</td>
324+
</tr>
325+
<tr>
326+
<td class="step-left">
327+
<input type="text" size="20" class="vst-input v-ftp-user" name="v_relay_username" value="<?=htmlentities(trim($v_relay_username, "'"))?>">
328+
</td>
329+
</tr>
330+
331+
<tr>
332+
<td class="vst-text step-left input-label">
333+
<?php print __('Password');?><br>
334+
</td>
335+
</tr>
336+
<tr>
337+
<td class="step-left">
338+
<input type="text" size="20" class="vst-input v-ftp-user" name="v_relay_password" value="<?=htmlentities(trim($v_relay_password, "'"))?>">
339+
</td>
340+
</tr>
341+
</table>
342+
</td>
343+
</tr>
344+
283345
</table>
284346
</td>
285347
</tr>
@@ -846,6 +908,38 @@
846908
</div>
847909
</td>
848910
</tr>
911+
912+
913+
914+
915+
<tr>
916+
<td class="vst-text" id="module-softaculous">
917+
<?php print __('Softaculous') ?>
918+
</td>
919+
</tr>
920+
<tr>
921+
<td>
922+
<select class="vst-list" name="v_softaculous">
923+
<option value='no'><?=__('no')?></option>
924+
<option value='yes' <? if($_GET['lead'] == 'softaculous' || $_SESSION['SOFTACULOUS'] == 'yes') echo 'selected="selected"'; ?>><?=__('yes')?></option>
925+
</select>
926+
<br><br>
927+
<div class="softaculous description" <? if ($_SESSION['SOFTACULOUS'] != 'yes') { ?>style="display:none" <? } ?>>
928+
<h5>Web Application Installations Made Easy</h5>
929+
Softaculous is a great Auto Installer having 426 great scripts, 1115 PHP Classes
930+
and we are still adding more. Softaculous is ideal for Web Hosting companies and
931+
it could give a significant boost to your sales. These scripts cover most of the
932+
uses a customer could ever have. We have covered a wide array of Categories so that
933+
everyone could find the required script one would need to power their Web Site.
934+
<ul>
935+
<li>
936+
<a href="https://www.softaculous.com/softaculous/" class="purchase" target="_blank"><?=__('Get Premium License')?></a>
937+
</li>
938+
</ul>
939+
</div>
940+
</td>
941+
</tr>
942+
849943
</table>
850944
</td>
851945
</tr>

0 commit comments

Comments
 (0)