From 2ce4468aa535aec10d8497936f49228e183200e2 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 6 Sep 2013 17:28:37 +1000 Subject: [PATCH] rename system_username to site_contact_username , system_user is a special user with -1 id that is only used for certain admin tasks for example system_user will autoclose stuff if needed, it will delete stubs and be the target for flag pms --- app/models/admin_dashboard_data.rb | 6 +++--- app/models/site_setting.rb | 2 +- config/locales/server.cs.yml | 4 ++-- config/locales/server.da.yml | 2 +- config/locales/server.de.yml | 4 ++-- config/locales/server.en.yml | 4 ++-- config/locales/server.es.yml | 2 +- config/locales/server.fr.yml | 2 +- config/locales/server.id.yml | 2 +- config/locales/server.it.yml | 2 +- config/locales/server.ko.yml | 2 +- config/locales/server.nl.yml | 4 ++-- config/locales/server.pseudo.yml | 4 ++-- config/locales/server.pt.yml | 2 +- config/locales/server.pt_BR.yml | 4 ++-- config/locales/server.ru.yml | 4 ++-- config/locales/server.sv.yml | 2 +- config/locales/server.zh_CN.yml | 2 +- config/locales/server.zh_TW.yml | 2 +- db/fixtures/users.rb | 15 ++++++++------- docs/INSTALL-email.md | 2 +- docs/INSTALL-ubuntu.md | 2 +- lib/discourse.rb | 10 +++++++--- lib/system_message.rb | 2 +- spec/components/discourse_spec.rb | 12 ++++++------ spec/integration/topic_auto_close_spec.rb | 2 +- spec/models/topic_spec.rb | 4 +++- 27 files changed, 56 insertions(+), 49 deletions(-) diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rb index aecec24799c..bef368261ec 100644 --- a/app/models/admin_dashboard_data.rb +++ b/app/models/admin_dashboard_data.rb @@ -37,7 +37,7 @@ class AdminDashboardData send_consumer_email_check, title_check, access_password_removal, - system_username_check, + site_contact_username_check, notification_email_check ].compact end @@ -148,8 +148,8 @@ class AdminDashboardData I18n.t('dashboard.consumer_email_warning') if Rails.env == 'production' and ActionMailer::Base.smtp_settings[:address] =~ /gmail\.com|live\.com|yahoo\.com/ end - def system_username_check - I18n.t('dashboard.system_username_warning') if SiteSetting.system_username.blank? + def site_contact_username_check + I18n.t('dashboard.site_contact_username_warning') if SiteSetting.site_contact_username.blank? end def notification_email_check diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index e7f1ae0c916..5a9f4b89f21 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -93,7 +93,7 @@ class SiteSetting < ActiveRecord::Base client_setting(:edit_history_visible_to_public, true) client_setting(:delete_removed_posts_after, 24) # hours setting(:post_undo_action_window_mins, 10) - setting(:system_username, '') + setting(:site_contact_username, '') setting(:max_mentions_per_post, 10) setting(:newuser_max_mentions_per_post, 2) diff --git a/config/locales/server.cs.yml b/config/locales/server.cs.yml index fbed23773a5..217422480bd 100644 --- a/config/locales/server.cs.yml +++ b/config/locales/server.cs.yml @@ -435,7 +435,7 @@ cs: title_nag: "Název webu je nastaven na výchozí hodnotu. Prosím, změňte název webu na skutečný název v Nastavení webu." consumer_email_warning: "Váš web je nastaven, aby používal Gmail (nebo jinou uživatelskou emailovou službu) k odesílání emailů. Gmail limituje počet emailů, které můžete odeslat. Zvažte použití jiného emailového poskytovatele, jako je třeba mandrill.com k zajištění doručitelnosti emailů." access_password_removal: "Váš web používá nastavení access_password, které je již odstraněno. Nová nastavení login_required a must_approve_users by měla být použita místo toho. Nastavení můžete změnit vNastavení webu. Nezapomeňte schválit uživatele v seznamu čekajících uživatelůt. (Tato zpráva zmizí za 2 dny.)" - system_username_warning: "Nastavení system_username je prázdné. Prosím, napravte to v Nastavení webu. Nastavte ho na uživatelské jméno administrátora, která má být odesilatelem systémových zpráv." + site_contact_username_warning: "Nastavení system_username je prázdné. Prosím, napravte to v Nastavení webu. Nastavte ho na uživatelské jméno administrátora, která má být odesilatelem systémových zpráv." notification_email_warning: "Nastavení notification_email je prázdné. Prosím, napravte to v Nastavení webu." content_types: @@ -548,7 +548,7 @@ cs: track_external_right_clicks: "Počítat kliknutí na externí odkazy pravým tlačítkem (např. otevření do nové záložky); defaultně zakázáno kvůli přepisu URL" topics_per_page: "Kolik témat je načteno do seznamu témat" posts_per_page: "Kolik příspěvků je zobrazeno ve stránce tématu" - system_username: "Uživatelské jméno, za které se zasílají automatické soukromé zprávy" + site_contact_username: "Uživatelské jméno, za které se zasílají automatické soukromé zprávy" send_welcome_message: "Mají noví uživatelé obdržet uvítací soukromou zprávu?" suppress_reply_directly_below: "Nezobrazovat počet odpovědí, pokud existuje jen jediná odpověď hned pod příspěvkem" suppress_reply_directly_above: "Nezobrazovat informaci 'je odpověď na' u příspěvku, jehož odpověď je přímo nad ním" diff --git a/config/locales/server.da.yml b/config/locales/server.da.yml index 3ef3974928d..5dfbecd0eda 100644 --- a/config/locales/server.da.yml +++ b/config/locales/server.da.yml @@ -349,7 +349,7 @@ da: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics are loaded by default on the topics list page" posts_per_page: "How many posts are returned on a topic page" - system_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum" send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)" diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index a2f903e88b3..f49286b48b8 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -404,7 +404,7 @@ de: title_nag: "Der Titel der Seite wurde noch nicht angepasst. Bitte bearbeite diesen in den Einstellungen." consumer_email_warning: "Deine Seite verwendet Gmail um Mails zu senden. Gmail hat eine Limite zum Senden von Mails. Um die Mail-Zustellung zu gewährleisten, solltest du einen anderen Mail Service in Erwägung ziehen." access_password_removal: "Deine Seite hat die Einstellung access_password verwendet, welche entfernt wurde. Die Einstellungen login_required und must_approve_users wurden eingeschalten und werden sofort verwendet. Du kannst diese in den Einstellungen wechseln. Stelle sicher, dass die Benutzer in der Warteliste aktiviert werden. (Diese Meldung wird in 2 Tagen nicht mehr angezeigt.)" - system_username_warning: "Die Einstellung system_username ist leer. Bitte ändere diese in den Einstellungen. Setzte einen Benutzernamen eines Administrators, welcher als Sender der Systemnachrichten verwendet werden soll." + site_contact_username_warning: "Die Einstellung system_username ist leer. Bitte ändere diese in den Einstellungen. Setzte einen Benutzernamen eines Administrators, welcher als Sender der Systemnachrichten verwendet werden soll." notification_email_warning: "Die Einstellung notification_email ist leer. Bitte ändere diese in den Einstellungen." content_types: @@ -521,7 +521,7 @@ de: track_external_right_clicks: "Verfolge, welche externen Links per Rechtsklick geöffnet werden (zum Beispiel in einem neuen Browser-Tab). Standardmäßig deaktiviert, da dies URL-Rewrites erfordert." topics_per_page: "Zahl der Themen, die standardmäßig auf die Themenübersichtsseite geladen werden." posts_per_page: "Zahl der Beiträge, die auf einer Themenseite gezeigt werden." - system_username: "Benutzername des Autors für automatisch vom Forum versendete private Nachrichten." + site_contact_username: "Benutzername des Autors für automatisch vom Forum versendete private Nachrichten." send_welcome_message: "Bekommen neue Nutzer eine Willkommensnachricht?" suppress_reply_directly_below: "Zeige die Zahl der Antworten auf einen Beitrag nicht, falls die einzige Antwort direkt darunter folgt." suppress_reply_directly_above: "Zeige 'In Antwort auf' nicht, falls der Beitrag direkt über der einzigen Antwort folgt." diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 0b061deb275..7f387ab3bfc 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -404,7 +404,7 @@ en: title_nag: "The title Site Setting is still set to the default value. Please update it with your site's title in the Site Settings." consumer_email_warning: "Your site is configured to use Gmail (or another consumer email service) to send email. Gmail limits how many emails you can send. Consider using an email service provider like mandrill.com to ensure email deliverability." access_password_removal: "Your site was using the access_password setting, which has been removed. The login_required and must_approve_users settings have been enabled, which should be used instead. You can change them in the Site Settings. Be sure to approve users in the Pending Users list. (This message will go away after 2 days.)" - system_username_warning: "The system_username setting is blank. Please update it in the Site Settings. Set it to the username of an admin user who should be the sender of system messages." + site_contact_username_warning: "The system_username setting is blank. Please update it in the Site Settings. Set it to the username of an admin user who should be the sender of system messages." notification_email_warning: "The notification_email setting is blank. Please update it in the Site Settings." content_types: @@ -521,7 +521,7 @@ en: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics loaded by default on the topics list page" posts_per_page: "How many posts loaded by default on a topic page, and when loading more posts" - system_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum" send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" suppress_reply_directly_above: "Don't show in-reply-to on a post when there is a single reply directly above" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index db26ed8a602..1f0b97a5acd 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -337,7 +337,7 @@ es: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "Cuantos topics son cargados por defecto en la página de lista de topics" posts_per_page: "Cuantos posts son devueltos en una página de topic" - system_username: "Nombre de usuario para el autor de mensajes privados enviados por el foro" + site_contact_username: "Nombre de usuario para el autor de mensajes privados enviados por el foro" send_welcome_message: "¿Reciben los nuevos usuarios un mensaje privado de bienvenida?" suppress_reply_directly_below: "No mostrar el contador de respuestas en un pot cuando una única respuesta directamente debajo" allow_index_in_robots_txt: "Permitir que el sitio sea indexado por motores de búsqueda (sobreescribe robots.txt)" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 188d41f946f..c6717ec3652 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -489,7 +489,7 @@ fr: track_external_right_clicks: "Suivi des clics sur les liens externes (ex: ouverture dans un nouvel onglet) désactivé par défaut car nécessite une ré-écrite de toutes les urls et nuit à l'accessibilité" topics_per_page: "Nombre de discussions à afficher sur la page de liste des discussions." posts_per_page: "Nombre de messages retournés sur une page de discussion" - system_username: "Pseudo qui envoie les messages automatiques" + site_contact_username: "Pseudo qui envoie les messages automatiques" send_welcome_message: "Les nouveaux utilisateurs reçoivent-ils un message privé de bienvenue ?" suppress_reply_directly_below: "Ne pas afficher les boutons de réponse sous un message lorsque la réponse est juste en dessous" allow_index_in_robots_txt: "Le site doit-être indexé par les moteurs de recherche (met à jour le fichier robots.txt)" diff --git a/config/locales/server.id.yml b/config/locales/server.id.yml index 6f0a013b575..398793424fe 100644 --- a/config/locales/server.id.yml +++ b/config/locales/server.id.yml @@ -348,7 +348,7 @@ id: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics are loaded by default on the topics list page" posts_per_page: "How many posts are returned on a topic page" - system_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum" send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index f49e7fc6ce1..e330a40ace4 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -470,7 +470,7 @@ it: track_external_right_clicks: "Traccia i link esterni sui quali viene fatto click destro (es: apri in una nuova tab). Disabilitato di default perché viene fatto il rewrite delle URL" topics_per_page: "Quanti topic vengono caricati di default nella pagina di lista topic" posts_per_page: "Quanti post vengono restituiti in una pagina di un topic" - system_username: "Username dell'autore dei messaggi privati automatizzati spediti dal forum" + site_contact_username: "Username dell'autore dei messaggi privati automatizzati spediti dal forum" send_welcome_message: "I nuovi utenti ricevono un messaggio di benvenuto?" suppress_reply_directly_below: "Non mostrare il numero di risposte ad un post quando c'è una singola risposta appena sotto" allow_index_in_robots_txt: "Il sito è indicizzabile dai motori di ricerta (aggiorna robots.txt)" diff --git a/config/locales/server.ko.yml b/config/locales/server.ko.yml index 84c01a16526..260d92f0dd5 100644 --- a/config/locales/server.ko.yml +++ b/config/locales/server.ko.yml @@ -470,7 +470,7 @@ ko: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics are loaded by default on the topics list page" posts_per_page: "How many posts are returned on a topic page" - system_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum" send_welcome_message: "Do new users get a welcome private message?" supress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index 61c08973a5c..c220caca6a1 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -407,7 +407,7 @@ nl: title_nag: "Je hebt nog geen title ingesteld voor je site. Geef een titel voor je site op in de Instellingen." consumer_email_warning: "Je site is ingesteld om Gmail te gebruiken voor het versturen van mails. Gmail heeft limieten voor het aantal mails dat je kan versturen. Overweeg om een andere e-mailprovider te gebruiken om er zeker van te zijn dat mails aankomen." access_password_removal: "Je site gebruikte een toegangswachtwoord (access_password) setting, maar die optie is uit Discourse verwijderd. De login_required en must_approve_users instellingen zijn er voor in de plaats gekomen. Je kan ze in de Instellingen aanpassen. Zorg er voor dat je gebruikers op de wachtlijst accepteert. (Dit bericht verdwijnt na twee dagen.)" - system_username_warning: "De instelling system_username is leeg. Werk deze bij in de Instellingen. Stel het in op de gebruikersnaam van een admin die als afzender van de systeemberichten zal worden wordt gebruikt." + site_contact_username_warning: "De instelling system_username is leeg. Werk deze bij in de Instellingen. Stel het in op de gebruikersnaam van een admin die als afzender van de systeemberichten zal worden wordt gebruikt." notification_email_warning: "De instelling notification_email is leeg. Werk deze bij in de Instellingen." content_types: @@ -522,7 +522,7 @@ nl: track_external_right_clicks: "Houd bij welke externe links met de rechtermuisknop worden aangeklikt (bijv: open in nieuwe tab). Dit staat standaard uit, gezien het de URLs moet herschrijven, waardoor het gebruiksgemak afneemt" topics_per_page: "Hoeveel topics er standaard worden weergegeven in de topiclijst." posts_per_page: "Hoeveel berichten er worden weergeven op een topic-pagina" - system_username: "Vanuit welke gebruikersnaam systeemberichten worden verstuurd" + site_contact_username: "Vanuit welke gebruikersnaam systeemberichten worden verstuurd" send_welcome_message: "Krijgen nieuwe leden een welkomst-privé-bericht?" suppress_reply_directly_below: "Laat geen reactieteller zien bij een bericht als er maar één reactie onder staat" suppress_reply_directly_above: "Laat geen 'in antwoord op' zien bij een bericht als er maar één reactie boven staat" diff --git a/config/locales/server.pseudo.yml b/config/locales/server.pseudo.yml index 1ea7cf4785e..5c3b91450ae 100644 --- a/config/locales/server.pseudo.yml +++ b/config/locales/server.pseudo.yml @@ -465,7 +465,7 @@ pseudo: ƀééɳ éɳáƀłéď, ŵĥíčĥ šĥóůłď ƀé ůšéď íɳšťéáď. Ýóů čáɳ čĥáɳǧé ťĥéɱ íɳ ťĥé <á ĥřéƒ=''/áďɱíɳ/šíťé_šéťťíɳǧš''>Šíťé Šéťťíɳǧš. Ɓé šůřé ťó <á ĥřéƒ=''/áďɱíɳ/ůšéřš/łíšť/ƿéɳďíɳǧ''>áƿƿřóνé ůšéřš íɳ ťĥé Рéɳďíɳǧ Ůšéřš łíšť. (Ťĥíš ɱéššáǧé ŵíłł ǧó áŵáý áƒťéř 2 ďáýš.) ]]' - system_username_warning: '[[ Ťĥé šýšťéɱ_ůšéřɳáɱé šéťťíɳǧ íš ƀłáɳǩ. Рłéášé ůƿďáťé + site_contact_username_warning: '[[ Ťĥé šýšťéɱ_ůšéřɳáɱé šéťťíɳǧ íš ƀłáɳǩ. Рłéášé ůƿďáťé íť íɳ ťĥé <á ĥřéƒ=''/áďɱíɳ/šíťé_šéťťíɳǧš''>Šíťé Šéťťíɳǧš. Šéť íť ťó ťĥé ůšéřɳáɱé óƒ áɳ áďɱíɳ ůšéř ŵĥó šĥóůłď ƀé ťĥé šéɳďéř óƒ šýšťéɱ ɱéššáǧéš. ]]' notification_email_warning: '[[ Ťĥé ɳóťíƒíčáťíóɳ_éɱáíł šéťťíɳǧ íš ƀłáɳǩ. Рłéášé @@ -631,7 +631,7 @@ pseudo: topics_per_page: '[[ Ĥóŵ ɱáɳý ťóƿíčš ářé łóáďéď ƀý ďéƒáůłť óɳ ťĥé ťóƿíčš łíšť ƿáǧé ]]' posts_per_page: '[[ Ĥóŵ ɱáɳý ƿóšťš ářé řéťůřɳéď óɳ á ťóƿíč ƿáǧé ]]' - system_username: '[[ Ůšéřɳáɱé ƒóř ťĥé áůťĥóř óƒ áůťóɱáťéď ƿříνáťé ɱéššáǧéš šéɳť + site_contact_username: '[[ Ůšéřɳáɱé ƒóř ťĥé áůťĥóř óƒ áůťóɱáťéď ƿříνáťé ɱéššáǧéš šéɳť ƀý ťĥé ƒóřůɱ ]]' send_welcome_message: '[[ Ďó ɳéŵ ůšéřš ǧéť á ŵéłčóɱé ƿříνáťé ɱéššáǧé? ]]' suppress_reply_directly_below: '[[ Ďóɳ''ť šĥóŵ řéƿłý čóůɳť óɳ á ƿóšť ŵĥéɳ ťĥéřé diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index 38847340628..9267a851c10 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -290,7 +290,7 @@ pt: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default cause it has to re-write urls, hurting usability" topics_per_page: "How many topics to show on the topics list page." posts_per_page: "How many posts are returned on a topic page" - system_username: "Username that sends system messages" + site_contact_username: "Username that sends system messages" send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show replies button below a post when the reply is directly below" allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)" diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index ec6af0c00cb..22aa310e97f 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -370,7 +370,7 @@ pt_BR: title_nag: "A configuração do título nas Configurações do Site ainda estão no valor padrão. Por favor atualize com título do seu site em Configurações do Site." consumer_email_warning: "Seu site está configurado para usar Gmail (ou outro serviço de email para pessoas). Gmail limita a quantidade de emails que você pode enviar. Considere o uso de um serviço de envio de emails como mandrill.com para assegurar a entregabilidade dos emails enviados." access_password_removal: "Seu site estava usando a definição access_password, que foi removida. As definições login_required e must_approve_users foram ativadas e devem ser usadas em substituição. Você pode alterá-las em Configurações do Site. Certifique-se de aprovar os usuários na lista de Usuários Pendentes. (Esta mensagem desaparecerá depois de 2 dias.)" - system_username_warning: "A definição system_username está em branco. Por favor atualize-a nas Configurações do Site. Coloque um nome de usuário de um usuário administrador o qual será o remetente das mensagens do sistema." + site_contact_username_warning: "A definição system_username está em branco. Por favor atualize-a nas Configurações do Site. Coloque um nome de usuário de um usuário administrador o qual será o remetente das mensagens do sistema." notification_email_warning: "A definição notification_email está em branco. Por favor atualize-a nas Configurações do Site." content_types: education_new_reply: @@ -473,7 +473,7 @@ pt_BR: track_external_right_clicks: "Rastrear cliques externos que são clicados com o botão direito (ex: abrir em nova aba) desativado por padrão, pois tem que reescrever urls, quebrando a usabilidade" topics_per_page: "Quantos tópicos exibir na página de listagem dos tópicos." posts_per_page: "Quantas postagens são requisitados numa página de tópico" - system_username: "Nome do Usuário que envia as mensagens do sistema" + site_contact_username: "Nome do Usuário que envia as mensagens do sistema" send_welcome_message: "Novos usuários recebem mensagem particular de boas-vindas?" suppress_reply_directly_below: "Não exibir contagem do número de respostas na postagem quando houver apenas uma resposta diretamente abaixo" suppress_reply_directly_above: "Não exibir \"em resposta a\" numa postagem quando houver apenas uma resposta diretamente a seguir" diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index b014bc2d71c..bb400339d53 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -467,7 +467,7 @@ ru: title_nag: "Заголовок Настроек сайта до сих пор установлен на значение по умолчанию. Обновите его в соответствии с названием вашего сайта здесь: Настройки сайта" consumer_email_warning: "Сайт настроен на использование Gmail (или другого почтового сервиса) для отправки сообщений. Gmail имеет ограничения на количество отправляемых сообщений. Вы можете рассмотреть возможность использования альтернативного поставщика услуг (например, mandrill.com) для обеспечения бесперебойности доставки почтовых сообщений." access_password_removal: "Ваш сайт использовал настройку access_password setting, которая была удалена. Были активированы настройки login_required и must_approve_users settings, которые должны были использоваться. Вы можете изменить их в Site Settings. Не забудьте подтвердить пользователей в листе ожидания. (Это сообщение исчезнет через 2 суток.)" - system_username_warning: "Опция system_username не установлена. Пожалуйста, обновите ее на странице Настройки сайта. Установите ее в значение имени пользователя или администратора от имени которого будут отсылаться системные сообщения пользователям." + site_contact_username_warning: "Опция system_username не установлена. Пожалуйста, обновите ее на странице Настройки сайта. Установите ее в значение имени пользователя или администратора от имени которого будут отсылаться системные сообщения пользователям." notification_email_warning: "Опция notification_email не установлена. Пожалуйста обновите ее на странице Настройки сайта." content_types: education_new_reply: @@ -576,7 +576,7 @@ ru: track_external_right_clicks: 'Отслеживать внешние ссылки, открытые правой кнопкой мыши (например: открыть в новой вкладке), по умолчанию отключено, так как это перезаписывает пути' topics_per_page: Количество тем, по умолчанию подгружаемых на странице «Список тем» posts_per_page: Количество сообщений, по умолчанию подгружаемых на странице темы и при ее пролистывании - system_username: Никнейм автора автоматических личных сообщений, рассылаемых форумом + site_contact_username: Никнейм автора автоматических личных сообщений, рассылаемых форумом send_welcome_message: Будут ли новые пользователи получать приветственное личное сообщение? suppress_reply_directly_below: Не показывать количество ответов на сообщение, если есть всего лишь один ответ непосредственно ниже suppress_reply_directly_above: Не показывать "в ответ на" для сообщений, когда существует ответ непосредственно над текущим diff --git a/config/locales/server.sv.yml b/config/locales/server.sv.yml index 5e74f96fecb..8c30170a8c3 100644 --- a/config/locales/server.sv.yml +++ b/config/locales/server.sv.yml @@ -392,7 +392,7 @@ sv: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics are loaded by default on the topics list page" posts_per_page: "How many posts are returned on a topic page" - system_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum" send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)" diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index b444632436d..ffc3e8c2e04 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -487,7 +487,7 @@ zh_CN: track_external_right_clicks: "追踪外部链接的右键点击(例如:在浏览器新标签打开),缺省是禁用的,因为它会重写URL" topics_per_page: "在主题列表页面,缺省载入多少个主题" posts_per_page: "在主题页面,返回多少个帖子" - system_username: "论坛给用户发送自动私信时使用的用户名" + site_contact_username: "论坛给用户发送自动私信时使用的用户名" send_welcome_message: "给新用户发送欢迎私信?" suppress_reply_directly_below: "当一个帖子只有一个回复时,不显示帖子回复数量" allow_index_in_robots_txt: "允许搜索引擎索引站点内容(更新 robots.txt)" diff --git a/config/locales/server.zh_TW.yml b/config/locales/server.zh_TW.yml index a576d248e63..5ee9994d7a2 100644 --- a/config/locales/server.zh_TW.yml +++ b/config/locales/server.zh_TW.yml @@ -470,7 +470,7 @@ zh_TW: track_external_right_clicks: "追蹤外部鏈接的右鍵點擊(例如:在浏覽器新標簽打開),缺省是禁用的,因爲它會重寫URL" topics_per_page: "在主題列表頁面,缺省載入多少個主題" posts_per_page: "在主題頁面,返回多少個帖子" - system_username: "論壇給用戶發送自動私信時使用的用戶名" + site_contact_username: "論壇給用戶發送自動私信時使用的用戶名" send_welcome_message: "給新用戶發送歡迎私信?" suppress_reply_directly_below: "當一個帖子只有一個回複時,不顯示帖子回複數量" allow_index_in_robots_txt: "允許搜索引擎索引站點內容(更新 robots.txt)" diff --git a/db/fixtures/users.rb b/db/fixtures/users.rb index 75c5472f3fe..2c36a5f2103 100644 --- a/db/fixtures/users.rb +++ b/db/fixtures/users.rb @@ -1,17 +1,18 @@ -user = User.where("id <> -1 and username_lower = 'community'").first +user = User.where("id <> -1 and username_lower = 'system'").first if user - user.username = UserNameSuggester.suggest('community') + user.username = UserNameSuggester.suggest("system") user.save end User.seed do |u| u.id = -1 - u.name = 'Community' - u.username = 'community' - u.username_lower = 'community' - u.email = 'no_email' + u.name = "system" + u.username = "system" + u.username_lower = "system" + u.email = "no_email" u.password = SecureRandom.hex - u.bio_raw = 'I am a community user, I clean up the forum and make sure it runs well.' + # TODO localize this, its going to require a series of hacks + u.bio_raw = "Not a real person. A global user for system notifications and other system tasks." u.active = true u.admin = true u.moderator = true diff --git a/docs/INSTALL-email.md b/docs/INSTALL-email.md index f2ffeae4686..6deb34d24b2 100644 --- a/docs/INSTALL-email.md +++ b/docs/INSTALL-email.md @@ -128,7 +128,7 @@ Login to Discourse, go to the Admin page and select 'Settings'. Filter with the string 'system'. -* Ensure that `system_username` is set to an email address for an appropriate "owner" of the forum +* Ensure that `site_contact_username` is set to an email address for an appropriate "owner" of the forum * Set `notification_email` to 'noreply@', 'nobody@' as appropriate. Filter with the string 'contact_email' diff --git a/docs/INSTALL-ubuntu.md b/docs/INSTALL-ubuntu.md index 79dcc140ffa..647ffe38f9d 100644 --- a/docs/INSTALL-ubuntu.md +++ b/docs/INSTALL-ubuntu.md @@ -286,7 +286,7 @@ and create an account by logging in normally, then run the commands: # Mark yourself as the 'system user': # (in rails console) - > SiteSetting.system_username = me.username + > SiteSetting.site_contact_username = me.username At this point we recommend you start going through the various items in the [Discourse Admin Quick Start Guide](https://github.com/discourse/discourse/wiki/The-Discourse-Admin-Quick-Start-Guide) diff --git a/lib/discourse.rb b/lib/discourse.rb index e7c01539dec..acb5bb90d5d 100644 --- a/lib/discourse.rb +++ b/lib/discourse.rb @@ -128,12 +128,16 @@ module Discourse end end - # Either returns the system_username user or the first admin. - def self.system_user - user = User.where(username_lower: SiteSetting.system_username).first if SiteSetting.system_username.present? + # Either returns the site_contact_username user or the first admin. + def self.site_contact_user + user = User.where(username_lower: SiteSetting.site_contact_username).first if SiteSetting.site_contact_username.present? user ||= User.admins.real.order(:id).first end + def self.system_user + User.where(id: -1).first + end + def self.store if SiteSetting.enable_s3_uploads? @s3_store_loaded ||= require 'file_store/s3_store' diff --git a/lib/system_message.rb b/lib/system_message.rb index 40e19d3d10c..29d52b52095 100644 --- a/lib/system_message.rb +++ b/lib/system_message.rb @@ -28,7 +28,7 @@ class SystemMessage title = I18n.t("system_messages.#{type}.subject_template", params) raw_body = I18n.t("system_messages.#{type}.text_body_template", params) - PostCreator.create(Discourse.system_user, + PostCreator.create(Discourse.site_contact_user, raw: raw_body, title: title, archetype: Archetype.private_message, diff --git a/spec/components/discourse_spec.rb b/spec/components/discourse_spec.rb index f9a50e69581..a5a50e0198f 100644 --- a/spec/components/discourse_spec.rb +++ b/spec/components/discourse_spec.rb @@ -47,19 +47,19 @@ describe Discourse do end end - context '#system_user' do + context '#site_contact_user' do let!(:admin) { Fabricate(:admin) } let!(:another_admin) { Fabricate(:admin) } - it 'returns the user specified by the site setting system_username' do - SiteSetting.stubs(:system_username).returns(another_admin.username) - Discourse.system_user.should == another_admin + it 'returns the user specified by the site setting site_contact_username' do + SiteSetting.stubs(:site_contact_username).returns(another_admin.username) + Discourse.site_contact_user.should == another_admin end it 'returns the first admin user otherwise' do - SiteSetting.stubs(:system_username).returns(nil) - Discourse.system_user.should == admin + SiteSetting.stubs(:site_contact_username).returns(nil) + Discourse.site_contact_user.should == admin end end diff --git a/spec/integration/topic_auto_close_spec.rb b/spec/integration/topic_auto_close_spec.rb index 18432bd5c3f..7ad05d921c2 100644 --- a/spec/integration/topic_auto_close_spec.rb +++ b/spec/integration/topic_auto_close_spec.rb @@ -69,7 +69,7 @@ describe Topic do end context 'topic was created by a non-staff user' do - Given!(:system_user) { Fabricate(:admin) } + Given!(:system_user) { Discourse.system_user } Given { Discourse.stubs(:system_user).returns(system_user) } Given(:regular_user) { Fabricate(:user) } Given(:regular_user_topic) { Fabricate(:topic, user: regular_user, category: category) } diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index e4c84ccd181..556e2113ec0 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -1000,7 +1000,9 @@ describe Topic do it "ignores the category's default auto-close" do Timecop.freeze(Time.zone.now) do - topic = Fabricate(:topic, category: Fabricate(:category, auto_close_days: 14)) + mod = Fabricate(:moderator) + # NOTE, only moderators can auto-close, if missing system user is used + topic = Fabricate(:topic, category: Fabricate(:category, auto_close_days: 14), user: mod) Jobs.expects(:enqueue_at).with(12.hours.from_now, :close_topic, has_entries(topic_id: topic.id, user_id: topic.user_id)) topic.auto_close_at = 12.hours.from_now topic.save.should be_true