fixed errors, code style and a little more

pull/159/head
ShindaKioku 2017-06-18 17:51:40 +03:00
parent 961890db9b
commit 42f6000ede
15 changed files with 497 additions and 47 deletions

8
.idea/KodExplorer.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/KodExplorer.iml" filepath="$PROJECT_DIR$/.idea/KodExplorer.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

434
.idea/workspace.xml Normal file
View File

@ -0,0 +1,434 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b680a8bc-2dd0-4771-a724-b85bf58746cd" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/app.class.php" afterPath="$PROJECT_DIR$/controller/app.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/fav.class.php" afterPath="$PROJECT_DIR$/controller/fav.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/setting.class.php" afterPath="$PROJECT_DIR$/controller/setting.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/share.class.php" afterPath="$PROJECT_DIR$/controller/share.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/system_group.class.php" afterPath="$PROJECT_DIR$/controller/system_group.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/system_member.class.php" afterPath="$PROJECT_DIR$/controller/system_member.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/controller/user.class.php" afterPath="$PROJECT_DIR$/controller/user.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/core/Application.class.php" afterPath="$PROJECT_DIR$/lib/core/Application.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/core/Controller.class.php" afterPath="$PROJECT_DIR$/lib/core/Controller.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/core/Model.class.php" afterPath="$PROJECT_DIR$/lib/core/Model.class.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/update.php" afterPath="$PROJECT_DIR$/lib/update.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager">
<leaf />
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>show_tips</find>
<find>$this-&gt;sql</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/lib/update.php" />
<option value="$PROJECT_DIR$/lib/core/Application.class.php" />
<option value="$PROJECT_DIR$/lib/core/Model.class.php" />
<option value="$PROJECT_DIR$/controller/system_member.class.php" />
<option value="$PROJECT_DIR$/controller/app.class.php" />
<option value="$PROJECT_DIR$/lib/core/Controller.class.php" />
<option value="$PROJECT_DIR$/controller/fav.class.php" />
<option value="$PROJECT_DIR$/controller/setting.class.php" />
<option value="$PROJECT_DIR$/controller/share.class.php" />
<option value="$PROJECT_DIR$/controller/system_group.class.php" />
<option value="$PROJECT_DIR$/controller/user.class.php" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="width" value="1366" />
<option name="height" value="768" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="function" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="class" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="KodExplorer" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="controller" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="FullScreen" value="true" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
<node-interpreter value="project" />
<working-dir value="" />
<envs />
<scope-kind value="ALL" />
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
<config-file value="" />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<TestRunner />
<method />
</configuration>
<configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1366" height="768" extended-state="6" />
<layout>
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24963397" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="processedProjectFiles" value="true" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/config/config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2048">
<caret line="9" column="19" lean-forward="true" selection-start-line="9" selection-start-column="19" selection-end-line="9" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/update.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="618">
<caret line="284" column="37" lean-forward="true" selection-start-line="284" selection-start-column="37" selection-end-line="284" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/core/Application.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242">
<caret line="51" column="21" lean-forward="false" selection-start-line="51" selection-start-column="12" selection-end-line="51" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/core/Model.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="260">
<caret line="23" column="26" lean-forward="true" selection-start-line="23" selection-start-column="26" selection-end-line="23" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/app.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="618">
<caret line="136" column="0" lean-forward="true" selection-start-line="136" selection-start-column="0" selection-end-line="136" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/desktop.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="618">
<caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/editor.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="618">
<caret line="131" column="0" lean-forward="true" selection-start-line="131" selection-start-column="0" selection-end-line="131" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/core/Controller.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-6">
<caret line="62" column="0" lean-forward="false" selection-start-line="62" selection-start-column="0" selection-end-line="62" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/explorer.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-30504">
<caret line="309" column="16" lean-forward="true" selection-start-line="309" selection-start-column="16" selection-end-line="309" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/fav.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-240">
<caret line="50" column="28" lean-forward="false" selection-start-line="50" selection-start-column="28" selection-end-line="50" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/setting.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="104">
<caret line="9" column="17" lean-forward="false" selection-start-line="9" selection-start-column="17" selection-end-line="9" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/share.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="410">
<caret line="616" column="8" lean-forward="false" selection-start-line="616" selection-start-column="8" selection-end-line="616" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/system_group.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-5284">
<caret line="60" column="10" lean-forward="false" selection-start-line="60" selection-start-column="10" selection-end-line="60" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/system_member.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1274">
<caret line="456" column="0" lean-forward="false" selection-start-line="456" selection-start-column="0" selection-end-line="456" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/system_role.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2996">
<caret line="10" column="17" lean-forward="true" selection-start-line="10" selection-start-column="17" selection-end-line="10" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/user.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="13185">
<caret line="537" column="1" lean-forward="false" selection-start-line="537" selection-start-column="1" selection-end-line="537" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/userShare.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/controller/util.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-156">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/class/phpqrcode.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-74926">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/class/downloader.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3542">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/class/fileCache.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1638">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/class/myCaptcha.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-422">
<caret line="188" column="19" lean-forward="false" selection-start-line="188" selection-start-column="19" selection-end-line="188" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/function/common.function.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="78">
<caret line="8" column="3" lean-forward="true" selection-start-line="8" selection-start-column="3" selection-end-line="8" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

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)){
@ -48,7 +48,7 @@ class system_member extends Controller{
}
}else{
$current_use = floatval($info['config']['size_use'])+floatval($use_size_add);
}
}
$info['config']['size_use'] = $current_use<0?0:$current_use;
$sql->set($the_id,$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)){
@ -105,7 +105,7 @@ class system_member extends Controller{
}
return $result;
}
//判断自己对某个组的权限 return false/'read'/'write'
//判断自己对某个组的权限 return false/'read'/'write'
public static function _user_auth_group_role($group_id){
$sql = self::load_data();
$user_info = $sql->get($_SESSION['kod_user']['user_id']);
@ -218,7 +218,7 @@ class system_member extends Controller{
$name = trim(rawurldecode($this->in['name']));
$password = rawurldecode($this->in['password']);
$group_info = json_decode(rawurldecode($this->in['group_info']),true);
$group_info = json_decode(rawurldecode($this->in['group_info']),true);
if(!is_array($group_info)){
show_json($this->L["system_member_group_error"],false);
}
@ -320,8 +320,8 @@ class system_member extends Controller{
}
//管理员自己不能添加自己到非管理员组
if($GLOBALS['is_root']
&& $_SESSION['kod_user']['user_id']==$user_id
if($GLOBALS['is_root']
&& $_SESSION['kod_user']['user_id']==$user_id
&& $this->in['role']!='1'){
show_json($this->L['error'],false);
}
@ -337,7 +337,7 @@ class system_member extends Controller{
$this->in['name'] = rawurlencode($the_name);//还原
$edit_arr = array('name','role','password','group_info','home_path','status','size_max');
foreach ($edit_arr as $key) {
if(!isset($this->in[$key])) continue;
if(!isset($this->in[$key])) continue;
$user_info[$key] = rawurldecode($this->in[$key]);
if($key == 'password'){
$user_info['password'] = md5($user_info[$key]);
@ -367,7 +367,7 @@ class system_member extends Controller{
/**
* 用户批量操作 system_member/do_action&action=&user_id=[101,222,131]&param=
* action :
* action :
* -------------
* del 删除用户
* status_set 启用&禁用 param=0/1
@ -375,7 +375,7 @@ class system_member extends Controller{
* group_reset 重置分组 param=group_json
* group_remove_from 从某个组删除 param=group_id
* group_add 添加到某个分组 param=group_json
*/
*/
public function do_action() {
if (!isset($this->in['user_id'])){
show_json($this->L["username_can_not_null"],false);
@ -391,14 +391,14 @@ class system_member extends Controller{
foreach ($user_arr as $user_id) {
switch ($action) {
case 'del'://删除
$user_info = $this->sql->get($user_id);
$user_info = $this->sql->get($user_id);
if($this->sql->remove($user_id) && $user_info['name']!=''){
del_dir(iconv_system(USER_PATH.$user_info['path'].'/'));
}
break;
case 'status_set'://禁用&启用
$status = intval($this->in['param']);
$this->sql->set(array('user_id',$user_id),array('status',$status));
$this->sql->set(array('user_id',$user_id),array('status',$status));
break;
case 'role_set'://设置权限组
$role = $this->in['param'];
@ -406,20 +406,20 @@ class system_member extends Controller{
if(!$GLOBALS['is_root'] && $role=='1'){
show_json($this->L['group_role_error'],false);
}
$this->sql->set(array('user_id',$user_id),array('role',$role));
$this->sql->set(array('user_id',$user_id),array('role',$role));
break;
case 'group_reset'://设置分组
$group_arr = json_decode($this->in['param'],true);
if(!is_array($group_arr)){
show_json($this->L['error'],false);
}
$this->sql->set(array('user_id',$user_id),array('group_info',$group_arr));
$this->sql->set(array('user_id',$user_id),array('group_info',$group_arr));
break;
case 'group_remove_from'://从某个组移除
$group_id = $this->in['param'];
$user_info = $this->sql->get($user_id);
unset($user_info['group_info'][$group_id]);
$this->sql->set($user_id,$user_info);
$this->sql->set($user_id,$user_info);
break;
case 'group_add'://添加到某个组
$group_arr = json_decode($this->in['param'],true);
@ -429,8 +429,8 @@ class system_member extends Controller{
$user_info = $this->sql->get($user_id);
foreach ($group_arr as $key => $value) {
$user_info['group_info'][$key] = $value;
}
$this->sql->set($user_id,$user_info);
}
$this->sql->set($user_id,$user_info);
default:break;
}
}
@ -467,7 +467,7 @@ class system_member extends Controller{
//============内部处理函数=============
/**
*初始化用户数据和配置。
*/
*/
private function _initDir($path){
$user_folder = array('home','recycle_kod','data');
$home_folders = explode(',',$this->config['setting_system']['new_user_folder']);

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);
@ -143,7 +141,7 @@ class user extends Controller{
if(isset($_SESSION) && $_SESSION['kod_login'] == 1){//避免session不可写导致循环跳转
$user = $_SESSION['kod_user'];
//admin 或者不填则允许所有kod用户登陆
if( $user['role'] == '1' ||
if( $user['role'] == '1' ||
!isset($this->in['check']) ||
!isset($this->in['value']) ){
$result = true;
@ -537,5 +535,4 @@ class user extends Controller{
include CLASS_DIR.'phpqrcode.php';
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

@ -15,7 +15,7 @@ function update_check(){
unzip_repeat();//再次解压避免windows部分主机解压失败问题
//from <=3.23 to last
if( file_exists(THE_DATA_PATH.'system/member.php') &&
if( file_exists(THE_DATA_PATH.'system/member.php') &&
!file_exists(THE_DATA_PATH.'system/system_member.php')){
new updateToV330();
update_clear();
@ -24,7 +24,7 @@ function update_check(){
//from [3.30~3.35]
$system_file = THE_DATA_PATH.'system/system_setting.php';
$system_data = fileCache::load($system_file);
if( file_exists($system_file) &&
if( file_exists($system_file) &&
(is_array($system_data) && !isset($system_data['current_version']) )
){
update330To336();
@ -67,7 +67,7 @@ function update_clear(){
del_file(BASIC_PATH.'readme.txt');
del_file(BASIC_PATH.'controller/group.class.php');
del_file(BASIC_PATH.'controller/member.class.php');
del_dir(THE_DATA_PATH.'i18n');
del_dir(THE_DATA_PATH.'thumb');
del_dir(BASIC_PATH.'__MACOSX');
@ -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'].'/');