Passed
Push — master ( 8d9c6d...04aa33 )
by Andreas
13:00
created
lib/org/openpsa/user/accounthelper.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $password_length = mb_strlen($password);
271 271
 
272 272
         if ($password_length < $this->_config->get('min_password_length')) {
273
-            if ($show_ui_message){
273
+            if ($show_ui_message) {
274 274
                 midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password too short'), 'error');
275 275
             }
276 276
             return false;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         }
289 289
 
290 290
         if ($score < $this->_config->get('min_password_score')) {
291
-            if ($show_ui_message){
291
+            if ($show_ui_message) {
292 292
                 midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password weak'), 'error');
293 293
             }
294 294
             return false;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $account = $this->get_account();
152 152
         if (!empty($new_password)) {
153 153
             //check if the new encrypted password was already used
154
-            if (   !$this->check_password_reuse($new_password, true)
154
+            if (!$this->check_password_reuse($new_password, true)
155 155
                 || !$this->check_password_strength($new_password, true)) {
156 156
                 $this->errstr = "password strength too low";
157 157
                 return false;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $password_length = mb_strlen($password);
271 271
 
272 272
         if ($password_length < $this->_config->get('min_password_length')) {
273
-            if ($show_ui_message){
273
+            if ($show_ui_message) {
274 274
                 midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password too short'), 'error');
275 275
             }
276 276
             return false;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         }
289 289
 
290 290
         if ($score < $this->_config->get('min_password_score')) {
291
-            if ($show_ui_message){
291
+            if ($show_ui_message) {
292 292
                 midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password weak'), 'error');
293 293
             }
294 294
             return false;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
     public static function get_person_by_formdata(array $data) : ?midcom_db_person
434 434
     {
435
-        if (   empty($data['username'])
435
+        if (empty($data['username'])
436 436
             || empty($data['password'])) {
437 437
             return null;
438 438
         }
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
          * If the maximum number of attempts is reached and the oldest attempt
482 482
          * on the stack is within our defined timeframe, we block the account
483 483
          */
484
-        if (   count($attempts) >= $max_attempts
484
+        if (count($attempts) >= $max_attempts
485 485
             && $attempts[$max_attempts - 1] >= (time() - ($timeframe * 60))) {
486 486
             $this->disable_account();
487 487
             $stat = false;
Please login to merge, or discard this patch.
src/midcom/dba/privileges.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function set_privilege($privilege, $assignee = null, int $value = MIDCOM_PRIVILEGE_ALLOW, string $classname = '') : bool
68 68
     {
69
-        if (   !$this->can_do('midgard:update')
69
+        if (!$this->can_do('midgard:update')
70 70
             || !$this->can_do('midgard:privileges')) {
71 71
             debug_add("Failed to set a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.",
72 72
             MIDCOM_LOG_ERROR);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function unset_privilege($privilege, $assignee = null, string $classname = '') : bool
98 98
     {
99
-        if (   !$this->can_do('midgard:update')
99
+        if (!$this->can_do('midgard:update')
100 100
             || !$this->can_do('midgard:privileges')) {
101 101
             debug_add("Failed to unset a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.",
102 102
             MIDCOM_LOG_ERROR);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      *     midcom_core_group object or subtype thereof.
126 126
      * @param string $classname An optional class name to which a SELF privilege is restricted to.
127 127
      */
128
-    public function get_privilege(string $privilege, midcom_core_user|midcom_core_group|string $assignee, string $classname = '')
128
+    public function get_privilege(string $privilege, midcom_core_user | midcom_core_group | string $assignee, string $classname = '')
129 129
     {
130 130
         if (!$this->can_do('midgard:privileges')) {
131 131
             debug_add("Failed to get a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.",
Please login to merge, or discard this patch.