Manually approve new registrations (default: false)

pull/530/head
Marcelo Schmidt 11 years ago
parent 162605aae7
commit 27df9c272c
  1. 7
      client/views/login/form.coffee
  2. 64
      client/views/login/form.html
  3. 2
      i18n/de.i18n.json
  4. 2
      i18n/el.i18n.json
  5. 7
      i18n/en.i18n.json
  6. 2
      i18n/es.i18n.json
  7. 2
      i18n/fi.i18n.json
  8. 2
      i18n/fr.i18n.json
  9. 2
      i18n/he.i18n.json
  10. 2
      i18n/hr.i18n.json
  11. 2
      i18n/hu.i18n.json
  12. 2
      i18n/it.i18n.json
  13. 2
      i18n/ja.i18n.json
  14. 2
      i18n/km.i18n.json
  15. 2
      i18n/ko.i18n.json
  16. 2
      i18n/pl.i18n.json
  17. 2
      i18n/pt.i18n.json
  18. 2
      i18n/ru.i18n.json
  19. 2
      i18n/ta-IN.i18n.json
  20. 2
      i18n/tr.i18n.json
  21. 2
      i18n/ug.i18n.json
  22. 2
      i18n/uk.i18n.json
  23. 2
      i18n/zh.i18n.json
  24. 1
      packages/rocketchat-lib/settings/server/startup.coffee
  25. 4
      server/lib/accounts.coffee

@ -24,7 +24,7 @@ Template.loginForm.helpers
return 'hidden' unless Template.instance().state.get() is 'login'
showBackToLoginLink: ->
return 'hidden' unless Template.instance().state.get() in ['register', 'forgot-password', 'email-verification']
return 'hidden' unless Template.instance().state.get() in ['register', 'forgot-password', 'email-verification', 'wait-activation']
btnLoginSave: ->
switch Template.instance().state.get()
@ -37,6 +37,9 @@ Template.loginForm.helpers
when 'forgot-password'
return t('Reset_password')
waitActivation: ->
return Template.instance().state.get() is 'wait-activation'
Template.loginForm.events
'submit #login-card': (event, instance) ->
event.preventDefault()
@ -75,6 +78,8 @@ Template.loginForm.events
if error?.error is 'no-valid-email'
toastr.success t('We_have_sent_registration_email')
instance.state.set 'login'
else if error?.error is 'inactive-user'
instance.state.set 'wait-activation'
# else
# FlowRouter.go 'index'
else

@ -1,37 +1,45 @@
<template name="loginForm">
<form id="login-card" method='/'>
{{ > loginServices }}
{{#if needsValidateEmail}}
<div class="alert alert-danger">
{{_ "You_neeed_confirm_email"}}
{{#if waitActivation}}
<header>
<h2>{{{_ "Registration_Succeeded"}}}</h2>
<p>{{{_ "Wait_activation_warning"}}}</p>
<p>{{{_ "Please_wait_activation"}}}</p>
</header>
{{else}}
{{ > loginServices }}
{{#if needsValidateEmail}}
<div class="alert alert-danger">
{{_ "You_need_confirm_email"}}
</div>
{{/if}}
<div class="fields">
<div class='input-text active {{showName}}'>
<input type="text" name='name' placeholder='{{_ "Name"}}' dir="auto" />
</div>
<div class='input-text active {{showEmailOrUsername}}'>
<input type="text" name='emailOrUsername' placeholder='{{_ "Email_or_username"}}' autocapitalize="off" autocorrect="off" />
</div>
<div class='input-text active {{showEmail}}'>
<input type="email" name='email' placeholder='{{_ "Email"}}' />
</div>
<div class='input-text active {{showPassword}}'>
<input type="password" name='pass' placeholder='{{_ "Password"}}' />
</div>
<div class='input-text active {{showConfirmPassword}}'>
<input type="password" name='confirm-pass' placeholder='{{_ "Confirm_password"}}' />
</div>
</div>
{{/if}}
<div class="fields">
<div class='input-text active {{showName}}'>
<input type="text" name='name' placeholder='{{_ "Name"}}' dir="auto" />
</div>
<div class='input-text active {{showEmailOrUsername}}'>
<input type="text" name='emailOrUsername' placeholder='{{_ "Email_or_username"}}' autocapitalize="off" autocorrect="off" />
<div class="submit">
<button data-loading-text="{{_ "Please_wait"}}..." class='button primary login'><span>{{btnLoginSave}}</span></button>
</div>
<div class='input-text active {{showEmail}}'>
<input type="email" name='email' placeholder='{{_ "Email"}}' />
<div class="register {{showRegisterLink}}">
<a href="">{{_ 'Register'}}</a>
</div>
<div class='input-text active {{showPassword}}'>
<input type="password" name='pass' placeholder='{{_ "Password"}}' />
<div class="forgot-password {{showForgotPasswordLink}}">
<a href="">{{_ 'Forgot_password'}}</a>
</div>
<div class='input-text active {{showConfirmPassword}}'>
<input type="password" name='confirm-pass' placeholder='{{_ "Confirm_password"}}' />
</div>
</div>
<div class="submit">
<button data-loading-text="{{_ "Please_wait"}}..." class='button primary login'><span>{{btnLoginSave}}</span></button>
</div>
<div class="register {{showRegisterLink}}">
<a href="">{{_ 'Register'}}</a>
</div>
<div class="forgot-password {{showForgotPasswordLink}}">
<a href="">{{_ 'Forgot_password'}}</a>
</div>
{{/if}}
<div class="back-to-login {{showBackToLoginLink}}">
<a href="">{{_ 'Back_to_login'}}</a>
</div>

@ -213,7 +213,7 @@
"Welcome_to_the" : "Willkommen bei",
"With_whom" : "Mit wem?",
"you_are_in_preview_mode_of" : "Sie sind m Vorschau-Modus des Kanals #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Sie müssen Ihre Email bestätigen!",
"You_need_confirm_email" : "Sie müssen Ihre Email bestätigen!",
"Your_Open_Source_solution" : "Deine eigene Open Source Chat Lösung",
"You_will_not_be_able_to_recover" : "Sie können es nicht wieder rückgängig machen!",
"Yes_delete_it" : "Ja, lösche es!",

@ -214,7 +214,7 @@
"Welcome_to_the" : "Καλως ήλθατε στο",
"With_whom" : "Με ποιον",
"you_are_in_preview_mode_of" : "Είστε σε κατάσταση προεπισκόπησης του καναλιού #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Πρεπει να επιβεβαίώσετε το email σας για να συνδεθείτε!",
"You_need_confirm_email" : "Πρεπει να επιβεβαίώσετε το email σας για να συνδεθείτε!",
"Your_Open_Source_solution" : "Η δικιά σου λύση ανοιχτού κώδικα",
"You_will_not_be_able_to_recover" : "Δεν θα μπορείτε να το επαναφέρετε!",
"Yes_delete_it" : "Ναι, διέγραψέ το!",

@ -1,6 +1,7 @@
{
"Access_online_demo" : "Access the online demo",
"Access_Online_Demo" : "Access the Online Demo",
"Accounts_ManuallyApproveNewUsers" : "Manually aprove new users",
"Accounts_denyUnverifiedEmail" : "Deny unverified e-mail",
"Accounts_EmailVerification" : "E-mail Verification",
"Accounts_RegistrationRequired" : "Registration Required",
@ -158,6 +159,7 @@
"Password" : "Password",
"Password_changed_successfully" : "Password changed successfully",
"Please_wait" : "Please wait",
"Please_wait_activation" : "Please wait, this can take some time.",
"Powered_by" : "Powered by",
"Privacy" : "Privacy",
"Private_Groups" : "Private Groups",
@ -177,6 +179,7 @@
"quote" : "quote",
"Recents" : "Recents",
"Register" : "Register a new account",
"Registration_Succeeded" : "Registration Succeeded",
"Remember_me" : "Remember me",
"Remove" : "Remove",
"Remove_Admin" : "Remove Admin",
@ -225,6 +228,7 @@
"User_has_been_deactivated" : "User has been deactivated",
"User_has_been_deleted" : "User has been deleted",
"User_is_no_longer_an_admin" : "User is no longer an admin",
"User_is_not_activated" : "User is not activated",
"User_is_now_an_admin" : "User is now an admin",
"User_joined_channel" : "Has joined the channel.",
"User_joined_channel_female" : "Has joined the channel.",
@ -243,6 +247,7 @@
"Username_title" : "Register username",
"Username_unavaliable" : "<strong>%s</strong> is already in use :(",
"View_All" : "View All",
"Wait_activation_warning" : "Before you can login, your account must be manually activated by an administrator.",
"We_have_sent_password_email" : "We have sent you an e-mail with password reset instructions. If you do not receive an e-mail shortly, please come back and try again.",
"We_have_sent_registration_email" : "We have sent you an e-mail to confirm your registration. If you do not receive an e-mail shortly, please come back and try again.",
"Welcome" : "Welcome <em>%s</em>.",
@ -250,7 +255,7 @@
"With_whom" : "With whom",
"Yes_delete_it" : "Yes, delete it!",
"you_are_in_preview_mode_of" : "You are in preview mode of channel #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "You need to confirm your email to login!",
"You_need_confirm_email" : "You need to confirm your email to login!",
"You_will_not_be_able_to_recover" : "You will not be able to recover!",
"Your_entry_has_been_deleted" : "Your entry has been deleted.",
"Your_Open_Source_solution" : "Your own Open Source chat solution"

@ -135,6 +135,6 @@
"Welcome" : "Bienvenido <em>%s</em>.",
"Welcome_to_the" : "Bienvenido a la",
"With_whom" : "Con quien",
"You_neeed_confirm_email" : "¡Es necesario confirmar tu correo electrónico para poder identificarte!",
"You_need_confirm_email" : "¡Es necesario confirmar tu correo electrónico para poder identificarte!",
"Your_Open_Source_solution" : "Tu propia solución de chat de código abierto"
}

@ -207,7 +207,7 @@
"Welcome_to_the" : "Tervetuloa",
"With_whom" : "kanssa",
"you_are_in_preview_mode_of" : "Tämä on kanavan #<strong>__room_name__</strong> esikatselutila",
"You_neeed_confirm_email" : "Sinun tulee vahvistaa sähköpostiosoitteesi!",
"You_need_confirm_email" : "Sinun tulee vahvistaa sähköpostiosoitteesi!",
"Your_Open_Source_solution" : "Your own Open Source chat solution",
"You_will_not_be_able_to_recover" : "Palauttaminen ei ole mahdollista!",
"Yes_delete_it" : "Kyllä, poista!",

@ -168,7 +168,7 @@
"Welcome_to_the" : "Bienvenue sur",
"With_whom" : "Avec qui",
"you_are_in_preview_mode_of" : "Aperçu du salon #<strong>__room_name__</strong> ",
"You_neeed_confirm_email" : "Vous devez confirmer votre adresse email pour vous connecter !",
"You_need_confirm_email" : "Vous devez confirmer votre adresse email pour vous connecter !",
"Your_Open_Source_solution" : "Votre propre solution de chat Open Source",
"You_will_not_be_able_to_recover" : "Cette action n'est pas réversible !",
"Yes_delete_it" : "Oui, je confirme la suppression !",

@ -145,6 +145,6 @@
"Welcome" : "ברוך הבא <em>%s</em>.",
"Welcome_to_the" : "ברוך הבא ל-",
"you_are_in_preview_mode_of" : "הנך בתצוגה מוקדמת של ערוץ #<strong>__rom_name__</strong>",
"You_neeed_confirm_email" : "הינך צריך לאמת את כתובת האימייל על מנת להתחבר!",
"You_need_confirm_email" : "הינך צריך לאמת את כתובת האימייל על מנת להתחבר!",
"Your_Open_Source_solution" : "פתרון הקוד הפתוח שלך לצ'אט"
}

@ -199,7 +199,7 @@
"Welcome_to_the" : "Dobro došli »",
"With_whom" : "Sa kim",
"you_are_in_preview_mode_of" : "Ti si u preglednom načinu kanala # <strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Trebaš potvrditi svoj email kako bi se prijavio!",
"You_need_confirm_email" : "Trebaš potvrditi svoj email kako bi se prijavio!",
"Your_Open_Source_solution" : "Vaše vlastito Open Source chat rješenje",
"You_will_not_be_able_to_recover" : "Ovo nećeš moći promijeniti!",
"Yes_delete_it" : "Da, obriši!",

@ -124,6 +124,6 @@
"We_have_sent_registration_email" : "Küldtünk egy email-t hogy megerősíthessük a regisztrációt. Ha nem kapnál hamarosan levelet akkor gyere vissza később és próbáld újra.",
"Welcome" : "Üdvözöllek <em>%s</em>",
"Welcome_to_the" : "Üdvözöllek a",
"You_neeed_confirm_email" : "Kérlek hitelesítsd az email címed a bejelntkezéshez",
"You_need_confirm_email" : "Kérlek hitelesítsd az email címed a bejelntkezéshez",
"Your_Open_Source_solution" : "A saját Nyílt Forrású chat-ed"
}

@ -124,6 +124,6 @@
"We_have_sent_registration_email" : "Abbiamo inviato una email per confermare la registrazione. Se non ricevi una email a breve tempo, torna e prova di nuovo.",
"Welcome" : "Benvenuto <em>%s</em>.",
"Welcome_to_the" : "Benvenuto a",
"You_neeed_confirm_email" : "Hai bisogno di confermare il tuo email per accedere!",
"You_need_confirm_email" : "Hai bisogno di confermare il tuo email per accedere!",
"Your_Open_Source_solution" : "La tua soluzione per chat Open Source"
}

@ -131,6 +131,6 @@
"We_have_sent_registration_email" : "登録を確認するメールを送信しました。すぐにメールが届かない場合は、再度お試しください。",
"Welcome" : "ようこそ <em>%s</em>.",
"Welcome_to_the" : "Welcome to the",
"You_neeed_confirm_email" : "ログインするためにはメールを確認する必要があります!",
"You_need_confirm_email" : "ログインするためにはメールを確認する必要があります!",
"Your_Open_Source_solution" : "独自のオープンソースチャットソリューション"
}

@ -170,7 +170,7 @@
"Welcome_to_the" : "សគមនមក",
"With_whom" : "ជនរណ",
"you_are_in_preview_mode_of" : "អនកទមរង #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "អនកបញកចល!",
"You_need_confirm_email" : "អនកបញកចល!",
"Your_Open_Source_solution" : "ដហររបសនក",
"You_will_not_be_able_to_recover" : "អនកនអមកញ!",
"Yes_delete_it" : "បទ លប!",

@ -165,7 +165,7 @@
"Welcome_to_the" : "오신것을 환영합니다",
"With_whom" : "누구랑?",
"you_are_in_preview_mode_of" : "#<strong>__room_name__</strong> 채널 미리보기 모드",
"You_neeed_confirm_email" : "로그인하려면 이메일 확인이 필요합니다!",
"You_need_confirm_email" : "로그인하려면 이메일 확인이 필요합니다!",
"Your_Open_Source_solution" : "자신만의 오픈소스 채팅 솔루션",
"You_will_not_be_able_to_recover" : "복구 안됩니다!",
"Yes_delete_it" : "넵, 삭제!",

@ -190,7 +190,7 @@
"Welcome_to_the" : "Witaj w",
"With_whom" : "Z kim",
"you_are_in_preview_mode_of" : "Jesteś w trybie podglądu kanału # <strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Musisz potwierdzić swój adres e-mail, aby zalogować się!",
"You_need_confirm_email" : "Musisz potwierdzić swój adres e-mail, aby zalogować się!",
"Your_Open_Source_solution" : "Twój własny czat Open Source",
"You_will_not_be_able_to_recover" : "Nie będziesz w stanie odzyskać!",
"Yes_delete_it" : "Tak, usuń to!",

@ -175,7 +175,7 @@
"Welcome_to_the" : "Bem-vindo ao",
"With_whom" : "Com quem",
"you_are_in_preview_mode_of" : "Esta é uma prévia do canal #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Você precisa confirmar seu email para logar!",
"You_need_confirm_email" : "Você precisa confirmar seu email para logar!",
"Your_Open_Source_solution" : "Sua própria solução Open Source",
"You_will_not_be_able_to_recover" : "Você não será capaz de desfazer!",
"Yes_delete_it" : "Sim, exclua!",

@ -167,7 +167,7 @@
"Welcome" : "Добро пожаловать, <em>%s</em>.",
"Welcome_to_the" : "Добро пожаловать в",
"you_are_in_preview_mode_of" : "Вы находитесь в режиме предварительного просмотра канала # <strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Необходимо подтвердить email для входа!",
"You_need_confirm_email" : "Необходимо подтвердить email для входа!",
"Your_Open_Source_solution" : "Ваш собственный чат на базе Open Source-технологий",
"You_will_not_be_able_to_recover" : "Вы не сможете восстановить!",
"Yes_delete_it" : "Да, удалить его!"

@ -99,7 +99,7 @@
"View_All" : "அனக",
"Welcome" : "<em>% s</em> உஙகள வரவி.",
"With_whom" : "யடன",
"You_neeed_confirm_email" : "நகள உளய உஙகளினஞசலகவரி உறிபடத வ!",
"You_need_confirm_email" : "நகள உளய உஙகளினஞசலகவரி உறிபடத வ!",
"You_will_not_be_able_to_recover" : "நகளக மி!",
"Yes_delete_it" : "ஆம, ந!",
"Your_entry_has_been_deleted" : "உஙகள உளகபபடிடத."

@ -150,7 +150,7 @@
"Welcome_to_the" : "Hoşgeldiniz",
"With_whom" : "Kiminle",
"you_are_in_preview_mode_of" : "Kanal  #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "Giriş yapabilmek için öncelikle e-posta adresinizi onaylamanız gerekmektedir!",
"You_need_confirm_email" : "Giriş yapabilmek için öncelikle e-posta adresinizi onaylamanız gerekmektedir!",
"Your_Open_Source_solution" : "Açık Kaynak Sohbet Uygulaması",
"You_will_not_be_able_to_recover" : "Sen kurtarmak mümkün olmayacaktır!",
"Yes_delete_it" : "Evet, bunu silin!",

@ -137,6 +137,6 @@
"View_All" : "ھەممىنى كۆرۈش",
"Welcome" : "ئەسسالامۇ-ئەلەيكۇم <em>%s</em>.",
"Welcome_to_the" : "كەلگىنىزگە مەرھابا",
"You_neeed_confirm_email" : "ئىلخەتنى جەزملەشتۈرۈپ بولغاندىن كېيىن كىرەلەيسىز!",
"You_need_confirm_email" : "ئىلخەتنى جەزملەشتۈرۈپ بولغاندىن كېيىن كىرەلەيسىز!",
"Your_Open_Source_solution" : "ئۆزىڭىزنىڭ ئوچۇق كودلۇق پاراڭلىشىش ھەل قىلىش ئۇسۇلى"
}

@ -125,6 +125,6 @@
"We_have_sent_registration_email" : "Ми відправили вам по електронній пошті, щоб підтвердити свою реєстрацію. Якщо ви не отримуєте електронну пошту найближчим часом, будь ласка, повернутися і спробувати знову.",
"Welcome" : "Вітаємо, <em>%s</em>.",
"Welcome_to_the" : "Ласкаво просимо в",
"You_neeed_confirm_email" : "Для входу необхідно підтвердити e-mail!",
"You_need_confirm_email" : "Для входу необхідно підтвердити e-mail!",
"Your_Open_Source_solution" : "Ваш власний Open Source чат"
}

@ -124,6 +124,6 @@
"We_have_sent_registration_email" : "我们已经向您发出一封电子邮件,以确认您的注册。如果您没有收到邮件,请重试。",
"Welcome" : "欢迎 <em>%s</em>",
"Welcome_to_the" : "欢迎来到",
"You_neeed_confirm_email" : "登录前请验证您的电子邮件!",
"You_need_confirm_email" : "登录前请验证您的电子邮件!",
"Your_Open_Source_solution" : "您自己的开源聊天解决方案"
}

@ -21,6 +21,7 @@ Meteor.startup ->
RocketChat.settings.add 'Accounts_Twitter', false, { type: 'boolean', group: 'Accounts' }
RocketChat.settings.add 'Accounts_Twitter_id', '', { type: 'string', group: 'Accounts' }
RocketChat.settings.add 'Accounts_Twitter_secret', '', { type: 'string', group: 'Accounts' }
RocketChat.settings.add 'Accounts_ManuallyApproveNewUsers', false, { type: 'boolean', group: 'Accounts' }
RocketChat.settings.addGroup 'API'
RocketChat.settings.add 'API_Analytics', '', { type: 'string', group: 'API', public: true }

@ -20,7 +20,7 @@ Accounts.onCreateUser (options, user) ->
# console.log 'user ->',JSON.stringify user, null, ' '
user.status = 'offline'
user.active = true
user.active = not RocketChat.settings.get 'Accounts_ManuallyApproveNewUsers'
serviceName = null
@ -59,7 +59,7 @@ Accounts.validateLoginAttempt (login) ->
return login.allowed
if login.user?.active isnt true
throw new Meteor.Error 'inactive-user', 'Your_user_has_been_deactivated'
throw new Meteor.Error 'inactive-user', TAPi18next.t 'project:User_is_not_activated'
return false
if login.type is 'password' and RocketChat.settings.get('Accounts_denyUnverifiedEmails') is true

Loading…
Cancel
Save