]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Fixed wrong contact permisssion
[friendica.git] / mod / settings.php
index 8b896676622cf61116e83b81c194be3d5737a4e5..79bf16d78ccb6f428d8d202c8ce1bbe201139eac 100644 (file)
@@ -27,7 +27,6 @@ use Friendica\Core\ACL;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
-use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -252,6 +251,8 @@ function settings_post(App $a)
                                unlink($_FILES['importcontact-filename']['tmp_name']);
                        }
                }
+
+               return;
        }
 
        if (!empty($_POST['resend_relocate'])) {
@@ -318,6 +319,7 @@ function settings_post(App $a)
        $hide_friends     = (($_POST['hide-friends'] == 1) ? 1: 0);
        $hidewall         = (($_POST['hidewall'] == 1) ? 1: 0);
        $unlisted         = (($_POST['unlisted'] == 1) ? 1: 0);
+       $accessiblephotos = (($_POST['accessible-photos'] == 1) ? 1: 0);
 
        $email_textonly   = (($_POST['email_textonly'] == 1) ? 1 : 0);
        $detailed_notif   = (($_POST['detailed_notif'] == 1) ? 1 : 0);
@@ -364,17 +366,17 @@ function settings_post(App $a)
 
        if ($username != $a->user['username']) {
                if (strlen($username) > 40) {
-                       $err .= DI::l10n()->t(' Please use a shorter name.');
+                       $err .= DI::l10n()->t('Please use a shorter name.');
                }
                if (strlen($username) < 3) {
-                       $err .= DI::l10n()->t(' Name too short.');
+                       $err .= DI::l10n()->t('Name too short.');
                }
        }
 
        if ($email != $a->user['email']) {
                //  check for the correct password
                if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
-                       $err .= DI::l10n()->t('Wrong Password') . EOL;
+                       $err .= DI::l10n()->t('Wrong Password.');
                        $email = $a->user['email'];
                }
                //  check the email is valid
@@ -392,7 +394,7 @@ function settings_post(App $a)
        }
 
        if (strlen($err)) {
-               notice($err . EOL);
+               notice($err);
                return;
        }
 
@@ -416,6 +418,7 @@ function settings_post(App $a)
        DI::pConfig()->set(local_user(), 'system', 'email_textonly', $email_textonly);
        DI::pConfig()->set(local_user(), 'system', 'detailed_notif', $detailed_notif);
        DI::pConfig()->set(local_user(), 'system', 'unlisted', $unlisted);
+       DI::pConfig()->set(local_user(), 'system', 'accessible-photos', $accessiblephotos);
 
        if ($page_flags == User::PAGE_FLAGS_PRVGROUP) {
                $hidewall = 1;
@@ -599,7 +602,7 @@ function settings_content(App $a)
                        $arr[$fname] = [];
                        $arr[$fname][0] = $fdata[0];
                        foreach (array_slice($fdata,1) as $f) {
-                               $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[DI::l10n()->t('Off'), DI::l10n()->t('On')]];
+                               $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(local_user(), $f[0]), $f[2]];
                        }
                }
 
@@ -839,7 +842,11 @@ function settings_content(App $a)
        ]);
 
        $unlisted = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['unlisted', DI::l10n()->t('Should public posts be unlisted?'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community page or in search results, nor will they be transported to relay servers.')],
+               '$field' => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')],
+       ]);
+
+       $accessiblephotos = Renderer::replaceMacros($opt_tpl, [
+               '$field' => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(local_user(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")],
        ]);
 
        $blockwall = Renderer::replaceMacros($opt_tpl, [
@@ -956,6 +963,7 @@ function settings_content(App $a)
                '$hide_friends' => $hide_friends,
                '$hide_wall' => $hide_wall,
                '$unlisted' => $unlisted,
+               '$accessiblephotos' => $accessiblephotos,
                '$unkmail' => $unkmail,
                '$cntunkmail'   => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")],