From 17caa109011938ca533d5c7bb7cfa38606c0645e Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:12:54 +0200 Subject: Rename config.tmp to config.php --- config/filemgr/rbfminc/config.php | 95 +++++++++++++++++++++++++++++++++++++++ config/filemgr/rbfminc/config.tmp | 95 --------------------------------------- 2 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 config/filemgr/rbfminc/config.php delete mode 100644 config/filemgr/rbfminc/config.tmp diff --git a/config/filemgr/rbfminc/config.php b/config/filemgr/rbfminc/config.php new file mode 100644 index 00000000..405514f8 --- /dev/null +++ b/config/filemgr/rbfminc/config.php @@ -0,0 +1,95 @@ +Security issue: Please change your username or password"; +//} +$security_issues = "
"; +?> diff --git a/config/filemgr/rbfminc/config.tmp b/config/filemgr/rbfminc/config.tmp deleted file mode 100644 index 405514f8..00000000 --- a/config/filemgr/rbfminc/config.tmp +++ /dev/null @@ -1,95 +0,0 @@ -Security issue: Please change your username or password"; -//} -$security_issues = "
"; -?> -- cgit v1.2.3 From af566daf06605f67b6cc9e60906ff7690134526f Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:14:51 +0200 Subject: Rename download.tmp to download.php --- config/filemgr/rbfminc/download.php | 49 +++++++++++++++++++++++++++++++++++++ config/filemgr/rbfminc/download.tmp | 49 ------------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 config/filemgr/rbfminc/download.php delete mode 100644 config/filemgr/rbfminc/download.tmp diff --git a/config/filemgr/rbfminc/download.php b/config/filemgr/rbfminc/download.php new file mode 100644 index 00000000..172ec896 --- /dev/null +++ b/config/filemgr/rbfminc/download.php @@ -0,0 +1,49 @@ + diff --git a/config/filemgr/rbfminc/download.tmp b/config/filemgr/rbfminc/download.tmp deleted file mode 100644 index badc6d19..00000000 --- a/config/filemgr/rbfminc/download.tmp +++ /dev/null @@ -1,49 +0,0 @@ - \ No newline at end of file -- cgit v1.2.3 From c0f717ffab5beb2206d21d1107077a55f34c8f94 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:15:38 +0200 Subject: Rename functions.tmp to functions.php --- config/filemgr/rbfminc/functions.php | 189 +++++++++++++++++++++++++++++++++++ config/filemgr/rbfminc/functions.tmp | 189 ----------------------------------- 2 files changed, 189 insertions(+), 189 deletions(-) create mode 100644 config/filemgr/rbfminc/functions.php delete mode 100644 config/filemgr/rbfminc/functions.tmp diff --git a/config/filemgr/rbfminc/functions.php b/config/filemgr/rbfminc/functions.php new file mode 100644 index 00000000..8dffd5e4 --- /dev/null +++ b/config/filemgr/rbfminc/functions.php @@ -0,0 +1,189 @@ + 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', + 'bmp' => 'image/bmp', + 'tif|tiff' => 'image/tiff', + 'ico' => 'image/x-icon', + 'asf|asx|wax|wmv|wmx' => 'video/asf', + 'avi' => 'video/avi', + 'mov|qt' => 'video/quicktime', + 'mpeg|mpg|mpe' => 'video/mpeg', + 'txt|c|cc|h' => 'text/plain', + 'rtx' => 'text/richtext', + 'css' => 'text/css', + 'htm|html' => 'text/html', + 'php|php3|' => 'application/php', + 'mp3|mp4' => 'audio/mpeg', + 'ra|ram' => 'audio/x-realaudio', + 'wav' => 'audio/wav', + 'ogg' => 'audio/ogg', + 'mid|midi' => 'audio/midi', + 'wma' => 'audio/wma', + 'rtf' => 'application/rtf', + 'js' => 'application/javascript', + 'pdf' => 'application/pdf', + 'doc' => 'application/msword', + 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', + 'wri' => 'application/vnd.ms-write', + 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', + 'mdb' => 'application/vnd.ms-access', + 'mpp' => 'application/vnd.ms-project', + 'swf' => 'application/x-shockwave-flash', + 'class' => 'application/java', + 'tar' => 'application/x-tar', + 'zip' => 'application/zip', + 'gz|gzip' => 'application/x-gzip', + 'exe' => 'application/x-msdownload', + // openoffice formats + 'odt' => 'application/vnd.oasis.opendocument.text', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odf' => 'application/vnd.oasis.opendocument.formula', + + )); + + $type = false; + $ext = false; + + foreach ($mimes as $ext_preg => $mime_match) { + $ext_preg = '!\.(' . $ext_preg . ')$!i'; + if ( preg_match($ext_preg, $filename, $ext_matches) ) { + $type = $mime_match; + $ext = $ext_matches[1]; + break; + } + } + + return compact('ext', 'type'); +} + + + +function roundsize($size){ + $i=0; + $iec = array("B", "Kb", "Mb", "Gb", "Tb"); + while (($size/1024)>1) { + $size=$size/1024; + $i++;} + return(round($size,1)." ".$iec[$i]); +} + +?> diff --git a/config/filemgr/rbfminc/functions.tmp b/config/filemgr/rbfminc/functions.tmp deleted file mode 100644 index f06ee69c..00000000 --- a/config/filemgr/rbfminc/functions.tmp +++ /dev/null @@ -1,189 +0,0 @@ - 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'bmp' => 'image/bmp', - 'tif|tiff' => 'image/tiff', - 'ico' => 'image/x-icon', - 'asf|asx|wax|wmv|wmx' => 'video/asf', - 'avi' => 'video/avi', - 'mov|qt' => 'video/quicktime', - 'mpeg|mpg|mpe' => 'video/mpeg', - 'txt|c|cc|h' => 'text/plain', - 'rtx' => 'text/richtext', - 'css' => 'text/css', - 'htm|html' => 'text/html', - 'php|php3|' => 'application/php', - 'mp3|mp4' => 'audio/mpeg', - 'ra|ram' => 'audio/x-realaudio', - 'wav' => 'audio/wav', - 'ogg' => 'audio/ogg', - 'mid|midi' => 'audio/midi', - 'wma' => 'audio/wma', - 'rtf' => 'application/rtf', - 'js' => 'application/javascript', - 'pdf' => 'application/pdf', - 'doc' => 'application/msword', - 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', - 'wri' => 'application/vnd.ms-write', - 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', - 'mdb' => 'application/vnd.ms-access', - 'mpp' => 'application/vnd.ms-project', - 'swf' => 'application/x-shockwave-flash', - 'class' => 'application/java', - 'tar' => 'application/x-tar', - 'zip' => 'application/zip', - 'gz|gzip' => 'application/x-gzip', - 'exe' => 'application/x-msdownload', - // openoffice formats - 'odt' => 'application/vnd.oasis.opendocument.text', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odf' => 'application/vnd.oasis.opendocument.formula', - - )); - - $type = false; - $ext = false; - - foreach ($mimes as $ext_preg => $mime_match) { - $ext_preg = '!\.(' . $ext_preg . ')$!i'; - if ( preg_match($ext_preg, $filename, $ext_matches) ) { - $type = $mime_match; - $ext = $ext_matches[1]; - break; - } - } - - return compact('ext', 'type'); -} - - - -function roundsize($size){ - $i=0; - $iec = array("B", "Kb", "Mb", "Gb", "Tb"); - while (($size/1024)>1) { - $size=$size/1024; - $i++;} - return(round($size,1)." ".$iec[$i]); -} - -?> \ No newline at end of file -- cgit v1.2.3 From 5444a37af5a09032bd4332f64423787c2473cb8f Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:16:09 +0200 Subject: Rename rename.tmp to rename.php --- config/filemgr/rbfminc/rename.php | 41 +++++++++++++++++++++++++++++++++++++++ config/filemgr/rbfminc/rename.tmp | 41 --------------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 config/filemgr/rbfminc/rename.php delete mode 100644 config/filemgr/rbfminc/rename.tmp diff --git a/config/filemgr/rbfminc/rename.php b/config/filemgr/rbfminc/rename.php new file mode 100644 index 00000000..5a2096ca --- /dev/null +++ b/config/filemgr/rbfminc/rename.php @@ -0,0 +1,41 @@ + + + +Rename + + + + + + diff --git a/config/filemgr/rbfminc/rename.tmp b/config/filemgr/rbfminc/rename.tmp deleted file mode 100644 index 266e38d4..00000000 --- a/config/filemgr/rbfminc/rename.tmp +++ /dev/null @@ -1,41 +0,0 @@ - - - -Rename - - - - - - \ No newline at end of file -- cgit v1.2.3 From d97ed5ab8182728c78b03ab6ea94d57effa7722a Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:16:37 +0200 Subject: Rename session.tmp to session.php --- config/filemgr/rbfminc/session.php | 32 ++++++++++++++++++++++++++++++++ config/filemgr/rbfminc/session.tmp | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 config/filemgr/rbfminc/session.php delete mode 100644 config/filemgr/rbfminc/session.tmp diff --git a/config/filemgr/rbfminc/session.php b/config/filemgr/rbfminc/session.php new file mode 100644 index 00000000..7cfc133d --- /dev/null +++ b/config/filemgr/rbfminc/session.php @@ -0,0 +1,32 @@ + diff --git a/config/filemgr/rbfminc/session.tmp b/config/filemgr/rbfminc/session.tmp deleted file mode 100644 index 7cfc133d..00000000 --- a/config/filemgr/rbfminc/session.tmp +++ /dev/null @@ -1,32 +0,0 @@ - -- cgit v1.2.3 From a7b3c587d433c07a2a881a5fc16158714be49948 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:19:08 +0200 Subject: Remove incredible useless crap --- config/filemgr/filemgr.inc | 152 --------------------------------------------- 1 file changed, 152 deletions(-) delete mode 100644 config/filemgr/filemgr.inc diff --git a/config/filemgr/filemgr.inc b/config/filemgr/filemgr.inc deleted file mode 100644 index 64186637..00000000 --- a/config/filemgr/filemgr.inc +++ /dev/null @@ -1,152 +0,0 @@ - -- cgit v1.2.3 From 314b5dff82f629bfcb5115e16a9ff0c9f73af984 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:20:05 +0200 Subject: Rename file_manager.tmp to file_manager.php --- config/filemgr/file_manager.php | 595 ++++++++++++++++++++++++++++++++++++++++ config/filemgr/file_manager.tmp | 595 ---------------------------------------- 2 files changed, 595 insertions(+), 595 deletions(-) create mode 100644 config/filemgr/file_manager.php delete mode 100644 config/filemgr/file_manager.tmp diff --git a/config/filemgr/file_manager.php b/config/filemgr/file_manager.php new file mode 100644 index 00000000..8c5ee1c5 --- /dev/null +++ b/config/filemgr/file_manager.php @@ -0,0 +1,595 @@ + 1){ + $up_one_level = " ondblclick=\"document.location='{$_SERVER['PHP_SELF']}?p=".urlencode(substr($current_folder, 0, strrpos(substr($current_folder, 0, -1), "/"))."/")."'\""; + } + + + if ($handle = @opendir($current_folder)) { + while (false !== ($folder_content = readdir($handle))) { + if(is_dir($current_folder.'/'.$folder_content) and $folder_content!='.' and $folder_content!='..'){ + $folders[] = $folder_content; + }elseif(!is_dir($current_folder.'/'.$folder_content) and $folder!='.' and $folder_content!='..'){ + $files[] = $folder_content; + } + } + closedir($handle); + }else{ + $error = "

Invalid directory

"; + } + + $container .= " + + + + + + + + + + + + + + +"; + + $id = 1; + + if(is_array($folders)){ + array_multisort($folders, SORT_ASC, SORT_REGULAR); + foreach($folders as $v){ + if($v){ + + $vf = $v.'/'; + + $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); + + $fileperms = GetFilePerms($current_folder.$v); + + if($url_path){ + $browser = "\"W\""; + if($url_field){ + $use_url = "\"U\""; + }else{ + $use_url = "\"U\""; + } + }else{ + $browser = " "; + $use_url = "\"U\""; + } + + + $container .= " + + + + + + + + + + + + + + + "; + $id++; + } + } + } + if(is_array($files)){ + array_multisort($files, SORT_ASC, SORT_REGULAR); + foreach($files as $v){ + if($v){ + + $extension = substr(strrchr($v, "."), 1); + + $file_image = "ico_file.png"; + if($extension == 'php' or $extension == 'php3'){$file_image = "ico_php.png";} + if( + $extension == 'htm' or + $extension == 'HTM' or + $extension == 'html' or + $extension == 'HTML' + ){$file_image = "ico_html.png";} + if( + $extension == 'jpg' or + $extension == 'JPG' or + $extension == 'jpeg' or + $extension == 'JPEG' or + $extension == 'gif' or + $extension == 'GIF' or + $extension == 'png' or + $extension == 'PNG' + ){$file_image = "ico_picture.png";} + + $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); + + $file_size = roundsize(filesize($current_folder.$v)); + + if( + $extension == 'txt' or + $extension == 'inc' or + $extension == 'sh' or + $extension == 'js' or + $extension == 'xml' or + $extension == 'conf' or + $extension == 'config' or + $extension == 'ini' or + $extension == 'php' or + $extension == 'php3' or + $extension == 'htm' or + $extension == 'HTM' or + $extension == 'html' or + $extension == 'HTML' or + $extension == 'css' or + $extension == 'CSS' + ){ + $edit_file_content = "\"Edit\""; + }else{ + $edit_file_content = " "; + } + + $fileperms = GetFilePerms($current_folder.$v); + + if($url_path){ + $browser = "\"W\""; + if($url_field){ + $use_url = "\"U\""; + }else{ + $use_url = "\"U\""; + } + }else{ + $browser = " "; + $use_url = "\"U\""; + } + + + $container .= " + + + + + + + + + + + + + + + "; + $id++; + } + } + } + + $container .= "
 Name Ext.SizeDateAttributes
\"F\"[..]
+ \"Folder\" + + +
+ {$v} +
+ +
+ + + + + + + +
+
{$browser}  + \"Rename\" +   + \"D\" +  <DIR>{$last_updated_time}{$fileperms}
+ \"File\" + +
+ {$v} +
+ +
+ + + + + +
+
{$browser} + \"Download\" + + \"Rename\" + {$edit_file_content} + \"D\" + {$extension}{$file_size}{$last_updated_time}{$fileperms}
"; + + $container = preg_replace("/\s+/m", " ", $container); + +?> + + + + + + + + + + +
+
+ +
+
+ + +
+

URL path:
+
+
+ Upload a file in current folder: + +     + + Replace existing file     + + +
+
+     Create new folder here; Folder name: + + +
+ +
[ open OPEN IN BROWSER ]     + [ download DOWNLOAD ]     + [ rename RENAME ]     + [ view VIEW/EDIT ]     + [ delete DELETE ]
+ + + File: {$current_folder}{$_GET['f']}
+
+ + + + +"; + } + +?> + +
+Created by TomSchaefer + +// + + "; +} +if($redirect){ + echo " + + "; +} +?> + + + + + + + + +Login + +



+ + + + + + diff --git a/config/filemgr/file_manager.tmp b/config/filemgr/file_manager.tmp deleted file mode 100644 index 8c5ee1c5..00000000 --- a/config/filemgr/file_manager.tmp +++ /dev/null @@ -1,595 +0,0 @@ - 1){ - $up_one_level = " ondblclick=\"document.location='{$_SERVER['PHP_SELF']}?p=".urlencode(substr($current_folder, 0, strrpos(substr($current_folder, 0, -1), "/"))."/")."'\""; - } - - - if ($handle = @opendir($current_folder)) { - while (false !== ($folder_content = readdir($handle))) { - if(is_dir($current_folder.'/'.$folder_content) and $folder_content!='.' and $folder_content!='..'){ - $folders[] = $folder_content; - }elseif(!is_dir($current_folder.'/'.$folder_content) and $folder!='.' and $folder_content!='..'){ - $files[] = $folder_content; - } - } - closedir($handle); - }else{ - $error = "

Invalid directory

"; - } - - $container .= " - - - - - - - - - - - - - - -"; - - $id = 1; - - if(is_array($folders)){ - array_multisort($folders, SORT_ASC, SORT_REGULAR); - foreach($folders as $v){ - if($v){ - - $vf = $v.'/'; - - $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); - - $fileperms = GetFilePerms($current_folder.$v); - - if($url_path){ - $browser = "\"W\""; - if($url_field){ - $use_url = "\"U\""; - }else{ - $use_url = "\"U\""; - } - }else{ - $browser = " "; - $use_url = "\"U\""; - } - - - $container .= " - - - - - - - - - - - - - - - "; - $id++; - } - } - } - if(is_array($files)){ - array_multisort($files, SORT_ASC, SORT_REGULAR); - foreach($files as $v){ - if($v){ - - $extension = substr(strrchr($v, "."), 1); - - $file_image = "ico_file.png"; - if($extension == 'php' or $extension == 'php3'){$file_image = "ico_php.png";} - if( - $extension == 'htm' or - $extension == 'HTM' or - $extension == 'html' or - $extension == 'HTML' - ){$file_image = "ico_html.png";} - if( - $extension == 'jpg' or - $extension == 'JPG' or - $extension == 'jpeg' or - $extension == 'JPEG' or - $extension == 'gif' or - $extension == 'GIF' or - $extension == 'png' or - $extension == 'PNG' - ){$file_image = "ico_picture.png";} - - $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); - - $file_size = roundsize(filesize($current_folder.$v)); - - if( - $extension == 'txt' or - $extension == 'inc' or - $extension == 'sh' or - $extension == 'js' or - $extension == 'xml' or - $extension == 'conf' or - $extension == 'config' or - $extension == 'ini' or - $extension == 'php' or - $extension == 'php3' or - $extension == 'htm' or - $extension == 'HTM' or - $extension == 'html' or - $extension == 'HTML' or - $extension == 'css' or - $extension == 'CSS' - ){ - $edit_file_content = "\"Edit\""; - }else{ - $edit_file_content = " "; - } - - $fileperms = GetFilePerms($current_folder.$v); - - if($url_path){ - $browser = "\"W\""; - if($url_field){ - $use_url = "\"U\""; - }else{ - $use_url = "\"U\""; - } - }else{ - $browser = " "; - $use_url = "\"U\""; - } - - - $container .= " - - - - - - - - - - - - - - - "; - $id++; - } - } - } - - $container .= "
 Name Ext.SizeDateAttributes
\"F\"[..]
- \"Folder\" - - -
- {$v} -
- -
- - - - - - - -
-
{$browser}  - \"Rename\" -   - \"D\" -  <DIR>{$last_updated_time}{$fileperms}
- \"File\" - -
- {$v} -
- -
- - - - - -
-
{$browser} - \"Download\" - - \"Rename\" - {$edit_file_content} - \"D\" - {$extension}{$file_size}{$last_updated_time}{$fileperms}
"; - - $container = preg_replace("/\s+/m", " ", $container); - -?> - - - - - - - - - - -
-
- -
-
- - -
-

URL path:
-
-
- Upload a file in current folder: - -     - - Replace existing file     - - -
-
-     Create new folder here; Folder name: - - -
- -
[ open OPEN IN BROWSER ]     - [ download DOWNLOAD ]     - [ rename RENAME ]     - [ view VIEW/EDIT ]     - [ delete DELETE ]
- - - File: {$current_folder}{$_GET['f']}
-
- - - - -"; - } - -?> - -
-Created by TomSchaefer - -// - - "; -} -if($redirect){ - echo " - - "; -} -?> - - - - - - - - -Login - -



- - - - - - -- cgit v1.2.3 From 54605e2102e2910881f63d83cbc9eaa490f4ad9e Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:20:51 +0200 Subject: Rename index.tmp to index.php --- config/filemgr/index.php | 11 +++++++++++ config/filemgr/index.tmp | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 config/filemgr/index.php delete mode 100644 config/filemgr/index.tmp diff --git a/config/filemgr/index.php b/config/filemgr/index.php new file mode 100644 index 00000000..b511069d --- /dev/null +++ b/config/filemgr/index.php @@ -0,0 +1,11 @@ + + + + + + + diff --git a/config/filemgr/index.tmp b/config/filemgr/index.tmp deleted file mode 100644 index 47092a0c..00000000 --- a/config/filemgr/index.tmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file -- cgit v1.2.3 From e7205c557e0cef823aca62adb3b9cc8dacdafefc Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:36:43 +0200 Subject: filemgr - rewrite utterly broken junk from scratch --- config/filemgr/filemgr.xml | 191 ++++++++++++++++----------------------------- 1 file changed, 69 insertions(+), 122 deletions(-) diff --git a/config/filemgr/filemgr.xml b/config/filemgr/filemgr.xml index c2a7ac42..1fe6d51f 100644 --- a/config/filemgr/filemgr.xml +++ b/config/filemgr/filemgr.xml @@ -1,18 +1,32 @@ - - + + - + Copyright (C) 2015 ESF, LLC All rights reserved. - */ -/* ========================================================================== */ +*/ +/* ====================================================================================== */ /* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -23,27 +37,24 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - +*/ +/* ====================================================================================== */ + ]]> + PHP File Manager - none https://forum.pfsense.org/index.php/topic,26974.0.html File Manager - 0.1.4 - Settings - /usr/local/pkg/filemgr.inc + 0.2.0 + Diagnostics: File Manager File Manager - File Manager settings
Diagnostics
filemgr.xml /packages/filemgr/file_manager.php
- Settings + File Manager /packages/filemgr/file_manager.php @@ -51,190 +62,126 @@ installedpackages->package->$packagename->configuration->filemgr /usr/local/pkg/ - 0755 https://packages.pfsense.org/packages/config/filemgr/filemgr.xml - /usr/local/pkg/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/filemgr.inc - - - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/file_manager.tmp + /usr/local/www/packages/filemgr/ + https://packages.pfsense.org/packages/config/filemgr/file_manager.php - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/index.tmp + /usr/local/www/packages/filemgr/ + https://packages.pfsense.org/packages/config/filemgr/index.php - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/bg_footer.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/bg_header.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/bg_page.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/file_editor_bg.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/folder.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/folder_go.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/folder_up.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/go.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_delete.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_download.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_file.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_html.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_open_as_web.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_php.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_picture.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_rename.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_script_edit.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_use_file.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/ico_use_file_inactive.png - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/index.html - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfmimg/ https://packages.pfsense.org/packages/config/filemgr/rbfmimg/new.png - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/rbfminc/config.tmp + /usr/local/www/packages/filemgr/rbfminc/ + https://packages.pfsense.org/packages/config/filemgr/rbfminc/config.php - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/rbfminc/download.tmp + /usr/local/www/packages/filemgr/rbfminc/ + https://packages.pfsense.org/packages/config/filemgr/rbfminc/download.php - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfminc/ https://packages.pfsense.org/packages/config/filemgr/rbfminc/file_editor_style.css - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/rbfminc/functions.tmp + /usr/local/www/packages/filemgr/ + https://packages.pfsense.org/packages/config/filemgr/rbfminc/functions.php - /tmp/ - 0755 + /usr/local/www/packages/filemgr/rbfminc/ https://packages.pfsense.org/packages/config/filemgr/rbfminc/index.html - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/rbfminc/rename.tmp - - - /tmp/ - 0755 - https://packages.pfsense.org/packages/config/filemgr/rbfminc/session.tmp - - - - Variable One - var1 - Enter the variable one here. - input - - - Variable Two - var1 - Enter the variable one here. - input - - - - - - php_sync_package_fm(); - - - php_sync_package_fm(); - - - php_install_command_fm(); - - - deinstall_command_fm(); - -
\ No newline at end of file + /usr/local/www/packages/filemgr/ + https://packages.pfsense.org/packages/config/filemgr/rbfminc/rename.php + + + /usr/local/www/packages/filemgr/ + https://packages.pfsense.org/packages/config/filemgr/rbfminc/session.php + + -- cgit v1.2.3 From bb215e93dadc4b6494be6f3826742b7a97bbe7bf Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:50:34 +0200 Subject: filemgr - fix up a couple of paths --- config/filemgr/filemgr.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/filemgr/filemgr.xml b/config/filemgr/filemgr.xml index 1fe6d51f..fdcf46d0 100644 --- a/config/filemgr/filemgr.xml +++ b/config/filemgr/filemgr.xml @@ -169,7 +169,7 @@ https://packages.pfsense.org/packages/config/filemgr/rbfminc/file_editor_style.css - /usr/local/www/packages/filemgr/ + /usr/local/www/packages/filemgr/rbfminc/ https://packages.pfsense.org/packages/config/filemgr/rbfminc/functions.php @@ -177,11 +177,11 @@ https://packages.pfsense.org/packages/config/filemgr/rbfminc/index.html - /usr/local/www/packages/filemgr/ + /usr/local/www/packages/filemgr/rbfminc/ https://packages.pfsense.org/packages/config/filemgr/rbfminc/rename.php - /usr/local/www/packages/filemgr/ + /usr/local/www/packages/filemgr/rbfminc/ https://packages.pfsense.org/packages/config/filemgr/rbfminc/session.php -- cgit v1.2.3 From 157b398f9d26dafc4c51e5a00dfd892bde437b72 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 00:52:14 +0200 Subject: Bump filemgr package version --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index c66d2b96..47f1d509 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -96,7 +96,7 @@ Diagnostics https://forum.pfsense.org/index.php/topic,26974.0.html https://packages.pfsense.org/packages/config/filemgr/filemgr.xml - 0.1.4 + 0.2.0 Beta 2.2 tom@tomschaefer.org -- cgit v1.2.3 From acc664d1c723c270d92557ebe6bcafd66cb32833 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 15:02:33 +0200 Subject: file_manager.php - code style fixes Add copyright header, code style fixes. --- config/filemgr/file_manager.php | 616 +++++++++++++++++----------------------- 1 file changed, 259 insertions(+), 357 deletions(-) diff --git a/config/filemgr/file_manager.php b/config/filemgr/file_manager.php index 8c5ee1c5..5e858591 100644 --- a/config/filemgr/file_manager.php +++ b/config/filemgr/file_manager.php @@ -1,6 +1,34 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +include("rbfminc/config.php"); +//include("rbfminc/session.php"); require_once('config.inc'); require("guiconfig.inc"); @@ -8,98 +36,101 @@ $closehead = false; include("head.inc"); global $config; -if('ok' == 'ok'){ +if ('ok' == 'ok') { set_time_limit(1800); //30 min - include "rbfminc/functions.php"; + include("rbfminc/functions.php"); - clearstatcache (); + clearstatcache(); $_GET['p'] = urldecode($_GET['p']); - if($_COOKIE['current_folder']){ + if ($_COOKIE['current_folder']) { $initial_folder_cookie = $_COOKIE['current_folder']; } - if($_GET['url_field']){ + if ($_GET['url_field']) { setcookie('url_field', $_GET['url_field']); $url_field = $_GET['url_field']; - }else{ + } else { $url_field = $_COOKIE['url_field']; } - if($_GET['p']){ - if(substr($_GET['p'], -1) != "/"){$_GET['p'] = $_GET['p']."/";} + if ($_GET['p']) { + if (substr($_GET['p'], -1) != "/") { + $_GET['p'] = $_GET['p']."/"; + } $current_folder = $_GET['p']; - }elseif($initial_folder_cookie and file_exists($initial_folder_cookie)){ - if(substr($initial_folder_cookie, -1) != "/"){$initial_folder_cookie = $initial_folder_cookie."/";} + } elseif (($initial_folder_cookie) && (file_exists($initial_folder_cookie))) { + if (substr($initial_folder_cookie, -1) != "/") { + $initial_folder_cookie = $initial_folder_cookie."/"; + } $current_folder = $initial_folder_cookie; - }elseif($initial_folder and file_exists($initial_folder)){ - if(substr($initial_folder, -1) != "/"){$initial_folder = $initial_folder."/";} + } elseif (($initial_folder) && (file_exists($initial_folder))) { + if (substr($initial_folder, -1) != "/") { + $initial_folder = $initial_folder."/"; + } $current_folder = $initial_folder; - }else{ + } else { $current_folder = $_SERVER['DOCUMENT_ROOT']."/"; } - - if($only_below and strlen($current_folder) < strlen($initial_folder)){ + if (($only_below) && (strlen($current_folder) < strlen($initial_folder))) { setcookie('current_folder', '', time()-3600); header("Location: file_manager.php"); exit(); } - //setcookie('current_folder', $current_folder); - if(substr($current_folder, 0, strlen($_SERVER['DOCUMENT_ROOT'])) == $_SERVER['DOCUMENT_ROOT']){ - $url_path = "http://".$_SERVER['HTTP_HOST']."/".substr($current_folder, strlen($_SERVER['DOCUMENT_ROOT'])); + if (substr($current_folder, 0, strlen($_SERVER['DOCUMENT_ROOT'])) == $_SERVER['DOCUMENT_ROOT']) { + $url_path = "http://" . $_SERVER['HTTP_HOST'] . "/" . substr($current_folder, strlen($_SERVER['DOCUMENT_ROOT'])); } - - if($_POST['save_file'] == 'save_file' and $_GET['f']){ - if($handle = fopen($current_folder.$_GET['f'] , 'w')){ + if (($_POST['save_file'] == 'save_file') && ($_GET['f'])) { + if ($handle = fopen($current_folder.$_GET['f'] , 'w')) { if (fwrite($handle, stripslashes($_POST['file_content'])) === FALSE) { $alert_info .= "Cannot write to file ({$current_folder}{$_GET['f']})"; - }else{ + } else { $alert_info .= "File ({$current_folder}{$_GET['f']}) successfully saved"; $redirect = "file_manager.php?p=".urlencode($current_folder); } - }else{ + } else { $alert_info .= "Invalid file!!!"; } } - if($_POST['upload_file'] == 'upload_file'){ - if($_FILES['file']['error'] == 8){ + if ($_POST['upload_file'] == 'upload_file') { + if ($_FILES['file']['error'] == 8) { $alert_info .= "File upload stopped by extension!!!"; } - if($_FILES['file']['error'] == 7){ + if ($_FILES['file']['error'] == 7) { $alert_info .= "Failed to write file to disk!!!"; } - if($_FILES['file']['error'] == 6){ + if ($_FILES['file']['error'] == 6) { $alert_info .= "Missing a temporary folder!!!"; } - if($_FILES['file']['error'] == 4){ + if ($_FILES['file']['error'] == 4) { $alert_info .= "No image was uploaded!!!"; } - if($_FILES['file']['error'] == 3){ + if ($_FILES['file']['error'] == 3) { $alert_info .= "The uploaded file was only partially uploaded!!!"; } - if($_FILES['file']['error'] == 2){ + if ($_FILES['file']['error'] == 2) { $alert_info .= "The uploaded file exceeds the MAX_FILE_SIZE!!!"; } - if($_FILES['file']['error'] == 1){ + if ($_FILES['file']['error'] == 1) { $alert_info .= "The uploaded file exceeds the upload_max_filesize!!!"; } - if(!$alert_info){ - if(file_exists($current_folder.$_FILES['file']['name']) and !$_POST['replace_file']){ + if (!$alert_info) { + if ((file_exists($current_folder.$_FILES['file']['name'])) && (!$_POST['replace_file'])) { $alert_info .= "A file with the same name already exist in this folder\\nTo replace this file check \"Replace existing file\" in upload form!"; $redirect = "file_manager.php?p=".urlencode($current_folder); - }else{ - if(!@move_uploaded_file($_FILES["file"]["tmp_name"], $current_folder.$_FILES['file']['name'])){ + } else { + if (!@move_uploaded_file($_FILES["file"]["tmp_name"], $current_folder.$_FILES['file']['name'])) { $alert_info .= "Failed to upload file!!!"; - }else{ + } else { $alert_info .= "File successfully uploaded!"; $redirect = "file_manager.php?p=".urlencode($current_folder); } @@ -107,61 +138,61 @@ if('ok' == 'ok'){ } } - if($_GET['do'] == 'delete' and $_GET['file'] and $_GET['type'] == 'file'){ - if(file_exists($current_folder.$_GET['file'])){ - if(!@unlink($current_folder.$_GET['file'])){ + if (($_GET['do'] == 'delete') && ($_GET['file']) && ($_GET['type'] == 'file')) { + if (file_exists($current_folder.$_GET['file'])) { + if (!@unlink($current_folder.$_GET['file'])) { $alert_info = "You cannot delete this file\\nThe relevant permissions must permit this."; - }else{ + } else { $alert_info = "File deleted"; $redirect = "file_manager.php?p=".urlencode($current_folder); } - }else{ + } else { $alert_info = "You cannot delete this file\\nInvalid file"; } } - if($_GET['do'] == 'delete' and $_GET['file'] and $_GET['type'] == 'directory'){ - if(file_exists($current_folder.$_GET['file'])){ - if(!RecursiveFolderDelete($current_folder.$_GET['file'])){ + if (($_GET['do'] == 'delete') && ($_GET['file']) && ($_GET['type'] == 'directory')) { + if (file_exists($current_folder.$_GET['file'])) { + if (!RecursiveFolderDelete($current_folder.$_GET['file'])) { $alert_info = "You cannot delete this directory\\nThe relevant permissions must permit this."; - }else{ + } else { $alert_info = "Folder deleted"; $redirect = "file_manager.php?p=".urlencode($current_folder); } - }else{ + } else { $alert_info = "You cannot delete this directory\\nInvalid directory"; } } - if($_POST['create_folder'] == "Create folder"){ - if(@mkdir($current_folder.$_POST['folder_name'])){ + if ($_POST['create_folder'] == "Create folder") { + if (@mkdir($current_folder.$_POST['folder_name'])) { $alert_info = "Folder created successfully!"; - }else{ - $alert_info = "Invalid folder bane!"; + } else { + $alert_info = "Invalid folder name!"; } } preg_match_all("/\//", $current_folder, $m); - if(count($m[0]) > 1){ + if (count($m[0]) > 1) { $up_one_level = " ondblclick=\"document.location='{$_SERVER['PHP_SELF']}?p=".urlencode(substr($current_folder, 0, strrpos(substr($current_folder, 0, -1), "/"))."/")."'\""; } if ($handle = @opendir($current_folder)) { while (false !== ($folder_content = readdir($handle))) { - if(is_dir($current_folder.'/'.$folder_content) and $folder_content!='.' and $folder_content!='..'){ + if ((is_dir($current_folder . '/' . $folder_content)) && ($folder_content != '.' && $folder_content != '..')) { $folders[] = $folder_content; - }elseif(!is_dir($current_folder.'/'.$folder_content) and $folder!='.' and $folder_content!='..'){ + } elseif ((!is_dir($current_folder . '/' . $folder_content)) && ($folder != '.') && ($folder_content != '..')) { $files[] = $folder_content; } } closedir($handle); - }else{ + } else { $error = "

Invalid directory

"; } - $container .= " + $container .= <<   @@ -176,286 +207,155 @@ if('ok' == 'ok'){ \"F\" [..] -"; +EOF; $id = 1; - if(is_array($folders)){ + if (is_array($folders)) { array_multisort($folders, SORT_ASC, SORT_REGULAR); - foreach($folders as $v){ - if($v){ - + foreach ($folders as $v) { + if ($v) { $vf = $v.'/'; - $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); - $fileperms = GetFilePerms($current_folder.$v); - if($url_path){ + if ($url_path) { $browser = "\"W\""; - if($url_field){ + if ($url_field) { $use_url = "\"U\""; - }else{ + } else { $use_url = "\"U\""; } - }else{ + } else { $browser = " "; $use_url = "\"U\""; } - $container .= " - - - \"Folder\" - - - -
- {$v} -
- -
- - - - - - - -
- - - {$browser} -   - - \"Rename\" - -   - - \"D\" - -   - <DIR> - {$last_updated_time} - {$fileperms} - - "; - $id++; + $container .= << + + \"Folder\" + + +
+ {$v} +
+ +
+ + + + + +
+ + + {$browser} +   + + \"Rename\" + +   + + \"D\" + +   + <DIR> + {$last_updated_time} + {$fileperms} + +EOF; + + $id++; } } } - if(is_array($files)){ - array_multisort($files, SORT_ASC, SORT_REGULAR); - foreach($files as $v){ - if($v){ + if (is_array($files)) { + array_multisort($files, SORT_ASC, SORT_REGULAR); + foreach ($files as $v) { + if ($v) { $extension = substr(strrchr($v, "."), 1); $file_image = "ico_file.png"; - if($extension == 'php' or $extension == 'php3'){$file_image = "ico_php.png";} - if( - $extension == 'htm' or - $extension == 'HTM' or - $extension == 'html' or - $extension == 'HTML' - ){$file_image = "ico_html.png";} - if( - $extension == 'jpg' or - $extension == 'JPG' or - $extension == 'jpeg' or - $extension == 'JPEG' or - $extension == 'gif' or - $extension == 'GIF' or - $extension == 'png' or - $extension == 'PNG' - ){$file_image = "ico_picture.png";} + if (($extension == 'php') || ($extension == 'php3')) { + $file_image = "ico_php.png"; + } + if (($extension == 'htm') || ($extension == 'HTM') || ($extension == 'html') || ($extension == 'HTML')) { + $file_image = "ico_html.png"; + } + if (($extension == 'jpg') || ($extension == 'JPG') || ($extension == 'jpeg') || ($extension == 'JPEG') || + ($extension == 'gif') || ($extension == 'GIF') || ($extension == 'png') || ($extension == 'PNG')) { + $file_image = "ico_picture.png"; + } $last_updated_time = date("Y.m.d H:i:s", filemtime($current_folder.$v)); - $file_size = roundsize(filesize($current_folder.$v)); - if( - $extension == 'txt' or - $extension == 'inc' or - $extension == 'sh' or - $extension == 'js' or - $extension == 'xml' or - $extension == 'conf' or - $extension == 'config' or - $extension == 'ini' or - $extension == 'php' or - $extension == 'php3' or - $extension == 'htm' or - $extension == 'HTM' or - $extension == 'html' or - $extension == 'HTML' or - $extension == 'css' or - $extension == 'CSS' - ){ + if (($extension == 'txt') || ($extension == 'inc') || ($extension == 'sh') || ($extension == 'js') || ($extension == 'xml') || + ($extension == 'conf') || ($extension == 'config') || ($extension == 'ini') || ($extension == 'php') || ($extension == 'php3') || + ($extension == 'htm') || ($extension == 'HTM') || ($extension == 'html') || ($extension == 'HTML') || ($extension == 'css') || ($extension == 'CSS')) { $edit_file_content = "\"Edit\""; - }else{ + } else { $edit_file_content = " "; } $fileperms = GetFilePerms($current_folder.$v); - if($url_path){ + if ($url_path) { $browser = "\"W\""; - if($url_field){ + if ($url_field) { $use_url = "\"U\""; - }else{ + } else { $use_url = "\"U\""; } - }else{ + } else { $browser = " "; $use_url = "\"U\""; } - - $container .= " - - - \"File\" - - -
- {$v} -
+ $container .= << + + \"File\" + + +
+ {$v} +
-
- - - - - -
- - - {$browser} - - \"Download\" - - - \"Rename\" - - {$edit_file_content} - - \"D\" - - {$extension} - {$file_size} - {$last_updated_time} - {$fileperms} - - "; +
+ + + + + +
+ + + {$browser} + + \"Download\" + + + \"Rename\" + + {$edit_file_content} + + \"D\" + + {$extension} + {$file_size} + {$last_updated_time} + {$fileperms} + +EOF; + $id++; } - } } + } $container .= ""; @@ -473,21 +373,19 @@ if('ok' == 'ok'){
-
- -
+
- +

URL path:
Upload a file in current folder: -     +    - Replace existing file     + Replace existing file   
@@ -503,10 +401,10 @@ if('ok' == 'ok'){ [ view VIEW/EDIT ]     [ delete DELETE ]
File: {$current_folder}{$_GET['f']}
@@ -515,7 +413,8 @@ if('ok' == 'ok'){ -"; +EOD; + } ?> @@ -523,72 +422,75 @@ if('ok' == 'ok'){ Created by TomSchaefer -// - - "; +if ($alert_info) { + echo << + // + +EOD; } -if($redirect){ - echo " - - "; + +if ($redirect) { + echo << + // + +EOD; } ?> + + - - - - -Login - -



- - - + + + + + Login + + + + + + Date: Wed, 12 Aug 2015 15:12:15 +0200 Subject: index.php - valid XHTML --- config/filemgr/index.php | 49 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/config/filemgr/index.php b/config/filemgr/index.php index b511069d..156ade3d 100644 --- a/config/filemgr/index.php +++ b/config/filemgr/index.php @@ -1,11 +1,44 @@ - - - - + + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +?> + + + + + Redirect + + + + -- cgit v1.2.3 From 98bcc4f2a0f9864ea3d80955eb3fe003b0e1b677 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 15:33:54 +0200 Subject: config.php - code style fixes --- config/filemgr/rbfminc/config.php | 100 ++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/config/filemgr/rbfminc/config.php b/config/filemgr/rbfminc/config.php index 405514f8..776abf58 100644 --- a/config/filemgr/rbfminc/config.php +++ b/config/filemgr/rbfminc/config.php @@ -1,29 +1,56 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: -$initial_folder = "/"; //initial folder -$only_below = 0; // 0=you can brows all server; 1=you can brows only the $initial_folder and below + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. -//Login info {Please change the initial username and password} -$username = 'admin'; -$password = 'admin'; + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +// Initial folder +$initial_folder = "/"; +// 0 = you can browse all files on the server; +// 1= you can browse only the $initial_folder and below +$only_below = 0; +// Login info {Please change the initial username and password} +$username = 'admin'; +$password = 'admin'; -/***********************************/ -// Protect against GLOBALS tricks -if (isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_GET['GLOBALS']) || isset($_COOKIE['GLOBALS'])){ +/* ==================================== */ +/* BEGIN Protect against GLOBALS tricks */ +if (isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_GET['GLOBALS']) || isset($_COOKIE['GLOBALS'])) { die("Hacking attempt"); } -if (isset($_SESSION) && !is_array($_SESSION)){ +if (isset($_SESSION) && !is_array($_SESSION)) { die("Hacking attempt"); } -if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on'){ +if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') { $not_unset = array('_GET', '_POST', '_COOKIE', 'HTTP_SERVER_VARS', '_SESSION', 'HTTP_ENV_VARS', '_FILES'); - if (!isset($_SESSION) || !is_array($_SESSION)){ + if (!isset($_SESSION) || !is_array($_SESSION)) { $_SESSION = array(); } $input = array_merge($_GET, $_POST, $_COOKIE, $HTTP_SERVER_VARS, $_SESSION, $HTTP_ENV_VARS, $_FILES); @@ -31,8 +58,8 @@ if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals unset($input['input']); unset($input['not_unset']); - while (list($var,) = @each($input)){ - if (in_array($var, $not_unset)){ + while (list($var,) = @each($input)) { + if (in_array($var, $not_unset)) { die('Hacking attempt!'); } unset($$var); @@ -41,55 +68,56 @@ if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals unset($input); } -if( !get_magic_quotes_gpc() ){ - if( is_array($_GET) ){ - while( list($k, $v) = each($_GET) ){ - if( is_array($_GET[$k]) ) - { - while( list($k2, $v2) = each($_GET[$k]) ){ +if (!get_magic_quotes_gpc()) { + if (is_array($_GET)) { + while (list($k, $v) = each($_GET)) { + if (is_array($_GET[$k])) { + while (list($k2, $v2) = each($_GET[$k])) { $_GET[$k][$k2] = addslashes($v2); } @reset($_GET[$k]); - }else{ + } else { $_GET[$k] = addslashes($v); } } @reset($_GET); } - if( is_array($_POST) ){ - while( list($k, $v) = each($_POST) ){ - if( is_array($_POST[$k]) ) - { - while( list($k2, $v2) = each($_POST[$k]) ){ + if (is_array($_POST)) { + while (list($k, $v) = each($_POST)) { + if (is_array($_POST[$k])) { + while (list($k2, $v2) = each($_POST[$k])) { $_POST[$k][$k2] = addslashes($v2); } @reset($_POST[$k]); - }else{ + } else { $_POST[$k] = addslashes($v); } } @reset($_POST); } - if( is_array($_COOKIE) ){ - while( list($k, $v) = each($_COOKIE) ){ - if( is_array($_COOKIE[$k]) ){ - while( list($k2, $v2) = each($_COOKIE[$k]) ){ + if (is_array($_COOKIE)) { + while (list($k, $v) = each($_COOKIE)) { + if (is_array($_COOKIE[$k])) { + while (list($k2, $v2) = each($_COOKIE[$k])) { $_COOKIE[$k][$k2] = addslashes($v2); } @reset($_COOKIE[$k]); - }else{ + } else { $_COOKIE[$k] = addslashes($v); } } @reset($_COOKIE); } } -//END Protect against GLOBALS tricks -/***********************************/ -//if($username == 'admin' and $password == 'admin'){ - //$security_issues = "
Security issue: Please change your username or password
"; -//} +/* END Protect against GLOBALS tricks */ +/* ==================================== */ + +/* +if ($username == 'admin' and $password == 'admin') { + $security_issues = "
Security issue: Please change your username or password
"; +} +*/ $security_issues = "
"; ?> -- cgit v1.2.3 From 81b0f0d2b3b72dc8f092bd83538f353bb1a266ea Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 15:43:22 +0200 Subject: download.php - code style fixes --- config/filemgr/rbfminc/download.php | 76 +++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/config/filemgr/rbfminc/download.php b/config/filemgr/rbfminc/download.php index 172ec896..88ff1788 100644 --- a/config/filemgr/rbfminc/download.php +++ b/config/filemgr/rbfminc/download.php @@ -1,29 +1,54 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ include_once("auth.inc"); -include "functions.php"; -//Set the cache policy +include("functions.php"); + +// Set the cache policy ob_end_clean(); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); -header("Pragma: no-cache"); -//Gets the parameters +header("Pragma: no-cache"); + +// Gets the parameters $_GET['file_name'] = urldecode($_GET['file_name']); $_GET['p'] = urldecode($_GET['p']); -//Check Authentication + +// Check Authentication $candownload = false; -if (function_exists("session_auth")) - {//pfSense 2.X - $candownload = session_auth();} -else - {//pfSense 1.2.3 - $candownload = htpasswd_backed_basic_auth();} -if ($candownload) -{ - if($_GET['file_name'] and $_GET['p']){ +$candownload = session_auth(); +if ($candownload) { + if (($_GET['file_name']) && ($_GET['p'])) { $filepath = $_GET['p'].$_GET['file_name']; - if(file_exists($filepath)){ - $type = wp_check_filetype($_GET['file_name']); + if (file_exists($filepath)) { + $type = wp_check_filetype($_GET['file_name']); header('Content-type: ' . $type[$_GET['file_name']]); header('Content-Disposition: attachment; filename="'.$_GET['file_name'].'"'); header('Content-Length: ' . filesize($filepath)); @@ -31,19 +56,14 @@ if ($candownload) flush(); readfile($filepath); exit; + } else { + echo "File not found"; } - else - { - echo("File not found"); - } - } - else - { - echo("File Unknown"); + } else { + echo "File Unknown"; } +} else { + echo "Session Expired"; } -else -{ - echo("Session Expired"); -} + ?> -- cgit v1.2.3 From 61d5ab638e42232bf4bc22a2e2074f152f6a47d7 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 16:04:20 +0200 Subject: functions.php - code style fixes --- config/filemgr/rbfminc/functions.php | 174 +++++++++++++++++++++-------------- 1 file changed, 103 insertions(+), 71 deletions(-) diff --git a/config/filemgr/rbfminc/functions.php b/config/filemgr/rbfminc/functions.php index 8dffd5e4..bab912a7 100644 --- a/config/filemgr/rbfminc/functions.php +++ b/config/filemgr/rbfminc/functions.php @@ -1,118 +1,149 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +function RecursiveFolderDelete($folderPath) { + if (is_dir($folderPath )) { + foreach (scandir($folderPath) as $value) { + if ($value != "." && $value != "..") { $value = $folderPath . "/" . $value; - if ( is_dir ( $value ) ) - { - RecursiveFolderDelete ( $value ); - } - elseif ( is_file ( $value ) ) - { - @unlink ( $value ); + if (is_dir($value)) { + RecursiveFolderDelete($value); + } elseif (is_file($value)) { + @unlink($value); } } } - if(!@rmdir ( $folderPath )){ + if (!@rmdir($folderPath)) { return FALSE; - }else{ + } else { return TRUE; } - } - else - { + } else { return FALSE; } } - function GetFilePerms($file) { - $perms = fileperms($file); - if (($perms & 0xC000) == 0xC000) {$info = 's'; } // Socket - elseif (($perms & 0xA000) == 0xA000) {$info = 'l'; } // Symbolic Link - elseif (($perms & 0x8000) == 0x8000) {$info = '-'; } // Regular - elseif (($perms & 0x6000) == 0x6000) {$info = 'b'; } // Block special - elseif (($perms & 0x4000) == 0x4000) {$info = 'd'; } // Directory - elseif (($perms & 0x2000) == 0x2000) {$info = 'c'; } // Character special - elseif (($perms & 0x1000) == 0x1000) {$info = 'p'; } // FIFO pipe - else {$info = '?';} // Unknown - // 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' : '-')); - - $info = "[".substr(sprintf('%o', fileperms($file)), -4)."] ".$info; - - return $info; -} + $perms = fileperms($file); + + if (($perms & 0xC000) == 0xC000) { + // Socket + $info = 's'; + } elseif (($perms & 0xA000) == 0xA000) { + // Symbolic Link + $info = 'l'; + } elseif (($perms & 0x8000) == 0x8000) { + // Regular + $info = '-'; + } elseif (($perms & 0x6000) == 0x6000) { + // Block special + $info = 'b'; + } elseif (($perms & 0x4000) == 0x4000) { + // Directory + $info = 'd'; + } elseif (($perms & 0x2000) == 0x2000) { + // Character special + $info = 'c'; + } elseif (($perms & 0x1000) == 0x1000) { + // FIFO pipe + $info = 'p'; + } else { + // Unknown + $info = '?'; + } + // 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' : '-')); + + $info = "[" . substr(sprintf('%o', fileperms($file)), -4) . "] " . $info; + return $info; +} function merge_filters($tag) { global $wp_filter, $merged_filters; - if ( isset($wp_filter['all']) && is_array($wp_filter['all']) ) + if (isset($wp_filter['all']) && is_array($wp_filter['all'])) { $wp_filter[$tag] = array_merge($wp_filter['all'], (array) $wp_filter[$tag]); + } - if ( isset($wp_filter[$tag]) ){ + if (isset($wp_filter[$tag])) { reset($wp_filter[$tag]); uksort($wp_filter[$tag], "strnatcasecmp"); } - $merged_filters[ $tag ] = true; + $merged_filters[$tag] = true; } - function apply_filters($tag, $string) { global $wp_filter, $merged_filters; - if ( !isset( $merged_filters[ $tag ] ) ) + if (!isset($merged_filters[$tag])) { merge_filters($tag); + } - if ( !isset($wp_filter[$tag]) ) + if (!isset($wp_filter[$tag])) { return $string; + } - reset( $wp_filter[ $tag ] ); + reset($wp_filter[$tag]); $args = func_get_args(); - do{ - foreach( (array) current($wp_filter[$tag]) as $the_ ) - if ( !is_null($the_['function']) ){ + do { + foreach ((array)current($wp_filter[$tag]) as $the_) { + if (!is_null($the_['function'])) { $args[1] = $string; $string = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); } + } - } while ( next($wp_filter[$tag]) !== false ); + } while (next($wp_filter[$tag]) !== false); return $string; } - function wp_check_filetype($filename, $mimes = null) { // Accepted MIME types are set here as PCRE unless provided. - $mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array ( + $mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', @@ -165,7 +196,7 @@ function wp_check_filetype($filename, $mimes = null) { foreach ($mimes as $ext_preg => $mime_match) { $ext_preg = '!\.(' . $ext_preg . ')$!i'; - if ( preg_match($ext_preg, $filename, $ext_matches) ) { + if (preg_match($ext_preg, $filename, $ext_matches)) { $type = $mime_match; $ext = $ext_matches[1]; break; @@ -177,13 +208,14 @@ function wp_check_filetype($filename, $mimes = null) { -function roundsize($size){ +function roundsize($size) { $i=0; $iec = array("B", "Kb", "Mb", "Gb", "Tb"); while (($size/1024)>1) { - $size=$size/1024; - $i++;} - return(round($size,1)." ".$iec[$i]); + $size=$size/1024; + $i++; + } + return(round($size, 1) . " " . $iec[$i]); } ?> -- cgit v1.2.3 From f485cfb1c4ffc973f1c09074c3fb025e8f522285 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 16:12:34 +0200 Subject: rename.php - code style fixes --- config/filemgr/rbfminc/rename.php | 51 ++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/config/filemgr/rbfminc/rename.php b/config/filemgr/rbfminc/rename.php index 5a2096ca..27553f18 100644 --- a/config/filemgr/rbfminc/rename.php +++ b/config/filemgr/rbfminc/rename.php @@ -1,12 +1,39 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. -if($user_login == 'ok'){ + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - include "functions.php"; + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +include("config.php"); +include("session.php"); + +if ($user_login == 'ok') { + include("functions.php"); ?> + Rename @@ -15,19 +42,18 @@ if($user_login == 'ok'){ + -- cgit v1.2.3 From cad6ed23f5dfb5145beaf4f224121c731fb1097c Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 16:17:05 +0200 Subject: session.php - code style fixes --- config/filemgr/rbfminc/session.php | 48 +++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/config/filemgr/rbfminc/session.php b/config/filemgr/rbfminc/session.php index 7cfc133d..b616643f 100644 --- a/config/filemgr/rbfminc/session.php +++ b/config/filemgr/rbfminc/session.php @@ -1,17 +1,43 @@ + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ session_name("file_manager_session"); +// Create session session_start(); - -/*************************************************************************************************/ -//create session -if($_POST['login'] == 'login' and $_POST['username'] and $_POST['password']){ +if (($_POST['login'] == 'login') && ($_POST['username']) && ($_POST['password'])) { $_SESSION = array(); - $_SESSION['username']=$_POST['username']; - $_SESSION['password']=$_POST['password']; + $_SESSION['username'] = $_POST['username']; + $_SESSION['password'] = $_POST['password']; } -if($_GET['logout'] == "logout"){ +if ($_GET['logout'] == "logout") { setcookie('url_field', '', time()-3600); setcookie('current_folder', '', time()-3600); $_SESSION = array(); @@ -21,11 +47,11 @@ if($_GET['logout'] == "logout"){ } -if($_SESSION['username'] and $_SESSION['password']){ - if($_SESSION['username'] == $username and $_SESSION['password'] == $password){ +if (($_SESSION['username']) && ($_SESSION['password'])) { + if (($_SESSION['username'] == $username) && ($_SESSION['password'] == $password)) { $user_login = 'ok'; - }else{ - $error_message = "Incorect username or password!"; + } else { + $error_message = "Incorrect username or password!"; } } -- cgit v1.2.3