Common_Module

+------------------------------------------------------------+ | apnscp | +------------------------------------------------------------+ | Copyright (c) Apis Networks | +------------------------------------------------------------+ | Licensed under Artistic License 2.0 | +------------------------------------------------------------+ | Author: Matt Saladna (msaladna@apisnetworks.com) | +------------------------------------------------------------+
extends Module\Skeleton\Standard
Methods Summary
public
# service_exists( string $service )
bool service_exists(string) Checks to see if a service exists on the server. If the service does not exist, return false, otherwise return true.

privilege


public
# service_enabled( string $service )
bool service_enabled(string) Checks to see if a service is enabled for a given role. If the service is not enabled, return false, otherwise return true.

privilege


public
# get_email( )
string get_email (void) Return the configured email address for a given user

privilege


public
# get_admin_email( )
string get_admin_email (void) Returns the administrative e-mail associated to an account

privilege


public
# get_user_preferences( string $user )
Get preferences for user
public
# set_email( string $email )
Set email for active session
public
# get_service_value( string $mSrvcType , string $mSrvcName = NULL, string $default = NULL )
mixed get_service_value (string, string) Returns the corresponding value to a service type and service name if it exists, otherwise false if it does not exist

privilege


public
public
# get_domain_expiration( string $domain = NULL )
int get_domain_expiration(string) Retrieves the domain expiration timestamp for a given domain. Certain domains are ineligible for the lookup as the registrar blocks out expiration data. The known TLDs are as follows: *.ws *.mx *.au *.tk

Deprecated


public
public
# get_pod( $module )
public
public
# get_login_history( int $limit = NULL )
public
# get_disk_quota( )
array get_disk_quota() Returns the disk quota for a given account two doubles packed in an associative array with indexes "used" and "total", the difference of indexes "total" and "used" represent your free disk quota. Depending upon the user calling it, it will either contain your total site's quota usage and limit or a user's quota and limit. If you are calling this through SOAP, please see the Site_Module::get_disk_quota_user() function for user-specific quota retrieval. If there is no quota -- which will not happen, but is there for backwards compatibility -- the returned value for total will be NULL.

see

User_Module::get_disk_quota
public
# get_mysql_version( )
Get MySQL version
public
# get_load( )
array get_load (void)

privilege


public
# get_services( )
array get_services() Returns an array of supported services

privilege


public
public
# get_postgresql_version( )
string get_postgresql_version() Fetches the query SELECT version(); from PostgreSQL

cache


privilege


public
# get_web_server_name( )
string get_web_server_name() Returns the Web server name

privilege


public
# get_ftp_server_name( )
string get_ftp_server_name() Returns the ftp server name

privilege


public
# get_mail_server_name( )
string get_mail_server_name() Returns the mail server name

privilege


public
# whoami( )
Get username
public
# get_uptime( bool $pretty = true )
string get_uptime([bool = false]) Returns the server uptime

privilege


public
# get_perl_modules( )
array get_perl_modules() Returns the list of Perl modules available to a user

privilege


public
# get_web_server_ip_addr( )
string get_web_server_ip_addr() Returns the IP address of the Web server

Deprecated


privilege


public
# get_ip_address( )
IP address of domain
public
# get_ip6_address( )
IPv6 address of domain
public
# get_listening_ip_addr( )
int get_listening_ip_addr
public
# get_canonical_hostname( )
string get_canonical_hostname()
public
# get_kernel_version( )
string get_kernel_version()
public
# get_operating_system( )
string get_operating_system()
public
public
# list_pci_devices( )
string list_pci_devices() The call is equivalent to /sbin/lspci
public
# get_current_services( string|array $svc )
Parse committed service configuration\
public
# get_new_services( string|array $svc = NULL )
Parse service configuration from journal
public
public
# save_service_information_backend( array $services , bool $journal = false )
bool save_service_information_backend([bool = true])
public
# set_global_preferences( mixed $pref , string $key )
Set a preference to apply to all users
public
# lock_global_preferences( string $key )
public
# unlock_global_preferences( string $key )
public
# set_timezone( string $zone )
Set timezone This is an API call. Use UCard::setPref() to set tz in app
public
# load_preferences( )
Load user preferences
public
public
# purge_preferences( )
Purge all saved preferences
public
# save_preferences( array $prefs )
public
# set_user_preferences( string $user , array $prefs )
public
# get_timezone( )
Get default timezone for user As with set_timezone, use UCard::getPref() in the CP
public
# get_base_path( )
Absolute filesystem base path
public
# _edit( )
public
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), cleanUserParameters(), query()
Constants Summary
public string GLOBAL_PREFERENCES_NAME
# '.global'
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected $exportedFunctions
# array ( '*' => 15, 'get_admin_username' => 3, 'get_admin_email' => 3, 'get_perl_modules' => 3, 'get_web_server_name' => 3, 'get_mail_server_name' => 3, 'get_ftp_server_name' => 3, 'get_web_server_ip_addr' => 3, 'get_ip_address' => 3, 'save_service_information_backend' => 19, 'get_global_preferences' => 2, 'get_current_services' => 19, 'get_new_services' => 19, 'get_old_services' => 19, 'get_user_preferences' => 3, 'set_user_preferences' => 2, )
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id