Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
commit | author | age
18341e 1 <?php
T 2
3 /*
4 Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9
10     * Redistributions of source code must retain the above copyright notice,
11       this list of conditions and the following disclaimer.
12     * Redistributions in binary form must reproduce the above copyright notice,
13       this list of conditions and the following disclaimer in the documentation
14       and/or other materials provided with the distribution.
15     * Neither the name of ISPConfig nor the names of its contributors
16       may be used to endorse or promote products derived from this software without
17       specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 /*
32     Form Definition
33
34     Tabellendefinition
35
36     Datentypen:
a9d0b2 37     - INTEGER (Wandelt Ausdrücke in Int um)
18341e 38     - DOUBLE
a9d0b2 39     - CURRENCY (Formatiert Zahlen nach Währungsnotation)
18341e 40     - VARCHAR (kein weiterer Format Check)
T 41     - TEXT (kein weiterer Format Check)
42     - DATE (Datumsformat, Timestamp Umwandlung)
43
44     Formtype:
45     - TEXT (normales Textfeld)
46     - TEXTAREA (normales Textfeld)
47     - PASSWORD (Feldinhalt wird nicht angezeigt)
48     - SELECT (Gibt Werte als option Feld aus)
49     - RADIO
50     - CHECKBOX
51     - FILE
52
53     VALUE:
54     - Wert oder Array
55
56     Hinweis:
a9d0b2 57     Das ID-Feld ist nicht bei den Table Values einzufügen.
b1a6a5 58
77dbe5 59     Search:
F 60     - searchable = 1 or searchable = 2 include the field in the search
61     - searchable = 1: this field will be the title of the search result
62     - searchable = 2: this field will be included in the description of the search result
18341e 63
T 64
65 */
66
b1a6a5 67 $form["title"]    = "IP Addresses";
MC 68 $form["description"]  = "Form to edit system IP Addresses";
69 $form["name"]    = "server_ip";
70 $form["action"]   = "server_ip_edit.php";
71 $form["db_table"]  = "server_ip";
72 $form["db_table_idx"] = "server_ip_id";
73 $form["db_history"]  = "yes";
74 $form["tab_default"] = "server_ip";
75 $form["list_default"] = "server_ip_list.php";
76 $form["auth"]   = 'yes';
18341e 77
T 78 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
79 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
80 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
81 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
82 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
83
84 $form["tabs"]['server_ip'] = array (
b1a6a5 85     'title'  => "IP Address",
MC 86     'width'  => 80,
87     'template'  => "templates/server_ip_edit.htm",
88     'fields'  => array (
89         //#################################
90         // Beginn Datenbankfelder
91         //#################################
18341e 92         'server_id' => array (
b1a6a5 93             'datatype' => 'INTEGER',
MC 94             'formtype' => 'SELECT',
95             'default' => '',
96             'datasource' => array (  'type' => 'SQL',
97                 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
98                 'keyfield'=> 'server_id',
99                 'valuefield'=> 'server_name'
100             ),
101             'value'  => ''
18341e 102         ),
a70698 103         'client_id' => array (
b1a6a5 104             'datatype' => 'INTEGER',
MC 105             'formtype' => 'SELECT',
106             'default' => '',
107             'datasource' => array (  'type' => 'SQL',
7ba2f5 108                 'querystring' => "(SELECT 0 AS client_id, '' AS name) UNION ALL (SELECT client_id,CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as name FROM client WHERE {AUTHSQL} ORDER BY contact_name)",
b1a6a5 109                 'keyfield'=> 'client_id',
MC 110                 'valuefield'=> 'name'
111             ),
112             'value'  => array(0 => ' ')
a70698 113         ),
T 114         'ip_type' => array (
b1a6a5 115             'datatype' => 'VARCHAR',
MC 116             'formtype' => 'SELECT',
117             'default' => '',
118             'value'  => array('IPv4' => 'IPv4', 'IPv6' => 'IPv6'),
77dbe5 119             'searchable' => 2
a70698 120         ),
18341e 121         'ip_address' => array (
b1a6a5 122             'datatype' => 'VARCHAR',
MC 123             'formtype' => 'TEXT',
7d6777 124             'validators' => array (  0 => array ( 'type' => 'CUSTOM', 'class' => 'validate_server', 'function' => 'check_server_ip',
b1a6a5 125                     'errmsg'=> 'ip_error_wrong'),
MC 126                 1 => array ( 'type' => 'UNIQUE',
127                     'errmsg'=> 'ip_error_unique'),
128             ),
129             'default' => '',
130             'value'  => '',
131             'separator' => '',
132             'width'  => '15',
133             'maxlength' => '15',
134             'rows'  => '',
135             'cols'  => '',
77dbe5 136             'searchable' => 1
18341e 137         ),
T 138         'virtualhost' => array (
b1a6a5 139             'datatype' => 'VARCHAR',
MC 140             'formtype' => 'CHECKBOX',
141             'default' => 'y',
142             'value'  => array(0 => 'n', 1 => 'y')
18341e 143         ),
a70698 144         'virtualhost_port' => array (
b1a6a5 145             'datatype' => 'VARCHAR',
MC 146             'formtype' => 'TEXT',
147             'validators' => array (  0 => array ( 'type' => 'REGEX',
148                     'regex' => '/^([0-9]{1,5}\,{0,1}){1,}$/i',
149                     'errmsg'=> 'error_port_syntax'),
150             ),
151             'default' => '80,443',
152             'value'  => '',
153             'separator' => '',
154             'width'  => '15',
155             'maxlength' => '15',
156             'rows'  => '',
157             'cols'  => ''
a70698 158         ),
b1a6a5 159         //#################################
MC 160         // ENDE Datenbankfelder
161         //#################################
18341e 162     )
T 163 );
b1a6a5 164 ?>