"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "interface/web/client/client_edit.php" between
ISPConfig-3.2.4.tar.gz and ISPConfig-3.2.5.tar.gz

About: ISPConfig is an ISP management and Hosting Control Panel (for different Managed Services).

client_edit.php  (ISPConfig-3.2.4):client_edit.php  (ISPConfig-3.2.5)
skipping to change at line 191 skipping to change at line 191
$app->tpl->setVar('app_module', 'client'); $app->tpl->setVar('app_module', 'client');
// Check wether per domain relaying is enabled or not // Check wether per domain relaying is enabled or not
$global_config = $app->getconf->get_global_config('mail'); $global_config = $app->getconf->get_global_config('mail');
if($global_config['show_per_domain_relay_options'] == 'y') { if($global_config['show_per_domain_relay_options'] == 'y') {
$app->tpl->setVar("show_per_domain_relay_options", 1); $app->tpl->setVar("show_per_domain_relay_options", 1);
} else { } else {
$app->tpl->setVar("show_per_domain_relay_options", 0); $app->tpl->setVar("show_per_domain_relay_options", 0);
} }
// APS is enabled or not
$global_config = $app->getconf->get_global_config('sites');
if($global_config['show_aps_menu'] == 'y') {
$app->tpl->setVar("show_aps_menu", 1);
} else {
$app->tpl->setVar("show_aps_menu", 0);
}
//* Set the 'customer no' default value //* Set the 'customer no' default value
if($this->id == 0) { if($this->id == 0) {
if($app->auth->is_admin()) { if($app->auth->is_admin()) {
//* Logged in User is admin //* Logged in User is admin
//* get the system config //* get the system config
$app->uses('getconf'); $app->uses('getconf');
$system_config = $app->getconf->get_global_config (); $system_config = $app->getconf->get_global_config ();
if($system_config['misc']['customer_no_template'] != '') { if($system_config['misc']['customer_no_template'] != '') {
skipping to change at line 423 skipping to change at line 431
// password changed // password changed
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && iss et($this->dataRecord["password"]) && $this->dataRecord["password"] != '') { if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && iss et($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
$password = $this->dataRecord["password"]; $password = $this->dataRecord["password"];
$password = $app->auth->crypt_password($password); $password = $app->auth->crypt_password($password);
$client_id = $this->id; $client_id = $this->id;
$sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?"; $sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?";
$app->db->query($sql, $password, $client_id); $app->db->query($sql, $password, $client_id);
} }
if(!isset($this->dataRecord['locked'])) $this->dataRecord['locked // lock and cancel
'] = 'n'; if(!isset($this->dataRecord['locked'])) $this->dataRecord['locked'] = 'n
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $th ';
is->dataRecord["locked"] != $this->oldDataRecord['locked']) { if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $this->dat
/** lock all the things like web, mail etc. - easy to ext aRecord["locked"] != $this->oldDataRecord['locked'])
end */ {
$lock = $app->functions->func_client_lock($this->id,$this
// get tmp_data of client ->dataRecord["locked"]);
$client_data = $app->db->queryOneRecord('SELECT `tmp_data }
` FROM `client` WHERE `client_id` = ?', $this->id);
if($client_data['tmp_data'] == '') $tmp_data = array();
else $tmp_data = unserialize($client_data['tmp_data']);
if(!is_array($tmp_data)) $tmp_data = array();
// database tables with their primary key columns
$to_disable = array('cron' => 'id',
'ftp_user' => 'ftp_user_id',
'mail_domain' => 'domain_id',
'mail_user' => 'mailuser_id',
'mail_user_smtp' => 'mailuser_id',
'mail_forwarding' => 'forwarding_id',
'mail_get' => 'mailget_id',
'openvz_vm' => 'vm_id',
'shell_user' => 'shell_user_id',
'webdav_user' => 'webdav_user_id',
'web_database' => 'database_id',
'web_domain' => 'domain_id',
'web_folder' => 'web_folder_id',
'web_folder_user' => 'web_folder_user_id'
);
$udata = $app->db->queryOneRecord('SELECT `userid` FROM `
sys_user` WHERE `client_id` = ?', $this->id);
$gdata = $app->db->queryOneRecord('SELECT `groupid` FROM
`sys_group` WHERE `client_id` = ?', $this->id);
$sys_groupid = $gdata['groupid'];
$sys_userid = $udata['userid'];
$entries = array();
if($this->dataRecord['locked'] == 'y') {
$prev_active = array();
$prev_sysuser = array();
foreach($to_disable as $current => $keycolumn) {
$active_col = 'active';
$reverse = false;
if($current == 'mail_user') {
$active_col = 'postfix';
} elseif($current == 'mail_user_smtp') {
$current = 'mail_user';
$active_col = 'disablesmtp';
$reverse = true;
}
if(!isset($prev_active[$current])) $prev_
active[$current] = array();
if(!isset($prev_sysuser[$current])) $prev
_sysuser[$current] = array();
$entries = $app->db->queryAllRecords('SEL
ECT ?? as `id`, `sys_userid`, ?? FROM ?? WHERE `sys_groupid` = ?', $keycolumn, $
active_col, $current, $sys_groupid);
foreach($entries as $item) {
if($item[$active_col] != 'y' && $
reverse == false) $prev_active[$current][$item['id']][$active_col] = 'n';
elseif($item[$active_col] == 'y'
&& $reverse == true) $prev_active[$current][$item['id']][$active_col] = 'y';
if($item['sys_userid'] != $sys_us
erid) $prev_sysuser[$current][$item['id']] = $item['sys_userid'];
// we don't have to store these i
f y, as everything without previous state gets enabled later
$app->db->datalogUpdate($current,
array($active_col => ($reverse == true ? 'y' : 'n'), 'sys_userid' => $_SESSION[
"s"]["user"]["userid"]), $keycolumn, $item['id']);
}
}
$tmp_data['prev_active'] = $prev_active;
$tmp_data['prev_sys_userid'] = $prev_sysuser;
$app->db->query("UPDATE `client` SET `tmp_data` =
? WHERE `client_id` = ?", serialize($tmp_data), $this->id);
unset($prev_active);
unset($prev_sysuser);
} elseif($this->dataRecord['locked'] == 'n') {
foreach($to_disable as $current => $keycolumn) {
$active_col = 'active';
$reverse = false;
if($current == 'mail_user') {
$active_col = 'postfix';
} elseif($current == 'mail_user_smtp') {
$current = 'mail_user';
$active_col = 'disablesmtp';
$reverse = true;
}
$entries = $app->db->queryAllRecords('SEL
ECT ?? as `id` FROM ?? WHERE `sys_groupid` = ?', $keycolumn, $current, $sys_grou
pid);
foreach($entries as $item) {
$set_active = ($reverse == true ?
'n' : 'y');
$set_inactive = ($reverse == true
? 'y' : 'n');
$set_sysuser = $sys_userid;
if(array_key_exists('prev_active'
, $tmp_data) == true
&& array_key_exists($curr
ent, $tmp_data['prev_active']) == true
&& array_key_exists($item
['id'], $tmp_data['prev_active'][$current]) == true
&& $tmp_data['prev_active
'][$current][$item['id']][$active_col] == $set_inactive) $set_active = $set_inac
tive;
if(array_key_exists('prev_sysuser
', $tmp_data) == true
&& array_key_exists($curr
ent, $tmp_data['prev_sysuser']) == true
&& array_key_exists($item
['id'], $tmp_data['prev_sysuser'][$current]) == true
&& $tmp_data['prev_sysuse
r'][$current][$item['id']] != $sys_userid) $set_sysuser = $tmp_data['prev_sysuse
r'][$current][$item['id']];
$app->db->datalogUpdate($current,
array($active_col => $set_active, 'sys_userid' => $set_sysuser), $keycolumn, $i
tem['id']);
}
}
if(array_key_exists('prev_active', $tmp_data)) un
set($tmp_data['prev_active']);
$app->db->query("UPDATE `client` SET `tmp_data` =
? WHERE `client_id` = ?", serialize($tmp_data), $this->id);
}
unset($tmp_data);
unset($entries);
unset($to_disable);
}
if(!isset($this->dataRecord['canceled'])) $this->dataRecord['canc eled'] = 'n'; if(!isset($this->dataRecord['canceled'])) $this->dataRecord['canc eled'] = 'n';
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $th is->dataRecord["canceled"] != $this->oldDataRecord['canceled']) { if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $th is->dataRecord["canceled"] != $this->oldDataRecord['canceled']) {
if($this->dataRecord['canceled'] == 'y') { $cancel = $app->functions->func_client_cancel($this->id,$
$sql = "UPDATE sys_user SET active = '0' WHERE cl this->dataRecord["canceled"]);
ient_id = ?";
$app->db->query($sql, $this->id);
} elseif($this->dataRecord['canceled'] == 'n') {
$sql = "UPDATE sys_user SET active = '1' WHERE cl
ient_id = ?";
$app->db->query($sql, $this->id);
}
} }
// language changed // language changed
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && iss et($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $thi s->oldDataRecord['language'] != $this->dataRecord['language']) { if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && iss et($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $thi s->oldDataRecord['language'] != $this->dataRecord['language']) {
$language = $this->dataRecord["language"]; $language = $this->dataRecord["language"];
$client_id = $this->id; $client_id = $this->id;
$sql = "UPDATE sys_user SET language = ? WHERE client_id = ?"; $sql = "UPDATE sys_user SET language = ? WHERE client_id = ?";
$app->db->query($sql, $language, $client_id); $app->db->query($sql, $language, $client_id);
} }
 End of changes. 3 change blocks. 
149 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)