-
Notifications
You must be signed in to change notification settings - Fork 3
/
FormSignup.php
40 lines (32 loc) · 1.09 KB
/
FormSignup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Piwik\Plugins\Signup;
use Piwik\Piwik;
use Piwik\QuickForm2;
/**
* Form used to signup as new user.
*/
class FormSignup extends QuickForm2
{
/**
* {@InheritDoc}
*/
function __construct($id = 'signup_form', $method = 'post', $attributes = null, $trackSubmit = false)
{
$attributes = array_merge($attributes ?: [], ['action' => '?module=Signup']);
parent::__construct($id, $method, $attributes, $trackSubmit);
}
/**
* {@InheritDoc}
*/
function init()
{
$this->addElement('text', 'login')
->addRule('required', Piwik::translate('General_Required', Piwik::translate('Login_LoginOrEmail')));
$this->addElement('password', 'password')
->addRule('required', Piwik::translate('General_Required', Piwik::translate('General_Password')));
$this->addElement('text', 'email')
->addRule('required', Piwik::translate('General_Required', Piwik::translate('Installation_Email')));
$this->addElement('hidden', 'nonce');
$this->addElement('submit', 'submit');
}
}