View Single Post
  #1  
Old 6th December 2011, 10:50
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Smile Website: Get All FTP acc by domain ID

Hi all,

yesterday I programming the new system based on ISPConfig API and I had need to get all FTP accounts by domain ID from ISPConfig. I cant find this funtion in the API functions. So, I write some for me and my use to ISPCP API. Its only little feature, but useful for me

Code is below. Maybe, you can think about implement this to new version, new release of ISPConfig, it may be useful for many other users using and programming with ISPCOnfig API.

If is this wrong place to this thread or this topic, Im sorry and please, help me, where to post this

Thanks for much.

Code:

PHP Code:
public function sites_ftp_get_all_by_domain($session_id$domain_id)
        {
        global 
$app;
                if(!
$this->checkPerm($session_idsites_ftp_user_get')) {
                $this->server->fault('
permission_denied', 'You do not have the permissions to access this function.);
            return 
false;
                }
        
$domain_id intval($domain_id);

         
$sql "SELECT ftp_user_id, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, server_id, username, password, quota_size, active, dir FROM ftp_user WHERE parent_domain_id=$domain_id";
         
$all $app->db->queryAllRecords($sql);
         return 
$all;
        } 
Placed in /usr/local/ispconfig/interface/lib/class/remoting.inc.php
Reply With Quote
Sponsored Links