Skip to content

Commit

Permalink
rename site setting to
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Feb 13, 2014
1 parent 62f9899 commit 50273ba
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Discourse.AdminBackupsIndexController = Ember.ArrayController.extend({
restoreDisabled: Em.computed.not("restoreEnabled"),

restoreEnabled: function() {
return Discourse.SiteSettings.allow_import && !this.get("status.isOperationRunning");
return Discourse.SiteSettings.allow_restore && !this.get("status.isOperationRunning");
}.property("status.isOperationRunning"),

restoreTitle: function() {
if (!Discourse.SiteSettings.allow_import) {
if (!Discourse.SiteSettings.allow_restore) {
return I18n.t("admin.backups.operations.restore.is_disabled");
} else if (this.get("status.isOperationRunning")) {
return I18n.t("admin.backups.operation_already_running");
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ cs:
github_client_id: "'Client id' pro přihlašování přes Github, registrace na https://github.com/settings/applications"
github_client_secret: "'Client secret' pro přihlašování přes Github, registrace na https://github.com/settings/applications"

allow_import: "Povolit import, kterým lze přepsat VŠECHNA data na tomto webu; nechte nastaveno na 'false', pokud neplánujete dělat importy dat"
allow_restore: "Povolit import, kterým lze přepsat VŠECHNA data na tomto webu; nechte nastaveno na 'false', pokud neplánujete dělat importy dat"

active_user_rate_limit_secs: "Jak často aktualizujeme informaci o poslední návštěvě uživatelů, v sekundách"
previous_visit_timeout_hours: "Kolik času musí uplynout v hodinách, než je návštěva uživatele považována za uplynulou"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ da:
github_client_id: "Client id til Github-login, oprettes på https://github.com/settings/applications."
github_client_secret: "Client secret til Github-login, oprettes på at https://github.com/settings/applications."

allow_import: "Tillad import, som kan erstatte ALLE sitets data; slå fra med mindre du planlægger at importere data"
allow_restore: "Tillad import, som kan erstatte ALLE sitets data; slå fra med mindre du planlægger at importere data"

active_user_rate_limit_secs: "Hvor ofte vi opdaterer feltet 'last_seen_at', i sekunder."
previous_visit_timeout_hours: "Hvor lang tid et besøg varer før vi regner det med i det 'forrige' besøg, i timer."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ de:
github_client_id: "Client-ID für Github Authentisierung, registriert auf https://github.com/settings/applications"
github_client_secret: "Client Secret für Github Authentisierung, registriert auf https://github.com/settings/applications"

allow_import: "Erlaube Datenimports. (WARNUNG: Hiermit können ALLE vorhandenen Daten überschrieben werden; immer auf 'false' lassen, es sei denn Du planst wirklich Datenimports)."
allow_restore: "Erlaube Datenimports. (WARNUNG: Hiermit können ALLE vorhandenen Daten überschrieben werden; immer auf 'false' lassen, es sei denn Du planst wirklich Datenimports)."

active_user_rate_limit_secs: "Sekunden, nach denen das 'last_seen_at'-Feld aktualisiert wird."
previous_visit_timeout_hours: "Stunden, die ein Besuch dauert bevor er als 'früherer' Besuch gezählt wird."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ en:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"

allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
allow_restore: "Allow restore, which can replace ALL site data! Leave false unless you plan to do restore a backup"

active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ es:
github_client_id: "Client id para la autenticación por Github, registrado en https://github.com/settings/applications"
github_client_secret: "Client secret para la autenticación por Github, registrado en https://github.com/settings/applications"

allow_import: "Permitir importación, la cual puede reemplazar TODOS los datos del sitio, déjalo a false hasta que planees ahcer importaciones de datos"
allow_restore: "Permitir importación, la cual puede reemplazar TODOS los datos del sitio, déjalo a false hasta que planees ahcer importaciones de datos"

active_user_rate_limit_secs: "Como de frecuentemente actualizaremos el campo 'last_seen_at', en segundos"
previous_visit_timeout_hours: "Cuanto tiempo debe pasar antes de que una visita sea considerada la 'visita previa', en horas"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ fr:
enable_github_logins: "Active l'authentification GitHub, nécessite github_client_id et github_client_secret"
github_client_id: "id client pour l'authentification Github, enregistré sur https://github.com/settings/applications"
github_client_secret: "secret client pour l'authentification Github, enregistré sur https://github.com/settings/applications"
allow_import: "Autoriser l'importation qui remplacera TOUTES les données du site. Laisser non coché, sauf si vous prévoyez d'importer des données."
allow_restore: "Autoriser la restauration qui remplacera TOUTES les données du site. Laisser non coché, sauf si vous prévoyez de restaurer un backup."
active_user_rate_limit_secs: "A quelle fréquence mettre à jour le champ 'dernier_vu_a', en secondes."
previous_visit_timeout_hours: "Combien de temps dure une visite avant de la considérer comme la visite 'précédente', en heures."
rate_limit_create_topic: "Après la création d'une discussion, les utilisateurs doivent attendre ce nombre de secondes avant de pouvoir créer une nouvelle discussion"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ id:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"

allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
allow_restore: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"

active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ it:
github_client_id: "Client id per autenticazione Github, ottenibile da https://github.com/settings/applications"
github_client_secret: "Client secret per autenticazione Github, ottenibile da https://github.com/settings/applications"

allow_import: "Abilita l'importazione, che può sostituire TUTTI i dati presenti nel sito; non modificare se non hai intenzione di importare dati"
allow_restore: "Abilita l'importazione, che può sostituire TUTTI i dati presenti nel sito; non modificare se non hai intenzione di importare dati"

active_user_rate_limit_secs: "Quanto frequentemente viene aggiornato il campo 'last_seen_at' field, in secondi"
previous_visit_timeout_hours: "Durata di una visita prima che venga considerata la visita 'precedente', in ore"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ ja:
github_client_id: "Github 認証用の client id。https://github.com/settings/applications で入手可能"
github_client_secret: "Github 認証用の client secret。https://github.com/settings/applications で入手可能"

allow_import: "インポートを有効にする。サイトの全データの上書きが可能になるため、データのインポートを予定していない場合は false にすることを推奨"
allow_restore: "インポートを有効にする。サイトの全データの上書きが可能になるため、データのインポートを予定していない場合は false にすることを推奨"

active_user_rate_limit_secs: "'last_seen_at' フィールドを更新する頻度 (秒)"
previous_visit_timeout_hours: "'previous' visit とみなす時間 (時間)"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ ko:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
allow_restore: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ nl:
github_client_id: "github_client_id (registreer op https://github.com/settings/applications)"
github_client_secret: "github_client_secret (registreer op https://github.com/settings/applications)"

allow_import: "Sta import toe, die ALLE site-data vervangt. Zet op 'false' tenzij je imports gaat doen."
allow_restore: "Sta import toe, die ALLE site-data vervangt. Zet op 'false' tenzij je imports gaat doen."

active_user_rate_limit_secs: "Hoe vaak we het 'last_seen_at'-veld updaten, in seconden."
previous_visit_timeout_hours: "Hoe lang een bezoek duurt voordat we het als het 'vorige' bezoek beschouwen, in uren."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.pseudo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ pseudo:
]]'
github_client_secret: '[[ Čłíéɳť šéčřéť ƒóř Ǧíťĥůƀ áůťĥéɳťíčáťíóɳ, řéǧíšťéřéď
áť ĥťťƿš://ǧíťĥůƀ.čóɱ/šéťťíɳǧš/áƿƿłíčáťíóɳš ]]'
allow_import: '[[ Áłłóŵ íɱƿóřť, ŵĥíčĥ čáɳ řéƿłáčé ÁŁŁ šíťé ďáťá; łéáνé ƒáłšé ůɳłéšš
allow_restore: '[[ Áłłóŵ íɱƿóřť, ŵĥíčĥ čáɳ řéƿłáčé ÁŁŁ šíťé ďáťá; łéáνé ƒáłšé ůɳłéšš
ýóů ƿłáɳ ťó ďó ďáťá íɱƿóřťš ]]'
active_user_rate_limit_secs: '[[ Ĥóŵ ƒřéƣůéɳťłý ŵé ůƿďáťé ťĥé ''łášť_šééɳ_áť''
ƒíéłď, íɳ šéčóɳďš ]]'
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pt:
facebook_app_id: "app id, registered at https://developers.facebook.com/apps (used for facebook auth)"
facebook_app_secret: "app secret, registered at https://developers.facebook.com/apps (used for facebook auth)"

allow_import: "Allow import, which will replace ALL site data. Set to false unless you plan to do imports."
allow_restore: "Allow import, which will replace ALL site data. Set to false unless you plan to do imports."

active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds."
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.pt_BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ pt_BR:
github_client_id: "Client id para autenticação via Github, registrado em https://github.com/settings/applications"
github_client_secret: "Client secret para autenticação via Github, registrado em https://github.com/settings/applications"

allow_import: "Permitir importar, vai substituir TODOS os dados do site. Deixe como falso a menos que você pretenda fazer importações."
allow_restore: "Permitir importar, vai substituir TODOS os dados do site. Deixe como falso a menos que você pretenda fazer importações."

active_user_rate_limit_secs: "Qual a frequencia de atualização do campo 'última vez visto em', em segundos."
previous_visit_timeout_hours: "Quanto tempo uma visita dura antes de considerarmos como 'última visita', em horas."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ ru:
enable_github_logins: 'Разрешить идентификацию с Github, требует github_client_id и github_client_secret'
github_client_id: 'Клиентский id для идентификации с Github, зарегистрированный на https://github.com/settings/applications'
github_client_secret: 'Клиентский секрет для идентификации с Github, зарегистрированный на https://github.com/settings/applications'
allow_import: 'Позволить импорт, который может заменить ВСЕ данные сайта. Оставьте false, если не планируете импортировать данные'
allow_restore: 'Позволить импорт, который может заменить ВСЕ данные сайта. Оставьте false, если не планируете импортировать данные'
active_user_rate_limit_secs: 'Как часто мы обновляем поле ''last_seen_at'', в секундах'
previous_visit_timeout_hours: 'Как долго должно длиться посещение сайта, чтобы мы посчитали его «предыдущим посещением», в часах'
rate_limit_create_topic: 'После создания темы пользователи должны выждать указанное количество секунд перед созданием новой темы'
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ sv:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"

allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
allow_restore: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"

active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"
previous_visit_timeout_hours: "How long a visit lasts before we consider it the 'previous' visit, in hours"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.zh_CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ zh_CN:
github_client_id: "Github 帐号验证的客户端帐号(Client id),到 https://github.com/settings/applications 来注册获取"
github_client_secret: "Github 帐号验证的客户端密码(Client secret),到 https://github.com/settings/applications 来注册获取"

allow_import: "允许导入数据,这将替换全站数据。除非你计划导入数据,否则请保持设置为false"
allow_restore: "允许导入数据,这将替换全站数据。除非你计划导入数据,否则请保持设置为false"

active_user_rate_limit_secs: "更新“最后一次见到”数据的频率,单位为秒"
previous_visit_timeout_hours: "系统判断一次访问之后多少小时后为“上一次”访问"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.zh_TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ zh_TW:
github_client_id: "Github 帳號驗證的用戶端帳號(Client id),到 https://github.com/settings/applications 來註冊獲取"
github_client_secret: "Github 帳號驗證的用戶端密碼(Client secret),到 https://github.com/settings/applications 來註冊獲取"

allow_import: "允許導入資料,這將替換全站資料。除非你計畫導入資料,否則請保持設置為false"
allow_restore: "允許導入資料,這將替換全站資料。除非你計畫導入資料,否則請保持設置為false"

active_user_rate_limit_secs: "更新“最後一次見到”資料的頻率,單位為秒"
previous_visit_timeout_hours: "系統判斷一次瀏覽之後多少小時後為“上一次”瀏覽"
Expand Down
2 changes: 1 addition & 1 deletion config/site_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ uncategorized:
summary_likes_required: 1
summary_percent_filter: 20
send_welcome_message: true
allow_import:
allow_restore:
client: true
default: false
educate_until_posts:
Expand Down
2 changes: 1 addition & 1 deletion lib/import/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run
protected

def ensure_import_is_enabled
raise Import::ImportDisabledError unless SiteSetting.allow_import?
raise Import::ImportDisabledError unless SiteSetting.allow_restore?
end

def ensure_no_operation_is_running
Expand Down
8 changes: 4 additions & 4 deletions lib/tasks/export.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task 'import', [:input_filename] => :environment do |t, args|
puts '', 'The filename argument was missing.', '', 'Usage:', ''
puts ' rake import[/path/to/export.json.gz]', ''
rescue Import::ImportDisabledError
puts '', 'Imports are not allowed.', 'An admin needs to set allow_import to true in the site settings before imports can be run.', ''
puts '', 'Imports are not allowed.', 'An admin needs to set allow_restore to true in the site settings before imports can be run.', ''
puts 'Import cancelled.', ''
end
end
Expand Down Expand Up @@ -48,12 +48,12 @@ end

desc 'Allow imports'
task 'import:enable' => :environment do |t|
SiteSetting.allow_import = true
SiteSetting.allow_restore = true
puts 'Imports are now permitted. Disable them with rake import:disable'
end

desc 'Forbid imports'
task 'import:disable' => :environment do |t|
SiteSetting.allow_import = false
SiteSetting.allow_restore = false
puts 'Imports are now forbidden.'
end
end
2 changes: 1 addition & 1 deletion script/discourse
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ WHERE table_schema='public' and (data_type like 'char%' or data_type like 'text%
puts '', 'The filename argument was missing.', ''
usage
rescue Import::ImportDisabledError
puts '', 'Imports are not allowed.', 'An admin needs to set allow_import to true in the site settings before imports can be run.', ''
puts '', 'Imports are not allowed.', 'An admin needs to set allow_restore to true in the site settings before imports can be run.', ''
puts 'Import cancelled.', ''
end
end
Expand Down

0 comments on commit 50273ba

Please sign in to comment.