APS - location already in use (vhostsubdomain/domain)
Hi all,
I've got a problem with installing an APS package on the same location, by different domains (subdomain). In the file aps_guicontroller.inc.php the doc_root is used to check, if a location is already in use /var/www/clients/clientX/webY/{{ LOCATION }} (example /var/www/clients/client1000/web2733/wp)
Because a subdomain uses the same doc_root, but got a different web_folder, the check will match everytime.
Domain: /var/www/clients/client1000/web2733/web/wp SubDomain: /var/www/clients/client1000/web2733/sub/wp
Is not the same, but the check will compare (/var/www/clients/client1000/web2733/wp == /var/www/clients/client1000/web2733/wp). So I think the best will be, to change the SQL query:
$instance_domains = $this->db->queryAllRecords("SELECT instance_id, s.value AS domain FROM aps_instances AS i, aps_instances_settings AS s WHERE i.id = s.instance_id AND s.name = 'main_domain' AND i.customer_id = '".$this->db->quote($customerid)."' AND s.value = '".$this->db->quote($postinput['main_domain'])."';");
So we will check for the used domain, only.
I created a patch file:
--- interface/lib/classes/aps_guicontroller.inc.php (revision ) +++ interface/lib/classes/aps_guicontroller.inc.php (revision ) @@ -559,7 +559,8 @@ $instance_domains = $app->db->queryAllRecords("SELECT instance_id, s.value AS domain FROM aps_instances AS i, aps_instances_settings AS s WHERE i.id = s.instance_id AND s.name = 'main_domain'
-
AND i.customer_id = '".$app->db->quote($customerid)."';");
-
AND i.customer_id = '".$this->db->quote($customerid)."'
-
AND s.value = '".$this->db->quote($postinput['main_domain'])."';"); for($i = 0; $i < count($instance_domains); $i++) { $used_path = '';