From 8c62326875df7181758b7600799e24006c8cf42f Mon Sep 17 00:00:00 2001 From: xevidos Date: Sun, 22 Dec 2019 02:57:43 -0500 Subject: [PATCH] Continued bug fixes for next update --- common.php | 11 ++++++++--- components/filemanager/class.filemanager.php | 6 +++--- components/filemanager/init.js | 3 +-- components/market/class.market.php | 2 +- components/project/class.project.php | 1 + components/user/class.user.php | 8 ++++---- components/user/controller.php | 3 +++ components/user/init.js | 9 +++++++++ 8 files changed, 30 insertions(+), 13 deletions(-) diff --git a/common.php b/common.php index 755fe7d..bc81154 100755 --- a/common.php +++ b/common.php @@ -270,8 +270,13 @@ class Common { Common::construct(); //Set a Session Name - session_name( md5( BASE_PATH ) ); - session_save_path( SESSIONS_PATH ); + try { + + session_name( md5( BASE_PATH ) ); + session_save_path( SESSIONS_PATH ); + } catch( exception $e ) { + } + session_start(); if( ! defined( 'SESSION_ID' ) ) { @@ -296,7 +301,7 @@ class Common { } public static function return( $output, $action = "return" ) { - + switch( $action ) { case( "exit" ): diff --git a/components/filemanager/class.filemanager.php b/components/filemanager/class.filemanager.php index b3f3a81..7f57bfd 100755 --- a/components/filemanager/class.filemanager.php +++ b/components/filemanager/class.filemanager.php @@ -6,9 +6,9 @@ * [root]/license.txt for more. This information must remain intact. */ -require_once('../../lib/diff_match_patch.php'); -require_once('../../common.php'); -require_once('./class.archive.php'); +require_once( '../../lib/diff_match_patch.php' ); +require_once( '../../common.php' ); +require_once( __DIR__ . '/class.archive.php' ); class Filemanager extends Common { diff --git a/components/filemanager/init.js b/components/filemanager/init.js index 5d2fa66..9103b8d 100755 --- a/components/filemanager/init.js +++ b/components/filemanager/init.js @@ -85,7 +85,6 @@ // Load uploader $.loadScript( "components/filemanager/upload_scripts/jquery.ui.widget.js", true ); $.loadScript( "components/filemanager/upload_scripts/jquery.iframe-transport.js", true ); - $.loadScript( "components/filemanager/upload_scripts/jquery.fileupload_data.js", true ); $( document ).on( 'dragenter', function( e ) { @@ -665,7 +664,7 @@ //Add Legacy support for new file layout for( let i = files.length;i--; ) { - files[i].name = files[i].basename; + files[i].name = files[i].path; } console.log( file, files ); diff --git a/components/market/class.market.php b/components/market/class.market.php index 4200b03..f80d1cd 100755 --- a/components/market/class.market.php +++ b/components/market/class.market.php @@ -224,7 +224,7 @@ class Market extends Common } } else { $reponame = explode('/', $repo); - $tmp = file_get_contents($this->url.'/?t='.rtrim($type, "s").'&i='.str_replace("-master", "", $reponame[sizeof($repo)-1])); + $tmp = file_get_contents($this->url.'/?t='.rtrim($type, "s").'&i='.str_replace("-master", "", $reponame[@sizeof($repo)-1])); } if (file_put_contents(BASE_PATH.'/'.$type.'/'.$name.'.zip', fopen($repo.'/archive/master.zip', 'r'))) { $zip = new ZipArchive; diff --git a/components/project/class.project.php b/components/project/class.project.php index 652eaea..c8f38d7 100755 --- a/components/project/class.project.php +++ b/components/project/class.project.php @@ -7,6 +7,7 @@ */ require_once( '../../common.php' ); +require_once( '../filemanager/class.filemanager.php' ); class Project extends Common { diff --git a/components/user/class.user.php b/components/user/class.user.php index 8fbfc48..a45e5b8 100755 --- a/components/user/class.user.php +++ b/components/user/class.user.php @@ -41,7 +41,7 @@ class User { $this->set_default_options( $username ); $pass = true; } - return false; + return $pass; } public function delete_user( $username ) { @@ -323,10 +323,10 @@ class User { public function Password() { global $sql; - $this->EncryptPassword(); + $password = $this->encrypt_password( $this->password ); $query = "UPDATE users SET password=? WHERE username=?;"; - $bind_variables = array( $this->password, $this->username ); - $return = $sql->query( $query, $bind_variables, 0, "rowCount" ); + $bind_variables = array( $password, $this->username ); + $return = $sql->query( $query, $bind_variables, 0, "rowCount", "exception" ); if( $return > 0 ) { diff --git a/components/user/controller.php b/components/user/controller.php index 37891d8..6d9a062 100755 --- a/components/user/controller.php +++ b/components/user/controller.php @@ -142,6 +142,9 @@ if( $_GET['action'] == 'create' ) { if( $result ) { exit( formatJSEND( "success", "User successfully created." ) ); + } else { + + exit( formatJSEND( "error", "User could not be created." ) ); } } } diff --git a/components/user/init.js b/components/user/init.js index 4f32165..c9d9630 100755 --- a/components/user/init.js +++ b/components/user/init.js @@ -159,6 +159,9 @@ codiad.message.success( i18n( 'User Account Created' ) ) _this.list(); + } else { + + console.log( createResponse, data ); } }); } @@ -183,6 +186,9 @@ if(deleteResponse != 'error') { codiad.message.success(i18n('Account Deleted')) _this.list(); + } else { + + console.log( deleteResponse, data ); } }); }); @@ -252,6 +258,9 @@ if(passwordResponse != 'error') { codiad.message.success(i18n('Password Changed')); codiad.modal.unload(); + } else { + + console.log( passwordResponse, data ); } }); }