當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。