Massive upgrade
This commit is contained in:
parent
99a9ed919e
commit
c1a3437f9b
396 changed files with 29083 additions and 31939 deletions
|
@ -26,7 +26,9 @@
|
|||
*/
|
||||
|
||||
$module["core"]["name"]="Ajax Class";
|
||||
$module["core"]["ver"]="0.5.0";
|
||||
$module["core"]["ver"]="0.6.0";
|
||||
|
||||
use Smarty\Smarty;
|
||||
|
||||
class ajax{
|
||||
var $db;
|
||||
|
@ -60,16 +62,16 @@ class ajax{
|
|||
$mod = new $task();
|
||||
$root = $_SERVER['DOCUMENT_ROOT'] . $config["path"];
|
||||
if(isset($config["theme"]) && is_dir($root . '/modules/'.$task.'/templates/'.$config["theme"]) && !$mod -> uses_default_templates){
|
||||
$mod -> tpl-> template_dir = $root . '/modules/'.$task.'/templates/'.$config["theme"];
|
||||
$mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/'.$config["theme"]);
|
||||
}elseif($mod -> uses_default_templates){
|
||||
if(isset($config["theme"]) && is_dir($root . '/themes/'.$config["theme"])){
|
||||
$mod -> tpl-> template_dir = $root . '/themes/'.$config["theme"];
|
||||
$mod -> tpl-> setTemplateDir($root . '/themes/'.$config["theme"]);
|
||||
|
||||
}else{
|
||||
$mod -> tpl-> template_dir = $root . '/themes/default';
|
||||
$mod -> tpl-> setTemplateDir($root . '/themes/default');
|
||||
}
|
||||
}else{
|
||||
$mod -> tpl-> template_dir = $root . '/modules/'.$task.'/templates/default';
|
||||
$mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/default');
|
||||
}
|
||||
|
||||
if($subtask!=""){
|
||||
|
|
|
@ -58,7 +58,7 @@ class cache {
|
|||
$this->prefix=$config['MEMCACHE_PREFIX'];
|
||||
$this->exp=$config['MEMCACHE_EXPIRATION'];
|
||||
$this->obj = new Memcached($this->prefix);
|
||||
$con = $this->connect($this->host,$this->port);
|
||||
$con = $this->connect($this->server,$this->port);
|
||||
if(!$con){
|
||||
return false;
|
||||
}else{
|
||||
|
|
|
@ -369,16 +369,16 @@ class Core{
|
|||
$mod->cookie=$_COOKIE;
|
||||
$root = $_SERVER['DOCUMENT_ROOT'] . $config['path'];
|
||||
if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/modules/'.$task.'/templates/'.$config['theme']) && !$mod -> uses_default_templates){
|
||||
$mod -> tpl-> template_dir = $root . '/modules/'.$task.'/templates/'.$config['theme'];
|
||||
$mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/'.$config['theme']);
|
||||
}elseif($mod -> uses_default_templates){
|
||||
if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/themes/'.$config['theme'])){
|
||||
$mod -> tpl-> template_dir = $root . '/themes/'.$config['theme'];
|
||||
$mod -> tpl-> setTemplateDir($root . '/themes/'.$config['theme']);
|
||||
|
||||
}else{
|
||||
$mod -> tpl-> template_dir = $root . '/themes/default';
|
||||
$mod -> tpl-> setTemplateDir($root . '/themes/default');
|
||||
}
|
||||
}else{
|
||||
$mod -> tpl-> template_dir = $root . '/modules/'.$task.'/templates/default';
|
||||
$mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/default');
|
||||
}
|
||||
|
||||
$meta.= $mod->redirect;
|
||||
|
|
|
@ -80,10 +80,12 @@ class plugins{
|
|||
{
|
||||
require_once $hook['file'];
|
||||
}
|
||||
if(is_array($variables)){
|
||||
if(!is_array($variables))
|
||||
$variables=array();
|
||||
}
|
||||
$return = call_user_func_array($hook['function'], $variables);
|
||||
|
||||
$return = call_user_func_array($hook['function'], $variables);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,8 +82,9 @@ class session {
|
|||
$additional_message = '<br />'.$lang->_('REASON').' '.$this->userdata['bio'];
|
||||
}
|
||||
//$this->destroy_session($session->sid);
|
||||
$this->userdata['uid']=0;
|
||||
|
||||
|
||||
$this->userdata['uid']=0;
|
||||
|
||||
$this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']);
|
||||
$core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message);
|
||||
}
|
||||
|
@ -152,7 +153,7 @@ class session {
|
|||
$time = time();
|
||||
if($time - $this->userdata['lastactive'] > 900){
|
||||
$db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='" . $this->userdata['lastactive'] . "', `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'");
|
||||
$mybb->user['lastvisit'] = $mybb->user['lastactive'];
|
||||
//$mybb->user['lastvisit'] = $mybb->user['lastactive'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -344,7 +345,7 @@ class session {
|
|||
function sanitize_username($username){
|
||||
global $config;
|
||||
$username = trim($username);
|
||||
$username = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $username);
|
||||
$username = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $username);
|
||||
$username = str_replace(array(chr(160), chr(173), chr(0xCA), chr(8238), chr(8237), chr(8203),"]","[","/","\\"), array("", "-", "", "", "", "","","","",""), $username);
|
||||
// Remove multiple spaces from the username
|
||||
$username = preg_replace("#\s{2,}#", "", $username);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue