mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-11 14:50:13 +01:00
Add notification center button and fix stat-card/activity board loading
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/FIleManager.iml" filepath="$PROJECT_DIR$/.idea/FIleManager.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
600
serverStatus/litespeed/FileManager/.idea/workspace.xml
generated
600
serverStatus/litespeed/FileManager/.idea/workspace.xml
generated
@@ -1,600 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="9320a755-b878-4593-8eac-7d773157fabd" name="Default" comment="" />
|
||||
<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="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file leaf-file-name="fileManager.php" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="414">
|
||||
<caret line="80" column="26" lean-forward="true" selection-start-line="80" selection-start-column="26" selection-end-line="80" selection-end-column="26" />
|
||||
<folding>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="caller.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="CSS File" />
|
||||
<option value="HTML File" />
|
||||
<option value="JavaScript File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>../../assets</find>
|
||||
<find>ajax/libs/angularjs/1.2.12/angular.js</find>
|
||||
<find>AbnTestController</find>
|
||||
<find>AbnTest</find>
|
||||
<find>listAction</find>
|
||||
<find>$commandToExecute</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>assets</replace>
|
||||
</replaceStrings>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/assets/prac.js" />
|
||||
<option value="$PROJECT_DIR$/javaprac.html" />
|
||||
<option value="$PROJECT_DIR$/admin-blog.html" />
|
||||
<option value="$PROJECT_DIR$/tree.html" />
|
||||
<option value="$PROJECT_DIR$/js/tree.js" />
|
||||
<option value="$PROJECT_DIR$/js/fileManager.js" />
|
||||
<option value="$PROJECT_DIR$/css/fileManager.css" />
|
||||
<option value="$PROJECT_DIR$/index.html" />
|
||||
<option value="$PROJECT_DIR$/php/caller.php" />
|
||||
<option value="$PROJECT_DIR$/php/fileManager.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" extendedState="6">
|
||||
<option name="x" value="1419" />
|
||||
<option name="y" value="-4" />
|
||||
<option name="width" value="1299" />
|
||||
<option name="height" value="764" />
|
||||
</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>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="FileManager" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="FileManager" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="FileManager" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="FileManager" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="php" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="DefaultHtmlFileTemplate" value="HTML File" />
|
||||
<property name="list.type.of.created.stylesheet" value="CSS" />
|
||||
</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="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="9320a755-b878-4593-8eac-7d773157fabd" name="Default" comment="" />
|
||||
<created>1511505785266</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1511505785266</updated>
|
||||
<workItem from="1511505786403" duration="25402000" />
|
||||
<workItem from="1512371928726" duration="717000" />
|
||||
<workItem from="1512401006678" duration="9000" />
|
||||
<workItem from="1512401100852" duration="2365000" />
|
||||
<workItem from="1523948661253" duration="7874000" />
|
||||
<workItem from="1524303326266" duration="7000" />
|
||||
<workItem from="1524730597265" duration="8000" />
|
||||
<workItem from="1525085664919" duration="10000" />
|
||||
<workItem from="1525683960581" duration="13000" />
|
||||
<workItem from="1526291898810" duration="13000" />
|
||||
<workItem from="1526512471223" duration="71000" />
|
||||
<workItem from="1530908210451" duration="3368000" />
|
||||
<workItem from="1531046295316" duration="1117000" />
|
||||
<workItem from="1531052646849" duration="625000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="41599000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="1419" y="-4" width="1303" height="780" extended-state="6" />
|
||||
<layout>
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12759416" 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="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" 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="false" 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="true" show_stripe_button="true" weight="0.32934132" 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="version" value="1" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<option name="time" value="1" />
|
||||
</breakpoint-manager>
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.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>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/assets/prac.js" />
|
||||
<entry file="file://$PROJECT_DIR$/index-alt.html" />
|
||||
<entry file="file://$PROJECT_DIR$/admin-blog.html" />
|
||||
<entry file="file://$PROJECT_DIR$/javaprac.html" />
|
||||
<entry file="file://$PROJECT_DIR$/js/tree.js" />
|
||||
<entry file="file://$PROJECT_DIR$/tree.html" />
|
||||
<entry file="file://$PROJECT_DIR$/js/fileManager.js" />
|
||||
<entry file="file://$PROJECT_DIR$/css/fileManager.css" />
|
||||
<entry file="file://$PROJECT_DIR$/index.html" />
|
||||
<entry file="file://$PROJECT_DIR$/php/caller.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="558">
|
||||
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$USER_HOME$/.cache/.fr-Tsiwv1/CyberCP/install/FileManager/php/fileManager.php" />
|
||||
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="414">
|
||||
<caret line="80" column="26" lean-forward="true" selection-start-line="80" selection-start-column="26" selection-end-line="80" selection-end-column="26" />
|
||||
<folding>
|
||||
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="e#6737#7475#0#PHP" expanded="false" />
|
||||
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,127 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Caller{
|
||||
|
||||
private $basePath = null;
|
||||
|
||||
public function __construct($basePath = null)
|
||||
{
|
||||
$this->basePath = $basePath ?: dirname(__DIR__);
|
||||
}
|
||||
|
||||
public function requestHandler()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' and isset($_POST['method'])) {
|
||||
|
||||
$pathToSeed = '/home/' . $_POST['domainName'] . '/..filemanagerkey';
|
||||
$receivedSeed = $_POST['domainRandomSeed'];
|
||||
|
||||
$myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
|
||||
$seed = fread($myfile,filesize($pathToSeed));
|
||||
fclose($myfile);
|
||||
|
||||
if ($seed != $receivedSeed){
|
||||
$answer = array(
|
||||
'uploadStatus' => 0,
|
||||
'answer' => 'Not allowed to upload in this path.',
|
||||
'error_message' => "None",
|
||||
'fileName' => $_FILES['file']['name']
|
||||
);
|
||||
$json = json_encode($answer);
|
||||
echo $json;
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($_POST['method']) {
|
||||
case 'upload':
|
||||
$this->uploadFile();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function uploadFile(){
|
||||
try {
|
||||
if (!empty($_FILES)) {
|
||||
|
||||
if($this->return_bytes(ini_get('upload_max_filesize')) < $_SERVER['CONTENT_LENGTH']){
|
||||
throw new Exception("Size of uploaded file is greater than upload limit!");
|
||||
}
|
||||
|
||||
$completePath = $this->cleanInput($_POST['completePath']);
|
||||
$fileName = $this->cleanInput($_FILES['file']['name']);
|
||||
$homePath = $this->cleanInput($_POST['home']);
|
||||
|
||||
$tempPath = $_FILES['file']['tmp_name'];
|
||||
$uploadPath = $completePath . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$pos = strpos($uploadPath, $homePath);
|
||||
|
||||
if ($pos === false) {
|
||||
throw new Exception("Not allowed to upload in this path!");
|
||||
}
|
||||
|
||||
|
||||
if(move_uploaded_file($tempPath, $uploadPath)==true){
|
||||
$answer = array(
|
||||
'uploadStatus' => 1,
|
||||
'answer' => 'File transfer completed',
|
||||
'error_message' => "None",
|
||||
'fileName' => $_FILES['file']['name']
|
||||
);
|
||||
$json = json_encode($answer);
|
||||
echo $json;
|
||||
}
|
||||
else{
|
||||
throw new Exception("Can not move uploaded file to destination location!");
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
throw new Exception("No Files to upload!");
|
||||
}
|
||||
}
|
||||
catch(Exception $e) {
|
||||
$answer = array(
|
||||
'uploadStatus' => 0,
|
||||
'answer' => 'No files',
|
||||
'error_message' => $e->getMessage(),
|
||||
'fileName' => $_FILES['file']['name'],
|
||||
);
|
||||
$json = json_encode($answer);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function return_bytes($val) {
|
||||
$val = trim($val);
|
||||
$last = strtolower($val[strlen($val)-1]);
|
||||
switch($last) {
|
||||
// The 'G' modifier is available since PHP 5.1.0
|
||||
case 'g':
|
||||
$val *= 1024;
|
||||
case 'm':
|
||||
$val *= 1024;
|
||||
case 'k':
|
||||
$val *= 1024;
|
||||
}
|
||||
|
||||
return $val;
|
||||
}
|
||||
|
||||
private function cleanInput($input) {
|
||||
$search = array(
|
||||
'@<script[^>]*?>.*?</script>@si',
|
||||
'@<[\/\!]*?[^<>]*?>@si',
|
||||
'@<style[^>]*?>.*?</style>@siU',
|
||||
'@<![\s\S]*?--[ \t\n\r]*>@'
|
||||
);
|
||||
$output = preg_replace($search, '', $input);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$caller = new Caller("/");
|
||||
$caller->requestHandler();
|
||||
@@ -1,748 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
class fileManager
|
||||
{
|
||||
|
||||
private $basePath = null;
|
||||
|
||||
public function requestHandler()
|
||||
{
|
||||
$postdata = file_get_contents("php://input");
|
||||
$request = json_decode($postdata);
|
||||
|
||||
$pathToSeed = '/home/' . $request->domainName . '/..filemanagerkey';
|
||||
$receivedSeed = $request->domainRandomSeed;
|
||||
|
||||
$myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
|
||||
$seed = fread($myfile,filesize($pathToSeed));
|
||||
fclose($myfile);
|
||||
|
||||
if ($seed != $receivedSeed){
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "You can not open filemanager for this domain.",
|
||||
"copied" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (isset($request->method)) {
|
||||
|
||||
switch ($request->method) {
|
||||
case 'list':
|
||||
$this->listDir($request->completeStartingPath);
|
||||
break;
|
||||
case 'listForTable':
|
||||
$home = $this->cleanInput($request->home);
|
||||
$completeStartingPath = $this->cleanInput($request->completeStartingPath);
|
||||
$this->listForTable($home,$completeStartingPath);
|
||||
break;
|
||||
case 'readFileContents':
|
||||
$this->readFileContents($request->fileName);
|
||||
break;
|
||||
case 'writeFileContents':
|
||||
$this->writeFileContents($request->fileName, $request->fileContent);
|
||||
break;
|
||||
case 'createNewFolder':
|
||||
$folderName = $this->cleanInput($request->folderName);
|
||||
$this->createNewFolder($folderName);
|
||||
break;
|
||||
case 'createNewFile':
|
||||
$fileName = $this->cleanInput($request->fileName);
|
||||
$this->createNewFile($fileName);
|
||||
break;
|
||||
case 'deleteFolderOrFile':
|
||||
$this->deleteFolderOrFile($request->path, $request->fileAndFolders);
|
||||
break;
|
||||
case 'compress':
|
||||
$compressedFileName = $this->cleanInput($request->compressedFileName);
|
||||
$this->compress($request->basePath, $request->listOfFiles, $compressedFileName, $request->compressionType);
|
||||
break;
|
||||
case 'extract':
|
||||
$extractionLocation = $this->cleanInput($request->extractionLocation);
|
||||
$this->extract($request->home,$request->basePath,$request->fileToExtract,$request->extractionType,$extractionLocation);
|
||||
break;
|
||||
case 'move':
|
||||
$this->moveFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
|
||||
break;
|
||||
case 'copy':
|
||||
$this->copyFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
|
||||
break;
|
||||
case 'rename':
|
||||
$newFileName = $this->cleanInput($request->newFileName);
|
||||
$this->renameFileOrFolder($request->basePath,$request->existingName,$newFileName);
|
||||
break;
|
||||
case 'changePermissions':
|
||||
$this->changePermissions($request->basePath, $request->permissionsPath, $request->newPermissions, $request->recursive);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function changePermissions($basePath, $permissionsPath, $newPermissions, $recursive)
|
||||
{
|
||||
try {
|
||||
|
||||
$completePath = $basePath . DIRECTORY_SEPARATOR . $permissionsPath;
|
||||
|
||||
if($recursive == 1){
|
||||
|
||||
$commandToExecute = 'chmod -R ' . $newPermissions . " '". $completePath . "'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
|
||||
}else{
|
||||
$commandToExecute = 'chmod ' . $newPermissions . " '". $completePath . "'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
}
|
||||
|
||||
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"permissionsChanged" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"permissionsChanged" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function listDir($basePath)
|
||||
{
|
||||
try {
|
||||
$path = "";
|
||||
$listPath = $basePath . $path;
|
||||
$files = scandir($listPath);
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"fetchStatus" => 1
|
||||
);
|
||||
$counter = 0;
|
||||
|
||||
$tempDir = array();
|
||||
$tempFiles = array();
|
||||
|
||||
// sorting files at end
|
||||
|
||||
foreach ($files as $dirFile) {
|
||||
|
||||
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
|
||||
if (is_dir($completePath) == true) {
|
||||
array_push($tempDir, $dirFile);
|
||||
} else {
|
||||
array_push($tempFiles, $dirFile);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$result = array_merge($tempDir, $tempFiles);
|
||||
|
||||
foreach ($result as $dirFile) {
|
||||
if ($dirFile == "." or $dirFile == "..") {
|
||||
continue;
|
||||
}
|
||||
$arrayCounter = 0;
|
||||
$tempArray = array($dirFile);
|
||||
$arrayCounter += 1;
|
||||
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
|
||||
$tempArray[$arrayCounter] = $completePath;
|
||||
$arrayCounter += 1;
|
||||
|
||||
if (is_dir($completePath) == true) {
|
||||
$list = true;
|
||||
$tempArray[$arrayCounter] = $list;
|
||||
} else {
|
||||
$list = false;
|
||||
$tempArray[$arrayCounter] = $list;
|
||||
}
|
||||
|
||||
$json_data[(string)$counter] = $tempArray;
|
||||
$counter += 1;
|
||||
|
||||
}
|
||||
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} catch (Exception $e) {
|
||||
$answer = array(
|
||||
'uploadStatus' => 0,
|
||||
'answer' => [1, 2, 3],
|
||||
'error_message' => $e->getMessage(),
|
||||
);
|
||||
$json = json_encode($answer);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function getPermissions($fileName){
|
||||
|
||||
$perms = fileperms($fileName);
|
||||
|
||||
switch ($perms & 0xF000) {
|
||||
case 0xC000: // socket
|
||||
$info = 's';
|
||||
break;
|
||||
case 0xA000: // symbolic link
|
||||
$info = 'l';
|
||||
break;
|
||||
case 0x8000: // regular
|
||||
$info = 'r';
|
||||
break;
|
||||
case 0x6000: // block special
|
||||
$info = 'b';
|
||||
break;
|
||||
case 0x4000: // directory
|
||||
$info = 'd';
|
||||
break;
|
||||
case 0x2000: // character special
|
||||
$info = 'c';
|
||||
break;
|
||||
case 0x1000: // FIFO pipe
|
||||
$info = 'p';
|
||||
break;
|
||||
default: // unknown
|
||||
$info = 'u';
|
||||
}
|
||||
|
||||
// Owner
|
||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0040) ?
|
||||
(($perms & 0x0800) ? 's' : 'x' ) :
|
||||
(($perms & 0x0800) ? 'S' : '-'));
|
||||
|
||||
// Group
|
||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0008) ?
|
||||
(($perms & 0x0400) ? 's' : 'x' ) :
|
||||
(($perms & 0x0400) ? 'S' : '-'));
|
||||
|
||||
// World
|
||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0001) ?
|
||||
(($perms & 0x0200) ? 't' : 'x' ) :
|
||||
(($perms & 0x0200) ? 'T' : '-'));
|
||||
|
||||
return $info;
|
||||
|
||||
}
|
||||
|
||||
private function listForTable($home,$basePath)
|
||||
{
|
||||
try {
|
||||
|
||||
$pos = strpos($basePath, $home);
|
||||
|
||||
if ($pos === false) {
|
||||
throw new Exception("Not allowed to browse this path, going back home!");
|
||||
}
|
||||
|
||||
$path = "";
|
||||
$listPath = $basePath . $path;
|
||||
$files = scandir($listPath);
|
||||
$json_data = array("error_message" => "None",
|
||||
"fetchStatus" => 1
|
||||
);
|
||||
$counter = 0;
|
||||
|
||||
$tempDir = array();
|
||||
$tempFiles = array();
|
||||
|
||||
// sorting files at end
|
||||
|
||||
foreach ($files as $dirFile) {
|
||||
|
||||
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
|
||||
if (is_dir($completePath) == true) {
|
||||
array_push($tempDir, $dirFile);
|
||||
} else {
|
||||
array_push($tempFiles, $dirFile);
|
||||
}
|
||||
}
|
||||
|
||||
$result = array_merge($tempDir, $tempFiles);
|
||||
|
||||
foreach ($result as $dirFile) {
|
||||
if ($dirFile == "." or $dirFile == "..") {
|
||||
continue;
|
||||
}
|
||||
$arrayCounter = 0;
|
||||
$tempArray = array($dirFile);
|
||||
$arrayCounter += 1;
|
||||
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
|
||||
$tempArray[$arrayCounter] = $completePath;
|
||||
$arrayCounter += 1;
|
||||
|
||||
// find last modified
|
||||
|
||||
$lastModified = date("F d Y H:i:s.", filemtime($completePath));
|
||||
$tempArray[$arrayCounter] = $lastModified;
|
||||
$arrayCounter += 1;
|
||||
|
||||
// find size of file
|
||||
|
||||
$fileSize = (int)(filesize($completePath) / 1024);
|
||||
$tempArray[$arrayCounter] = $fileSize;
|
||||
$arrayCounter += 1;
|
||||
|
||||
// find permissions of file
|
||||
|
||||
|
||||
$tempArray[$arrayCounter] = substr(sprintf('%o', fileperms($completePath)), -4);;
|
||||
$arrayCounter += 1;
|
||||
|
||||
|
||||
// Deciding if the current path is file or dir.
|
||||
|
||||
if (is_dir($completePath) == true) {
|
||||
$list = true;
|
||||
$tempArray[$arrayCounter] = $list;
|
||||
} else {
|
||||
$list = false;
|
||||
$tempArray[$arrayCounter] = $list;
|
||||
}
|
||||
|
||||
$json_data[(string)$counter] = $tempArray;
|
||||
$counter += 1;
|
||||
|
||||
}
|
||||
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} catch (Exception $e) {
|
||||
$answer = array(
|
||||
'fetchStatus' => 0,
|
||||
'error_message' => $e->getMessage(),
|
||||
);
|
||||
$json = json_encode($answer);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function readFileContents($pathToFile)
|
||||
{
|
||||
|
||||
try {
|
||||
$listPath = $pathToFile;
|
||||
$contentsofFile = file_get_contents($pathToFile);
|
||||
|
||||
if ($contentsofFile !== false) {
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"fetchStatus" => 1,
|
||||
"fileContents" => $contentsofFile
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} else {
|
||||
throw new Exception("Can not read the file Contents");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"fetchStatus" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function writeFileContents($pathToFile, $fileContent)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
|
||||
$contentsofFile = file_put_contents($pathToFile, $fileContent);
|
||||
|
||||
if ($contentsofFile !== false) {
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"saveStatus" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} else {
|
||||
throw new Exception("Can not write the file Contents.");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"saveStatus" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function createNewFolder($folderName)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
|
||||
$returnVal = mkdir($folderName);
|
||||
|
||||
if ($returnVal !== false) {
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"createStatus" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} else {
|
||||
throw new Exception("Can not create Folder");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"createStatus" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function createNewFile($fileName)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
|
||||
if (touch($fileName)) {
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"createStatus" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} else {
|
||||
throw new Exception("Can not create file!");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"createStatus" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function deleteFolderOrFile($basePath, $fileAndFolders)
|
||||
{
|
||||
try {
|
||||
|
||||
foreach ($fileAndFolders as $path) {
|
||||
|
||||
$path = $basePath . DIRECTORY_SEPARATOR . $path;
|
||||
|
||||
if (is_dir($path) == true) {
|
||||
$commandToExecute = 'rm -rf ' . "'".$path ."'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
exec($commandToExecute, $programOutput);
|
||||
} else {
|
||||
if (unlink($path)) {
|
||||
continue;
|
||||
} else {
|
||||
throw new Exception("Can not delete!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"deleteStatus" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"deleteStatus" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function compress($basePath, $listOfFiles, $compressedFileName, $compressionType)
|
||||
{
|
||||
try {
|
||||
|
||||
chdir($basePath);
|
||||
|
||||
if ($compressionType == "zip") {
|
||||
|
||||
$compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".zip";
|
||||
|
||||
$commandToExecute = 'zip -r ' . $compressedFileName . ' ';
|
||||
|
||||
foreach ($listOfFiles as $file) {
|
||||
$completePathToFile = $file;
|
||||
$commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
|
||||
}
|
||||
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => $commandToExecute,
|
||||
"compressed" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
else {
|
||||
|
||||
$compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".tar.gz";
|
||||
|
||||
$commandToExecute = 'tar -czvf ' . $compressedFileName . ' ';
|
||||
|
||||
foreach ($listOfFiles as $file) {
|
||||
$completePathToFile = $file;
|
||||
$commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
|
||||
}
|
||||
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"compressed" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"compressed" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
}
|
||||
|
||||
private function extract($home,$basePath,$completeFileToExtract, $extractionType, $extractionLocation)
|
||||
{
|
||||
try {
|
||||
|
||||
$pos = strpos($extractionLocation, $home);
|
||||
|
||||
if ($pos === false) {
|
||||
throw new Exception("Not allowed to extact in this path, please choose location inside home!");
|
||||
}
|
||||
|
||||
if ($extractionType == "zip") {
|
||||
|
||||
$commandToExecute = "unzip -o '" . $completeFileToExtract . "' -d '" . $extractionLocation . "'";
|
||||
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => $commandToExecute,
|
||||
"extracted" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
} else {
|
||||
|
||||
$commandToExecute = "tar xf '" . $completeFileToExtract . "' -C '" . $extractionLocation . "'";
|
||||
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"extracted" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
|
||||
|
||||
}
|
||||
}catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"extracted" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
}
|
||||
|
||||
private function moveFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
|
||||
{
|
||||
try {
|
||||
|
||||
$pos = strpos($newPath, $home);
|
||||
|
||||
if ($pos === false) {
|
||||
throw new Exception("Not allowed to move in this path, please choose location inside home!");
|
||||
}
|
||||
|
||||
if(!file_exists($newPath)){
|
||||
if(!mkdir($newPath, 0777, true)){
|
||||
$json_data = array(
|
||||
"error_message" => "Can not create the new folder, it already exists!",
|
||||
"moved" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fileAndFolders as $path) {
|
||||
|
||||
$completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
|
||||
$completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
|
||||
|
||||
$commandToExecute = 'mv ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
exec($commandToExecute, $programOutput);
|
||||
}
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"moved" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"moved" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function copyFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
|
||||
{
|
||||
try {
|
||||
|
||||
$pos = strpos($newPath, $home);
|
||||
|
||||
if ($pos === false) {
|
||||
throw new Exception("Not allowed to move in this path, please choose location inside home!");
|
||||
}
|
||||
|
||||
if(!file_exists($newPath)){
|
||||
if(!mkdir($newPath, 0777, true)){
|
||||
throw new Exception("Can not create the new folder, it already exists!");
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fileAndFolders as $path) {
|
||||
|
||||
$completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
|
||||
$completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
|
||||
|
||||
$commandToExecute = 'cp ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
exec($commandToExecute, $programOutput);
|
||||
}
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"copied" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"copied" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function renameFileOrFolder($basePath, $currentName, $newName)
|
||||
{
|
||||
try {
|
||||
|
||||
$completeOldPath = $basePath . DIRECTORY_SEPARATOR . $currentName;
|
||||
$completeNewPath = $basePath . DIRECTORY_SEPARATOR . $newName;
|
||||
|
||||
$commandToExecute = 'mv ' ."'". $completeOldPath . "'" . ' ' . "'" . $completeNewPath . "'";
|
||||
$programOutput = fopen('temp.txt', 'a');
|
||||
exec($commandToExecute, $programOutput);
|
||||
|
||||
$json_data = array(
|
||||
"error_message" => "None",
|
||||
"renamed" => 1,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$json_data = array(
|
||||
"error_message" => $e->getMessage(),
|
||||
"renamed" => 0,
|
||||
);
|
||||
$json = json_encode($json_data);
|
||||
echo $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function cleanInput($input) {
|
||||
$search = array(
|
||||
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
|
||||
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
|
||||
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
|
||||
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments
|
||||
);
|
||||
$output = preg_replace($search, '', $input);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
$caller = new fileManager();
|
||||
$caller->requestHandler();
|
||||
Reference in New Issue
Block a user