Merge pull request #277 from muelli/user

User.php: This seems to fix bug 91

Former-commit-id: 6b92fac7bf
This commit is contained in:
Net Gusto 2014-11-26 10:52:13 +01:00
commit 942f59edd8

View file

@ -87,7 +87,11 @@ class User extends \Flake\Core\Model\Db {
$sRes = parent::get($sPropName);
} catch(\Exception $e) {
# no, it may belong to the oIdentityPrincipal model object
$sRes = $this->oIdentityPrincipal->get($sPropName);
if ($this->oIdentityPrincipal) {
$sRes = $this->oIdentityPrincipal->get($sPropName);
} else {
$sRes = "";
}
}
return $sRes;
@ -113,7 +117,9 @@ class User extends \Flake\Core\Model\Db {
parent::set($sPropName, $sPropValue);
} catch(\Exception $e) {
# no, it may belong to the oIdentityPrincipal model object
$this->oIdentityPrincipal->set($sPropName, $sPropValue);
if ($this->oIdentityPrincipal) {
$this->oIdentityPrincipal->set($sPropName, $sPropValue);
}
}
return $this;
@ -277,4 +283,4 @@ class User extends \Flake\Core\Model\Db {
public function getPasswordHashForPassword($sPassword) {
return md5($this->get("username") . ':' . BAIKAL_AUTH_REALM . ':' . $sPassword);
}
}
}