Commit 65ea2ecf authored by mcramer's avatar mcramer
Browse files

Fixed/Implemented: replaced intval() by $app->functions->intval() in all...

Fixed/Implemented: replaced intval() by $app->functions->intval() in all interface functions due to big number problem in intval()
parent 3064f83f
...@@ -81,7 +81,8 @@ class app { ...@@ -81,7 +81,8 @@ class app {
if(empty($_SESSION['s']['language'])) $_SESSION['s']['language'] = $conf['language']; if(empty($_SESSION['s']['language'])) $_SESSION['s']['language'] = $conf['language'];
} }
$this->uses('auth,plugin,functions'); $this->uses('functions'); // we need this before all others!
$this->uses('auth,plugin');
} }
public function __destruct() { public function __destruct() {
...@@ -119,7 +120,7 @@ class app { ...@@ -119,7 +120,7 @@ class app {
if($priority >= $this->_conf['log_priority']) { if($priority >= $this->_conf['log_priority']) {
// $server_id = $conf["server_id"]; // $server_id = $conf["server_id"];
$server_id = 0; $server_id = 0;
$priority = intval($priority); $priority = $this->functions->intval($priority);
$tstamp = time(); $tstamp = time();
$msg = $this->db->quote('[INTERFACE]: '.$msg); $msg = $this->db->quote('[INTERFACE]: '.$msg);
$this->db->query("INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES ($server_id,0,$priority,$tstamp,'$msg')"); $this->db->query("INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES ($server_id,0,$priority,$tstamp,'$msg')");
......
...@@ -210,7 +210,7 @@ class ApsGUIController extends ApsBase ...@@ -210,7 +210,7 @@ class ApsGUIController extends ApsBase
//* Get server config of the web server //* Get server config of the web server
$this->app->uses("getconf"); $this->app->uses("getconf");
$web_config = $this->app->getconf->get_server_config(intval($websrv["server_id"]),'web'); $web_config = $this->app->getconf->get_server_config($app->functions->intval($websrv["server_id"]),'web');
//* Set mysql mode to php-fcgi and enable suexec in website on apache servers //* Set mysql mode to php-fcgi and enable suexec in website on apache servers
if($web_config['server_type'] == 'apache') { if($web_config['server_type'] == 'apache') {
...@@ -239,7 +239,7 @@ class ApsGUIController extends ApsBase ...@@ -239,7 +239,7 @@ class ApsGUIController extends ApsBase
$client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$websrv['sys_groupid']); $client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$websrv['sys_groupid']);
if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) { if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) {
$mysql_db_server_id = $client['default_dbserver']; $mysql_db_server_id = $client['default_dbserver'];
$dbserver_config = $web_config = $app->getconf->get_server_config(intval($mysql_db_server_id),'server'); $dbserver_config = $web_config = $app->getconf->get_server_config($app->functions->intval($mysql_db_server_id),'server');
$mysql_db_host = $dbserver_config['ip_address']; $mysql_db_host = $dbserver_config['ip_address'];
$mysql_db_remote_access = 'y'; $mysql_db_remote_access = 'y';
$mysql_db_remote_ips = $dbserver_config['ip_address']; $mysql_db_remote_ips = $dbserver_config['ip_address'];
...@@ -322,7 +322,7 @@ class ApsGUIController extends ApsBase ...@@ -322,7 +322,7 @@ class ApsGUIController extends ApsBase
if($tmp['database_id'] > 0) $this->db->datalogDelete('web_database', 'database_id', $tmp['database_id']); if($tmp['database_id'] > 0) $this->db->datalogDelete('web_database', 'database_id', $tmp['database_id']);
$database_user = $tmp['database_user_id']; $database_user = $tmp['database_user_id'];
$tmp = $this->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = '" . intval($database_user) . "' OR `database_ro_user_id` = '" . intval($database_user) . "'"); $tmp = $this->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = '" . $app->functions->intval($database_user) . "' OR `database_ro_user_id` = '" . $app->functions->intval($database_user) . "'");
if($tmp['cnt'] < 1) $this->db->datalogDelete('web_database_user', 'database_user_id', $database_user); if($tmp['cnt'] < 1) $this->db->datalogDelete('web_database_user', 'database_user_id', $database_user);
$this->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_REMOVE, 'id', $instanceid); $this->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_REMOVE, 'id', $instanceid);
...@@ -449,6 +449,8 @@ class ApsGUIController extends ApsBase ...@@ -449,6 +449,8 @@ class ApsGUIController extends ApsBase
*/ */
public function validateInstallerInput($postinput, $pkg_details, $domains, $settings = array()) public function validateInstallerInput($postinput, $pkg_details, $domains, $settings = array())
{ {
global $app;
$ret = array(); $ret = array();
$input = array(); $input = array();
$error = array(); $error = array();
...@@ -566,12 +568,12 @@ class ApsGUIController extends ApsBase ...@@ -566,12 +568,12 @@ class ApsGUIController extends ApsBase
{ {
if($setting['SettingType'] == 'string' || $setting['SettingType'] == 'password') if($setting['SettingType'] == 'string' || $setting['SettingType'] == 'password')
{ {
if(intval($setting['SettingMinLength']) != 0 if($app->functions->intval($setting['SettingMinLength'], true) != 0
&& strlen($postinput[$setting_id]) < intval($setting['SettingMinLength'])) && strlen($postinput[$setting_id]) < $app->functions->intval($setting['SettingMinLength'], true))
$temp_errstr = sprintf($this->app->lng('error_short_value_for'), $setting['setting_name']); $temp_errstr = sprintf($this->app->lng('error_short_value_for'), $setting['setting_name']);
if(intval($setting['SettingMaxLength']) != 0 if($app->functions->intval($setting['SettingMaxLength'], true) != 0
&& strlen($postinput[$setting_id]) > intval($setting['SettingMaxLength'])) && strlen($postinput[$setting_id]) > $app->functions->intval($setting['SettingMaxLength'], true))
$temp_errstr = sprintf($this->app->lng('error_long_value_for'), $setting['setting_name']); $temp_errstr = sprintf($this->app->lng('error_long_value_for'), $setting['setting_name']);
if(isset($setting['SettingRegex']) if(isset($setting['SettingRegex'])
......
...@@ -47,7 +47,7 @@ class auth { ...@@ -47,7 +47,7 @@ class auth {
public function has_clients($userid) { public function has_clients($userid) {
global $app, $conf; global $app, $conf;
$userid = intval($userid); $userid = $app->functions->intval($userid);
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); $client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
if($client['limit_client'] > 0) { if($client['limit_client'] > 0) {
return true; return true;
...@@ -60,8 +60,8 @@ class auth { ...@@ -60,8 +60,8 @@ class auth {
public function add_group_to_user($userid,$groupid) { public function add_group_to_user($userid,$groupid) {
global $app; global $app;
$userid = intval($userid); $userid = $app->functions->intval($userid);
$groupid = intval($groupid); $groupid = $app->functions->intval($groupid);
if($userid > 0 && $groupid > 0) { if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
...@@ -98,8 +98,8 @@ class auth { ...@@ -98,8 +98,8 @@ class auth {
public function remove_group_from_user($userid,$groupid) { public function remove_group_from_user($userid,$groupid) {
global $app; global $app;
$userid = intval($userid); $userid = $app->functions->intval($userid);
$groupid = intval($groupid); $groupid = $app->functions->intval($groupid);
if($userid > 0 && $groupid > 0) { if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
......
...@@ -15,7 +15,7 @@ class client_templates { ...@@ -15,7 +15,7 @@ class client_templates {
/* /*
* Get the master-template for the client * Get the master-template for the client
*/ */
$sql = "SELECT template_master, template_additional FROM client WHERE client_id = " . intval($clientId); $sql = "SELECT template_master, template_additional FROM client WHERE client_id = " . $app->functions->intval($clientId);
$record = $app->db->queryOneRecord($sql); $record = $app->db->queryOneRecord($sql);
$masterTemplateId = $record['template_master']; $masterTemplateId = $record['template_master'];
$additionalTemplateStr = $record['template_additional']; $additionalTemplateStr = $record['template_additional'];
...@@ -24,7 +24,7 @@ class client_templates { ...@@ -24,7 +24,7 @@ class client_templates {
* if the master-Template is custom there is NO changing * if the master-Template is custom there is NO changing
*/ */
if ($masterTemplateId > 0){ if ($masterTemplateId > 0){
$sql = "SELECT * FROM client_template WHERE template_id = " . intval($masterTemplateId); $sql = "SELECT * FROM client_template WHERE template_id = " . $app->functions->intval($masterTemplateId);
$limits = $app->db->queryOneRecord($sql); $limits = $app->db->queryOneRecord($sql);
} else { } else {
// if there is no master template it makes NO SENSE adding sub templates. // if there is no master template it makes NO SENSE adding sub templates.
...@@ -40,7 +40,7 @@ class client_templates { ...@@ -40,7 +40,7 @@ class client_templates {
$addTpl = explode('/', $additionalTemplateStr); $addTpl = explode('/', $additionalTemplateStr);
foreach ($addTpl as $item){ foreach ($addTpl as $item){
if (trim($item) != ''){ if (trim($item) != ''){
$sql = "SELECT * FROM client_template WHERE template_id = " . intval($item); $sql = "SELECT * FROM client_template WHERE template_id = " . $app->functions->intval($item);
$addLimits = $app->db->queryOneRecord($sql); $addLimits = $app->db->queryOneRecord($sql);
/* maybe the template is deleted in the meantime */ /* maybe the template is deleted in the meantime */
if (is_array($addLimits)){ if (is_array($addLimits)){
...@@ -115,7 +115,7 @@ class client_templates { ...@@ -115,7 +115,7 @@ class client_templates {
} }
} }
if($update != '') { if($update != '') {
$sql = 'UPDATE client SET ' . $update . " WHERE client_id = " . intval($clientId); $sql = 'UPDATE client SET ' . $update . " WHERE client_id = " . $app->functions->intval($clientId);
$app->db->query($sql); $app->db->query($sql);
} }
} }
......
...@@ -140,6 +140,7 @@ class form { ...@@ -140,6 +140,7 @@ class form {
* @return record * @return record
*/ */
function decode($record) { function decode($record) {
global $app;
if(is_array($record)) { if(is_array($record)) {
foreach($record as $key => $val) { foreach($record as $key => $val) {
switch ($this->tableDef[$key]['datatype']) { switch ($this->tableDef[$key]['datatype']) {
...@@ -154,7 +155,7 @@ class form { ...@@ -154,7 +155,7 @@ class form {
break; break;
case 'INTEGER': case 'INTEGER':
$new_record[$key] = intval($val); $new_record[$key] = $app->functions->intval($val);
break; break;
case 'DOUBLE': case 'DOUBLE':
...@@ -306,7 +307,7 @@ class form { ...@@ -306,7 +307,7 @@ class form {
} }
break; break;
case 'INTEGER': case 'INTEGER':
$new_record[$key] = intval($val); $new_record[$key] = $app->functions->intval($val);
break; break;
case 'DOUBLE': case 'DOUBLE':
$new_record[$key] = $app->db->quote($val); $new_record[$key] = $app->db->quote($val);
......
...@@ -299,7 +299,15 @@ class functions { ...@@ -299,7 +299,15 @@ class functions {
return $result_array; return $result_array;
} }
public function intval($string, $force_numeric = false) {
if(intval($string) == 2147483647) {
if($force_numeric == true) return floatval($string);
elseif(preg_match('/^([-]?)[0]*([1-9][0-9]*)([^0-9].*)*$/', $string, $match)) return $match[1].$match[2];
else return 0;
} else {
return intval($string);
}
}
} }
......
...@@ -37,7 +37,7 @@ class getconf { ...@@ -37,7 +37,7 @@ class getconf {
if(!isset($this->config[$server_id])) { if(!isset($this->config[$server_id])) {
$app->uses('ini_parser'); $app->uses('ini_parser');
$server_id = intval($server_id); $server_id = $app->functions->intval($server_id);
$server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id); $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id);
$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config']));
} }
......
...@@ -194,14 +194,14 @@ class listform { ...@@ -194,14 +194,14 @@ class listform {
global $app, $conf; global $app, $conf;
//* Add Global Limit from selectbox //* Add Global Limit from selectbox
if(!empty($_POST['search_limit']) AND intval($_POST['search_limit'])){ if(!empty($_POST['search_limit']) AND $app->functions->intval($_POST['search_limit'])){
$_SESSION['search']['limit'] = intval($_POST['search_limit']); $_SESSION['search']['limit'] = $app->functions->intval($_POST['search_limit']);
} }
//* Get Config variables //* Get Config variables
$list_name = $this->listDef['name']; $list_name = $this->listDef['name'];
$search_prefix = $this->listDef['search_prefix']; $search_prefix = $this->listDef['search_prefix'];
$records_per_page = (empty($_SESSION['search']['limit']) ? intval($this->listDef['records_per_page']) : intval($_SESSION['search']['limit'])) ; $records_per_page = (empty($_SESSION['search']['limit']) ? $app->functions->intval($this->listDef['records_per_page']) : $app->functions->intval($_SESSION['search']['limit'])) ;
$table = $this->listDef['table']; $table = $this->listDef['table'];
//* set PAGE to zero, if in session not set //* set PAGE to zero, if in session not set
...@@ -210,14 +210,14 @@ class listform { ...@@ -210,14 +210,14 @@ class listform {
} }
//* set PAGE to worth request variable "PAGE" - ? setze page auf wert der request variablen "page" //* set PAGE to worth request variable "PAGE" - ? setze page auf wert der request variablen "page"
if(isset($_REQUEST["page"])) $_SESSION["search"][$list_name]["page"] = intval($_REQUEST["page"]); if(isset($_REQUEST["page"])) $_SESSION["search"][$list_name]["page"] = $app->functions->intval($_REQUEST["page"]);
//* PAGE to 0 set, if look for themselves ? page auf 0 setzen, wenn suche sich ge�ndert hat. //* PAGE to 0 set, if look for themselves ? page auf 0 setzen, wenn suche sich ge�ndert hat.
if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0;
$sql_von = intval($_SESSION['search'][$list_name]['page'] * $records_per_page); $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page);
$record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where"); $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where");
$pages = intval(($record_count['anzahl'] - 1) / $records_per_page); $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page);
$vars['list_file'] = $_SESSION['s']['module']['name'].'/'.$this->listDef['file']; $vars['list_file'] = $_SESSION['s']['module']['name'].'/'.$this->listDef['file'];
...@@ -331,7 +331,7 @@ class listform { ...@@ -331,7 +331,7 @@ class listform {
break; break;
case 'INTEGER': case 'INTEGER':
$record[$key] = intval($record[$key]); $record[$key] = $app->functions->intval($record[$key]);
break; break;
case 'DOUBLE': case 'DOUBLE':
...@@ -387,7 +387,7 @@ class listform { ...@@ -387,7 +387,7 @@ class listform {
break; break;
case 'INTEGER': case 'INTEGER':
$record[$key] = intval($record[$key]); $record[$key] = $app->functions->intval($record[$key]);
break; break;
case 'DOUBLE': case 'DOUBLE':
......
...@@ -53,7 +53,7 @@ class plugin_backuplist extends plugin_base { ...@@ -53,7 +53,7 @@ class plugin_backuplist extends plugin_base {
$error = ''; $error = '';
if(isset($_GET['backup_action'])) { if(isset($_GET['backup_action'])) {
$backup_id = intval($_GET['backup_id']); $backup_id = $app->functions->intval($_GET['backup_id']);
if($_GET['backup_action'] == 'download' && $backup_id > 0) { if($_GET['backup_action'] == 'download' && $backup_id > 0) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'"; $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'";
......
...@@ -1023,11 +1023,11 @@ class remoting { ...@@ -1023,11 +1023,11 @@ class remoting {
return false; return false;
} }
$sys_userid = intval($sys_userid); $sys_userid = $app->functions->intval($sys_userid);
$rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid); $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid);
if(isset($rec['client_id'])) { if(isset($rec['client_id'])) {
return intval($rec['client_id']); return $app->functions->intval($rec['client_id']);
} else { } else {
$this->server->fault('no_client_found', 'There is no sysuser account for this client ID.'); $this->server->fault('no_client_found', 'There is no sysuser account for this client ID.');
return false; return false;
...@@ -1043,11 +1043,11 @@ class remoting { ...@@ -1043,11 +1043,11 @@ class remoting {
return false; return false;
} }
$client_id = intval($client_id); $client_id = $app->functions->intval($client_id);
$rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client_id); $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client_id);
if(isset($rec['groupid'])) { if(isset($rec['groupid'])) {
return intval($rec['groupid']); return $app->functions->intval($rec['groupid']);
} else { } else {
$this->server->fault('no_group_found', 'There is no group for this client ID.'); $this->server->fault('no_group_found', 'There is no group for this client ID.');
return false; return false;
...@@ -1112,12 +1112,12 @@ class remoting { ...@@ -1112,12 +1112,12 @@ class remoting {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false; return false;
} }
$client_id = intval($client_id); $client_id = $app->functions->intval($client_id);
$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id");
$tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic'; $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic';
$tables_array = explode(',',$tables); $tables_array = explode(',',$tables);
$client_group_id = intval($client_group['groupid']); $client_group_id = $app->functions->intval($client_group['groupid']);
$table_list = array(); $table_list = array();
if($client_group_id > 1) { if($client_group_id > 1) {
...@@ -1133,7 +1133,7 @@ class remoting { ...@@ -1133,7 +1133,7 @@ class remoting {
if($client_id > 0) { if($client_id > 0) {
// remove the group of the client from the resellers group // remove the group of the client from the resellers group
$parent_client_id = intval($this->dataRecord['parent_client_id']); $parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']);
$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id");
$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id");
$app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']); $app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']);
...@@ -1147,7 +1147,7 @@ class remoting { ...@@ -1147,7 +1147,7 @@ class remoting {
// Delete all records (sub-clients, mail, web, etc....) of this client. // Delete all records (sub-clients, mail, web, etc....) of this client.
$tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic'; $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic';
$tables_array = explode(',',$tables); $tables_array = explode(',',$tables);
$client_group_id = intval($client_group['groupid']); $client_group_id = $app->functions->intval($client_group['groupid']);
if($client_group_id > 1) { if($client_group_id > 1) {
foreach($tables_array as $table) { foreach($tables_array as $table) {
if($table != '') { if($table != '') {
...@@ -1507,7 +1507,7 @@ class remoting { ...@@ -1507,7 +1507,7 @@ class remoting {
} }
if(!isset($params['client_group_id']) or (isset($params['client_group_id']) && empty($params['client_group_id']))) { if(!isset($params['client_group_id']) or (isset($params['client_group_id']) && empty($params['client_group_id']))) {
$rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".intval($client_id)); $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client_id));
$params['client_group_id'] = $rec['groupid']; $params['client_group_id'] = $rec['groupid'];
} }
...@@ -1769,7 +1769,7 @@ class remoting { ...@@ -1769,7 +1769,7 @@ class remoting {
} }
// Delete all users that belong to this folder. - taken from web_folder_delete.php // Delete all users that belong to this folder. - taken from web_folder_delete.php
$records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = '".intval($primary_id)."'"); $records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = '".$app->functions->intval($primary_id)."'");
foreach($records as $rec) { foreach($records as $rec) {
$this->deleteQuery('../sites/form/web_folder_user.tform.php',$rec['web_folder_user_id']); $this->deleteQuery('../sites/form/web_folder_user.tform.php',$rec['web_folder_user_id']);
//$app->db->datalogDelete('web_folder_user','web_folder_user_id',$rec['web_folder_user_id']); //$app->db->datalogDelete('web_folder_user','web_folder_user_id',$rec['web_folder_user_id']);
...@@ -1874,7 +1874,7 @@ class remoting { ...@@ -1874,7 +1874,7 @@ class remoting {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false; return false;
} }
$group_id = intval($group_id); $group_id = $app->functions->intval($group_id);
$sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = $group_id "; $sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = $group_id ";
$all = $app->db->queryAllRecords($sql); $all = $app->db->queryAllRecords($sql);
return $all; return $all;
...@@ -1892,7 +1892,7 @@ class remoting { ...@@ -1892,7 +1892,7 @@ class remoting {
return false; return false;
} }
$client = $app->db->queryOneRecord("SELECT default_dnsserver FROM client WHERE client_id = ".intval($client_id)); $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM client WHERE client_id = ".$app->functions->intval($client_id));
$server_id = $client["default_dnsserver"]; $server_id = $client["default_dnsserver"];
$template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = '$template_id'"); $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = '$template_id'");
$fields = explode(',',$template_record['fields']); $fields = explode(',',$template_record['fields']);
...@@ -1959,7 +1959,7 @@ class remoting { ...@@ -1959,7 +1959,7 @@ class remoting {
if($error == '') { if($error == '') {
// Insert the soa record // Insert the soa record
$tmp = $app->db->queryOneRecord("SELECT userid,default_group FROM sys_user WHERE client_id = ".intval($client_id)); $tmp = $app->db->queryOneRecord("SELECT userid,default_group FROM sys_user WHERE client_id = ".$app->functions->intval($client_id));
$sys_userid = $tmp['userid']; $sys_userid = $tmp['userid'];
$sys_groupid = $tmp['default_group']; $sys_groupid = $tmp['default_group'];
unset($tmp); unset($tmp);
...@@ -2024,7 +2024,7 @@ class remoting { ...@@ -2024,7 +2024,7 @@ class remoting {
$rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin.'%'); $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin.'%');
if(isset($rec['id'])) { if(isset($rec['id'])) {
return intval($rec['id']); return $app->functions->intval($rec['id']);
} else { } else {
$this->server->fault('no_domain_found', 'There is no domain ID with informed domain name.'); $this->server->fault('no_domain_found', 'There is no domain ID with informed domain name.');
return false; return false;
...@@ -2909,11 +2909,11 @@ class remoting { ...@@ -2909,11 +2909,11 @@ class remoting {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false; return false;
} }
$sys_userid = intval($sys_userid);