Jump to content

How to delete the parts of Sub-Account Permissions


Nyan

Recommended Posts

I want to delete the indication of the followings in Add New Contact page.

Sub-Account-Permissions

Manage Domain Settings

View & Manage Affiliate Account

View & Modify Product Passwords

View Domains

Sub-Account-Permissions.jpg

 

I updated from V.6.1.1 to V.6.2.0.

WHMCS support told that I must look at the following URL.

http://docs.whmcs.com/Hooks:ClientAreaPageContacts

 

Any help would be greatly appreciated!!

Link to comment
Share on other sites

WHMCS support told that I must look at the following URL.

http://docs.whmcs.com/Hooks:ClientAreaPageContacts

there are probably two ways to do this - either by modifying the template(s), or using an action hook.

 

if you wanted to modify the templates, you could edit the clientareaaddcontact.tpl template and add an {if} statement to remove the permissions you don't want... replace the following code...

 

                {foreach $allPermissions as $permission}
                   <div class="col-sm-6">
                       <label>
                           <input type="checkbox" name="permissions[]" value="{$permission}"{if in_array($permission, $permissions)} checked{/if} />
                           <span>
                               {assign var='langPermission' value='subaccountperms'|cat:$permission}{$LANG.$langPermission}
                           </span>
                       </label>
                   </div>
               {/foreach}

with...

 

                {foreach $allPermissions as $permission}
               {if $permission neq "manageproducts" and $permission neq "domains" and $permission neq "managedomains" and $permission neq "affiliates"}
                   <div class="col-sm-6">
                       <label>
                           <input type="checkbox" name="permissions[]" value="{$permission}"{if in_array($permission, $permissions)} checked{/if} />
                           <span>
                               {assign var='langPermission' value='subaccountperms'|cat:$permission}{$LANG.$langPermission}
                           </span>
                       </label>
                   </div>
               {/if}
               {/foreach}

additionally, you might need to make a similar change to 'clientareacontacts.tpl' which has a similar {foreach} loop to show the sub-account permissions.

 

or the quicker way, would be to use an action hook - add a file to the includes/hooks folder, call it "addcontactshook.php" and paste the following into it.

 

<?php

function hook_modify_accounts_permissions($vars) 
   {
       $permissions = array("allPermissions" => array("profile","contacts","products","productsso","invoices","quotes","tickets","emails","orders"));
       return $permissions; 
   }

add_hook('ClientAreaPageAddContact', 1, 'hook_modify_accounts_permissions');
?>

the hook replaces the existing Smarty array with the options you want removed - with this, there should be no need to modify the templates.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated