Data records are now assigned to the correct client group if they were created by the administrator.
| | |
| | | `quota` int(11) NOT NULL default '0', |
| | | `homedir` varchar(255) NOT NULL, |
| | | `autoresponder` enum('n','y') NOT NULL default 'n', |
| | | `autoresponder_text` tinytext NOT NULL, |
| | | `autoresponder_text` tinytext NULL, |
| | | `custom_mailfilter` text, |
| | | `postfix` enum('y','n') NOT NULL, |
| | | `access` enum('y','n') NOT NULL, |
| | |
| | | $sql_insert_val = substr($sql_insert_val,0,-2);
|
| | | $sql = "INSERT INTO ".$escape.$this->formDef['db_table'].$escape." ($sql_insert_key) VALUES ($sql_insert_val)";
|
| | | } else {
|
| | | if($this->formDef['auth'] == 'yes') { |
| | | if($primary_id != 0) {
|
| | | $sql_update = substr($sql_update,0,-2);
|
| | | $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->getAuthSQL('u')." AND ".$this->formDef['db_table_idx']." = ".$primary_id;
|
| | |
| | | } else {
|
| | | $app->error("Primary ID fehlt!");
|
| | | }
|
| | | } else { |
| | | if($primary_id != 0) { |
| | | $sql_update = substr($sql_update,0,-2); |
| | | $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id; |
| | | if($sql_ext_where != '') $sql .= " and ".$sql_ext_where; |
| | | } else { |
| | | $app->error("Primary ID fehlt!"); |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | return $sql;
|
| | |
| | | define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser |
| | | define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache'); |
| | | |
| | | define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns'); |
| | | define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools'); |
| | | |
| | | //******************************************************************************** |
| | | //** Future Code idea - pedro - rfc |
| | |
| | | */ |
| | | |
| | | |
| | | |
| | | //** External programs |
| | | //$conf["programs"]["convert"] = "/usr/bin/convert"; |
| | | $conf['programs']['wput'] = ISPC_ROOT_PATH."\\tools\\wput\\wput.exe"; |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | $soa_id = intval($_POST["zone"]); |
| | | $serial = time(); |
| | | $app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id"); |
| | | |
| | | // Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app; |
| | | |
| | | $domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("update mail_forwarding SET sys_groupid = ".$domain['sys_groupid']." WHERE forwarding_id = ".$this->id); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | $domain_select = ''; |
| | | if(is_array($domains)) { |
| | | foreach( $domains as $domain) { |
| | | $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':''; |
| | | $selected = (isset($email_parts[1]) && $domain["domain"] == $email_parts[1])?'SELECTED':''; |
| | | $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n"; |
| | | } |
| | | } |
| | |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_mailcatchall FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // Check if the user may add another mailbox. |
| | | // Check if the user may add another catchall |
| | | if($this->id == 0 && $client["limit_mailcatchall"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE sys_groupid = $client_group_id AND type = 'catchall'"); |
| | | if($tmp["number"] >= $client["limit_mailcatchall"]) { |
| | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app; |
| | | |
| | | $domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("update mail_forwarding SET sys_groupid = ".$domain['sys_groupid']." WHERE forwarding_id = ".$this->id); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | $domains = $app->db->queryAllRecords($sql); |
| | | $domain_select = ''; |
| | | foreach( $domains as $domain) { |
| | | $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':''; |
| | | $selected = (isset($email_parts[1]) && $domain["domain"] == $email_parts[1])?'SELECTED':''; |
| | | $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n"; |
| | | } |
| | | $app->tpl->setVar("email_domain",$domain_select); |
| | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app; |
| | | |
| | | $domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->query("update mail_forwarding SET sys_groupid = ".$domain['sys_groupid']." WHERE forwarding_id = ".$this->id); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app; |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_user WHERE email = '".mysql_real_escape_string($this->dataRecord["destination"])."'"); |
| | | $app->db->query("update mail_get SET sys_groupid = ".$tmp['sys_groupid']." WHERE mailget_id = ".$this->id); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | $mailuser = $app->db->queryOneRecord("SELECT custom_mailfilter FROM mail_user WHERE mailuser_id = ".$this->dataRecord["mailuser_id"]); |
| | | $mailuser = $app->db->queryOneRecord("SELECT sys_groupid, custom_mailfilter FROM mail_user WHERE mailuser_id = ".$this->dataRecord["mailuser_id"]); |
| | | $rule_content = $mailuser['custom_mailfilter']."\n".$app->db->quote($this->getRule()); |
| | | $app->db->datalogUpdate('mail_user', "custom_mailfilter = '$rule_content'", 'mailuser_id', $this->dataRecord["mailuser_id"]); |
| | | |
| | | // set permissions |
| | | $app->db->query("UPDATE mail_user_filter SET sys_groupid = ".$mailuser['sys_groupid']." WHERE filter_id = "$this->id); |
| | | |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | var $parent_domain_record; |
| | | |
| | | function onShowNew() { |
| | | global $app, $conf; |
| | | |
| | |
| | | $this->dataRecord["server_id"] = $parent_domain["server_id"]; |
| | | //$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"]; |
| | | |
| | | $this->parent_domain_record = $parent_domain; |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | $app->db->query('UPDATE web_domain SET sys_groupid = '.intval($this->parent_domain_record['sys_groupid']).' WHERE domain_id = '.$this->id); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | var $parent_domain_record; |
| | | |
| | | function onShowNew() { |
| | | global $app, $conf; |
| | | |
| | |
| | | $this->dataRecord["server_id"] = $parent_domain["server_id"]; |
| | | $this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"]; |
| | | |
| | | $this->parent_domain_record = $parent_domain; |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | $app->db->query('UPDATE web_domain SET sys_groupid = '.intval($this->parent_domain_record['sys_groupid']).' WHERE domain_id = '.$this->id); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | $form["db_history"] = "no"; |
| | | $form['tab_default'] = 'users'; |
| | | $form['list_default'] = 'index.php'; |
| | | $form['auth'] = 'yes'; |
| | | $form['auth'] = 'no'; |
| | | |
| | | //* 0 = id of the user, > 0 id must match with id of current user |
| | | $form['auth_preset']['userid'] = 0; |
| | |
| | | |
| | | // Importing ID |
| | | $this->id = $_SESSION['s']['user']['userid']; |
| | | $_POST['id'] = $_SESSION['s']['user']['userid']; |
| | | |
| | | if(count($_POST) > 1) { |
| | | $this->dataRecord = $_POST; |
| | |
| | | } |
| | | } |
| | | |
| | | function onInsert() { |
| | | die('No inserts allowed.'); |
| | | } |
| | | |
| | | function onBeforeUpdate() { |
| | | global $app, $conf; |
| | | |