[Xen-Soluce] Invite System

[Xen-Soluce] Invite System [Paid] 2.3.2 Fix 1

No permission to buy (€20.00)
Hi!
After registration without the code, with this ad-on is it possible to use the code for a registered user and get access to the "premium" user group?
So that they have access to private forums?

So basically there's a private category called X".
I give access to users who register with the code, but regular users who wont have it will get to simple user group so can access 90% of the forums.

You can access X" with the invitation registration or if you have the generated code and use it.

Is that possible with this ad-on?
 
Hi!
After registration without the code, with this ad-on is it possible to use the code for a registered user and get access to the "premium" user group?
So that they have access to private forums?

So basically there's a private category called X".
I give access to users who register with the code, but regular users who wont have it will get to simple user group so can access 90% of the forums.

You can access X" with the invitation registration or if you have the generated code and use it.

Is that possible with this ad-on?
Hello,

For the moment no, this addon only allows to invite users on to register and to put a forum only under invitation.

Regards, CRUEL-MODZ
 
@XenSoluce Suggestion: Set possibility for registered to automatically follow the user invite him and/or viceversa.
Example, UserA invite B and C, and B and C once registered, automatically follow A.
Or UserA invite B and C and once registered, A automatically follow B and C
 
@XenSoluce Suggestion: Set possibility for registered to automatically follow the user invite him and/or viceversa.
Example, UserA invite B and C, and B and C once registered, automatically follow A.
Or UserA invite B and C and once registered, A automatically follow B and C
Hello, I'll ask @CRUEL-MODZ about this !

Hello @xlegends , just saw your review , thank you. Feel free to post a suggestion here for invite via email :

Regards, SyTry
 
Bug: At the moment, tokens are unusable due to a flawed permissions check.

Solution: In src/addons/XenSoluce/InviteSystem/XF/Pub/Controller/Account.php find:
PHP:
            if($tokenR->canUse())
            {
                return $this->message(\XF::phrase('do_not_have_permission'));
            }

Change to
PHP:
            if(!$tokenR->canUse())
            {
                return $this->message(\XF::phrase('do_not_have_permission'));
            }

PS: Using return $this->noPermission(); is much easier than manually specifying the no permissions phrase :) Not only that, but it has the added benefit of being compatible with 3rd party add-ons that modify the "No permissions" page, because it uses the ControllerPlugin Error, and it also correctly returns status code 403 rather than 200.

I would strongly recommend replacing every instance of return $this->message(\XF::phrase('do_not_have_permission')); (or similar calls) with either return $this->noPermission(); or throw $this->exception($this->noPermission()); as appropriate.
 
Bug: At the moment, tokens are unusable due to a flawed permissions check.

Solution: In src/addons/XenSoluce/InviteSystem/XF/Pub/Controller/Account.php find:
PHP:
            if($tokenR->canUse())
            {
                return $this->message(\XF::phrase('do_not_have_permission'));
            }

Change to
PHP:
            if(!$tokenR->canUse())
            {
                return $this->message(\XF::phrase('do_not_have_permission'));
            }

PS: Using return $this->noPermission(); is much easier than manually specifying the no permissions phrase :) Not only that, but it has the added benefit of being compatible with 3rd party add-ons that modify the "No permissions" page, because it uses the ControllerPlugin Error, and it also correctly returns status code 403 rather than 200.

I would strongly recommend replacing every instance of return $this->message(\XF::phrase('do_not_have_permission')); (or similar calls) with either return $this->noPermission(); or throw $this->exception($this->noPermission()); as appropriate.
Indeed, thanks for the feedback!
 
In actionInvitation there's a very odd piece of code:

return $this->redirect($this->buildLink('account/invitation') . '?&code=' . $Code->code); - this is not how you add URL parameters to links. Please use $this->buildLink('account/invitation', null, ['code' => $Code->code]) instead.

See Controller::buildLink: public function buildLink($link, $data = null, array $parameters = []) - the $parameters param is an array of things that should be added as URL parameters.
 
Furthermore, entities are lacking property declarations. You should run php cmd.php xf-dev:entity-class-properties XenSoluce/InviteSystem after changing any entity.
 
In actionInvitation there's a very odd piece of code:

return $this->redirect($this->buildLink('account/invitation') . '?&code=' . $Code->code); - this is not how you add URL parameters to links. Please use $this->buildLink('account/invitation', null, ['code' => $Code->code]) instead.

See Controller::buildLink: public function buildLink($link, $data = null, array $parameters = []) - the $parameters param is an array of things that should be added as URL parameters.
Yes indeed, I will release an update as soon as possible ;)
 
In xs_is_clipboard_js template you need to be calling for new ClipboardJS(<selector>) to avoid:
Uncaught TypeError: Illegal constructor
from being thrown.

Also, maybe bundle clipboard.js in the add-on build? Or better yet use something like XF.CopyToClipboard to avoid loading any additional dependency.
 
In xs_is_clipboard_js template you need to be calling for new ClipboardJS(<selector>) to avoid:

from being thrown.

Also, maybe bundle clipboard.js in the add-on build? Or better yet use something like XF.CopyToClipboard to avoid loading any additional dependency.
Yes indeed I will change that in the next update thank you!
 
Last edited:
hello,

No, currently there is no such possibility,
I could create a system that allows your users to buy a token and this token would allow them to generate an invitation code.

Regards, CRUEL-MODZ
 
Top Bottom