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
This commit is contained in:
Sam 2013-09-06 17:28:37 +10:00
parent 41a1b6942d
commit 2ce4468aa5
27 changed files with 56 additions and 49 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 <a href='/admin/site_settings'>Nastavení webu</a>."
consumer_email_warning: "Váš web je nastaven, aby používal Gmail (nebo jinou uživatelskou emailovou službu) k odesílání emailů. <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>Gmail limituje počet emailů, které můžete odeslat</a>. 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 v<a href='/admin/site_settings'>Nastavení webu</a>. Nezapomeňte <a href='/admin/users/list/pending'>schválit uživatele v seznamu čekajících uživatelůt</a>. (Tato zpráva zmizí za 2 dny.)"
system_username_warning: "Nastavení system_username je prázdné. Prosím, napravte to v <a href='/admin/site_settings'>Nastavení webu</a>. 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 <a href='/admin/site_settings'>Nastavení webu</a>. 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 <a href='/admin/site_settings'>Nastavení webu</a>."
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"

View File

@ -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)"

View File

@ -404,7 +404,7 @@ de:
title_nag: "Der Titel der Seite wurde noch nicht angepasst. Bitte bearbeite diesen in den <a href='/admin/site_settings'>Einstellungen</a>."
consumer_email_warning: "Deine Seite verwendet Gmail um Mails zu senden. <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>Gmail hat eine Limite zum Senden von Mails</a>. 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 <a href='/admin/site_settings'>den Einstellungen</a> wechseln. Stelle sicher, <a href='/admin/users/list/pending'>dass die Benutzer in der Warteliste</a> aktiviert werden. (Diese Meldung wird in 2 Tagen nicht mehr angezeigt.)"
system_username_warning: "Die Einstellung system_username ist leer. Bitte ändere diese in <a href='/admin/site_settings'>den Einstellungen</a>. 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 <a href='/admin/site_settings'>den Einstellungen</a>. 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 <a href='/admin/site_settings'>den Einstellungen</a>."
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."

View File

@ -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 <a href='/admin/site_settings'>Site Settings</a>."
consumer_email_warning: "Your site is configured to use Gmail (or another consumer email service) to send email. <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>Gmail limits how many emails you can send</a>. 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 <a href='/admin/site_settings'>Site Settings</a>. Be sure to <a href='/admin/users/list/pending'>approve users in the Pending Users list</a>. (This message will go away after 2 days.)"
system_username_warning: "The system_username setting is blank. Please update it in the <a href='/admin/site_settings'>Site Settings</a>. 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 <a href='/admin/site_settings'>Site Settings</a>. 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 <a href='/admin/site_settings'>Site Settings</a>."
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"

View File

@ -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)"

View File

@ -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)"

View File

@ -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)"

View File

@ -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)"

View File

@ -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)"

View File

@ -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 <a href='/admin/site_settings'>Instellingen</a>."
consumer_email_warning: "Je site is ingesteld om Gmail te gebruiken voor het versturen van mails. <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>Gmail heeft limieten voor het aantal mails dat je kan versturen</a>. 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 <a href='/admin/site_settings'>de Instellingen</a> aanpassen. Zorg er voor dat je <a href='/admin/users/list/pending'>gebruikers op de wachtlijst accepteert</a>. (Dit bericht verdwijnt na twee dagen.)"
system_username_warning: "De instelling system_username is leeg. Werk deze bij in <a href='/admin/site_settings'>de Instellingen</a>. 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 <a href='/admin/site_settings'>de Instellingen</a>. 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 <a href='/admin/site_settings'>de Instellingen</a>."
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"

View File

@ -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: '[[ Ďóɳ''ť šĥóŵ řéƿłý čóůɳť óɳ á ƿóšť ŵĥéɳ ťĥéřé

View File

@ -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)"

View File

@ -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 <a href='/admin/site_settings'>Configurações do Site</a>."
consumer_email_warning: "Seu site está configurado para usar Gmail (ou outro serviço de email para pessoas). <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>Gmail limita a quantidade de emails que você pode enviar</a>. 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 <a href='/admin/site_settings'>Configurações do Site</a>. Certifique-se de <a href='/admin/users/list/pending'>aprovar os usuários na lista de Usuários Pendentes</a>. (Esta mensagem desaparecerá depois de 2 dias.)"
system_username_warning: "A definição system_username está em branco. Por favor atualize-a nas <a href='/admin/site_settings'>Configurações do Site</a>. 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 <a href='/admin/site_settings'>Configurações do Site</a>. 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 <a href='/admin/site_settings'>Configurações do Site</a>."
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"

View File

@ -467,7 +467,7 @@ ru:
title_nag: "Заголовок Настроек сайта до сих пор установлен на значение по умолчанию. Обновите его в соответствии с названием вашего сайта здесь: <a href='/admin/site_settings'>Настройки сайта</a>"
consumer_email_warning: "Сайт настроен на использование Gmail (или другого почтового сервиса) для отправки сообщений. Gmail <a href='http://support.google.com/a/bin/answer.py?hl=en&answer=166852' target='_blank'>имеет ограничения</a> на количество отправляемых сообщений. Вы можете рассмотреть возможность использования альтернативного поставщика услуг (например, mandrill.com) для обеспечения бесперебойности доставки почтовых сообщений."
access_password_removal: "Ваш сайт использовал настройку access_password setting, которая была удалена. Были активированы настройки login_required и must_approve_users settings, которые должны были использоваться. Вы можете изменить их в <a href='/admin/site_settings'>Site Settings</a>. Не забудьте <a href='/admin/users/list/pending'>подтвердить пользователей в листе ожидания</a>. (Это сообщение исчезнет через 2 суток.)"
system_username_warning: "Опция system_username не установлена. Пожалуйста, обновите ее на странице <a href='/admin/site_settings'>Настройки сайта</a>. Установите ее в значение имени пользователя или администратора от имени которого будут отсылаться системные сообщения пользователям."
site_contact_username_warning: "Опция system_username не установлена. Пожалуйста, обновите ее на странице <a href='/admin/site_settings'>Настройки сайта</a>. Установите ее в значение имени пользователя или администратора от имени которого будут отсылаться системные сообщения пользователям."
notification_email_warning: "Опция notification_email не установлена. Пожалуйста обновите ее на странице <a href='/admin/site_settings'>Настройки сайта</a>."
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: Не показывать "в ответ на" для сообщений, когда существует ответ непосредственно над текущим

View File

@ -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)"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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'

View File

@ -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)

View File

@ -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'

View File

@ -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,

View File

@ -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

View File

@ -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) }

View File

@ -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