153 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_mod_web_perm.xlf');
171 $this->perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
174 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
175 $this->doc->setModuleTemplate(
'EXT:perm/Resources/Private/Templates/perm.html');
176 $this->doc->form =
'<form action="' .
$GLOBALS[
'BACK_PATH'] .
'tce_db.php" method="post" name="editform">';
177 $this->doc->loadJavascriptLib(
'js/jsfunc.updateform.js');
178 $this->doc->getPageRenderer()->loadPrototype();
179 $this->doc->loadJavascriptLib(\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath(
'perm') .
'mod1/perm.js');
181 $this->doc->getContextMenuCode();
192 $level =
$GLOBALS[
'LANG']->getLL(
'levels');
193 $this->MOD_MENU = array(
215 $access = is_array($this->pageinfo);
217 if ($this->
id && $access ||
$GLOBALS[
'BE_USER']->isAdmin() && !$this->
id) {
218 if (
$GLOBALS[
'BE_USER']->isAdmin() && !$this->
id) {
219 $this->pageinfo = array(
'title' =>
'[root-level]',
'uid' => 0,
'pid' => 0);
222 $this->editingAllowed = $this->pageinfo[
'perms_userid'] ==
$GLOBALS[
'BE_USER']->user[
'uid'] ||
$GLOBALS[
'BE_USER']->isAdmin();
226 $this->doc->postCode .= $this->doc->wrapScriptTags(
' 227 setCheck("check[perms_user]", "data[pages][' . $this->
id .
'][perms_user]"); 228 setCheck("check[perms_group]", "data[pages][' . $this->
id .
'][perms_group]"); 229 setCheck("check[perms_everybody]", "data[pages][' . $this->
id .
'][perms_everybody]"); 234 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'permissions') . ($this->edit ?
': ' .
$GLOBALS[
'LANG']->getLL(
'Edit') :
''));
235 $vContent = $this->doc->getVersionSelector($this->
id, 1);
237 $this->content .= $this->doc->section(
'', $vContent);
248 $markers[
'CSH'] = $this->docHeaderButtons[
'csh'];
253 $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
256 $this->content = $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'permissions'));
259 $this->content = $this->doc->render(
$GLOBALS[
'LANG']->getLL(
'permissions'), $this->content);
268 $this->content = $this->doc->insertStylesAndJS($this->content);
286 $buttons[
'view'] =
'<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewonclick($this->pageinfo[
'uid'],
$GLOBALS[
'BACK_PATH'],
BackendUtility::BEgetRootLine($this->pageinfo[
'uid']))) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-document-view') .
'</a>';
288 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
289 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(
',', array_keys($this->MOD_MENU)), $this->MCONF[
'name']);
305 public function doEdit() {
306 if (
$GLOBALS[
'BE_USER']->workspace != 0) {
312 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
313 $defaultFlashMessageQueue->enqueue($flashMessage);
317 $beGroupKeys = array_keys($beGroupArray);
319 if (!
$GLOBALS[
'BE_USER']->isAdmin()) {
323 if (!
$GLOBALS[
'BE_USER']->isAdmin()) {
332 foreach ($beUserArray as
$uid => $row) {
333 if (
$uid == $this->pageinfo[
'perms_userid']) {
335 $selected =
' selected="selected"';
339 $options .=
'<option value="' .
$uid .
'"' . $selected .
'>' . htmlspecialchars($row[
'username']) .
'</option>';
341 $options =
'<option value="0"></option>' . $options;
342 $selector =
'<select name="data[pages][' . $this->
id .
'][perms_userid]">' . $options .
'</select>';
343 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'Owner'), $selector, TRUE);
348 foreach ($beGroupArray as
$uid => $row) {
349 if (
$uid == $this->pageinfo[
'perms_groupid']) {
351 $selected =
' selected="selected"';
355 $options .=
'<option value="' .
$uid .
'"' . $selected .
'>' . htmlspecialchars($row[
'title']) .
'</option>';
359 if (!$userset && $this->pageinfo[
'perms_groupid']) {
360 $options =
'<option value="' . $this->pageinfo[
'perms_groupid'] .
'" selected="selected">' . htmlspecialchars($beGroupArray_o[$this->pageinfo[
'perms_groupid']][
'title']) .
'</option>' . $options;
362 $options =
'<option value="0"></option>' . $options;
363 $selector =
'<select name="data[pages][' . $this->
id .
'][perms_groupid]">' . $options .
'</select>';
365 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'Group'), $selector, TRUE);
369 <table class="t3-table" id="typo3-permissionMatrix"> 373 <th>' .
$GLOBALS[
'LANG']->getLL(
'1', TRUE) .
'</th> 374 <th>' .
$GLOBALS[
'LANG']->getLL(
'16', TRUE) .
'</th> 375 <th>' .
$GLOBALS[
'LANG']->getLL(
'2', TRUE) .
'</th> 376 <th>' .
$GLOBALS[
'LANG']->getLL(
'4', TRUE) .
'</th> 377 <th>' .
$GLOBALS[
'LANG']->getLL(
'8', TRUE) .
'</th> 382 <td><strong>' .
$GLOBALS[
'LANG']->getLL(
'Owner', TRUE) .
'</strong></td> 390 <td><strong>' .
$GLOBALS[
'LANG']->getLL(
'Group', TRUE) .
'</strong></td> 398 <td><strong>' .
$GLOBALS[
'LANG']->getLL(
'Everybody', TRUE) .
'</strong></td> 408 <input type="hidden" name="data[pages][' . $this->
id .
'][perms_user]" value="' . $this->pageinfo[
'perms_user'] .
'" /> 409 <input type="hidden" name="data[pages][' . $this->
id .
'][perms_group]" value="' . $this->pageinfo[
'perms_group'] .
'" /> 410 <input type="hidden" name="data[pages][' . $this->
id .
'][perms_everybody]" value="' . $this->pageinfo[
'perms_everybody'] .
'" /> 413 <input type="hidden" name="redirect" value="' . htmlspecialchars((
BackendUtility::getModuleUrl(
'web_perm') .
'&mode=' . $this->MOD_SETTINGS[
'mode'] .
'&depth=' . $this->MOD_SETTINGS[
'depth'] .
'&id=' . (
int)$this->return_id .
'&lastEdited=' . $this->
id)) .
'" /> 417 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'permissions'), $code, TRUE);
423 if (
$GLOBALS[
'BE_USER']->uc[
'helpText']) {
424 $legendText =
'<p><strong>' .
$GLOBALS[
'LANG']->getLL(
'1', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'1_t', TRUE) .
'<br />';
425 $legendText .=
'<strong>' .
$GLOBALS[
'LANG']->getLL(
'16', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'16_t', TRUE) .
'<br />';
426 $legendText .=
'<strong>' .
$GLOBALS[
'LANG']->getLL(
'2', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'2_t', TRUE) .
'<br />';
427 $legendText .=
'<strong>' .
$GLOBALS[
'LANG']->getLL(
'4', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'4_t', TRUE) .
'<br />';
428 $legendText .=
'<strong>' .
$GLOBALS[
'LANG']->getLL(
'8', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'8_t', TRUE) .
'</p>';
430 $code = $legendText .
'<p>' .
$GLOBALS[
'LANG']->getLL(
'def', TRUE) .
'</p>';
432 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'Legend', TRUE), $code, TRUE);
442 public function notEdit() {
444 $beGroupKeys =
$GLOBALS[
'BE_USER']->userGroupsUID;
446 if (!
$GLOBALS[
'BE_USER']->isAdmin()) {
450 if (!
$GLOBALS[
'BE_USER']->isAdmin()) {
458 $code =
$GLOBALS[
'LANG']->getLL(
'Depth') .
': ';
460 $this->content .= $this->doc->section(
'', $code);
464 $tree->init(
'AND ' . $this->perms_clause);
465 $tree->addField(
'perms_user', 1);
466 $tree->addField(
'perms_group', 1);
467 $tree->addField(
'perms_everybody', 1);
468 $tree->addField(
'perms_userid', 1);
469 $tree->addField(
'perms_groupid', 1);
470 $tree->addField(
'hidden');
471 $tree->addField(
'fe_group');
472 $tree->addField(
'starttime');
473 $tree->addField(
'endtime');
474 $tree->addField(
'editlock');
478 $tree->tree[] = array(
'row' => $this->pageinfo,
'HTML' => $HTML);
481 $tree->getTree($this->
id, $this->MOD_SETTINGS[
'depth'],
'');
487 <th colspan="2"> </th> 488 <th>' .
$GLOBALS[
'LANG']->getLL(
'Owner', TRUE) .
'</th> 489 <th align="center">' .
$GLOBALS[
'LANG']->getLL(
'Group', TRUE) .
'</th> 490 <th align="center">' .
$GLOBALS[
'LANG']->getLL(
'Everybody', TRUE) .
'</th> 491 <th align="center">' .
$GLOBALS[
'LANG']->getLL(
'EditLock', TRUE) .
'</th> 497 foreach ($tree->tree as $data) {
499 $pageId = $data[
'row'][
'uid'];
502 $bgCol = $this->lastEdited == $pageId ?
' class="bgColor-20"' :
'';
506 $userName = $beUserArray[$data[
'row'][
'perms_userid']] ?
507 $beUserArray[$data[
'row'][
'perms_userid']][
'username'] :
508 ($data[
'row'][
'perms_userid'] ? $data[
'row'][
'perms_userid'] :
'');
510 if ($data[
'row'][
'perms_userid'] && !$beUserArray[$data[
'row'][
'perms_userid']]) {
516 $groupName = $beGroupArray[$data[
'row'][
'perms_groupid']] ?
517 $beGroupArray[$data[
'row'][
'perms_groupid']][
'title'] :
518 ($data[
'row'][
'perms_groupid'] ? $data[
'row'][
'perms_groupid'] :
'');
520 if ($data[
'row'][
'perms_groupid'] && !$beGroupArray[$data[
'row'][
'perms_groupid']]) {
527 $editPermsAllowed = $data[
'row'][
'perms_userid'] ==
$GLOBALS[
'BE_USER']->user[
'uid'] ||
$GLOBALS[
'BE_USER']->isAdmin();
530 $cellAttrib = $data[
'row'][
'_CSSCLASS'] ?
' class="' . $data[
'row'][
'_CSSCLASS'] .
'"' :
'';
531 $cells[] =
'<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) .
'>' .
535 if ($editPermsAllowed && $pageId) {
536 $aHref =
BackendUtility::getModuleUrl(
'web_perm') .
'&mode=' . $this->MOD_SETTINGS[
'mode'] .
'&depth=' . $this->MOD_SETTINGS[
'depth'] .
'&id=' . ($data[
'row'][
'_ORIG_uid'] ? $data[
'row'][
'_ORIG_uid'] : $pageId) .
'&return_id=' . $this->
id .
'&edit=1';
537 $cells[] =
'<td' . $bgCol .
'><a href="' . htmlspecialchars($aHref) .
'" title="' .
$GLOBALS[
'LANG']->getLL(
'ch_permissions', TRUE) .
'">' .
540 $cells[] =
'<td' . $bgCol .
'></td>';
547 <td' . $bgCol .
' nowrap="nowrap">' . ($data[
'row'][
'editlock'] ?
'<span id="el_' . $pageId .
'" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId .
'\', \
'1\');" title="' .
$GLOBALS[
'LANG']->getLL(
'EditLock_descr', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'status-warning-lock') .
'</a></span>' : ($pageId === 0 ?
'' :
'<span id="el_' . $pageId .
'" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId .
'\', \
'0\');" title="Enable the »Admin-only« edit lock for this page">[+]</a></span>')) .
'</td> 551 $code .=
'<tr>' . implode(
'', $cells) .
'</tr>';
555 $code =
'<table class="t3-table" id="typo3-permissionList">' . $code .
'</table>';
558 $this->content .= $this->doc->section(
'', $code);
564 $legendText =
'<strong>' .
$GLOBALS[
'LANG']->getLL(
'1', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'1_t', TRUE);
565 $legendText .=
'<br /><strong>' .
$GLOBALS[
'LANG']->getLL(
'16', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'16_t', TRUE);
566 $legendText .=
'<br /><strong>' .
$GLOBALS[
'LANG']->getLL(
'2', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'2_t', TRUE);
567 $legendText .=
'<br /><strong>' .
$GLOBALS[
'LANG']->getLL(
'4', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'4_t', TRUE);
568 $legendText .=
'<br /><strong>' .
$GLOBALS[
'LANG']->getLL(
'8', TRUE) .
'</strong>: ' .
$GLOBALS[
'LANG']->getLL(
'8_t', TRUE);
570 $code =
'<div id="permission-information"> 572 <div class="text">' . $legendText .
'</div></div>';
574 $code .=
'<div id="perm-legend">' .
$GLOBALS[
'LANG']->getLL(
'def', TRUE);
580 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'Legend') .
':', $code, TRUE, TRUE);
596 $onclick =
'checkChange(\'check[' . $checkName .
']\', \'data[pages][' .
$GLOBALS[
'SOBE']->id .
'][' . $checkName .
']\')';
597 return '<input type="checkbox" name="check[' . $checkName .
'][' . $num .
']" onclick="' . htmlspecialchars($onclick) .
'" /><br />';
611 $tree->addField(
'perms_userid', 1);
615 $tree->getTree(
$id, $this->getLevels,
'');
617 if (
$GLOBALS[
'BE_USER']->user[
'uid'] && count($tree->orig_ids_hierarchy)) {
619 $label_recur =
$GLOBALS[
'LANG']->getLL(
'recursive');
620 $label_levels =
$GLOBALS[
'LANG']->getLL(
'levels');
621 $label_pA =
$GLOBALS[
'LANG']->getLL(
'pages_affected');
622 $theIdListArr = array();
624 <option value=""></option>';
626 for ($a = $this->getLevels; $a > 0; $a--) {
627 if (is_array($tree->orig_ids_hierarchy[$a])) {
628 foreach ($tree->orig_ids_hierarchy[$a] as $theId) {
629 if (
$GLOBALS[
'BE_USER']->isAdmin() ||
$GLOBALS[
'BE_USER']->user[
'uid'] == $tree->recs[$theId][
'perms_userid']) {
630 $theIdListArr[] = $theId;
633 $lKey = $this->getLevels - $a + 1;
635 <option value="' . htmlspecialchars(implode(
',', $theIdListArr)) .
'">' . htmlspecialchars($label_recur .
' ' . $lKey .
' ' . $label_levels, ENT_COMPAT,
'UTF-8', FALSE) .
' (' . count($theIdListArr) .
' ' . $label_pA .
')' .
'</option>';
639 $theRecursiveSelect =
'<br /> 640 <select name="mirror[pages][' .
$id .
']"> 645 $theRecursiveSelect =
'';
648 return $theRecursiveSelect;
static blindUserNames($usernames, $groupArray, $excludeBlindedFlag=0)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static readPageAccess($id, $perms_clause)
static renderOwnername($page, $ownerUid, $username, $validUser=TRUE)
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
static quoteJSvalue($value)
static cshItem($table, $field, $BACK_PATH, $wrap='', $onlyIconMode=FALSE, $styleAttrib='')
static renderPermissions($int, $pageId=0, $who='user')
static getGroupNames($fields='title, uid', $where='')
static makeInstance($className)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
printCheckBox($checkName, $num)
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
getRecursiveSelect($id, $perms_clause)
static getUserNames($fields='username, usergroup, usergroup_cached_list, uid', $where='')
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static blindGroupNames($groups, $groupArray, $excludeBlindedFlag=0)
static renderGroupname($page, $groupUid, $groupname, $validGroup=TRUE)
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
static fixed_lgd_cs($string, $chars, $appendString='...')
static getListGroupNames($fields='title, uid')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]