Completed
Pull Request — master (#15)
by Semih Serhat
01:54
created
templates/settings-admin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 <div id="brute-force-protection">
27 27
 	<div>
28 28
 		<input type="checkbox" class="checkbox" id="security-brute-force-protection-enabled"
29
-			<?php if ($_['isBruteForceProtectionEnabled']) p("checked");?> >
29
+			<?php if ($_['isBruteForceProtectionEnabled']) p("checked"); ?> >
30 30
 		<label for="security-brute-force-protection-enabled"><?php p($l->t('Activate Brute Force Protection')) ?></label>
31 31
 	</div>
32 32
 </div>
@@ -36,22 +36,22 @@  discard block
 block discarded – undo
36 36
 	<div>
37 37
 		<label for="security-min-password-length"><?php p($l->t('Determine minimum password length')) ?></label>
38 38
 		<input type="number" id="security-min-password-length" min="6" value="<?php p($_['minPasswordLength']) ?>">
39
-        <button id="save-pass-length" class="save"><?php p($l->t('Save Length'));?></button>
39
+        <button id="save-pass-length" class="save"><?php p($l->t('Save Length')); ?></button>
40 40
         <span id="security-min-password-length-message" class="msg"></span>
41 41
 	</div>
42 42
 	<div>
43 43
 		<input type="checkbox" class="checkbox" id="security-enforce-upper-lower-case"
44
-			<?php if ($_['isUpperLowerCaseEnforced']) p("checked");?> >
44
+			<?php if ($_['isUpperLowerCaseEnforced']) p("checked"); ?> >
45 45
 		<label for="security-enforce-upper-lower-case"><?php p($l->t('Enforce at least one upper and one lower case character on passwords')) ?></label>
46 46
 	</div>
47 47
 	<div>
48 48
 		<input type="checkbox" class="checkbox" id="security-enforce-numerical-characters"
49
-			<?php if ($_['isNumericalCharsEnforced']) p("checked");?> >
49
+			<?php if ($_['isNumericalCharsEnforced']) p("checked"); ?> >
50 50
 		<label for="security-enforce-numerical-characters"><?php p($l->t('Enforce at least one numerical characters on passwords')) ?></label>
51 51
 	</div>
52 52
 	<div>
53 53
 		<input type="checkbox" class="checkbox" id="security-enforce-special-characters"
54
-			<?php if ($_['isSpecialCharsEnforced']) p("checked");?> >
54
+			<?php if ($_['isSpecialCharsEnforced']) p("checked"); ?> >
55 55
 		<label for="security-enforce-special-characters"><?php p($l->t('Enforce at least one special characters on passwords')) ?></label>
56 56
 	</div>
57 57
 </div>
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
templates/settings-personal.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@
 block discarded – undo
25 25
 ?>
26 26
 <div id="password-policies" class="hidden">
27 27
 	<?php print_unescaped(
28
-		"<p>". $l->t('Passwords must:'). "</p>");?>
28
+		"<p>".$l->t('Passwords must:')."</p>"); ?>
29 29
 	<ul class="pass-info">
30 30
 		<?php print_unescaped(
31
-			"<li class='pass-info-element'>". $l->t('be at least 8 characters long ', $_['minPasswordLength']). "</li>");?>
31
+			"<li class='pass-info-element'>".$l->t('be at least 8 characters long ', $_['minPasswordLength'])."</li>"); ?>
32 32
 		<?php if ($_['isUpperLowerCaseEnforced']) print_unescaped(
33
-			"<li class='pass-info-element'>". $l->t('contain at least one uppercase letter and at least one lowercase letter '). "</li>");?>
33
+			"<li class='pass-info-element'>".$l->t('contain at least one uppercase letter and at least one lowercase letter ')."</li>"); ?>
34 34
 		<?php if ($_['isNumericalCharsEnforced']) print_unescaped(
35
-			"<li class='pass-info-element'>". $l->t('contain at least one numerical character'). "</li>");?>
35
+			"<li class='pass-info-element'>".$l->t('contain at least one numerical character')."</li>"); ?>
36 36
 		<?php if ($_['isSpecialCharsEnforced']) print_unescaped(
37
-			"<li class='pass-info-element'>". $l->t('contain at least one special character'). "</li>");?>
37
+			"<li class='pass-info-element'>".$l->t('contain at least one special character')."</li>"); ?>
38 38
 	</ul>
39 39
 </div>
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
 }
24 24
 require_once __DIR__.'/../../../lib/base.php';
25 25
 
26
-OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib', true);
26
+OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT.'/tests/lib', true);
27 27
 
28
-if(!class_exists('PHPUnit_Framework_TestCase')) {
28
+if (!class_exists('PHPUnit_Framework_TestCase')) {
29 29
     require_once('PHPUnit/Autoload.php');
30 30
 }
31 31
 
Please login to merge, or discard this patch.
lib/PasswordValidator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 use OC\HintException;
23 23
 use OCP\IL10N;
24 24
 
25
-class PasswordValidator  {
25
+class PasswordValidator {
26 26
 
27 27
 	/** @var SecurityConfig */
28 28
 	protected $config;
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function checkPasswordLength($password) {
64 64
 		$minPassLength = $this->config->getMinPasswordLength();
65
-		if(strlen($password) < $minPassLength) {
66
-			$message = 'Password needs to be at least ' . $minPassLength . ' characters long';
65
+		if (strlen($password) < $minPassLength) {
66
+			$message = 'Password needs to be at least '.$minPassLength.' characters long';
67 67
 			$hint = $this->l->t(
68 68
 				'Password needs to be at least %s characters long', [$minPassLength]
69 69
 			);
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	 * @throws HintException
79 79
 	 */
80 80
 	public function checkUpperLowerCase($password) {
81
-		$enforceUpperLowerCase= $this->config->getIsUpperLowerCaseEnforced();
82
-		if($enforceUpperLowerCase === true && $this->hasUpperAndLowerCase($password) === false) {
81
+		$enforceUpperLowerCase = $this->config->getIsUpperLowerCaseEnforced();
82
+		if ($enforceUpperLowerCase === true && $this->hasUpperAndLowerCase($password) === false) {
83 83
 			$message = 'Password should contain at least one upper and one lower case character.';
84 84
 			$hint = $this->l->t(
85 85
 				'Password should contain at least one upper and one lower case character.'
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function checkNumericCharacters($password) {
98 98
 		$enforceNumericCharacters = $this->config->getIsNumericCharactersEnforced();
99
-		if($enforceNumericCharacters === true && $this->hasNumericalCharacters($password) === false) {
99
+		if ($enforceNumericCharacters === true && $this->hasNumericalCharacters($password) === false) {
100 100
 			$message = 'Password should contain at least one numerical character.';
101 101
 			$hint = $this->l->t(
102 102
 				'Password should contain at least one numerical character.'
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function checkSpecialCharacters($password) {
115 115
 		$enforceSpecialCharacters = $this->config->getIsSpecialCharactersEnforced();
116
-		if($enforceSpecialCharacters === true && $this->hasSpecialCharacter($password) === false) {
116
+		if ($enforceSpecialCharacters === true && $this->hasSpecialCharacter($password) === false) {
117 117
 			$message = 'Password should contain at least one special character.';
118 118
 			$hint = $this->l->t(
119 119
 				'Password should contain at least one special character.'
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
 class Application extends App {
33 33
 
34
-    public function __construct(array $urlParams=array()){
34
+    public function __construct(array $urlParams = array()) {
35 35
         parent::__construct('security', $urlParams);
36 36
 
37 37
         $container = $this->getContainer();
Please login to merge, or discard this patch.
lib/Db/DbService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     /**
55 55
      * @param string $uid
56 56
      */
57
-    public function addFailedLoginAttempt($uid, $ip){
57
+    public function addFailedLoginAttempt($uid, $ip) {
58 58
         $builder = $this->connection->getQueryBuilder();
59 59
         $builder->insert('failed_login_attempts')
60 60
             ->setValue('ip', $builder->createNamedParameter($ip))
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function deleteSuspiciousAttemptsForIp($ip) {
99 99
         $builder = $this->connection->getQueryBuilder();
100 100
         $builder->delete('failed_login_attempts')
101
-            ->where($builder->expr()->eq('ip',$builder->createNamedParameter($ip)))
101
+            ->where($builder->expr()->eq('ip', $builder->createNamedParameter($ip)))
102 102
             ->execute();
103 103
     }
104 104
 }
105 105
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Hooks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	 * @param PasswordValidator $passValidator
56 56
 	 * @param EventDispatcherInterface $dispatcher
57 57
      */
58
-    public function __construct($userManager, $throttle, $request, $passValidator, $dispatcher){
58
+    public function __construct($userManager, $throttle, $request, $passValidator, $dispatcher) {
59 59
         $this->userManager = $userManager;
60 60
         $this->throttle = $throttle;
61 61
         $this->request = $request;
Please login to merge, or discard this patch.