diff --git a/lib/users/User.inc b/lib/users/User.inc index 91eba61..7c096ed 100644 --- a/lib/users/User.inc +++ b/lib/users/User.inc @@ -499,22 +499,22 @@ class User extends KTEntity { } - function hasPermission(&$oPermissionDescriptor) { + function hasPermission(&$oPermissionDescriptor, $iUserId = null) { + if(empty($iUserId)){ + $iUserId = $_SESSION['iUserId']; + } + $pdgTable = KTUtil::getTableName('permission_descriptor_groups'); global $default; $uglTable = $default->users_groups_table; - $sQuery = "SELECT COUNT(*) AS num FROM $pdgTable INNER JOIN " . - "$uglTable ON $uglTable.group_id=$pdgTable.group_id" . - "WHERE $pdgTable.descriptor_id = ? AND " . - "$uglTable.user_id=?"; - $aParams = array($oPermissionDescriptor->getID()); - $aParams[] = $this->iId; + $sQuery = "SELECT COUNT(*) AS num FROM $pdgTable pd + INNER JOIN $uglTable ug ON ug.group_id = pd.group_id + WHERE pd.descriptor_id = ? AND ug.user_id = ?"; + + $aParams = array($oPermissionDescriptor->getID(), $iUserId); $res = DBUtil::getOneResultKey(array($sQuery, $aParams), 'num'); - if (PEAR::isError($res)) { - return $res; - } - if ((int)$res === 0) { + if (PEAR::isError($res) || empty($res)) { return false; } return true; diff --git a/plugins/ktcore/folder/Permissions.php b/plugins/ktcore/folder/Permissions.php index 1295f84..5a44c3e 100644 --- a/plugins/ktcore/folder/Permissions.php +++ b/plugins/ktcore/folder/Permissions.php @@ -216,7 +216,7 @@ class KTFolderPermissionsAction extends KTFolderAction { // TODO : paginate this page, when there are too many users foreach ($aUsers as $oUser) { if ($everyone || ($authenticated && $oUser->isAnonymous()) || - $oUser->hasPermission($oDescriptor)) { + $oUser->hasPermission($oDescriptor, $oUser->getId())) { $aMapPermissionUser[$iPermissionID][$oUser->getId()] = true; } } diff --git a/resources/js/search2widget.js b/resources/js/search2widget.js index a82fd8c..7f48657 100644 --- a/resources/js/search2widget.js +++ b/resources/js/search2widget.js @@ -191,6 +191,8 @@ function createSearchBar(div, suffix) if (suffix == 1) { el.applyStyles('position:relative; top: -15px; margin-right: 15px'); + if (Ext.isSafari) + el.applyStyles('top: 0px'); } else { diff --git a/templates/ktcore/search2/search_results.smarty b/templates/ktcore/search2/search_results.smarty index 61c1f60..8286f92 100644 --- a/templates/ktcore/search2/search_results.smarty +++ b/templates/ktcore/search2/search_results.smarty @@ -129,7 +129,7 @@ function onShowAll(showall) {else}