Commit 383b343596e5f4cb1980856ab742c12e1113995f
1 parent
d405ecb7
Merged in from DEV trunk...
KTS-2890 "Search results run off page on IE 7, FF, Safari" Fixed. Committed By: Conrad Vermeulen Reviewed By: Johnathan Byrne KTS-2891 "Search widget is too big as it is invisible when the screen resolution is low" Fixed. Added support for Safari Committed By: Conrad Vermeulen Reviewed By: Jonathan Bryne KTS-2816 "User without permissions is notes as having all permissions upon 'View resolved permissins for users'" Fixed. Fixed problems in the user hasPermission function. Committed By: Jonathan Byrne Reviewed By: Jalaloedien Abrahams git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8100 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
15 additions
and
13 deletions
lib/users/User.inc
| ... | ... | @@ -499,22 +499,22 @@ class User extends KTEntity { |
| 499 | 499 | |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - function hasPermission(&$oPermissionDescriptor) { | |
| 502 | + function hasPermission(&$oPermissionDescriptor, $iUserId = null) { | |
| 503 | + if(empty($iUserId)){ | |
| 504 | + $iUserId = $_SESSION['iUserId']; | |
| 505 | + } | |
| 506 | + | |
| 503 | 507 | $pdgTable = KTUtil::getTableName('permission_descriptor_groups'); |
| 504 | 508 | global $default; |
| 505 | 509 | $uglTable = $default->users_groups_table; |
| 506 | 510 | |
| 507 | - $sQuery = "SELECT COUNT(*) AS num FROM $pdgTable INNER JOIN " . | |
| 508 | - "$uglTable ON $uglTable.group_id=$pdgTable.group_id" . | |
| 509 | - "WHERE $pdgTable.descriptor_id = ? AND " . | |
| 510 | - "$uglTable.user_id=?"; | |
| 511 | - $aParams = array($oPermissionDescriptor->getID()); | |
| 512 | - $aParams[] = $this->iId; | |
| 511 | + $sQuery = "SELECT COUNT(*) AS num FROM $pdgTable pd | |
| 512 | + INNER JOIN $uglTable ug ON ug.group_id = pd.group_id | |
| 513 | + WHERE pd.descriptor_id = ? AND ug.user_id = ?"; | |
| 514 | + | |
| 515 | + $aParams = array($oPermissionDescriptor->getID(), $iUserId); | |
| 513 | 516 | $res = DBUtil::getOneResultKey(array($sQuery, $aParams), 'num'); |
| 514 | - if (PEAR::isError($res)) { | |
| 515 | - return $res; | |
| 516 | - } | |
| 517 | - if ((int)$res === 0) { | |
| 517 | + if (PEAR::isError($res) || empty($res)) { | |
| 518 | 518 | return false; |
| 519 | 519 | } |
| 520 | 520 | return true; | ... | ... |
plugins/ktcore/folder/Permissions.php
| ... | ... | @@ -216,7 +216,7 @@ class KTFolderPermissionsAction extends KTFolderAction { |
| 216 | 216 | // TODO : paginate this page, when there are too many users |
| 217 | 217 | foreach ($aUsers as $oUser) { |
| 218 | 218 | if ($everyone || ($authenticated && $oUser->isAnonymous()) || |
| 219 | - $oUser->hasPermission($oDescriptor)) { | |
| 219 | + $oUser->hasPermission($oDescriptor, $oUser->getId())) { | |
| 220 | 220 | $aMapPermissionUser[$iPermissionID][$oUser->getId()] = true; |
| 221 | 221 | } |
| 222 | 222 | } | ... | ... |
resources/js/search2widget.js
templates/ktcore/search2/search_results.smarty
| ... | ... | @@ -129,7 +129,7 @@ function onShowAll(showall) |
| 129 | 129 | {else} |
| 130 | 130 | |
| 131 | 131 | <form method=post action="/action.php"> |
| 132 | - <table border=0 cellpadding="1" cellspacing="1" width="800px" align=center> | |
| 132 | + <table border=0 cellpadding="1" cellspacing="1" width="100%" align=center> | |
| 133 | 133 | {assign var=cbid value=0} |
| 134 | 134 | |
| 135 | 135 | {foreach item=document from=$results} | ... | ... |