@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $account = $this->get_account(); |
| 171 | 171 | if (!empty($new_password)) { |
| 172 | 172 | //check if the new encrypted password was already used |
| 173 | - if ( !$this->check_password_reuse($new_password, true) |
|
| 173 | + if (!$this->check_password_reuse($new_password, true) |
|
| 174 | 174 | || !$this->check_password_strength($new_password, true)) { |
| 175 | 175 | $this->errstr = "password strength too low"; |
| 176 | 176 | return false; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $password_length = mb_strlen($password); |
| 320 | 320 | |
| 321 | 321 | if ($password_length < $this->_config->get('min_password_length')) { |
| 322 | - if ($show_ui_message){ |
|
| 322 | + if ($show_ui_message) { |
|
| 323 | 323 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
| 324 | 324 | } |
| 325 | 325 | return false; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if ($score < $this->_config->get('min_password_score')) { |
| 340 | - if ($show_ui_message){ |
|
| 340 | + if ($show_ui_message) { |
|
| 341 | 341 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
| 342 | 342 | } |
| 343 | 343 | return false; |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | public static function get_person_by_formdata($data) |
| 472 | 472 | { |
| 473 | - if ( empty($data['username']) |
|
| 473 | + if (empty($data['username']) |
|
| 474 | 474 | || empty($data['password'])) { |
| 475 | 475 | return false; |
| 476 | 476 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $max_attempts = midcom_baseclasses_components_configuration::get($component, 'config')->get('max_password_attempts'); |
| 503 | 503 | $timeframe = midcom_baseclasses_components_configuration::get($component, 'config')->get('password_block_timeframe_min'); |
| 504 | 504 | |
| 505 | - if ( $max_attempts == 0 |
|
| 505 | + if ($max_attempts == 0 |
|
| 506 | 506 | || $timeframe == 0) { |
| 507 | 507 | return $stat; |
| 508 | 508 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | * If the maximum number of attempts is reached and the oldest attempt |
| 525 | 525 | * on the stack is within our defined timeframe, we block the account |
| 526 | 526 | */ |
| 527 | - if ( count($attempts) >= $max_attempts |
|
| 527 | + if (count($attempts) >= $max_attempts |
|
| 528 | 528 | && $attempts[$max_attempts - 1] >= (time() - ($timeframe * 60))) { |
| 529 | 529 | $this->disable_account(); |
| 530 | 530 | $stat = false; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $password_length = mb_strlen($password); |
| 320 | 320 | |
| 321 | 321 | if ($password_length < $this->_config->get('min_password_length')) { |
| 322 | - if ($show_ui_message){ |
|
| 322 | + if ($show_ui_message) { |
|
| 323 | 323 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
| 324 | 324 | } |
| 325 | 325 | return false; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if ($score < $this->_config->get('min_password_score')) { |
| 340 | - if ($show_ui_message){ |
|
| 340 | + if ($show_ui_message) { |
|
| 341 | 341 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
| 342 | 342 | } |
| 343 | 343 | return false; |