Project

General

Profile

Bug #22649 ยป 14387.diff

Administrator Admin, 2010-05-13 20:23

View differences:

typo3/mod/tools/em/class.em_index.php (working copy)
);
$this->privacyNotice = $GLOBALS['LANG']->getLL('privacy_notice');
$securityMessage = sprintf($GLOBALS['LANG']->getLL('security_descr'),
$securityMessage = $GLOBALS['LANG']->getLL('security_warning_extensions') .
'<br /><br />' . sprintf($GLOBALS['LANG']->getLL('security_descr'),
'<a href="http://typo3.org/teams/security/" target="_blank">', '</a>'
);
$flashMessage = t3lib_div::makeInstance(
......
$this->terConnection->wsdlURL = $TYPO3_CONF_VARS['EXT']['em_wsdlURL'];
$this->xmlhandler = t3lib_div::makeInstance('SC_mod_tools_em_xmlhandler');
$this->xmlhandler->emObj = $this;
$this->xmlhandler->useUnchecked = $this->MOD_SETTINGS['display_unchecked'];
$this->xmlhandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
// Initialize Document Template object:
......
),
'display_shy' => '',
'display_own' => '',
'display_unchecked' => '',
'display_obsolete' => '',
'display_installed' => '',
'display_files' => '',
......
$offset = $this->listingLimit*$this->pointer;
if($this->MOD_SETTINGS['display_own'] && strlen($this->fe_user['username'])) {
$this->xmlhandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username'], $this->MOD_SETTINGS['listOrder']);
$this->xmlhandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username'], $this->MOD_SETTINGS['listOrder'], TRUE);
} else {
$this->xmlhandler->searchExtensionsXML($this->listRemote_search, '', $this->MOD_SETTINGS['listOrder'], false, false, $offset, $this->listingLimit);
$this->xmlhandler->searchExtensionsXML($this->listRemote_search, '', $this->MOD_SETTINGS['listOrder'], TRUE, FALSE, $offset, $this->listingLimit);
}
if (count($this->xmlhandler->extensionsXML)) {
list($list,$cat) = $this->prepareImportExtList(true);
......
$onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['lookUp'].value);return false;";
$content .= '<form action="index.php" method="post" onsubmit="' . htmlspecialchars($onsubmit) .
'"><label for="lookUp">' .
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'),
($this->MOD_SETTINGS['display_unchecked'] ?
'<strong style="color:#900;">' . $GLOBALS['LANG']->getLL('list_or_look_up_all') . '</strong>'
: '<strong style="color:#090;">' . $GLOBALS['LANG']->getLL('list_or_look_up_reviewed') . '</strong>'
)
) .
'</label><br />
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'), '')
. '</label><br />
<input type="text" id="lookUp" name="lookUp" value="' . htmlspecialchars($this->listRemote_search) .
'" /> <input type="submit" value="' . $GLOBALS['LANG']->getLL('look_up_button') . '" /></form><br /><br />';
......
$onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['lookUp'].value);return false;";
$content .= '<form action="index.php" method="post" onsubmit="' . htmlspecialchars($onsubmit) .
'"><label for="lookUp">' .
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'),
($this->MOD_SETTINGS['display_unchecked'] ?
'<strong style="color:#900;">' . $GLOBALS['LANG']->getLL('list_or_look_up_all') . '</strong>'
: '<strong style="color:#090;">' . $GLOBALS['LANG']->getLL('list_or_look_up_reviewed') . '</strong>'
)
) .
'</label><br />
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'), '')
. '</label><br />
<input type="text" id="lookUp" name="lookUp" value="' . htmlspecialchars($this->listRemote_search) .
'" /> <input type="submit" value="' . $GLOBALS['LANG']->getLL('look_up_button') . '" /></form><br /><br />';
......
$onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['lookUp'].value);return false;";
$content .= '<form action="index.php" method="post" onsubmit="' . htmlspecialchars($onsubmit) .
'"><label for="lookUp">' .
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'),
($this->MOD_SETTINGS['display_unchecked'] ?
'<strong style="color:#900;">' . $GLOBALS['LANG']->getLL('list_or_look_up_all') . '</strong>'
: '<strong style="color:#090;">' . $GLOBALS['LANG']->getLL('list_or_look_up_reviewed') . '</strong>'
)
) .
'</label><br />
sprintf($GLOBALS['LANG']->getLL('list_or_look_up'), '')
. '</label><br />
<input type="text" id="lookUp" name="lookUp" value="" /> <input type="submit" value="' .
$GLOBALS['LANG']->getLL('look_up_button') . '" /><br /><br />';
......
$content.= '
' . t3lib_BEfunc::cshItem('_MOD_tools_em', 'settings', $GLOBALS['BACK_PATH'], '|<br />') . '
<form action="index.php" method="post" name="altersettings">
<fieldset><legend>' . $GLOBALS['LANG']->getLL('security_settings') . '</legend>
<table border="0" cellpadding="2" cellspacing="2">
<tr class="bgColor4">
<td><label for="display_unchecked">' . $GLOBALS['LANG']->getLL('show_exts_without_security_check') . '</label></td>
<td>'.t3lib_BEfunc::getFuncCheck(0,'SET[display_unchecked]',$this->MOD_SETTINGS['display_unchecked'],'','','id="display_unchecked"').'</td>
</tr>
</table>
<strong>' . $GLOBALS['LANG']->getLL('notice') . '</strong> ' .
sprintf($GLOBALS['LANG']->getLL('security_notice'),
'<a href="http://typo3.org/extensions/what-are-reviews/" target="_blank">', '</a>'
) .
'</fieldset>
<br />
<br />
<fieldset><legend>' . $GLOBALS['LANG']->getLL('user_settings') . '</legend>
<table border="0" cellpadding="2" cellspacing="2">
<tr class="bgColor4">
......
if (!$this->xmlhandler->countExtensions()) {
$this->fetchMetaData('extensions');
}
$this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', true);
$this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', TRUE, TRUE);
// check if extension can be fetched
if(isset($this->xmlhandler->extensionsXML[$extKey])) {
......
'</tr>';
foreach ($extList[0] as $name => $data) {
$this->xmlhandler->searchExtensionsXMLExact($name, '', '', false, true);
$this->xmlhandler->searchExtensionsXMLExact($name, '', '', TRUE, TRUE);
if (!is_array($this->xmlhandler->extensionsXML[$name])) {
continue;
}
typo3/mod/tools/em/class.em_xmlhandler.php (working copy)
var $extXMLResult = array();
var $extensionsXML = array();
var $reviewStates = null;
var $useUnchecked = false;
var $useObsolete = false;
/**
......
if ($owner) {
$where.= ' AND ownerusername='.$GLOBALS['TYPO3_DB']->fullQuoteStr($owner, 'cache_extensions');
}
if (strlen($owner) || $this->useUnchecked || $allExt) {
// show extensions without review or that have passed review
$where.= ' AND reviewstate >= 0';
} else {
// only display extensions that have passed review
$where.= ' AND reviewstate > 0';
// Show extensions without a review or that have passed a review, but not insecure extensions
$where .= ' AND reviewstate >= 0';
if (!$this->useObsolete) {
// 5 == obsolete
$where.= ' AND state != 5';
}
if (!$this->useObsolete && !$allExt) {
$where.= ' AND state!=5'; // 5 == obsolete
}
switch ($order) {
case 'author_company':
$forder = 'authorname, authorcompany';
......
}
$order = $forder.', title';
if (!$allVer) {
if ($this->useUnchecked) {
$where .= ' AND lastversion>0';
} else {
$where .= ' AND lastreviewedversion>0';
}
$where .= ' AND lastversion > 0';
}
$this->catArr = array();
$idx = 0;
......
}
/**
* Removes all extension versions from $extensions that have a reviewstate<1, unless explicitly allowed
*
* @param array &$extensions The "versions" subpart of the extension list
* @return void
*/
function checkReviewState(&$extensions) {
if ($this->useUnchecked) return;
foreach ($extensions as $version => $data) {
if($data['reviewstate']<1)
unset($extensions[$version]);
}
}
/**
* Removes all extension versions from the list of available extensions that have a reviewstate<1, unless explicitly allowed
*
* @return void
*/
function checkReviewStateGlobal() {
if($this->useUnchecked) return;
foreach ($this->extensionsXML as $extkey => $data) {
foreach ($data['versions'] as $version => $vdata) {
if($vdata['reviewstate']<1) unset($this->extensionsXML[$extkey]['versions'][$version]);
}
if(!count($this->extensionsXML[$extkey]['versions'])) unset($this->extensionsXML[$extkey]);
}
}
/**
* ***************PARSING METHODS***********************
*/
/**
typo3/sysext/lang/locallang_mod_tools_em.xml (working copy)
<label index="descr_local">Local extension (typo3conf/ext/) - Local for this TYPO3 installation only (dynamic).</label>
<label index="privacy_notice">When you interact with the online repository, server information may be sent and stored in the repository for statistics.</label>
<label index="security_header">Found a security problem? Please get in touch with us!</label>
<label index="security_warning_extensions">Please be aware that extensions are third-party software. Installing an extension is a security risk, as the high level of quality and security in the TYPO3 Core can not be assured in these extensions.</label>
<label index="security_descr">If you think you have found a security issue in TYPO3 or an extension, please contact the %sTYPO3 security team%s! Thank you!</label>
<label index="menu_loaded_extensions">Loaded extensions</label>
<label index="menu_install_extensions">Install extensions</label>
......
<label index="local">local</label>
<label index="excluded_from_updates">The extension is excluded from updates! You can change this in the appropriate ext_emconf.php file.</label>
<label index="import_to_local_dir">Import this extension from online repository to the 'local' directory typo3conf/ext/.</label>
<label index="list_or_look_up">List or look up %s extensions</label>
<label index="list_or_look_up">List or look up extensions</label>
<label index="list_or_look_up_all">all</label>
<label index="list_or_look_up_reviewed">reviewed</label>
<label index="look_up_button">Look up</label>
    (1-1/1)