mirror of
https://github.com/e107inc/e107.git
synced 2025-06-03 17:34:59 +02:00
Fixes #3711 - check local themes/plugins against author names as well as versions before suggesting updates.
This commit is contained in:
parent
f148e20837
commit
18a8571ed3
@ -62,8 +62,10 @@ if(in_array($pref['adminstyle'], array('infopanel', 'flexpanel')))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// DEBUG THE ADDON_UPDATED INFOPANEL
|
||||
//e107::getCache()->clear('Infopanel_plugin', true);
|
||||
//e107::getSession()->clear('addons-update-status');
|
||||
//e107::getSession()->set('addons-update-checked',false); // set to recheck it.
|
||||
|
||||
define('e_ADMIN_HOME', true); // used by some admin shortcodes.
|
||||
|
||||
|
@ -56,6 +56,7 @@ if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'addons' && ($_G
|
||||
{
|
||||
e107::getSession()->set('addons-update-checked',true);
|
||||
|
||||
/** @var admin_shortcodes $sc */
|
||||
$sc = e107::getScBatch('admin');
|
||||
|
||||
$themes = $sc->getUpdateable('theme');
|
||||
@ -64,6 +65,7 @@ if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'addons' && ($_G
|
||||
$text = $sc->renderAddonUpdate($plugins);
|
||||
$text .= $sc->renderAddonUpdate($themes);
|
||||
|
||||
|
||||
if(empty($text))
|
||||
{
|
||||
exit;
|
||||
|
@ -572,6 +572,7 @@ class plugin_ui extends e_admin_ui
|
||||
if(file_exists($_path.'plugin.xml'))
|
||||
{
|
||||
$plugin->install_plugin_xml($id, 'upgrade');
|
||||
$text = LAN_UPGRADE_SUCCESSFUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -656,13 +657,17 @@ class plugin_ui extends e_admin_ui
|
||||
e107::getConfig('core')->save();
|
||||
}
|
||||
|
||||
|
||||
$mes->addSuccess($text);
|
||||
//$plugin->save_addon_prefs('update');
|
||||
|
||||
// make sure ALL plugin/addon pref lists get update and are current
|
||||
e107::getPlug()->clearCache()->buildAddonPrefLists();
|
||||
|
||||
// clear infopanel in admin dashboard.
|
||||
e107::getCache()->clear('Infopanel_plugin', true);
|
||||
e107::getSession()->clear('addons-update-status');
|
||||
e107::getSession()->set('addons-update-checked',false); // set to recheck it.
|
||||
|
||||
$this->redirectAction('list');
|
||||
}
|
||||
|
||||
|
@ -290,8 +290,12 @@ class theme_admin_ui extends e_admin_ui
|
||||
|
||||
if($this->themeObj->setTheme($id))
|
||||
{
|
||||
|
||||
$mes->addSuccess($message);
|
||||
|
||||
// clear infopanel in admin dashboard.
|
||||
e107::getCache()->clear('Infopanel_theme', true);
|
||||
e107::getSession()->clear('addons-update-status');
|
||||
e107::getSession()->set('addons-update-checked',false); // set to recheck it.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -131,6 +131,8 @@ class admin_shortcodes
|
||||
$e107_var['x'.$key]['link'] = e_ADMIN.'docs.php?'.$key;
|
||||
}
|
||||
|
||||
$act = null; // FIXME
|
||||
|
||||
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
|
||||
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
||||
}
|
||||
@ -1131,7 +1133,7 @@ class admin_shortcodes
|
||||
|
||||
$text .= $themeinfo ? "<br />".FOOTLAN_7.": ".$themeinfo : '';
|
||||
|
||||
$sqlMode = str_replace(",", ", ",e107::getDB()->getMode());
|
||||
$sqlMode = str_replace(",", ", ", e107::getDb()->getMode());
|
||||
|
||||
$text .= "<br /><br />
|
||||
<b>".FOOTLAN_8."</b>
|
||||
@ -1152,10 +1154,10 @@ class admin_shortcodes
|
||||
<br /><br />
|
||||
<b>".FOOTLAN_12."</b>
|
||||
<br />
|
||||
".e107::getDB()->getServerInfo(). // mySqlServerInfo.
|
||||
".e107::getDb()->getServerInfo(). // mySqlServerInfo.
|
||||
|
||||
"<br />".FOOTLAN_16.": ".$mySQLdefaultdb."
|
||||
<br />PDO: ".((e107::getDB()->getPDO() === true) ? LAN_ENABLED : LAN_DISABLED)."
|
||||
<br />PDO: ".((e107::getDb()->getPDO() === true) ? LAN_ENABLED : LAN_DISABLED)."
|
||||
<br />Mode: <small>".$sqlMode."</small>
|
||||
|
||||
<br /><br />
|
||||
@ -1411,7 +1413,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
|
||||
$res = e107::getSession()->get('addons-update-status');
|
||||
|
||||
if($res !== null)
|
||||
if($res !== null) // cached version.
|
||||
{
|
||||
return $res;
|
||||
}
|
||||
@ -1469,20 +1471,31 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
|
||||
case "plugin":
|
||||
$versions = $mp->getVersionList('plugin');
|
||||
$list = e107::getPref('plug_installed');
|
||||
$plg = e107::getPlug();
|
||||
$tmp = $plg->getInstalled();
|
||||
$list = array();
|
||||
foreach($tmp as $folder=>$version)
|
||||
{
|
||||
$plg->load($folder);
|
||||
$list[$folder] = array('version'=>$version, 'author'=>$plg->getAuthor());
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
|
||||
foreach($list as $folder=>$version)
|
||||
foreach($list as $folder=>$var)
|
||||
{
|
||||
$version = $var['version'];
|
||||
$author = $var['author'];
|
||||
|
||||
if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<'))
|
||||
if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<') && ($versions[$folder]['author'] === $author))
|
||||
{
|
||||
$versions[$folder]['modalDownload'] = $mp->getDownloadModal($type, $versions[$folder]);
|
||||
$ret[] = $versions[$folder];
|
||||
e107::getMessage()->addDebug("Local version: ".$version." Remote version: ".$versions[$folder]['version']);
|
||||
e107::getMessage()->addDebug("Local author: ".$$author." Remote author: ".$versions[$folder]['author']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ class e_theme
|
||||
{
|
||||
foreach($this->_data as $dir=>$v)
|
||||
{
|
||||
$arr[$dir] = $v['version'];
|
||||
$arr[$dir] = array('version'=>$v['version'], 'author'=>$v['author']);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user