当前位置: 首页>>代码示例>>PHP>>正文


PHP BackendUserAuthentication::workspaceAllowAutoCreation方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Authentication\BackendUserAuthentication::workspaceAllowAutoCreation方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUserAuthentication::workspaceAllowAutoCreation方法的具体用法?PHP BackendUserAuthentication::workspaceAllowAutoCreation怎么用?PHP BackendUserAuthentication::workspaceAllowAutoCreation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Authentication\BackendUserAuthentication的用法示例。


在下文中一共展示了BackendUserAuthentication::workspaceAllowAutoCreation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process_datamap


//.........这里部分代码省略.........
                         $propArr = $this->getRecordProperties($table, $id);
                         $this->log($table, $id, 2, 0, 1, 'Attempt to modify record \'%s\' (%s) without permission. Or non-existing page.', 2, array($propArr['header'], $table . ':' . $id), $propArr['event_pid']);
                     }
                     continue;
                 }
                 // Next check of the record permissions (internals)
                 $recordAccess = $this->BE_USER->recordEditAccessInternals($table, $id);
                 if (!$recordAccess) {
                     if ($this->enableLogging) {
                         $this->newlog('recordEditAccessInternals() check failed. [' . $this->BE_USER->errorMsg . ']', 1);
                     }
                 } else {
                     // Here we fetch the PID of the record that we point to...
                     $tempdata = $this->recordInfo($table, $id, 'pid' . ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ? ',t3ver_wsid,t3ver_stage' : ''));
                     $theRealPid = $tempdata['pid'];
                     // Use the new id of the versionized record we're trying to write to:
                     // (This record is a child record of a parent and has already been versionized.)
                     if ($this->autoVersionIdMap[$table][$id]) {
                         // For the reason that creating a new version of this record, automatically
                         // created related child records (e.g. "IRRE"), update the accordant field:
                         $this->getVersionizedIncomingFieldArray($table, $id, $incomingFieldArray, $registerDBList);
                         // Use the new id of the copied/versionized record:
                         $id = $this->autoVersionIdMap[$table][$id];
                         $recordAccess = true;
                         $this->autoVersioningUpdate = true;
                     } elseif (!$this->bypassWorkspaceRestrictions && ($errorCode = $this->BE_USER->workspaceCannotEditRecord($table, $tempdata))) {
                         $recordAccess = false;
                         // Versioning is required and it must be offline version!
                         // Check if there already is a workspace version
                         $WSversion = BackendUtility::getWorkspaceVersionOfRecord($this->BE_USER->workspace, $table, $id, 'uid,t3ver_oid');
                         if ($WSversion) {
                             $id = $WSversion['uid'];
                             $recordAccess = true;
                         } elseif ($this->BE_USER->workspaceAllowAutoCreation($table, $id, $theRealPid)) {
                             // new version of a record created in a workspace - so always refresh pagetree to indicate there is a change in the workspace
                             $this->pagetreeNeedsRefresh = true;
                             /** @var $tce DataHandler */
                             $tce = GeneralUtility::makeInstance(__CLASS__);
                             $tce->stripslashes_values = false;
                             // Setting up command for creating a new version of the record:
                             $cmd = array();
                             $cmd[$table][$id]['version'] = array('action' => 'new', 'treeLevels' => -1, 'label' => 'Auto-created for WS #' . $this->BE_USER->workspace);
                             $tce->start(array(), $cmd);
                             $tce->process_cmdmap();
                             $this->errorLog = array_merge($this->errorLog, $tce->errorLog);
                             // If copying was successful, share the new uids (also of related children):
                             if ($tce->copyMappingArray[$table][$id]) {
                                 foreach ($tce->copyMappingArray as $origTable => $origIdArray) {
                                     foreach ($origIdArray as $origId => $newId) {
                                         $this->uploadedFileArray[$origTable][$newId] = $this->uploadedFileArray[$origTable][$origId];
                                         $this->autoVersionIdMap[$origTable][$origId] = $newId;
                                     }
                                 }
                                 ArrayUtility::mergeRecursiveWithOverrule($this->RTEmagic_copyIndex, $tce->RTEmagic_copyIndex);
                                 // See where RTEmagic_copyIndex is used inside fillInFieldArray() for more information...
                                 // Update registerDBList, that holds the copied relations to child records:
                                 $registerDBList = array_merge($registerDBList, $tce->registerDBList);
                                 // For the reason that creating a new version of this record, automatically
                                 // created related child records (e.g. "IRRE"), update the accordant field:
                                 $this->getVersionizedIncomingFieldArray($table, $id, $incomingFieldArray, $registerDBList);
                                 // Use the new id of the copied/versionized record:
                                 $id = $this->autoVersionIdMap[$table][$id];
                                 $recordAccess = true;
                                 $this->autoVersioningUpdate = true;
                             } elseif ($this->enableLogging) {
                                 $this->newlog('Could not be edited in offline workspace in the branch where found (failure state: \'' . $errorCode . '\'). Auto-creation of version failed!', 1);
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:67,代码来源:DataHandler.php


注:本文中的TYPO3\CMS\Core\Authentication\BackendUserAuthentication::workspaceAllowAutoCreation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。