Page 1 of 1

Custom controlpanel integration

Posted: Thu Oct 13, 2011 8:15 am
by sanderj
Hi.

I'm having a problem with integrating our own controlpanel with installatron.

I'm following this guide here: http://installatron.com/developer/integration

I've verified that the getUser function is called every time with "domain344", "client1234" 2x and "www-data", after following the example and passing domain344 as CURRENT_USER env into initSession().

However, when I go to the website and try to install an application, I get "Malformed field_location:" and "_errors_nodomains" in the install_error_log, and the website says:
"Error
Malformed field_location:
No domains are available for this account. Use the hosting control panel to add a domain before installing an application."

The getUser("domain344") returns:
return array(
"type" => "user",
"parent" => "client1234",
"path_home" => "/var/www/vhosts/bob.com",
"path_remote" => "ftp://".urlencode("user").":".urlencode("password")."@server23.host.com",
"package" => "bronze",
"email" => "user@domain.com",
"vhosts" => array(
"http://bob.com" => "httpdocs",
"http://www.bob.com" => "httpdocs",
)
);

What do I have to do to make this work?

Re: Custom controlpanel integration

Posted: Thu Oct 13, 2011 1:31 pm
by Phil
Hello,

The output for getUser('domain344') looks correct. What does sample output look like for getUser('client1234'). Make sure "vhosts" is not defined for the client.

Thank you,
Phil.

Re: Custom controlpanel integration

Posted: Fri Oct 14, 2011 3:20 am
by sanderj
I have it just as the example:

if ( $u == "www-data" )
{
return array(
"type" => "admin",
"email" => "domain@host.com"
);
}
else if ( $u == "client1234" )
{
return array(
"type" => "user",
"parent" => "www-data",
"sub_users" => array(
"domain344",
"domain360"
)
);
}

Re: Custom controlpanel integration

Posted: Fri Oct 14, 2011 11:25 am
by Phil
Hello,

Try passing "client1234" instead of the domain as "CURRENT_USER" to test if a different result is received.

Also ensure the session cache has been cleared. It's possible it's stuck on an old session.

Code: Select all

rm -f /var/installatron/tmp/sess*


Thanks,
Phil.

Re: Custom controlpanel integration

Posted: Mon Oct 17, 2011 2:49 am
by sanderj
After I cleared the cache, there was same result when trying domain344.
When trying with client1234 I got the following error message:

Error: Unable to `setEffectiveUser'. Contact Installatron Support with details about your control panel and operating system versions, and include the information dumped below. Session dump: array ( 'puid' => 33, 'uid' => 0, 'user' => 'client1234', 'time' => 1318837177, 'client_addr' => 'IP', 'client_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.2; nb-NO; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8', ) Environ dump: array ( 'CURRENT_USER' => 'client1234', 'REMOTE_ADDR' => 'IP', 'QUERY_STRING' => 'CURRENT_USER=client1234', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows; U; Windows NT 5.2; nb-NO; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8', 'APACHE_PID_FILE' => '/var/run/apache2.pid', 'PATH' => '/usr/local/bin:/usr/bin:/bin', 'LANG' => 'C', 'APACHE_RUN_USER' => 'www-data', 'APACHE_RUN_GROUP' => 'www-data', 'REQUEST_METHOD' => 'GET', 'PWD' => '/var/installatron/frontend', 'I_EUID' => '33', 'PHP_SELF' => '/usr/local/installatron/lib/boot.php', 'SCRIPT_NAME' => '/usr/local/installatron/lib/boot.php', 'SCRIPT_FILENAME' => '/usr/local/installatron/lib/boot.php', 'PATH_TRANSLATED' => '/usr/local/installatron/lib/boot.php', 'DOCUMENT_ROOT' => '', 'REQUEST_TIME' => 1318837177, 'argv' => array ( 0 => '/usr/local/installatron/lib/boot.php', ), 'argc' => 1, )

We are running ubuntu 10.04 LTS, currently without any connecton to our controlpanel.

Re: Custom controlpanel integration

Posted: Mon Oct 17, 2011 6:26 am
by Phil
Hello,

That error suggests when Installatron calls getUser() for the current user (client1234), getUser() is actually returning false, not the array suggested in the previous example.

I would be happy to evaluate your current backend.php. You can email it to me directly at pstier@installatron.com.

Thank you,
Phil.