Jump to content

Check the menuitem disable or not


SametALMDR

Recommended Posts

Hi everyone,

I wanted to check any sidebar item is disable or not but ı couldn't do it such as in the following

add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar){

if($primarySidebar->getChild("My Account")->getChild("Security Settings")->isDisabled()){
    echo "exist";
}
else{
    echo "not exist";
}

});

It gives an error when there is no security question because it returns null but how can ı use is that exist or not ?

Link to comment
Share on other sites

On 18/05/2019 at 21:43, SametALMDR said:

Actually the thing that ı want to check is the securtiy questions part is enabled or disabled.Is there any variable exist in whmcs to check it as well ? 

Security questions aren't really enabled from a setting, they're enabled when you add a security question from the admin area - so the way to test would be to query the database, specifically the tbladminsecurityquestions table and do a row count - if it's more than 0 (I think it's empty on installation - but check that), then security questions should have been enabled.

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