Commit 767df718ecc6cdbee6838867a06fc8762277f384
1 parent
937569ea
KTS-1687
"Double quote to single quote conversion" Fixed. KTS-1616 "Changing permissions error appears: Call to undefined function: getname()" Fixed. Problem mainly due to db referential integrity issues. Reviewed by: Jalalodien Abrahams git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6270 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
58 additions
and
52 deletions
plugins/ktcore/folder/Permissions.php
| @@ -6,15 +6,15 @@ require_once(KT_LIB_DIR . '/permissions/permission.inc.php'); | @@ -6,15 +6,15 @@ require_once(KT_LIB_DIR . '/permissions/permission.inc.php'); | ||
| 6 | require_once(KT_LIB_DIR . '/permissions/permissionutil.inc.php'); | 6 | require_once(KT_LIB_DIR . '/permissions/permissionutil.inc.php'); |
| 7 | require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); | 7 | require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); |
| 8 | 8 | ||
| 9 | -require_once(KT_LIB_DIR . "/foldermanagement/folderutil.inc.php"); | 9 | +require_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); |
| 10 | 10 | ||
| 11 | require_once(KT_LIB_DIR . '/roles/Role.inc'); | 11 | require_once(KT_LIB_DIR . '/roles/Role.inc'); |
| 12 | 12 | ||
| 13 | class KTFolderPermissionsAction extends KTFolderAction { | 13 | class KTFolderPermissionsAction extends KTFolderAction { |
| 14 | var $sName = 'ktcore.actions.folder.permissions'; | 14 | var $sName = 'ktcore.actions.folder.permissions'; |
| 15 | 15 | ||
| 16 | - var $_sEditShowPermission = "ktcore.permissions.security"; | ||
| 17 | - var $_sShowPermission = "ktcore.permissions.security"; | 16 | + var $_sEditShowPermission = 'ktcore.permissions.security'; |
| 17 | + var $_sShowPermission = 'ktcore.permissions.security'; | ||
| 18 | var $_bAdminAlwaysAvailable = true; | 18 | var $_bAdminAlwaysAvailable = true; |
| 19 | var $bAutomaticTransaction = true; | 19 | var $bAutomaticTransaction = true; |
| 20 | 20 | ||
| @@ -23,8 +23,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -23,8 +23,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | function do_main() { | 25 | function do_main() { |
| 26 | - $this->oPage->setBreadcrumbDetails(_kt("Permissions")); | ||
| 27 | - $oTemplate = $this->oValidator->validateTemplate("ktcore/folder/view_permissions"); | 26 | + $this->oPage->setBreadcrumbDetails(_kt('Permissions')); |
| 27 | + $oTemplate = $this->oValidator->validateTemplate('ktcore/folder/view_permissions'); | ||
| 28 | 28 | ||
| 29 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectID()); | 29 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectID()); |
| 30 | $aPermissions = KTPermission::getList(); | 30 | $aPermissions = KTPermission::getList(); |
| @@ -75,18 +75,21 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -75,18 +75,21 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 75 | // this should be quite limited - direct role -> user assignment is typically rare. | 75 | // this should be quite limited - direct role -> user assignment is typically rare. |
| 76 | foreach ($aActiveUsers as $id => $marker) { | 76 | foreach ($aActiveUsers as $id => $marker) { |
| 77 | $oUser = User::get($id); | 77 | $oUser = User::get($id); |
| 78 | + if (is_null($oUser)) continue; // this is just a patch in case there is a db integrity issue. | ||
| 78 | $users[$oUser->getName()] = $oUser; | 79 | $users[$oUser->getName()] = $oUser; |
| 79 | } | 80 | } |
| 80 | asort($users); // ascending, per convention. | 81 | asort($users); // ascending, per convention. |
| 81 | 82 | ||
| 82 | foreach ($aActiveGroups as $id => $marker) { | 83 | foreach ($aActiveGroups as $id => $marker) { |
| 83 | $oGroup = Group::get($id); | 84 | $oGroup = Group::get($id); |
| 85 | + if (is_null($oGroup)) continue; // this is just a patch in case there is a db integrity issue. | ||
| 84 | $groups[$oGroup->getName()] = $oGroup; | 86 | $groups[$oGroup->getName()] = $oGroup; |
| 85 | } | 87 | } |
| 86 | asort($groups); | 88 | asort($groups); |
| 87 | 89 | ||
| 88 | foreach ($aActiveRoles as $id => $marker) { | 90 | foreach ($aActiveRoles as $id => $marker) { |
| 89 | $oRole = Role::get($id); | 91 | $oRole = Role::get($id); |
| 92 | + if (is_null($oRole)) continue; // this is just a patch in case there is a db integrity issue. | ||
| 90 | $roles[$oRole->getName()] = $oRole; | 93 | $roles[$oRole->getName()] = $oRole; |
| 91 | } | 94 | } |
| 92 | asort($roles); | 95 | asort($roles); |
| @@ -102,7 +105,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -102,7 +105,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 102 | // from a folder. | 105 | // from a folder. |
| 103 | if ($oInherited->getId() !== $this->oFolder->getId()) { | 106 | if ($oInherited->getId() !== $this->oFolder->getId()) { |
| 104 | $iInheritedFolderId = $oInherited->getId(); | 107 | $iInheritedFolderId = $oInherited->getId(); |
| 105 | - $sInherited = join(" » ", $oInherited->getPathArray()); | 108 | + $sInherited = join(' » ', $oInherited->getPathArray()); |
| 106 | } | 109 | } |
| 107 | // only allow inheritance if not inherited, -and- folders is editable | 110 | // only allow inheritance if not inherited, -and- folders is editable |
| 108 | $bInheritable = $bEdit && ($oInherited->getId() !== $this->oFolder->getId()); | 111 | $bInheritable = $bEdit && ($oInherited->getId() !== $this->oFolder->getId()); |
| @@ -114,9 +117,11 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -114,9 +117,11 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 114 | 117 | ||
| 115 | foreach ($aDynConditions as $oDynCondition) { | 118 | foreach ($aDynConditions as $oDynCondition) { |
| 116 | $g = Group::get($oDynCondition->getGroupId()); | 119 | $g = Group::get($oDynCondition->getGroupId()); |
| 117 | - | 120 | + if (is_null($g)) continue; // db integrity catch |
| 121 | + | ||
| 118 | if (PEAR::isError($g)) { continue; } | 122 | if (PEAR::isError($g)) { continue; } |
| 119 | - $c = KTSavedSearch::get($oDynCondition->getConditionId()); | 123 | + $c = KTSavedSearch::get($oDynCondition->getConditionId()); |
| 124 | + if (is_null($c)) continue; // db integrity catch | ||
| 120 | if (PEAR::isError($c)) { continue; } | 125 | if (PEAR::isError($c)) { continue; } |
| 121 | 126 | ||
| 122 | $aInfo = array( | 127 | $aInfo = array( |
| @@ -133,18 +138,18 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -133,18 +138,18 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 133 | } | 138 | } |
| 134 | 139 | ||
| 135 | $aTemplateData = array( | 140 | $aTemplateData = array( |
| 136 | - "context" => $this, | ||
| 137 | - "permissions" => $aPermissions, | ||
| 138 | - "groups" => $groups, | ||
| 139 | - "users" => $users, | ||
| 140 | - "roles" => $roles, | ||
| 141 | - "oFolder" => $this->oFolder, | ||
| 142 | - "aMapPermissionGroup" => $aMapPermissionGroup, | ||
| 143 | - "aMapPermissionRole" => $aMapPermissionRole, | ||
| 144 | - "aMapPermissionUser" => $aMapPermissionUser, | ||
| 145 | - "edit" => $bEdit, | 141 | + 'context' => $this, |
| 142 | + 'permissions' => $aPermissions, | ||
| 143 | + 'groups' => $groups, | ||
| 144 | + 'users' => $users, | ||
| 145 | + 'roles' => $roles, | ||
| 146 | + 'oFolder' => $this->oFolder, | ||
| 147 | + 'aMapPermissionGroup' => $aMapPermissionGroup, | ||
| 148 | + 'aMapPermissionRole' => $aMapPermissionRole, | ||
| 149 | + 'aMapPermissionUser' => $aMapPermissionUser, | ||
| 150 | + 'edit' => $bEdit, | ||
| 146 | 'inheritable' => $bInheritable, | 151 | 'inheritable' => $bInheritable, |
| 147 | - "inherited" => $sInherited, | 152 | + 'inherited' => $sInherited, |
| 148 | 'foldername' => $this->oFolder->getName(), | 153 | 'foldername' => $this->oFolder->getName(), |
| 149 | 'conditions' => $aConditions, | 154 | 'conditions' => $aConditions, |
| 150 | ); | 155 | ); |
| @@ -152,8 +157,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -152,8 +157,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 152 | } | 157 | } |
| 153 | 158 | ||
| 154 | function do_resolved_users() { | 159 | function do_resolved_users() { |
| 155 | - $this->oPage->setBreadcrumbDetails(_kt("Permissions")); | ||
| 156 | - $oTemplate = $this->oValidator->validateTemplate("ktcore/folder/resolved_permissions_user"); | 160 | + $this->oPage->setBreadcrumbDetails(_kt('Permissions')); |
| 161 | + $oTemplate = $this->oValidator->validateTemplate('ktcore/folder/resolved_permissions_user'); | ||
| 157 | 162 | ||
| 158 | $oPL = KTPermissionLookup::get($this->oFolder->getPermissionLookupID()); | 163 | $oPL = KTPermissionLookup::get($this->oFolder->getPermissionLookupID()); |
| 159 | $aPermissions = KTPermission::getList(); | 164 | $aPermissions = KTPermission::getList(); |
| @@ -187,6 +192,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -187,6 +192,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 187 | // this should be quite limited - direct role -> user assignment is typically rare. | 192 | // this should be quite limited - direct role -> user assignment is typically rare. |
| 188 | foreach ($aActiveUsers as $id => $marker) { | 193 | foreach ($aActiveUsers as $id => $marker) { |
| 189 | $oUser = User::get($id); | 194 | $oUser = User::get($id); |
| 195 | + if (is_null($oUser)) continue; | ||
| 190 | $users[$oUser->getName()] = $oUser; | 196 | $users[$oUser->getName()] = $oUser; |
| 191 | } | 197 | } |
| 192 | asort($users); // ascending, per convention. | 198 | asort($users); // ascending, per convention. |
| @@ -195,19 +201,19 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -195,19 +201,19 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 195 | $sInherited = ''; | 201 | $sInherited = ''; |
| 196 | 202 | ||
| 197 | $aTemplateData = array( | 203 | $aTemplateData = array( |
| 198 | - "context" => $this, | ||
| 199 | - "permissions" => $aPermissions, | ||
| 200 | - "groups" => $groups, | ||
| 201 | - "users" => $users, | ||
| 202 | - "roles" => $roles, | ||
| 203 | - "oFolder" => $this->oFolder, | ||
| 204 | - "aMapPermissionGroup" => $aMapPermissionGroup, | ||
| 205 | - "aMapPermissionRole" => $aMapPermissionRole, | ||
| 206 | - "aMapPermissionUser" => $aMapPermissionUser, | ||
| 207 | - "edit" => $bEdit, | ||
| 208 | - "inherited" => $sInherited, | 204 | + 'context' => $this, |
| 205 | + 'permissions' => $aPermissions, | ||
| 206 | + 'groups' => $groups, | ||
| 207 | + 'users' => $users, | ||
| 208 | + 'roles' => $roles, | ||
| 209 | + 'oFolder' => $this->oFolder, | ||
| 210 | + 'aMapPermissionGroup' => $aMapPermissionGroup, | ||
| 211 | + 'aMapPermissionRole' => $aMapPermissionRole, | ||
| 212 | + 'aMapPermissionUser' => $aMapPermissionUser, | ||
| 213 | + 'edit' => $bEdit, | ||
| 214 | + 'inherited' => $sInherited, | ||
| 209 | 'foldername' => $this->oFolder->getName(), | 215 | 'foldername' => $this->oFolder->getName(), |
| 210 | - "iFolderId" => $this->oFolder->getId(), | 216 | + 'iFolderId' => $this->oFolder->getId(), |
| 211 | ); | 217 | ); |
| 212 | return $oTemplate->render($aTemplateData); | 218 | return $oTemplate->render($aTemplateData); |
| 213 | } | 219 | } |
| @@ -226,7 +232,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -226,7 +232,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 226 | function _copyPermissions() { | 232 | function _copyPermissions() { |
| 227 | $oTransaction = KTFolderTransaction::createFromArray(array( | 233 | $oTransaction = KTFolderTransaction::createFromArray(array( |
| 228 | 'folderid' => $this->oFolder->getId(), | 234 | 'folderid' => $this->oFolder->getId(), |
| 229 | - 'comment' => "Override permissions from parent", | 235 | + 'comment' => 'Override permissions from parent', |
| 230 | 'transactionNS' => 'ktcore.transactions.permissions_change', | 236 | 'transactionNS' => 'ktcore.transactions.permissions_change', |
| 231 | 'userid' => $_SESSION['userID'], | 237 | 'userid' => $_SESSION['userID'], |
| 232 | 'ip' => Session::getClientIP(), | 238 | 'ip' => Session::getClientIP(), |
| @@ -242,7 +248,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -242,7 +248,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 242 | 248 | ||
| 243 | 249 | ||
| 244 | function do_edit() { | 250 | function do_edit() { |
| 245 | - $this->oPage->setBreadcrumbDetails(_kt("Viewing Permissions")); | 251 | + $this->oPage->setBreadcrumbDetails(_kt('Viewing Permissions')); |
| 246 | 252 | ||
| 247 | 253 | ||
| 248 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); | 254 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); |
| @@ -257,7 +263,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -257,7 +263,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 257 | if ($oInherited->getId() !== $this->oFolder->getId()) { | 263 | if ($oInherited->getId() !== $this->oFolder->getId()) { |
| 258 | $override = KTUtil::arrayGet($_REQUEST, 'override', false); | 264 | $override = KTUtil::arrayGet($_REQUEST, 'override', false); |
| 259 | if (empty($override)) { | 265 | if (empty($override)) { |
| 260 | - $this->errorRedirectToMain(_kt("This folder does not override its permissions"), sprintf("fFolderId=%d", $this->oFolder->getId())); | 266 | + $this->errorRedirectToMain(_kt('This folder does not override its permissions'), sprintf('fFolderId=%d', $this->oFolder->getId())); |
| 261 | } | 267 | } |
| 262 | $this->startTransaction(); | 268 | $this->startTransaction(); |
| 263 | $this->_copyPermissions(); | 269 | $this->_copyPermissions(); |
| @@ -280,7 +286,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -280,7 +286,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 280 | 286 | ||
| 281 | // templating | 287 | // templating |
| 282 | $oTemplating =& KTTemplating::getSingleton(); | 288 | $oTemplating =& KTTemplating::getSingleton(); |
| 283 | - $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions"); | 289 | + $oTemplate = $oTemplating->loadTemplate('ktcore/folder/permissions'); |
| 284 | 290 | ||
| 285 | $bCanInherit = ($this->oFolder->getId() != 1); | 291 | $bCanInherit = ($this->oFolder->getId() != 1); |
| 286 | 292 | ||
| @@ -288,11 +294,11 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -288,11 +294,11 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 288 | $docperms = KTPermission::getDocumentRelevantList(); | 294 | $docperms = KTPermission::getDocumentRelevantList(); |
| 289 | 295 | ||
| 290 | $aTemplateData = array( | 296 | $aTemplateData = array( |
| 291 | - "iFolderId" => $this->oFolder->getId(), | 297 | + 'iFolderId' => $this->oFolder->getId(), |
| 292 | 'roles' => Role::getList(), | 298 | 'roles' => Role::getList(), |
| 293 | 'groups' => Group::getList(), | 299 | 'groups' => Group::getList(), |
| 294 | - "conditions" => KTSavedSearch::getConditions(), | ||
| 295 | - "dynamic_conditions" => $aDynamicConditions, | 300 | + 'conditions' => KTSavedSearch::getConditions(), |
| 301 | + 'dynamic_conditions' => $aDynamicConditions, | ||
| 296 | 'context' => &$this, | 302 | 'context' => &$this, |
| 297 | 'foldername' => $this->oFolder->getName(), | 303 | 'foldername' => $this->oFolder->getName(), |
| 298 | 'jsonpermissions' => $sJSONPermissions, | 304 | 'jsonpermissions' => $sJSONPermissions, |
| @@ -309,7 +315,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -309,7 +315,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 309 | return array('error' => true, | 315 | return array('error' => true, |
| 310 | 'type' => 'kt.permission_denied', | 316 | 'type' => 'kt.permission_denied', |
| 311 | 'alert' => true, | 317 | 'alert' => true, |
| 312 | - 'message' => _kt("You do not have permission to alter security settings.")); | 318 | + 'message' => _kt('You do not have permission to alter security settings.')); |
| 313 | } | 319 | } |
| 314 | 320 | ||
| 315 | function &_getPermissionsMap() { | 321 | function &_getPermissionsMap() { |
| @@ -368,7 +374,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -368,7 +374,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 368 | $aEntityList = array(); | 374 | $aEntityList = array(); |
| 369 | } | 375 | } |
| 370 | 376 | ||
| 371 | - $aGroups = Group::getList(sprintf('name like "%%%s%%"', $sFilter)); | 377 | + $aGroups = Group::getList(sprintf('name like \'%%%s%%\'', $sFilter)); |
| 372 | foreach($aGroups as $oGroup) { | 378 | foreach($aGroups as $oGroup) { |
| 373 | $aPerm = @array_keys($aPermissionsMap['group'][$oGroup->getId()]); | 379 | $aPerm = @array_keys($aPermissionsMap['group'][$oGroup->getId()]); |
| 374 | if(!is_array($aPerm)) { | 380 | if(!is_array($aPerm)) { |
| @@ -391,7 +397,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -391,7 +397,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 391 | } | 397 | } |
| 392 | } | 398 | } |
| 393 | 399 | ||
| 394 | - $aRoles = Role::getList(sprintf('name like "%%%s%%"', $sFilter)); | 400 | + $aRoles = Role::getList(sprintf('name like \'%%%s%%\'', $sFilter)); |
| 395 | foreach($aRoles as $oRole) { | 401 | foreach($aRoles as $oRole) { |
| 396 | $aPerm = @array_keys($aPermissionsMap['role'][$oRole->getId()]); | 402 | $aPerm = @array_keys($aPermissionsMap['role'][$oRole->getId()]); |
| 397 | if(!is_array($aPerm)) { | 403 | if(!is_array($aPerm)) { |
| @@ -425,7 +431,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -425,7 +431,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 425 | if (!KTBrowseUtil::inAdminMode($this->oUser, $this->oFolder)) { | 431 | if (!KTBrowseUtil::inAdminMode($this->oUser, $this->oFolder)) { |
| 426 | $this->oValidator->userHasPermissionOnItem($this->oUser, $this->_sEditShowPermission, $this->oFolder, $aOptions); | 432 | $this->oValidator->userHasPermissionOnItem($this->oUser, $this->_sEditShowPermission, $this->oFolder, $aOptions); |
| 427 | } | 433 | } |
| 428 | - require_once(KT_LIB_DIR . "/documentmanagement/observers.inc.php"); | 434 | + require_once(KT_LIB_DIR . '/documentmanagement/observers.inc.php'); |
| 429 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); | 435 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); |
| 430 | $aFoo = $_REQUEST['foo']; | 436 | $aFoo = $_REQUEST['foo']; |
| 431 | 437 | ||
| @@ -439,7 +445,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -439,7 +445,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 439 | 445 | ||
| 440 | $oTransaction = KTFolderTransaction::createFromArray(array( | 446 | $oTransaction = KTFolderTransaction::createFromArray(array( |
| 441 | 'folderid' => $this->oFolder->getId(), | 447 | 'folderid' => $this->oFolder->getId(), |
| 442 | - 'comment' => "Updated permissions", | 448 | + 'comment' => 'Updated permissions', |
| 443 | 'transactionNS' => 'ktcore.transactions.permissions_change', | 449 | 'transactionNS' => 'ktcore.transactions.permissions_change', |
| 444 | 'userid' => $_SESSION['userID'], | 450 | 'userid' => $_SESSION['userID'], |
| 445 | 'ip' => Session::getClientIP(), | 451 | 'ip' => Session::getClientIP(), |
| @@ -459,8 +465,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -459,8 +465,8 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 459 | 465 | ||
| 460 | $this->commitTransaction(); | 466 | $this->commitTransaction(); |
| 461 | 467 | ||
| 462 | - $this->addInfoMessage(_kt("Permissions on folder updated")); | ||
| 463 | - $po->redirect(KTUtil::addQueryString($_SERVER['PHP_SELF'], "action=edit&fFolderId=" . $this->oFolder->getId())); | 468 | + $this->addInfoMessage(_kt('Permissions on folder updated')); |
| 469 | + $po->redirect(KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=edit&fFolderId=' . $this->oFolder->getId())); | ||
| 464 | exit(0); | 470 | exit(0); |
| 465 | } | 471 | } |
| 466 | 472 | ||
| @@ -472,7 +478,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -472,7 +478,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 472 | } | 478 | } |
| 473 | $oTransaction = KTFolderTransaction::createFromArray(array( | 479 | $oTransaction = KTFolderTransaction::createFromArray(array( |
| 474 | 'folderid' => $this->oFolder->getId(), | 480 | 'folderid' => $this->oFolder->getId(), |
| 475 | - 'comment' => "Inherit permissions from parent", | 481 | + 'comment' => 'Inherit permissions from parent', |
| 476 | 'transactionNS' => 'ktcore.transactions.permissions_change', | 482 | 'transactionNS' => 'ktcore.transactions.permissions_change', |
| 477 | 'userid' => $_SESSION['userID'], | 483 | 'userid' => $_SESSION['userID'], |
| 478 | 'ip' => Session::getClientIP(), | 484 | 'ip' => Session::getClientIP(), |
| @@ -504,7 +510,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -504,7 +510,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 504 | 510 | ||
| 505 | $oTransaction = KTFolderTransaction::createFromArray(array( | 511 | $oTransaction = KTFolderTransaction::createFromArray(array( |
| 506 | 'folderid' => $this->oFolder->getId(), | 512 | 'folderid' => $this->oFolder->getId(), |
| 507 | - 'comment' => "Added dynamic permissions", | 513 | + 'comment' => 'Added dynamic permissions', |
| 508 | 'transactionNS' => 'ktcore.transactions.permissions_change', | 514 | 'transactionNS' => 'ktcore.transactions.permissions_change', |
| 509 | 'userid' => $_SESSION['userID'], | 515 | 'userid' => $_SESSION['userID'], |
| 510 | 'ip' => Session::getClientIP(), | 516 | 'ip' => Session::getClientIP(), |
| @@ -524,7 +530,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -524,7 +530,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 524 | $res = $oDynamicCondition->saveAssignment($aPermissionIds); | 530 | $res = $oDynamicCondition->saveAssignment($aPermissionIds); |
| 525 | $this->oValidator->notError($res, $aOptions); | 531 | $this->oValidator->notError($res, $aOptions); |
| 526 | KTPermissionUtil::updatePermissionLookupForPO($oPO); | 532 | KTPermissionUtil::updatePermissionLookupForPO($oPO); |
| 527 | - $this->successRedirectTo('edit', _kt("Dynamic permission added"), "fFolderId=" . $this->oFolder->getId()); | 533 | + $this->successRedirectTo('edit', _kt('Dynamic permission added'), 'fFolderId=' . $this->oFolder->getId()); |
| 528 | } | 534 | } |
| 529 | 535 | ||
| 530 | function do_removeDynamicCondition() { | 536 | function do_removeDynamicCondition() { |
| @@ -541,7 +547,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -541,7 +547,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 541 | 547 | ||
| 542 | $oTransaction = KTFolderTransaction::createFromArray(array( | 548 | $oTransaction = KTFolderTransaction::createFromArray(array( |
| 543 | 'folderid' => $this->oFolder->getId(), | 549 | 'folderid' => $this->oFolder->getId(), |
| 544 | - 'comment' => "Removed dynamic permissions", | 550 | + 'comment' => 'Removed dynamic permissions', |
| 545 | 'transactionNS' => 'ktcore.transactions.permissions_change', | 551 | 'transactionNS' => 'ktcore.transactions.permissions_change', |
| 546 | 'userid' => $_SESSION['userID'], | 552 | 'userid' => $_SESSION['userID'], |
| 547 | 'ip' => Session::getClientIP(), | 553 | 'ip' => Session::getClientIP(), |
| @@ -554,7 +560,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -554,7 +560,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 554 | 560 | ||
| 555 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); | 561 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); |
| 556 | KTPermissionUtil::updatePermissionLookupForPO($oPO); | 562 | KTPermissionUtil::updatePermissionLookupForPO($oPO); |
| 557 | - $this->successRedirectTo('edit', _kt("Dynamic permission removed"), "fFolderId=" . $this->oFolder->getId()); | 563 | + $this->successRedirectTo('edit', _kt('Dynamic permission removed'), 'fFolderId=' . $this->oFolder->getId()); |
| 558 | } | 564 | } |
| 559 | } | 565 | } |
| 560 | 566 |