/** Tries to resolve committer as a GBUser */ function committerUser() { $user = $this->committerEmail ? GBUser::find($this->committerEmail) : null; if ($user === null) { return $default; } }
static function authenticate($force = true, $context = 'gb-admin') { $auth = self::authenticator($context); self::$authorized = null; if ($authed = $auth->authenticate()) { self::$authorized = GBUser::find($authed); return self::$authorized; } elseif ($force) { $url = gb_admin::$url . 'helpers/authorize.php?referrer=' . urlencode(self::url()); header('HTTP/1.1 303 See Other'); header('Location: ' . $url); exit('<html><body>See Other <a href="' . $url . '"></a></body></html>'); } return $authed; }