From 35ccdef6c75424ff0782cd873bb0fe7ec03536b5 Mon Sep 17 00:00:00 2001 From: ftimme <ft@falkotimme.com> Date: Wed, 13 Mar 2013 16:46:40 -0400 Subject: [PATCH] - Fixed FS#2736 - entering multiple DNS MX records outputs errors... --- interface/lib/classes/listform_actions.inc.php | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php index 8b99abd..8296560 100644 --- a/interface/lib/classes/listform_actions.inc.php +++ b/interface/lib/classes/listform_actions.inc.php @@ -33,8 +33,9 @@ private $id; public $idx_key; public $DataRowColor; - public $SQLExtWhere = ''; - public $SQLOrderBy = ''; + public $SQLExtWhere = ''; + public $SQLOrderBy = ''; + public $SQLExtSelect = ''; public function onLoad() { @@ -141,13 +142,14 @@ if($_SESSION['s']['user']['typ'] == "admin") { $sql_where = ''; } else { - $sql_where = $app->tform->getAuthSQL('r').' and'; + $sql_where = $app->tform->getAuthSQL('r', $app->listform->listDef['table']).' and'; + //$sql_where = $app->tform->getAuthSQL('r').' and'; } } if($this->SQLExtWhere != '') { $sql_where .= ' '.$this->SQLExtWhere.' and'; } - + $sql_where = $app->listform->getSearchSQL($sql_where); $app->tpl->setVar($app->listform->searchValues); @@ -248,6 +250,12 @@ $order_by_sql = "GROUP BY mailuser_id ".$order_by_sql; } } + + if($this->SQLExtSelect != '') { + if(substr($this->SQLExtSelect,0,1) != ',') $this->SQLExtSelect = ','.$this->SQLExtSelect; + $extselect .= $this->SQLExtSelect; + } + return 'SELECT '.$app->listform->listDef['table'].'.*'.$extselect.' FROM '.$app->listform->listDef['table']."$join WHERE $sql_where $order_by_sql $limit_sql"; } @@ -278,11 +286,20 @@ $app->tpl->setVar($app->listform->wordbook); $app->tpl->setVar('form_action', $app->listform->listDef['file']); + if(isset($_SESSION['show_info_msg'])) { + $app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']); + unset($_SESSION['show_info_msg']); + } + if(isset($_SESSION['show_error_msg'])) { + $app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']); + unset($_SESSION['show_error_msg']); + } + //* Parse the templates and send output to the browser $this->onShowEnd(); } - private function onShowEnd() + public function onShowEnd() { global $app; $app->tpl_defaults(); -- Gitblit v1.9.1