API call sites_database_get_all_by_user problem

Discussion in 'ISPConfig 3 Priority Support' started by variable99, May 15, 2024.

  1. variable99

    variable99 Member HowtoForge Supporter

    This peace of code in remoting lib returns only active MySQL databases. If database marked as inactive API call returns zero:
    PHP:
    /**
        * Get all databases by user
        * @author Julio Montoya <[email protected]> BeezNest 2010
        */
       
    public function sites_database_get_all_by_user($session_id$client_id)
       {
           global 
    $app;
           if(!
    $this->checkPerm($session_id'sites_database_get')) {
               throw new 
    SoapFault('permission_denied''You do not have the permissions to access this function.');
               return 
    false;
           }
           
    $client_id $app->functions->intval($client_id);
           
    $sql "SELECT d.database_id, d.database_name, d.database_user_id, d.database_ro_user_id, du.database_user, du.database_password FROM web_database d LEFT JOIN web_database_user du ON (du.database_user_id = d.database_user_id) INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = ?";
           
    $all $app->db->queryAllRecords($sql$client_id);
           return 
    $all;
       }
    I don't see WHERE clause which could indicate search by status... Am I missing something?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. variable99

    variable99 Member HowtoForge Supporter

    You are correct, but still, I don't understand why that function failed to obtain data...
     

Share This Page