Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th June 2010, 16:50
jmontoya jmontoya is offline
Member
 
Join Date: May 2010
Location: France
Posts: 52
Thanks: 2
Thanked 4 Times in 4 Posts
Default Remoting::server_get function proposal

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 Code:
    // 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 <gugli100@gmail.com>
        */
    
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 Code:
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""

__________________
Julio Montoya
BeezNest : http://www.beeznest.com
Blog: http://phpcommit.wordpress.com
Reply With Quote
Sponsored Links
  #2  
Old 13th June 2010, 15:35
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,667
Thanks: 819
Thanked 5,317 Times in 4,170 Posts
 
Default

Thnaks for the suggestion. I've added it to the feature requests.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help setting up domainpop with postfix kameelperdza Installation/Configuration 6 15th June 2009 07:49
cyrus-sasl won't install on my ubuntu9.04 kameelperdza Installation/Configuration 1 13th June 2009 10:28
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
SuSE Enterprise, PHP binary coming with ISPConfig does not work properly NexusTechUS Installation/Configuration 1 26th April 2007 20:03
installing Perl module GD - ran into problems Ovidiu Installation/Configuration 6 19th September 2006 09:32


All times are GMT +2. The time now is 11:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.