Completed
Push — master ( 8a7616...00f01c )
by Martijn van
02:38
created
code/AdminLoginForm.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -3,63 +3,63 @@
 block discarded – undo
3 3
 class AdminLoginForm extends MemberLoginForm
4 4
 {
5 5
 
6
-    public function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
7
-    {
8
-        parent::__construct($controller, $name, $fields, $actions, $checkCurrentUser);
6
+	public function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
7
+	{
8
+		parent::__construct($controller, $name, $fields, $actions, $checkCurrentUser);
9 9
 
10
-        if ($this->Actions()->fieldByName('forgotPassword')) {
11
-            // replaceField won't work, since it's a dataless field
12
-            $this->Actions()->removeByName('forgotPassword');
13
-            $this->Actions()->push(new LiteralField(
14
-                'forgotPassword',
15
-                '<p id="ForgotPassword"><a href="AdminSecurity/lostpassword">'
16
-                . _t('Member.BUTTONLOSTPASSWORD', "I've lost my password") . '</a></p>'
17
-            ));
18
-        }
10
+		if ($this->Actions()->fieldByName('forgotPassword')) {
11
+			// replaceField won't work, since it's a dataless field
12
+			$this->Actions()->removeByName('forgotPassword');
13
+			$this->Actions()->push(new LiteralField(
14
+				'forgotPassword',
15
+				'<p id="ForgotPassword"><a href="AdminSecurity/lostpassword">'
16
+				. _t('Member.BUTTONLOSTPASSWORD', "I've lost my password") . '</a></p>'
17
+			));
18
+		}
19 19
 
20
-        Requirements::customScript(<<<JS
20
+		Requirements::customScript(<<<JS
21 21
 			(function() {
22 22
 				var el = document.getElementById("AdminLoginForm_LoginForm_Email");
23 23
 				if(el && el.focus) el.focus();
24 24
 			})();
25 25
 JS
26
-        );
27
-    }
26
+		);
27
+	}
28 28
 
29
-    /**
30
-     * @param array $data
31
-     */
32
-    public function forgotPassword($data)
33
-    {
34
-        $email = Convert::raw2sql($data['Email']);
29
+	/**
30
+	 * @param array $data
31
+	 */
32
+	public function forgotPassword($data)
33
+	{
34
+		$email = Convert::raw2sql($data['Email']);
35 35
 
36
-        /* @var $member Member */
37
-        $member = Member::get()->where("Email = '{$email}'")->first();
36
+		/* @var $member Member */
37
+		$member = Member::get()->where("Email = '{$email}'")->first();
38 38
 
39
-        if ($member) {
40
-            $token = $member->generateAutologinTokenAndStoreHash();
39
+		if ($member) {
40
+			$token = $member->generateAutologinTokenAndStoreHash();
41 41
 
42
-            /* @var $email Member_ForgotPasswordEmail */
43
-            $email = Member_ForgotPasswordEmail::create();
44
-            $email->populateTemplate($member);
45
-            $email->populateTemplate(array(
46
-                'PasswordResetLink' => AdminSecurity::getPasswordResetLink($member, $token)
47
-            ));
48
-            $email->setTo($member->Email);
49
-            $email->send();
42
+			/* @var $email Member_ForgotPasswordEmail */
43
+			$email = Member_ForgotPasswordEmail::create();
44
+			$email->populateTemplate($member);
45
+			$email->populateTemplate(array(
46
+				'PasswordResetLink' => AdminSecurity::getPasswordResetLink($member, $token)
47
+			));
48
+			$email->setTo($member->Email);
49
+			$email->send();
50 50
 
51
-            $this->controller->redirect('AdminSecurity/passwordsent/' . urlencode($data['Email']));
52
-        } elseif ($data['Email']) {
53
-            // Avoid information disclosure by displaying the same status,
54
-            // regardless wether the email address actually exists
55
-            $this->controller->redirect('AdminSecurity/passwordsent/' . urlencode($data['Email']));
56
-        } else {
57
-            $this->sessionMessage(
58
-                _t('Member.ENTEREMAIL', 'Please enter an email address to get a password reset link.'),
59
-                'bad'
60
-            );
51
+			$this->controller->redirect('AdminSecurity/passwordsent/' . urlencode($data['Email']));
52
+		} elseif ($data['Email']) {
53
+			// Avoid information disclosure by displaying the same status,
54
+			// regardless wether the email address actually exists
55
+			$this->controller->redirect('AdminSecurity/passwordsent/' . urlencode($data['Email']));
56
+		} else {
57
+			$this->sessionMessage(
58
+				_t('Member.ENTEREMAIL', 'Please enter an email address to get a password reset link.'),
59
+				'bad'
60
+			);
61 61
 
62
-            $this->controller->redirect('AdminSecurity/lostpassword');
63
-        }
64
-    }
62
+			$this->controller->redirect('AdminSecurity/lostpassword');
63
+		}
64
+	}
65 65
 }
Please login to merge, or discard this patch.