本文整理汇总了PHP中t3lib_div::sanitizeLocalUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::sanitizeLocalUrl方法的具体用法?PHP t3lib_div::sanitizeLocalUrl怎么用?PHP t3lib_div::sanitizeLocalUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::sanitizeLocalUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Registering incoming data
*
* @return void
*/
public function init()
{
// set the GPvars from outside
$this->file = t3lib_div::_GP('file');
$this->CB = t3lib_div::_GP('CB');
$this->overwriteExistingFiles = t3lib_div::_GP('overwriteExistingFiles');
$this->vC = t3lib_div::_GP('vC');
$this->redirect = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('redirect'));
$this->initClipboard();
}
示例2: logout
/**
* Performs the logout processing
*
* @return void
*/
function logout()
{
global $BE_USER;
$BE_USER->writelog(255, 2, 0, 1, 'User %s logged out from TYPO3 Backend', array($BE_USER->user['username']));
// Logout written to log
$BE_USER->logoff();
$redirect = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('redirect'));
$redirectUrl = $redirect ? $redirect : 'index.php';
t3lib_utility_Http::redirect($redirectUrl);
}
示例3: main
/**
* Creates the header and frameset for the module/submodules
*
* @return void
*/
function main()
{
global $BE_USER, $TBE_TEMPLATE, $TBE_STYLES;
// GPvars:
$this->exScript = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('exScript'));
$this->id = intval(t3lib_div::_GP('id'));
$this->fW = t3lib_div::_GP('fW');
// Setting resizing flag:
$this->resizable = $BE_USER->uc['navFrameResizable'] ? TRUE : FALSE;
// Setting frame width:
if (intval($this->fW) && $this->resizable) {
// Framewidth from stored value, last one.
$width = t3lib_div::intInRange($this->fW, 100, 1000) + 10;
// +10 to compensate for width of scrollbar. However, width is always INSIDE scrollbars, so potentially it will jump a little forth/back...
} else {
// Framewidth from configuration;
$width = $BE_USER->uc['navFrameWidth'];
$width = intval($width) ? intval($width) : ($TBE_STYLES['dims']['navFrameWidth'] ? intval($TBE_STYLES['dims']['navFrameWidth']) : $this->defaultWidth);
}
// Navigation frame URL:
$script = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('script'));
$nav = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('nav'));
$URL_nav = htmlspecialchars($nav . '¤tSubScript=' . rawurlencode($script));
// List frame URL:
$URL_list = htmlspecialchars($this->exScript ? $this->exScript : $script . ($this->id ? (strpos($script, '?') ? '&' : '?') . 'id=' . rawurlencode($this->id) : ''));
// Start page output
$TBE_TEMPLATE->docType = 'xhtml_frames';
$this->content = $TBE_TEMPLATE->startPage('Frameset');
if ($this->resizable) {
$this->content .= '
<frameset id="typo3-content-frameset" cols="' . $width . ',*">
<frame name="nav_frame" src="' . $URL_nav . '" marginwidth="0" marginheight="0" scrolling="auto" />
<frame name="list_frame" src="' . $URL_list . '" marginwidth="0" marginheight="0" scrolling="auto" />
</frameset>
</html>
';
} else {
$this->content .= '
<frameset id="typo3-content-frameset" cols="' . $width . ',8,*" framespacing="0" frameborder="0" border="0">
<frame name="nav_frame" src="' . $URL_nav . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
<frame name="border_frame" src="' . (isset($GLOBALS['TBE_STYLES']['border']) ? $GLOBALS['TBE_STYLES']['border'] : 'border.html') . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
<frame name="list_frame" src="' . $URL_list . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
</frameset>
</html>
';
}
}
示例4: init
/**
* Constructor, initializing internal variables.
*
* @return void
*/
function init()
{
global $BE_USER, $LANG, $BACK_PATH;
// Setting internal vars:
$this->sys_language = intval(t3lib_div::_GP('sys_language'));
$this->page_id = intval(t3lib_div::_GP('uid'));
$this->table = t3lib_div::_GP('table');
$this->R_URI = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
$this->input_moveUid = t3lib_div::_GP('moveUid');
$this->moveUid = $this->input_moveUid ? $this->input_moveUid : $this->page_id;
$this->makeCopy = t3lib_div::_GP('makeCopy');
// Select-pages where clause for read-access:
$this->perms_clause = $BE_USER->getPagePermsClause(1);
// Starting the document template object:
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/move_el.html');
$this->doc->JScode = '';
// Starting document content (header):
$this->content = '';
$this->content .= $this->doc->header($LANG->getLL('movingElement'));
$this->content .= $this->doc->spacer(5);
}
示例5: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('close' => '', 'save' => '', 'save_view' => '', 'save_close' => '', 'shortcut' => '', 'undo' => '');
if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'], $this->P['uid'])) {
$closeUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
// Getting settings for the undo button:
$undoButton = 0;
$undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->P['table'], 'sys_history') . ' AND recuid=' . intval($this->P['uid']), '', 'tstamp DESC', '1');
if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
$undoButton = 1;
}
// Close
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode($closeUrl) . '\')); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" />' . '</a>';
// Save
$buttons['save'] = '<a href="#" onclick="TBE_EDITOR.checkAndDoSubmit(1); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" alt="" />' . '</a>';
// Save & View
if (t3lib_extMgm::isLoaded('cms')) {
$buttons['save_view'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedokshow.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" alt="" />' . '</a>';
}
// Save & Close
$buttons['save_close'] = '<input type="image" class="c-inputButton" onclick="' . htmlspecialchars('document.editform.redirect.value=\'' . $closeUrl . '\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />';
// Undo/Revert:
if ($undoButton) {
$buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'show_rechis.php?element=' . rawurlencode($this->P['table'] . ':' . $this->P['uid']) . '&revert=' . rawurlencode('field:' . $this->P['field']) . '&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' . '</a>';
}
// Shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1);
}
}
return $buttons;
}
示例6: localizationRedirect
/**
* Redirects to alt_doc with new parameters to edit a just created localized record
*
* @param string String passed by GET &justLocalized=
* @return void
*/
function localizationRedirect($justLocalized)
{
global $TCA;
list($table, $orig_uid, $language) = explode(':', $justLocalized);
if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField']) {
$localizedRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', $table, $TCA[$table]['ctrl']['languageField'] . '=' . intval($language) . ' AND ' . $TCA[$table]['ctrl']['transOrigPointerField'] . '=' . intval($orig_uid) . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table));
if (is_array($localizedRecord)) {
// Create parameters and finally run the classic page module for creating a new page translation
$params = '&edit[' . $table . '][' . $localizedRecord['uid'] . ']=edit';
$returnUrl = '&returnUrl=' . rawurlencode(t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')));
$location = $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . $params . $returnUrl . t3lib_BEfunc::getUrlToken('editRecord');
t3lib_utility_Http::redirect($location);
}
}
}
示例7: main_mode
/**
* Main function of the MODULE. Write the content to $this->content
* There are three main modes:
* - Based on a file reference, creating/modifying a DS/TO
* - Based on a Template Object uid, remapping
* - Based on a Data Structure uid, selecting a Template Object to map.
*
* @return void
*/
function main_mode() {
global $LANG, $BACK_PATH;
$this->doc = t3lib_div::makeInstance('template');
$this->doc->docType= 'xhtml_trans';
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('EXT:templavoila/resources/templates/cm1_default.html');
$this->doc->bodyTagId = 'typo3-mod-php';
$this->doc->divClass = '';
$this->doc->inDocStylesArray[]='
#templavoila-frame-visual { height:500px; display:block; margin:0 5px; width:98%; border: 1xpx solid black;}
DIV.typo3-fullDoc H2 { width: 100%; }
TABLE#c-mapInfo {margin-top: 10px; margin-bottom: 5px; }
TABLE#c-mapInfo TR TD {padding-right: 20px;}
select option.pagetemplate {background-image:url(../icon_pagetemplate.gif);background-repeat: no-repeat; background-position: 5px 50%; padding: 1px 0 3px 24px; -webkit-background-size: 0;}
select option.fce {background-image:url(../icon_fce_ce.png);background-repeat: no-repeat; background-position: 5px 50%; padding: 1px 0 3px 24px; -webkit-background-size: 0;}
#c-toMenu { margin-bottom:10px; }
';
$this->doc->inDocStylesArray[] = self::$gnyfStyleBlock;
// Add custom styles
$this->doc->styleSheetFile2 = t3lib_extMgm::extRelPath($this->extKey)."cm1/styles.css";
// General GPvars for module mode:
$this->displayFile = tx_templavoila_file::filename(t3lib_div::_GP('file'));
$this->displayTable = t3lib_div::_GP('table');
$this->displayUid = t3lib_div::_GP('uid');
$this->displayPath = t3lib_div::_GP('htmlPath');
$this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
// GPvars specific to the DS listing/table and mapping features:
$this->_preview = t3lib_div::_GP('_preview');
$this->mapElPath = t3lib_div::_GP('mapElPath');
$this->doMappingOfPath = t3lib_div::_GP('doMappingOfPath');
$this->showPathOnly = t3lib_div::_GP('showPathOnly');
$this->mappingToTags = t3lib_div::_GP('mappingToTags');
$this->DS_element = t3lib_div::_GP('DS_element');
$this->DS_cmd = t3lib_div::_GP('DS_cmd');
$this->fieldName = t3lib_div::_GP('fieldName');
// GPvars specific for DS creation from a file.
$this->_load_ds_xml_content = t3lib_div::_GP('_load_ds_xml_content');
$this->_load_ds_xml_to = t3lib_div::_GP('_load_ds_xml_to');
$this->_saveDSandTO_TOuid = t3lib_div::_GP('_saveDSandTO_TOuid');
$this->_saveDSandTO_title = t3lib_div::_GP('_saveDSandTO_title');
$this->_saveDSandTO_type = t3lib_div::_GP('_saveDSandTO_type');
$this->_saveDSandTO_pid = t3lib_div::_GP('_saveDSandTO_pid');
$this->DS_element_DELETE = t3lib_div::_GP('DS_element_DELETE');
// Finding Storage folder:
$this->findingStorageFolderIds();
// Setting up form-wrapper:
$this->doc->form='<form action="'.$this->linkThisScript(array()).'" method="post" name="pageform">';
// JavaScript
$this->doc->JScode.= $this->doc->wrapScriptTags('
script_ended = 0;
function jumpToUrl(URL) { //
document.location = URL;
}
function updPath(inPath) { //
document.location = "'.t3lib_div::linkThisScript(array('htmlPath'=>'','doMappingOfPath'=>1)).'&htmlPath="+top.rawurlencode(inPath);
}
function openValidator(key) {
new Ajax.Request("' . $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=tx_templavoila_cm1_ajax::getDisplayFileContent&key=" + key, {
onSuccess: function(response) {
var valform = new Element(\'form\',{method: \'post\', target:\'_blank\', action: \'http://validator.w3.org/check#validate_by_input\'});
valform.insert(new Element(\'input\',{name: \'fragment\', value:response.responseText, type: \'hidden\'}));$(document.body).insert(valform);
valform.submit();
}
});
}
');
if(tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) {
$this->doc->getDynTabMenuJScode();
} else {
$this->doc->loadJavascriptLib('js/tabmenu.js');
}
// Setting up the context sensitive menu:
$CMparts = $this->doc->getContextMenuCode();
$this->doc->bodyTagAdditions = $CMparts[1];
$this->doc->JScode.=$CMparts[0];
$this->doc->postCode.= $CMparts[2];
// Icons
$this->dsTypes = array(
//.........这里部分代码省略.........
示例8: init
/**
* Constructor function for class
*
* @return void
*/
function init()
{
global $LANG, $BACK_PATH, $TYPO3_CONF_VARS;
// Initialize GPvars:
$this->number = t3lib_div::_GP('number');
$this->target = t3lib_div::_GP('target');
$this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
// Init basic-file-functions object:
$this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->basicff->init($GLOBALS['FILEMOUNTS'], $TYPO3_CONF_VARS['BE']['fileExtensions']);
// Init basic-charset-functions object:
$this->charsetConversion = t3lib_div::makeInstance('t3lib_cs');
// Cleaning and checking target
$this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
$this->target = $this->basicff->is_directory($this->target);
$key = $this->basicff->checkPathAgainstMounts($this->target . '/');
if (!$this->target || !$key) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new RuntimeException($title . ': ' . $message);
}
// Finding the icon
switch ($GLOBALS['FILEMOUNTS'][$key]['type']) {
case 'user':
$this->icon = 'gfx/i/_icon_ftp_user.gif';
break;
case 'group':
$this->icon = 'gfx/i/_icon_ftp_group.gif';
break;
default:
$this->icon = 'gfx/i/_icon_ftp.gif';
break;
}
$this->icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, $this->icon, 'width="18" height="16"') . ' title="" alt="" />';
// Relative path to filemount, $key:
$this->shortPath = substr($this->target, strlen($GLOBALS['FILEMOUNTS'][$key]['path']));
// Setting title:
$this->title = $this->icon . htmlspecialchars($GLOBALS['FILEMOUNTS'][$key]['name']) . ': ' . $this->shortPath;
// Setting template object
$this->doc = t3lib_div::makeInstance('template');
$this->doc->setModuleTemplate('templates/file_newfolder.html');
$this->doc->backPath = $BACK_PATH;
$this->doc->JScode = $this->doc->wrapScriptTags('
var path = "' . $this->target . '";
function reload(a) { //
if (!changed || (changed && confirm(' . $LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . '))) {
var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8')) . '";
window.location.href = "file_newfolder.php?"+params;
}
}
function backToList() { //
top.goToModule("file_list");
}
var changed = 0;
');
}
示例9: main
/**
* Main function
* Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
*
* @return void
*/
function main()
{
// Get this record
$origRow = t3lib_BEfunc::getRecord($this->P['table'], $this->P['uid']);
// Get TSconfig for it.
$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
// Set [params][pid]
if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
$this->pid = intval($TSconfig['_' . substr($this->P['params']['pid'], 3, -3)]);
} else {
$this->pid = intval($this->P['params']['pid']);
}
// Make redirect:
if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
// If pid is blank OR if id is set, then return...
$redirectUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
} else {
// Otherwise, show the list:
$urlParameters = array();
$urlParameters['id'] = $this->pid;
$urlParameters['table'] = $this->P['params']['table'];
$urlParameters['returnUrl'] = t3lib_div::getIndpEnv('REQUEST_URI');
$redirectUrl = t3lib_BEfunc::getModuleUrl('web_list', $urlParameters);
}
t3lib_utility_Http::redirect($redirectUrl);
}
示例10: sanitizeLocalUrlDeniesEncodedInvalidUrls
/**
* Tests whether valid local URLs are handled correctly.
* @dataProvider invalidLocalUrlDataProvider
* @test
*/
public function sanitizeLocalUrlDeniesEncodedInvalidUrls($url)
{
$this->assertEquals('', t3lib_div::sanitizeLocalUrl(rawurlencode($url)));
}
示例11: displayWorkspaceOverview
/**
* Rendering the overview of versions in the current workspace
*
* @return string HTML (table)
* @see ws/index.php for sister function!
*/
function displayWorkspaceOverview()
{
// Initialize variables:
$this->showWorkspaceCol = $GLOBALS['BE_USER']->workspace === 0 && $this->MOD_SETTINGS['display'] <= -98;
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
$this->be_user_Array = t3lib_BEfunc::getUserNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, $groupArray, 1);
}
// Initialize Workspace ID and filter-value:
if ($GLOBALS['BE_USER']->workspace === 0) {
$wsid = $this->details ? -99 : $this->MOD_SETTINGS['display'];
// Set wsid to the value from the menu (displaying content of other workspaces)
$filter = $this->details ? 0 : $this->MOD_SETTINGS['filter'];
} else {
$wsid = $GLOBALS['BE_USER']->workspace;
$filter = 0;
}
// Initialize workspace object and request all pending versions:
$wslibObj = t3lib_div::makeInstance('wslib');
// Selecting ALL versions belonging to the workspace:
$versions = $wslibObj->selectVersionsInWorkspace($wsid, $filter, -99, $this->uid);
// $this->uid is the page id of LIVE record.
// Traverse versions and build page-display array:
$pArray = array();
foreach ($versions as $table => $records) {
foreach ($records as $rec) {
$pageIdField = $table === 'pages' ? 't3ver_oid' : 'realpid';
$this->displayWorkspaceOverview_setInPageArray($pArray, $table, $rec);
}
}
// Make header of overview:
$tableRows = array();
if (count($pArray)) {
$tableRows[] = '
<tr class="bgColor5 tableheader">
' . ($this->diffOnly ? '' : '<td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('liveVersion') . '</td>') . '
<td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('wsVersions') . '</td>
<td nowrap="nowrap"' . ($this->diffOnly ? ' colspan="2"' : ' colspan="4"') . '>' . $GLOBALS['LANG']->getLL('controls') . '</td>
</tr>';
// Add lines from overview:
$tableRows = array_merge($tableRows, $this->displayWorkspaceOverview_list($pArray));
$table = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding workspace-overview">' . implode('', $tableRows) . '</table>';
} else {
$table = '';
}
$returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
$linkBack = t3lib_div::_GP('returnUrl') ? '<a href="' . htmlspecialchars($returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . $GLOBALS['LANG']->getLL('goBack', TRUE) . '</a><br /><br />' : '';
$resetDiffOnly = $this->diffOnly ? '<a href="index.php?id=' . intval($this->id) . '" class="typo3-goBack">' . $GLOBALS['LANG']->getLL('showAllInformation') . '</a><br /><br />' : '';
$versionSelector = $GLOBALS['BE_USER']->workspace ? $this->doc->getVersionSelector($this->id) : '';
return $versionSelector . $linkBack . $resetDiffOnly . $table . $this->markupNewOriginals();
}
示例12: init
/**
* Initialize the login box. Will also react on a &L=OUT flag and exit.
*
* @return void
*/
function init()
{
// We need a PHP session session for most login levels
session_start();
$this->redirect_url = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('redirect_url'));
$this->GPinterface = t3lib_div::_GP('interface');
// Grabbing preset username and password, for security reasons this feature only works if SSL is used
if (t3lib_div::getIndpEnv('TYPO3_SSL')) {
$this->u = t3lib_div::_GP('u');
$this->p = t3lib_div::_GP('p');
}
// If "L" is "OUT", then any logged in is logged out. If redirect_url is given, we redirect to it
$this->L = t3lib_div::_GP('L');
// Login
$this->loginRefresh = t3lib_div::_GP('loginRefresh');
// Value of "Login" button. If set, the login button was pressed.
$this->commandLI = t3lib_div::_GP('commandLI');
// sets the level of security from conf vars
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) {
$this->loginSecurityLevel = $GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'];
}
// try to get the preferred browser language
$preferredBrowserLanguage = $GLOBALS['LANG']->csConvObj->getPreferredClientLanguage(t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE'));
// if we found a $preferredBrowserLanguage and it is not the default language and no be_user is logged in
// initialize $GLOBALS['LANG'] again with $preferredBrowserLanguage
if ($preferredBrowserLanguage != 'default' && !$GLOBALS['BE_USER']->user['uid']) {
$GLOBALS['LANG']->init($preferredBrowserLanguage);
}
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_login.xml');
// check if labels from $GLOBALS['TYPO3_CONF_VARS']['BE']['loginLabels'] were changed,
// and merge them to $GLOBALS['LOCAL_LANG'] if needed
$this->mergeOldLoginLabels();
// Setting the redirect URL to "backend.php" if no alternative input is given
$this->redirectToURL = $this->redirect_url ? $this->redirect_url : 'backend.php';
// Do a logout if the command is set
if ($this->L == 'OUT' && is_object($GLOBALS['BE_USER'])) {
$GLOBALS['BE_USER']->logoff();
if ($this->redirect_url) {
t3lib_utility_Http::redirect($this->redirect_url);
}
exit;
}
}
示例13: requestInstallExtensions
/**
* Outputs a screen from where you can install multiple extensions in one go
* This can be called from external modules with "...index.php?CMD[requestInstallExtensions]=
*
* @param string Comma list of extension keys to install. Renders a screen with checkboxes for all extensions not already imported or installed
* @return void
*/
function requestInstallExtensions($extList)
{
// Return URL:
$returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
$installOrImportExtension = t3lib_div::_POST('installOrImportExtension');
// Extension List:
$extArray = explode(',', $extList);
$outputRow = array();
$outputRow[] = '
<tr class="t3-row-header tableheader">
<td>' . $GLOBALS['LANG']->getLL('reqInstExt_install_import') . '</td>
<td>' . $GLOBALS['LANG']->getLL('reqInstExt_ext_key') . '</td>
</tr>
';
foreach ($extArray as $extKey) {
// Check for the request:
if ($installOrImportExtension[$extKey]) {
$this->installExtension($extKey);
}
// Display:
if (!t3lib_extMgm::isLoaded($extKey)) {
$outputRow[] = '
<tr class="bgColor4">
<td><input type="checkbox" name="' . htmlspecialchars('installOrImportExtension[' . $extKey . ']') . '" value="1" checked="checked" id="check_' . $extKey . '" /></td>
<td><label for="check_' . $extKey . '">' . htmlspecialchars($extKey) . '</label></td>
</tr>
';
}
}
if (count($outputRow) > 1 || !$returnUrl) {
$content = '
<!-- ending page form ... -->
<form action="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '" method="post">
<table border="0" cellpadding="1" cellspacing="1">' . implode('', $outputRow) . '</table>
<input type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('reqInstExt_import_install_selected') . '" />
</form>';
if ($returnUrl) {
$content .= '
<br />
<br />
<a href="' . htmlspecialchars($returnUrl) . '">' . $GLOBALS['LANG']->getLL('reqInstExt_return') . '</a>
';
}
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('reqInstExt_imp_inst_ext'), $content, 0, 1);
} else {
t3lib_utility_Http::redirect($returnUrl);
}
}
示例14: init
/**
* Initializing the module
*
* @return void
*/
function init()
{
global $BE_USER;
// Setting module configuration / page select clause
$this->MCONF = $GLOBALS['MCONF'];
$this->perms_clause = $BE_USER->getPagePermsClause(1);
$this->backPath = $GLOBALS['BACK_PATH'];
// GPvars:
$this->id = intval(t3lib_div::_GP('id'));
$this->pointer = t3lib_div::_GP('pointer');
$this->imagemode = t3lib_div::_GP('imagemode');
$this->clear_cache = t3lib_div::_GP('clear_cache');
$this->popView = t3lib_div::_GP('popView');
$this->edit_record = t3lib_div::_GP('edit_record');
$this->new_unique_uid = t3lib_div::_GP('new_unique_uid');
$this->search_field = t3lib_div::_GP('search_field');
$this->search_levels = t3lib_div::_GP('search_levels');
$this->showLimit = t3lib_div::_GP('showLimit');
$this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
$this->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables'];
// Load page info array:
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
// Initialize menu
$this->menuConfig();
// Setting sys language from session var:
$this->current_sys_language = intval($this->MOD_SETTINGS['language']);
// Include scripts: QuickEdit
if ($this->MOD_SETTINGS['function'] == 0) {
$this->include_once[] = PATH_t3lib . 'class.t3lib_tceforms.php';
$this->include_once[] = PATH_t3lib . 'class.t3lib_clipboard.php';
$this->include_once[] = PATH_t3lib . 'class.t3lib_loaddbgroup.php';
$this->include_once[] = PATH_t3lib . 'class.t3lib_transferdata.php';
}
// Include scripts: Clear-cache cmd.
if ($this->clear_cache) {
$this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php';
}
// CSH / Descriptions:
$this->descrTable = '_MOD_' . $this->MCONF['name'];
}
示例15: init
/**
* Constructor function for the class
*
* @return void
*/
function init()
{
global $BE_USER, $LANG, $BACK_PATH;
// page-selection permission clause (reading)
$this->perms_clause = $BE_USER->getPagePermsClause(1);
// this will hide records from display - it has nothing todo with user rights!!
if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
$this->perms_clause .= ' AND pages.uid NOT IN (' . $pidList . ')';
}
}
// Setting GPvars:
$this->id = intval(t3lib_div::_GP('id'));
// The page id to operate from
$this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
$this->pagesOnly = t3lib_div::_GP('pagesOnly');
// Create instance of template class for output
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/db_new.html');
$this->doc->JScode = '';
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
// Creating content
$this->content = '';
$this->content .= $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle'));
// Id a positive id is supplied, ask for the page record with permission information contained:
if ($this->id > 0) {
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
}
// If a page-record was returned, the user had read-access to the page.
if ($this->pageinfo['uid']) {
// Get record of parent page
$this->pidInfo = t3lib_BEfunc::getRecord('pages', $this->pageinfo['pid']);
// Checking the permissions for the user with regard to the parent page: Can he create new pages, new content record, new page after?
if ($BE_USER->doesUserHaveAccess($this->pageinfo, 8)) {
$this->newPagesInto = 1;
}
if ($BE_USER->doesUserHaveAccess($this->pageinfo, 16)) {
$this->newContentInto = 1;
}
if (($BE_USER->isAdmin() || is_array($this->pidInfo)) && $BE_USER->doesUserHaveAccess($this->pidInfo, 8)) {
$this->newPagesAfter = 1;
}
} elseif ($BE_USER->isAdmin()) {
// Admins can do it all
$this->newPagesInto = 1;
$this->newContentInto = 1;
$this->newPagesAfter = 0;
} else {
// People with no permission can do nothing
$this->newPagesInto = 0;
$this->newContentInto = 0;
$this->newPagesAfter = 0;
}
}