Index: branches/unlabeled/unlabeled-1.120.2/kernel/action.php =================================================================== diff -u -r5295 -r5401 --- branches/unlabeled/unlabeled-1.120.2/kernel/action.php (.../action.php) (revision 5295) +++ branches/unlabeled/unlabeled-1.120.2/kernel/action.php (.../action.php) (revision 5401) @@ -497,20 +497,16 @@ case "m_cat_delete": if($ro_perm) break; - if($objSession->HasCatPermission("CATEGORY.DELETE",$objCatList->CurrentCategoryID())) - { - if(isset($_POST["catlist"])) - { - if(is_array($_POST["catlist"])) - foreach($_POST["catlist"] as $catid) - { - $objCatList->Delete_Category($catid); - - } - $application->StoreVar('refresh_tree', 1); - } - } - break; + if(isset($_POST["catlist"])) + { + if(is_array($_POST["catlist"])) + foreach ($_POST["catlist"] as $catid) { + $objCatList->Delete_Category($catid, true); + } + $application->StoreVar('refresh_tree', 1); + } + break; + case "m_cat_cut": if($ro_perm) break; if(isset($_POST["catlist"])) Index: branches/unlabeled/unlabeled-1.106.2/globals.php =================================================================== diff -u -r5359 -r5401 --- branches/unlabeled/unlabeled-1.106.2/globals.php (.../globals.php) (revision 5359) +++ branches/unlabeled/unlabeled-1.106.2/globals.php (.../globals.php) (revision 5401) @@ -249,7 +249,7 @@ Function QueryCount($sql) { $sql = preg_replace('/SELECT(.*)FROM[ \n\r](.*)/is','SELECT COUNT(*) AS TableCount FROM $2', $sql); - $sql = preg_replace('/(.*)LIMIT(.*)/is','$1', $sql); + $sql = preg_replace('/(.*)[ \n\r]LIMIT[ \n\r](.*)/is','$1', $sql); $sql = preg_replace('/(.*)ORDER BY(.*)/is','$1', $sql); //echo $sql; Index: branches/unlabeled/unlabeled-1.24.2/admin/advanced_view.php =================================================================== diff -u -r5359 -r5401 --- branches/unlabeled/unlabeled-1.24.2/admin/advanced_view.php (.../advanced_view.php) (revision 5359) +++ branches/unlabeled/unlabeled-1.24.2/admin/advanced_view.php (.../advanced_view.php) (revision 5401) @@ -20,6 +20,7 @@ } $start = k4getmicrotime(); +define('ADVANCED_VIEW', 1); // new startup: begin define('REL_PATH', 'admin'); Index: branches/unlabeled/unlabeled-1.54.2/kernel/include/category.php =================================================================== diff -u -r4946 -r5401 --- branches/unlabeled/unlabeled-1.54.2/kernel/include/category.php (.../category.php) (revision 4946) +++ branches/unlabeled/unlabeled-1.54.2/kernel/include/category.php (.../category.php) (revision 5401) @@ -2313,16 +2313,27 @@ return $dest->Get("CategoryId"); } - function Delete_Category($Id) + function Delete_Category($Id, $check_perm = false) { global $objSession; $d =& $this->GetCategory($Id); - if(is_object($d)) - { - if($d->Get("CategoryId")==$Id) - { + if (is_object($d)) { + $perm_status = true; + if ($check_perm) { + if (defined('ADVANCED_VIEW') && ADVANCED_VIEW) { + // check by this cat parent category + $check_cat = $d->Get('ParentId'); + } + else { + // check by current category + $check_cat = $this->CurrentCategoryID(); + } + $perm_status = $objSession->HasCatPermission('CATEGORY.DELETE', $check_cat); + } + + if (($d->Get("CategoryId") == $Id) && $perm_status) { $d->SendUserEventMail("CATEGORY.DELETE",$objSession->Get("PortalUserId")); $d->SendAdminEventMail("CATEGORY.DELETE"); $p =& $this->GetCategory($d->Get("ParentId"));