mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 12:21:45 +02:00
Added tokens to some links.
This commit is contained in:
@@ -362,7 +362,7 @@ class plugin_ui extends e_admin_ui
|
||||
{
|
||||
$plg->load($path);
|
||||
$name = $plg->getName();
|
||||
$url = e_ADMIN."plugin.php?mode=installed&action=upgrade&path=".$path;
|
||||
$url = e_ADMIN."plugin.php?mode=installed&action=upgrade&path=".$path."&e-token=".e_TOKEN;
|
||||
$text .= "<li class='media'>
|
||||
<div class='media-left'>
|
||||
<a href='".$url."'>".$plg->getIcon(32)."</a>
|
||||
@@ -384,6 +384,12 @@ class plugin_ui extends e_admin_ui
|
||||
|
||||
function installPage()
|
||||
{
|
||||
if(empty($this->getQuery('e-token')))
|
||||
{
|
||||
e107::getMessage()->addError("Invalid Token"); // Debug - no need for translation.
|
||||
$this->redirectAction('list');
|
||||
}
|
||||
|
||||
$id = $this->getQuery('path');
|
||||
|
||||
$text = e107::getPlugin()->install($id);
|
||||
@@ -438,6 +444,11 @@ class plugin_ui extends e_admin_ui
|
||||
|
||||
function uninstallPage()
|
||||
{
|
||||
if(empty($this->getQuery('e-token')))
|
||||
{
|
||||
e107::getMessage()->addError("Invalid Token"); // Debug - no need for translation.
|
||||
$this->redirectAction('list');
|
||||
}
|
||||
|
||||
|
||||
$id = $this->getQuery('path');
|
||||
@@ -483,6 +494,14 @@ class plugin_ui extends e_admin_ui
|
||||
|
||||
function repairPage()
|
||||
{
|
||||
|
||||
if(empty($this->getQuery('e-token')))
|
||||
{
|
||||
e107::getMessage()->addError("Invalid Token"); // Debug - no need for translation.
|
||||
$this->redirectAction('list');
|
||||
return null;
|
||||
}
|
||||
|
||||
$id = $this->getQuery('path');
|
||||
|
||||
$this->repair($id);
|
||||
@@ -499,7 +518,7 @@ class plugin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
e107::getSingleton('e107plugin')->refresh($id);
|
||||
e107::getLog()->add('PLUGMAN_04', $id, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('PLUGMAN_04', $id);
|
||||
|
||||
e107::getMessage()->addSuccess("Repair Complete (".$id.")"); // Repair Complete ([x])
|
||||
|
||||
@@ -526,6 +545,12 @@ class plugin_ui extends e_admin_ui
|
||||
|
||||
function upgradePage()
|
||||
{
|
||||
if(empty($this->getQuery('e-token')))
|
||||
{
|
||||
e107::getMessage()->addError("Invalid Token"); // Debug - no need for translation.
|
||||
$this->redirectAction('list');
|
||||
}
|
||||
|
||||
$this->pluginUpgrade();
|
||||
|
||||
}
|
||||
@@ -1009,13 +1034,13 @@ class plugin_form_ui extends e_admin_form_ui
|
||||
if($var['plugin_install_required'] == true)
|
||||
{
|
||||
|
||||
if($var['plugin_installflag'])
|
||||
if(!empty($var['plugin_installflag']))
|
||||
{
|
||||
$text .= ($var['plugin_installflag'] ? "<a class='btn btn-default' href=\"" . e_SELF . "?mode=".$mode."&action=uninstall&path={$var['plugin_path']}\" title='" . EPL_ADLAN_1 . "' >" . ADMIN_UNINSTALLPLUGIN_ICON . "</a>" : "<a class='btn' href=\"" . e_SELF . "?install.{$var['plugin_id']}\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>");
|
||||
$text .= "<a class='btn btn-default' href=\"" . e_SELF . "?mode=".$mode."&action=uninstall&path=".$var['plugin_path']."&e-token=".e_TOKEN."\" title='" . EPL_ADLAN_1 . "' >" . ADMIN_UNINSTALLPLUGIN_ICON . "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<a class='btn btn-default' href=\"" . e_SELF . "?mode=installed&action=install&path={$var['plugin_path']}\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>";
|
||||
$text .= "<a class='btn btn-default' href=\"" . e_SELF . "?mode=installed&action=install&path=".$var['plugin_path']."&e-token=".e_TOKEN."\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1037,17 +1062,17 @@ class plugin_form_ui extends e_admin_form_ui
|
||||
|
||||
if($var['plugin_version'] != $var['plugin_version_file'] && $var['plugin_installflag'])
|
||||
{
|
||||
$text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=upgrade&path={$var['plugin_path']}' title=\"" . EPL_UPGRADE . " v" . $var['plugin_version_file'] . "\" >" . ADMIN_UPGRADEPLUGIN_ICON . "</a>";
|
||||
$text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=upgrade&path=".$var['plugin_path']."&e-token=".e_TOKEN."' title=\"" . EPL_UPGRADE . " v" . $var['plugin_version_file'] . "\" >" . ADMIN_UPGRADEPLUGIN_ICON . "</a>";
|
||||
}
|
||||
|
||||
if($var['plugin_installflag'])
|
||||
{
|
||||
$text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=repair&path={$var['plugin_path']}' title='" . LAN_REPAIR_PLUGIN_SETTINGS . "'> " . ADMIN_REPAIRPLUGIN_ICON . "</a>";
|
||||
$text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=repair&path=".$var['plugin_path']."&e-token=".e_TOKEN."' title='" . LAN_REPAIR_PLUGIN_SETTINGS . "'> " . ADMIN_REPAIRPLUGIN_ICON . "</a>";
|
||||
}
|
||||
|
||||
if($var['plugin_installflag'] && is_dir($_path . ".git"))
|
||||
{
|
||||
$text .= "<a class='plugin-manager btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=pull&path={$var['plugin_path']}' title='" . LAN_SYNC_WITH_GIT_REPO . "'> " . ADMIN_GITSYNC_ICON . "</a>";
|
||||
$text .= "<a class='plugin-manager btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=pull&path=".$var['plugin_path']."&e-token=".e_TOKEN."' title='" . LAN_SYNC_WITH_GIT_REPO . "'> " . ADMIN_GITSYNC_ICON . "</a>";
|
||||
}
|
||||
|
||||
|
||||
@@ -1140,12 +1165,16 @@ class plugin_online_ui extends e_admin_ui
|
||||
// Modal Download.
|
||||
public function downloadPage()
|
||||
{
|
||||
if(empty($_GET['e-token']))
|
||||
{
|
||||
echo e107::getMessage()->addError("Invalid Token")->render('default', 'error');
|
||||
return null;
|
||||
}
|
||||
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
|
||||
// print_a($_GET);
|
||||
|
||||
$string = base64_decode($_GET['src']);
|
||||
parse_str($string, $data);
|
||||
@@ -1192,7 +1221,7 @@ class plugin_online_ui extends e_admin_ui
|
||||
$upgradable = e107::getPlug()->getUpgradableList();
|
||||
if(!empty($upgradable[$pluginFolder]))
|
||||
{
|
||||
$mes->addSuccess("<a target='_top' href='".e_ADMIN."plugin.php?mode=installed&action=upgrade&id=".$pluginFolder."' class='btn btn-primary'>".LAN_UPDATE."</a>");
|
||||
$mes->addSuccess("<a target='_top' href='".e_ADMIN."plugin.php?mode=installed&action=upgrade&id=".$pluginFolder."&e-token=".e_TOKEN."' class='btn btn-primary'>".LAN_UPDATE."</a>");
|
||||
}
|
||||
|
||||
echo $mes->render('default', 'success');
|
||||
@@ -2539,6 +2568,9 @@ class pluginBuilder
|
||||
$ns = e107::getRender();
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
|
||||
$newDir = [];
|
||||
$lanDir = [];
|
||||
|
||||
$plugFolders = $fl->get_dirs(e_PLUGIN);
|
||||
foreach($plugFolders as $dir)
|
||||
|
Reference in New Issue
Block a user