use Friendica\Protocol\Email;
use Friendica\Util\Network;
use Friendica\Util\Temporal;
+use Friendica\Module\Login;
function get_theme_config_file($theme)
{
],
];
+ $tabs[] = [
+ 'label' => L10n::t('Profiles'),
+ 'url' => 'profiles',
+ 'selected' => (($a->argc == 1) && ($a->argv[0] === 'profiles')?'active':''),
+ 'accesskey' => 'p',
+ ];
+
if (Feature::get()) {
$tabs[] = [
'label' => L10n::t('Additional features'),
}
// Adjust the page flag if the account type doesn't fit to the page flag.
- if (($account_type == ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
- $page_flags = PAGE_NORMAL;
- } elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [PAGE_SOAPBOX])) {
- $page_flags = PAGE_SOAPBOX;
- } elseif (($account_type == ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [PAGE_SOAPBOX])) {
- $page_flags = PAGE_SOAPBOX;
- } elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
- $page_flags = PAGE_COMMUNITY;
+ if (($account_type == Contact::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [Contact::PAGE_NORMAL, Contact::PAGE_SOAPBOX, Contact::PAGE_FREELOVE])) {
+ $page_flags = Contact::PAGE_NORMAL;
+ } elseif (($account_type == Contact::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [Contact::PAGE_SOAPBOX])) {
+ $page_flags = Contact::PAGE_SOAPBOX;
+ } elseif (($account_type == Contact::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [Contact::PAGE_SOAPBOX])) {
+ $page_flags = Contact::PAGE_SOAPBOX;
+ } elseif (($account_type == Contact::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP])) {
+ $page_flags = Contact::PAGE_COMMUNITY;
}
$email_changed = false;
date_default_timezone_set($timezone);
}
- $str_group_allow = perms2str(defaults($_POST, 'group_allow' , ''));
- $str_contact_allow = perms2str(defaults($_POST, 'contact_allow', ''));
- $str_group_deny = perms2str(defaults($_POST, 'group_deny' , ''));
- $str_contact_deny = perms2str(defaults($_POST, 'contact_deny' , ''));
+ $str_group_allow = !empty($_POST['group_allow']) ? perms2str($_POST['group_allow']) : '';
+ $str_contact_allow = !empty($_POST['contact_allow']) ? perms2str($_POST['contact_allow']) : '';
+ $str_group_deny = !empty($_POST['group_deny']) ? perms2str($_POST['group_deny']) : '';
+ $str_contact_deny = !empty($_POST['contact_deny']) ? perms2str($_POST['contact_deny']) : '';
$openidserver = $a->user['openidserver'];
//$openid = normalise_openid($openid);
if ($openid != $a->user['openid'] || (strlen($openid) && (!strlen($openidserver)))) {
if (Network::isUrlValid($openid)) {
logger('updating openidserver');
- $open_id_obj = new LightOpenID($a->get_hostname());
+ $open_id_obj = new LightOpenID($a->getHostName());
$open_id_obj->identity = $openid;
$openidserver = $open_id_obj->discover($open_id_obj->identity);
} else {
PConfig::set(local_user(), 'system', 'email_textonly', $email_textonly);
PConfig::set(local_user(), 'system', 'detailed_notif', $detailed_notif);
- if ($page_flags == PAGE_PRVGROUP) {
+ if ($page_flags == Contact::PAGE_PRVGROUP) {
$hidewall = 1;
if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
if ($def_gid) {
if (!local_user()) {
//notice(L10n::t('Permission denied.') . EOL);
- return;
+ return Login::form();
}
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
'$theme_config' => $theme_config,
]);
- $tpl = get_markup_template('settings/display_end.tpl');
- $a->page['end'] .= replace_macros($tpl, [
- '$theme' => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes]
- ]);
-
return $o;
}
// Set the account type to "Community" when the page is a community page but the account type doesn't fit
// This is only happening on the first visit after the update
- if (in_array($a->user['page-flags'], [PAGE_COMMUNITY, PAGE_PRVGROUP]) &&
- ($a->user['account-type'] != ACCOUNT_TYPE_COMMUNITY))
- $a->user['account-type'] = ACCOUNT_TYPE_COMMUNITY;
+ if (in_array($a->user['page-flags'], [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP]) &&
+ ($a->user['account-type'] != Contact::ACCOUNT_TYPE_COMMUNITY))
+ $a->user['account-type'] = Contact::ACCOUNT_TYPE_COMMUNITY;
$pageset_tpl = get_markup_template('settings/pagetypes.tpl');
'$user' => L10n::t("Personal Page Subtypes"),
'$community' => L10n::t("Community Forum Subtypes"),
'$account_type' => $a->user['account-type'],
- '$type_person' => ACCOUNT_TYPE_PERSON,
- '$type_organisation' => ACCOUNT_TYPE_ORGANISATION,
- '$type_news' => ACCOUNT_TYPE_NEWS,
- '$type_community' => ACCOUNT_TYPE_COMMUNITY,
+ '$type_person' => Contact::ACCOUNT_TYPE_PERSON,
+ '$type_organisation' => Contact::ACCOUNT_TYPE_ORGANISATION,
+ '$type_news' => Contact::ACCOUNT_TYPE_NEWS,
+ '$type_community' => Contact::ACCOUNT_TYPE_COMMUNITY,
- '$account_person' => ['account-type', L10n::t('Personal Page'), ACCOUNT_TYPE_PERSON,
+ '$account_person' => ['account-type', L10n::t('Personal Page'), Contact::ACCOUNT_TYPE_PERSON,
L10n::t('Account for a personal profile.'),
- ($a->user['account-type'] == ACCOUNT_TYPE_PERSON)],
+ ($a->user['account-type'] == Contact::ACCOUNT_TYPE_PERSON)],
- '$account_organisation' => ['account-type', L10n::t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
+ '$account_organisation' => ['account-type', L10n::t('Organisation Page'), Contact::ACCOUNT_TYPE_ORGANISATION,
L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
- ($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)],
+ ($a->user['account-type'] == Contact::ACCOUNT_TYPE_ORGANISATION)],
- '$account_news' => ['account-type', L10n::t('News Page'), ACCOUNT_TYPE_NEWS,
+ '$account_news' => ['account-type', L10n::t('News Page'), Contact::ACCOUNT_TYPE_NEWS,
L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
- ($a->user['account-type'] == ACCOUNT_TYPE_NEWS)],
+ ($a->user['account-type'] == Contact::ACCOUNT_TYPE_NEWS)],
- '$account_community' => ['account-type', L10n::t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
+ '$account_community' => ['account-type', L10n::t('Community Forum'), Contact::ACCOUNT_TYPE_COMMUNITY,
L10n::t('Account for community discussions.'),
- ($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)],
+ ($a->user['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY)],
- '$page_normal' => ['page-flags', L10n::t('Normal Account Page'), PAGE_NORMAL,
+ '$page_normal' => ['page-flags', L10n::t('Normal Account Page'), Contact::PAGE_NORMAL,
L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
- ($a->user['page-flags'] == PAGE_NORMAL)],
+ ($a->user['page-flags'] == Contact::PAGE_NORMAL)],
- '$page_soapbox' => ['page-flags', L10n::t('Soapbox Page'), PAGE_SOAPBOX,
+ '$page_soapbox' => ['page-flags', L10n::t('Soapbox Page'), Contact::PAGE_SOAPBOX,
L10n::t('Account for a public profile that automatically approves contact requests as "Followers".'),
- ($a->user['page-flags'] == PAGE_SOAPBOX)],
+ ($a->user['page-flags'] == Contact::PAGE_SOAPBOX)],
- '$page_community' => ['page-flags', L10n::t('Public Forum'), PAGE_COMMUNITY,
+ '$page_community' => ['page-flags', L10n::t('Public Forum'), Contact::PAGE_COMMUNITY,
L10n::t('Automatically approves all contact requests.'),
- ($a->user['page-flags'] == PAGE_COMMUNITY)],
+ ($a->user['page-flags'] == Contact::PAGE_COMMUNITY)],
- '$page_freelove' => ['page-flags', L10n::t('Automatic Friend Page'), PAGE_FREELOVE,
+ '$page_freelove' => ['page-flags', L10n::t('Automatic Friend Page'), Contact::PAGE_FREELOVE,
L10n::t('Account for a popular profile that automatically approves contact requests as "Friends".'),
- ($a->user['page-flags'] == PAGE_FREELOVE)],
+ ($a->user['page-flags'] == Contact::PAGE_FREELOVE)],
- '$page_prvgroup' => ['page-flags', L10n::t('Private Forum [Experimental]'), PAGE_PRVGROUP,
+ '$page_prvgroup' => ['page-flags', L10n::t('Private Forum [Experimental]'), Contact::PAGE_PRVGROUP,
L10n::t('Requires manual approval of contact requests.'),
- ($a->user['page-flags'] == PAGE_PRVGROUP)],
+ ($a->user['page-flags'] == Contact::PAGE_PRVGROUP)],
]);
$tpl_addr = get_markup_template('settings/nick_set.tpl');
$prof_addr = replace_macros($tpl_addr,[
- '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
- '$basepath' => $a->get_hostname()
+ '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLpath(), System::baseUrl() . '/profile/' . $nickname),
+ '$basepath' => $a->getHostName()
]);
$stpl = get_markup_template('settings/settings.tpl');