view · edit · sidebar · attach · print · history

20101111-setup-eshop update-customer-data


  1. Confirm login with admin and customer account
  2. Update customer data in local
  3. Test login with a new customer account
  4. Trace the error message
  5. Summarize how to update customer data

Goal
  • Setup E-Shop / 70%
Milestones
  1. Confirm login with admin and customer account
  2. Login process, Resolve customer_order page, start page in the case of ch.bbmb.Customer privilege
    • Test update customer data locally 11:15 success
    • Test login with a new customer yus account 11:30 fail
    • Trace the error message
    • Summarize updating customer data
  3. How to delete customer data?
Summary
Commits
ToDo Tomorrow
  • Make a set-up script
Attached Files

Confirm login with admin and customer account

Boot bbmb and yus

masa@masa ~/ywesee/bbmb $ bin/bbmbd config="config.yml" 
masa@masa ~/ywesee/yus $ bin/yusd server_url="druby://localhost:12001"

Check yus account

masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" mhatakeyama@ywesee.com
Password for mhatakeyama@ywesee.com: 
["mhatakeyama@ywesee.com",
 ["edit", [["yus.entities"]]],
 ["edti", [["yus.entities"]]],
 ["grant",
  [["create"], ["credit"], ["edit"], ["invoice"], ["login"], ["view"]]],
 ["login",
  [["ch.bbmb.Admin"],
   ["org.oddb.RootUser"],
   ["org.oddb.de.Admin"],
   ["org.oddb.de.PowerUser"]]],
 ["reset_password", []],
 ["set_password", [["mhatakeyama@ywesee.com"]]],
 ["view", [["org.oddb.de"]]],
 ["RootUser"]]

Confirm login with ch.bbmb.Admin

Change yus grant

masa@masa ~/ywesee/yus $ bin/yus_grant --server_url="druby://localhost:12001" --revoke mhatakeyama@ywesee.com login ch.bbmb.Admin
Password for mhatakeyama@ywesee.com: 
revokeed permission to login ch.bbmb.Admin for mhatakeyama@ywesee.com from 
masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" mhatakeyama@ywesee.com
Password for mhatakeyama@ywesee.com: 
["mhatakeyama@ywesee.com",
 ["edit", [["yus.entities"]]],
 ["edti", [["yus.entities"]]],
 ["grant",
  [["create"], ["credit"], ["edit"], ["invoice"], ["login"], ["view"]]],
 ["login",
  [["org.oddb.RootUser"], ["org.oddb.de.Admin"], ["org.oddb.de.PowerUser"]]],
 ["reset_password", []],
 ["set_password", [["mhatakeyama@ywesee.com"]]],
 ["view", [["org.oddb.de"]]],
 ["RootUser"]]
masa@masa ~/ywesee/yus $ bin/yus_grant --server_url="druby://localhost:12001" mhatakeyama@ywesee.com login ch.bbmb.Customer
Password for mhatakeyama@ywesee.com: 
granted permission to login ch.bbmb.Customer for mhatakeyama@ywesee.com until 
masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" mhatakeyama@ywesee.com
Password for mhatakeyama@ywesee.com: 
["mhatakeyama@ywesee.com",
 ["edit", [["yus.entities"]]],
 ["edti", [["yus.entities"]]],
 ["grant",
  [["create"], ["credit"], ["edit"], ["invoice"], ["login"], ["view"]]],
 ["login",
  [["ch.bbmb.Customer"],
   ["org.oddb.RootUser"],
   ["org.oddb.de.Admin"],
   ["org.oddb.de.PowerUser"]]],
 ["reset_password", []],
 ["set_password", [["mhatakeyama@ywesee.com"]]],
 ["view", [["org.oddb.de"]]],
 ["RootUser"]]

No reboot bbmbd and yusd

Confirm login with ch.bbmb.Customer

bbmb error log

"BBMB::Html::Viral::Customer#_customer"
@session.user.name="mhatakeyama@ywesee.com"
Model::Customer.find_by_email(@session.user.name)=nil
error in SBSM::Session#process: /de
NoMethodError
undefined method `current_order' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:406:in `process'
/home/masa/ywesee/bbmb/lib/bbmb/html/util/session.rb:45:in `process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:173:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'
"BBMB::Html::Viral::Customer#_customer"
@session.user.name="mhatakeyama@ywesee.com"
Model::Customer.find_by_email(@session.user.name)=nil
error in SBSM::Session#process: /de/current_order/
NoMethodError
undefined method `current_order' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:406:in `process'
/home/masa/ywesee/bbmb/lib/bbmb/html/util/session.rb:45:in `process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:173:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'
error in SBSM::Session#to_html: /de/current_order/
NoMethodError
undefined method `empty?' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/view/current_order.rb:438:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `new'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `__standard_component'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:54:in `content'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:141:in `send'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:141:in `create'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:33:in `compose'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:13:in `each'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:13:in `compose'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:272:in `new'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:272:in `view'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:192:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:496:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/redirector.rb:33:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:174:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `drb_process'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'
/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'
/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'
bin/bbmbd:51
BBMB::Html::View::CurrentOrder::COMPONENTS[[0, 1]] in create(content)
error in SBSM::Session#http_headers: /de/current_order/
NoMethodError
undefined method `empty?' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/view/current_order.rb:438:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `new'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `__standard_component'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:54:in `content'

Notes

  • This is just the result confirmation yesterday

Update customer data in local

Preparation

config.yml

---
error_recipients:
 - mhatakeyama@ywesee.com
bbmb_dir: /home/masa/ywesee/bbmb
db_name: xxxxxx_bbmb
db_user: xxxxxx
db_pass: xxxxxx
importers:
 "Kunden.txt": "CustomerImporter"
load_files:
 - 'bbmb/util/csv_importer'
log_level: DEBUG
mail_order_to: mhatakeyama@ywesee.com
mail_order_from: mhatakeyama@ywesee.com
name: "Bbmb(Masa)"
smtp_server: mail.ywesee.com
smtp_authtype: :plain
smtp_user: 'mhatakeyama@ywesee.com'
smtp_pass: passwd
target_format: csv
inject_error_body: |
  inject_error_body
inject_error_subject: 'Bestellung "%s" mit fehlendem Kunden: "%s"'
inject_error_from: 'mhatakeyama@ywesee.com'
inject_error_to: 'mhatakeyama@ywesee.com'
mail_confirm_from: 'mhatakeyama@ywesee.com'
mail_confirm_reply_to: 'mhatakeyama@ywesee.com'
mail_confirm_subject: "Masa: Auftragsbestätigung %s"
mail_confirm_lines:
 - "%3i x %-40s à %6.2f, total  %7.2f"
 - "%3i x %-40s à %6.2f, total  %7.2f"
 - "%3i x %-40s a %6.2f, totale %7.2f"
mail_confirm_body: |
  mail_confirm_body
confirm_error_body: |
  confirm_error_body
confirm_error_subject: Kunde "%s" ohne hinterlegte Email-Adresse im Masa E-shop
confirm_error_from: 'mhatakeyama@ywesee.com'
confirm_error_to: 'mhatakeyama@ywesee.com'

invoice?: false
update?: true
new_customer_mail: "mailto:mhatakeyama@ywesee.com?subject=Neukunde BBMB - bitte Passwort generieren"
polling_file: '/home/masa/ywesee/bbmb/etc/polling.yml'

lib/bbmb/util/server.rb

      def run_updater
        @updater ||= Thread.new {
          loop {
            day = Date.today
            now = Time.now
            if(now.hour >= BBMB.config.update_hour)
              day += 1
            end
            at = Time.local(day.year, day.month, day.day,
#                            BBMB.config.update_hour)
                            now.hour, now.min+1)
print "at="
p at
print "now="
p now
            secs = at - now
            BBMB.logger.debug("updater") {
              "sleeping %.2f seconds" % secs
            }
            sleep(secs)
            update
          }
        }
      end

Put Kunden.txt data

masa@masa ~/ywesee/bbmb $ ls data/
Kunden.txt

Put polling.yml file

masa@masa ~/ywesee/bbmb $ cat etc/polling.yml 
--- !ruby/object:BBMB::Util::FileMission 
backup_dir: var/backup
directory: data
glob_pattern: *.txt
delete: false

Start bbmbd

masa@masa ~/ywesee/bbmb $ bin/bbmbd config="config.yml" 
...
at=Thu Nov 11 09:39:00 +0100 2010
now=Thu Nov 11 09:38:11 +0100 2010
I, [2010-11-11T09:38:11.979565 #12915]  INFO -- start: starting bbmb-server on druby://localhost:12000
D, [2010-11-11T09:38:11.979619 #12915] DEBUG -- updater: sleeping 48.02 seconds

Result

at=Thu Nov 11 10:46:00 +0100 2010
now=Thu Nov 11 10:45:50 +0100 2010
I, [2010-11-11T10:45:50.130845 #14361]  INFO -- start: starting bbmb-server on druby://localhost:12000
D, [2010-11-11T10:45:50.130897 #14361] DEBUG -- updater: sleeping 9.87 seconds
"getin BBSB::Util::Server#update"
"getin BBMB::Util::Updater#run"
"getin PollingManager.poll_sources"
"getin PollingManager.load_sources"
BBMB.config.polling_file="/home/masa/ywesee/bbmb/etc/polling.yml"
filename="Kunden.txt"
"getin BBMB::Util::Updater#import"
importer="CustomerImporter"
klass=BBMB::Util::CustomerImporter
args=[]
count=2
D, [2010-11-11T10:46:00.010835 #14361] DEBUG -- updater: CustomerImporter imported 2 entities
"done update"

New file

masa@masa ~/ywesee/bbmb $ ls var/backup  -al
insgesamt 4
drwxr-xr-x 2 masa masa  32 11. Nov 10:47 .
drwxr-xr-x 3 masa masa   8 11. Nov 10:46 ..
-rw-r--r-- 1 masa masa 326 11. Nov 10:46 Kunden.txt

Notes

  • Looks done updating
  • No report email comes

Memo

  • apache error_log
[Thu Nov 11 09:22:11 2010] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8n mod_ruby/1.3.0 Ruby/1.8.6(2009-06-08) configured -- resuming normal operations
[Thu Nov 11 08:12:34 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/bbmb/etc/trans_handler.yml
[Thu Nov 11 08:12:34 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml

Question

  • How to delete customer data from database?

Test login with a new customer account

Create a new customer yus account

masa@masa ~/ywesee/yus $ bin/yus_add_user --server_url="druby://localhost:12001" aaa@bbb.com
bin/yus_add_user:18: warning: multiple values for a block parameter (2 for 1)
        from /usr/lib64/ruby/1.8/getoptlong.rb:613
Password for mhatakeyama@ywesee.com: 
New Password for aaa@bbb.com
Repeat Password for aaa@bbb.com

masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" aaa@bbb.com
Password for mhatakeyama@ywesee.com: 
["aaa@bbb.com",
 ["set_password", [["aaa@bbb.com"]]]]

masa@masa ~/ywesee/yus $ bin/yus_grant --server_url="druby://localhost:12001" aaa@bbb.com login ch.bbmb.Customer
Password for mhatakeyama@ywesee.com: 
granted permission to login ch.bbmb.Customer for aaa@bbb.com until 

masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" aaa@bbb.com
Password for mhatakeyama@ywesee.com: 
["aaa@bbb.com",
 ["login", [["ch.bbmb.Customer"]]],
 ["set_password", [["aaa@bbb.com"]]]]

Set email on browser

Login with the new account as a ch.bbmb.Customer

Result

  • The same error

Trace the error message

Error log when login with a ch.bbmb.Customer account

"BBMB::Html::State::Login#login"
"BBMB::Html::Util::Session#login"
"getin login"
"BBMB::Html::State::Login#login"
"BBMB::Html::Util::Session#login"
"getin login"
D, [2010-11-11T11:48:11.907486 #15337] DEBUG -- User: aaa@bbb.com: allowed?(login, ch.bbmb.Admin) -> false
D, [2010-11-11T11:48:11.908146 #15337] DEBUG -- User: aaa@bbb.com: allowed?(login, ch.bbmb.Customer) -> true
"BBMB::Html::Viral::Customer#_customer"
@session.user.name="aaa@bbb.com"
Model::Customer.find_by_email(@session.user.name)=nil

error in SBSM::Session#process: /de
NoMethodError
undefined method `current_order' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:406:in `process'
/home/masa/ywesee/bbmb/lib/bbmb/html/util/session.rb:45:in `process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:173:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'
"BBMB::Html::Viral::Customer#_customer"

@session.user.name="aaa@bbb.com"
Model::Customer.find_by_email(@session.user.name)=nil

error in SBSM::Session#process: /de/current_order/
NoMethodError
undefined method `current_order' for nil:NilClass
/home/masa/ywesee/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:406:in `process'
/home/masa/ywesee/bbmb/lib/bbmb/html/util/session.rb:45:in `process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:173:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'

error in SBSM::Session#to_html: /de/current_order/
NoMethodError
undefined method `empty?' for #<SBSM::UnknownUser:0x7f7321b6aee0>
/home/masa/ywesee/bbmb/lib/bbmb/html/view/current_order.rb:438:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `new'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `__standard_component'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:54:in `content'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:141:in `send'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:141:in `create'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:33:in `compose'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:13:in `each'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/divcomposite.rb:13:in `compose'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:272:in `new'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:272:in `view'
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:192:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:496:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/redirector.rb:33:in `to_html'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:174:in `drb_process'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `drb_process'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'
/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'
/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'
bin/bbmbd:51

BBMB::Html::View::CurrentOrder::COMPONENTS[[0, 1]] in create(content)
error in SBSM::Session#http_headers: /de/current_order/
NoMethodError
undefined method `empty?' for #<SBSM::UnknownUser:0x7f7321b6aee0>
/home/masa/ywesee/bbmb/lib/bbmb/html/view/current_order.rb:438:in `init'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `new'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:67:in `__standard_component'
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb:54:in `content'

Focus on find_by_email method

Why

  • Model::Customer.find_by_email(@session.user.name)=nil
  • even though there is a customer information in the database

lib/bbmb/html/state/current_order.rb:20 NoMethodError undefined method `current_order' for nil:NilClass

  def init
    @model = _customer.current_order    #<= HERE
    @model.calculate_effective_prices
  end

lib/bbmb/html/state/viral/customer.rb

  def _customer
    @customer ||= Model::Customer.find_by_email(@session.user.name)
  end

Question

  • Why is BBMB::Html::State::Viral::Customer#_customer method called from BBMB::Html::State::CurrentOrder#init ?

lib/bbmb/html/view/current_order.rb:438 NoMethodError undefined method `empty?' for #<SBSM::UnknownUser:0x7f7321b6aee0>

  def init
    if(!@model.empty? || @lookandfeel.enabled?(:additional_info_first))
      components.store([1,2], CurrentOrderForm)
    end
    super
  end

Notes

  • This NoMethodError, empty? for SBSM::UnknownUser also comes probably from 'Model::Customer.find_by_email(@session.user.name)=nil'

Summarize how to update customer data

Davatz-san help Customer Login e-shop

The customer does not login via yus as far as I understand.
You have to click onto the button: "Passwort generieren" in the customer view:

http://dev.ywesee.com/uploads/$PageName//setemail.jpg

That will generate a Passwort. With that Password you can then login.
Of course you will also have to set an email-Address.

Procedure to add a customer account

Note

  • If there is alread an account in yus database, it is IMPOSSIBLE to add 'email' data from web browser
  • Before the updating of customer data, the account (email) data in yus database should be removed.
  • The system (ch.bbmb.Admin user) updates yus data automatically. You do not have to use yus admin commands (yus_add_user etc, yus_grant, etc.)
  • I have not known yet how to delete a customer account
  • bin/admin seems not completed. I cannot use it for updating.

1. Update customer data through Updater

  • Input the customer information in data/Kunden.txt
  • But this file can be set different in config.yml
  • Be careful the file format, the data is separated by 'tab'
  • If the format is wrong, the data might be imported without error message
9999  7601001380103 Masa  Herr  Hata  Masa  Apotheke zum ywesee GmbH    Winterthulstrasse 111 1111  Zürich  044 111 00 11 044 111 00 11

Note

  • email data cannot be set in this file.
  • The first number is customer code, and the second nummber is EAN code.
  • The EAN code should be correct number.

2. Run updater

  • The 'update?' flag in config.yml should be 'true'
  • As a default, the updater runs once a day

Note

  • At the moment, in order to run updater quickly as follows
  • But this is a temporary method. We should use bin/admin.

lib/bbmb/util/server.rb

      def run_updater
        @updater ||= Thread.new {
          loop {
            day = Date.today
            now = Time.now
            if(now.hour >= BBMB.config.update_hour)
              day += 1
            end
            at = Time.local(day.year, day.month, day.day,
#                            BBMB.config.update_hour)
                            now.hour, now.min+1)
print "at="
p at
print "now="
p now
            secs = at - now
            BBMB.logger.debug("updater") {
              "sleeping %.2f seconds" % secs
            }
            sleep(secs)
            update
p "done update"
            sleep(100000)
          }
        }
      end

3. Set email by a ch.bbmb.Admin user

Notes

  • There are two privileges for bbmb
    • ch.bbmb.Admin and ch.bbmb.Customer
  • In order to create ch.bbmb.Admin account, use yus_add_user, yus_grant command
$ bin/yus_add_user [email]
$ bin/yus_grant [email] login ch.bbmb.Admin
$ bin/yus_show [email]
  • If you have a mistake, use yus_delete_user or yus_grant --revoke commands
  • If the yus server url is different from the default, use the option --server_url like , --server_url="druby://localhost:12001"

Login by using a ch.bbmb.Admin account

Check yus account

masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" aaa@bbb.com
Password for mhatakeyama@ywesee.com: 
(druby://localhost:12001) /usr/lib64/ruby/site_ruby/1.8/yus/session.rb:160:in `find_or_fail': Unknown Entity 'aaa@bbb.com' (Yus::UnknownEntityError)
        from (druby://localhost:12001) /usr/lib64/ruby/site_ruby/1.8/yus/session.rb:358:in `show'
        from bin/yus_show:65

Set email address

Note

  • Then yus account is created automatically
masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" aaa@bbb.com
Password for mhatakeyama@ywesee.com: 
[u"aaa@bbb.com",
 ["set_password", [["aaa@bbb.com"]]]]

Notes

  • But ch.bbmb.Custmer grant is not yet set

4. Passwort Generieren

Push 'Passwort Generieren' button

Then the ch.bbmb.Customer privilege is added to the account

masa@masa ~/ywesee/yus $ bin/yus_show --server_url="druby://localhost:12001" aaa@bbb.com
Password for mhatakeyama@ywesee.com: 
[u"aaa@bbb.com",
 ["login", [["ch.bbmb.Customer"]]],
 ["set_password", [["aaa@bbb.com"]]]]

Note

  • The following message comes
  • Then if I put the password, I cannot set the password
  • I do not know why
  • I cannot change the password even by using yus command, yus_passwd
  • But I can delete the password by using yus command
masa@masa ~/ywesee/yus $ bin/yus_passwd --server_url="druby://localhost:12001" aaa@bbb.com
bin/yus_passwd:18: warning: multiple values for a block parameter (2 for 1)
        from /usr/lib64/ruby/1.8/getoptlong.rb:613
Password for mhatakeyama@ywesee.com: 
New Password for aaa@bbb.com: (Just enter)
Repeat Password for aaa@bbb.com: (Just enter)

5. Login by using the customer account

Then I can login without password as a customer

view · edit · sidebar · attach · print · history
Page last modified on July 07, 2014, at 10:06 AM