1
1
Fork 0

Delete mod/settings.php and its reference

This commit is contained in:
Hypolite Petovan 2022-11-04 23:59:55 -04:00
parent 5916544bc8
commit e6ada08e1b
2 changed files with 3 additions and 108 deletions

View file

@ -1,105 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
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;
}
}

View file

@ -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)]];