Remoting::server_get function proposal

Discussion in 'Developers' Forum' started by jmontoya, Jun 11, 2010.

  1. jmontoya

    jmontoya New Member

    I propose this function for the remoting class.
    We can get the server config sections. It works well for me I comment the check permission part.

    Hope that helps to someone. Maybe it could be added in the class? :)


    PHP:
        // Get server details
            /**
            Gets the server configuration
            @param int session id
            @param int server id
            @param string  section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
            @author Julio Montoya <[email protected]>
            */
        
    public function server_get($session_id$server_id$section ='') {
            global 
    $app;        
            
    /*if(!$this->checkPerm($session_id, 'server_get')) {
                $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
                return false;
            }*/
            
    if (!empty($session_id) && !empty($server_id)) {    
                
    $app->uses('remoting_lib , getconf');        
                
    $section_config =  $app->getconf->get_server_config($server_id,$section);        
                return 
    $section_config;
            } else {
                return 
    false;
            }
        }
    If we call this function and we do a var_dump:

    var_dump($client->server_get(1,1,'web'));
    We will get something like this:
    PHP:
    array(13) {
      [
    "website_basedir"]=>
      
    string(8"/var/www"
      
    ["website_path"]=>
      
    string(50"/var/www/clients/client[client_id]/web[website_id]"
      
    ["website_symlinks"]=>
      
    string(79"/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/"
      
    ["vhost_conf_dir"]=>
      
    string(28"/etc/apache2/sites-available"
      
    ["vhost_conf_enabled_dir"]=>
      
    string(26"/etc/apache2/sites-enabled"
      
    ["security_level"]=>
      
    string(2"20"
      
    ["user"]=>
      
    string(8"www-data"
      
    ["group"]=>
      
    string(8"www-data"
      
    ["php_open_basedir"]=>
      
    string(140"[website_path]/web:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin"
      
    ["htaccess_allow_override"]=>
      
    string(3"All"
      
    ["apps_vhost_port"]=>
      
    string(4"8081"
      
    ["apps_vhost_ip"]=>
      
    string(9"_default_"
      
    ["apps_vhost_servername"]=>
      
    string(0""
    }
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thnaks for the suggestion. I've added it to the feature requests.
     

Share This Page