Completed
Push — develop ( 4bd203...a628f2 )
by
unknown
08:09
created

ModuleOptions::setNotifyOnRegistration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Auth\Options;
12
13
use Zend\Stdlib\AbstractOptions;
14
15
/**
16
 * Class ModuleOptions
17
 *
18
 * defines AbstractOptions of the Auth Module
19
 * @since 0.30
20
 *        - add $notifyOnRegistration, $notificationEmail and notificationLanguage options.
21
 */
22
class ModuleOptions extends AbstractOptions
23
{
24
25
    /**
26
     * default email address, which is used in FROM headers of system mails like "new registration",
27
     * "forgot password",..
28
     *
29
     * @var string
30
     */
31
    protected $fromEmail = '[email protected]';
32
33
    /**
34
     * default name, which is used in FROM headers of system mails like "new registration", "forgot password",..
35
     *
36
     * @var string
37
     */
38
    protected $fromName = 'Name';
39
40
    /**
41
     * default role, which is assigned to a user after registration. possible Values (user|recruiter)
42
     * @var string
43
     */
44
    protected $role = 'recruiter';
45
46
    /**
47
     * Subject of the registration mail.
48
     *
49
     * @var string
50
     */
51
    protected $mailSubjectRegistration = 'Welcome to YAWIK';
52
53
    /**
54
     * an authSuffix can be used, if you plan to connect an external system. Users can login with "username", but
55
     * the login itself is stored as "username@authSuffix"
56
     *
57
     * @var string
58
     */
59
    protected $authSuffix = '';
60
61
    /**
62
     * Enable Login via Social Networks
63
     *
64
     * @var array()
65
     */
66
    protected $enableLogins = ['facebook','xing','linkedin','google','github'];
67
68
    /**
69
     * Enable Registration
70
     *
71
     * @var bool
72
     */
73
    protected $enableRegistration = true;
74
75
    /**
76
     * Notify via email user registration?
77
     *
78
     * @see ::notificationEmail
79
     * @var bool
80
     */
81
    protected $notifyOnRegistration = false;
82
83
    /**
84
     * Email to send notifications to.
85
     *
86
     * @var string
87
     */
88
    protected $notificationEmail;
89
90
    /**
91
     * Language in which to send the notifications.
92
     *
93
     * @var string
94
     */
95
    protected $notificationLanguage = 'en';
96
97
    /**
98
     * Enable to reset the password
99
     *
100
     * @var bool
101
     */
102
    protected $enableResetPassword = true;
103
104
105
    /**
106
     * Sets the "role " option
107
     *
108
     * @param $role
109
     * @return $this
110
     */
111
    public function setRole($role)
112
    {
113
        $this->role = $role;
114
        return $this;
115
    }
116
117
    /**
118
     * Gets the "role" option
119
     *
120
     * @return string
121
     */
122
    public function getRole()
123
    {
124
        return $this->role;
125
    }
126
127
    /**
128
     * Gets email address which is used in FROM header of system mails
129
     *
130
     * @return string
131
     */
132
    public function getFromEmail()
133
    {
134
        return $this->fromEmail;
135
    }
136
137
    /**
138
     * Sets email address which is used in FROM header of system mails
139
     *
140
     * @param $fromEmail
141
     * @return $this
142
     */
143
    public function setFromEmail($fromEmail)
144
    {
145
        $this->fromEmail = $fromEmail;
146
        return $this;
147
    }
148
149
    /**
150
     * Gets the From: Name of the mail header
151
     *
152
     * @return string
153
     */
154
    public function getFromName()
155
    {
156
        return $this->fromName;
157
    }
158
159
    /**
160
     * Sets the From: of the mail header
161
     *
162
     * @param $fromName
163
     * @return $this
164
     */
165
    public function setFromName($fromName)
166
    {
167
        $this->fromName = $fromName;
168
        return $this;
169
    }
170
171
172
    /**
173
     * Sets the Mail Subject of the registration Mail
174
     *
175
     * @param $mailSubjectRegistration
176
     * @return $this
177
     */
178
    public function setMailSubjectRegistration($mailSubjectRegistration)
179
    {
180
        $this->mailSubjectRegistration = $mailSubjectRegistration;
181
        return $this;
182
    }
183
184
    /**
185
     * Gets the Mail Subject of the registration Mail
186
     *
187
     * @return string
188
     */
189
    public function getMailSubjectRegistration()
190
    {
191
        return $this->mailSubjectRegistration;
192
    }
193
194
    /**
195
     * @param $suffix
196
     * @return $this
197
     */
198
    public function setAuthSuffix($suffix)
199
    {
200
        $this->authSuffix = $suffix;
201
        return $this;
202
    }
203
204
    /**
205
     * @return string
206
     */
207
    public function getAuthSuffix()
208
    {
209
        return $this->authSuffix;
210
    }
211
212
    /**
213
     * @param $enableLogins
214
     * @return $this
215
     */
216
    public function setEnableLogins($enableLogins)
217
    {
218
        $this->enableLogins = $enableLogins;
219
        return $this;
220
    }
221
222
    /**
223
     * @return array()
0 ignored issues
show
Documentation introduced by
The doc-type array() could not be parsed: Expected "|" or "end of type", but got "(" at position 5. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
224
     */
225
    public function getEnableLogins()
226
    {
227
        return $this->enableLogins;
228
    }
229
230
    /**
231
     * @param $enableRegistration
232
     * @return $this
233
     */
234
    public function setEnableRegistration($enableRegistration)
235
    {
236
        $this->enableRegistration = $enableRegistration;
237
        return $this;
238
    }
239
240
    /**
241
     * @return bool
242
     */
243
    public function getEnableRegistration()
0 ignored issues
show
Coding Style introduced by
function getEnableRegistration() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
244
    {
245
        return $this->enableRegistration;
246
    }
247
248
    /**
249
     * @param string $notificationEmail
250
     *
251
     * @return self
252
     * @since 0.30
253
     */
254
    public function setNotificationEmail($notificationEmail)
255
    {
256
        $this->notificationEmail = $notificationEmail;
257
258
        return $this;
259
    }
260
261
    /**
262
     * @return string
263
     * @since 0.30
264
     */
265
    public function getNotificationEmail()
266
    {
267
        return $this->notificationEmail;
268
    }
269
270
    /**
271
     * @param boolean $notifyOnRegistration
272
     *
273
     * @return self
274
     * @since 0.30
275
     */
276
    public function setNotifyOnRegistration($notifyOnRegistration)
277
    {
278
        $this->notifyOnRegistration = $notifyOnRegistration;
279
280
        return $this;
281
    }
282
283
    /**
284
     * @return boolean
285
     * @since 0.30
286
     */
287
    public function getNotifyOnRegistration()
0 ignored issues
show
Coding Style introduced by
function getNotifyOnRegistration() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
288
    {
289
        return $this->notifyOnRegistration;
290
    }
291
292
    /**
293
     * @internal
294
     *      Convinience method.
295
     *
296
     * @return string
297
     * @since 0,30
298
     */
299
    public function notifyOnRegistration()
300
    {
301
        return $this->getNotificationEmail();
302
    }
303
304
    /**
305
     * @param string $notificationLanguage
306
     *
307
     * @return self
308
     * @since 0.30
309
     */
310
    public function setNotificationLanguage($notificationLanguage)
311
    {
312
        $this->notificationLanguage = $notificationLanguage;
313
314
        return $this;
315
    }
316
317
    /**
318
     * @return string
319
     * @since 0.30
320
     */
321
    public function getNotificationLanguage()
322
    {
323
        return $this->notificationLanguage;
324
    }
325
326
327
328
    /**
329
     * @param $enableResetPassword
330
     * @return $this
331
     */
332
    public function setEnableResetPassword($enableResetPassword)
333
    {
334
        $this->enableResetPassword = $enableResetPassword;
335
        return $this;
336
    }
337
338
    /**
339
     * @return bool
340
     */
341
    public function getEnableResetPassword()
0 ignored issues
show
Coding Style introduced by
function getEnableResetPassword() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
342
    {
343
        return $this->enableResetPassword;
344
    }
345
}
346