diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 9b00969..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,9 +0,0 @@
-dist/ifm.php -diff
-dist/ifm.min.php -diff
-dist/* -diff
-src/includes/ace.js -diff
-
-src export-ignore
-compiler.php export-ignore
-.gitignore export-ignore
-.gitattributes export-ignore
diff --git a/compiler.php b/compiler.php
index 398c4e8..c93547e 100755
--- a/compiler.php
+++ b/compiler.php
@@ -10,7 +10,7 @@ chdir( realpath( dirname( __FILE__ ) ) );
// output files and common attrs
define( "IFM_CDN", false );
-define( "IFM_VERSION", "v2.6.1" );
+define( "IFM_VERSION", "v2.6.2" );
define( "IFM_RELEASE_DIR", "dist/");
define( "IFM_STANDALONE", "ifm.php" );
define( "IFM_STANDALONE_GZ", "ifm.min.php" );
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index f269c7d..b5b0756 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -101,7 +101,7 @@
"toggle_nav": "Переключить вид",
"upload": "Загрузить",
"upload_drop": "Перетащите файлы для загрузки",
- "upload_file": "Загрузить файла",
+ "upload_file": "Загрузить файл",
"upload_remote": "Удаленная загрузка",
"upload_remote_url": "Удаленная загрузка по URL",
"username": "Имя пользователя",
diff --git a/src/ifm.js b/src/ifm.js
index d284552..0064d9f 100644
--- a/src/ifm.js
+++ b/src/ifm.js
@@ -1394,9 +1394,11 @@ function IFM(params) {
if( newFooter.style.maxHeight == '80%' ) {
newFooter.style.maxHeight = '6em';
newFooter.style.overflow = 'hidden';
+ newFooter.hidden = true;
} else {
newFooter.style.maxHeight = '80%';
newFooter.style.overflow = 'scroll';
+ newFooter.hidden = false;
}
}
});
diff --git a/src/ifmarchive.php b/src/ifmarchive.php
index b8e0871..2140606 100644
--- a/src/ifmarchive.php
+++ b/src/ifmarchive.php
@@ -32,15 +32,14 @@ class IFMArchive {
if ($f != '.' && $f != '..') {
$filePath = $folder . '/' . $f;
if (file_exists($filePath) && is_readable($filePath))
- if (is_file($filePath)) {
+ if (is_file($filePath))
if (!is_callable($exclude_callback) || $exclude_callback($f))
$archive->addFile( $filePath, substr( $filePath, $offset ) );
- } elseif (is_dir($filePath)) {
+ elseif (is_dir($filePath))
if (is_callable($exclude_callback))
self::addFolder($archive, $filePath, $offset, $exclude_callback);
else
self::addFolder($archive, $filePath, $offset);
- }
}
}
closedir($handle);
@@ -56,7 +55,7 @@ class IFMArchive {
if (!is_array($src))
$src = array($src);
- //file_put_contents("debug.ifm.log", var_export(is_callable($exclude_callback), true)."\n");
+ file_put_contents("debug.ifm.log", var_export(is_callable($exclude_callback), true)."\n");
foreach ($src as $s)
if (is_dir($s))
diff --git a/src/main.php b/src/main.php
index 42f11a9..c2e7da7 100644
--- a/src/main.php
+++ b/src/main.php
@@ -62,7 +62,7 @@ class IFM {
private $config = array();
private $templates = array();
private $i18n = array();
- public $mode = "";
+ public $mode = "standalone";
public function __construct( $config=array() ) {
@@ -218,7 +218,7 @@ IFM_ASSETS
IFM - improved file manager
- ';
+ ';
$this->getCSS();
print '';
}
@@ -994,13 +994,16 @@ IFM_ASSETS
if( ! isset( $_SESSION['ifmauth'] ) || $_SESSION['ifmauth'] !== true ) {
$login_failed = false;
+ $login_message = "";
if( isset( $_POST["inputLogin"] ) && isset( $_POST["inputPassword"] ) ) {
- if( $this->checkCredentials( $_POST["inputLogin"], $_POST["inputPassword"] ) ) {
+ $state = $this->checkCredentials( $_POST["inputLogin"], $_POST["inputPassword"] );
+ if($state['status']) {
$_SESSION['ifmauth'] = true;
}
else {
$_SESSION['ifmauth'] = false;
$login_failed = true;
+ $login_message = $state['message'];
}
}
@@ -1013,7 +1016,7 @@ IFM_ASSETS
else
$this->jsonResponse( array( "status"=>"ERROR", "message"=>"not authenticated" ) );
} else {
- $this->loginForm($login_failed);
+ $this->loginForm($login_failed, $login_message);
}
return false;
}
@@ -1023,6 +1026,7 @@ IFM_ASSETS
}
private function checkCredentials( $user, $pass ) {
+ $authenticated = array("status" => false, "message" => "");
list( $src, $srcopt ) = explode( ";", $this->config['auth_source'], 2 );
switch( $src ) {
case "inline":
@@ -1035,12 +1039,11 @@ IFM_ASSETS
$htpasswd = new Htpasswd( $srcopt );
return $htpasswd->verify( $user, $pass );
} else {
- trigger_error( "IFM: Fatal: Credential file does not exist or is not readable" );
- return false;
+ // trigger_error( "IFM: Fatal: Credential file does not exist or is not readable" );
+ return $authenticated;
}
break;
case "ldap":
- $authenticated = false;
$ldapopts = explode( ";", $srcopt );
if( count( $ldapopts ) === 3 ) {
list( $ldap_server, $rootdn, $ufilter ) = explode( ";", $srcopt );
@@ -1050,8 +1053,8 @@ IFM_ASSETS
}
$u = "uid=" . $user . "," . $rootdn;
if( ! $ds = ldap_connect( $ldap_server ) ) {
- trigger_error( "Could not reach the ldap server.", E_USER_ERROR );
- return false;
+ $authenticated['status'] = false;
+ $authenticated['message'] = "Could not reach the ldap server.";
}
ldap_set_option( $ds, LDAP_OPT_PROTOCOL_VERSION, 3 );
if( $ds ) {
@@ -1059,31 +1062,32 @@ IFM_ASSETS
if( $ldbind ) {
if( $ufilter ) {
if( ldap_count_entries( $ds, ldap_search( $ds, $rootdn, $ufilter ) ) > 0 ){
- $authenticated = true;
+ $authenticated['status'] = true;
} else {
- trigger_error( "User not allowed.", E_USER_ERROR );
- $authenticated = false;
+ $authenticated['status'] = false;
+ $authenticated['message'] = "User not allowed.";
}
} else {
- $authenticated = true;
+ $authenticated['status'] = true;
}
} else {
- trigger_error( ldap_error( $ds ), E_USER_ERROR );
- $authenticated = false;
+ $authenticated['status'] = false;
+ $authenticated['message'] = ldap_error( $ds );
}
ldap_unbind( $ds );
- } else
- $authenticated = false;
+ } else {
+ $authenticated['status'] = false;
+ }
return $authenticated;
break;
}
- return false;
+ return $authenticated;
}
- private function loginForm($loginFailed=false) {
+ private function loginForm($loginFailed=false, $loginMessage) {
$err = "";
if( $loginFailed )
- $err = ''.$this->l['login_failed'].'
';
+ $err = ''.$loginMessage.'
';
$this->getHTMLHeader();
$html = str_replace( "{{error}}", $err, $this->templates['login'] );
$html = str_replace( "{{i18n.username}}", $this->l['username'], $html );
@@ -1177,7 +1181,7 @@ IFM_ASSETS
private function getTypeIcon( $type ) {
$type = strtolower($type);
switch( $type ) {
- case "aac": case "aiff": case "mid": case "mp3": case "wav": return 'icon icon-file-audio'; break;
+ case "aac": case "aiff": case "mid": case "mp3": case "wav": return 'icon icon-file-audio'; break;
case "ai": case "bmp": case "eps": case "tiff": case "gif": case "jpg": case "jpeg": case "png": case "psd": case "svg": return 'icon icon-file-image'; break;
case "avi": case "flv": case "mp4": case "mpg": case "mkv": case "mpeg": case "webm": case "wmv": case "mov": return 'icon icon-file-video'; break;
case "c": case "cpp": case "css": case "dat": case "h": case "html": case "java": case "js": case "php": case "py": case "sql": case "xml": case "yml": case "json": return 'icon icon-file-code'; break;
@@ -1186,7 +1190,7 @@ IFM_ASSETS
case "ods": case "xls": case "xlsx": return 'icon icon-file-excel'; break;
case "odp": case "ppt": case "pptx": return 'icon icon-file-powerpoint'; break;
case "pdf": return 'icon icon-file-pdf'; break;
- case "tgz": case "zip": case "tar": case "tgz": case "tar.gz": case "tar.xz": case "tar.bz2": case "7z": case "rar": return 'icon icon-file-archive';
+ case "tgz": case "zip": case "tar": case "tgz": case "tar.gz": case "tar.xz": case "tar.bz2": case "7z": case "rar": return 'icon icon-file-archive';
default: return 'icon icon-doc';
}
}
diff --git a/src/style.css b/src/style.css
index 85eb32a..b65ba31 100644
--- a/src/style.css
+++ b/src/style.css
@@ -1,63 +1,63 @@
body {
- padding-top: 70px;
- overflow-y: scroll !important;
+ padding-top: 70px;
+ overflow-y: scroll !important;
}
a { cursor: pointer !important; }
a.ifmitem:focus { outline: 0 }
img.imgpreview {
- max-width: 100%;
- background-repeat: repeat repeat;
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAABI2lDQ1BJQ0MgcHJvZmlsZQAAKJGdkLFKw1AUhr9UsaXYSXEQhwyuBRHM5FIVgqAQYwWrU5qkWExiSFKKb+Cb6MN0EASfwCdQcPa/0cHBLF44/B+Hc/7/3gstOwnTcnkH0qwqXH8wuhxd2e032nTosksvCMt84HknNJ7PVyyjL33j1Tz351mJ4jKULlRZmBcVWPtiZ17lhlWs3w79Q/GD2I7SLBI/ibejNDJsdv00mYU/nuY2q3F2cW76qi1cjjnFw2bMjCkJFX1pps4RDntSl4KAe0pCaUKs3lwzFTeiUk4uB6KhSLdpyNus8zyljOUxlZdJuCOVp8nD/O/32sdZvWltLPKgCOrWkqo1mcD7I/RGsPYM3euGrM7vtzXMOPXMP9/4BdaxUFxWskm6AAAAAmJLR0QAy6Y7OAoAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAiSURBVAjXY/zPwMDAcIaBgYGBiQEOCDJZzjAwMDCYkKoNAPmXAuEuYku0AAAAAElFTkSuQmCC");
+ max-width: 100%;
+ background-repeat: repeat repeat;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAABI2lDQ1BJQ0MgcHJvZmlsZQAAKJGdkLFKw1AUhr9UsaXYSXEQhwyuBRHM5FIVgqAQYwWrU5qkWExiSFKKb+Cb6MN0EASfwCdQcPa/0cHBLF44/B+Hc/7/3gstOwnTcnkH0qwqXH8wuhxd2e032nTosksvCMt84HknNJ7PVyyjL33j1Tz351mJ4jKULlRZmBcVWPtiZ17lhlWs3w79Q/GD2I7SLBI/ibejNDJsdv00mYU/nuY2q3F2cW76qi1cjjnFw2bMjCkJFX1pps4RDntSl4KAe0pCaUKs3lwzFTeiUk4uB6KhSLdpyNus8zyljOUxlZdJuCOVp8nD/O/32sdZvWltLPKgCOrWkqo1mcD7I/RGsPYM3euGrM7vtzXMOPXMP9/4BdaxUFxWskm6AAAAAmJLR0QAy6Y7OAoAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAiSURBVAjXY/zPwMDAcIaBgYGBiQEOCDJZzjAwMDCYkKoNAPmXAuEuYku0AAAAAElFTkSuQmCC");
}
div#content { width: 100%; height: 350px; } /* is for the ACE editor */
label {
- display: inline-block;
- margin-bottom: .5rem;
- font-weight: 700;
+ display: inline-block;
+ margin-bottom: .5rem;
+ font-weight: 700;
}
/* Make tables more compact (overwrites bootstrap default of 0.75rem) */
.table td, .table th {
- padding: 0.25rem;
+ padding: 0.25rem;
}
/* narrow navbar */
.navbar {
- padding: 0.3rem;
+ padding: 0.3rem;
}
/*
* Icon size
*/
.icon {
- font-size: 14pt;
+ font-size: 14pt;
}
@media (max-width: 768px) {
- .icon { font-size: 12pt; }
- #filetable tr th.buttons { min-width: 85px !important; }
+ .icon { font-size: 12pt; }
+ #filetable tr th.buttons { min-width: 85px !important; }
}
/*
* Filetable related settings
*/
#filetable th {
- border-top: 0;
+ border-top: 0;
}
#filetable td:nth-child(5), #filetable th:nth-child(5) {
- text-align: center;
+ text-align: center;
}
#filetable td:nth-child(6), #filetable th:nth-child(6) {
- text-align: center;
+ text-align: center;
}
#filetable tr td:last-child {
- text-align: right;
+ text-align: right;
}
#filetable td:last-child a:hover {
- text-decoration: none;
+ text-decoration: none;
}
.td-permissions { width: 1px; }
@@ -80,53 +80,53 @@ div.ifminfo div.panel div.panel-body { padding: 0px !important; text-align: cen
* Footer / Task-Queue settings
*/
footer {
- position: fixed;
- padding-top: 1em;
- border-top: 1px;
- background-color: #EEE;
- bottom: 0;
- width: 100%;
- max-height: 6em;
- overflow: hidden;
+ position: fixed;
+ padding-top: 1em;
+ border-top: 1px;
+ background-color: #EEE;
+ bottom: 0;
+ width: 100%;
+ max-height: 6em;
+ overflow: hidden;
}
#waitqueue .progress {
- position: relative;
- margin-bottom: 0;
+ position: relative;
+ margin-bottom: 0;
}
#waitqueue .progbarlabel {
- position:absolute;
- top: 0;
- left: 10px;
- font-weight: bold;
+ position:absolute;
+ top: 0;
+ left: 10px;
+ font-weight: bold;
}
/*
* File drop overlay
*/
#filedropoverlay {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- text-align: center;
- color: #FFF;
- background-color: lightblue;
- filter: alpha(opacity=70);
- -moz-opacity: 0.7;
- opacity: 0.7;
- z-index: 1000;
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ color: #FFF;
+ background-color: lightblue;
+ filter: alpha(opacity=70);
+ -moz-opacity: 0.7;
+ opacity: 0.7;
+ z-index: 1000;
}
#filedropoverlay h1 {
- border-radius: 5px;
- color: #000;
- position:relative;
- top:50%;
- font-size: 6em;
- pointer-events: none;
+ border-radius: 5px;
+ color: #000;
+ position:relative;
+ top:50%;
+ font-size: 6em;
+ pointer-events: none;
}
@@ -134,8 +134,8 @@ footer {
* Datatables related settings
*/
table.dataTable thead th {
- position: relative;
- background-image: none !important;
+ position: relative;
+ background-image: none !important;
}
/* remove original sort icons */
@@ -144,50 +144,50 @@ table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_asc_disabled:before,
table.dataTable thead .sorting_desc_disabled:before {
- right: 0 !important;
- content: "" !important;
+ right: 0 !important;
+ content: "" !important;
}
/* custom sort icons */
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
- position: absolute;
- top: 6px;
- right: 8px;
- display: block;
- font-family: fontello;
- font-size: 0.8em;
- opacity: 1;
- color: #000;
+ position: absolute;
+ top: 6px;
+ right: 8px;
+ display: block;
+ font-family: fontello;
+ font-size: 0.8em;
+ opacity: 1;
+ color: #000;
}
table.dataTable thead th.sorting:after {
- content: "\F0DC";
- color: #ddd;
+ content: "\F0DC";
+ color: #ddd;
}
table.dataTable thead th.sorting_asc:after {
- content: "\f0de";
+ content: "\f0de";
}
table.dataTable thead th.sorting_desc:after {
- content: "\f0dd";
+ content: "\f0dd";
}
/*
* Modal related settings
*/
#copyMoveTree {
- max-height: 80vh;
- overflow: auto;
+ max-height: 80vh;
+ overflow: auto;
}
@media (min-width: 576px) {
- .modal-dialog {
- max-width: 600px;
- margin: 1.75rem auto;
- }
+ .modal-dialog {
+ max-width: 600px;
+ margin: 1.75rem auto;
+ }
}
@media (min-width: 992px) {
- .modal-lg, .modal-xl {
- max-width: 800px;
- }
+ .modal-lg, .modal-xl {
+ max-width: 800px;
+ }
}
diff --git a/src/templates/app.html b/src/templates/app.html
index 92b39db..c59aa8a 100644
--- a/src/templates/app.html
+++ b/src/templates/app.html
@@ -1,108 +1,108 @@
-
{{i18n.upload_drop}}
+ {{i18n.upload_drop}}
-
-
-
-
- |
- {{i18n.filename}} |
- {{#config.download}}
- |
- {{/config.download}}
- {{#config.showlastmodified}}
- {{i18n.last_modified}} |
- {{/config.showlastmodified}}
- {{#config.showfilesize}}
- {{i18n.size}} |
- {{/config.showfilesize}}
- {{#config.showpermissions}}
- {{i18n.permissions}} |
- {{/config.showpermissions}}
- {{#config.showowner}}
- {{i18n.owner}} |
- {{/config.showowner}}
- {{#config.showgroup}}
- {{i18n.group}} |
- {{/config.showgroup}}
- |
-
-
-
-
-
-
-
+
+
+
+
+ |
+ {{i18n.filename}} |
+ {{#config.download}}
+ |
+ {{/config.download}}
+ {{#config.showlastmodified}}
+ {{i18n.last_modified}} |
+ {{/config.showlastmodified}}
+ {{#config.showfilesize}}
+ {{i18n.size}} |
+ {{/config.showfilesize}}
+ {{#config.showpermissions}}
+ {{i18n.permissions}} |
+ {{/config.showpermissions}}
+ {{#config.showowner}}
+ {{i18n.owner}} |
+ {{/config.showowner}}
+ {{#config.showgroup}}
+ {{i18n.group}} |
+ {{/config.showgroup}}
+ |
+
+
+
+
+
+
+
diff --git a/src/templates/login.html b/src/templates/login.html
index 89c0d32..4a93494 100644
--- a/src/templates/login.html
+++ b/src/templates/login.html
@@ -107,6 +107,7 @@ body {
IFM {{i18n.login}}
+ {{error}}
@@ -115,6 +116,8 @@ body {
+
+
\ No newline at end of file
diff --git a/src/templates/modal.ajaxrequest.html b/src/templates/modal.ajaxrequest.html
index a4707b6..59567c2 100644
--- a/src/templates/modal.ajaxrequest.html
+++ b/src/templates/modal.ajaxrequest.html
@@ -1,16 +1,31 @@
diff --git a/src/templates/modal.copymove.html b/src/templates/modal.copymove.html
index 0faeb4d..8a50312 100644
--- a/src/templates/modal.copymove.html
+++ b/src/templates/modal.copymove.html
@@ -1,13 +1,15 @@
diff --git a/src/templates/modal.createarchive.html b/src/templates/modal.createarchive.html
index 43e1300..20c4d65 100644
--- a/src/templates/modal.createarchive.html
+++ b/src/templates/modal.createarchive.html
@@ -1,12 +1,14 @@
diff --git a/src/templates/modal.createdir.html b/src/templates/modal.createdir.html
index e379b8a..b5e771c 100644
--- a/src/templates/modal.createdir.html
+++ b/src/templates/modal.createdir.html
@@ -1,12 +1,14 @@
diff --git a/src/templates/modal.extractfile.html b/src/templates/modal.extractfile.html
index a357ff8..ec3c0dd 100644
--- a/src/templates/modal.extractfile.html
+++ b/src/templates/modal.extractfile.html
@@ -1,29 +1,37 @@