Completed
Push — develop ( 923a1c...1e9876 )
by Maxim
47s queued 29s
created
manager/processors/duplicate_htmlsnippet.processor.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
3 5
 if(!$modx->hasPermission('new_chunk')) {
4 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 7
 }
@@ -12,8 +14,11 @@  discard block
 block discarded – undo
12 14
 // count duplicates
13 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"));
14 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
15
-if($count>=1) $count = ' '.($count+1);
16
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
17 22
 
18 23
 // duplicate htmlsnippet
19 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/user_documents_permissions.class.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class udperms{
3
+class udperms
4
+{
4 5
 
5 6
 	var $user;
6 7
 	var $document;
7 8
 	var $role;
8 9
 	var $duplicateDoc = false;
9 10
 	
10
-	function checkPermissions() {
11
+	function checkPermissions()
12
+	{
11 13
 		
12 14
 		global $udperms_allowroot;
13 15
 		global $modx;
@@ -28,7 +30,10 @@  discard block
 block discarded – undo
28 30
 		}
29 31
 		
30 32
 		$parent = $modx->db->getValue($modx->db->select('parent', $tblsc, "id='{$this->document}'"));
31
-		if($document == 0 && $parent == NULL && $udperms_allowroot == 1) return true; // User is allowed to create new document in root
33
+		if($document == 0 && $parent == NULL && $udperms_allowroot == 1) {
34
+		    return true;
35
+		}
36
+		// User is allowed to create new document in root
32 37
 		if (($this->duplicateDoc==true || $document==0) && $parent==0 && $udperms_allowroot==0) {
33 38
 			return false; // deny duplicate || create new document at root if Allow Root is No
34 39
 		}
@@ -56,7 +61,9 @@  discard block
 block discarded – undo
56 61
 			"sc.id='{$this->document}' AND (". ( (!$docgrp) ? null : "dg.document_group = ".$docgrp." ||" ) . " sc.privatemgr = 0)"
57 62
 			);
58 63
 		$limit = $modx->db->getValue($rs);
59
-		if($limit==1) $permissionsok = true;
64
+		if($limit==1) {
65
+		    $permissionsok = true;
66
+		}
60 67
 		
61 68
 		return $permissionsok;
62 69
 	}
Please login to merge, or discard this patch.
manager/processors/cache_sync.class.processor.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     function getParents($id, $path = '')
49
-    { // modx:returns child's parent
49
+    {
50
+// modx:returns child's parent
50 51
         global $modx;
51 52
         if (empty($this->aliases)) {
52 53
             $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible";
@@ -403,7 +404,8 @@  discard block
 block discarded – undo
403 404
                         $_ = trim($_);
404 405
                     }
405 406
                     $lastChar = substr($_, -1);
406
-                    if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289
407
+                    if (!in_array($lastChar, $chars)) {
408
+// ,320,327,288,284,289
407 409
                         if (!in_array($prev_token, array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) {
408 410
                             $_ .= ' ';
409 411
                         }
Please login to merge, or discard this patch.
manager/processors/save_user.processor.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -349,7 +349,8 @@  discard block
 block discarded – undo
349 349
 }
350 350
 
351 351
 // Send an email to the user
352
-function sendMailMessage($email, $uid, $pwd, $ufn) {
352
+function sendMailMessage($email, $uid, $pwd, $ufn)
353
+{
353 354
 	global $modx, $_lang, $signupemail_message;
354 355
 	global $emailsubject, $emailsender;
355 356
 	global $site_name;
@@ -378,7 +379,8 @@  discard block
 block discarded – undo
378 379
 }
379 380
 
380 381
 // Save User Settings
381
-function saveUserSettings($id) {
382
+function saveUserSettings($id)
383
+{
382 384
 	global $modx;
383 385
 	$tbl_user_settings = $modx->getFullTableName('user_settings');
384 386
 
@@ -462,7 +464,8 @@  discard block
 block discarded – undo
462 464
 }
463 465
 
464 466
 // Web alert -  sends an alert to web browser
465
-function webAlertAndQuit($msg) {
467
+function webAlertAndQuit($msg)
468
+{
466 469
 	global $id, $modx;
467 470
 	$mode = $_POST['mode'];
468 471
 	$modx->manager->saveFormValues($mode);
@@ -470,7 +473,8 @@  discard block
 block discarded – undo
470 473
 }
471 474
 
472 475
 // Generate password
473
-function generate_password($length = 10) {
476
+function generate_password($length = 10)
477
+{
474 478
 	$allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";
475 479
 	$ps_len = strlen($allowable_characters);
476 480
 	mt_srand((double) microtime() * 1000000);
Please login to merge, or discard this patch.
manager/processors/remove_locks.processor.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,12 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
3 5
 
4 6
 if(!isset($_GET['id'])) {
5
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	if(!$modx->hasPermission('remove_locks')) {
8
+	    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+	}
6 10
 	
7 11
 	// Remove all locks
8 12
 	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php 
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
3 5
 if(!$modx->hasPermission('new_plugin')) {
4 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 7
 }
@@ -12,8 +14,11 @@  discard block
 block discarded – undo
12 14
 // count duplicates
13 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
14 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
15
-if($count>=1) $count = ' '.($count+1);
16
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
17 22
 
18 23
 // duplicate Plugin
19 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/optimize_table.processor.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php 
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
-if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) {	
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
5
+if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) {
4 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 7
 }
6 8
 
Please login to merge, or discard this patch.
manager/processors/delete_role.processor.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
3 5
 if(!$modx->hasPermission('delete_role')) {
4 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 7
 }
@@ -9,13 +11,13 @@  discard block
 block discarded – undo
9 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
10 12
 }
11 13
 
12
-if($id==1){
14
+if($id==1) {
13 15
 	$modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!");
14 16
 }
15 17
 
16 18
 $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'");
17 19
 $count=$modx->db->getValue($rs);
18
-if($count>0){
20
+if($count>0) {
19 21
 	$modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
20 22
 }
21 23
 
Please login to merge, or discard this patch.
manager/processors/delete_user.processor.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(IN_MANAGER_MODE!="true") {
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4
+}
3 5
 if(!$modx->hasPermission('delete_user')) {
4 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 7
 }
Please login to merge, or discard this patch.