modolabs / Kurogo-Mobile-Web

Kurogo is a PHP framework for delivering high quality, data driven customizable content to a wide range of mobile devices. Its strengths lie in the customizable system that allows you to adapt content from a variety of sources and easily present that to mobile devices from feature phones, to early generation smart phones, to modern devices and tablets
http://kurogo.org
GNU Lesser General Public License v2.1
198 stars 99 forks source link

CASAuthentication CASUser constructor getting attributes from phpCAS #69

Open achantrill opened 10 years ago

achantrill commented 10 years ago

I have found what appears to be a typo in the CASAuthentication code, in the constructor for the CASUser class. The following block (lines 301-306):

    foreach (self::$attributeMap as $property => $attribute) {
        if (phpCAS::hasAttribute($attribute)) {
            $method = 'set'.$property;
            $this->$method(phpCAS::getAttribute($property));
        }
    }

is checking to see if phpCAS has an attribute of $attribute, but then when it tries to retrieve the attribute, it uses getAttribute($property). It should instead look like this:

    foreach (self::$attributeMap as $property => $attribute) {
        if (phpCAS::hasAttribute($attribute)) {
            $method = 'set'.$property;
            $this->$method(phpCAS::getAttribute($attribute));
        }
    }

using the $attribute when using the phpCAS::getAttribute method. Otherwise, unless you have your properties exactly matching your attributes in your configuration file, you will get empty strings for all of your user properties.

Thanks!