* fix bug #965.
This commit is contained in:
@@ -27,7 +27,7 @@ include './framework/router.class.php';
|
||||
include './framework/control.class.php';
|
||||
include './framework/model.class.php';
|
||||
include './framework/helper.class.php';
|
||||
include './config/config.php';
|
||||
helper::import(realpath('./config/config.php'));
|
||||
|
||||
/* Set the PATH_INFO variable. */
|
||||
if($config->requestType == 'PATH_INFO')
|
||||
|
||||
@@ -1803,8 +1803,22 @@ class baseRouter
|
||||
{
|
||||
foreach($lang->db->custom[$moduleName] as $section => $fields)
|
||||
{
|
||||
if(isset($lang->{$moduleName}->{$section}['']))
|
||||
{
|
||||
$nullKey = '';
|
||||
$nullValue = $lang->{$moduleName}->{$section}[$nullKey];
|
||||
}
|
||||
elseif(isset($lang->{$moduleName}->{$section}[0]))
|
||||
{
|
||||
$nullKey = 0;
|
||||
$nullValue = $lang->{$moduleName}->{$section}[0];
|
||||
}
|
||||
unset($lang->{$moduleName}->{$section});
|
||||
|
||||
if(isset($nullKey))$lang->{$moduleName}->{$section}[$nullKey] = $nullValue;
|
||||
foreach($fields as $key => $value) $lang->{$moduleName}->{$section}[$key] = $value;
|
||||
unset($nullKey);
|
||||
unset($nullValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ class pinyin
|
||||
public function __construct()
|
||||
{
|
||||
$this->segments = array();
|
||||
$segment = __DIR__ . '/data/words';
|
||||
if(file_exists($segment)) $this->segments = include __DIR__ . '/data/words';
|
||||
$segment = dirname(__FILE__) . '/data/words';
|
||||
if(file_exists($segment)) $this->segments = include dirname(__FILE__) . '/data/words';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+48
-45
@@ -62,9 +62,9 @@ class adminModel extends model
|
||||
*/
|
||||
public function postAPI($url, $formvars = "")
|
||||
{
|
||||
$this->agent->cookies['lang'] = $this->cookie->lang;
|
||||
$this->agent->submit($url, $formvars);
|
||||
return $this->agent->results;
|
||||
$this->agent->cookies['lang'] = $this->cookie->lang;
|
||||
$this->agent->submit($url, $formvars);
|
||||
return $this->agent->results;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,65 +101,68 @@ class adminModel extends model
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register zentao by API.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function registerByAPI()
|
||||
{
|
||||
$apiURL = 'http://www.zentao.net/user-register.json?bind=yes&HTTP_X_REQUESTED_WITH=XMLHttpRequest';
|
||||
return $this->postAPI($apiURL, $_POST);
|
||||
}
|
||||
/**
|
||||
* Register zentao by API.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function registerByAPI()
|
||||
{
|
||||
$apiURL = 'http://www.zentao.net/user-register.json?bind=yes&HTTP_X_REQUESTED_WITH=XMLHttpRequest';
|
||||
return $this->postAPI($apiURL, $_POST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Login zentao by API.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function bindByAPI()
|
||||
{
|
||||
$apiURL = 'http://www.zentao.net/user-bindChanzhi.json?HTTP_X_REQUESTED_WITH=XMLHttpRequest';
|
||||
return $this->postAPI($apiURL, $_POST);
|
||||
}
|
||||
/**
|
||||
* Login zentao by API.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function bindByAPI()
|
||||
{
|
||||
$apiURL = 'http://www.zentao.net/user-bindChanzhi.json?HTTP_X_REQUESTED_WITH=XMLHttpRequest';
|
||||
return $this->postAPI($apiURL, $_POST);
|
||||
}
|
||||
|
||||
public function getSecretKey()
|
||||
{
|
||||
$apiURL = "http://www.zentao.net/user-secretKey.json";
|
||||
//$apiURL = "http://www.zentao.net/user-secretKey.json";
|
||||
$apiURL = "http://www.zentao.cn/user-secretKey.json";
|
||||
$params['u'] = $this->config->global->community;
|
||||
$params['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$params['k'] = $this->getSignature($params);
|
||||
$this->agent->cookies['lang'] = $this->cookie->lang;
|
||||
$this->agent->fetch($apiURL . '?' . http_build_query($params));
|
||||
$result = $this->agent->results;
|
||||
$result = json_decode($result);
|
||||
$this->agent->cookies['lang'] = $this->cookie->lang;
|
||||
$this->agent->fetch($apiURL . '?' . http_build_query($params));
|
||||
$result = $this->agent->results;
|
||||
$result = json_decode($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function sendCodeByAPI($type)
|
||||
{
|
||||
$module = $type == 'mobile' ? 'sms' : 'mail';
|
||||
$apiURL = "http://www.zentao.net/{$module}-apiSendCode.json";
|
||||
//$apiURL = "http://www.zentao.net/{$module}-apiSendCode.json";
|
||||
$apiURL = "http://www.zentao.cn/{$module}-apiSendCode.json";
|
||||
$params['u'] = $this->config->global->community;
|
||||
$params['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$params['k'] = $this->getSignature($params);
|
||||
|
||||
$param = http_build_query($params);
|
||||
return $this->postAPI($apiURL . '?' . $param, $_POST);
|
||||
return $this->postAPI($apiURL . '?' . $param, $_POST);
|
||||
}
|
||||
|
||||
public function certifyByAPI($type)
|
||||
{
|
||||
$module = $type == 'mobile' ? 'sms' : 'mail';
|
||||
$apiURL = "http://www.zentao.net/{$module}-apiCertify.json";
|
||||
//$apiURL = "http://www.zentao.net/{$module}-apiCertify.json";
|
||||
$apiURL = "http://www.zentao.cn/{$module}-apiCertify.json";
|
||||
$params['u'] = $this->config->global->community;
|
||||
$params['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$params['k'] = $this->getSignature($params);
|
||||
|
||||
$param = http_build_query($params);
|
||||
return $this->postAPI($apiURL . '?' . $param, $_POST);
|
||||
return $this->postAPI($apiURL . '?' . $param, $_POST);
|
||||
}
|
||||
|
||||
public function getSignature($params)
|
||||
@@ -169,17 +172,17 @@ class adminModel extends model
|
||||
return md5(http_build_query($params) . md5($privateKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get register information.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getRegisterInfo()
|
||||
/**
|
||||
* Get register information.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getRegisterInfo()
|
||||
{
|
||||
$register = new stdclass();
|
||||
$register->company = $this->app->company->name;
|
||||
$register->email = $this->app->user->email;
|
||||
return $register;
|
||||
}
|
||||
$register->company = $this->app->company->name;
|
||||
$register->email = $this->app->user->email;
|
||||
return $register;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<?php js::set('libID', $libID);?>
|
||||
<?php if(!$fixedMenu and $this->from != 'doc') js::set('type', 'doc');?>
|
||||
<?php if($this->cookie->browseType == 'bymenu'):?>
|
||||
<?php include __DIR__ . '/browsebymenu.html.php';?>
|
||||
<?php include dirname(__FILE__) . '/browsebymenu.html.php';?>
|
||||
<?php elseif($this->cookie->browseType == 'bytree'):?>
|
||||
<?php include __DIR__ . '/browsebytree.html.php';?>
|
||||
<?php include dirname(__FILE__) . '/browsebytree.html.php';?>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
|
||||
@@ -711,7 +711,10 @@ class user extends control
|
||||
{
|
||||
$url = html_entity_decode($this->post->referer);
|
||||
$param = substr($url, strrpos($url, '?') + 1);
|
||||
list($module, $method) = explode('&', $param);
|
||||
|
||||
$module = $this->config->default->module;
|
||||
$method = $this->config->default->method;
|
||||
if(strpos($param, '&') !== false) list($module, $method) = explode('&', $param);
|
||||
$module = str_replace('m=', '', $module);
|
||||
$method = str_replace('f=', '', $method);
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ if(file_exists('install.php') or file_exists('upgrade.php'))
|
||||
$undeleteFiles = array();
|
||||
if(file_exists('install.php')) $undeleteFiles[] = '<strong style="color:#ed980f">install.php</strong>';
|
||||
if(file_exists('upgrade.php')) $undeleteFiles[] = '<strong style="color:#ed980f">upgrade.php</strong>';
|
||||
$wwwDir = __DIR__;
|
||||
$wwwDir = dirname(__FILE__);
|
||||
if($undeleteFiles)
|
||||
{
|
||||
echo "<html><head><meta charset='utf-8'></head>
|
||||
|
||||
@@ -1451,6 +1451,7 @@ function fixedTfootAction(formID)
|
||||
tableWidth,
|
||||
tableOffset,
|
||||
hasFixed;
|
||||
if(!$tbody.length) return false;
|
||||
function fixTfoot()
|
||||
{
|
||||
tableWidth = $table.width();
|
||||
|
||||
Reference in New Issue
Block a user