Skip to content

Commit

Permalink
Adds support for eZ Find configurations using eZ Find's basicAuth
Browse files Browse the repository at this point in the history
authentication setup
  • Loading branch information
benkmugo committed Jan 24, 2019
1 parent f7ab221 commit c5dad94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/ezfind/index.php
Expand Up @@ -354,6 +354,22 @@ private function getSolrBaseURL()
{
$ini = eZINI::instance( 'solr.ini' );
$url = $ini->variable( 'SolrBase', 'SearchServerURI' );

$authentication = $ini->variable( 'SolrBase', 'SearchServerAuthentication' );
$userPass = $ini->variable( 'SolrBase', 'SearchServerUserPass' );

if( $authentication === 'enabled' )
{
if( $userPass )
{
$url = str_replace( '://', '://' . $userPass . '@', $url );
}
else
{
echo "SearchServerAuthentication is enabled, but SearchServerUserPass is not set\n";
}
}

if( "/" != substr( $url, strlen($url)-1 ) )
{
$url .= "/";
Expand Down

0 comments on commit c5dad94

Please sign in to comment.