Commit 1078a720 authored by Thomas Löffler's avatar Thomas Löffler

Fixes extension upload via SOAP

parent da91779c
......@@ -1101,8 +1101,8 @@ class tx_ter_api
return $GLOBALS['TYPO3_DB']->sql_num_rows(
$GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid', 'tx_ter_extensions', 'extensionkey = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(
strtolower($extensionInfoData->extensionKey)
) . ' AND version = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extensionInfoData->version)
strtolower($extensionInfoData->extensionKey), 'tx_ter_extensions'
) . ' AND version = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extensionInfoData->version, 'tx_ter_extensions')
)
);
}
......@@ -1521,6 +1521,8 @@ class tx_ter_api
$this->helperObj->loadBackendUser(1, '_ter_', true);
$this->helperObj->loadLang();
$this->loadTceForm();
// Due to the lack of existence of this needed array we define it here to be able to write
$GLOBALS['PAGES_TYPES']['default']['allowedTables'] = '*';
}
// Check if the record already exists and get UID if not given
......
......@@ -151,7 +151,7 @@ class tx_ter_helper
// as password strings on typo3.org are not updated ones
if ($row['password'] !== $accountData->password && !$objPHPass->checkPassword(
$accountData->password, $row['password']
)
) && $this->ldapValidationSucceeded($accountData)
  • That is obviously wrong here, as we want to throw the exception, when ldap auth fails, not when it succeeds

Please register or sign in to reply
) {
throw new tx_ter_exception_unauthorized ('Wrong password.', TX_TER_ERROR_GENERAL_WRONGPASSWORD);
}
......@@ -166,6 +166,27 @@ class tx_ter_helper
return $row;
}
/**
* Check if LDAP authenticates the credentials
*
* @param stdClass $accountData
* @return bool
*/
private function ldapValidationSucceeded(stdClass $accountData): bool
{
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ig_ldap_sso_auth')) {
return false;
}
/** @var \Causal\IgLdapSsoAuth\Domain\Repository\ConfigurationRepository $configurationRepository */
$configurationRepository = GeneralUtility::makeInstance(\Causal\IgLdapSsoAuth\Domain\Repository\ConfigurationRepository::class);
$configurationRecords = $configurationRepository->findAll();
\Causal\IgLdapSsoAuth\Library\Configuration::initialize('fe', $configurationRecords[0]);
return (bool)\Causal\IgLdapSsoAuth\Library\Authentication::ldapAuthenticate($accountData->username, $accountData->password);
}
/**
* Checks for correct account data without throwing an exception.
* It just returns TRUE / FALSE
......@@ -482,10 +503,8 @@ class tx_ter_helper
}
$GLOBALS['BE_USER'] = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\FrontendBackendUserAuthentication::class);
$GLOBALS['BE_USER']->dontSetCookie = true;
$GLOBALS['BE_USER']->start();
$GLOBALS['BE_USER']->user = [
'uid' => (int)$uid,
'uid' => 0,
'username' => $username,
'admin' => (int)$isAdmin,
];
......@@ -504,7 +523,7 @@ class tx_ter_helper
return;
}
$GLOBALS['LANG'] = GeneralUtility::makeInstance('language');
$GLOBALS['LANG'] = GeneralUtility::makeInstance(\TYPO3\CMS\Lang\LanguageService::class);
$GLOBALS['LANG']->init($lang);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment