Merged revisions 1647 - 1662 from trunk.
| | |
| | | |
| | | This guide is incomplete. Work in progress. |
| | | |
| | | |
| | | Installing the webserver |
| | | -------------------------------------------------- |
| | | |
| | |
| | | |
| | | apt-get install gcc make |
| | | |
| | | |
| | | apt-get install postfix |
| | | |
| | | |
| | | |
| | |
| | | -- Dumping data for table `sys_config` |
| | | -- |
| | | |
| | | INSERT INTO sys_config VALUES ('1','db','db_version','3.0.2'); |
| | | INSERT INTO sys_config VALUES ('1','db','db_version','3.0.2.1'); |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | |
| | | |
| | | //** Application |
| | | define('ISPC_APP_TITLE', 'ISPConfig'); |
| | | define('ISPC_APP_VERSION', '3.0.2'); |
| | | define('ISPC_APP_VERSION', '3.0.2.1'); |
| | | |
| | | |
| | | //** Database |
| | |
| | | ignore-minimum = no # Ignore minimum TTL for zone? |
| | | soa-table = dns_soa # Name of table containing SOA records |
| | | rr-table = dns_rr # Name of table containing RR data |
| | | soa-where = server_id = {server_id} # Extra WHERE clause for SOA queries |
| | | rr-where = server_id = {server_id} # Extra WHERE clause for RR queries |
| | | ## soa-where = server_id = {server_id} # Extra WHERE clause for SOA queries |
| | | ## rr-where = server_id = {server_id} # Extra WHERE clause for RR queries |
| | | use-soa-active = yes # To fix bug 295 where active or inactive status is ignored. |
| | | use-rr-active = yes# To fix bug 295 where active or inactive status is ignored. |
| | |
| | | system("mysqldump -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -c -t --add-drop-table --create-options --quick --result-file=existing_db.sql ".$conf['mysql']['database']); |
| | | } |
| | | |
| | | if(filesize('existing_db.sql') < 60000) die('Possible problem with dumping the database. We will stop here. Please check the file existing_db.sql'); |
| | | if(filesize('existing_db.sql') < 30000) die('Possible problem with dumping the database. We will stop here. Please check the file existing_db.sql'); |
| | | |
| | | // create a backup copy of the ispconfig database in the root folder |
| | | $backup_db_name = '/root/ispconfig_db_backup_'.@date('Y-m-d_h-i').'.sql'; |
| | |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('client'); |
| | | if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); |
| | | if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are for Admins only.'); |
| | | |
| | | $app->uses('tpl,tform'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class page_action extends tform_actions { |
| | | function onBeforeDelete() { |
| | | global $app; |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE template_master = ".$this->id." OR template_additional like '%/".$this->id."/%'"); |
| | | if($rec['number'] > 0) { |
| | | $app->error($app->tform->lng('template_del_aborted_txt')); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | } |
| | | } |
| | | |
| | | //* Load themes |
| | | $themes_list = array(); |
| | | $handle = @opendir(ISPC_THEMES_PATH); |
| | | while ($file = @readdir ($handle)) { |
| | | if (substr($file, 0, 1) != '.') { |
| | | if(@is_dir(ISPC_THEMES_PATH."/$file")) { |
| | | $themes_list[$file] = $file; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $form["tabs"]['address'] = array ( |
| | | 'title' => "Address", |
| | | 'width' => 100, |
| | |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => 'default', |
| | | 'value' => array('default' => 'default'), |
| | | 'value' => $themes_list, |
| | | 'separator' => '', |
| | | 'width' => '30', |
| | | 'maxlength' => '255', |
| | |
| | | $wb["limit_web_quota_txt"] = 'Web Quota'; |
| | | $wb["limit_traffic_quota_txt"] = 'Traffic Quota'; |
| | | $wb["limit_trafficquota_error_notint"] = 'Traffic Quota must be a number.'; |
| | | $wb["template_del_aborted_txt"] = 'Delete aborted. There is still a client which has this template selected.'; |
| | | ?> |
| | |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[a-zA-Z0-9\.\-\_]{0,100}$/', |
| | | 'regex' => '/^[a-zA-Z0-9\.\-\_\ ]{0,100}$/', |
| | | 'errmsg'=> 'target_error_regex'), |
| | | ), |
| | | 'default' => '', |
| | |
| | | |
| | | |
| | | |
| | | ?> |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Name is empty.'; |
| | | $wb['searchterm_is_empty'] = 'Search term is empty.'; |
| | | $wb['source_txt'] = 'Source'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Nome está em branco.'; |
| | | $wb['searchterm_is_empty'] = 'Termo de busca em branco.'; |
| | | $wb['source_txt'] = 'Origem'; |
| | | $wb['target_error_regex'] = 'O alvo só pode conter os caracteres: a-z, 0-9, -, . e _'; |
| | | $wb['target_error_regex'] = 'O alvo só pode conter os caracteres: a-z, 0-9, -, ., _, e {espaço}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Name ist leer.'; |
| | | $wb['searchterm_is_empty'] = 'Suchbegriff ist leer.'; |
| | | $wb['source_txt'] = 'Quelle'; |
| | | $wb['target_error_regex'] = 'Das Ziel beinhaltet wahrscheinlich diese Zeichen: a-z, 0-9, -, . und _'; |
| | | $wb['target_error_regex'] = 'Das Ziel beinhaltet wahrscheinlich diese Zeichen: a-z, 0-9, -, ., _, und {raum}'; |
| | | ?> |
| | |
| | | $wb["rulename_error_empty"] = 'Name is empty.'; |
| | | $wb["searchterm_is_empty"] = 'Search term is empty.'; |
| | | $wb["source_txt"] = 'Source'; |
| | | $wb["target_error_regex"] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | ?> |
| | | $wb["target_error_regex"] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'El nombre está vacío.'; |
| | | $wb['searchterm_is_empty'] = 'El término de búsqueda está vacío.'; |
| | | $wb['source_txt'] = 'Origen'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Säännön nimi on tyhjä.'; |
| | | $wb['searchterm_is_empty'] = 'Hakusana on tyhjä.'; |
| | | $wb['source_txt'] = 'Lähde'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Le nom est vide.'; |
| | | $wb['searchterm_is_empty'] = 'Le terme recherché est vide.'; |
| | | $wb['source_txt'] = 'Source'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'A név üres'; |
| | | $wb['searchterm_is_empty'] = 'Keresési feltétel üres'; |
| | | $wb['source_txt'] = 'Forrás'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Name is empty.'; |
| | | $wb['searchterm_is_empty'] = 'Search term is empty.'; |
| | | $wb['source_txt'] = 'Source'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Name is empty.'; |
| | | $wb['searchterm_is_empty'] = 'Search term is empty.'; |
| | | $wb['source_txt'] = 'Source'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Naam is leeg.'; |
| | | $wb['searchterm_is_empty'] = 'Zoekterm is leeg.'; |
| | | $wb['source_txt'] = 'Bron'; |
| | | $wb['target_error_regex'] = 'Het doel mag alleen deze tekens bevatten: a-z, 0-9, -, . en _'; |
| | | $wb['target_error_regex'] = 'Het doel mag alleen deze tekens bevatten: a-z, 0-9, -, ., _, en {ruimte}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Nazwa jest pusta.'; |
| | | $wb['searchterm_is_empty'] = 'Szukany termin jest pusty.'; |
| | | $wb['source_txt'] = 'Źródło'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Nume e gol'; |
| | | $wb['searchterm_is_empty'] = 'Cautare termeni e gol'; |
| | | $wb['source_txt'] = 'Sursa'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Name is empty.'; |
| | | $wb['searchterm_is_empty'] = 'Search term is empty.'; |
| | | $wb['source_txt'] = 'Source'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'Meno je prázdne'; |
| | | $wb['searchterm_is_empty'] = 'H?adaný výraz je prázdny.'; |
| | | $wb['source_txt'] = 'Zdroj'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | $wb['rulename_error_empty'] = 'İsim boş.'; |
| | | $wb['searchterm_is_empty'] = 'Search term is empty.'; |
| | | $wb['source_txt'] = 'Kaynak'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, . and _'; |
| | | $wb['target_error_regex'] = 'The target may only contain these characters: a-z, 0-9, -, ., _, and {space}'; |
| | | ?> |
| | |
| | | } |
| | | |
| | | //** If the email address has been changed, change it in all aliases too |
| | | if($this->oldDataRecord['email'] != $this->dataRecord['email']) { |
| | | if(isset($this->dataRecord['email']) && $this->oldDataRecord['email'] != $this->dataRecord['email']) { |
| | | //if($this->oldDataRecord['email'] != $this->dataRecord['email']) { |
| | | |
| | | //* Update the aliases |
| | | $forwardings = $app->db->queryAllRecords("SELECT * FROM mail_forwarding WHERE destination = '".$app->db->quote($this->oldDataRecord['email'])."'"); |
| | |
| | | //** Traffic of the current month |
| | | $tmp_date = date('Y-m'); |
| | | $tmp_rec = $app->db->queryOneRecord("SELECT traffic as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month = '$tmp_date'"); |
| | | $rec['this_month'] = number_format(intval($tmp_rec['t'])/1024, 0, '.', ' '); |
| | | $rec['this_month'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' '); |
| | | |
| | | //** Traffic of the current year |
| | | $tmp_date = date('Y'); |
| | | $tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic) as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month like '$tmp_date%'"); |
| | | $rec['this_year'] = number_format(intval($tmp_rec['t'])/1024, 0, '.', ' '); |
| | | $rec['this_year'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' '); |
| | | |
| | | //** Traffic of the last month |
| | | $tmp_date = date('Y-m',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $tmp_rec = $app->db->queryOneRecord("SELECT traffic as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month = '$tmp_date'"); |
| | | $rec['last_month'] = number_format(intval($tmp_rec['t'])/1024, 0, '.', ' '); |
| | | $rec['last_month'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' '); |
| | | |
| | | //** Traffic of the last year |
| | | $tmp_date = date('Y',mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); |
| | | $tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic) as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month like '$tmp_date%'"); |
| | | $rec['last_year'] = number_format(intval($tmp_rec['t'])/1024, 0, '.', ' '); |
| | | $rec['last_year'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' '); |
| | | |
| | | //* The variable "id" contains always the index variable |
| | | $rec['id'] = $rec[$this->idx_key]; |
| | |
| | | <tmpl_loop name="records">
|
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
|
| | | <td class="tbl_col_email"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="email"}</a></td>
|
| | | <td class="tbl_col_this_month"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_month"} kB</a></td>
|
| | | <td class="tbl_col_last_month"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_month"} kB</a></td>
|
| | | <td class="tbl_col_this_year"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_year"} kB</a></td>
|
| | | <td class="tbl_col_last_year"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_year"} kB</a></td>
|
| | | <td class="tbl_col_this_month"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_month"} MB</a></td>
|
| | | <td class="tbl_col_last_month"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_month"} MB</a></td>
|
| | | <td class="tbl_col_this_year"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_year"} MB</a></td>
|
| | | <td class="tbl_col_last_year"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_year"} MB</a></td>
|
| | | <td class="tbl_col_buttons">
|
| | | <div class="buttons icons16">
|
| | | </div>
|
| | |
| | | /* |
| | | * gets the state from the db and process it |
| | | */ |
| | | function _processDbState($type, $serverId, &$serverState, &$messages) |
| | | function _processDbState($type, $serverId, $serverState, $messages) |
| | | { |
| | | global $app; |
| | | |
| | |
| | | $wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota'; |
| | | $wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/'; |
| | | $wb["php_open_basedir_txt"] = 'PHP open_basedir'; |
| | | $wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded'; |
| | | ?> |
| | |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="traffic_quota">{tmpl_var name='traffic_quota_txt'}</label> |
| | | <input name="traffic_quota" id="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" /> MB |
| | | <input name="traffic_quota" id="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" /> MB <tmpl_var name='traffic_quota_exceeded_txt'> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='cgi_txt'}</p> |
| | |
| | | $app->tpl->setVar("edit_disabled", 0); |
| | | } |
| | | |
| | | $tmp_txt = ($this->dataRecord['traffic_quota_lock'] == 'y')?'<b>('.$app->tform->lng('traffic_quota_exceeded_txt').')</b>':''; |
| | | $app->tpl->setVar("traffic_quota_exceeded_txt", $tmp_txt); |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | | |
| | |
| | | $client_id = intval($client["client_id"]); |
| | | } |
| | | |
| | | if(($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) && isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["client_group_id"]) { |
| | | if(($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) && isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"]) { |
| | | // Set the values for document_root, system_user and system_group |
| | | $system_user = $app->db->quote('web'.$this->id); |
| | | $system_group = $app->db->quote('client'.$client_id); |
| | |
| | | <tmpl_if name='php' op='==' value='fast-cgi'> |
| | | # php as fast-cgi enabled |
| | | <IfModule mod_fcgid.c> |
| | | SocketPath /tmp/fcgid_sock/ |
| | | # SocketPath /tmp/fcgid_sock/ |
| | | IdleTimeout 3600 |
| | | ProcessLifeTime 7200 |
| | | MaxProcessCount 1000 |
| | | # MaxProcessCount 1000 |
| | | DefaultMinClassProcessCount 3 |
| | | DefaultMaxClassProcessCount 100 |
| | | IPCConnectTimeout 8 |
| | |
| | | <tmpl_if name='php' op='==' value='fast-cgi'> |
| | | # php as fast-cgi enabled |
| | | <IfModule mod_fcgid.c> |
| | | SocketPath /tmp/fcgid_sock/ |
| | | # SocketPath /tmp/fcgid_sock/ |
| | | IdleTimeout 3600 |
| | | ProcessLifeTime 7200 |
| | | MaxProcessCount 1000 |
| | | # MaxProcessCount 1000 |
| | | DefaultMinClassProcessCount 3 |
| | | DefaultMaxClassProcessCount 100 |
| | | IPCConnectTimeout 8 |
| | |
| | | foreach($records as $rec){ |
| | | $tmp_path = realpath(escapeshellcmd($rec["document_root"].'/tmp')); |
| | | if($tmp_path != '' && strlen($tmp_path) > 10 && is_dir($tmp_path) && $app->system->is_user($rec['system_user'])){ |
| | | exec("cd ".$tmp_path."; find -ctime +1 -user ".escapeshellcmd($rec['system_user'])." | grep -v -w .no_delete | xargs rm &> /dev/null"); |
| | | if($app->system->is_user('www-data')) exec("cd ".$tmp_path."; find -ctime +1 -user www-data | grep -v -w .no_delete | xargs rm &> /dev/null"); |
| | | if($app->system->is_user('wwwrun')) exec("cd ".$tmp_path."; find -ctime +1 -user wwwrun | grep -v -w .no_delete | xargs rm &> /dev/null"); |
| | | exec("cd ".$tmp_path."; find -ctime +1 -user ".escapeshellcmd($rec['system_user'])." | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null"); |
| | | if($app->system->is_user('www-data')) exec("cd ".$tmp_path."; find -ctime +1 -user www-data | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null"); |
| | | if($app->system->is_user('wwwrun')) exec("cd ".$tmp_path."; find -ctime +1 -user wwwrun | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null"); |
| | | } |
| | | } |
| | | } |
| | |
| | | foreach($records as $rec) { |
| | | |
| | | $web_traffic_quota = $rec['traffic_quota']; |
| | | $domain = $rec['web_domain']; |
| | | $domain = $rec['domain']; |
| | | |
| | | // get the client |
| | | /* |
| | |
| | | */ |
| | | |
| | | //* get the traffic |
| | | $tmp = $app->db->query("SELECT traffic_bytes FROM web_traffic WHERE traffic_date like '$current_month%' AND hostname = '$domain'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT traffic_bytes FROM web_traffic WHERE traffic_date like '$current_month%' AND hostname = '$domain'"); |
| | | $web_traffic = $tmp['traffic_bytes']/1024/1024; |
| | | |
| | | //* Website is over quota, we will disable it |
| | |
| | | ($client_traffic_quota > 0 && $web_traffic > $client_traffic_quota) || |
| | | ($reseller_traffic_quota > 0 && $web_traffic > $reseller_traffic_quota)) {*/ |
| | | if($web_traffic_quota > 0 && $web_traffic > $web_traffic_quota) { |
| | | $app->db->datalogUpdate('web_domain', "traffic_quota_lock = 'y',active = 'n'", 'domain_id', $rec['domain_id']); |
| | | $app->dbmaster->datalogUpdate('web_domain', "traffic_quota_lock = 'y',active = 'n'", 'domain_id', $rec['domain_id']); |
| | | $app->log("Traffic quota for ".$rec['domain_id']." Exceeded. Disabling website.",LOGLEVEL_DEBUG); |
| | | } else { |
| | | //* unlock the website, if traffic is lower then quota |
| | | if($rec['traffic_quota_lock'] == 'y') { |
| | | $app->db->datalogUpdate('web_domain', "traffic_quota_lock = 'n',active = 'y'", 'domain_id', $rec['domain_id']); |
| | | $app->dbmaster->datalogUpdate('web_domain', "traffic_quota_lock = 'n',active = 'y'", 'domain_id', $rec['domain_id']); |
| | | $app->log("Traffic quota for ".$rec['domain_id']." ok again. Enabling website.",LOGLEVEL_DEBUG); |
| | | } |
| | | } |