Menu

#91 guest cannot post any comments

v1.6
open
nobody
None
5
2007-04-02
2007-04-02
no_comment
No

As guest, you are not able to comment any post. bypassperms doesn't help. The error is located in the user-info a guest has, incl. the group-info. without user-info no group-id and without group-id no permission-datas.

Discussion

  • no_comment

    no_comment - 2007-04-02
    • milestone: --> v1.6
     
  • no_comment

    no_comment - 2007-04-02

    Logged In: YES
    user_id=1457161
    Originator: YES

    using revision 26 of SVN-code

     
  • no_comment

    no_comment - 2007-05-06

    Logged In: YES
    user_id=1457161
    Originator: YES

    there is a way to fix it. the problem is, that false datas will be returned if function get_advinfo will be used for getting guests member and group infos.

    so posting as guest will be blocked by function add_post at this point:

    } else {
    if (!$this->has_perms('g_reply_other_topics')) {
    $this->sdkerror($this->lang['sdk_noperms']);
    return FALSE;
    }
    }

    obviously, the has_perms-function uses the get_advinfo-function to get the content of the g_reply_other_topics-var. but get_advinfo returns false data when guests-infos are requested.

    so you have to fix the get_advinfo-function in the IPBSDK:

    just replace

    function get_advinfo($memberid = '') {
    if (!$memberid) {
    // No UID? Return current user info
    $memberid = $this->ips->member['id'];
    }

    with

    function get_advinfo($memberid = '') {
    if (!$memberid) {
    if($this->is_loggedin()) {
    // No UID? Return current user info
    $memberid = $this->ips->member['id'];
    } else {
    // Return guest group info
    // guests group-info fix by Matthias Reuter (http://pc-intern.com | http://straightvisions.com\)
    $this->DB->query ("SELECT * FROM ibf_groups WHERE g_id='2'");
    if ($this->DB->get_num_rows()) {
    $info = $this->DB->fetch_row();
    $this->save_cache('get_advinfo', $memberid, $info);

    return $info;
    } else {
    return FALSE;
    }
    }
    }

     

Log in to post a comment.

Monday.com Logo