0 ) { $url .= "?" . urldecode( $_REQUEST['query'] ); } $this->getRequest()->getSession()->persist(); $_SESSION['iss'] = $_REQUEST['iss']; $GLOBALS['wgOut']->redirect( $url ); } else { $request = $this->getRequest(); $this->setHeaders(); $title = Title::newFromText( "Special:SelectOpenIDConnectIssuer" ); $urlbase = $title->getFullURL(); $urlbase .= "?uri=" . urlencode( $_REQUEST['uri'] ); $urlbase .= "&query=" . urlencode( $_REQUEST['query'] ); $urlbase .= "&iss="; $html = Html::openElement( 'div', [ 'style' => 'text-align:center' ] ); $html .= Html::openElement( 'table' ); $html .= Html::openElement( 'tr' ); $GLOBALS['wgOut']->AddHtml( $html ); foreach ( $GLOBALS['wgOpenIDConnect_Config'] as $iss => $data ) { $html = Html::openElement( 'td' ); $html .= Html::openElement( 'table', [ 'style' => 'padding:20px;' ] ); $html .= Html::openElement( 'tr' ); if ( isset( $data['icon'] ) ) { $html .= Html::openElement( 'td', [ 'style' => 'text-align:center;' ] ); $html .= Html::openElement( 'a', [ 'href' => $urlbase . $iss ] ); $html .= Html::openElement( 'img', [ 'src' => $data['icon'] ] ); $html .= Html::closeElement( 'img' ); $html .= Html::closeElement( 'a' ); $html .= Html::closeElement( 'td' ); $html .= Html::closeElement( 'tr' ); $html .= Html::openElement( 'tr' ); } $html .= Html::openElement( 'td', [ 'style' => 'text-align:center;' ] ); $html .= Html::openElement( 'a', [ 'href' => $urlbase . $iss ] ); if ( isset( $data['name'] ) ) { $html .= $data['name']; } else { $html .= $iss; } $html .= Html::closeElement( 'a' ); $html .= Html::closeElement( 'td' ); $html .= Html::closeElement( 'tr' ); $html .= Html::closeElement( 'table' ); $html .= Html::closeElement( 'td' ); $GLOBALS['wgOut']->AddHtml( $html ); } $html = Html::closeElement( 'tr' ); $html .= Html::closeElement( 'table' ); $html .= Html::closeElement( 'div' ); $GLOBALS['wgOut']->AddHtml( $html ); } } } }