function SelectDomainByX($xvalue, $xtype) { $return = null; switch ($xtype) { case 'id': if (!$this->_connector->Execute($this->_commandCreator->SelectDomainById($xvalue))) { return $return; } break; case 'name': if (!$this->_connector->Execute($this->_commandCreator->SelectDomainByName($xvalue))) { return $return; } break; default: return $return; break; } $row = $this->_connector->GetNextRecord(); if ($row) { $return = new CWebMailDomain(); $return->InitByDbRow($row); } return $return; }
/** * @param int $_id * @return CWebMailDomain */ function &SelectDomainById($_id) { $_domain = null; if (!$this->_dbConnection->Execute($this->_commandCreator->SelectDomainById($_id))) { return $_domain; } $row = $this->_dbConnection->GetNextRecord(); if ($row) { $_domain = new CWebMailDomain(); $_domain->SetId($row->id_domain); $_domain->Init($row->name, $row->mail_protocol, $row->mail_inc_host, $row->mail_inc_port, $row->mail_out_host, $row->mail_out_port, $row->mail_out_auth, $row->is_internal, $row->global_addr_book, $row->save_mail); $this->_dbConnection->FreeResult(); } return $_domain; }
/** * @param CWebMailDomain $domain * @return string */ function UpdateDomainById($domain) { $sql = ' UPDATE %sawm_domains SET mail_inc_host = %s, mail_inc_port = %d, mail_out_host = %s, mail_out_port = %d, mail_out_auth = %d, is_internal = %d, global_addr_book = %d, ldap_auth = %d, save_mail = %d, url = %s, site_name = %s, settings_mail_protocol = %d, settings_mail_inc_host = %s, settings_mail_inc_port = %d, settings_mail_out_host = %s, settings_mail_out_port = %d, settings_mail_out_auth = %d, allow_direct_mode = %d, direct_mode_id_def = %d, attachment_size_limit = %d, allow_attachment_limit = %d, mailbox_size_limit = %d, allow_mailbox_limit = %d, take_quota = %d, allow_new_users_change_set = %d, allow_auto_reg_on_login = %d, allow_users_add_accounts = %d, allow_users_change_account_def = %d, def_user_charset = %d, allow_users_change_charset = %d, def_user_timezone = %d, allow_users_change_timezone = %d, msgs_per_page = %d, skin = %s, allow_users_change_skin = %d, lang = %s, allow_users_change_lang = %d, show_text_labels = %d, allow_ajax = %d, allow_editor = %d, allow_contacts = %d, allow_calendar = %d, hide_login_mode = %d, domain_to_use = %s, allow_choosing_lang = %d, allow_advanced_login = %d, allow_auto_detect_and_correct = %d, use_captcha = %d, use_domain_selection = %d, view_mode = %d WHERE id_domain = %d'; return sprintf($sql, $this->_prefix, $this->_escapeString($domain->_mailIncomingHost), $domain->_mailIncomingPort, $this->_escapeString($domain->_mailSmtpHost), $domain->_mailSmtpPort, $domain->_mailSmtpAuth, $domain->_isInternal, $domain->_globalAddrBook, $domain->_ldapAuth, $domain->GetSettingsValue('save_mail'), $this->_escapeString($domain->GetSettingsValue('url')), $this->_escapeString($domain->GetSettingsValue('site_name')), $domain->GetSettingsValue('settings_mail_protocol'), $this->_escapeString($domain->GetSettingsValue('settings_mail_inc_host')), $domain->GetSettingsValue('settings_mail_inc_port'), $this->_escapeString($domain->GetSettingsValue('settings_mail_out_host')), $domain->GetSettingsValue('settings_mail_out_port'), $domain->GetSettingsValue('settings_mail_out_auth'), $domain->GetSettingsValue('allow_direct_mode'), $domain->GetSettingsValue('direct_mode_id_def'), $domain->GetSettingsValue('attachment_size_limit'), $domain->GetSettingsValue('allow_attachment_limit'), $domain->GetSettingsValue('mailbox_size_limit'), $domain->GetSettingsValue('allow_mailbox_limit'), $domain->GetSettingsValue('take_quota'), $domain->GetSettingsValue('allow_new_users_change_set'), $domain->GetSettingsValue('allow_auto_reg_on_login'), $domain->GetSettingsValue('allow_users_add_accounts'), $domain->GetSettingsValue('allow_users_change_account_def'), $domain->GetSettingsValue('def_user_charset'), $domain->GetSettingsValue('allow_users_change_charset'), $domain->GetSettingsValue('def_user_timezone'), $domain->GetSettingsValue('allow_users_change_timezone'), $domain->GetSettingsValue('msgs_per_page'), $this->_escapeString($domain->GetSettingsValue('skin')), $domain->GetSettingsValue('allow_users_change_skin'), $this->_escapeString($domain->GetSettingsValue('lang')), $domain->GetSettingsValue('allow_users_change_lang'), $domain->GetSettingsValue('show_text_labels'), $domain->GetSettingsValue('allow_ajax'), $domain->GetSettingsValue('allow_editor'), $domain->GetSettingsValue('allow_contacts'), $domain->GetSettingsValue('allow_calendar'), $domain->GetSettingsValue('hide_login_mode'), $this->_escapeString($domain->GetSettingsValue('domain_to_use')), $domain->GetSettingsValue('allow_choosing_lang'), $domain->GetSettingsValue('allow_advanced_login'), $domain->GetSettingsValue('allow_auto_detect_and_correct'), $domain->GetSettingsValue('use_captcha'), $domain->GetSettingsValue('use_domain_selection'), $domain->GetSettingsValue('view_mode'), $domain->_id); }