card-mod-account 0.13.3 → 0.14.2

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
  SHA256:
3
- metadata.gz: 8a6c9bf78d8f4a19df6661d0e99a6ccec12c08c712a341aee95afd8ae0eef101
4
- data.tar.gz: 2b9c11f0d7808f2a463e6643942626c9965efcc3a445ead0dc0303c919e71627
3
+ metadata.gz: adc87bf8c7fbcd353a929064f4f624b62c82d2bd832f14bc117f51932904d508
4
+ data.tar.gz: 8c6ec9b150b12be1d4d2d4af7cfc707aa75717dbac5410ceccf0ae723392469d
5
5
  SHA512:
6
- metadata.gz: b3956e654f686ce6187c452828c27194ac2ca6f678dd0c8c27e0e21a2c1ef467625a79b5a2edfc135d70ed9fac8844555cd76e92cbf8a242b3df63134691e7fd
7
- data.tar.gz: 8c955a69f593fa6dac36bde94354dac1f9765afbf4704b7f2572e9b7378d3a37158cdc821143c20e87423530589ce1f26984b2032cbf8f204ceb8f98b337f8d0
6
+ metadata.gz: 4e310f6dd5ebe29872f2b8a851a853966b172ffd43c191f42ee95e1a80862f19bf39f1889d2bf0dc533e60550bec7bb929cf2e150c4bbeac5387c114d9cd4b6d
7
+ data.tar.gz: 6434b7b07a78fdba72e11dcb9e53e86e13f4b973fe1d059c30010989db062d4055f309791b0574c9139108715744bef1e4c765e660f5d5bc039adef0d36ba7e4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  # @title README - mod: account
3
3
  -->
4
- # account
4
+ # Account mod
5
5
 
6
6
  Create and manage accounts with cards.
data/locales/de.yml ADDED
@@ -0,0 +1,114 @@
1
+ :account:
2
+ set:
3
+ right:
4
+ account:
5
+ events:
6
+ sorry_email_reset: Entschuldigung, %{error_msg}. Please check your email for a new password reset link.
7
+ email:
8
+ error_invalid_address: ungültige Adresse
9
+ search_email_duplicate: E-Mail-Duplikat? (%{content})
10
+ error_not_unique: existiert bereits
11
+ deny_email_restricted: E-Mail-Adresse ist nur für Administratoren und den Accountinhaber sichtbar
12
+ password:
13
+ encrypted: verschlüsselt
14
+ password_length: mindestens 4 Zeichen
15
+ salt:
16
+ private_data: Private data
17
+ stats:
18
+ field: Field
19
+ cache_value: Cache Val
20
+ db_value: Database Val
21
+ cache_db_compare: Cache/DB Comparison
22
+ cached_card: Cached Card Inspect
23
+ db_card: Database Card Inspect
24
+ status:
25
+ deny_not_change_own_account: Du bist nicht berechtigt den Status deines eigenen Accounts zu ändern.
26
+ api_key:
27
+ private_data: Private data
28
+ error_token_not_found: kein Token gefunden
29
+ error_token_expired: Token abgelaufen
30
+ error_incorrect_token: Token passt nicht
31
+ exception_bad_expiration: ungültiger Wert für Ablaufdatum (z.B. '%{example}')
32
+ self:
33
+ account_links:
34
+ sign_up: Registrieren
35
+ sign_in: Anmelden
36
+ invite: Einladen
37
+ sign_out: Abmelden
38
+ signin:
39
+ sign_in_title: Anmelden
40
+ sign_in: Anmelden
41
+ or_sign_up: '...oder registrieren!'
42
+ reset_password: PASSWORT ZURÜCKSETZEN
43
+ forgot_password: Passwort vergessen
44
+ reset_my_password: Setze mein Passwort zurück
45
+ check_email: Sie erhalten in Kürze eine E-Mail mit einem Link um ihr Passwort zurück zu setzen.
46
+ error_unknown_email: Unbekannte E-Mail-Adresse.
47
+ error_not_active: Entschuldigung, der Account ist nicht aktiviert.
48
+ error_wrong_password: Falsches Passwort
49
+ error_blank: fehlt
50
+ email_missing: E-Mail-Addresse fehlt
51
+ password_missing: Passwort fehlt
52
+ error_not_active: nicht aktiviert
53
+ error_not_recognized: unbekannt
54
+ type:
55
+ signup:
56
+ views:
57
+ sign_up: Registrieren
58
+ invite: Einladen
59
+ missing_account: "ERROR: Signup-Karte ohne Account"
60
+ send_invite: Sende Einladung
61
+ first_last_help: üblicherweise Vor- und Nachname
62
+ signed_up_on: "%{name} hat sich registriert am %{date}"
63
+ was_signed_up_on: "%{name} wurde registriert am %{date}"
64
+ send: Senden
65
+ resend: Wieder senden
66
+ verification: Eine E-Mail zur Verifikation wurde verschickt.
67
+ verification_to: Eine E-Mail zur Verifikation wurde gesendet an %{email}.
68
+ action_verify_email: "%{action} Verifikations-E-Maill"
69
+ approve_without: Akzeptieren ohne Verifikation
70
+ deny_delete: Ablehnen und löschen
71
+ field_manip_abort: keine Feldänderungen während der Aktivierung
72
+ no_account_abort: kein Account verknüpft mit %{name}
73
+ illegal_approval_abort: ungültige Genehmigung
74
+ check_email_reset: Please check your email for a new password reset link.
75
+ errors_message: Sorry, %{item}. %{message}
76
+ user:
77
+ help_first_last: üblicherweise Vor- und Nachname
78
+ welcome: Willkommen, Decker!
79
+ get_started: Um loszulegen, erstelle einen Account.
80
+ email_off: "WARNING: E-Mail-Versand ist deaktiviert. Ändere die Einstellung in %{path} um bei neuen Registrierungen Benachrichtigungen zu senden."
81
+ set_up: Anlegen
82
+ setting_up: Lege an
83
+
84
+ de:
85
+ account_check_email: Prüfen Sie Ihre E-Mail auf einen Link zum Zurücksetzen Ihres Passworts
86
+ account_deny_email_restricted: E-Mail-Adresse ist nur für Administratoren und Kontoinhaber
87
+ account_deny_not_change_own_account: den Status des eigenen Kontos ändern
88
+ account_email_missing: E-Mail darf nicht frei bleiben
89
+ account_encrypted: verschlüssel
90
+ account_error_blank: darf nicht frei bleiben
91
+ account_error_invalid_address: muss eine gültige Adresse sein
92
+ account_error_not_active: Sorry, dieses Konto ist nicht aktiviert
93
+ account_error_not_recognized: unbekannt
94
+ account_error_not_unique: muss eindeutig sein
95
+ account_error_token_expired: abgelaufenes Token
96
+ account_error_unknown_email: unbekannte E-Mail-Adresse
97
+ account_error_wrong_password: Falsches Passwort
98
+ account_exception_bad_expiration: unzulässiger Verfallswert (z.B. '%{example}')
99
+ account_forgot_password: Passwort vergessen
100
+ account_invite: Einladen
101
+ account_missing_account: "FEHLER: Registrierkarte ohne Konto"
102
+ account_or_sign_up: '...oder registrieren!'
103
+ account_password_length: muss mindestens 4 Zeichen lang sein
104
+ account_password_missing: Passwort muss angegeben werden
105
+ account_private_data: Private Daten
106
+ account_reset_my_password: Passwort zurücksetzen
107
+ account_reset_password: PASSWORT ZURÜCKSETZEN
108
+ account_search_email_duplicate: E-Mail-Duplikat? (%{content})
109
+ account_sign_in: Anmelden
110
+ account_sign_in_title: Anmelden
111
+ account_sign_out: Abmelden
112
+ account_sign_up: Registrieren
113
+ account_sorry_email_reset:
114
+ Sorry, %{error_msg}. Bitte prüfen Sie Ihre E-Mail auf einen neuen Link zum Zurücksetzen des Passworts.
data/set/all/account.rb CHANGED
@@ -48,18 +48,18 @@ def clear_roles
48
48
  @parties = @all_roles = @all_active_roles = @read_rules = nil
49
49
  end
50
50
 
51
- def with_clear_roles
52
- a = @parties
53
- b = @all_roles
54
- c = @all_active_roles
55
- d = @read_rules
56
- yield
57
- ensure
58
- @parties = a
59
- @all_roles = b
60
- @all_active_roles = c
61
- @read_rules = d
62
- end
51
+ # def with_clear_roles
52
+ # a = @parties
53
+ # b = @all_roles
54
+ # c = @all_active_roles
55
+ # d = @read_rules
56
+ # yield
57
+ # ensure
58
+ # @parties = a
59
+ # @all_roles = b
60
+ # @all_active_roles = c
61
+ # @read_rules = d
62
+ # end
63
63
 
64
64
  def all_enabled_roles
65
65
  @all_active_roles ||= (id == AnonymousID ? [] : enabled_role_ids)
@@ -1,11 +1,11 @@
1
1
  #### ON CREATE
2
2
 
3
3
  event :set_default_salt, :prepare_to_validate, on: :create do
4
- add_subfield(:salt).generate
4
+ subfield(:salt).generate
5
5
  end
6
6
 
7
7
  event :set_default_status, :prepare_to_validate, on: :create do
8
- add_subfield :status, content: (accounted&.try(:default_account_status) || "active")
8
+ subfield :status, content: (accounted&.try(:default_account_status) || "active")
9
9
  end
10
10
 
11
11
  # ON UPDATE
@@ -19,7 +19,7 @@ end
19
19
  event :verify_and_activate, :prepare_to_validate, on: :update, trigger: :required do
20
20
  activatable do
21
21
  verifying_token :verify_and_activate_success, :verify_and_activate_failure
22
- add_subcard(accounted)&.try :activate_accounted
22
+ subcard(accounted)&.try :activate_accounted
23
23
  end
24
24
  end
25
25
 
@@ -47,7 +47,7 @@ end
47
47
  # NOTE: this only works in the context of an action.
48
48
  # if run independently, it will not activate an account
49
49
  event :activate_account do
50
- add_subfield :status, content: "active"
50
+ subfield :status, content: "active"
51
51
  trigger_event! :send_welcome_email
52
52
  end
53
53
 
@@ -8,10 +8,7 @@ def ok_to_read
8
8
  own_account? || super
9
9
  end
10
10
 
11
- event :encrypt_password, :store,
12
- on: :save, changed: :content,
13
- when: proc { !Card::Env[:no_password_encryptions] } do
14
- # no_password_encryptions = hack for import - fix with api for ignoring events
11
+ event :encrypt_password, :store, on: :save, changed: :content do
15
12
  salt = left&.salt
16
13
  self.content = Auth.encrypt content, salt
17
14
 
data/set/right/roles.rb CHANGED
@@ -19,7 +19,7 @@ def with_old_role_permissions
19
19
  new_roles = item_cards
20
20
  new_content = content
21
21
  left.clear_roles
22
- Auth.update_always_cache Card::Auth.as_id, nil
22
+ Auth.update_always_cache nil
23
23
  self.content = db_content_before_act
24
24
  yield new_roles
25
25
  ensure
data/set/self/signin.rb CHANGED
@@ -8,12 +8,7 @@
8
8
 
9
9
  # authentication event
10
10
  event :signin, :validate, on: :update do
11
- email = subfield :email
12
- email &&= email.content
13
- pword = subfield :password
14
- pword &&= pword.content
15
-
16
- authenticate_or_abort email, pword
11
+ authenticate_or_abort subfield_content(:email), subfield_content(:password)
17
12
  end
18
13
 
19
14
  # abort after successful signin (do not save card)
@@ -36,7 +31,7 @@ event :send_reset_password_token, before: :signin, on: :update, trigger: :requir
36
31
  end
37
32
 
38
33
  def email_from_subfield
39
- @email_from_subfield ||= subfield(:email)&.content
34
+ @email_from_subfield ||= subfield_content(:email)
40
35
  end
41
36
 
42
37
  def ok_to_read
@@ -206,7 +201,7 @@ format :html do
206
201
  end
207
202
 
208
203
  def signin_field name
209
- nest_name = "".to_name.trait(name)
204
+ nest_name = "".to_name.field(name)
210
205
  [nest_name, { title: name.to_s, view: "titled",
211
206
  nest_name: nest_name, skip_perms: true }]
212
207
  end
data/set/type/signup.rb CHANGED
@@ -26,7 +26,7 @@ event :approve_without_verification, :validate, on: :update, trigger: :required
26
26
  # TODO: if validated here, add trigger and activate in storage phase
27
27
  approvable do
28
28
  activate_accounted
29
- account_subfield.activate_account
29
+ subfield(:account).activate_account
30
30
  end
31
31
  end
32
32
 
@@ -35,20 +35,12 @@ event :act_as_current_for_integrate_stage, :integrate, on: :create do
35
35
  Auth.current_id = id
36
36
  end
37
37
 
38
- def account_subfield
39
- subfield(:account) || add_subfield(:account)
40
- end
41
-
42
38
  def request_verification
43
- acct = account_subfield
44
- acct.add_subfield :status, content: "unverified"
39
+ acct = subfield :account
40
+ acct.subfield :status, content: "unverified"
45
41
  acct.trigger_event! :send_verification_email
46
42
  end
47
43
 
48
44
  def approvable
49
- if can_approve?
50
- yield
51
- else
52
- abort :failure, "illegal approval" # raise permission denied?
53
- end
45
+ can_approve? ? yield : abort(:failure, "illegal approval") # raise permission denied?
54
46
  end
data/set/type/user.rb CHANGED
@@ -54,8 +54,8 @@ event :setup_as_bot, before: :check_permissions, on: :create, when: :setup? do
54
54
  end
55
55
 
56
56
  event :setup_first_user, :prepare_to_store, on: :create, when: :setup? do
57
- add_subcard "signup alert email+*to", content: name
58
- add_subfield :roles, content: roles_for_first_user
57
+ subcard "signup alert email+*to", content: name
58
+ subfield :roles, content: roles_for_first_user
59
59
  end
60
60
 
61
61
  def roles_for_first_user
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-account
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-09-24 00:00:00.000000000 Z
13
+ date: 2022-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.103.3
21
+ version: 1.104.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.103.3
28
+ version: 1.104.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-email
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.13.3
35
+ version: 0.14.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.13.3
42
+ version: 0.14.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-permissions
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.13.3
49
+ version: 0.14.2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.13.3
56
+ version: 0.14.2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: card-mod-list
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.13.3
63
+ version: 0.14.2
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.13.3
70
+ version: 0.14.2
71
71
  description: ''
72
72
  email:
73
73
  - info@decko.org
@@ -76,6 +76,7 @@ extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
78
  - README.md
79
+ - locales/de.yml
79
80
  - locales/en.yml
80
81
  - set/abstract/account_field.rb
81
82
  - set/abstract/accountable.rb
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.1.6
125
+ rubygems_version: 3.2.15
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Email-based account handling for decko cards