use Friendica\Module\BaseSettings;
use Friendica\Module\Security\Login;
use Friendica\Protocol\Email;
-use Friendica\Util\Strings;
use Friendica\Util\Temporal;
use Friendica\Worker\Delivery;
}
}
- $username = (!empty($_POST['username']) ? Strings::escapeTags(trim($_POST['username'])) : '');
- $email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : '');
- $timezone = (!empty($_POST['timezone']) ? Strings::escapeTags(trim($_POST['timezone'])) : '');
- $language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : '');
+ $username = (!empty($_POST['username']) ? trim($_POST['username']) : '');
+ $email = (!empty($_POST['email']) ? trim($_POST['email']) : '');
+ $timezone = (!empty($_POST['timezone']) ? trim($_POST['timezone']) : '');
+ $language = (!empty($_POST['language']) ? trim($_POST['language']) : '');
- $defloc = (!empty($_POST['defloc']) ? Strings::escapeTags(trim($_POST['defloc'])) : '');
- $maxreq = (!empty($_POST['maxreq']) ? intval($_POST['maxreq']) : 0);
- $expire = (!empty($_POST['expire']) ? intval($_POST['expire']) : 0);
+ $defloc = (!empty($_POST['defloc']) ? trim($_POST['defloc']) : '');
+ $maxreq = (!empty($_POST['maxreq']) ? intval($_POST['maxreq']) : 0);
+ $expire = (!empty($_POST['expire']) ? intval($_POST['expire']) : 0);
$def_gid = (!empty($_POST['group-selection']) ? intval($_POST['group-selection']) : 0);
if ($email != $user['email']) {
// check for the correct password
- if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
+ try {
+ User::getIdFromPasswordAuthentication(local_user(), $_POST['mpassword']);
+ } catch (Exception $ex) {
$err .= DI::l10n()->t('Wrong Password.');
$email = $user['email'];
}
}
if (($timezone != $user['timezone']) && strlen($timezone)) {
- date_default_timezone_set($timezone);
+ $a->setTimeZone($timezone);
}
$aclFormatter = DI::aclFormatter();
$settings_connectors = '';
Hook::callAll('connector_settings', $settings_connectors);
- if (is_site_admin()) {
+ if ($a->isSiteAdmin()) {
$diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
$ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
} else {
$expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
if (!strlen($user['timezone'])) {
- $timezone = date_default_timezone_get();
+ $timezone = $a->getTimeZone();
}
// Set the account type to "Community" when the page is a community page but the account type doesn't fit