From b0d97c42d17f47bad97b442216162374d8be11c0 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Sun, 08 Apr 2018 09:54:53 +0800
Subject: [PATCH] 默认汇总时间设定为昨天
---
application/modules/Public/controllers/User.php | 73 +++++++++++++++++++++++++++++++++++-
1 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/application/modules/Public/controllers/User.php b/application/modules/Public/controllers/User.php
index ba411de..6e941c0 100644
--- a/application/modules/Public/controllers/User.php
+++ b/application/modules/Public/controllers/User.php
@@ -5,7 +5,7 @@
class UserController extends System_Controller_Web{
public function init(){
- $this->request = $this->getRequest();
+ $this->request = $this->getRequest();
if($this->request->action == "login"){
$this->setLayout();
}
@@ -30,8 +30,11 @@
}
}
else{
- $this->setLayout();
- }
+ $session = Yaf_Session::getInstance();
+ if(isset($session['user'])){
+ $this->redirect('/admin/index/index');
+ }
+ }
}
/**
@@ -43,6 +46,70 @@
$this->redirect('/user_login.html');
}
+ /**
+ * ������
+ */
+ public function UploadAction(){
+ //header('Access-Control-Allow-Origin: http://www.baidu.com'); //������http://www.baidu.com������������������
+ //header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With'); //���������������������header
+ date_default_timezone_set("Asia/Shanghai");
+ error_reporting(E_ERROR);
+ header("Content-Type: text/html; charset=utf-8");
+
+ $CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("themes/ueditor/php/config.json")), true);
+ $action = $this->get('action');
+ switch ($action) {
+ case 'config':
+ $result = json_encode($CONFIG);
+ break;
+
+ /* ������������ */
+ case 'uploadimage':
+ /* ������������ */
+ case 'uploadscrawl':
+ /* ������������ */
+ case 'uploadvideo':
+ /* ������������ */
+ case 'uploadfile':
+ $result = include("themes/ueditor/php/action_upload.php");
+ break;
+
+ /* ������������ */
+ case 'listimage':
+ $result = include("themes/ueditor/php/action_list.php");
+ break;
+ /* ������������ */
+ case 'listfile':
+ $result = include("themes/ueditor/php/action_list.php");
+ break;
+
+ /* ������������������ */
+ case 'catchimage':
+ $result = include("themes/ueditor/php/action_crawler.php");
+ break;
+
+ default:
+ $result = json_encode(array(
+ 'state'=> '������������������'
+ ));
+ break;
+ }
+
+ /* ������������ */
+ if (isset($_GET["callback"])) {
+ if (preg_match("/^[\w_]+$/", $_GET["callback"])) {
+ echo htmlspecialchars($_GET["callback"]) . '(' . $result . ')';
+ } else {
+ echo json_encode(array(
+ 'state'=> 'callback���������������'
+ ));
+ }
+ } else {
+ echo $result;
+ }
+ die();
+ }
+
}
--
Gitblit v1.8.0