Commit 59523eab1e13eae3ec1ab55db6e1af10ce43ee65
1 parent
27001530
Merged in from DEV trunk...
"KTS-1377" "Not to delete roles when overriding inherited assigning of roles" Fixed. When the role is created, the users and groups should be inherited from the parent role. Reviewed By: Kevin Fourie "KTS-2023" "Fatal Error when clicking 'backup now' btn on the Upgrade Wizard" Fixed. Reviewed By: Kevin Fourie "KTS-1303" "Plugin and indexer paths are saved in the DB" Fixed. Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6712 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
31 additions
and
2 deletions
lib/plugins/plugin.inc.php
| ... | ... | @@ -364,7 +364,7 @@ class KTPlugin { |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | function stripKtDir($sFilename) { |
| 367 | - if (strpos($sFilename, KT_DIR) === 0) { | |
| 367 | + if (strpos($sFilename, KT_DIR) === 0 ||strpos($sFilename, realpath(KT_DIR)) === 0) { | |
| 368 | 368 | return substr($sFilename, strlen(KT_DIR) + 1); |
| 369 | 369 | } |
| 370 | 370 | return $sFilename; | ... | ... |
plugins/ktcore/KTPermissions.php
| ... | ... | @@ -432,6 +432,35 @@ class KTRoleAllocationPlugin extends KTFolderAction { |
| 432 | 432 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), |
| 433 | 433 | ); |
| 434 | 434 | $this->oValidator->notErrorFalse($oTransaction, $aOptions); |
| 435 | + | |
| 436 | + // inherit parent permissions | |
| 437 | + $oParentAllocation = RoleAllocation::getAllocationsForFolderAndRole($this->oFolder->getParentID(), $role_id); | |
| 438 | + if (!is_null($oParentAllocation) && !PEAR::isError($oParentAllocation)) | |
| 439 | + { | |
| 440 | + $oPD = $oParentAllocation->getPermissionDescriptor(); | |
| 441 | + | |
| 442 | + $aAllowed = $oPD->getAllowed(); | |
| 443 | + $userids=$aAllowed['user']; | |
| 444 | + $groupids=$aAllowed['group']; | |
| 445 | + | |
| 446 | + // now lets update for the new allocation | |
| 447 | + $oPD = $oRoleAllocation->getPermissionDescriptor(); | |
| 448 | + | |
| 449 | + $aAllowed = $oPD->getAllowed(); | |
| 450 | + | |
| 451 | + $aAllowed['user'] = $userids; | |
| 452 | + $aAllowed['group'] = $groupids; | |
| 453 | + | |
| 454 | + $oRoleAllocation->setAllowed($aAllowed); | |
| 455 | + $res = $oRoleAllocation->update(); | |
| 456 | + | |
| 457 | + if (PEAR::isError($res) || ($res == false)) | |
| 458 | + { | |
| 459 | + $this->errorRedirectToMain(_kt('Failed to create the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId())); | |
| 460 | + } | |
| 461 | + } | |
| 462 | + | |
| 463 | + // regenerate permissions | |
| 435 | 464 | |
| 436 | 465 | $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId()); |
| 437 | 466 | ... | ... |
setup/upgrade.php