Project

General

Profile

Bug #19217 » extension_write_protected.diff

Administrator Admin, 2008-08-13 23:25

View differences:

typo3/mod/tools/em/class.em_index.php (working copy)
'experimental' => 'Experimental',
'test' => 'Test',
'obsolete' => 'Obsolete',
'write_protected' => 'Writeprotected'
);
/**
......
'experimental' => '#007eba',
'test' => '#979797',
'obsolete' => '#000000',
'write_protected' => '#cf7307'
);
/**
......
if ($inst_list[$extKey]['type']!='S' && (!isset($inst_list[$extKey]) || $this->versionDifference($version,$inst_list[$extKey]['EM_CONF']['version'],$this->versionDiffFactor))) {
if (isset($inst_list[$extKey])) {
// update
$loc= ($inst_list[$extKey]['type']=='G'?'G':'L');
$aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]='.$loc;
$loadUnloadLink.= '<a href="'.htmlspecialchars($aUrl).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/import_update.gif" width="12" height="12" title="Update the extension in \''.($loc=='G'?'global':'local').'\' from online repository to server" alt="" /></a>';
if ($inst_list[$extKey]['EM_CONF']['state'] != 'write_protected') {
$loc= ($inst_list[$extKey]['type']=='G'?'G':'L');
$aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]='.$loc;
$loadUnloadLink.= '<a href="'.htmlspecialchars($aUrl).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/import_update.gif" width="12" height="12" title="Update the extension in \''.($loc=='G'?'global':'local').'\' from online repository to server" alt="" /></a>';
} else {
// extension is marked as write protected
$loadUnloadLink.= '<span style="background-color:#cf7307;color:#fff;padding:2px;" title="write protected">WP</span>';
}
} else {
// import
$aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]=L';
......
$content.= '<form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'"><label for="_lookUp">List or look up <strong'.($this->MOD_SETTINGS['display_unchecked']?' style="color:#900;">all':' style="color:#090;">reviewed').'</strong> extensions</label><br />
<input type="text" id="_lookUp" name="_lookUp" value="'.htmlspecialchars($this->listRemote_search).'" /> <input type="submit" value="Look up" /></form><br /><br />';
$content .= $this->browseLinks();
$content .= $this->browseLinks();
$content.= '
<!-- TER Extensions list -->
<table border="0" cellpadding="2" cellspacing="1">'.implode(chr(10),$lines).'</table>';
$content .= '<br />'.$this->browseLinks();
$content .= '<br />'.$this->browseLinks();
$content.= '<br /><br />'.$this->securityHint;
$content.= '<br /><br /><strong>PRIVACY NOTICE:</strong><br /> '.$this->privacyNotice;
......
if (count($this->inst_keys)) {
reset($this->inst_keys);
while(list($extKey)=each($this->inst_keys)) {
$this->xmlhandler->searchExtensionsXML($extKey, '', '', true);
$this->xmlhandler->searchExtensionsXML($extKey, '', '', true);
if((strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) || isset($this->xmlhandler->extensionsXML[$extKey])) continue;
$loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
......
// Read uploaded file:
if (!$uploadedTempFile) {
if (!is_uploaded_file($_FILES['upload_ext_file']['tmp_name'])) {
t3lib_div::sysLog('Possible file upload attack: '.$_FILES['upload_ext_file']['tmp_name'], 'Extension Manager', 3);
t3lib_div::sysLog('Possible file upload attack: '.$_FILES['upload_ext_file']['tmp_name'], 'Extension Manager', 3);
return 'File was not uploaded?!?';
}
......
function showExtensionsToUpdate() {
global $LANG;
$extList = $this->getInstalledExtensions();
$content = '<table border="0" cellpadding="2" cellspacing="1">'.
'<tr class="bgColor5">'.
'<td></td>'.
......
'<td>'.$LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:tab_mod_comment').'</td>'.
'</tr>';
foreach ($extList[0] as $name => $data) {
foreach ($extList[0] as $name => $data) { debug($data);
$this->xmlhandler->searchExtensionsXML($name, '', '', false, true);
if (!is_array($this->xmlhandler->extensionsXML[$name])) {
continue;
......
}
}
$content .= '<tr class="bgColor4"><td valign="top">'.$icon.'</td>'.
'<td valign="top"><a href="?CMD[importExtInfo]='.$name.'">'.$data[EM_CONF][title].'</a></td>'.
'<td valign="top">' . ($data['EM_CONF']['state'] == 'write_protected' ? '<span style="color:#cf7307">' . $data['EM_CONF']['title'] . ' (write-protected)</span>' : '<a href="?CMD[importExtInfo]='.$name.'">'.$data[EM_CONF][title].'</a>') . '</td>'.
'<td valign="top">'.$name.'</td>'.
'<td valign="top" align="right">'.$data[EM_CONF][version].'</td>'.
'<td valign="top" align="right">'.$lastversion.'</td>'.
(1-1/4)