bbmb 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fc3295b2cda0d75a3081036c93995faeee526a0
4
- data.tar.gz: 9a8f77400cee85995a9da0e73c6e716f12a081ea
3
+ metadata.gz: 74b33b06bdc40e8e375f2cb467bad60696906bd5
4
+ data.tar.gz: 24fe53d831147f6efdc76eb012bd105c8ef3b780
5
5
  SHA512:
6
- metadata.gz: 2061a3762bd644ab5869d9174027d5e5554d8d2adca75521954b090e8f376e66a51defe6b4e8002916fd67cc2f4c32c4b8b4af934df9d7e5057e381c1f87850f
7
- data.tar.gz: 591fdea209b7846a3e204f0fe3fc585cbe8244e0f3e7f682a62497da26d22071da3575e28098379ddd68873290d7863ece8c531fc53d0b7b7e756ab527bb4dcd
6
+ metadata.gz: 936dbe0717e852eb213a1b7f2d8c71f03c832b73958be9ded5205461478efc391675018aafbe538b00e243262ee38d804cb8bec1d821b21acf50ced53783b755
7
+ data.tar.gz: 44ca2e4e4488f7fa689198e8a9e5246e93afe7105d6abc648f75fe7089a0e1a99abc4279a91525a6a6ce1e54bce0dd37d27dd9cfc68bfe5628a3093b3db7dc45
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.2.1 / 17.05.2017
2
+
3
+ * Fix logout. Uses app
4
+ * Allow changing the e-mail address when old is nil and new one is not used by any other customer
5
+
1
6
  === 2.2.0 / 17.05.2017
2
7
 
3
8
  * Refuse empty e-mail adress with e_email_required
@@ -38,7 +38,7 @@ class Session < SBSM::Session
38
38
  def logout
39
39
  SBSM.info "BBMB::Html::Util::Session logout @auth_session #{@auth_session.class}"
40
40
  $stdout.sync = true
41
- @app.logout(@user.auth_session) if(@user.respond_to?(:auth_session))
41
+ BBMB.auth.logout(@user.auth_session) if(@user.respond_to?(:auth_session))
42
42
  super
43
43
  end
44
44
 
@@ -70,7 +70,7 @@ class Customer
70
70
  return if @email.eql?(email)
71
71
  email = email.encode('UTF-8')
72
72
  ## notify the server of this change, as it affects the user-data
73
- BBMB.server.rename_user(@email, email)
73
+ BBMB.server.rename_user(customer_id, @email, email)
74
74
  @email = email
75
75
  end
76
76
  end
@@ -43,11 +43,16 @@ module BBMB
43
43
  def inject_order(customer_id, products, infos, opts={})
44
44
  @app.inject_order(customer_id, products, infos, opts)
45
45
  end
46
- def rename_user(old_name, new_name)
46
+ def rename_user(customer_id, old_name, new_name)
47
47
  return if old_name.eql?(new_name)
48
48
  BBMB.auth.autosession(BBMB.config.auth_domain) do |session|
49
- if(old_name.nil?)
50
- session.create_entity(new_name)
49
+ if (old_name.nil?)
50
+ begin
51
+ session.create_entity(new_name)
52
+ rescue => error
53
+ raise error if Model::Customer.odba_extent.find {|x| x.email && x.email.index(new_name) }
54
+ SBSM.info("Skip session.create_entity for customer #{customer_id} as we found no customer with e-mail #{new_name}")
55
+ end
51
56
  else
52
57
  session.rename(old_name, new_name)
53
58
  end
data/lib/bbmb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbmb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger