From e6ada08e1b622a9c7dee579f17d43a68829faa61 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 4 Nov 2022 23:59:55 -0400 Subject: [PATCH] Delete mod/settings.php and its reference --- mod/settings.php | 105 --------------------------------- src/Module/Security/OpenID.php | 6 +- 2 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 mod/settings.php diff --git a/mod/settings.php b/mod/settings.php deleted file mode 100644 index 619f40b3e..000000000 --- a/mod/settings.php +++ /dev/null @@ -1,105 +0,0 @@ -. - * - */ - -use Friendica\App; -use Friendica\BaseModule; -use Friendica\Content\Feature; -use Friendica\Content\Nav; -use Friendica\Core\Hook; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Item; -use Friendica\Model\User; -use Friendica\Module\BaseSettings; -use Friendica\Module\Security\Login; -use Friendica\Protocol\Email; - -function settings_init(App $a) -{ - if (!DI::userSession()->getLocalUserId()) { - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return; - } - - BaseSettings::createAside(); -} - -function settings_post(App $a) -{ - if (!$a->isLoggedIn()) { - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return; - } - - if (DI::userSession()->getSubManagedUserId()) { - return; - } - - if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'features')) { - BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features'); - foreach ($_POST as $k => $v) { - if (strpos($k, 'feature_') === 0) { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0)); - } - } - return; - } -} - -function settings_content(App $a) -{ - $o = ''; - Nav::setSelected('settings'); - - if (!DI::userSession()->getLocalUserId()) { - //DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return Login::form(); - } - - if (DI::userSession()->getSubManagedUserId()) { - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return ''; - } - - if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'features')) { - - $arr = []; - $features = Feature::get(); - foreach ($features as $fname => $fdata) { - $arr[$fname] = []; - $arr[$fname][0] = $fdata[0]; - foreach (array_slice($fdata,1) as $f) { - $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(DI::userSession()->getLocalUserId(), $f[0]), $f[2]]; - } - } - - $tpl = Renderer::getMarkupTemplate('settings/features.tpl'); - $o .= Renderer::replaceMacros($tpl, [ - '$form_security_token' => BaseModule::getFormSecurityToken("settings_features"), - '$title' => DI::l10n()->t('Additional Features'), - '$features' => $arr, - '$submit' => DI::l10n()->t('Save Settings'), - ]); - return $o; - } -} diff --git a/src/Module/Security/OpenID.php b/src/Module/Security/OpenID.php index 2675f1fec..e33fb42b7 100644 --- a/src/Module/Security/OpenID.php +++ b/src/Module/Security/OpenID.php @@ -56,9 +56,9 @@ class OpenID extends BaseModule } // NOTE: we search both for normalised and non-normalised form of $authid - // because the normalization step was removed from setting - // mod/settings.php in 8367cad so it might have left mixed - // records in the user table + // because the normalization step was removed from settings + // in commit 8367cadeeffec4b6792a502847304b17ceba5882, so it might + // have left mixed records in the user table // $condition = ['blocked' => false, 'account_expired' => false, 'account_removed' => false, 'verified' => true, 'openid' => [$authId, Strings::normaliseOpenID($authId)]];