Comment 'LeonidS My hosting w...' to 'Dolphin Connect Bug'
  • LeonidS My hosting wanted a breakdown.  To make it easy I just paste in what she wanted to know.

    Can you break things down a bit on what is happening?  It seems to me that account IDs are being checked but when checking the database the account ID in Dolphin didn't match with UNA account.  I would think you wouldn't check on IDs though.  Let's walk through the code:

    $aRemoteProfileInfo = $aResponse;

    This is fetching an array; I would assume, from the Dolphin site of the user trying to connect using Dolphin Connect module.  Is that correct?
    if ($aRemoteProfileInfo) {

    If the array exists, continue
    // check if user logged in before
    $iLocalProfileId = $this->_oDb->getProfileId($aRemoteProfileInfo['id']);

    OK, this is an integer by the i and from the name I would think it is a UNA ID; not the Dolphin ID; is this an account ID or a Profile ID; remember in Dolphin we only had Profile IDs?  This seems confusing to me because it appears we are checking IDs and not account names to see if the account already exists.
    if ($iLocalProfileId && $oProfile = BxDolProfile::getInstance($iLocalProfileId)) {

    Exactly what are we comparing here from both the UNA side of things and the Dolphin side of things?  If they are equal, then the conclusion is that the Dolphin user already exits in the UNA site.  This must be where things are getting interesting because it set a Dolphin user that DID NOT exist in UNA as existing in UNA; therefore we are getting a false positive here.


    // user already exists
    $this->setLogged($oProfile ->id());
    }
    else {
    // register new user
    $this->_createProfile($aRemoteProfileInfo);
    }
    }
    else {
    $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
    }