本文整理汇总了PHP中tform_actions::onSubmit方法的典型用法代码示例。如果您正苦于以下问题:PHP tform_actions::onSubmit方法的具体用法?PHP tform_actions::onSubmit怎么用?PHP tform_actions::onSubmit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tform_actions
的用法示例。
在下文中一共展示了tform_actions::onSubmit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onSubmit
function onSubmit()
{
global $app, $conf;
// Check the client limits, if user is not the admin
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
// if user is not admin
// Get the limits of the client
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT limit_fetchmail 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 transport.
if ($this->id == 0 && $client["limit_fetchmail"] >= 0) {
$tmp = $app->db->queryOneRecord("SELECT count(mailget_id) as number FROM mail_get WHERE sys_groupid = {$client_group_id}");
if ($tmp["number"] >= $client["limit_fetchmail"]) {
$app->tform->errorMessage .= $app->tform->wordbook["limit_fetchmail_txt"] . "<br>";
}
unset($tmp);
}
}
// end if user is not admin
// Set the server ID according to the selected destination
$tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '" . $app->db->quote($this->dataRecord["destination"]) . "'");
$this->dataRecord["server_id"] = $tmp["server_id"];
unset($tmp);
parent::onSubmit();
}
示例2: onSubmit
function onSubmit()
{
global $app, $conf;
// Get the record of the parent domain
$parent_domain = $app->db->queryOneRecord("select server_id FROM web_domain WHERE domain_id = " . intval(@$this->dataRecord["parent_domain_id"]));
// Set a few fixed values
$this->dataRecord["server_id"] = $parent_domain["server_id"];
parent::onSubmit();
}
示例3: onSubmit
function onSubmit()
{
global $app, $conf;
// Get the record of the parent domain
$folder = $app->db->queryOneRecord("select server_id FROM web_folder WHERE web_folder_id = " . $app->functions->intval(@$this->dataRecord["web_folder_id"]));
// Set a few fixed values
$this->dataRecord["server_id"] = $folder["server_id"];
parent::onSubmit();
}
示例4: onSubmit
function onSubmit()
{
global $app;
//* We do not want to mirror the the server itself
if ($this->id == $this->dataRecord['mirror_server_id']) {
$this->dataRecord['mirror_server_id'] = 0;
}
parent::onSubmit();
}
示例5: onSubmit
function onSubmit()
{
global $app, $conf;
//* If the current user is not the admin user
if ($_SESSION['s']['user']['typ'] != 'admin') {
//* Set the admin as recipient
$this->dataRecord['recipient_id'] = 1;
}
//* Set the sender_id field to the ID of the current user
$this->dataRecord['sender_id'] = $_SESSION['s']['user']['userid'];
//* Get recipient email address
if ($this->dataRecord['recipient_id'] > 1) {
$sql = "SELECT client.email FROM sys_user, client WHERE sys_user.userid = " . $app->functions->intval($this->dataRecord['recipient_id']) . " AND sys_user.client_id = client.client_id";
$client = $app->db->queryOneRecord($sql);
$recipient_email = $client['email'];
} else {
$app->uses('ini_parser,getconf');
$system_config_mail_settings = $app->getconf->get_global_config('mail');
$recipient_email = $system_config_mail_settings['admin_mail'];
}
//* Get sender email address
if ($this->dataRecord['sender_id'] > 1) {
$sql = "SELECT client.email FROM sys_user, client WHERE sys_user.userid = " . $app->functions->intval($this->dataRecord['sender_id']) . " AND sys_user.client_id = client.client_id";
$client = $app->db->queryOneRecord($sql);
$sender_email = $client['email'];
} else {
$app->uses('ini_parser,getconf');
$system_config_mail_settings = $app->getconf->get_global_config('mail');
$sender_email = $system_config_mail_settings['admin_mail'];
}
$email_regex = '/^(\\w+[\\w\\.\\-\\+]*\\w{0,}@\\w+[\\w.-]*\\.[a-z\\-]{2,10}){0,1}$/i';
if (preg_match($email_regex, $sender_email, $match) && preg_match($email_regex, $recipient_email, $match)) {
$subject = $app->tform->lng('support_request_subject_txt') . ': ' . $this->dataRecord['subject'];
if ($this->dataRecord['recipient_id'] == 1) {
$message = $app->tform->lng('support_request_txt');
} else {
$message = $app->tform->lng('answer_to_support_request_txt');
}
$message .= "\n\n" . $app->tform->lng('message_txt') . ": \"" . $this->dataRecord['message'] . "\"";
$message .= "\n\nISPConfig: " . ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
$app->functions->mail($recipient_email, $subject, $message, $sender_email);
//* Send confirmation email to sender
if ($this->dataRecord['sender_id'] == 1) {
$confirmation_message = $app->tform->lng('answer_to_support_request_sent_txt');
} else {
$confirmation_message = $app->tform->lng('support_request_sent_txt');
}
$confirmation_message .= "\n\n" . $app->tform->lng('message_txt') . ": \"" . $this->dataRecord['message'] . "\"";
$confirmation_message .= "\n\nISPConfig: " . ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
$app->functions->mail($sender_email, $subject, $confirmation_message, $recipient_email);
} else {
$app->tform->errorMessage .= $app->tform->lng("recipient_or_sender_email_address_not_valid_txt") . "<br />";
}
//* call the onSubmit function of the parent class
parent::onSubmit();
}
示例6: onSubmit
function onSubmit()
{
$this->id = $_SESSION['s']['user']['mailuser_id'];
//* if autoresponder checkbox not selected, do not save dates
if (!isset($_POST['autoresponder']) && array_key_exists('autoresponder_start_date', $_POST)) {
$this->dataRecord['autoresponder_start_date'] = array_map(create_function('$item', 'return 0;'), $this->dataRecord['autoresponder_start_date']);
$this->dataRecord['autoresponder_end_date'] = array_map(create_function('$item', 'return 0;'), $this->dataRecord['autoresponder_end_date']);
}
parent::onSubmit();
}
示例7: onSubmit
function onSubmit()
{
global $app;
$this->id = $_SESSION['s']['user']['mailuser_id'];
$rec = $app->tform->getDataRecord($this->id);
if (isset($_POST['cc']) && trim($_POST['cc']) == $rec['email']) {
$app->tform->errorMessage .= $app->tform->lng('email_is_cc_error');
}
parent::onSubmit();
}
示例8: onSubmit
function onSubmit()
{
global $app;
//* Resellers shall not be able to create another reseller or set reseller specific settings
if ($_SESSION["s"]["user"]["typ"] == 'user') {
$this->dataRecord['limit_client'] = 0;
$this->dataRecord['limit_domainmodule'] = 0;
}
parent::onSubmit();
}
示例9: onSubmit
function onSubmit()
{
global $app, $conf;
//* If the current user is not the admin user
if ($_SESSION['s']['user']['typ'] != 'admin') {
//* Set the admin as recipient
$this->dataRecord['recipient_id'] = 1;
}
//* Set the sender_id field to the ID of the current user
$this->dataRecord['sender_id'] = $_SESSION['s']['user']['userid'];
//* call the onSubmit function of the parent class
parent::onSubmit();
}
示例10: onSubmit
function onSubmit()
{
global $app, $conf;
// Get the record of the parent domain
$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = " . intval(@$this->dataRecord["parent_domain_id"]));
// Set a few fixed values
$this->dataRecord["type"] = 'subdomain';
$this->dataRecord["server_id"] = $parent_domain["server_id"];
$this->dataRecord["domain"] = $this->dataRecord["domain"] . '.' . $parent_domain["domain"];
$this->parent_domain_record = $parent_domain;
//* make sure that the email domain is lowercase
if (isset($this->dataRecord["domain"])) {
$this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
}
parent::onSubmit();
}
示例11: onSubmit
function onSubmit()
{
global $app, $conf;
// Check for duplicates
if ($this->dataRecord['template_type'] == 'welcome') {
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$sql = "SELECT count(client_message_template_id) as number FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = " . $client_group_id;
if ($this->id > 0) {
$sql .= " AND client_message_template_id != " . $this->id;
}
$tmp = $app->db->queryOneRecord($sql);
if ($tmp['number'] > 0) {
$app->tform->errorMessage .= $app->tform->lng('duplicate_welcome_error');
}
}
parent::onSubmit();
}
示例12: onSubmit
function onSubmit()
{
global $app;
$app->uses('ini_parser,getconf');
$section = $app->tform->getCurrentTab();
$server_config_array = $app->getconf->get_global_config();
$new_config = $app->tform->encode($this->dataRecord, $section);
if ($section == 'mail') {
if ($new_config['smtp_pass'] == '') {
$new_config['smtp_pass'] = $server_config_array['smtp_pass'];
}
if ($new_config['smtp_enabled'] == 'y' && ($new_config['admin_mail'] == '' || $new_config['admin_name'] == '')) {
$app->tform->errorMessage .= $app->tform->lng("smtp_missing_admin_mail_txt");
}
}
parent::onSubmit();
}
示例13: onSubmit
function onSubmit()
{
global $app, $conf;
// we will check only users, not admins
if ($_SESSION["s"]["user"]["typ"] == 'user' && $this->id == 0) {
// Get the limits of the client
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT limit_client 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 website.
if ($client["limit_client"] >= 0) {
$tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = {$client_group_id}");
if ($tmp["number"] >= $client["limit_client"]) {
$app->error($app->tform->wordbook["limit_client_txt"]);
}
}
}
parent::onSubmit();
}
示例14: onSubmit
function onSubmit()
{
global $app, $conf;
// Get the record of the parent domain
$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = " . $app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND " . $app->tform->getAuthSQL('r'));
if (!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) {
$app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
}
// Set a few fixed values
$this->dataRecord["server_id"] = $parent_domain["server_id"];
// make sure this folder isn't protected already
if ($this->id > 0) {
$folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE parent_domain_id = " . $this->dataRecord['parent_domain_id'] . " AND path = '" . $this->dataRecord['path'] . "' AND web_folder_id != " . $this->id);
} else {
$folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE parent_domain_id = " . $this->dataRecord['parent_domain_id'] . " AND path = '" . $this->dataRecord['path'] . "'");
}
if (is_array($folder) && !empty($folder)) {
$app->tform->errorMessage .= $app->tform->lng('error_folder_already_protected_txt');
}
parent::onSubmit();
}
示例15: onSubmit
function onSubmit()
{
global $app, $conf;
// Check the client limits, if user is not the admin
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
// if user is not admin
// Get the limits of the client
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$client = $app->db->queryOneRecord("SELECT limit_spamfilter_policy 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.
if ($this->id == 0 && $client["limit_spamfilter_policy"] >= 0) {
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM spamfilter_policy WHERE sys_groupid = {$client_group_id}");
if ($tmp["number"] >= $client["limit_spamfilter_policy"]) {
$app->tform->errorMessage .= $app->tform->wordbook["limit_spamfilter_policy_txt"] . "<br>";
}
unset($tmp);
}
}
// end if user is not admin
parent::onSubmit();
}