diff --git a/common.php b/common.php index 088e996..1506e34 100755 --- a/common.php +++ b/common.php @@ -2,14 +2,14 @@ /* * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed - * as-is and without warranty under the MIT License. See + * as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ ////////////////////////////////////////////////////////////////// // Check Session / Key ////////////////////////////////////////////////////////////////// - + function checkSession(){ // Set any API keys $api_keys = array(); @@ -24,31 +24,31 @@ ////////////////////////////////////////////////////////////////// // Get JSON ////////////////////////////////////////////////////////////////// - + function getJSON($file){ $json = file_get_contents(BASE_PATH . "/data/" . $file); $json = str_replace("|*/?>","",str_replace(""; $write = fopen(BASE_PATH . "/data/" . $file, 'w') or die("can't open file"); fwrite($write, $data); fclose($write); } - + ////////////////////////////////////////////////////////////////// // Format JSEND Response ////////////////////////////////////////////////////////////////// - - function formatJSEND($status,$data=false){ - + + function formatJSEND($status,$data=false){ + // Success /////////////////////////////////////////////// if($status=="success"){ if($data){ @@ -56,21 +56,21 @@ }else{ $jsend = '{"status":"success","data":null}'; } - + // Error ///////////////////////////////////////////////// }else{ $jsend = '{"status":"error","message":"'.$data.'"}'; } - + // Return //////////////////////////////////////////////// - return $jsend; - + return $jsend; + } - + ////////////////////////////////////////////////////////////////// // Check Function Availability ////////////////////////////////////////////////////////////////// - + function isAvailable($func) { if (ini_get('safe_mode')) return false; $disabled = ini_get('disable_functions'); @@ -82,4 +82,4 @@ return true; } -?> \ No newline at end of file +?> diff --git a/components/filemanager/class.filemanager.php b/components/filemanager/class.filemanager.php index 795c9ef..8020108 100755 --- a/components/filemanager/class.filemanager.php +++ b/components/filemanager/class.filemanager.php @@ -26,7 +26,7 @@ class Filemanager { public $controller = ""; public $upload_json = ""; public $search_string = ""; - + public $query = ""; public $foptions = ""; @@ -147,7 +147,7 @@ class Filemanager { $output = shell_exec($cmd); $file_arr = explode("\n", $output); $output_arr = array(); - + error_reporting(0); foreach ($file_arr as $i => $fentry) { @@ -372,7 +372,7 @@ class Filemanager { //DEBUG : file_put_contents($this->path.".orig",$fileContents ); //DEBUG : file_put_contents($this->path.".patch", $this->patch); } - + $writeSuccess = fwrite($file, $this->content); fclose($file); if (! $writeSuccess){ diff --git a/components/project/class.project.php b/components/project/class.project.php index 9a28b10..ec83dc8 100755 --- a/components/project/class.project.php +++ b/components/project/class.project.php @@ -2,7 +2,7 @@ /* * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed -* as-is and without warranty under the MIT License. See +* as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ @@ -17,30 +17,30 @@ class Project { public $projects = ''; public $no_return = false; public $assigned = false; - + ////////////////////////////////////////////////////////////////// // METHODS ////////////////////////////////////////////////////////////////// - + // -----------------------------||----------------------------- // - + ////////////////////////////////////////////////////////////////// // Construct ////////////////////////////////////////////////////////////////// - + public function __construct(){ $this->projects = getJSON('projects.php'); if(file_exists(BASE_PATH . "/data/" . $_SESSION['user'] . '_acl.php')){ $this->assigned = getJSON($_SESSION['user'] . '_acl.php'); } } - + ////////////////////////////////////////////////////////////////// // Get First (Default, none selected) ////////////////////////////////////////////////////////////////// - + public function GetFirst(){ - + $projects_assigned = false; if($this->assigned){ foreach($this->projects as $project=>$data){ @@ -56,16 +56,16 @@ class Project { } // Set Sessions $_SESSION['project'] = $this->path; - + if(!$this->no_return){ echo formatJSEND("success",array("name"=>$this->name,"path"=>$this->path)); } } - + ////////////////////////////////////////////////////////////////// // Get Name From Path ////////////////////////////////////////////////////////////////// - + public function GetName(){ foreach($this->projects as $project=>$data){ if($data['path']==$this->path){ @@ -74,11 +74,11 @@ class Project { } return $this->name; } - + ////////////////////////////////////////////////////////////////// // Open Project ////////////////////////////////////////////////////////////////// - + public function Open(){ $pass = false; foreach($this->projects as $project=>$data){ @@ -94,11 +94,11 @@ class Project { echo formatJSEND("error","Error Opening Project"); } } - + ////////////////////////////////////////////////////////////////// // Create ////////////////////////////////////////////////////////////////// - + public function Create(){ $this->path = $this->SanitizePath(); $pass = $this->checkDuplicate(); @@ -111,11 +111,11 @@ class Project { echo formatJSEND("error","A Project With the Same Name or Path Exists"); } } - + ////////////////////////////////////////////////////////////////// // Delete Project ////////////////////////////////////////////////////////////////// - + public function Delete(){ $revised_array = array(); foreach($this->projects as $project=>$data){ @@ -128,12 +128,12 @@ class Project { // Response echo formatJSEND("success",null); } - - + + ////////////////////////////////////////////////////////////////// // Check Duplicate ////////////////////////////////////////////////////////////////// - + public function CheckDuplicate(){ $pass = true; foreach($this->projects as $project=>$data){ @@ -143,14 +143,14 @@ class Project { } return $pass; } - + ////////////////////////////////////////////////////////////////// // Sanitize Path ////////////////////////////////////////////////////////////////// - + public function SanitizePath(){ $sanitized = str_replace(" ","_",$this->name); return preg_replace('/[^\w-]/', '', $sanitized); } - -} \ No newline at end of file + +} diff --git a/config.example.php b/config.example.php index cfd5d1b..482dbcb 100755 --- a/config.example.php +++ b/config.example.php @@ -2,7 +2,7 @@ /* * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed -* as-is and without warranty under the MIT License. See +* as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ @@ -36,4 +36,4 @@ session_start(); require_once("common.php"); -?> \ No newline at end of file +?>