- $user = get_user($x);
-
- // Spec §4.1.2: if "openid.mode" is absent, whe SHOULD assume that
- // the request is not an OpenId message
- // Thus, we try to render the discovery page
- if (!array_key_exists('openid_mode', $_REQUEST)) {
- return $this->render_discovery_page($page, $user);
- }
-
- // Create a server and decode the request
- $server = init_openid_server();
- $request = $server->decodeRequest();
-
- // This request requires user interaction
- if (in_array($request->mode,
- array('checkid_immediate', 'checkid_setup'))) {
-
- // Each user has only one identity to choose from
- // So we can make automatically the identity selection
- if ($request->idSelect()) {
- $request->identity = $user->hruid();
- }
-
- // If we still don't have an identifier (used or desired), give up
- if (!$request->identity) {
- $this->render_no_identifier_page($page, $request);
+ $requested_user = User::getSilent($login);
+ $server = new OpenId();
+
+ // Spec §4.1.2: if "openid.mode" is absent, we SHOULD assume that
+ // the request is not an OpenId message.
+ if (!$server->IsOpenIdRequest()) {
+ if ($requested_user) {
+ $server->RenderDiscoveryPage($page, $requested_user);