root/trunk/includes/pages/hostmaster/hostmaster_dnsnameserver.php @ 1

Revision 1, 2.1 kB (checked in by Winner, 5 years ago)

Initial import

Line 
1<?php
2/*
3 * WiND - Wireless Nodes Database
4 *
5 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 dated June, 1991.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 *
20 */
21
22class hostmaster_dnsnameserver {
23
24        var $tpl;
25       
26        function hostmaster_dnsnameserver() {
27               
28        }
29       
30        function form_nameserver() {
31                global $db, $vars;
32                $form_nameserver = new form(array('FORM_NAME' => 'form_nameserver'));
33                $form_nameserver->db_data('dns_nameservers.name, dns_nameservers.ip, dns_nameservers.status');
34                $form_nameserver->db_data_values("dns_nameservers", "id", get('nameserver'));
35                $form_nameserver->data[1]['value'] = long2ip($form_nameserver->data[1]['value']);
36                return $form_nameserver;
37        }
38       
39        function output() {
40                if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name']));
41                global $construct;
42                $this->tpl['form_nameserver'] = $construct->form($this->form_nameserver(), __FILE__);
43                return template($this->tpl, __FILE__);
44        }
45
46        function output_onpost_form_nameserver() {
47                global $construct, $main, $db;
48                $form_nameserver = $this->form_nameserver();
49                $_POST['dns_nameservers__ip'] = ip2long($_POST['dns_nameservers__ip']);
50                $ret = $form_nameserver->db_set(array(),
51                                                        "dns_nameservers", "id", get('nameserver'));
52               
53                if ($ret) {
54                        $main->message->set_fromlang('info', 'edit_success', makelink("", TRUE));
55                } else {
56                        $main->message->set_fromlang('error', 'generic');               
57                }
58        }
59
60}
61
62?>
Note: See TracBrowser for help on using the browser.