Nyan Posted December 11, 2015 Share Posted December 11, 2015 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 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!! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 11, 2015 Share Posted December 11, 2015 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. 0 Quote Link to comment Share on other sites More sharing options...
Nyan Posted December 14, 2015 Author Share Posted December 14, 2015 I appreciate your kindness. I can delete the indication of the followings in Add New Contact page. I have added a single line of code. add_hook('ClientAreaPageContacts', 1, 'hook_modify_accounts_permissions'); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.