Bug #19219 » patch_9172_4_ver_4.2.diff
typo3/mod/web/perm/class.sc_mod_web_perm_ajax.php (Arbeitskopie) | ||
---|---|---|
* @param Integer $page: The TYPO3 page id
|
||
* @param Integer $ownerUid: The new page user uid
|
||
* @param String $username: The TYPO3 BE username (used to display in the element)
|
||
* @param Boolean $validUser: Must be set to FALSE, if the user has no name or is deleted
|
||
* @return String The new group wrapped in HTML
|
||
*/
|
||
public function renderOwnername($page, $ownerUid, $username) {
|
||
public function renderOwnername($page, $ownerUid, $username, $validUser = true) {
|
||
$elementId = 'o_'.$page;
|
||
$ret = '<span id="'.$elementId.'"><a class="ug_selector" onclick="WebPermissions.showChangeOwnerSelector('.$page.', '.$ownerUid.', \''.$elementId.'\', \''.htmlspecialchars($username).'\');">'.($username == '' ? '<span class=not_set>[not set]</span>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($username, 20))).'</a></span>';
|
||
$ret = '<span id="' . $elementId . '"><a class="ug_selector onclick="WebPermissions.showChangeOwnerSelector(' . $page . ', ' . $ownerUid . ', \'' . $elementId.'\', \'' . htmlspecialchars($username) . '\');">' . ($validUser ? ($username == '' ? '<span class=not_set>[not set]</span>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($username, 20))) : ('<span class=not_set>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($username, 20)) . '</span>')) . '</a></span>';
|
||
return $ret;
|
||
}
|
||
... | ... | |
* @param Integer $page: The TYPO3 page id
|
||
* @param Integer $groupUid: The new page group uid
|
||
* @param String $groupname: The TYPO3 BE groupname (used to display in the element)
|
||
* @param Boolean $validGroup: Must be set to FALSE, if the group has no name or is deleted
|
||
* @return String The new group wrapped in HTML
|
||
*/
|
||
public function renderGroupname($page, $groupUid, $groupname) {
|
||
public function renderGroupname($page, $groupUid, $groupname, $validGroup = true) {
|
||
$elementId = 'g_'.$page;
|
||
$ret = '<span id="'.$elementId.'"><a class="ug_selector" onclick="WebPermissions.showChangeGroupSelector('.$page.', '.$groupUid.', \''.$elementId.'\', \''.htmlspecialchars($groupname).'\');">'.($groupname == '' ? '<span class=not_set>[not set]</span>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($groupname, 20))).'</a></span>';
|
||
$ret = '<span id="'.$elementId . '"><a class="ug_selector" onclick="WebPermissions.showChangeGroupSelector(' . $page . ', ' . $groupUid . ', \'' . $elementId . '\', \'' . htmlspecialchars($groupname) . '\');">'. ($validGroup ? ($groupname == '' ? '<span class=not_set>[not set]</span>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($groupname, 20))) : ('<span class=not_set>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($groupname, 20)) . '</span>')) . '</a></span>';
|
||
return $ret;
|
||
}
|
||
typo3/mod/web/perm/index.php (Arbeitskopie) | ||
---|---|---|
$lE_bgCol = $bgCol;
|
||
// User/Group names:
|
||
$userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>['.$data['row']['perms_userid'].']!</i>' : '');
|
||
$userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)));
|
||
$userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '[' . $data['row']['perms_userid'] . ']!' : '');
|
||
if ($data['row']['perms_userid'] && (!$beUserArray[$data['row']['perms_userid']])) {
|
||
$userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)), false);
|
||
} else {
|
||
$userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)));
|
||
}
|
||
$groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? '<i>['.$data['row']['perms_groupid'].']!</i>' : '');
|
||
$groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)));
|
||
$groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? '[' . $data['row']['perms_groupid'] . ']!' : '');
|
||
if ($data['row']['perms_groupid'] && (!$beGroupArray[$data['row']['perms_groupid']])) {
|
||
$groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)), false);
|
||
} else {
|
||
$groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)));
|
||
}
|
||
// Seeing if editing of permissions are allowed for that page:
|
||
$editPermsAllowed = ($data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin());
|
||