use Friendica\Module\Login;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Security;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\ExpressionLanguage;
require_once 'boot.php';
require_once 'include/conversation.php';
require_once 'include/dba.php';
-require_once 'include/security.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
],
'$current_theme' => $a->getCurrentTheme(),
'$rules' => advancedcontentfilter_get_rules(),
- '$form_security_token' => get_form_security_token()
+ '$form_security_token' => Security::get_form_security_token()
]);
}
}
throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method'));
}
- if (!check_form_security_token()) {
+ if (!Security::check_form_security_token()) {
throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.'));
}
throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method'));
}
- if (!check_form_security_token()) {
+ if (!Security::check_form_security_token()) {
throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.'));
}
throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method'));
}
- if (!check_form_security_token()) {
+ if (!Security::check_form_security_token()) {
throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.'));
}
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBA;
+use Friendica\Util\Security;
/**
* Installs the addon hook
}
// output Gravatar settings
- $o .= '<input type="hidden" name="form_security_token" value="' .get_form_security_token("gravatarsave") .'">';
+ $o .= '<input type="hidden" name="form_security_token" value="' .Security::get_form_security_token("gravatarsave") .'">';
$o .= replace_macros( $t, [
'$submit' => L10n::t('Save Settings'),
'$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars],
* Save admin settings
*/
function gravatar_addon_admin_post (&$a) {
- check_form_security_token('gravatarsave');
+ Security::check_form_security_token('gravatarsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');
$rating = ((x($_POST, 'rating')) ? notags(trim($_POST['rating'])) : 'g');
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBA;
+use Friendica\Util\Security;
/**
* Installs the addon hook
}
// output Libravatar settings
- $o .= '<input type="hidden" name="form_security_token" value="' .get_form_security_token("libravatarsave") .'">';
+ $o .= '<input type="hidden" name="form_security_token" value="' .Security::get_form_security_token("libravatarsave") .'">';
$o .= replace_macros( $t, [
'$submit' => L10n::t('Save Settings'),
'$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found. See README'), $default_avatars],
*/
function libravatar_addon_admin_post(&$a)
{
- check_form_security_token('libravatarrsave');
+ Security::check_form_security_token('libravatarrsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');
Config::set('libravatar', 'default_avatar', $default_avatar);
use Friendica\Core\L10n;
use Friendica\Database\DBA;
use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Security;
function public_server_install()
{
function public_server_addon_admin_post(&$a)
{
- check_form_security_token_redirectOnErr('/admin/addons/publicserver', 'publicserver');
+ Security::check_form_security_token_redirectOnErr('/admin/addons/publicserver', 'publicserver');
$expiredays = (x($_POST, 'expiredays') ? notags(trim($_POST['expiredays'])) : '');
$expireposts = (x($_POST, 'expireposts') ? notags(trim($_POST['expireposts'])) : '');
$nologin = (x($_POST, 'nologin') ? notags(trim($_POST['nologin'])) : '');
function public_server_addon_admin(&$a, &$o)
{
- $token = get_form_security_token("publicserver");
+ $token = Security::get_form_security_token("publicserver");
$t = get_markup_template("admin.tpl", "addon/public_server");
$o = replace_macros($t, [
'$submit' => L10n::t('Save Settings'),
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
+use Friendica\Core\Authentication;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBA;
die('This api requires login');
}
- require_once 'include/security.php';
- authenticate_success($record);
+ Authentication::success($record);
$_SESSION["allow_api"] = true;
Addon::callHooks('logged_in', $a->user);
}