We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 1dc051a9 authored by mattl's avatar mattl

We never accept a user without a Profile

parent f46d675a
......@@ -120,16 +120,18 @@ class User extends Managed_DataObject
);
}
protected $_profile = -1;
protected $_profile = null;
/**
* @return Profile
*
* @throws UserNoProfileException if user has no profile
*/
function getProfile()
public function getProfile()
{
if (is_int($this->_profile) && $this->_profile == -1) { // invalid but distinct from null
if (!($this->_profile instanceof Profile)) {
$this->_profile = Profile::getKV('id', $this->id);
if (empty($this->_profile)) {
if (!($this->_profile instanceof Profile)) {
throw new UserNoProfileException($this);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment