fixed errors, code style and a little more

pull/159/head^2
ShindaKioku 2017-06-18 18:32:21 +03:00
parent 961890db9b
commit cbed717cd0
11 changed files with 41 additions and 47 deletions

View File

@ -19,7 +19,7 @@ class app extends Controller{
$this->display(TEMPLATE.'app/index.php');
}
public function init_app($user_info){
public function init_app(){
$list = $this->sql->get();
$new_user_app = $this->config['setting_system']['new_user_app'];
$default = explode(',',$new_user_app);

View File

@ -33,7 +33,7 @@ class fav extends Controller{
}
$name = $name.'('.$index.')';
}
$res=$this->sql->set(
$this->sql->set(
$name,
array(
'name' => $name,
@ -49,9 +49,6 @@ class fav extends Controller{
* 编辑
*/
public function edit() {
$this->in['name'] = $this->in['name'];
$this->in['path'] = $this->in['path'];
$this->in['name_to'] = $this->in['name_to'];
$new_fav = $this->sql->get($this->in['name']);
if(!isset($new_fav['type'])){
$new_fav['type'] = 'folder';

View File

@ -7,7 +7,6 @@
*/
class setting extends Controller{
private $sql;
function __construct(){
parent::__construct();
}

View File

@ -14,7 +14,7 @@ class share extends Controller{
function __construct(){
parent::__construct();
$this->tpl = TEMPLATE.'share/';
$auth = system_role::get_info(1);//经过role检测
system_role::get_info(1);//经过role检测
//不需要检查的action
$arr_not_check = array('common_js');
if (!in_array(ACT,$arr_not_check)){
@ -192,7 +192,7 @@ class share extends Controller{
$this->sql->set($this->in['sid'],$this->share_info);
}
public function common_js(){
$out = ob_get_clean();
ob_get_clean();
$the_config = array(
'lang' => LANGUAGE_TYPE,
'system_os' => $this->config['system_os'],
@ -614,7 +614,7 @@ class share extends Controller{
if (in_array($val['name'],$ex_name)) continue;
$list_new['folderlist'][] = $val;
}
$s = _DIR_OUT($list_new);
_DIR_OUT($list_new);
return _DIR_OUT($list_new);
}
}

View File

@ -34,7 +34,7 @@ class system_group extends Controller{
* @param [type] $the_id [user_id or group_id]
* @param [type] $use_size_add [变更的大小 size_max G为单位 size_use Byte为单位]
*/
public static function space_change($the_id,$use_size_add=false){
public function space_change($the_id,$use_size_add=false){
$sql = self::load_data();
$info = $sql->get($the_id);
if(!is_array($info)){
@ -58,7 +58,7 @@ class system_group extends Controller{
* 空间剩余检测
* 1073741824 —— 1G
*/
public static function space_check($the_id){
public function space_check($the_id){
$sql = self::load_data();
$info = $sql->get($the_id);
if(!is_array($info)){

View File

@ -33,7 +33,7 @@ class system_member extends Controller{
* @param [type] $the_id [user_id or group_id]
* @param [type] $use_size_add [变更的大小 size_max G为单位 size_use Byte为单位]
*/
public static function space_change($the_id,$use_size_add=false){
public function space_change($the_id,$use_size_add=false){
$sql = self::load_data();
$info = $sql->get($the_id);
if(!is_array($info)){
@ -56,7 +56,7 @@ class system_member extends Controller{
* 空间剩余检测
* 1073741824 —— 1G
*/
public static function space_check($the_id){
public function space_check($the_id){
$sql = self::load_data();
$info = $sql->get($the_id);
if(!is_array($info)){

View File

@ -8,7 +8,6 @@
class user extends Controller{
private $user; //用户相关信息
private $auth; //用户所属组权限
private $notCheck;
function __construct(){
parent::__construct();
@ -42,8 +41,7 @@ class user extends Controller{
$this->_setCsrfToken();
}
if(in_array(ST,$this->notCheckApp)) return;//不需要判断的控制器
if(in_array(ACT,$this->notCheck)) return;//不需要判断的action
if(in_array(ST,$this->notCheckApp) && in_array(ACT,$this->notCheck)) return;//不需要判断的控制器 | 不需要判断的action
if(isset($_SESSION['kod_login']) && $_SESSION['kod_login']===true){
$user = system_member::get_info($this->user['user_id']);
$this->login_success($user);
@ -538,4 +536,3 @@ class user extends Controller{
QRcode::png(rawurldecode($this->in['url']));
}
}

View File

@ -13,7 +13,7 @@
class Application {
public $default_controller = null; //默认的类名
public $default_do = null; //默认的方法名
public $sub_dir =''; //控制器子目录
public $sub_dir = ''; //控制器子目录
public $model = ''; //控制器对应模型 对象。
/**
@ -70,7 +70,7 @@ class Application {
*/
private function autorun(){
global $config;
if (count($config['autorun']) > 0) {
if (count($config['autorun'])) {
foreach ($config['autorun'] as $key => $var) {
$this->appRun($var['controller'],$var['function']);
}

View File

@ -37,6 +37,9 @@ abstract class Controller {
*/
public function loadModel($class){
$args = func_get_args();
if ( !$this->$class ) {
show_tips($class.' model not exists');
}
$this -> $class = call_user_func_array('init_model', $args);
return $this -> $class;
}

View File

@ -12,24 +12,22 @@
*/
abstract class Model {
var $db = null;
var $in;
var $config;
protected $db = null;
public $in;
/**
* 构造函数
* @return Null
*/
function __construct(){
public function __construct(){
global $g_config, $in;
$this -> in = $in;
$this -> config = $config;
}
/**
* TODO db
*/
function db(){
public function db(){
if ($this ->db != NULL) {
return $this ->db;
}else{

View File

@ -206,7 +206,7 @@ class updateToV330{
$group_path = THE_DATA_PATH.'Group/';
mk_dir($group_path);
touch($group_path.'index.html');
touch($group_path.'index.htmzl');
$public = THE_DATA_PATH.'public';
$item_path = iconv_system($group_path.$arr['path'].'/');