Example #1
0
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
******************************************************************************/
if (isset($_POST['submit'])) {
    if (!empty($_POST['dnsname'])) {
        $smarty->assign('if_error_postmaster', false);
        if (domain_exist($_POST['dnsname'], $db)) {
            $smarty->assign('error_msg', 'y');
            $smarty->assign('if_error_domain_exits', 'y');
            $smarty->assign('dnsname', $_POST['dnsname']);
        } elseif (!domain_valid($_POST['dnsname'])) {
            $smarty->assign('error_msg', 'y');
            $smarty->assign('if_error_domain_wrong', 'y');
        } else {
            if (isset($_POST['max_email']) && is_numeric($_POST['max_email'])) {
                $max_email = $_POST['max_email'];
            } else {
                $max_email = 0;
            }
            if (isset($_POST['max_forward']) && is_numeric($_POST['max_forward'])) {
                $max_forward = $_POST['max_forward'];
            } else {
     $tDescription = escape_string($_POST['fDescription']);
     $tAliases = escape_string($_POST['fAliases']);
     $tMailboxes = escape_string($_POST['fMailboxes']);
     if (isset($_POST['fMaxquota'])) {
         $tMaxquota = escape_string($_POST['fMaxquota']);
     }
     if (isset($_POST['fTransport'])) {
         $tTransport = escape_string($_POST['fTransport']);
     }
     if (isset($_POST['fDefaultaliases'])) {
         $tDefaultaliases = escape_string($_POST['fDefaultaliases']);
     }
     if (isset($_POST['fBackupmx'])) {
         $tBackupmx = escape_string($_POST['fBackupmx']);
     }
     if (domain_exist($fDomain)) {
         $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error'];
     }
     if (empty($fDomain) or !check_domain($fDomain)) {
         $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error2'];
     }
 }
 if ($error != 1) {
     $tAliases = $CONF['aliases'];
     $tMailboxes = $CONF['mailboxes'];
     $tMaxquota = $CONF['maxquota'];
     if ($fBackupmx == "on") {
         $fAliases = -1;
         $fMailboxes = -1;
         $fMaxquota = -1;
         $fBackupmx = 1;