This commit is contained in:
滔哥
2018-10-12 09:15:31 +08:00
6 changed files with 20 additions and 37 deletions
+11 -7
View File
@@ -311,6 +311,15 @@ class baseRouter
*/
public $cookie;
/**
* 原始SESSIONID
* SESSIONID
*
* @var int
* @access public
*/
public $sessionID;
/**
* 网站代号。
* The code of current site.
@@ -815,13 +824,8 @@ class baseRouter
session_name($sessionName);
session_start();
$sessionID = session_id();
if(isset($_GET[$this->config->sessionVar]) and $sessionID != $_GET[$this->config->sessionVar])
{
helper::restartSession($_GET[$this->config->sessionVar]);
if($this->session->fingerprint and $this->cookie->fingerprint != $this->session->fingerprint) helper::restartSession($sessionID);
}
if($this->session->fingerprint and $this->cookie->fingerprint != $this->session->fingerprint) helper::restartSession();
$this->sessionID = session_id();
if(isset($_GET[$this->config->sessionVar]) and $this->sessionID != $_GET[$this->config->sessionVar]) helper::restartSession($_GET[$this->config->sessionVar]);
define('SESSION_STARTED', true);
}
+2 -14
View File
@@ -24,7 +24,6 @@ class commonModel extends model
{
define('FIRST_RUN', true);
$this->sendHeader();
$this->setFingerprint();
$this->setCompany();
$this->setUser();
$this->loadConfigFromDB();
@@ -52,17 +51,6 @@ class commonModel extends model
header("Cache-control: private");
}
/**
* Set fingerprint.
*
* @access public
* @return void
*/
public function setFingerprint()
{
if($this->cookie->fingerprint and !$this->session->fingerprint) $this->session->set('fingerprint', $this->cookie->fingerprint);
}
/**
* Set the commpany.
*
@@ -1326,8 +1314,8 @@ EOD;
$method = $this->app->getMethodName();
if(isset($this->app->user->modifyPassword) and $this->app->user->modifyPassword and ($module != 'my' or $method != 'changepassword')) die(js::locate(helper::createLink('my', 'changepassword')));
if($this->isOpenMethod($module, $method)) return true;
if(!$this->loadModel('user')->isLogon() and $this->cookie->fingerprint and $this->server->php_auth_user) $this->user->identifyByPhpAuth();
if(!$this->loadModel('user')->isLogon() and $this->cookie->fingerprint and $this->cookie->za) $this->user->identifyByCookie();
if(!$this->loadModel('user')->isLogon() and $this->server->php_auth_user) $this->user->identifyByPhpAuth();
if(!$this->loadModel('user')->isLogon() and $this->cookie->za) $this->user->identifyByCookie();
if(isset($this->app->user))
{
+3 -8
View File
@@ -153,13 +153,7 @@ class file extends control
*/
public function download($fileID, $mouse = '')
{
/* When get sid then change session id. */
if(isset($_GET[$this->config->sessionVar]))
{
$sessionID = isset($_COOKIE[$this->config->sessionVar]) ? $_COOKIE[$this->config->sessionVar] : sha1(mt_rand());
helper::restartSession($sessionID);
}
if(session_id() != $this->app->sessionID) helper::restartSession($this->app->sessionID);
$file = $this->file->getById($fileID);
/* Judge the mode, down or open. */
@@ -168,7 +162,8 @@ class file extends control
if(stripos($fileTypes, $file->extension) !== false && $mouse == 'left') $mode = 'open';
if($file->extension == 'txt')
{
$extension = end(explode('.', $file->title));
$extension = 'txt';
if(($postion = strrpos($file->title, '.')) !== false)$extension = substr($file->title, $postion + 1);
if($extension != 'txt') $mode = 'down';
$file->extension = $extension;
}
+4 -4
View File
@@ -48,10 +48,10 @@
<?php if(!$task->deleted):?>
<div class='divider'></div>
<?php
common::printIcon('testtask', 'start', "taskID=$task->id", $task, 'button', '', '', 'iframe', true);
common::printIcon('testtask', 'close', "taskID=$task->id", $task, 'button', '', '', 'iframe', true);
common::printIcon('testtask', 'block', "taskID=$task->id", $task, 'button', 'pause', '', 'iframe', true);
common::printIcon('testtask', 'activate', "taskID=$task->id", $task, 'button', 'magic', '', 'iframe', true);
common::printIcon('testtask', 'start', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true);
common::printIcon('testtask', 'close', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true);
common::printIcon('testtask', 'block', "taskID=$task->id", $task, 'button', 'pause', '', 'iframe showinonlybody', true);
common::printIcon('testtask', 'activate', "taskID=$task->id", $task, 'button', 'magic', '', 'iframe showinonlybody', true);
common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'button', 'sitemap');
common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'button', 'link');
?>
-3
View File
@@ -17,9 +17,6 @@ $(document).ready(function()
$('#account').focus();
/* Set fingerprint. */
$.cookie('fingerprint', getFingerprint(), {expires:config.cookieLife, path:config.webRoot});
$("#langs li > a").click(function()
{
selectLang($(this).data('value'));
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: login.html.php 5084 2013-07-10 01:31:38Z wyd621@gmail.com $
*/
include '../../common/view/header.lite.html.php';
js::import($jsRoot . 'fingerprint/fingerprint.js');
if(empty($config->notMd5Pwd))js::import($jsRoot . 'md5.js');
?>
<main id="main" class="fade no-padding">