Fork me on GitHub

pnGroups...  Bottom

  • Concerning the pnGroups module, is it possible to simply click on a hyperlink and be assigned to a public group? I'm trying to save the user a few clicks in going thru the pnGroup module to assign themselves to a group. It seems that this could be done in a single hyperlink....can it?


    Thx,
    JQ
  • Nope... The function registering the user into a group needs the unique key generated by the form. Without it, it's a no go.
    Besides, I wouldn't recommand to give people direct access too much on things...

    They should confirm that they are sure they want to be part of a group. wink
  • Thank you for the reply--in this case though, I'd only have 2 public groups and depending on which they choose would determine which block menu they would see. So, not a big deal in terms of security.

    It would be an excellent feature though in terms of user friendliness. I'm not suggesting doing away with all of the verification screens to become membership of a group, but instead offer another option for those who could benefit from making it easier to become a member of a group if they wish. Hence 2 paths to accomplish the same goal.

    I can certainly understand circumstances where you would need to make sure that was the group they wanted to become a member of. However, let's please consider the "user friendliness" of what exists today. The user would have to have some intuitive knowledge of what group they need to become a member of and go through the process of being assigned to that group. This may or may not be intuitive.

    My suggestion would be to add the ability to simply allow them to click on a link to become a member (if this is possible technically). That way you could have a screen explaining what each hyperlink would do and be much more friendly than the current process.

    Maybe the "development gods" at be could consider this to be an addition to what is there already now.

    Please understand, I'm not being critical, but am only trying to offer some insight from a usage standpoint. This kind of functionality would be fantastic IMHO.

    The current syntax of the link has all of the requirements already--it just doesn't work automagically... You have to validate and click a few more times.

    index.php?module=pnGroups&func=membership&action=subscribe&gid=4

    Adding one more parameter...

    index.php?module=pnGroups&func=membership&action=subscribe&gid=4&verify=no

    or something like that would be PERFECT!


    Possible???


    Thanks again,
    JQ
  • I won't change the mod, you'll have to hack it this way

    Find this part :

    Code

    function pnGroups_user_userupdate()
    {

        list($gid, $action, $gtype, $tag) = pnVarCleanFromInput('gid', 'action', 'gtype', 'tag');

        if (empty($gid) || !is_numeric($gid) || empty($action)) {
            return pnVarPrepHTMLDisplay(_MODARGSERROR);
        }

        if (!pnSecConfirmAuthKey()) {
            pnSessionSetVar('errormsg', _BADAUTHKEY);
            pnRedirect(pnModURL('pnGroups', 'user', 'main'));
            return true;
        }

    //........ the rest


    And put // in front of the lines :

    Code

    //    if (!pnSecConfirmAuthKey()) {
    //        pnSessionSetVar('errormsg', _BADAUTHKEY);
    //        pnRedirect(pnModURL('pnGroups', 'user', 'main'));
    //        return true;
    //    }


    You'll then be able to change your template and use a link

    Code

    <a href="<!--[pnmodurl modname='pnGroups' func='userupdate' gid=$gid action=$action]-->">sub</a>


    You might have a problem with the action param... I'm doing this from memory and I don't know if it is set yet.
  • Again Chestnut, thank you for the response.

    I found the lines in the code and commented per your illustration above. The URL was generated as:

    index.php?module=pnGroups&func=userupdate&action=subscribe&gid=3

    Error message was this:

    Quote

    _PNCG_GRPMUSTCONFIRM


    Pardon my ignorance in the PHP language, but the next statement after the commented lines is this:

    Code

    if (empty($tag)) return pnVarPrepForDisplay(_PNCG_GRPMUSTCONFIRM);


    Could $tag need to be populated with a confirmation syntax of some sort?


    Again, many thanks
    JQ
  • index.php?module=pnGroups&func=userupdate&action=subscribe&tag=1&gid=3

    wink

This list is based on users active over the last 60 minutes.