Page 1 of 1

Disable/Hide VestaCP Modules like Web or DNS

Posted: Mon May 23, 2016 9:23 am
by ThA-LaN-LaW
Hi all,

can i disable or hide VestaCP Modules like Web or DNS in the Admin-Gui?
One of our Customers need only the MAIL tab.

Best regards

Re: Disable/Hide VestaCP Modules like Web or DNS

Posted: Tue May 24, 2016 2:33 pm
by skurudo
ThA-LaN-LaW wrote: can i disable or hide VestaCP Modules like Web or DNS in the Admin-Gui?
One of our Customers need only the MAIL tab.
You can limit to use for one customer via Packages

Or you can change template files for user, but this is for all users.
(/usr/local/vesta/web/templates/user/)

Re: Disable/Hide VestaCP Modules like Web or DNS

Posted: Thu May 26, 2016 2:56 pm
by ThA-LaN-LaW
Thanks!
but, how can i limit the Packages? If i set web to 0 - the WEB Tab still will be shown.

Re: Disable/Hide VestaCP Modules like Web or DNS

Posted: Fri May 27, 2016 5:09 am
by joem
ThA-LaN-LaW wrote:Thanks!
but, how can i limit the Packages? If i set web to 0 - the WEB Tab still will be shown.

Open /usr/local/vesta/web/templates/user/panel.html replace all content with,

Code: Select all

  <div class="hidden" id="token" token="<?=$_SESSION['token']?>"></div>
  <a href="#" class="to-top">
    <i class="l-icon-to-top"></i>
  </a>
  <a href="#" class="to-shortcuts">
    <i class="l-icon-shortcuts"></i>
  </a>
  <div class="l-header">
    <div class="l-center">
      <a href="/" class="l-logo"></a>
      <!-- /.l-logo -->
      <div class="l-menu clearfix">
        <div class="l-menu__item <?php if($TAB == 'STATS' ) echo 'l-menu__item--active' ?>"><a href="/list/stats/"><?=__('Statistics')?></a></div>
        <div class="l-menu__item <?php if($TAB == 'LOG' ) echo 'l-menu__item--active' ?>"><a href="/list/log/"><?=__('Log')?></a></div>
        <?php if ((isset($_SESSION['FILEMANAGER_KEY'])) && (!empty($_SESSION['FILEMANAGER_KEY']))) {?><div class="l-menu__item <?php if($TAB == 'FILEMANAGER' ) echo 'l-menu__item--active' ?>"><a href="/list/directory/"><?=__('File Manager')?></a></div><?php }?>
      </div>
      <!-- /.l-menu -->

      <div class="l-profile">
        <a class="l-profile__username" href="/edit/user/?user=<?php echo $user; ?>"><? if(($_SESSION['user'] == 'admin') && ($user != 'admin')) echo 'admin → ' ?><?=$user?></a>
        <a class="l-profile__logout" href="/logout/"> <?=__('Log out')?> </a>
      </div>
      <!-- /.l-profile -->
    </div>
  </div>
  <!-- /.l-header -->



  <div class="l-content">
    <div class="l-center">
      <div class="l-stat">
        <div class="l-stat__col <?php if($TAB == 'USER' ) echo 'l-stat__col--active' ?>">
          <a href="/list/user/">
            <div class="l-stat__col-title"><?=__('USER')?></div>
            <ul>
              <li><?=__('Disk')?>: <span><?=humanize_usage_size($panel[$user]['U_DISK'])?> <?=humanize_usage_measure($panel[$user]['U_DISK'])?></span></li>
              <li><?=__('Bandwidth');?>: <span> <?=humanize_usage_size($panel[$user]['U_BANDWIDTH'])?> <?=humanize_usage_measure($panel[$user]['U_BANDWIDTH'])?></span></li>
            </ul>
          </a>
        </div>
        
        <?php if($panel[$user]['WEB_DOMAINS'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'WEB' ) echo 'l-stat__col--active' ?>">
          <a href="/list/web/">
            <div class="l-stat__col-title"><?=__('WEB')?></div>
            <ul>
              <li><?=__('domains')?>: <span><?=$panel[$user]['U_WEB_DOMAINS']?></span></li>
              <li><?=__('aliases')?>: <span><?=$panel[$user]['U_WEB_ALIASES']?></span></li>
              <li><?=__('spnd')?>: <span><?=$panel[$user]['SUSPENDED_WEB']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        <?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'DNS' ) echo 'l-stat__col--active' ?>">
          <a href="/list/dns/">
            <div class="l-stat__col-title"><?=__('DNS')?></div>
            <ul>
              <li><?=__('domains')?>: <span><?=$panel[$user]['U_DNS_DOMAINS']?></span></li>
              <li><?=__('records')?>: <span><?=$panel[$user]['U_DNS_RECORDS']?></span></li>
              <li><?=__('spnd')?>: <span><?=$panel[$user]['SUSPENDED_DNS']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        <?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
          <a href="/list/mail/">
            <div class="l-stat__col-title"><?=__('MAIL')?></div>
            <ul>
              <li><?=__('domains')?>: <span><?=$panel[$user]['U_MAIL_DOMAINS']?></span></li>
              <li><?=__('accounts')?>: <span><?=$panel[$user]['U_MAIL_ACCOUNTS']?></span></li>
              <li><?=__('spnd')?>: <span><?=$panel[$user]['SUSPENDED_MAIL']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        <?php if($panel[$user]['DATABASES'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'DB' ) echo 'l-stat__col--active' ?>">
          <a href="/list/db/">
            <div class="l-stat__col-title"><?=__('DB')?></div>
            <ul>
              <li><?=__('databases')?>: <span><?=$panel[$user]['U_DATABASES']?></span></li>
              <li><?=__('spnd')?>: <span><?=$panel[$user]['SUSPENDED_DB']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        <?php if($panel[$user]['CRON_JOBS'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'CRON' ) echo 'l-stat__col--active' ?>">
          <a href="/list/cron/">
            <div class="l-stat__col-title"><?=__('CRON')?></div>
            <ul>
              <li><?=__('jobs')?>: <span><?=$panel[$user]['U_CRON_JOBS']?></span></li>
              <li><?=__('spnd')?>: <span><?=$panel[$user]['SUSPENDED_CRON']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        <?php if($panel[$user]['BACKUPS'] != "0") { ?>
        <div class="l-stat__col <?php if($TAB == 'BACKUP' ) echo 'l-stat__col--active' ?>">
          <a href="/list/backup/">
            <div class="l-stat__col-title"><?=__('BACKUP')?></div>
            <ul>
              <li><?=__('backups')?>: <span><?=$panel[$user]['U_BACKUPS']?></span></li>
            </ul>
          </a>
        </div>
        <?php } ?>
        
        
      </div>
      <!-- /.l-stats -->
    </div>
    <div class="l-separator"></div>
    <!-- /.l-separator -->
This will allow you to hide web, dns, mail, database, cron, and backup tabs by setting the package limit to 0 for each function. Keep in mind when you update vesta in the feature panel.html will be overwritten undoing these changes.