Fix redirect to let users login if try to view a non-public group rathe rthan rediect to the public group immmediately, a=chris

Chris Pollett [2020-08-10 00:Aug:th]
Fix redirect to let users login if try to view a non-public group rathe rthan rediect to the public group immmediately, a=chris
Filename
src/controllers/components/SocialComponent.php
src/locale/ar/configure.ini
src/locale/bn/configure.ini
src/locale/de/configure.ini
src/locale/en_US/configure.ini
src/locale/es/configure.ini
src/locale/fa/configure.ini
src/locale/fr_FR/configure.ini
src/locale/he/configure.ini
src/locale/hi/configure.ini
src/locale/id/configure.ini
src/locale/it/configure.ini
src/locale/ja/configure.ini
src/locale/kn/configure.ini
src/locale/ko/configure.ini
src/locale/nl/configure.ini
src/locale/pl/configure.ini
src/locale/pt/configure.ini
src/locale/ru/configure.ini
src/locale/te/configure.ini
src/locale/th/configure.ini
src/locale/tl/configure.ini
src/locale/tr/configure.ini
src/locale/vi_VN/configure.ini
src/locale/zh_CN/configure.ini
src/locale/zh_CN/statistics.txt
diff --git a/src/controllers/components/SocialComponent.php b/src/controllers/components/SocialComponent.php
index 2446494e4..2db84adee 100644
--- a/src/controllers/components/SocialComponent.php
+++ b/src/controllers/components/SocialComponent.php
@@ -1825,6 +1825,11 @@ class SocialComponent extends Component implements CrawlConstants
         if ($just_group_id) {
             $group = $group_model->getGroupById($just_group_id, $user_id);
             if (!$group) {
+                if ($user_id == C\PUBLIC_USER_ID) {
+                    $_REQUEST = ['c' => "admin", 'a' => '', C\CSRF_TOKEN => ''];
+                    return $parent->redirectWithMessage(
+                        tl("social_component_login_first"));
+                }
                 unset($_REQUEST['route']);
                 $_REQUEST['just_group_id'] = C\PUBLIC_GROUP_ID;
                 return $parent->redirectWithMessage(
@@ -2531,6 +2536,11 @@ class SocialComponent extends Component implements CrawlConstants
         $group = $group_model->getGroupById($group_id, $user_id);
         if (!$group || !isset($group["OWNER_ID"])) {
             if ($data['MODE'] !== 'api') {
+                if ($user_id == C\PUBLIC_USER_ID) {
+                    $_REQUEST = ['c' => "admin", 'a' => '', C\CSRF_TOKEN => ''];
+                    return $parent->redirectWithMessage(
+                        tl("social_component_login_first"));
+                }
                 unset($_REQUEST["route"]);
                 $_REQUEST['group_id'] = C\PUBLIC_GROUP_ID;
                 return $parent->redirectWithMessage(
diff --git a/src/locale/ar/configure.ini b/src/locale/ar/configure.ini
index 1c726f1af..025497736 100755
--- a/src/locale/ar/configure.ini
+++ b/src/locale/ar/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "موضوع خلق!"
 social_component_post_edited_elsewhere = "بعد تحريرها فقط في مكان آخر (علامة تبويب أخرى?)"
 social_component_no_update_access = "لا يمكن تحديث آخر!"
 social_component_post_updated = "آخر تحديث!"
+social_component_login_first = "الرجاء تسجيل الدخول للوصول إلى المزيد من الجماعات!"
 social_component_no_group_access = "ليس عضوا أو أن't قراءة تلك المجموعة. التحول إلى مجموعة عامة!"
 social_component_name_asc = "اسم&أمبير ؛ uarr;"
 social_component_name_desc = "اسم&أمبير ؛ الدر;"
diff --git a/src/locale/bn/configure.ini b/src/locale/bn/configure.ini
index 5cf07729f..0cd45e118 100755
--- a/src/locale/bn/configure.ini
+++ b/src/locale/bn/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "থ্রেড নির্মিত!"
 social_component_post_edited_elsewhere = "পোস্ট ছিল মাত্র সম্পাদিত অন্যত্র (অন্য ট্যাব?)"
 social_component_no_update_access = "না আপডেট পোস্ট!"
 social_component_post_updated = "পোস্ট আপডেট করা হয়েছে!"
+social_component_login_first = "দয়া করে লগইন অ্যাক্সেস করতে একাধিক গ্রুপ!"
 social_component_no_group_access = "সদস্য না, বা করতে পারেন,'t পড়তে যে গ্রুপ. সুইচিং পাবলিক গ্রুপ!"
 social_component_name_asc = "নাম↑"
 social_component_name_desc = "নাম↓"
diff --git a/src/locale/de/configure.ini b/src/locale/de/configure.ini
index d4ec1d735..a4ef39617 100755
--- a/src/locale/de/configure.ini
+++ b/src/locale/de/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Erstellt!"
 social_component_post_edited_elsewhere = "Beitrag wurde gerade bearbeitet an anderer Stelle (einem anderen tab?)"
 social_component_no_update_access = "Kann Nicht Update-Post!"
 social_component_post_updated = "Post Aktualisiert!"
+social_component_login_first = "Bitte loggen Sie sich ein, um Zugriff auf weitere Gruppen!"
 social_component_no_group_access = "Nicht Mitglied ist oder werden kann't gelesen, dass Gruppe. Den Umstieg auf den öffentlichen Gruppe!"
 social_component_name_asc = "Namen↑"
 social_component_name_desc = "Namen↓"
diff --git a/src/locale/en_US/configure.ini b/src/locale/en_US/configure.ini
index 2a78f76ed..6ebcd0242 100644
--- a/src/locale/en_US/configure.ini
+++ b/src/locale/en_US/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Created!"
 social_component_post_edited_elsewhere = "Post was just edited elsewhere (another tab?)"
 social_component_no_update_access = "Cannot Update Post!"
 social_component_post_updated = "Post Updated!"
+social_component_login_first = "Please login to access more groups!"
 social_component_no_group_access = "Not a member or can't read that group. Switching to public group!"
 social_component_name_asc = "Name↑"
 social_component_name_desc = "Name↓"
diff --git a/src/locale/es/configure.ini b/src/locale/es/configure.ini
index ef0e5c104..3025ea50c 100755
--- a/src/locale/es/configure.ini
+++ b/src/locale/es/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Hilo Creado!"
 social_component_post_edited_elsewhere = "Post se acaba de editar en otro lugar (otra pestaña?)"
 social_component_no_update_access = "No Puede Actualizar El Post!!!"
 social_component_post_updated = "Post Actualizado!"
+social_component_login_first = "Por favor, inicie sesión para acceder a más grupos!"
 social_component_no_group_access = "No es miembro, o puede't leer ese grupo. El cambio a grupo público!"
 social_component_name_asc = "Nombre↑"
 social_component_name_desc = "Nombre&: darr;"
diff --git a/src/locale/fa/configure.ini b/src/locale/fa/configure.ini
index a4cff7c73..83100e67a 100755
--- a/src/locale/fa/configure.ini
+++ b/src/locale/fa/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "موضوع ایجاد شده!"
 social_component_post_edited_elsewhere = "ارسال شد فقط ویرایش در جای دیگر (برگه دیگری?)"
 social_component_no_update_access = "نمی تواند به روز رسانی پست!"
 social_component_post_updated = "پست به روز شد!"
+social_component_login_first = "لطفا برای دسترسی بیشتر گروه!"
 social_component_no_group_access = "نه یک عضو و یا می't خواندن آن گروه. تعویض به سکس!"
 social_component_name_asc = "نام↑"
 social_component_name_desc = "نام↓"
diff --git a/src/locale/fr_FR/configure.ini b/src/locale/fr_FR/configure.ini
index fe0680a6b..ade826d5f 100755
--- a/src/locale/fr_FR/configure.ini
+++ b/src/locale/fr_FR/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Fil a créé!"
 social_component_post_edited_elsewhere = "Post a été publié ailleurs (sur un autre onglet?)"
 social_component_no_update_access = "Impossible me mettre à jour le post!"
 social_component_post_updated = "Post mis à jour!"
+social_component_login_first = "Veuillez vous connecter pour accéder à plusieurs groupes!"
 social_component_no_group_access = "Pas un membre ou peut't lu que groupe. De commutation de groupe public!"
 social_component_name_asc = "Nom↑"
 social_component_name_desc = "Nom↓"
diff --git a/src/locale/he/configure.ini b/src/locale/he/configure.ini
index 208dee0c0..6b5eec615 100755
--- a/src/locale/he/configure.ini
+++ b/src/locale/he/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "חוט נוצר!"
 social_component_post_edited_elsewhere = "הפוסט היה רק לערוך במקום אחר (הכרטיסיה אחר?)"
 social_component_no_update_access = "אין אפשרות לעדכן את הפוסט!"
 social_component_post_updated = "פוסט מתעדכן!"
+social_component_login_first = "נא להתחבר כדי לגשת יותר קבוצות!"
 social_component_no_group_access = "לא חבר או יכול'לא קראתי את הקבוצה הזאת. מיתוג ציבורי קבוצה!"
 social_component_name_asc = "השם↑"
 social_component_name_desc = "השם&דארר;"
diff --git a/src/locale/hi/configure.ini b/src/locale/hi/configure.ini
index 5dbc63a63..2dbd9cff7 100755
--- a/src/locale/hi/configure.ini
+++ b/src/locale/hi/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "धागा बनाया!"
 social_component_post_edited_elsewhere = "पोस्ट सिर्फ संपादित कहीं और (एक टैब?)"
 social_component_no_update_access = "अद्यतन नहीं कर सकता पोस्ट!"
 social_component_post_updated = "पोस्ट अद्यतन!"
+social_component_login_first = "कृपया लॉगिन का उपयोग करने के लिए और अधिक समूहों!"
 social_component_no_group_access = "नहीं एक सदस्य या कर सकते हैं'टी पढ़ें । स्विच करने के लिए समूह!"
 social_component_name_asc = "नाम↑"
 social_component_name_desc = "नाम&डर;"
diff --git a/src/locale/id/configure.ini b/src/locale/id/configure.ini
index db27d9ac9..2c9c58526 100755
--- a/src/locale/id/configure.ini
+++ b/src/locale/id/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Dibuat!"
 social_component_post_edited_elsewhere = "Posting itu hanya diedit di tempat lain (tab lain?)"
 social_component_no_update_access = "Tidak Bisa Update Post!"
 social_component_post_updated = "Posting Diperbarui!"
+social_component_login_first = "Silahkan login untuk mengakses lebih kelompok!"
 social_component_no_group_access = "Bukan anggota atau dapat't baca bahwa kelompok. Beralih ke grup publik!"
 social_component_name_asc = "Nama↑"
 social_component_name_desc = "Nama↓"
diff --git a/src/locale/it/configure.ini b/src/locale/it/configure.ini
index 8c466633e..2afb48891 100755
--- a/src/locale/it/configure.ini
+++ b/src/locale/it/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Creato!"
 social_component_post_edited_elsewhere = "Il Post è stato editato altrove (un'altra scheda?)"
 social_component_no_update_access = "Impossibile Aggiornare Il Post!"
 social_component_post_updated = "Post Aggiornato!"
+social_component_login_first = "Effettua il login per accedere a più gruppi!"
 social_component_no_group_access = "Non un membro o di un possibile't di lettura che di gruppo. Di commutazione per gruppo pubblico!"
 social_component_name_asc = "Nome↑"
 social_component_name_desc = "Nome↓"
diff --git a/src/locale/ja/configure.ini b/src/locale/ja/configure.ini
index b89dd0cc4..6206345ee 100755
--- a/src/locale/ja/configure.ini
+++ b/src/locale/ja/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "スレッドプしてみました。"
 social_component_post_edited_elsewhere = "後で編集し他の場所で別のタブ?)"
 social_component_no_update_access = "な更新。"
 social_component_post_updated = "ポストの商品が紹介されました。"
+social_component_login_first = "ログインして行ってください。アクセス以上のグループ!"
 social_component_no_group_access = "会員以外の方です't読していただきました。 切り替えるパブリックグループ!"
 social_component_name_asc = "名↑"
 social_component_name_desc = "名↓"
diff --git a/src/locale/kn/configure.ini b/src/locale/kn/configure.ini
index 6eaab0762..b879ab3b4 100755
--- a/src/locale/kn/configure.ini
+++ b/src/locale/kn/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "ಥ್ರೆಡ್ ದಾಖಲಿಸಿದ
 social_component_post_edited_elsewhere = "ಪೋಸ್ಟ್ ಕೇವಲ ಸಂಪಾದನೆ ಬೇರೆಡೆ (ಮತ್ತೊಂದು ಟ್ಯಾಬ್?)"
 social_component_no_update_access = "ಸಾಧ್ಯವಿಲ್ಲ ಅಪ್ಡೇಟ್ ಪೋಸ್ಟ್!"
 social_component_post_updated = "ಪೋಸ್ಟ್ ಅಪ್ಡೇಟ್ಗೊಳಿಸಲಾಗಿದೆ!"
+social_component_login_first = "ದಯವಿಟ್ಟು ಲಾಗಿನ್ ಪ್ರವೇಶಿಸಲು ಹೆಚ್ಚು ಗುಂಪುಗಳು!"
 social_component_no_group_access = "ಸದಸ್ಯ ಅಲ್ಲ ಅಥವಾ ಮಾಡಬಹುದು'ಟಿ ಓದಲು ಎಂದು ಗುಂಪು. ಸ್ವಿಚಿಂಗ್ ಸಾರ್ವಜನಿಕ ಗುಂಪು!"
 social_component_name_asc = "ಹೆಸರು↑"
 social_component_name_desc = "ಹೆಸರು&ಡರ್;"
diff --git a/src/locale/ko/configure.ini b/src/locale/ko/configure.ini
index add99c55f..691a86b0c 100755
--- a/src/locale/ko/configure.ini
+++ b/src/locale/ko/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "실을 만들었습니다!"
 social_component_post_edited_elsewhere = "게시 그냥 편집 다른 곳에서(다른 탭?)"
 social_component_no_update_access = "업데이트할 수 없습니다."
 social_component_post_updated = "게시 업데이트!"
+social_component_login_first = "로그인하십시오 액세스 그룹!"
 social_component_no_group_access = "회원 또는't 읽는 그룹이다. 스위칭을 공공 그룹!"
 social_component_name_asc = "이름↑"
 social_component_name_desc = "이름↓"
diff --git a/src/locale/nl/configure.ini b/src/locale/nl/configure.ini
index cd9b50bb4..55f84a7a8 100644
--- a/src/locale/nl/configure.ini
+++ b/src/locale/nl/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Draad Gemaakt!"
 social_component_post_edited_elsewhere = "Bericht was gewoon elders bewerkt (een ander tabblad?)"
 social_component_no_update_access = "Kan niet bijwerken Post!"
 social_component_post_updated = "Bericht Bijgewerkt!"
+social_component_login_first = "Gelieve in te loggen om toegang te krijgen tot meer groepen!"
 social_component_no_group_access = "Geen lid is of kan die groep niet lezen. Overschakelen op openbare groep!"
 social_component_name_asc = "Naam↑"
 social_component_name_desc = "Naam↓"
diff --git a/src/locale/pl/configure.ini b/src/locale/pl/configure.ini
index 28159d562..003893bb6 100755
--- a/src/locale/pl/configure.ini
+++ b/src/locale/pl/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Temat Stworzył!"
 social_component_post_edited_elsewhere = "Post był edytowany w innym miejscu i innej karcie?)"
 social_component_no_update_access = "Nie Mogę Zaktualizować Post!"
 social_component_post_updated = "Post Zaktualizowany!"
+social_component_login_first = "Zaloguj się, aby uzyskać dostęp do większej liczby Grup!"
 social_component_no_group_access = "Nie jest członkiem lub można't czytać tę grupę. Przejście do publicznej grupie!"
 social_component_name_asc = "Nazwa↑"
 social_component_name_desc = "Nazwa&dar;"
diff --git a/src/locale/pt/configure.ini b/src/locale/pt/configure.ini
index c14fd7cbe..edd4a18a9 100755
--- a/src/locale/pt/configure.ini
+++ b/src/locale/pt/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Criada!"
 social_component_post_edited_elsewhere = "O Post foi editado apenas em outro lugar (outra aba?)"
 social_component_no_update_access = "Não É Possível Atualizar O Post!"
 social_component_post_updated = "Post Atualizado!"
+social_component_login_first = "Por favor faça login para aceder a mais grupos!"
 social_component_no_group_access = "Não é um membro ou pode't ler esse grupo. Alternar para o grupo público!"
 social_component_name_asc = "Nome↑"
 social_component_name_desc = "Nome↓"
diff --git a/src/locale/ru/configure.ini b/src/locale/ru/configure.ini
index 9dde57143..a664f4608 100755
--- a/src/locale/ru/configure.ini
+++ b/src/locale/ru/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Тему Создал!"
 social_component_post_edited_elsewhere = "Пост был просто отредактирован в другом месте (другой вкладке?)"
 social_component_no_update_access = "Не Могу Обновить Пост!"
 social_component_post_updated = "Пост Обновлен!"
+social_component_login_first = "Пожалуйста, войдите, чтобы получить доступ к более Групп!"
 social_component_no_group_access = "Не является членом или можете't читать эту группу. Переход к публичной группе!"
 social_component_name_asc = "Имя↑"
 social_component_name_desc = "Имя&дар;"
diff --git a/src/locale/te/configure.ini b/src/locale/te/configure.ini
index dbedd109a..0ce733067 100644
--- a/src/locale/te/configure.ini
+++ b/src/locale/te/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "థ్రెడ్ సృష్టించ
 social_component_post_edited_elsewhere = "పోస్ట్ వేరే చోట ఇప్పుడే సవరించారు (వేరే టేబ్?)"
 social_component_no_update_access = "పోస్ట్ ని అప్డేట్ చేయలేరు!"
 social_component_post_updated = "పోస్ట్ అప్డేట్ చేయబడినది!"
+social_component_login_first = "Please login to access మరింత సమూహాలు!"
 social_component_no_group_access = "సభ్యుడు కాదు లేదా ఆ గ్రూప్ ని చదవలేరు.పబ్లిక్ గ్రూప్ కి మార్చండి!"
 social_component_name_asc = "పేరు↑"
 social_component_name_desc = "పేరు&డర్ర్;"
diff --git a/src/locale/th/configure.ini b/src/locale/th/configure.ini
index 060ffb040..fe2a5b1d3 100755
--- a/src/locale/th/configure.ini
+++ b/src/locale/th/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "เธรดสร้างขึ้น!"
 social_component_post_edited_elsewhere = "โพสแค่ได้แก้ไขไปที่อื่นกัน(อีกเหรอ?)"
 social_component_no_update_access = "ไม่สามารถปรับปรุงโพสต์!"
 social_component_post_updated = "โพสอัพเดท!"
+social_component_login_first = "ได้โปรดล็อกอินเพื่อเข้าใช้งานมากกว่ากลุ่มข่าว!"
 social_component_no_group_access = "ไม่เป็นสมาชิกหรือสามารถ'ทีอ่านกลุ่มนั้น เปลี่ยนกลับสาธารณะชนกลุ่ม!"
 social_component_name_asc = "ชื่อของ↑"
 social_component_name_desc = "ชื่อของ↓"
diff --git a/src/locale/tl/configure.ini b/src/locale/tl/configure.ini
index c786982b0..c34e734d2 100644
--- a/src/locale/tl/configure.ini
+++ b/src/locale/tl/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Thread Nilikha!"
 social_component_post_edited_elsewhere = "Post na ito ay lamang na-edit sa ibang lugar (isa pang tab?)"
 social_component_no_update_access = "Hindi Maaaring I-Update Ang Post Na Ito!"
 social_component_post_updated = "Mag-Post Ng Update!"
+social_component_login_first = "Mangyaring mag-login upang ma-access ang higit pang mga pangkat!"
 social_component_no_group_access = "Hindi isang miyembro o maaari't basahin ang mga pangkat na iyon. Paglipat sa pampublikong grupo!"
 social_component_name_asc = "Pangalan↑"
 social_component_name_desc = "Pangalan↓"
diff --git a/src/locale/tr/configure.ini b/src/locale/tr/configure.ini
index 373468605..a75db11d0 100755
--- a/src/locale/tr/configure.ini
+++ b/src/locale/tr/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "İş Parçacığı Yarattı!"
 social_component_post_edited_elsewhere = "Yazı sadece (başka bir sekme)başka bir yerde düzenlendi."
 social_component_no_update_access = "Güncelleme Sonrası Olamaz!"
 social_component_post_updated = "Güncelleme Sonrası!"
+social_component_login_first = "[1]) ([2] Daha fazla gruplara erişim için lütfen giriş yapın "
 social_component_no_group_access = "Üye değil ya't grup okuyun. Genel grup için geçiş!"
 social_component_name_asc = "Adı↑"
 social_component_name_desc = "Adı↓"
diff --git a/src/locale/vi_VN/configure.ini b/src/locale/vi_VN/configure.ini
index 1f2c3e20d..0c23db65a 100755
--- a/src/locale/vi_VN/configure.ini
+++ b/src/locale/vi_VN/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "Chủ Đề Tạo Ra!"
 social_component_post_edited_elsewhere = "Bài vừa sửa ở nơi khác (khác, tab?)"
 social_component_no_update_access = "Không Thể Viết Bài!"
 social_component_post_updated = "Gửi Cập Nhật!"
+social_component_login_first = "Xin vui lòng nhập để truy cập nhiều nhóm!"
 social_component_no_group_access = "Không phải là một thành viên hoặc có thể' \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
 social_component_name_asc = "Tên và uarr;"
 social_component_name_desc = "Tên và darr;"
diff --git a/src/locale/zh_CN/configure.ini b/src/locale/zh_CN/configure.ini
index 1aa6dfa5e..0b96123d9 100755
--- a/src/locale/zh_CN/configure.ini
+++ b/src/locale/zh_CN/configure.ini
@@ -237,6 +237,7 @@ social_component_thread_created = "线创建了!"
 social_component_post_edited_elsewhere = "后只是编辑的其他地方(另一种标签?)"
 social_component_no_update_access = "无法更新后!"
 social_component_post_updated = "布更新后的!"
+social_component_login_first = "请登录访问多个团体!"
 social_component_no_group_access = "没有一个成员或者可以't读组。 切换到公共组!"
 social_component_name_asc = "姓名和amp;uarr;"
 social_component_name_desc = "姓名和amp;darr;"
diff --git a/src/locale/zh_CN/statistics.txt b/src/locale/zh_CN/statistics.txt
index 5a165df53..b6bef56f0 100755
--- a/src/locale/zh_CN/statistics.txt
+++ b/src/locale/zh_CN/statistics.txt
@@ -1 +1 @@
-d:100;
\ No newline at end of file
+d:99;
\ No newline at end of file
ViewGit