card-mod-account 0.13.1 → 0.14.0

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: 30fe51b85306cfeb947b62ada48300c7373ae1b9e230daed93dcdba3f8ef807f
4
- data.tar.gz: 85f9abc4fbbf73d3224d3ae174e915b0baa73987856d0a37e5453a10885ff52f
3
+ metadata.gz: 638211a7127079ff602776727beb2cf6cb326070d0925ded7c40e60d57d599b1
4
+ data.tar.gz: c5277ae363de992d247b7f1f0093f81709cfed224f8529699478e77ab0cfc36b
5
5
  SHA512:
6
- metadata.gz: ffbbfd5d34dd47d15f9f0c42c5d2e628679fedfcf5cae5c12f588c9722aab7366815e8913c8a67269aec50be6568adef99a768670479c07d4670cab72ce59542
7
- data.tar.gz: 1562716c63f91d49256b310c08ae5443e5c4d48beb7d2ccf8558a559a04ddd86919d47517f9af2285232c69614697c5b9cae16e26d3a5daea841cd415ea8009d
6
+ metadata.gz: e0505e91a086cfd6d4e6f65358440e24d36e102cbdd4da67e5112811f3b13cad7efd5408505010b19a2569278457f4f98badc6299fda47655e417069ced9c36b
7
+ data.tar.gz: 1ae8cffb4c6ba7a55b6a4214963e2d29c52da4d19d41ecec0156701ecf3c6001d691ee5038b0bba3aa2927a79e4099c7771b3ff83fd56713c574ca50e3051aa3
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/locales/en.yml ADDED
@@ -0,0 +1,31 @@
1
+ en:
2
+ account_check_email: Check your email for a link to reset your password
3
+ account_deny_email_restricted: viewing email is restricted to administrators and account holders
4
+ account_deny_not_change_own_account: change the status of your own account
5
+ account_email_missing: email can't be blank
6
+ account_encrypted: encrypted
7
+ account_error_blank: can't be blank
8
+ account_error_invalid_address: must be valid address
9
+ account_error_not_active: Sorry, that account is not active.
10
+ account_error_not_recognized: not recognized
11
+ account_error_not_unique: must be unique
12
+ account_error_token_expired: expired token
13
+ account_error_unknown_email: Unrecognized email.
14
+ account_error_wrong_password: Wrong password
15
+ account_exception_bad_expiration: illegal expiration value (eg '%{example}')
16
+ account_forgot_password: Forgot Password
17
+ account_invite: Invite
18
+ account_missing_account: "ERROR: signup card missing account"
19
+ account_or_sign_up: '...or sign up!'
20
+ account_password_length: must be at least 4 characters
21
+ account_password_missing: password can't be blank
22
+ account_private_data: Private data
23
+ account_reset_my_password: Reset my password
24
+ account_reset_password: RESET PASSWORD
25
+ account_search_email_duplicate: email duplicate? (%{content})
26
+ account_sign_in: Sign in
27
+ account_sign_in_title: Sign In
28
+ account_sign_out: Sign out
29
+ account_sign_up: Sign up
30
+ account_sorry_email_reset:
31
+ Sorry, %{error_msg}. Please check your email for a new password reset link.
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
 
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/right/status.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  include_set Abstract::AccountField
2
2
  include_set Abstract::Pointer
3
3
 
4
- def input_type
5
- :radio
4
+ format :html do
5
+ def input_type
6
+ :radio
7
+ end
6
8
  end
7
9
 
8
10
  def option_names
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.1
4
+ version: 0.14.0
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-08-06 00:00:00.000000000 Z
13
+ date: 2021-12-22 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.1
21
+ version: 1.104.0
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.1
28
+ version: 1.104.0
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.1
35
+ version: 0.14.0
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.1
42
+ version: 0.14.0
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.1
49
+ version: 0.14.0
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.1
56
+ version: 0.14.0
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.1
63
+ version: 0.14.0
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.1
70
+ version: 0.14.0
71
71
  description: ''
72
72
  email:
73
73
  - info@decko.org
@@ -76,6 +76,8 @@ extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
78
  - README.md
79
+ - locales/de.yml
80
+ - locales/en.yml
79
81
  - set/abstract/account_field.rb
80
82
  - set/abstract/accountable.rb
81
83
  - set/all/account.rb
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  - !ruby/object:Gem::Version
121
123
  version: '0'
122
124
  requirements: []
123
- rubygems_version: 3.1.6
125
+ rubygems_version: 3.2.15
124
126
  signing_key:
125
127
  specification_version: 4
126
128
  summary: Email-based account handling for decko cards