Jump to content
brian!

v8 "Login As Owner" link - open in new tab/window hook

Recommended Posts

in v7 and earlier, you could right-click on the "Login As Client" link and open it in a new tab - useful if you need to see both admin and client areas at the same time.

in v8, "Login As Owner" now uses a form and you can't right-click on it to open a new tab... *sighs* 🙄

so the simple hook below will open that link in a new tab by default...

<?php

# Login As Owner Open In New Tab Hook
# Written by brian!

function admin_login_as_owner_hook($vars) {

	if ($vars['filename'] == 'clientssummary' && isset($_GET["userid"])) {
		return '<script>$("#frmLoginAsOwner").prop("target","_blank");</script>';
	}
}
add_hook("AdminAreaFooterOutput", 1, "admin_login_as_owner_hook");

you could edit the clientssummary.tpl template too and just add the target link to the form code.

Share this post


Link to post
Share on other sites

Hi,

After updating to 8.0 from 7.10 I can not longer login into customer´s backend because it causes the next error:

 

Oops!

Access Denied - Forbidden

You do not have the required permission to perform the selected operation!

 

Please try navigating using the options below.

 Regresar  Homepage
 
 

 

Can anybody help me?

Regards,

Oscar.

Share this post


Link to post
Share on other sites

(Updating myself)

Hi,

I have seen that I can login as owner only for customers created directly with WHMCS.

The error is located only with customers imported from Resellerclub with resellerclub-mods tool to mass import customers.

Any idea of where can I solve this problem?

 

Regards,

Oscar.

Share this post


Link to post
Share on other sites
18 hours ago, Manchester Web Hosting said:

@brian! this seems to be adjusted in the recent v8.0.2 and now you can click the login as owner in admin client summary screen and right click. Or am I looking at the wrong one??

I suspect you're looking at the right one - but what I see occurring is..

  • if I click on the link, it opens the client area and logs in in the same tab (useless if I need to see the admin area at the same time).
  • if I right-click on the link and open in new tab, then it opens the dashboard again in the new tab and not the logged in client area.

hence why I wrote the hook so that when I click the link, it opens the client area in a new tab.

Share this post


Link to post
Share on other sites
3 hours ago, brian! said:

I suspect you're looking at the right one - but what I see occurring is..

  • if I click on the link, it opens the client area and logs in in the same tab (useless if I need to see the admin area at the same time).
  • if I right-click on the link and open in new tab, then it opens the dashboard again in the new tab and not the logged in client area.

hence why I wrote the hook so that when I click the link, it opens the client area in a new tab.

Aha, you are indeed correct! i right clicked and opened in new tab yesterday BUt never actually checked the tab. I did just now and you are right it just shows the same page again.

Someone needs to give those guys a bafta OR grammy. The work they do is fantastic... maybe someday they should be nominated for a nobel prize?

Share this post


Link to post
Share on other sites

Apologies for necrobumping this issue but in 8.0.4 (and since 8.0) I can't "Login as Owner" for some users and can't figure out any pattern and I don't use Reseller club. There is something about how some of my users have been added that must be different and I suspect a direct database twiddle would fix it... but what might that twiddle be?

Share this post


Link to post
Share on other sites
5 hours ago, markc said:

There is something about how some of my users have been added that must be different and I suspect a direct database twiddle would fix it... but what might that twiddle be?

I take it that these users are "owners" ? e.g they're not previous subaccounts that have just been converted to users ?

Share this post


Link to post
Share on other sites

"subaccounts converted to users?" Not that I am aware of. I might be missing some conceptual change regarding users vs owners in the v8 update. I have triple checked that my Full Administrator user has everything checked in the Roles section. A difference is that clicking on Login as Owner for the users with an error goes to https://xxxxx/admin/client/548/login whereas the ones that work go to https://xxxxx/clientarea.php as I would expect. Hmm, perhaps a session  error.

Share this post


Link to post
Share on other sites
3 hours ago, markc said:

"subaccounts converted to users?" Not that I am aware of. I might be missing some conceptual change regarding users vs owners in the v8 update.

what should happen when upgrading to v8 I believe (happy to be corrected if wrong) is that...

  • clients are converted to users and assigned as owner of that client.
  • sub-accounts (contacts who can login) should be converted to users and assigned to the client.
  • contacts remain contacts.
4 hours ago, markc said:

A difference is that clicking on Login as Owner for the users with an error goes to https://xxxxx/admin/client/548/login whereas the ones that work go to https://xxxxx/clientarea.php as I would expect. Hmm, perhaps a session  error.

might be worth looking in the tblusers_clients database table and seeing if there is anything different about these users (tblusers).

another question to ask is what happens when the hook is disabled? e.g is the hook causing the issue or is WHMCS causing it ??

Share this post


Link to post
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