bbmb 2.1.5 → 2.1.6

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: bb9850553e28e9f603b495d864c1e17bb9a0f835
4
- data.tar.gz: 83b72979f233b9d7e2c15eb3d9f4a3cda2af93e0
3
+ metadata.gz: d5365fd813153ac20b43e196524e0c9545f75e53
4
+ data.tar.gz: 8646828879d9666acb695a24cc3623784a62151d
5
5
  SHA512:
6
- metadata.gz: d5f630e2f4112e7c5b17061ff6f24e0a7aad3fb21725cacabd480cd94cdff7c166377855651d18b6be4f59559134c484c1f16d821abbf6321daf2727799022b6
7
- data.tar.gz: c4f8e3782a87607ee8ce8171e583d56c8cc2c92889f366bc66dcd6491e82a75c125d5c18b3dbe82bad8f59a574f0cd851b05862e5924fdc5512559427c2487b3
6
+ metadata.gz: 2f06402f1cea28e3315f9249cae42c88f7248b90ba8a5efb934e399267711b91c31250f7e4881fb74969cef1c11a9ca3a7fdd25dd24fda174747f334e253e255
7
+ data.tar.gz: 3fb14b307539caaa45e632ca72c4cb8fa6c545733d51da53dfb9c7efa1aa63f11739fd1cf845b6fb1fa5ec7efc52b3cb25a8676d404a723806f596c56f2d0b5a
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 2.1.6 / 16.05.2017
2
+
3
+ * Fixed sorting via last_login when logged in as admin
4
+ * Nicer tracing on how updater/invoicer start
5
+ * Removed some dead code and debug statements
6
+
1
7
  === 2.1.5 / 16.05.2017
2
8
 
3
9
  * Improved fix for orders with unreachable ODBA-IDs for positions
@@ -72,7 +72,7 @@ module BBMB
72
72
  end
73
73
 
74
74
  def last_login
75
- @last_login ||= @session.user.last_login(email)
75
+ @last_login ||= @session.auth_session.last_login(email)
76
76
  end
77
77
 
78
78
  def valid
@@ -17,16 +17,8 @@ class KnownUser < SBSM::User
17
17
  # login BBMB.config.auth_domain + ".Customer"
18
18
  attr_reader :auth_session
19
19
  PREFERENCE_KEYS = [ :home, :pagestep ]
20
- PREFERENCE_KEYS.each { |key|
21
- define_method(key) {
22
- remote_call(:get_preference, key)
23
- }
24
- } if false
25
20
  def initialize(session)
26
- puts "BBMB::Html::Util::KnownUser.new object_id is #{self.object_id} SBSM::Session ? #{self.is_a? SBSM::Session} auth_session is #{session.class}"
27
21
  @auth_session = session.auth_session
28
- # puts "backtrace #{caller.join("\n")}"
29
- # @auth_session.auth.allowed?('edit', 'yus.entities')
30
22
  end
31
23
  def allowed?(action, key=nil)
32
24
  if @auth_session
@@ -34,18 +26,7 @@ class KnownUser < SBSM::User
34
26
  return @auth_session.remote_call(:allowed?, action, key)
35
27
  end
36
28
  SBSM.debug('User ' + sprintf('allowed?(%s, %s)', action, key))
37
- if defined?(yus_user) && yus_user
38
- allowed = yus_user.send(:allowed?, action, key)
39
- end if false
40
29
  return true
41
- # SBSM.debug('User'+ sprintf('allowed?(%s, %s) -> %s', action, key, allowed))
42
- return allowed
43
- # session.rb:25:in `login' BBMB::Html::Util::Session login claude.meier@gmx.net 5972659ce6c7f9b2356c0e650c7c40a3
44
- allowed = remote_call(:allowed?, action, key)
45
- SBSM.debug('User') {
46
- sprintf('%s: allowed?(%s, %s) -> %s', name, action, key, allowed)
47
- }
48
- allowed
49
30
  rescue => error
50
31
  puts error
51
32
  puts error.backtrace.join("\n")
@@ -55,7 +36,6 @@ class KnownUser < SBSM::User
55
36
  && (entity = @auth_session.find_entity(email)) && entity.valid?)
56
37
  end
57
38
  def navigation
58
- puts "BBMB::Html::Util::KnownUser navigation returning [ :logout ]"
59
39
  [ :logout ]
60
40
  end
61
41
  def get_preference(key)
@@ -76,7 +56,6 @@ class KnownUser < SBSM::User
76
56
  puts error
77
57
  puts error.backtrace.join("\n")
78
58
  end
79
- # alias :method_missing :remote_call
80
59
  end
81
60
  end
82
61
  end
@@ -6,7 +6,6 @@ module BBMB
6
6
  module View
7
7
  class NavigationLink < HtmlGrid::Link
8
8
  def init
9
- puts "NavigationLink unless #{@session.event} == #{@name}"
10
9
  unless(@session.event == @name)
11
10
  self.href = @lookandfeel._event_url(@name)
12
11
  end
@@ -26,11 +26,11 @@ module BBMB
26
26
  module Util
27
27
  class Server
28
28
  def initialize(persistence, app)
29
- puts "Self #{self.class} initialize"
30
29
  @persistence = persistence
31
30
  @app = app
32
31
  end
33
32
  def invoice(range)
33
+ SBSM.info "invoice started at #{Time.now} for #{range}"
34
34
  Invoicer.run(range)
35
35
  rescue Exception => e
36
36
  Mail.notify_error(e)
@@ -47,7 +47,6 @@ module BBMB
47
47
  @app.rename_user(old_name, new_name)
48
48
  end
49
49
  def run_invoicer
50
- SBSM.debug("run_invoicer starting")
51
50
  @invoicer ||= Thread.new {
52
51
  Thread.current.abort_on_exception = true
53
52
  loop {
@@ -57,19 +56,16 @@ module BBMB
57
56
  now = Time.now
58
57
  at = Time.local(day.year, day.month)
59
58
  secs = at - now
60
- SBSM.debug("invoicer") {
61
- "sleeping %.2f seconds" % secs
62
- }
59
+ msg = "run_invoicer sleeping %.2f seconds (or more than %d days)" % [ secs, secs/3600/24 ]
60
+ SBSM.debug(msg)
63
61
  sleep(secs)
64
- SBSM.debug("invoice starting")
65
62
  invoice(start...at)
66
- SBSM.debug("invoice finished")
67
63
  }
68
64
  }
69
65
  end
70
66
  def run_updater
71
67
  run_only_once_at_startup = false
72
- SBSM.debug("updater") { "run_updater run_only_once_at_startup? #{run_only_once_at_startup} " }
68
+ SBSM.debug("run_only_once_at_startup? #{run_only_once_at_startup} hour: #{BBMB.config.update_hour}")
73
69
  @updater ||= Thread.new {
74
70
  loop {
75
71
  day = Date.today
@@ -79,9 +75,8 @@ module BBMB
79
75
  end
80
76
  at = Time.local(day.year, day.month, day.day, BBMB.config.update_hour)
81
77
  secs = at - now
82
- SBSM.debug("updater") { "sleeping %.2f seconds. run_only_once_at_startup #{run_only_once_at_startup}" % secs }
78
+ SBSM.debug("updater sleeping %.2f seconds. run_only_once_at_startup #{run_only_once_at_startup}" % secs)
83
79
  if run_only_once_at_startup then puts "Skipped sleeping #{secs}" else sleep(secs) end
84
-
85
80
  SBSM.debug("update starting")
86
81
  update
87
82
  SBSM.debug("update finished")
@@ -101,13 +96,12 @@ module BBMB
101
96
  [ File.join(Dir.pwd, 'etc', 'config.yml'),
102
97
  ].each do |config_file|
103
98
  if File.exist?(config_file)
104
- puts "BBMB.config.load from #{config_file}"
99
+ SBSM.info "BBMB.config.load from #{config_file}"
105
100
  BBMB.config.load (config_file)
106
101
  break
107
102
  end
108
103
  end
109
104
  @auth = DRb::DRbObject.new(nil, BBMB.config.auth_url)
110
- puts "@auth is #{@auth} from #{self.class}"
111
105
  @app = app
112
106
  super(app: app,
113
107
  session_class: BBMB::Html::Util::Session,
data/lib/bbmb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.1.5'
2
+ VERSION = '2.1.6'
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.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger