PluginProbe
Awesome Support – WordPress HelpDesk & Support Plugin / trunk
Awesome Support – WordPress HelpDesk & Support Plugin vtrunk
6.4.0 trunk 3.0.0 3.0.1 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 All 95 releases
awesome-support / includes / admin / settings / settings-registration.php

settings-registration.php in Awesome Support – WordPress HelpDesk & Support Plugin trunk, at includes/admin/settings/settings-registration.php

247 lines 11.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 add_filter( 'wpas_plugin_settings', 'wpas_core_settings_registration', 5, 1 );
3 /**
4 * Add plugin core settings for registration.
5 *
6 * @param array $def Array of existing settings
7 *
8 * @return array Updated settings
9 */
10 function wpas_core_settings_registration( $def ) {
11
12 $user_registration = boolval( get_option( 'users_can_register' ) );
13 $registration_lbl = ( true === $user_registration ) ? _x( 'allowed', 'User registration is allowed', 'awesome-support' ) : _x( 'not allowed', 'User registration is not allowed', 'awesome-support' );
14
15 // translators: %s is the registration text.
16 $desc = __( 'Allow users to register on the support page. This setting can be enabled even though the WordPress setting is disabled. Currently, registrations are %s by WordPress.', 'awesome-support' );
17
18 $settings = array(
19 'registration' => array(
20 'name' => __( 'Registration', 'awesome-support' ),
21 'options' => array(
22 array(
23 'name' => __( 'Registration', 'awesome-support' ),
24 'type' => 'heading',
25 ),
26
27 array(
28 'name' => __( 'Allow Registrations', 'awesome-support' ),
29 'id' => 'allow_registrations',
30 'type' => 'radio',
31 'desc' => sprintf( $desc, "<strong>$registration_lbl</strong>" ),
32 'default' => 'allow',
33 'options' => array(
34 'allow' => __( 'Allow registrations', 'awesome-support' ),
35 'disallow' => __( 'Disallow registrations', 'awesome-support' ),
36 'disallow_silent' => __( 'Disallow registrations without notice (just show the login form)', 'awesome-support' ),
37 'moderated' => __( 'Moderated registrations', 'awesome-support' ),
38 )
39 ),
40
41 array(
42 'name' => __( 'Registration Alerts', 'awesome-support' ),
43 'type' => 'heading',
44 'desc' => __( 'Who should receive the standard WordPress notifications when a new user registers on the site?', 'awesome-support' ),
45 ),
46 array(
47 'name' => __( 'Who Should Receive New User Notifications?', 'awesome-support' ),
48 'id' => 'reg_notify_users',
49 'type' => 'radio',
50 'options' => array( 'none' => __('No One','awesome-support'), 'user' => __('Only The Customer','awesome-support'), 'admin' => __('Only The Site Admin','awesome-support'), 'both' => __('Customer and Admin','awesome-support') ),
51 'default' => 'both,',
52 ),
53
54 array(
55 'name' => __( 'User Names', 'awesome-support' ),
56 'type' => 'heading',
57 'desc' => __( 'How should user names be determined?', 'awesome-support' ),
58 ),
59 array(
60 'name' => __( 'User Name Construction', 'awesome-support' ),
61 'id' => 'reg_user_name_construction',
62 'type' => 'radio',
63 'default' => 6,
64 'desc' => __( 'How should we construct the user name?', 'awesome-support' ),
65 'options' => array(
66 '0' => __( 'Default - Uses the first part of email address', 'awesome-support' ),
67 '1' => __( 'Use the entire email address', 'awesome-support' ),
68 '2' => __( 'Use a random number', 'awesome-support' ),
69 '3' => __( 'Use a GUID', 'awesome-support' ),
70 '4' => __( 'Use the first name', 'awesome-support' ),
71 '5' => __( 'Use the last name', 'awesome-support' ),
72 '6' => __( 'Concatenate the first and last name', 'awesome-support' ),
73 ),
74 ),
75
76 array(
77 'name' => __( 'Registration Field Descriptions', 'awesome-support' ),
78 'type' => 'heading',
79 'desc' => __( 'Add a description to each of the registration fields which will appear beneath the field. You can use this to add GDPR related information indicating what each field is used for.', 'awesome-support' ),
80 ),
81 array(
82 'name' => __( 'First name description', 'awesome-support' ),
83 'id' => 'reg_first_name_desc',
84 'type' => 'text',
85 'default' => '',
86 ),
87 array(
88 'name' => __( 'Last name description', 'awesome-support' ),
89 'id' => 'reg_last_name_desc',
90 'type' => 'text',
91 'default' => '',
92 ),
93 array(
94 'name' => __( 'Email address description', 'awesome-support' ),
95 'id' => 'reg_email_desc',
96 'type' => 'text',
97 'default' => '',
98 ),
99
100 array(
101 'name' => __( 'Other', 'awesome-support' ),
102 'type' => 'heading',
103 ),
104 array(
105 'name' => __( 'Default Role For New Users', 'awesome-support' ),
106 'id' => 'new_user_role',
107 'type' => 'text',
108 'desc' => __( 'The role should be the internal WordPress role id such as wpas_user and is case sensitive. Do not leave this blank! This role should have the 5 core Awesome Support capabilities in order for users to be able to submit tickets. Check our documentation for more information.', 'awesome-support' ),
109 'default' => 'wpas_user'
110 ),
111
112 )
113 ),
114 );
115
116 $gdpr_consent_options = array(
117 array(
118 'name' => __( 'GDPR Notice #1', 'awesome-support' ),
119 'type' => 'heading',
120 'desc' => __( 'The GDPR requires that you provide explicit notice about what you will do with the data you collect from users. This section allows you to describe how any personal data collected will be used and require consent from the user before they can register.', 'awesome-support' ),
121 ),
122 array(
123 'name' => __( 'GDPR Notice: Short Description', 'awesome-support' ),
124 'id' => 'gdpr_notice_short_desc_01',
125 'type' => 'text',
126 'default' => '',
127 'desc' => __( 'If you fill this in, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t tick the checkbox. It is best to keep this brief - eg: Receive Emails? or Join Email List?', 'awesome-support' ),
128 ),
129 array(
130 'name' => __( 'GDPR Notice: Long Description', 'awesome-support' ),
131 'id' => 'gdpr_notice_long_desc_01',
132 'type' => 'editor',
133 'default' => '',
134 'desc' => __( 'If you add notice terms in this box, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t accept these notice terms. It is best to keep this notice to one or two lines.', 'awesome-support' ),
135 'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 )
136 ),
137 array(
138 'name' => __( 'Mandatory', 'awesome-support' ),
139 'id' => "gdpr_notice_mandatory_01",
140 'type' => 'checkbox',
141 'default' => true,
142 'desc' => __( 'Does the user need to check this option before being able to register?', 'awesome-support' )
143 ),
144 array(
145 'name' => __( 'Can Opt Out', 'awesome-support' ),
146 'id' => "gdpr_notice_opt_out_ok_01",
147 'type' => 'checkbox',
148 'default' => false,
149 'desc' => __( 'Is this an option that the user can opt-out from after granting consent?', 'awesome-support' )
150 ),
151
152 array(
153 'name' => __( 'GDPR Notice #2', 'awesome-support' ),
154 'type' => 'heading',
155 'desc' => __( 'If personal data will be used in any additional context add that here. It is best to keep this brief.', 'awesome-support' ),
156 ),
157 array(
158 'name' => __( 'GDPR Notice: Short Description', 'awesome-support' ),
159 'id' => 'gdpr_notice_short_desc_02',
160 'type' => 'text',
161 'default' => '',
162 'desc' => __( 'If you fill this in, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t tick the checkbox. It is best to keep this brief - eg: Receive Emails? or Join Email List?', 'awesome-support' ),
163 ),
164 array(
165 'name' => __( 'GDPR Notice: Long Description', 'awesome-support' ),
166 'id' => 'gdpr_notice_long_desc_02',
167 'type' => 'editor',
168 'default' => '',
169 'desc' => __( 'If you add notice terms in this box, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t accept these notice terms. It is best to keep this notice to one or two lines.', 'awesome-support' ),
170 'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 )
171 ),
172 array(
173 'name' => __( 'Mandatory', 'awesome-support' ),
174 'id' => "gdpr_notice_mandatory_02",
175 'type' => 'checkbox',
176 'default' => true,
177 'desc' => __( 'Does the user need to check this option before being able to register?', 'awesome-support' )
178 ),
179 array(
180 'name' => __( 'Can Opt Out', 'awesome-support' ),
181 'id' => "gdpr_notice_opt_out_ok_02",
182 'type' => 'checkbox',
183 'default' => false,
184 'desc' => __( 'Is this an option that the user can opt-out from after granting consent?', 'awesome-support' )
185 ),
186
187
188 array(
189 'name' => __( 'GDPR Notice #3', 'awesome-support' ),
190 'type' => 'heading',
191 'desc' => __( 'If personal data will be used in any additional context add that here. It is best to keep this brief.', 'awesome-support' ),
192 ),
193 array(
194 'name' => __( 'GDPR Notice: Short Description', 'awesome-support' ),
195 'id' => 'gdpr_notice_short_desc_03',
196 'type' => 'text',
197 'default' => '',
198 'desc' => __( 'If you fill this in, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t tick the checkbox. It is best to keep this brief - eg: Receive Emails? or Join Email List?', 'awesome-support' ),
199 ),
200 array(
201 'name' => __( 'GDPR Notice: Long Description', 'awesome-support' ),
202 'id' => 'gdpr_notice_long_desc_03',
203 'type' => 'editor',
204 'default' => '',
205 'desc' => __( 'If you add notice terms in this box, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t accept these notice terms. It is best to keep this notice to one or two lines.', 'awesome-support' ),
206 'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 )
207 ),
208 array(
209 'name' => __( 'Mandatory', 'awesome-support' ),
210 'id' => "gdpr_notice_mandatory_03",
211 'type' => 'checkbox',
212 'default' => true,
213 'desc' => __( 'Does the user need to check this option before being able to register?', 'awesome-support' )
214 ),
215 array(
216 'name' => __( 'Can Opt Out', 'awesome-support' ),
217 'id' => "gdpr_notice_opt_out_ok_03",
218 'type' => 'checkbox',
219 'default' => false,
220 'desc' => __( 'Is this an option that the user can opt-out from after granting consent?', 'awesome-support' )
221 ),
222
223
224 array(
225 'name' => __( 'Terms & Conditions', 'awesome-support' ),
226 'type' => 'heading',
227 ),
228 array(
229 'name' => __( 'Content', 'awesome-support' ),
230 'id' => 'terms_conditions',
231 'type' => 'editor',
232 'default' => '',
233 'desc' => __( 'Terms & conditions are not mandatory. If you add terms, a mandatory checkbox will be added in the registration form. Users won\'t be able to register if they don\'t accept your terms', 'awesome-support' ),
234 'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 )
235 ),
236 );
237
238 $gdpr_consent_options = apply_filters('wpas_gdpr_consents', $gdpr_consent_options );
239
240 foreach ($gdpr_consent_options as $key => $gdpr_option ) {
241 $settings['registration']['options'][] = $gdpr_option;
242 }
243
244 return array_merge( $def, apply_filters('wpas_settings_registration', $settings ) );
245
246 }
247