@@ -31,8 +31,11 @@ |
||
| 31 | 31 | // count duplicates |
| 32 | 32 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'")); |
| 33 | 33 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 34 | -if($count>=1) $count = ' '.($count+1); |
|
| 35 | -else $count = ''; |
|
| 34 | +if($count>=1) { |
|
| 35 | + $count = ' '.($count+1); |
|
| 36 | +} else { |
|
| 37 | + $count = ''; |
|
| 38 | +} |
|
| 36 | 39 | |
| 37 | 40 | // duplicate module |
| 38 | 41 | $newid = $modx->db->insert( |
@@ -12,12 +12,20 @@ discard block |
||
| 12 | 12 | // ok, two things to check. |
| 13 | 13 | // first, document cannot be moved to itself |
| 14 | 14 | // second, new parent must be a folder. If not, set it to folder. |
| 15 | -if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
| 16 | -if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 17 | -if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 15 | +if($documentID==$newParentID) { |
|
| 16 | + $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
| 17 | +} |
|
| 18 | +if($documentID <= 0) { |
|
| 19 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 20 | +} |
|
| 21 | +if($newParentID < 0) { |
|
| 22 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 23 | +} |
|
| 18 | 24 | |
| 19 | 25 | $parents = $modx->getParentIds($newParentID); |
| 20 | -if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 26 | +if (in_array($documentID, $parents)) { |
|
| 27 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
| 28 | +} |
|
| 21 | 29 | |
| 22 | 30 | $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); |
| 23 | 31 | $oldparent = $modx->db->getValue($rs); |
@@ -62,11 +70,11 @@ discard block |
||
| 62 | 70 | "old_parent" => $oldparent, |
| 63 | 71 | "new_parent" => $newParentID |
| 64 | 72 | )); |
| 65 | -if (is_array($evtOut) && count($evtOut) > 0){ |
|
| 73 | +if (is_array($evtOut) && count($evtOut) > 0) { |
|
| 66 | 74 | $newParent = array_pop($evtOut); |
| 67 | 75 | if($newParent == $oldparent) { |
| 68 | 76 | $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
| 69 | - }else{ |
|
| 77 | + } else { |
|
| 70 | 78 | $newParentID = $newParent; |
| 71 | 79 | } |
| 72 | 80 | } |
@@ -403,10 +403,12 @@ |
||
| 403 | 403 | $failedlogins += 1; |
| 404 | 404 | |
| 405 | 405 | $fields = array('failedlogincount' => $failedlogins); |
| 406 | - if ($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
| 406 | + if ($failedlogins >= $failed_allowed) { |
|
| 407 | + //block user for too many fail attempts |
|
| 407 | 408 | { |
| 408 | 409 | $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
| 409 | 410 | } |
| 411 | + } |
|
| 410 | 412 | |
| 411 | 413 | $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
| 412 | 414 | |