From a1d770f9151d067da8bf3cc7e8d4a7035e4edb03 Mon Sep 17 00:00:00 2001 From: Segr Date: Thu, 27 Feb 2014 13:56:49 +0400 Subject: [PATCH 1/4] $_REQUEST['depid'] is already array --- manager/actions/mutate_module_resources.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index 5c1a6be46a..b70efb511e 100644 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -63,7 +63,7 @@ break; case 'del': // convert ids to numbers - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['depid'])); + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); // get resources that needs to be removed $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",",$opids).")"); From 6d7732e454a152b24901dcf612f539d36100876c Mon Sep 17 00:00:00 2001 From: Segr Date: Thu, 27 Feb 2014 13:57:42 +0400 Subject: [PATCH 2/4] Check 'cls' & 'id' when delete event_logs --- manager/processors/delete_eventlog.processor.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/manager/processors/delete_eventlog.processor.php b/manager/processors/delete_eventlog.processor.php index 411e41da63..d19f7a75fc 100644 --- a/manager/processors/delete_eventlog.processor.php +++ b/manager/processors/delete_eventlog.processor.php @@ -4,13 +4,16 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$id = isset($_GET['id'])? intval($_GET['id']) : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if (isset($_GET['cls']) && $_GET['cls']==1) { + $where = ''; +} else { + $id = isset($_GET['id'])? intval($_GET['id']) : 0; + if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); + } + $where = "id='{$id}'"; } -$where = (isset($_GET['cls']) && $_GET['cls']==1) ? '' : "id='{$id}'"; - // delete event log $modx->db->delete($modx->getFullTableName('event_log'), $where); From 3344c083b8433ad86af167507bfea5fc39a108d8 Mon Sep 17 00:00:00 2001 From: Segr Date: Thu, 27 Feb 2014 14:04:28 +0400 Subject: [PATCH 3/4] Delete extra code --- assets/plugins/managermanager/modx.ddtools.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/plugins/managermanager/modx.ddtools.class.php b/assets/plugins/managermanager/modx.ddtools.class.php index 9da24fb8b1..1a32701d6c 100755 --- a/assets/plugins/managermanager/modx.ddtools.class.php +++ b/assets/plugins/managermanager/modx.ddtools.class.php @@ -486,7 +486,6 @@ public static function getDocuments($ids = array(), $published = false, $deleted if (count($ids) == 0){ return false; }else{ - $limit = ($limit != "") ? "LIMIT $limit" : ""; // LIMIT capabilities - rad14701 // modify field names to use sc. table reference $fields = 'sc.' . implode(',sc.', preg_replace("/^\s/i", "", explode(',', $fields))); $sort = ($sort == "") ? "" : 'sc.' . implode(',sc.', preg_replace("/^\s/i", "", explode(',', $sort))); From bb8a1a72f894216a69cb84cf27c9d13d4708ca79 Mon Sep 17 00:00:00 2001 From: Segr Date: Thu, 27 Feb 2014 14:09:38 +0400 Subject: [PATCH 4/4] Fix typo --- manager/includes/document.parser.class.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 7be6d2778c..098bea5bf0 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2766,8 +2766,8 @@ function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $publis "{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id - LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}' - {$query} AND tvtpl.templateid = '{$docRow['template']}'", + LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", + "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "") ); @@ -3041,7 +3041,6 @@ function getWebUserInfo($uid) { INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'" ); - $rs= $this->db->query($sql); if ($row = $this->db->getRow($rs)) { if (!$row["usertype"]) $row["usertype"]= "web";