本文整理汇总了PHP中tform_actions类的典型用法代码示例。如果您正苦于以下问题:PHP tform_actions类的具体用法?PHP tform_actions怎么用?PHP tform_actions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了tform_actions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onShowEnd
function onShowEnd()
{
global $app, $conf;
$rec = $app->tform->getDataRecord($_SESSION['s']['user']['mailuser_id']);
$app->tpl->setVar("email", $rec['email']);
parent::onShowEnd();
}
示例2: 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();
}
示例3: onShowEnd
function onShowEnd()
{
global $app, $conf;
$rec = $app->tform->getDataRecord($this->id);
$app->tpl->setVar("email", $rec['email']);
parent::onShowEnd();
}
示例4: onShow
function onShow()
{
global $app;
// Translate the items, very bad trick... :( because the language file is not loaded yet when the form file gets parsed
foreach ($app->tform->formDef["tabs"]['remote_user']['fields']['remote_functions']['value'] as $key => $val) {
$app->tform->formDef["tabs"]['remote_user']['fields']['remote_functions']['value'][$key] = $app->tform->lng($val) . '<br>';
}
parent::onShow();
}
示例5: 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();
}
示例6: 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();
}
示例7: 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();
}
示例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: onShowEnd
function onShowEnd()
{
global $app;
// Is autoresponder set?
if ($this->dataRecord['autoresponder'] == 'y') {
$app->tpl->setVar("ar_active", 'checked="checked"');
} else {
$app->tpl->setVar("ar_active", '');
}
parent::onShowEnd();
}
示例10: onShow
function onShow()
{
global $app, $conf;
//* We do not want that messages get edited, so we switch to a
//* read only template if a existing message is loaded
if ($this->id > 0) {
$app->tform->formDef['tabs']['message']['template'] = 'templates/support_message_view.htm';
}
//* call the onShow function of the parent class
parent::onShow();
}
示例11: onDelete
function onDelete()
{
global $app, $conf, $list_def_file, $tform_def_file;
// Loading tform framework
if (!is_object($app->tform)) {
$app->uses('tform');
}
if ($_POST["confirm"] == 'yes') {
parent::onDelete();
} else {
$app->uses('tpl');
$app->tpl->newTemplate("form.tpl.htm");
$app->tpl->setInclude('content_tpl', 'templates/client_del.htm');
include_once $list_def_file;
// Load table definition from file
$app->tform->loadFormDef($tform_def_file);
$this->id = $app->functions->intval($_REQUEST["id"]);
$this->dataRecord = $app->tform->getDataRecord($this->id);
$client_id = $app->functions->intval($this->dataRecord['client_id']);
//$parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']);
//$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id");
$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = {$client_id}");
// Get all records (sub-clients, mail, web, etc....) of this client.
$tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain';
$tables_array = explode(',', $tables);
$client_group_id = $app->functions->intval($client_group['groupid']);
$table_list = array();
if ($client_group_id > 1) {
foreach ($tables_array as $table) {
if ($table != '') {
$records = $app->db->queryAllRecords("SELECT * FROM {$table} WHERE sys_groupid = " . $client_group_id);
$number = count($records);
if ($number > 0) {
$table_list[] = array('table' => $table . "(" . $number . ")");
}
}
}
}
$app->tpl->setVar('id', $this->id);
$app->tpl->setVar('number_records', $number);
$app->tpl->setLoop('records', $table_list);
//* load language file
$lng_file = 'lib/lang/' . $_SESSION['s']['language'] . '_client_del.lng';
include $lng_file;
$app->tpl->setVar($wb);
$app->tpl_defaults();
$app->tpl->pparse();
}
}
示例12: 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();
}
示例13: 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();
}
示例14: onSubmit
function onSubmit()
{
global $app, $conf;
// Get the record of the parent domain
$folder = $app->db->queryOneRecord("select * FROM web_folder WHERE web_folder_id = " . $app->functions->intval(@$this->dataRecord["web_folder_id"]) . " AND " . $app->tform->getAuthSQL('r'));
if (!$folder || $folder['web_folder_id'] != @$this->dataRecord['web_folder_id']) {
$app->tform->errorMessage .= $app->tform->lng("no_folder_perm");
}
// Set a few fixed values
$this->dataRecord["server_id"] = $folder["server_id"];
// make sure this folder/user combination does not exist already
if ($this->id > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM web_folder_user WHERE web_folder_id = " . $this->dataRecord['web_folder_id'] . " AND username = '" . $this->dataRecord['username'] . "' AND web_folder_user_id != " . $this->id);
} else {
$user = $app->db->queryOneRecord("SELECT * FROM web_folder_user WHERE web_folder_id = " . $this->dataRecord['web_folder_id'] . " AND username = '" . $this->dataRecord['username'] . "'");
}
if (is_array($user) && !empty($user)) {
$app->tform->errorMessage .= $app->tform->lng('error_user_exists_already_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();
}