Skip to content
Snippets Groups Projects
Commit 272abb33 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'ce-to-ee-2017-09-01' into 'master'

CE upstream: Friday

Closes gitaly#184, gitaly#219, #3298, gitaly#486, gitlab-ce#37194, and gitlab-ce#34864

See merge request !2806
parents 75d710bc 2990c23f
No related branches found
No related tags found
1 merge request!2806CE upstream: Friday
Pipeline #
Showing
with 75 additions and 25 deletions
0.34.0
0.36.0
Loading
Loading
@@ -752,7 +752,7 @@ GEM
retriable (1.4.1)
rinku (2.0.0)
rotp (2.1.2)
rouge (2.2.0)
rouge (2.2.1)
rqrcode (0.7.0)
chunky_png
rqrcode-rails3 (0.1.7)
Loading
Loading
Loading
Loading
@@ -2,19 +2,20 @@ import _ from 'underscore';
 
(() => {
/*
* TODO: Make these methods more configurable (e.g. parseSeconds timePeriodContstraints,
* stringifyTime condensed or non-condensed, abbreviateTimelengths)
* TODO: Make these methods more configurable (e.g. stringifyTime condensed or
* non-condensed, abbreviateTimelengths)
* */
 
const utils = window.gl.utils = gl.utils || {};
const prettyTime = utils.prettyTime = {
/*
* Accepts seconds and returns a timeObject { weeks: #, days: #, hours: #, minutes: # }
* Seconds can be negative or positive, zero or non-zero.
* Seconds can be negative or positive, zero or non-zero. Can be configured for any day
* or week length.
*/
parseSeconds(seconds) {
const DAYS_PER_WEEK = 5;
const HOURS_PER_DAY = 8;
parseSeconds(seconds, { daysPerWeek = 5, hoursPerDay = 8 } = {}) {
const DAYS_PER_WEEK = daysPerWeek;
const HOURS_PER_DAY = hoursPerDay;
const MINUTES_PER_HOUR = 60;
const MINUTES_PER_WEEK = DAYS_PER_WEEK * HOURS_PER_DAY * MINUTES_PER_HOUR;
const MINUTES_PER_DAY = HOURS_PER_DAY * MINUTES_PER_HOUR;
Loading
Loading
Loading
Loading
@@ -734,6 +734,7 @@
#{$selector}.dropdown-menu,
#{$selector}.dropdown-menu-nav {
li {
display: block;
padding: 0 1px;
 
&:hover {
Loading
Loading
Loading
Loading
@@ -61,6 +61,10 @@
display: -webkit-flex;
display: flex;
}
.dropdown-menu.dropdown-menu-align-right {
margin-top: -2px;
}
}
 
.form-horizontal {
Loading
Loading
@@ -356,3 +360,7 @@
}
}
}
.member-form-control {
@include new-style-dropdown;
}
Loading
Loading
@@ -290,6 +290,7 @@
 
.dropdown-toggle {
.fa {
margin-left: 0;
color: inherit;
}
}
Loading
Loading
Loading
Loading
@@ -117,11 +117,14 @@ def update
user_params_with_pass = user_params.dup
 
if params[:user][:password].present?
user_params_with_pass.merge!(
password_params = {
password: params[:user][:password],
password_confirmation: params[:user][:password_confirmation],
password_expires_at: Time.now
)
password_confirmation: params[:user][:password_confirmation]
}
password_params[:password_expires_at] = Time.now unless changing_own_password?
user_params_with_pass.merge!(password_params)
end
 
respond_to do |format|
Loading
Loading
@@ -167,6 +170,10 @@ def remove_email
 
protected
 
def changing_own_password?
user == current_user
end
def user
@user ||= User.find_by!(username: params[:id])
end
Loading
Loading
Loading
Loading
@@ -210,7 +210,7 @@ def validate_user_service_ticket!
end
 
def check_password_expiration
if current_user && current_user.password_expires_at && current_user.password_expires_at < Time.now && current_user.allow_password_authentication?
if current_user && current_user.password_expires_at && current_user.password_expires_at < Time.now && !current_user.ldap_user?
return redirect_to new_profile_password_path
end
end
Loading
Loading
module RequiresWhitelistedMonitoringClient
extend ActiveSupport::Concern
include Gitlab::CurrentSettings
included do
before_action :validate_ip_whitelisted_or_valid_token!
end
Loading
Loading
class PasswordsController < Devise::PasswordsController
include Gitlab::CurrentSettings
before_action :resource_from_email, only: [:create]
before_action :check_password_authentication_available, only: [:create]
before_action :prevent_ldap_reset, only: [:create]
before_action :throttle_reset, only: [:create]
 
def edit
Loading
Loading
@@ -40,11 +38,11 @@ def resource_from_email
self.resource = resource_class.find_by_email(email)
end
 
def check_password_authentication_available
return if current_application_settings.password_authentication_enabled? && (resource.nil? || resource.allow_password_authentication?)
def prevent_ldap_reset
return unless resource&.ldap_user?
 
redirect_to after_sending_reset_password_instructions_path_for(resource_name),
alert: "Password authentication is unavailable."
alert: "Cannot reset password for LDAP user."
end
 
def throttle_reset
Loading
Loading
Loading
Loading
@@ -77,7 +77,7 @@ def determine_layout
end
 
def authorize_change_password!
render_404 unless @user.allow_password_authentication?
render_404 if @user.ldap_user?
end
 
def user_params
Loading
Loading
Loading
Loading
@@ -94,6 +94,6 @@ def apply_diff_view_cookie!
end
 
def require_pages_enabled!
not_found unless Gitlab.config.pages.enabled
not_found unless @project.pages_available?
end
end
Loading
Loading
@@ -205,7 +205,7 @@ def promo_url
end
 
def support_url
current_application_settings.help_page_support_url.presence || promo_url + '/getting-help/'
Gitlab::CurrentSettings.current_application_settings.help_page_support_url.presence || promo_url + '/getting-help/'
end
 
def page_filter_path(options = {})
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@ module ApplicationSettingsHelper
prepend EE::ApplicationSettingsHelper
extend self
 
include Gitlab::CurrentSettings
delegate :gravatar_enabled?,
:signup_enabled?,
:password_authentication_enabled?,
Loading
Loading
module AuthHelper
include Gitlab::CurrentSettings
PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq).freeze
FORM_BASED_PROVIDERS = [/\Aldap/, 'kerberos', 'crowd'].freeze
 
Loading
Loading
Loading
Loading
@@ -78,7 +78,8 @@ def upgrade_plan_url
def show_promotions?(selected_user = current_user)
return false unless selected_user
 
if current_application_settings.should_check_namespace_plan?
if Gitlab::CurrentSettings.current_application_settings
.should_check_namespace_plan?
true
else
license = License.current
Loading
Loading
module ProjectsHelper
include Gitlab::CurrentSettings
def link_to_project(project)
link_to [project.namespace.becomes(Namespace), project], title: h(project.name) do
title = content_tag(:span, project.name, class: 'project-name')
Loading
Loading
class BaseMailer < ActionMailer::Base
include Gitlab::CurrentSettings
around_action :render_with_default_locale
 
helper ApplicationHelper
helper MarkupHelper
 
attr_accessor :current_user
helper_method :current_user, :can?
helper_method :current_user, :can?, :current_application_settings
 
default from: proc { default_sender_address.format }
default reply_to: proc { default_reply_to_address.format }
Loading
Loading
Loading
Loading
@@ -251,6 +251,28 @@ def cherry_pick_branch_name
project.repository.next_branch("cherry-pick-#{short_id}", mild: true)
end
 
def cherry_pick_description(user)
message_body = "(cherry picked from commit #{sha})"
if merged_merge_request?(user)
commits_in_merge_request = merged_merge_request(user).commits
if commits_in_merge_request.present?
message_body << "\n"
commits_in_merge_request.reverse.each do |commit_in_merge|
message_body << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}"
end
end
end
message_body
end
def cherry_pick_message(user)
%Q{#{message}\n\n#{cherry_pick_description(user)}}
end
def revert_description(user)
if merged_merge_request?(user)
"This reverts merge request #{merged_merge_request(user).to_reference}"
Loading
Loading
module Elastic
module ApplicationSearch
extend ActiveSupport::Concern
extend Gitlab::CurrentSettings
 
included do
include Elasticsearch::Model
include Gitlab::CurrentSettings
 
index_name [Rails.application.class.parent_name.downcase, Rails.env].join('-')
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment