Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1452005 Details for
Bug 1573243
Can't edit users when using LDAP datasource
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
1573243_bz.patch
1573243_bz.patch (text/plain), 1.79 KB, created by
Waldirio M Pinheiro
on 2018-06-15 17:19:04 UTC
(
hide
)
Description:
1573243_bz.patch
Filename:
MIME Type:
Creator:
Waldirio M Pinheiro
Created:
2018-06-15 17:19:04 UTC
Size:
1.79 KB
patch
obsolete
>diff --git a/app/models/auth_sources/auth_source_ldap.rb b/app/models/auth_sources/auth_source_ldap.rb >index 1165e6d..9db98bb 100644 >--- a/app/models/auth_sources/auth_source_ldap.rb >+++ b/app/models/auth_sources/auth_source_ldap.rb >@@ -207,16 +207,24 @@ class AuthSourceLdap < AuthSource > end > > def avatar_path >- "#{Rails.public_path}/assets/avatars" >+ "#{Rails.public_path}/images/avatars" > end > > def store_avatar(avatar) >- avatar = avatar.to_utf8 >+ unless avatar.instance_of?(Net::BER::BerIdentifiedString) >+ avatar = avatar.to_utf8 >+ end > avatar_hash = Digest::SHA1.hexdigest(avatar) > avatar_file = "#{avatar_path}/#{avatar_hash}.jpg" > unless FileTest.exist? avatar_file > FileUtils.mkdir_p(avatar_path) >- File.open(avatar_file, 'wb') { |f| f.write(Base64.decode64(avatar)) } >+ File.open(avatar_file, 'wb') do |f| >+ if avatar.instance_of?(Net::BER::BerIdentifiedString) >+ f.write(avatar) >+ else >+ f.write(Base64.decode64(avatar)) >+ end >+ end > end > avatar_hash > end >diff --git a/app/models/user.rb b/app/models/user.rb >index 986c057..c75189f 100644 >--- a/app/models/user.rb >+++ b/app/models/user.rb >@@ -220,7 +220,8 @@ class User < ActiveRecord::Base > > # clean up old avatar if it exists and the image isn't in use by anyone else > if old_hash.present? && user.avatar_hash != old_hash && !User.unscoped.where(:avatar_hash => old_hash).any? >- File.delete "#{Rails.public_path}/avatars/#{old_hash}.jpg" if File.exist? old_avatar >+ old_avatar = "#{Rails.public_path}/avatars/#{old_hash}.jpg" >+ File.delete(old_avatar) if File.exist?(old_avatar) > end > else > logger.debug "Failed to authenticate #{user.login} against #{user.auth_source} authentication source"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1573243
:
1428846
| 1452005 |
1452006