Jump to content
robetus

Can't remove Change Password from module

Recommended Posts

I've created a provisioning module for v7.3.0 and I'm using the following to remove the Change Password button from the Module Command area in admin but it isn't working:

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    if(null !== $primarySidebar->getChild('Service Details Actions'))
    {
            $primarySidebar->getChild('Service Details Actions')
            ->removeChild('Change Password');
    }
});

Why isn't this working? It looks right to me.

Share this post


Link to post
Share on other sites
if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
$primarySidebar->getChild('Service Details Actions')
->removeChild('Change Password');
}

 

Share this post


Link to post
Share on other sites

Thank you but that didn't work for me, I'm beginning to think I have a php conflict somewhere. No errors anywhere that I can see it just not working.

Edited by robetus

Share this post


Link to post
Share on other sites

it would work as a pure hook, but remember...

https://developers.whmcs.com/hooks/module-hooks/

Quote

Hook files are only detected at the time a module is activated and configured. If you add your hook file after the module has already been activated, you may need to deactivate and reactivate your module in order for WHMCS to recognise it.

 

Share this post


Link to post
Share on other sites

When you say pure hook you mean inside /includes/hooks correct? It didn't work there either. Again no errors, just not working. I also place it inside the hooks.php file inside the module and it didn't work. This module is not an addon module so there is nothing to activate.

Share this post


Link to post
Share on other sites
4 hours ago, robetus said:

I'm using the following to remove the Change Password button from the Module Command area in admin but it isn't working:

ok, just noticed you're trying to use a client area hook in the admin area.. that's never going to work...

it might be useful to see a screenshot of what you're seeing and where this button is.

Share this post


Link to post
Share on other sites

The button is next to the Suspend Unspend buttons in the module command area of the product in the admin area.

Share this post


Link to post
Share on other sites

I attached where the change password is showing in the admin area if that helps at all. Don't know why the hook isn't working.

module commands.png

Share this post


Link to post
Share on other sites

Never mind. I was looking at the wrong thing. I'm not sure if you can close this post or something but it was just a mistake. Apologies for that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By robetus
      Is there a way I can put this link:
      href="../dologin.php?username={$clientsdetails.email|urlencode}&language=&?action=productdetails&id={$serviceid}" Inside the Product/Services tab (/admin/clientsservices.php) so that I can directly login to the product in the clientarea that I'm looking at in the admin area? I'm not sure the above syntax is correct either.
    • By bellafronte
      Hello folks,
      I'm trying to retrieve shopping cart items in the ShoppingCartViewCartOutput hook, the documentation informs the cartData parameter, but it only has the array with the ID of the products in the cart.
      I need to retrieve all the cart data, such as product name, quantity, value, payment cycle, currency and the total value of the cart in ShoppingCartViewCartOutput hook. I tried to retrieve the data through $ _SESSION and the $ _GLOBAL variable but both have the same information as $cartData.
      Does WHMCS have a way to retrieve all the information from the cart at this point in the hook ShoppingCartViewCartOutput?
    • By tslin
      Hello everyone,
       
      My requirement is that let's say I have one configuration option called "personal computer" which is text box.
      User will fill 1, 2, 3, etc...
      When they check out ("Click to Continue" button), I need to check one value from my another site by calling web service.
      Eg. If they fill 3 and result from another site is less than 3, they cannot check out.
       
      My problem is I don't know whether there is a hook that run before user can checkout.
      I had tried following hooks but still can't find the solution.
      1) ShoppingCartValidateProductUpdate,
      2) ShoppingCartValidateCheckout
      3) ShoppingCartValidateProductUpdate
      4) ShoppingCartValidateCheckout
      5) PreShoppingCartCheckout
      6) PreCalculateCartTotals
       
      Most of them are not working, or, I don't know when will they fire.
       
      Please help me. Is this possible to achieve?
      Or is there any work around to achieve this?
       
      Thanks in advanced
      tslin
    • By ITSNev
      Are hooks global and ran against ALL products, or can you implement a hook to run against a specific product only?
       
      E.G. you created a new Product Call "Test Service" which is automatic set to "Active" using the AutoRelease Module on recieving payment in full, but then I would like to be able to setup HOOKs to run against this product when Suspending/UnSuspending/Terminating/Cancelling
       
      Or do I have to create a provision module for this?
       
      Thx
      Neville
    • By tbsweet52
      Hey guys,
       
      I've been stumped the past few days trying to figure out how to retrieve an order's custom field values and then HTTP POST them as XML to our 3rd party API.
       
      Since WHMCS doesn't include product custom fields as variables in it's hooks, I had to resort to querying MYSQL.
       
      I was able to retrieve the values, but I can't pass them in XML.
       
      Would appreciate any help!
       
      Thanks
       
      Tom
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines