This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Filemanager Module Working Sentora 2.0.1, 2.0.2
#1
[Not Solved] Filemanager Module Working Sentora 2.0.1, 2.0.2
The First Download Filemanager : elFinder

================================================
Note : Only por Admin Users, not for give access customers, etc
================================================


Quote:https://studio-42.github.io/elFinder/#elf_l1_Lw

Upload inside ( Login as Root ) :

From SSH :

Quote:mkdir -p /etc/sentora/panel/etc/apps/Filemanager

Quote:cd /etc/sentora/panel/etc/apps/Filemanager

Quote:wget https://github.com/Studio-42/elFinder/ar...2.1.65.zip


Quote:unzip elFinder-2.1.65-2.zip


Finally URL :

Quote:cd /etc/sentora/panel/etc/apps/Filemanager/elFinder-2.1.65


Access from Sentora :

Quote:https://cp.yourdomain.com/etc/apps/Filem...der-2.1.65


Configurate is inside folder Filemanager elFinder, config inside folder called php, change default name to connector.minimal.php-dist to connector.minimal.php, and edit your paths


Inside folder with Filemanager Script you can create simple php file for access with the name that you want ( for example index,php or other ) and this content : ( https://cp.yourdomain.com/etc/apps/Filem.../index.php)



Quote:<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<title>elFinder 2.1.x source version with PHP connector</title>

<!-- Require JS (REQUIRED) -->
<!-- Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things -->
<script data-main="./main.default.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script>
define('elFinderConfig', {
// elFinder options (REQUIRED)
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wi...on-options
defaultOpts : {
url : 'php/connector.minimal.php', // or connector.maximal.php : connector URL (REQUIRED)
commandsOptions : {
edit : {
extraOptions : {
// set API key to enable Creative Cloud image editor
// see https://console.adobe.io/
creativeCloudApiKey : '',
// browsing manager URL for CKEditor, TinyMCE
// uses self location with the empty value
managerUrl : ''
}
},
quicklook : {
// to enable CAD-Files and 3D-Models preview with sharecad.org
sharecadMimes : ['image/vnd.dwg', 'image/vnd.dxf', 'model/vnd.dwf', 'application/vnd.hp-hpgl', 'application/plt', 'application/step', 'model/iges', 'application/vnd.ms-pki.stl', 'application/sat', 'image/cgm', 'application/x-msmetafile'],
// to enable preview with Google Docs Viewer
googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/postscript', 'application/rtf'],
// to enable preview with Microsoft Office Online Viewer
// these MIME types override "googleDocsMimes"
officeOnlineMimes : ['application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation']
}
},
// bootCalback calls at before elFinder boot up
bootCallback : function(fm, extraObj) {
/* any bind functions etc. */
fm.bind('init', function() {
// any your code
});
// for example set document.title dynamically.
var title = document.title;
fm.bind('open', function() {
var path = '',
cwd  = fm.cwd();
if (cwd) {
path = fm.path(cwd.hash) || null;
}
document.title = path? path + ':' + title : title;
}).bind('destroy', function() {
document.title = title;
});
}
},
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {}
}
});
</script>
</head>
<body>

<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>

</body>
</html>




For access from panel create simple module for install from Sentora, you can download from here in attachments


When Install module you need go to modules inside Sentora and put your URL to the script, inside controller.ext.php

The path is :

cd /etc/sentora/panel/modules/fileManager_Me/code/

/etc/sentora/panel/modules/fileManager_Me/code/controller.ext.php


Quote:class module_controller extends ctrl_module
{

static function getSentoraFm()
{
//////////////////////
/// Change the URL ///
/////////////////////
$url="https://cp.yourdomain.com/etc/apps/Filemanager/elFinder-2.1.65/index.php";

return $url;

}

}


And all ready for access you Filemanager without ptoblmes, important put some security access for Filemanager as .htpassword, etc, or simple code i php for login


Regards


Attached Files
.zpp   Sentora_elFinder.zpp (Size: 3.72 KB / Downloads: 1)
Reply
Thanks given by: TGates
#2
[Not Solved] RE: Filemanager Module Working Sentora 2.0.1, 2.0.2
This could be updated to install like a normal module.
It is a bit confusing for a novice user.

Also, the code should be deployed to /etc/apps/elfinder/ or /etc/apps/filemanager/ to keep the access URL easy for clients to remember Wink

Parts of the code from my Sentastico module would be very helpful in making the module:
-Getting a file (elfinder.zip) and deploying it to the proper folder.
Parts of the code from my SenAds module would also be helpful:
-Writing/creating the config file automatically.

Depending on the elFinder.zip size, I'd include it in the module.zpp package. Then use the install.run hook to unzip and move the files to the /apps/Filemanager/ location and create the config file.

I haven't used elFinder in years, does it prompt the client to enter username and password?
How secure is it? How active is it's creator?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#3
[Not Solved] RE: Filemanager Module Working Sentora 2.0.1, 2.0.2
I implemented this solution because the other file manager plugin wasn't working and was causing errors. I created this for a quick fix, and it works perfectly and securely. Users can specify different paths, etc. It's important to include a login for accessing the script.

I have seen some posts recently regarding this issue, and I also needed a solution for editing files. I think the best approach is to place the script in the same folder as the applications (webmail, etc.). This solution is intended for admin users, not for regular members.

Regards.
Reply
Thanks given by:
#4
[Not Solved] RE: Filemanager Module Working Sentora 2.0.1, 2.0.2
(06-05-2024, 11:47 AM)franmm25 Wrote: I implemented this solution because the other file manager plugin wasn't working and was causing errors. I created this for a quick fix, and it works perfectly and securely. Users can specify different paths, etc. It's important to include a login for accessing the script.

I have seen some posts recently regarding this issue, and I also needed a solution for editing files. I think the best approach is to place the script in the same folder as the applications (webmail, etc.). This solution is intended for admin users, not for regular members.

Regards.

Yes, the apps folder is a good location. 
If for zadmin only, you may want to update your original post to explain that.
'this is for zadmin only' and explain why. Other's may install it and try to use it as an actual client used module.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#5
[Not Solved] RE: Filemanager Module Working Sentora 2.0.1, 2.0.2
Yes, of course, the idea is to provide a file and editing system for a panel admin, with single access, not for clients, the client solution would have to be intended for their domains, here if an additional module system is not created, All the documents could be seen, unless, as I say, a system was created that discriminated by the client's ID, which could be done, and not modularly integrated with Sentora but reading the domains of each client, to only allow access to those and not to others, but I will put what you told me in the post, to see if I also look at possible integrations with other Filemanagers, greetings
Reply
Thanks given by: TGates


Forum Jump:


Users browsing this thread: 1 Guest(s)