Unverified Commit 09a425cb authored by Benjamin Neff's avatar Benjamin Neff
Browse files

Merge branch 'release/0.7.12.0'

parents dc7c5ffe 1e8a96d8
# 0.7.12.0
## Refactor
* Harmonize markdown titles sizes [#8029](https://github.com/diaspora/diaspora/pull/8029)
## Bug fixes
* Improve handling of mixed case hostnames while fetching OpenGraph data [#8021](https://github.com/diaspora/diaspora/pull/8021)
* Fix "remember me" with two factor authentication enabled [#8031](https://github.com/diaspora/diaspora/pull/8031)
## Features
* Add line mentioning diaspora\* on the splash page [#7966](https://github.com/diaspora/diaspora/pull/7966)
* Improve communication about signing up on closed pods [#7896](https://github.com/diaspora/diaspora/pull/7896)
# 0.7.11.0
## Refactor
......
......@@ -42,6 +42,14 @@
padding: 15px;
}
.part-of-diaspora {
font-style: italic;
a {
color: $white;
}
}
.login-form {
fieldset { background: none; }
......
......@@ -16,6 +16,30 @@
}
}
h1 {
font-size: 2.7rem;
}
h2 {
font-size: 2.3rem;
}
h3 {
font-size: 2rem;
}
h4 {
font-size: 1.8rem;
}
h5 {
font-size: 1.6rem;
}
h6 {
font-size: 1.4rem;
}
.img-responsive {
display: inline;
}
......
.page-registrations.action-new,
.page-registrations.action-create {
.page-registrations {
.ball {
background: image-url('branding/ball.png') no-repeat;
background-size: contain;
......@@ -12,19 +11,24 @@
height: 633px;
}
@media (max-width: $screen-xs-max) {
.v-center {
height: auto;
}
}
.content {
display: table-cell;
vertical-align: middle;
h2 {
h1 {
font-size: 35px;
margin: 12px;
text-align: center;
margin: 12px 0;
}
}
form {
max-width: 400px;
max-width: 500px;
}
.captcha-img {
......@@ -34,16 +38,13 @@
width: 120px;
}
.captcha-input {
.form-control.captcha-input {
border-bottom: 1px solid $input-border;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-sizing: border-box;
font-size: 16px;
height: 40px;
line-height: $line-height-base;
padding: 10px 10px 10px 130px;
width: 100%;
padding-left: 130px;
}
.terms > a {
......
......@@ -5,9 +5,9 @@
# the COPYRIGHT file.
class RegistrationsController < Devise::RegistrationsController
before_action :check_registrations_open_or_valid_invite!
before_action :check_registrations_open_or_valid_invite!, except: :registrations_closed
layout -> { request.format == :mobile ? "application" : "with_header" }
layout -> { request.format == :mobile ? "application" : "with_header_with_footer" }
def create
@user = User.build(user_params)
......@@ -28,13 +28,17 @@ class RegistrationsController < Devise::RegistrationsController
end
end
def registrations_closed
render "registrations/registrations_closed"
end
private
def check_registrations_open_or_valid_invite!
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
flash[:error] = params[:invite] ? t("registrations.invalid_invite") : t("registrations.closed")
redirect_to new_user_session_path
flash[:error] = t("registrations.invalid_invite") if params[:invite]
redirect_to registrations_closed_path
end
def invite
......
......@@ -12,21 +12,21 @@ class SessionsController < Devise::SessionsController
# rubocop:enable Rails/LexicallyScopedActionFilter
def find_user
return User.find(session[:otp_user_id]) if session[:otp_user_id]
return User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
User.find(session[:otp_user_id]) if session[:otp_user_id]
end
def authenticate_with_2fa
self.resource = find_user
u = find_user
return true unless u&.otp_required_for_login?
return true unless resource&.otp_required_for_login?
if params[:user][:otp_attempt].present? && session[:otp_user_id]
authenticate_with_two_factor_via_otp(u)
elsif u&.valid_password?(params[:user][:password])
prompt_for_two_factor(u)
authenticate_with_two_factor_via_otp(resource)
else
strategy = Warden::Strategies[:database_authenticatable].new(warden.env, :user)
prompt_for_two_factor(strategy.user) if strategy.valid? && strategy._run!.successful?
end
end
......
......@@ -33,7 +33,9 @@ class OpenGraphCache < ApplicationRecord
end
def fetch_and_save_opengraph_data!
object = OpenGraphReader.fetch!(self.url)
uri = URI.parse(url.start_with?("http") ? url : "http://#{url}")
uri.normalize!
object = OpenGraphReader.fetch!(uri)
return unless object
......
......@@ -591,6 +591,10 @@ class User < ApplicationRecord
end
end
def remember_me
true
end
private
def clearable_fields
......
......@@ -37,7 +37,6 @@
autocorrect: "off",
aria: {labelledby: "passwordConfirmationLabel"}
= hidden_field(:user, :remember_me, value: 1)
= f.submit t("devise.passwords.edit.change_password"), class: "btn btn-block btn-primary"
.text-center
......
......@@ -4,6 +4,10 @@
.row
.col-md-8.text-center
%h1= t("home.default.headline", pod_name: pod_name)
- if pod_name != "diaspora*"
%h2.part-of-diaspora
!= t("home.default.part_of_diaspora",
diaspora_site_link: link_to(t("home.default.diaspora_site_link"), "https://diasporafoundation.org/"))
%h2= t("home.default.byline")
.col-md-4.login-form
= render partial: "sessions/form", locals: {mobile: false, resource: User.new, resource_name: :user}
......
%ul.nav.navbar-nav.navbar-right
- if AppConfig.settings.enable_registrations? && !current_page?(controller: "/registrations", action: :new)
- unless current_page?(controller: "/registrations", action: :new)
%li= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: "login"
- unless current_page?(controller: "/sessions", action: :new)
%li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login"
......@@ -4,7 +4,7 @@
- if mobile
%legend
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
= t("aspects.aspect_stream.make_something")
= AppConfig.settings.pod_name
- if mobile
= f.label :email, t("registrations.new.email"), class: "control-label", id: "emailLabel"
......
%h2
= t("devise.shared.links.sign_up_closed")
!= t("registrations.closed.closed_pod",
wiki: link_to(t("registrations.closed.another_pod"), "https://diasporafoundation.org/getting_started/sign_up"))
!= t("registrations.closed.find_pods",
poduptime: link_to("Poduptime", "https://podupti.me/"))
!= t("registrations.closed.other_questions",
wiki: link_to("Wiki", "https://wiki.diasporafoundation.org/Choosing_a_pod"))
#registration
.container
.row
.col-md-10.offset1
.col-md-7.hidden-phone
%h1.ball
.col-md-5.v-center
.content.text-center
%h2#pod-name
= AppConfig.settings.pod_name
.col-sm-6.hidden-xs
.ball
.col-sm-6.col-xs-12.v-center
.content.text-center
%h1#pod-name
= AppConfig.settings.pod_name
= render partial: "form", locals: {mobile: false}
= render partial: "form", locals: {mobile: false}
#registration
.container
.row
.col-sm-6.hidden-xs
.ball
.col-sm-6.col-xs-12.v-center
.content
= render partial: "registrations_closed"
.stream#main-stream
- flash.each do |name, msg|
.expose#flash-container
.flash-message{class: "message alert alert-#{flash_class name}", role: "alert"}
= msg
.login-form
.login-container
= render partial: "registrations_closed"
......@@ -40,5 +40,4 @@
autocorrect: "off",
aria: {labelledby: "passwordLabel"}
= f.hidden_field :remember_me, value: 1
= f.submit t("devise.sessions.new.sign_in"), class: "btn btn-large btn-block btn-primary"
......@@ -4,7 +4,7 @@
defaults:
version:
number: "0.7.11.0" # Do not touch unless doing a release, do not backport the version number that's in master
number: "0.7.12.0" # Do not touch unless doing a release, do not backport the version number that's in master
heroku: false
environment:
url: "http://localhost:3000/"
......
......@@ -15,11 +15,6 @@ end
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
config.warden do |manager|
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
manager.default_strategies(scope: :user).unshift :two_factor_backupable
end
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmation, reset password and unlock tokens in the database.
......
......@@ -86,7 +86,7 @@ pt-BR:
remember_me: "Lembre-se de mim"
sign_in: "Entrar"
username: "Nome de usuário"
signed_in: "Você entrou com sucesso."
signed_in: "Você entrou."
signed_out: "Você saiu com sucesso."
shared:
links:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment