From: Jonny Tischbein Date: Sun, 7 Oct 2018 14:34:08 +0000 (+0200) Subject: Save return_url before login. Add login mask to many sites if not logged in. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28456de249fe05a1edd88b9451451a22e18b27b3;p=friendica.git Save return_url before login. Add login mask to many sites if not logged in. --- diff --git a/mod/contacts.php b/mod/contacts.php index c33e9b6206..7597fd6432 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -22,6 +22,7 @@ use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Proxy as ProxyUtils; use Friendica\Core\ACL; +use Friendica\Module\Login; function contacts_init(App $a) { @@ -375,7 +376,7 @@ function contacts_content(App $a, $update = 0) if (!local_user()) { notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } if ($a->argc == 3) { diff --git a/mod/events.php b/mod/events.php index d04aac3761..e5ebf86465 100644 --- a/mod/events.php +++ b/mod/events.php @@ -17,6 +17,7 @@ use Friendica\Model\Item; use Friendica\Model\Profile; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; +use Friendica\Module\Login; require_once 'include/items.php'; @@ -193,7 +194,7 @@ function events_content(App $a) { if (!local_user()) { notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } if ($a->argc == 1) { diff --git a/mod/message.php b/mod/message.php index 13ae2f7512..bb3000736a 100644 --- a/mod/message.php +++ b/mod/message.php @@ -16,6 +16,7 @@ use Friendica\Model\Mail; use Friendica\Util\DateTimeFormat; use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Temporal; +use Friendica\Module\Login; require_once 'include/conversation.php'; @@ -97,7 +98,7 @@ function message_content(App $a) if (!local_user()) { notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } $myprofile = System::baseUrl() . '/profile/' . $a->user['nickname']; diff --git a/mod/notifications.php b/mod/notifications.php index 3934a32357..867c7260da 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -12,6 +12,7 @@ use Friendica\Core\NotificationsManager; use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\Module\Login; function notifications_post(App $a) { @@ -65,7 +66,7 @@ function notifications_content(App $a) { if (!local_user()) { notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } $page = defaults($_REQUEST, 'page', 1); diff --git a/mod/profiles.php b/mod/profiles.php index 7d0c3178cf..f41cb72af4 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -20,6 +20,7 @@ use Friendica\Model\Profile; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; +use Friendica\Module\Login; function profiles_init(App $a) { @@ -509,7 +510,7 @@ function profiles_content(App $a) { if (! local_user()) { notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } $o = ''; diff --git a/mod/settings.php b/mod/settings.php index 78fa446ce0..1e6ce1354e 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -22,6 +22,7 @@ use Friendica\Model\User; use Friendica\Protocol\Email; use Friendica\Util\Network; use Friendica\Util\Temporal; +use Friendica\Module\Login; function get_theme_config_file($theme) { @@ -658,7 +659,7 @@ function settings_content(App $a) if (!local_user()) { //notice(L10n::t('Permission denied.') . EOL); - return; + return Login::form(); } if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) { diff --git a/src/Module/Login.php b/src/Module/Login.php index ad5d5ad0b6..f1f728ae90 100644 --- a/src/Module/Login.php +++ b/src/Module/Login.php @@ -47,7 +47,10 @@ class Login extends BaseModule public static function post() { + $return_url = $_SESSION['return_url']; session_unset(); + $_SESSION['return_url'] = $return_url; + // OpenId Login if ( empty($_POST['password'])