+ elseif (empty($_POST) && (@$request->query['scope'] == 'email')) {
+ // Display an interstitial page for a login when we have email scope (verified email for logging in).
+ $para = $body->appendElement('p', sprintf(_('Sign in to %s using…'), $request->query['client_id'])); // XXX: put domain name from redirect URI on there instead
+ $para->setAttribute('class', 'signinwelcome');
+ $form = $body->appendForm('', 'POST', 'loginauthform');
+ $form->setAttribute('id', 'loginauthform');
+ $form->setAttribute('class', 'loginarea');
+ $form->appendInputRadio('user_email', 'uemail_'.md5($user['email']), $user['email'], $user['email'] == $user['email']);
+ $form->appendLabel('uemail_'.md5($user['email']), $user['email']);
+ $para = $form->appendElement('p');
+ $para->setAttribute('class', 'small otheremaillinks');
+ $link = $para->appendLink('#', _('Add another email address'));
+ $link->setAttribute('id', 'addanotheremail'); // Makes the JS put the right functionality onto the link.
+ $para->appendText(' ');
+ $link = $para->appendLink('#', _('This is not me'));
+ $link->setAttribute('id', 'isnotme'); // Makes the JS put the right functionality onto the link.
+ $authinput = $form->appendInputHidden('authorized', 'yes');
+ $authinput->setAttribute('id', 'isauthorized');
+ $submit = $form->appendInputSubmit(_('Sign in'));
+ $para = $form->appendElement('p');
+ $para->setAttribute('class', 'small');
+ $link = $para->appendLink('#', _('Cancel'));
+ $link->setAttribute('id', 'cancelauth'); // Makes the JS put the right functionality onto the link.
+ }