root / htdocs / class / Interface.php @ 56f4bdf250e42ed8152b1b76967d3e5249a9354b
View | Annotate | Download (1.8 KB)
| 1 | <?php
|
|---|---|
| 2 | |
| 3 | /***************************************************************************
|
| 4 | * |
| 5 | * Copyright (c) by Andreas Unterkircher, unki@netshadow.at |
| 6 | * All rights reserved |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | * |
| 22 | ***************************************************************************/ |
| 23 | |
| 24 | class Network_Interface extends MsObject { |
| 25 | |
| 26 | /**
|
| 27 | * Network_Interface constructor |
| 28 | * |
| 29 | * Initialize the Network_Interface class |
| 30 | */ |
| 31 | public function __construct($id = null) |
| 32 | {
|
| 33 | parent::__construct($id, Array( |
| 34 | 'table_name' => 'interfaces', |
| 35 | 'col_name' => 'if', |
| 36 | 'fields' => Array(
|
| 37 | 'if_idx' => 'integer', |
| 38 | 'if_name' => 'text', |
| 39 | 'if_speed' => 'text', |
| 40 | 'if_fallback_idx' => 'integer', |
| 41 | 'if_ifb' => 'text', |
| 42 | 'if_active' => 'text', |
| 43 | 'if_host_idx' => 'integer', |
| 44 | ), |
| 45 | )); |
| 46 | |
| 47 | if(!isset($id) || empty($id)) { |
| 48 | $this->if_active = 'Y'; |
| 49 | $this->if_fallback_idx = 0; |
| 50 | } |
| 51 | |
| 52 | } // __construct()
|
| 53 | |
| 54 | public function pre_save() |
| 55 | {
|
| 56 | global $ms;
|
| 57 | |
| 58 | $this->if_host_idx = $ms->get_current_host_profile();
|
| 59 | |
| 60 | } // pre_save()
|
| 61 | |
| 62 | } // class Network_Interface
|
| 63 | |
| 64 | ?> |
| 65 |