[XenConcept] Login As User

[XenConcept] Login As User [Paid] 2.1.1

No permission to buy ($15.00)
@XenConcept i get this error with xenforo 2.0.7 and php 7.2:

ErrorException: [E_WARNING] count(): Parameter must be an array or an object that implements Countable in src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php at line 50
  1. XF::handlePhpError()
  2. count() in src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php at line 50
  3. XenConcept\LoginAsUser\Service\LoginAsUser\Login->preLogin() in src/addons/XenConcept/LoginAsUser/XF/Pub/Controller/Misc.php at line 26
  4. XenConcept\LoginAsUser\XF\Pub\Controller\Misc->setupLoginAsUser() in src/addons/XenConcept/LoginAsUser/XF/Pub/Controller/Misc.php at line 61
  5. XenConcept\LoginAsUser\XF\Pub\Controller\Misc->actionLoginAsUser() in src/XF/Mvc/Dispatcher.php at line 249
  6. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  9. XF\App->run() in src/XF.php at line 328
  10. XF::runApp() in index.php at line 13
 
@XenConcept i get this error with xenforo 2.0.7 and php 7.2:

ErrorException: [E_WARNING] count(): Parameter must be an array or an object that implements Countable in src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php at line 50
  1. XF::handlePhpError()
  2. count() in src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php at line 50
  3. XenConcept\LoginAsUser\Service\LoginAsUser\Login->preLogin() in src/addons/XenConcept/LoginAsUser/XF/Pub/Controller/Misc.php at line 26
  4. XenConcept\LoginAsUser\XF\Pub\Controller\Misc->setupLoginAsUser() in src/addons/XenConcept/LoginAsUser/XF/Pub/Controller/Misc.php at line 61
  5. XenConcept\LoginAsUser\XF\Pub\Controller\Misc->actionLoginAsUser() in src/XF/Mvc/Dispatcher.php at line 249
  6. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  9. XF\App->run() in src/XF.php at line 328
  10. XF::runApp() in index.php at line 13

Hello,

The error is due to the PHP version. I had the case with a our client
 
Not sure why this wasn't fixed, but i ran into this problem too so here is a quick fix.

src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php
Code:
    public function preLogin(&$errors = [])
    {

change to

    public function preLogin(&$errors)
    {
        $errors = [];
 
Not sure why this wasn't fixed, but i ran into this problem too so here is a quick fix.

src/addons/XenConcept/LoginAsUser/Service/LoginAsUser/Login.php
Code:
    public function preLogin(&$errors = [])
    {

change to

    public function preLogin(&$errors)
    {
        $errors = [];

Ah thanks, i fixed by myself days ago changing line 50 from

Code:
return count($errors) == 0;
to

Code:
return $errors == 0;

I don't know if its correct but works, it's a shame that @XenConcept don't fix his paid addons.
 
One problem I just found with this, is that a moderator with this permission can login to an admins account, then they have permissions that the admin has to do things they do not otherwise have permission to do.

I created a super mod, without hard delete permission, used this to login to my admin account, then I could hard delete as an admin.
 
One problem I just found with this, is that a moderator with this permission can login to an admins account, then they have permissions that the admin has to do things they do not otherwise have permission to do.

I created a super mod, without hard delete permission, used this to login to my admin account, then I could hard delete as an admin.

This is normal since you login to the user's account. For example, how do you want to test the permissions of the user to log in to if you keep your permissions?
 
I understand that, but really this is restricted to admins only then. A moderator should not be able to test super admin permissions. A hierarchy would be nice, is all...

Super admin can test everyone lower, admin can test super mod, mod, user, mod can test user. A security thing.

Its ok... I will just limit to admins.
 
After installing I do not see the login as user button in their profile. (Do not display the button (Login As User) is unticked in options)

Should there be a permission? (I'm not seeing any permissions for the addon)
 
After installing I do not see the login as user button in their profile. (Do not display the button (Login As User) is unticked in options)

Should there be a permission? (I'm not seeing any permissions for the addon)

The permission is in General moderator permissions
 

Attachments

  • Screenshot_2.webp
    Screenshot_2.webp
    30.8 KB · Views: 10
Got it. As the moderator permissions was collapsed my browser search for login didn’t find anything
 
Top Bottom