1 | <?php |
||
15 | class UserAccountDataChecker extends DataChecker { |
||
16 | |||
17 | public $mUsername = ''; |
||
18 | public $mPassword = ''; |
||
19 | public $mEmail = ''; |
||
20 | public $mRealname = ''; |
||
21 | public $mDomain = ''; |
||
22 | public $mLanguage = ''; |
||
23 | public $mRemember = false; |
||
24 | public $mUser = null; |
||
25 | |||
26 | 1 | public function __construct() { |
|
27 | 1 | $that = $this; |
|
28 | 1 | $this->addCheck( array( &$that, 'checkDomainValidity' ), array() ); |
|
29 | 1 | $this->addCheck( array( &$that, 'checkDomainUser' ), array() ); |
|
30 | 1 | $this->addCheck( array( &$that, 'checkCreatePermissions' ), array() ); |
|
31 | 1 | $this->addCheck( array( &$that, 'checkSorbs' ), array() ); |
|
32 | 1 | $this->addCheck( array( &$that, 'checkUserExists' ), array() ); |
|
33 | 1 | $this->addCheck( array( &$that, 'checkPasswordLength' ), array() ); |
|
34 | 1 | $this->addCheck( array( &$that, 'checkEmailValidity' ), array() ); |
|
35 | } |
||
36 | |||
37 | // Checks |
||
38 | |||
39 | public function checkDomainValidity() { |
||
40 | global $wgAuth; |
||
41 | |||
42 | if ( !$wgAuth->validDomain( $this->mDomain ) ) |
||
43 | $this->error( wfMessage( 'wrongpassword' )->text() ); |
||
44 | } |
||
45 | |||
46 | public function checkDomainUser() { |
||
53 | |||
54 | public function checkCreatePermissions() { |
||
60 | |||
61 | public function checkSorbs() { |
||
69 | |||
70 | public function checkUserExists() { |
||
74 | |||
75 | public function checkPasswordLength() { |
||
82 | |||
83 | public function checkEmailValidity() { |
||
89 | |||
90 | protected function populateData() { |
||
116 | |||
117 | } |
||
118 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: