Jump to content

Knowledgebase - Only One  Specific User Access


Recommended Posts

13 hours ago, VirtualWorldGlobal said:

Is there any way to provide Knowledgebase access to only one  specific user account as (primary.clientemail@client.com)

If yes then how to do this ?

Thanks

 
 

Not by default. This could be done with hooks and some customization but out of the box there is no option. You can either make them public or private, and private is global for all users.

This also makes sense. Why would you create a completely new KB article just for 1 single person? It would make more sense if this were per group, example, this KB only applies to people with XX product, but that is also not possible out of the box.

Link to comment
Share on other sites

16 hours ago, VirtualWorldGlobal said:

Is there any way to provide Knowledgebase access to only one  specific user account as (primary.clientemail@client.com)

as yggdrasil says, you would have to hook or edit the templates.... once a user is logged in, then you start to limit who sees what.

3 hours ago, yggdrasil said:

Why would you create a completely new KB article just for 1 single person?

he's not wanting to create a kb article for just one user - I can imagine what he has in mind with this.

Link to comment
Share on other sites

@yggdrasil Kind of Admin KB (where all KB articles will be accessed by one client only).

I have started using WordPress KB plugin for clients which is more convenient for me to manage...

1 hour ago, brian! said:

as yggdrasil says, you would have to hook or edit the templates.... once a user is logged in, then you start to limit who sees what.

Okay 

 

1 hour ago, brian! said:

he's not wanting to create a kb article for just one user - I can imagine what he has in mind with this.

Yes you know better 😃

Link to comment
Share on other sites

 

10 minutes ago, brian! said:

so is the KB in WordPress or WHMCS ?

Wordpress for client KB - For client KB I have migrated all articles to my website using - Knowledgebase Helpdesk lite plugin (It's Free)

But for the WHMCS KB for just one user access would help me to create Admin KB for ourselves....

Edited by VirtualWorldGlobal
Link to comment
Share on other sites

Hi @brian!

please help me to add submenu in the primary navbar 

So that when user clicks on 'Order' Button there is a drop down where I can add to website URL's and they open in a new window.

You provide me a hook to add custom text to the navbar and it has been excellent - many thanks,  now I want remove the URL from the Order button and add the websites below...

vwits.png

Edited by VirtualWorldGlobal
Link to comment
Share on other sites

38 minutes ago, VirtualWorldGlobal said:

Wordpress for client KB - For client KB I have migrated all articles to my website using - Knowledgebase Helpdesk lite plugin (It's Free)

it might be useful to post a link in case others want to use it.

39 minutes ago, VirtualWorldGlobal said:

But for the WHMCS KB for just one user access would help me to create Admin KB for ourselves....

the quick way would be to detect who the user is, and redirect them away from kb pages if they're not who you want to access kb...

<?php

# Allow Access To Knowledgebase Pages Hook
# Written by brian! 

function allow_access_to_kb_pages_hook($vars) {
	
	$client = Menu::context('client');
	$kbusers = array(5);
	if (!in_array($client->id,$kbusers)) {
		header("Location: index.php");
		die;
	}
}
add_hook("ClientAreaPageKnowledgebase", 1, "allow_access_to_kb_pages_hook");

if we were having to give access to different articles to different users, then that gets more involved - but the above is more of a simple, are you user X? if so, you can view the kb; if not, you're getting redirected away from there to another specified page.

so $kbusers is an array of client IDs that you want to grant access to the kb to... i'd prefer to use ids rather than email addresses, but you could switch the array to contain a list of email addresses, and then use $client->email in the code instead.

9 minutes ago, VirtualWorldGlobal said:

So that when user clicks on 'Order' Button there is a drop down where I can add to website URL's and they open in a new window.

what's the menuitemname of that Order navbar child ?

Link to comment
Share on other sites

The below hook you gave me...to add custom Menu Item

 

Quote

<?php

use WHMCS\View\Menu\Item as MenuItem;
 
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
    $client = Menu::context('client');
    $primaryNavbar->addChild('A- Order',array('label' => Lang::trans('Order'),'uri' => 'https://www.mydomain.com/sales','order' => 1,'icon' => 'fa fa-shopping-cart',))->setAttribute('target','_blank');
    if (!$client && !is_null($primaryNavbar->getChild('Home'))) 
    {
        $primaryNavbar->getChild('Home')->setUri('clientarea.php')->setAttribute('target','_blank');
    }
});

 

Link to comment
Share on other sites

Knowledgebase Helpdesk lite plugin (It's Free)

URL: https://wordpress.org/plugins/knowledgebase-helpdesk/

36 minutes ago, brian! said:
1 hour ago, VirtualWorldGlobal said:

Wordpress for client KB - For client KB I have migrated all articles to my website using - Knowledgebase Helpdesk lite plugin (It's Free)

it might be useful to post a link in case others want to use it.

 

 

Link to comment
Share on other sites

11 minutes ago, VirtualWorldGlobal said:

The below hook you gave me...to add custom Menu Item

<?php

use WHMCS\View\Menu\Item as MenuItem;
 
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
    $client = Menu::context('client');
    $primaryNavbar->addChild('A- Order',array('label' => Lang::trans('Order'),'uri' => 'https://www.mydomain.com/sales','order' => 1,'icon' => 'fa fa-shopping-cart',))->setAttribute('target','_blank');
    $primaryNavbar->getChild('A- Order')->addChild('website1',array('uri' => 'https://www.mydomain.com/website1','order' => 1,'icon' => 'fa fa-shopping-cart',))->setAttribute('target','_blank');
    $primaryNavbar->getChild('A- Order')->addChild('website2',array('uri' => 'https://www.mydomain.com/website2','order' => 2,'icon' => 'fa fa-shopping-cart',))->setAttribute('target','_blank');	
    if (!$client && !is_null($primaryNavbar->getChild('Home'))) 
    {
        $primaryNavbar->getChild('Home')->setUri('clientarea.php')->setAttribute('target','_blank');
    }
});

jL6g1Qs.png

I didn't know if you wanted to use icons on the child menu items, or if there should be language overrides used for the labels...

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