View Single Post
Old 17th August 2012, 15:58
Croydon Croydon is offline
ISPConfig Developer
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Post Getting ajaxplorer to work with multiserver ISPC (no real integration)

I tried (and managed) to get ajaxplorer working with a multiserver setup of ISPConfig 3.
It is not fully integrated but uses the remoting api to get the right server for a ftp user.

This does only work with latest svn version of ISPConfig as I added a small function to the remoting.

Step 1:
Install Ajaxplorer as usual
Be sure you have configured everything you want with the admin user before you proceed. Admin login is currently no longer working after completing the following steps, so you have to revert them temporarily if you need to login as admin again.

Step 2:
Create a remote user in ispconfig. This user needs the "Server functions" and "FTP-User functions" rights, nothing else.

Step 3:
Change the conf/bootstrap_plugins.php section
PHP Code:
        "AUTH_DRIVER" => array(
"NAME"          => "ftp",
"OPTIONS"       => array(
"LOGIN_REDIRECT"                => false,
"REPOSITORY_ID"             => "ispc_ftp",
"ADMIN_USER"                => "admin",
"FTP_LOGIN_SCREEN"      => false,
Step 4:
Add this as the first(!) repository in conf/bootstrap_repositories.php
PHP Code:
$REPOSITORIES["ispc_ftp"] = array(
"DISPLAY"       => "Web FTP",
"DRIVER"        => "ftp",
"FTP_HOST"       => "localhost",
"FTP_PORT"      => "21",
"FTP_SECURE"   => false,
"DEFAULT_RIGHTS"    => "rw",
"FIX_PERMISSIONS" => "detect_remote_user_id",
"TMP_UPLOAD" => "/tmp"
Do not change the FTP_HOST, it is determined automatically later.
You can change the DISPLAY setting if you like.
If you want SSL connections to the ftp server you can set FTP_SECURE to true.

I deleted all other repositories from the file, except ajaxp_shared and ajxp_conf.

Step 5:
in file plugins/auth.ftp/class.ftpAuthDriver.php add a new method to the class:
PHP Code:

class ftpAuthDriver extends AbstractAuthDriver {
// stripped content

function get_ispc_host($username) {
// connect to ispc via remoting and read ftp user
$server '';             
$soap_uri '';
$soap_location $soap_uri 'index.php';

$client = new SoapClient(null, array('location' => $soap_location'uri'      => $soap_uri));
       try {
$session_id $client->login($login,$pass)) {
$check $client->sites_ftp_user_server_get($session_id$username);
$check) {
$server = isset($check['ip_address']) ? $check['ip_address'] : $check['hostname'];

      } catch (
SoapFault $e) {

      return (
$server != '' $server 'localhost');

// stripped content

Step 6:
Search for function checkPassword($login, $pass, $seed)
In this function add after
PHP Code:
               $repoId $this->options["REPOSITORY_ID"]; 
PHP Code:
                $repository ConfService::getRepositoryById($repoId);
$_SESSION['ISPC_HOST'] = $this->get_ispc_host($login);
Step 7:
In file plugins/access.ftp/class.ftpAccessDriver.php search for function initRepository() - should be around line 55.
add after
PHP Code:
                $this->urlBase $wrapperData["protocol"]."://".$this->repository->getId(); 
PHP Code:
                if(isset($_SESSION['ISPC_HOST'])) {
and around line 221 replace
PHP Code:
return is_writable($path); 
PHP Code:
return true
This leads to ajaxexplorer showing the raw ftp errors like "ftp_fput() permission denied" instead of "Cannot write file ... " but makes it working at least as ajaxplorer compares the file's owner uid with the login name. This differs due to virtual users in ispconfig pureftp.

This should be everything that is needed.

What is done:
On login (checkPassword method) a function is called that calls the ISPConfig remoting api and gets some server infos for the given ftp user.
It then returns the server-ip (or hostname) and overwrites the Ajaxplorer repository config temporarily.

No warranty for this howto, as always Use at your own risk.
Marius Cramer

pixcept KG

Last edited by Croydon; 18th August 2012 at 11:22.
Reply With Quote
Sponsored Links