Commit 65ea2ecf authored by mcramer's avatar mcramer

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 {
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() {
......@@ -119,7 +120,7 @@ class app {
if($priority >= $this->_conf['log_priority']) {
// $server_id = $conf["server_id"];
$server_id = 0;
$priority = intval($priority);
$priority = $this->functions->intval($priority);
$tstamp = time();
$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')");
......
......@@ -210,7 +210,7 @@ class ApsGUIController extends ApsBase
//* Get server config of the web server
$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
if($web_config['server_type'] == 'apache') {
......@@ -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']);
if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) {
$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_remote_access = 'y';
$mysql_db_remote_ips = $dbserver_config['ip_address'];
......@@ -322,7 +322,7 @@ class ApsGUIController extends ApsBase
if($tmp['database_id'] > 0) $this->db->datalogDelete('web_database', 'database_id', $tmp['database_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);
$this->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_REMOVE, 'id', $instanceid);
......@@ -449,6 +449,8 @@ class ApsGUIController extends ApsBase
*/
public function validateInstallerInput($postinput, $pkg_details, $domains, $settings = array())
{
global $app;
$ret = array();
$input = array();
$error = array();
......@@ -566,12 +568,12 @@ class ApsGUIController extends ApsBase
{
if($setting['SettingType'] == 'string' || $setting['SettingType'] == 'password')
{
if(intval($setting['SettingMinLength']) != 0
&& strlen($postinput[$setting_id]) < intval($setting['SettingMinLength']))
if($app->functions->intval($setting['SettingMinLength'], true) != 0
&& strlen($postinput[$setting_id]) < $app->functions->intval($setting['SettingMinLength'], true))
$temp_errstr = sprintf($this->app->lng('error_short_value_for'), $setting['setting_name']);
if(intval($setting['SettingMaxLength']) != 0
&& strlen($postinput[$setting_id]) > intval($setting['SettingMaxLength']))
if($app->functions->intval($setting['SettingMaxLength'], true) != 0
&& strlen($postinput[$setting_id]) > $app->functions->intval($setting['SettingMaxLength'], true))
$temp_errstr = sprintf($this->app->lng('error_long_value_for'), $setting['setting_name']);
if(isset($setting['SettingRegex'])
......
......@@ -47,7 +47,7 @@ class auth {
public function has_clients($userid) {
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");
if($client['limit_client'] > 0) {
return true;
......@@ -60,8 +60,8 @@ class auth {
public function add_group_to_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
$userid = $app->functions->intval($userid);
$groupid = $app->functions->intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
......@@ -98,8 +98,8 @@ class auth {
public function remove_group_from_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
$userid = $app->functions->intval($userid);
$groupid = $app->functions->intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
......
......@@ -15,7 +15,7 @@ class client_templates {
/*
* 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);
$masterTemplateId = $record['template_master'];
$additionalTemplateStr = $record['template_additional'];
......@@ -24,7 +24,7 @@ class client_templates {
* if the master-Template is custom there is NO changing
*/
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);
} else {
// if there is no master template it makes NO SENSE adding sub templates.
......@@ -40,7 +40,7 @@ class client_templates {
$addTpl = explode('/', $additionalTemplateStr);
foreach ($addTpl as $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);
/* maybe the template is deleted in the meantime */
if (is_array($addLimits)){
......@@ -115,7 +115,7 @@ class client_templates {
}
}
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);
}
}
......
......@@ -140,6 +140,7 @@ class form {
* @return record
*/
function decode($record) {
global $app;
if(is_array($record)) {
foreach($record as $key => $val) {
switch ($this->tableDef[$key]['datatype']) {
......@@ -154,7 +155,7 @@ class form {
break;
case 'INTEGER':
$new_record[$key] = intval($val);
$new_record[$key] = $app->functions->intval($val);
break;
case 'DOUBLE':
......@@ -306,7 +307,7 @@ class form {
}
break;
case 'INTEGER':
$new_record[$key] = intval($val);
$new_record[$key] = $app->functions->intval($val);
break;
case 'DOUBLE':
$new_record[$key] = $app->db->quote($val);
......
......@@ -299,7 +299,15 @@ class functions {
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 {
if(!isset($this->config[$server_id])) {
$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);
$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config']));
}
......
......@@ -194,14 +194,14 @@ class listform {
global $app, $conf;
//* Add Global Limit from selectbox
if(!empty($_POST['search_limit']) AND intval($_POST['search_limit'])){
$_SESSION['search']['limit'] = intval($_POST['search_limit']);
if(!empty($_POST['search_limit']) AND $app->functions->intval($_POST['search_limit'])){
$_SESSION['search']['limit'] = $app->functions->intval($_POST['search_limit']);
}
//* Get Config variables
$list_name = $this->listDef['name'];
$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'];
//* set PAGE to zero, if in session not set
......@@ -210,14 +210,14 @@ class listform {
}
//* 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.
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");
$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'];
......@@ -331,7 +331,7 @@ class listform {
break;
case 'INTEGER':
$record[$key] = intval($record[$key]);
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
......@@ -387,7 +387,7 @@ class listform {
break;
case 'INTEGER':
$record[$key] = intval($record[$key]);
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
......
......@@ -53,7 +53,7 @@ class plugin_backuplist extends plugin_base {
$error = '';
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) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'";
......
This diff is collapsed.
This diff is collapsed.
......@@ -177,7 +177,7 @@ class searchform {
$sql_von = $_SESSION['search'][$list_name]['page'] * $records_per_page;
$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'] = $this->listDef['file'];
$vars['page'] = $_SESSION['search'][$list_name]['page'];
......@@ -264,6 +264,7 @@ class searchform {
public function decode($record)
{
global $app;
if(is_array($record)) {
foreach($this->listDef['item'] as $field) {
$key = $field['field'];
......@@ -276,7 +277,7 @@ class searchform {
break;
case 'INTEGER':
$record[$key] = intval($record[$key]);
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
......@@ -324,7 +325,7 @@ class searchform {
break;
case 'INTEGER':
$record[$key] = intval($record[$key]);
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
......
......@@ -54,14 +54,14 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SEPARATOR
* - separator char used for fileds with multiple values
*
* Hint: The auto increment (ID) filed of the table has not be be definied eoarately.
* Hint: The auto increment (ID) filed of the table has not be be definied separately.
*
*/
class tform {
/**
* Table definition (array)
* Definition of the database table (array)
* @var tableDef
*/
var $tableDef;
......@@ -79,25 +79,25 @@ class tform {
var $table_name;
/**
* Enable debigging
* Debug Variable
* @var debug
*/
var $debug = 0;
/**
* name of the primary field of the datbase table (string)
* name of the primary field of the database table (string)
* @var table_index
*/
var $table_index;
/**
* contains the error message
* contains the error messages
* @var errorMessage
*/
var $errorMessage = '';
var $dateformat = "d.m.Y";
var $formDef;
var $formDef = array();
var $wordbook;
var $module;
var $primary_id;
......@@ -124,7 +124,7 @@ class tform {
function loadFormDef($file,$module = '') {
global $app,$conf;
include_once($file);
include($file);
$this->formDef = $form;
$this->module = $module;
......@@ -169,7 +169,7 @@ class tform {
if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab).");
$new_record = '';
$table_idx = $this->formDef['db_table_idx'];
if(isset($record[$table_idx])) $new_record[$table_idx] = intval($record[$table_idx ]);
if(isset($record[$table_idx])) $new_record[$table_idx] = $app->functions->intval($record[$table_idx ]);
if(is_array($record)) {
foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
......@@ -202,7 +202,7 @@ class tform {
break;
case 'INTEGER':
$new_record[$key] = intval($record[$key]);
$new_record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
......@@ -224,7 +224,7 @@ class tform {
}
/**
* Get the key => value array of a form filed from a datasource definitiom
* Get the key => value array of a form filled from a datasource definitiom
*
* @param field = array with field definition
* @param record = Dataset as array
......@@ -247,7 +247,6 @@ class tform {
$table_idx = $this->formDef['db_table_idx'];
$tmp_recordid = (isset($record[$table_idx]))?$record[$table_idx]:0;
//$tmp_recordid = intval($this->primary_id);
$querystring = str_replace("{RECORDID}",$tmp_recordid,$querystring);
unset($tmp_recordid);
......@@ -678,7 +677,7 @@ class tform {
}
break;
case 'INTEGER':
$new_record[$key] = (isset($record[$key]))?$record[$key]:0;
$new_record[$key] = (isset($record[$key]))?$app->functions->intval($record[$key]):0;
//if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default'];
//if($key == 'refresh') die($record[$key]);
break;
......@@ -863,7 +862,7 @@ class tform {
}
}
} else {
$tmpval = intval($field_value);
$tmpval = $app->functions->intval($field_value);
if($tmpval === 0 and !empty($field_value)) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
......@@ -976,7 +975,7 @@ class tform {
}
/**
* Create the SQL staement.
* Create SQL statement
*
* @param record = Datensatz als Array
* @param action = INSERT oder UPDATE
......
......@@ -49,7 +49,7 @@ class tform_actions {
$app->tform->loadFormDef($tform_def_file);
// Importing ID
$this->id = (isset($_REQUEST["id"]))?intval($_REQUEST["id"]):0;
$this->id = (isset($_REQUEST["id"]))?$app->functions->intval($_REQUEST["id"]):0;
// show print version of the form
if(isset($_GET["print_form"]) && $_GET["print_form"] == 1) {
......@@ -291,7 +291,7 @@ class tform_actions {
$app->tform->loadFormDef($tform_def_file);
// importing ID
$this->id = intval($_REQUEST["id"]);
$this->id = $app->functions->intval($_REQUEST["id"]);
if($this->id > 0) {
......
......@@ -74,7 +74,7 @@ class tools_sites {
}
}
$tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = " . intval($client_group_id));
$tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id));
$clientName = $tmp['name'];
if ($clientName == "") $clientName = 'default';
$clientName = $this->convertClientName($clientName);
......@@ -100,7 +100,7 @@ class tools_sites {
$client_group_id = 0;
}
}
$tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = " . intval($client_group_id));
$tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id));
$clientID = $tmp['client_id'];
if ($clientID == '') $clientID = '0';
return $clientID;
......
......@@ -150,7 +150,7 @@ function is_integer($value, $fieldname, $zero_allowed = 0){
$error = '';
if(intval($value) != $value || !is_numeric($value)) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_integer']."<br>\r\n";
if($app->functions->intval($value, true) != $value || !is_numeric($value)) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_integer']."<br>\r\n";
if($value > 2147483647) $error .= $fieldname." ".$app->tform->wordbook['error_must_not_be_greater_than_2147483647']."<br>\r\n";
if(!$zero_allowed){
if($value <= 0) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_positive']."<br>\r\n";
......@@ -268,7 +268,7 @@ function increase_serial($serial){
// increase serial
$serial_date = substr($serial, 0, 8);
$count = intval(substr($serial, 8, 2));
$count = $app->functions->intval(substr($serial, 8, 2));
$current_date = date("Ymd");
if($serial_date >= $current_date){
$count += 1;
......
......@@ -88,7 +88,7 @@ class validate_domain {
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
if ($settings['use_domain_module'] == 'y') {
$sql = "SELECT domain_id, domain FROM domain WHERE domain_id = " . intval($check_domain);
$sql = "SELECT domain_id, domain FROM domain WHERE domain_id = " . $app->functions->intval($check_domain);
$domain_check = $app->db->queryOneRecord($sql);
if(!$domain_check) return;
$check_domain = $domain_check['domain'];
......@@ -114,11 +114,11 @@ class validate_domain {
$primary_id = $app->tform->primary_id;
}
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE `domain` = '" . $app->db->quote($domain_name) . "' AND `domain_id` != " . intval($primary_id));
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE `domain` = '" . $app->db->quote($domain_name) . "' AND `domain_id` != " . $app->functions->intval($primary_id));
if($check['cnt'] > 0) return false;
if($only_domain == false) {
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE CONCAT(`subdomain`, '.', `domain`) = '" . $app->db->quote($domain_name) . "' AND `domain_id` != " . intval($primary_id));
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE CONCAT(`subdomain`, '.', `domain`) = '" . $app->db->quote($domain_name) . "' AND `domain_id` != " . $app->functions->intval($primary_id));
if($check['cnt'] > 0) return false;
}
......
......@@ -124,8 +124,8 @@ class mail_user_filter_plugin {
global $app,$conf;
$app->uses("getconf");
$mailuser_rec = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE mailuser_id = ".intval($page_form->dataRecord["mailuser_id"]));
$mail_config = $app->getconf->get_server_config(intval($mailuser_rec["server_id"]),'mail');
$mailuser_rec = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE mailuser_id = ".$app->functions->intval($page_form->dataRecord["mailuser_id"]));
$mail_config = $app->getconf->get_server_config($app->functions->intval($mailuser_rec["server_id"]),'mail');
if($mail_config['mail_filter_syntax'] == 'sieve') {
......
......@@ -29,13 +29,13 @@ class sites_web_database_user_plugin {
// make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
// also make sure that the user can not delete domain created by a admin
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) {
$client_group_id = intval($page_form->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
$app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE database_user_id = ".$page_form->id);
}
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) {
$client_group_id = intval($page_form->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
$app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE database_user_id = ".$page_form->id);
}
$app->db->query("UPDATE web_database_user SET server_id = '" . intval($conf['server_id']) . "' WHERE database_user_id = ".$page_form->id);
$app->db->query("UPDATE web_database_user SET server_id = '" . $app->functions->intval($conf['server_id']) . "' WHERE database_user_id = ".$page_form->id);
}
}
\ No newline at end of file
......@@ -43,16 +43,16 @@ class sites_web_domain_plugin {
// make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
// also make sure that the user can not delete domain created by a admin
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) {
$client_group_id = intval($page_form->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
$app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$page_form->id);
}
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) {
$client_group_id = intval($page_form->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
$app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$page_form->id);
}
// Get configuration for the web system
$app->uses("getconf");
$web_config = $app->getconf->get_server_config(intval($page_form->dataRecord['server_id']),'web');
$web_config = $app->getconf->get_server_config($app->functions->intval($page_form->dataRecord['server_id']),'web');
$document_root = str_replace("[website_id]",$page_form->id,$web_config["website_path"]);
$document_root = str_replace("[website_idhash_1]",$this->id_hash($page_form->id,1),$document_root);
$document_root = str_replace("[website_idhash_2]",$this->id_hash($page_form->id,1),$document_root);
......@@ -63,11 +63,11 @@ class sites_web_domain_plugin {
if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = $client_group_id");
$client_id = intval($client["client_id"]);
$client_id = $app->functions->intval($client["client_id"]);
} else {
//$client_id = intval($this->dataRecord["client_group_id"]);
$client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($page_form->dataRecord["client_group_id"]));
$client_id = intval($client["client_id"]);
//$client_id = $app->functions->intval($this->dataRecord["client_group_id"]);
$client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval($page_form->dataRecord["client_group_id"]));
$client_id = $app->functions->intval($client["client_id"]);
}
// Set the values for document_root, system_user and system_group
......
......@@ -47,9 +47,9 @@ class sites_web_vhost_subdomain_plugin {
// Get configuration for the web system
$app->uses("getconf");
$web_rec = $app->tform->getDataRecord($page_form->id);
$web_config = $app->getconf->get_server_config(intval($web_rec['server_id']),'web');
$web_config = $app->getconf->get_server_config($app->functions->intval($web_rec['server_id']),'web');
$parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . intval($web_rec['parent_domain_id']) . "'");
$parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . $app->functions->intval($web_rec['parent_domain_id']) . "'");
// Set the values for document_root, system_user and system_group
$system_user = $app->db->quote($parent_domain['system_user']);
......@@ -61,7 +61,7 @@ class sites_web_vhost_subdomain_plugin {
$php_open_basedir = $app->db->quote(str_replace("[website_domain]",$web_rec['domain'],$php_open_basedir));
$htaccess_allow_override = $app->db->quote($parent_domain['allow_override']);
$sql = "UPDATE web_domain SET sys_groupid = ".intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id;
$sql = "UPDATE web_domain SET sys_groupid = ".$app->functions->intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id;
$app->db->query($sql);
}
}
\ No newline at end of file
......@@ -39,11 +39,11 @@ class vm_openvz_plugin {
// make sure that the record belongs to the clinet group and not the admin group when admin inserts it
// also make sure that the user can not delete domain created by a admin
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE openvz_vm SET sys_groupid = $client_group_id WHERE vm_id = ".$this->id);
}
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE openvz_vm SET sys_groupid = $client_group_id WHERE vm_id = ".$this->id);
}
......@@ -80,11 +80,11 @@ class vm_openvz_plugin {
// make sure that the record belongs to the clinet group and not the admin group when a admin inserts it
// also make sure that the user can not delete domain created by a admin
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE openvz_vm SET sys_groupid = $client_group_id WHERE vm_id = ".$this->id);
}
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
$app