Page 1 of 1
Can modules be disabled?
Posted: Tue Feb 03, 2015 4:31 pm
by Grunthos
Can modules that aren't required be disabled in the web interface easily?
Stopping the services is simple enough but I'm looking to remove or diable DNS and MAIL from the interface if i can.
GTF
Re: Can modules be disabled?
Posted: Tue Feb 03, 2015 5:03 pm
by Grunthos
Answering my own post:
Easy. Code some php around each href in panel.html and they're selectable.
GTF
Re: Can modules be disabled?
Posted: Fri Feb 06, 2015 1:28 am
by ivanh
What was your PHP method? I was personally thinking editing the HTML with comments.
Re: Can modules be disabled?
Posted: Fri Feb 06, 2015 2:11 am
by Grunthos
I've already scrubbed the install i was playing with to test someting else but it was something like:
A function allowed_option takes a username and the option to check.
Reads a flatfile with something similar to:
"username","0","1","0","1"...etc
0 returns false, 1 returns true. If true output the HTML.
Code: Select all
<?php if (!allowed_option($userName,"/list/web"){
}
else {?>
<a class="nav-lnk" href="/list/web/">
<span class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>block">
<p class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>header">
<?php print __('WEB');?>
</p>
<p class="nav-counters">
<?php print __('domains');?>: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
<?php print __('aliases');?>: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
<?php print __('spnd');?>: <? echo $panel[$user]['SUSPENDED_WEB']?>
</p>
<p class="marker"></p>
</span>
</a>
<?php}?>
I was considering using the first part of the if to output a greyed out, non selectable option.
Crude but it worked ok for the test.
Hope that helps.
GTF