diff --git a/class2.php b/class2.php index fa6894a6c..13a94df84 100644 --- a/class2.php +++ b/class2.php @@ -2220,19 +2220,21 @@ class error_handler // global $_E107; - if(isset($_E107['debug'])) + + if(!empty($_E107['debug'])) { $this->debug = true; error_reporting(E_ALL); return; } - if(isset($_E107['cli'])) + + if(!empty($_E107['cli'])) { - error_reporting(E_ALL ^ E_NOTICE); + error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE); return; } - if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level']) && strpos($_SERVER['QUERY_STRING'], 'debug=-') !== TRUE ) + if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== false) || isset($_COOKIE['e107_debug_level']) && strpos($_SERVER['QUERY_STRING'], 'debug=-') === false ) { $this->debug = true; error_reporting(E_ALL); diff --git a/comment.php b/comment.php index 8e298d09d..0b406ece6 100644 --- a/comment.php +++ b/comment.php @@ -62,9 +62,9 @@ if(e_AJAX_REQUEST) // TODO improve security } - if(varset($_GET['mode']) == 'delete' && vartrue($_POST['itemid']) && ADMIN) + if(varset($_GET['mode']) == 'delete' && !empty($_POST['id']) && ADMIN) { - $status = e107::getComment()->deleteComment($_POST['itemid']); + $status = e107::getComment()->deleteComment($_POST['id'],$_POST['table'],$_POST['itemid']); $ret['msg'] = ($status) ? 'Ok' : COMLAN_332; $ret['error'] = ($status) ? false : true; echo json_encode($ret); diff --git a/contact.php b/contact.php index 00063b86b..757202ce4 100644 --- a/contact.php +++ b/contact.php @@ -102,7 +102,7 @@ if(isset($_POST['send-contactus'])) } // Check subject line. - if(strlen(trim($subject)) < 2) + if(isset($_POST['subject']) && strlen(trim($subject)) < 2) { $error .= LANCONTACT_13."\\n"; } diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 86cf3ad19..ca4fb2a44 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -103,12 +103,19 @@ class admin_start private $allowed_types = null; private $refresh = false; + private $exit = false; private $deprecated = array(); function __construct() { + if(!getperms('0')) // don't display this tuff to regular admins only main admin. + { + return null; + } + + // Files that can cause comflicts and problems. $this->deprecated = array( e_ADMIN."ad_links.php", e_PLUGIN."tinymce4/e_meta.php", @@ -127,7 +134,10 @@ class admin_start e_PLUGIN."forum/forum_update_check.php", e_PLUGIN."online_extended_menu/online_extended_menu.php", e_PLUGIN."online_extended_menu/images/user.png", - e_PLUGIN."online_extended_menu/languages/English.php" + e_PLUGIN."online_extended_menu/languages/English.php", + e_PLUGIN."pm/sendpm.sc", + e_PLUGIN."pm/shortcodes/", + e_PLUGIN."social/e_header.php" ); @@ -138,18 +148,55 @@ class admin_start $this->deleteDeprecated(); } - $this->checkNewInstall(); + + + + e107::getDb()->db_Mark_Time('Check Paths'); $this->checkPaths(); + e107::getDb()->db_Mark_Time('Check Timezone'); $this->checkTimezone(); + e107::getDb()->db_Mark_Time('Check Writable'); $this->checkWritable(); - $this->checkHtmlarea(); + + e107::getDb()->db_Mark_Time('Check Incompatible Plugins'); $this->checkIncompatiblePlugins(); + + e107::getDb()->db_Mark_Time('Check Filetypes'); $this->checkFileTypes(); + + e107::getDb()->db_Mark_Time('Check Suspect Files'); $this->checkSuspiciousFiles(); + + e107::getDb()->db_Mark_Time('Check Deprecated'); $this->checkDeprecated(); - $this->checkPasswordEncryption(); + + e107::getDb()->db_Mark_Time('Check HTMLArea'); + $this->checkHtmlarea(); + + e107::getDb()->db_Mark_Time('Check Htaccess'); $this->checkHtaccess(); + e107::getDb()->db_Mark_Time('Check Core Update'); + $this->checkCoreUpdate(); + + if($this->exit === true) + { + return null; + } + + e107::getDb()->db_Mark_Time('Check New Install'); + $this->checkNewInstall(); + + e107::getDb()->db_Mark_Time('Check Plugin Update'); + $this->checkPluginUpdate(); + + e107::getDb()->db_Mark_Time('Check Theme Update'); + $this->checkThemeUpdate(); + + e107::getDb()->db_Mark_Time('Check Password Encryption'); + $this->checkPasswordEncryption(); + + if($this->refresh == true) { e107::getRedirect()->go(e_SELF); @@ -197,6 +244,125 @@ class admin_start } + private function checkCoreUpdate() + { + // auto db update + if ('0' != ADMINPERMS) + { + return null; + } + + //$sc = e107::getScBatch('admin'); + //echo $tp->parseTemplate('{ADMIN_COREUPDATE=alert}',true, $sc); + + global $dont_check_update, $e107info; + global $dbupdate, $dbupdatep, $e107cache; + + require_once(e_ADMIN.'update_routines.php'); + + if(update_check() === true) + { + if(e_DEBUG !== true) + { + $this->exit = true; + } + } + + + + } + + + private function checkPluginUpdate() + { + require_once(e_HANDLER.'e_marketplace.php'); + $mp = new e_marketplace(); // autodetect the best method + + $versions = $mp->getVersionList('plugin'); + + $plugins = e107::getPref('plug_installed'); + + if(empty($plugins)) + { + return null; + } + + + $tp = e107::getParser(); + + foreach($plugins as $folder=>$version) + { + + if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<')) + { + $link = "".$versions[$folder]['name'].""; + + $dl = $mp->getDownloadModal('plugin', $versions[$folder]); + + $caption = LAN_DOWNLOAD.": ".$versions[$folder]['name']." ".$versions[$folder]['version']; + + $lans = array('x'=>$link, 'y'=>LAN_PLUGIN); + $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); + $message .= " ".$tp->toGlyph('fa-cloud-download').""; + + + e107::getMessage()->addInfo($message); + e107::getMessage()->addDebug("Local version: ".$version." Remote version: ".$versions[$folder]['version']); + } + + } + + + } + + private function checkThemeUpdate() + { + require_once(e_HANDLER.'e_marketplace.php'); + $mp = new e_marketplace(); // autodetect the best method + + $versions = $mp->getVersionList('theme'); + + $themes = scandir(e_THEME); + + if(empty($themes)) + { + return null; + } + + $tp = e107::getParser(); + + $list = e107::getTheme()->getThemeList(); + + foreach($list as $data) + { + + $folder = $data['path']; + $version = $data['version']; + + if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<')) + { + $link = "".$versions[$folder]['name'].""; + + $lans = array('x'=>$link, 'y'=>LAN_THEME); + + $dl = $mp->getDownloadModal('theme', $versions[$folder]); + + $caption = LAN_DOWNLOAD.": ".$versions[$folder]['name']." ".$versions[$folder]['version']; + + $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); + $message .= " ".$tp->toGlyph('fa-cloud-download').""; + + + e107::getMessage()->addInfo($message); + e107::getMessage()->addDebug("Local version: ".$version." Remote version: ".$versions[$folder]['version']); + } + + } + + + + } + /** * */ @@ -477,15 +643,7 @@ class admin_start // --------------------------------------------------------- -// auto db update -if ('0' == ADMINPERMS) -{ - $sc = e107::getScBatch('admin'); - echo $tp->parseTemplate('{ADMIN_COREUPDATE=alert}',true, $sc); - - require_once(e_ADMIN.'update_routines.php'); - update_check(); -} + diff --git a/e107_admin/cron.php b/e107_admin/cron.php index 5e15af631..d8bc114de 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -2,23 +2,12 @@ /* * e107 website system * - * Copyright (C) 2008-2012 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * Cron Administration + * Cron Administration - Scheduled Tasks * - * $URL$ - * $Id$ - * - */ - -/** - * - * @package e107 - * @subpackage admin - * @version $Id$ - * Admin-related functions for cron (Scheduler) management */ require_once('../class2.php'); @@ -194,7 +183,9 @@ class cron_admin_ui extends e_admin_ui $this->cronImport(e107::getAddonConfig('e_cron')); // Import plugin Crons $this->cronImportLegacy(); // Import Legacy Cron Tab Settings } - + + $this->renderHelp(); + } @@ -393,10 +384,10 @@ class cron_admin_ui extends e_admin_ui $setpwd_message .= "". LAN_CRON_16.""; if(e_DOMAIN && file_exists("/usr/local/cpanel/version")) { - $setpwd_message .= "
"; + $setpwd_message .= ""; } - $setpwd_message .= "".$k." | +".print_a($val,true)." | ".print_a($corePrefs[$k],true)." | +