1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Fix for plugin repair (in debug mode) Fix for Login page signup link when registration is disabled.

This commit is contained in:
Cameron
2016-04-30 12:02:02 -07:00
parent d3383a71b6
commit d098589456
5 changed files with 69 additions and 25 deletions

View File

@@ -164,7 +164,7 @@ class pluginmanager_form extends e_form
if ($this->plug['plugin_installflag'] && e_DEBUG == true)
{
$text .= "<a class='btn btn-default' href='".e_SELF."?refresh.".$this->plug['plugin_id']."' title='".'Repair plugin settings'."'> ".ADMIN_REPAIRPLUGIN_ICON."</a>";
$text .= "<a class='btn btn-default' href='".e_SELF."?repair.".$this->plug['plugin_id']."' title='".'Repair plugin settings'."'> ".ADMIN_REPAIRPLUGIN_ICON."</a>";
}
@@ -345,6 +345,12 @@ class pluginManager{
$this -> pluginCheck(true); // forced
}
if($this->action == "repair")
{
$this -> pluginRepair();
$this->action = 'refresh';
}
if($this->action == "refresh")
{
$this -> pluginCheck(true); // forced
@@ -376,10 +382,8 @@ class pluginManager{
$this -> action = "installed";
}
if($this->action == "refresh")
{
$this -> pluginRefresh();
}
if($this->action == "upload")
{
$this -> pluginUpload();
@@ -1084,9 +1088,9 @@ class pluginManager{
// -----------------------------------------------------------------------------
function pluginRefresh()
function pluginRepair()
{
global $plug;
// global $plug;
$plug = e107::getSingleton('e107plugin')->getinfo($this->id);
@@ -2345,8 +2349,11 @@ class pluginBuilder
{
$createData = str_replace("`".MPREFIX, '`', $data[1]);
$createData .= ";";
if(!file_exists($file))
{
file_put_contents($file,$createData);
}
}
}
@@ -2567,12 +2574,20 @@ class pluginBuilder
if($content = file_get_contents($source))
{
$content = str_replace($srch, $this->pluginName, $content);
if(!file_exists($destination))
{
if(file_put_contents($destination,$content))
{
$result[] = LAN_CREATED." : ".$addon;
}
}
else
{
$result[] = "Skipped (already exists) : ".$addon;
}
}
else
{
//$mes->addError("Addon source-file was empty: ".$addon);
}

View File

@@ -180,15 +180,14 @@ class login_shortcodes extends e_shortcode
function sc_login_table_signup_link($parm='')
{
if(empty($this->userReg))
if($this->userReg === 1)
{
return "<a href='".e_SIGNUP."'>".LAN_LOGIN_11."</a>";
}
return null;
}
return "<a href='".e_SIGNUP."'>".LAN_LOGIN_11."</a>";
}
function sc_login_table_fpw_link($parm='')
{

View File

@@ -1423,6 +1423,8 @@ class e107plugin
$mes = e107::getMessage();
$event = e107::getEvent();
$mes->addDebug("Running ".$function);
$error = array(); // Array of error messages
$canContinue = TRUE; // Clear flag if must abort part way through
@@ -1563,7 +1565,7 @@ class e107plugin
$this->XmlAdminLinks($function, $plug_vars['adminLinks']);
}
if (varset($plug_vars['siteLinks']))
if (!empty($plug_vars['siteLinks']))
{
$this->XmlSiteLinks($function, $plug_vars);
}
@@ -2025,7 +2027,12 @@ class e107plugin
return;
}
// print_a($plug_vars);
if($function == 'refresh')
{
$mes->addDebug("Checking Plugin Site-links");
$mes->addDebug(print_a($plug_vars['siteLinks'],true));
}
$array = $plug_vars['siteLinks'];
@@ -2050,9 +2057,17 @@ class e107plugin
{
case 'upgrade':
case 'install':
case 'refresh':
if (!$remove) // Add any non-deprecated link
{
if($function == 'refresh')
{
$perm = 'nobody';
}
$result = $this->manage_link('add', $url, $linkName, $perm, $options);
if($result !== NULL)
{
@@ -2068,8 +2083,6 @@ class e107plugin
}
break;
case 'refresh': // Probably best to leave well alone
break;
case 'uninstall': //remove all links
@@ -2705,14 +2718,17 @@ class e107plugin
if (file_exists($_path.'plugin.xml'))
{
$text = $this->install_plugin_xml($plug, 'refresh');
$this->install_plugin_xml($plug, 'refresh');
}
else
{
e107::getMessage()->addDebug("Missing xml file at : ".$_path."plugin.xml");
$text = EPL_ADLAN_21;
}
e107::getMessage()->addDebug("Running Refresh of ".$_path);
$this->save_addon_prefs();
return $text;

View File

@@ -840,12 +840,14 @@ class e_parse_shortcode
$parmArray = false;
$fullShortcodeKey = null;
$noDebugLog = false;
if ($this->eVars)
{
if ($this->eVars->isVar($matches[1]))
{
$match1 = $matches[1]; // php7 fix.
// e107::getDebug()->log("Using eVars ".$match1);
return $this->eVars->$match1;
}
}
@@ -923,6 +925,7 @@ class e_parse_shortcode
{
$debugArr = array('class_original'=>get_class($this->addedCodes), 'class_override'=>$this->addonOverride[$_method], 'function'=>$_method);
e107::getDebug()->logCode(4, $code, null, print_a($debugArr,true));
$noDebugLog = true;
}
@@ -1201,7 +1204,7 @@ class e_parse_shortcode
$sql->db_Mark_Time("(After SC {$code})");
}
if (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS)
if (($noDebugLog != true) && (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS))
{
global $db_debug;

View File

@@ -13,12 +13,23 @@
class theme_shortcodes extends e_shortcode
{
public $override = true;
function __construct()
{
}
function sc_news_summary()
{
$sc = e107::getScBatch('news');
$data = $sc->getScVar('news_item');
return "<span class='label label-danger'>".e107::getParser()->toHTML($data['news_summary'],'BODY')."</span>";
}
function sc_bootstrap_branding()
{
$pref = e107::pref('theme', 'branding');