Commit 336a577f authored by tbrehm's avatar tbrehm

Added Server table

parent aa513707
......@@ -136,9 +136,11 @@ class app {
}
function tpl_defaults() {
global $conf;
$this->tpl->setVar('theme',$_SESSION["s"]["theme"]);
$this->tpl->setVar('phpsessid',session_id());
$this->tpl->setVar('html_content_encoding',$conf["html_content_encoding"]);
}
......
......@@ -153,7 +153,7 @@ class tform_tpl_generator {
// ansonsten wird sie angelegt
$tables = $app->db->getTables();
if(!in_array($formDef['db_table'],$tables)) {
if(!@in_array($formDef['db_table'],$tables)) {
// Datenbank noch nicht vorhanden
$columns = array();
......@@ -172,6 +172,52 @@ class tform_tpl_generator {
$columns[] = $col;
$app->db->show_error_messages = true;
if($formDef["auth"] == 'yes') {
$col = array( 'action' => 'add',
'name' => 'sys_userid',
'type' => 'int32',
'typeValue' => '',
'defaultValue' => '',
'notNull' => true
);
$columns[] = $col;
$col = array( 'action' => 'add',
'name' => 'sys_groupid',
'type' => 'int32',
'typeValue' => '',
'defaultValue' => '',
'notNull' => true
);
$columns[] = $col;
$col = array( 'action' => 'add',
'name' => 'sys_perm_user',
'type' => 'varchar',
'typeValue' => '5',
'defaultValue' => '',
'notNull' => true
);
$columns[] = $col;
$col = array( 'action' => 'add',
'name' => 'sys_perm_group',
'type' => 'varchar',
'typeValue' => '5',
'defaultValue' => '',
'notNull' => true
);
$columns[] = $col;
$col = array( 'action' => 'add',
'name' => 'sys_perm_other',
'type' => 'varchar',
'typeValue' => '5',
'defaultValue' => '',
'notNull' => true
);
$columns[] = $col;
}
foreach($formDef['tabs'] as $tab) {
foreach($tab["fields"] as $name => $field) {
/*
......
......@@ -62,7 +62,8 @@ $conf["programs"]["wput"] = $conf["rootpath"]."\\tools\\wput\\wput.exe";
Themes
*/
$conf["theme"] = 'default';
$conf["theme"] = 'default';
$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
/*
Default Language
......
......@@ -3,151 +3,12 @@
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Erstellungszeit: 18. Oktober 2005 um 16:00
# Server Version: 4.0.22
# PHP-Version: 5.0.2
# Erstellungszeit: 01. November 2005 um 23:57
# Server Version: 4.0.23
# PHP-Version: 5.0.3
# Datenbank: `ispconfig3`
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_datalog`
#
DROP TABLE IF EXISTS sys_datalog;
CREATE TABLE sys_datalog (
datalog_id bigint(20) NOT NULL auto_increment,
dbtable varchar(255) NOT NULL default '',
dbidx varchar(255) NOT NULL default '',
action char(1) NOT NULL default '',
tstamp bigint(20) NOT NULL default '0',
user varchar(255) NOT NULL default '',
data text NOT NULL,
PRIMARY KEY (datalog_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_datalog`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_dbsync`
#
DROP TABLE IF EXISTS sys_dbsync;
CREATE TABLE sys_dbsync (
id bigint(20) NOT NULL auto_increment,
jobname varchar(255) NOT NULL default '',
sync_interval_minutes int(11) NOT NULL default '0',
db_type varchar(255) NOT NULL default '',
db_host varchar(255) NOT NULL default '',
db_name varchar(255) NOT NULL default '',
db_username varchar(255) NOT NULL default '',
db_password varchar(255) NOT NULL default '',
db_tables varchar(255) NOT NULL default 'admin,forms',
empty_datalog int(11) NOT NULL default '0',
sync_datalog_external int(11) NOT NULL default '0',
active int(11) NOT NULL default '1',
last_datalog_id bigint(20) NOT NULL default '0',
PRIMARY KEY (id),
KEY last_datalog_id (last_datalog_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_dbsync`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_filesync`
#
DROP TABLE IF EXISTS sys_filesync;
CREATE TABLE sys_filesync (
id bigint(20) NOT NULL auto_increment,
jobname varchar(255) NOT NULL default '',
sync_interval_minutes int(11) NOT NULL default '0',
ftp_host varchar(255) NOT NULL default '',
ftp_path varchar(255) NOT NULL default '',
ftp_username varchar(255) NOT NULL default '',
ftp_password varchar(255) NOT NULL default '',
local_path varchar(255) NOT NULL default '',
wput_options varchar(255) NOT NULL default '--timestamping --reupload --dont-continue',
active int(11) NOT NULL default '1',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_filesync`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_group`
#
DROP TABLE IF EXISTS sys_group;
CREATE TABLE sys_group (
groupid int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description text NOT NULL,
PRIMARY KEY (groupid)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_group`
#
INSERT INTO sys_group VALUES (1, 'admin', 'Administrators group');
INSERT INTO sys_group VALUES (2, 'user', 'Users Group');
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_user`
#
DROP TABLE IF EXISTS sys_user;
CREATE TABLE sys_user (
userid int(11) NOT NULL auto_increment,
sys_userid int(11) NOT NULL default '0',
sys_groupid int(11) NOT NULL default '0',
sys_perm_user varchar(5) NOT NULL default '',
sys_perm_group varchar(5) NOT NULL default '',
sys_perm_other varchar(5) NOT NULL default '',
username varchar(100) NOT NULL default '',
passwort varchar(100) NOT NULL default '',
modules varchar(255) NOT NULL default '',
startmodule varchar(255) NOT NULL default '',
app_theme varchar(100) NOT NULL default 'default',
typ varchar(20) NOT NULL default 'user',
active tinyint(4) NOT NULL default '1',
name varchar(100) NOT NULL default '',
vorname varchar(100) NOT NULL default '',
unternehmen varchar(100) NOT NULL default '',
strasse varchar(100) NOT NULL default '',
ort varchar(100) NOT NULL default '',
plz varchar(10) NOT NULL default '',
land varchar(50) NOT NULL default '',
email varchar(100) NOT NULL default '',
url varchar(255) NOT NULL default '',
telefon varchar(100) NOT NULL default '',
fax varchar(100) NOT NULL default '',
language varchar(10) NOT NULL default 'de',
groups varchar(255) NOT NULL default '',
default_group int(11) NOT NULL default '0',
PRIMARY KEY (userid)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_user`
#
INSERT INTO sys_user VALUES (1, 1, 0, 'riud', 'riud', '', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin,clients,designer,resellers,sites', 'admin', 'default', 'admin', 1, '', 'Administrator', '', '', '', '', '', '', '', '', '', 'en', '1,2', 0);
#
# Tabellenstruktur fr Tabelle `mail_blacklist`
#
......@@ -160,6 +21,11 @@ CREATE TABLE mail_blacklist (
PRIMARY KEY (blacklist_id),
KEY server_id (server_id,address)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_blacklist`
#
# --------------------------------------------------------
#
......@@ -176,6 +42,11 @@ CREATE TABLE mail_domain (
PRIMARY KEY (domain_id),
KEY server_id (server_id,domain,type)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_domain`
#
# --------------------------------------------------------
#
......@@ -191,6 +62,11 @@ CREATE TABLE mail_domain_alias (
PRIMARY KEY (domain_alias_id),
KEY server_id (server_id,domain)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_domain_alias`
#
# --------------------------------------------------------
#
......@@ -206,6 +82,11 @@ CREATE TABLE mail_domain_catchall (
PRIMARY KEY (virtual_default_id),
KEY server_id (server_id,domain)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_domain_catchall`
#
# --------------------------------------------------------
#
......@@ -236,6 +117,11 @@ CREATE TABLE mail_email (
PRIMARY KEY (mailbox_id),
KEY server_id (server_id,email)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_email`
#
# --------------------------------------------------------
#
......@@ -253,6 +139,11 @@ CREATE TABLE mail_greylist (
create_time datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (greylist_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_greylist`
#
# --------------------------------------------------------
#
......@@ -270,6 +161,11 @@ CREATE TABLE mail_mailman_domain (
mm_group varchar(50) NOT NULL default '',
PRIMARY KEY (mailman_id,server_id,domain)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_mailman_domain`
#
# --------------------------------------------------------
#
......@@ -285,10 +181,17 @@ CREATE TABLE mail_whitelist (
KEY server_id (server_id,address)
) TYPE=MyISAM;
#
# Daten fr Tabelle `mail_whitelist`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `reseller`
#
DROP TABLE IF EXISTS reseller;
CREATE TABLE reseller (
reseller_id bigint(20) NOT NULL auto_increment,
sys_userid int(11) NOT NULL default '0',
......@@ -322,4 +225,179 @@ CREATE TABLE reseller (
ip_address text NOT NULL,
PRIMARY KEY (reseller_id)
) TYPE=MyISAM;
# --------------------------------------------------------
\ No newline at end of file
#
# Daten fr Tabelle `reseller`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `server`
#
DROP TABLE IF EXISTS server;
CREATE TABLE server (
server_id bigint(20) NOT NULL auto_increment,
sys_userid int(11) NOT NULL default '0',
sys_groupid int(11) NOT NULL default '0',
sys_perm_user varchar(5) NOT NULL default '',
sys_perm_group varchar(5) NOT NULL default '',
sys_perm_other varchar(5) NOT NULL default '',
server_name varchar(255) NOT NULL default '',
mail_server int(11) NOT NULL default '0',
web_server int(11) NOT NULL default '0',
dns_server int(11) NOT NULL default '0',
file_server int(11) NOT NULL default '0',
mysql_server int(11) NOT NULL default '0',
postgresql_server int(11) NOT NULL default '0',
firebird_server int(11) NOT NULL default '0',
active int(11) NOT NULL default '1',
PRIMARY KEY (server_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `server`
#
INSERT INTO server VALUES (1, 1, 1, 'riud', 'riud', '', 'Server 1', 1, 0, 0, 0, 0, 0, 0, 1);
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_datalog`
#
DROP TABLE IF EXISTS sys_datalog;
CREATE TABLE sys_datalog (
datalog_id bigint(20) NOT NULL auto_increment,
dbtable varchar(255) NOT NULL default '',
dbidx varchar(255) NOT NULL default '',
action char(1) NOT NULL default '',
tstamp bigint(20) NOT NULL default '0',
user varchar(255) NOT NULL default '',
data text NOT NULL,
PRIMARY KEY (datalog_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_datalog`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_dbsync`
#
DROP TABLE IF EXISTS sys_dbsync;
CREATE TABLE sys_dbsync (
id bigint(20) NOT NULL auto_increment,
jobname varchar(255) NOT NULL default '',
sync_interval_minutes int(11) NOT NULL default '0',
db_type varchar(255) NOT NULL default '',
db_host varchar(255) NOT NULL default '',
db_name varchar(255) NOT NULL default '',
db_username varchar(255) NOT NULL default '',
db_password varchar(255) NOT NULL default '',
db_tables varchar(255) NOT NULL default 'admin,forms',
empty_datalog int(11) NOT NULL default '0',
sync_datalog_external int(11) NOT NULL default '0',
active int(11) NOT NULL default '1',
last_datalog_id bigint(20) NOT NULL default '0',
PRIMARY KEY (id),
KEY last_datalog_id (last_datalog_id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_dbsync`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_filesync`
#
DROP TABLE IF EXISTS sys_filesync;
CREATE TABLE sys_filesync (
id bigint(20) NOT NULL auto_increment,
jobname varchar(255) NOT NULL default '',
sync_interval_minutes int(11) NOT NULL default '0',
ftp_host varchar(255) NOT NULL default '',
ftp_path varchar(255) NOT NULL default '',
ftp_username varchar(255) NOT NULL default '',
ftp_password varchar(255) NOT NULL default '',
local_path varchar(255) NOT NULL default '',
wput_options varchar(255) NOT NULL default '--timestamping --reupload --dont-continue',
active int(11) NOT NULL default '1',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_filesync`
#
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_group`
#
DROP TABLE IF EXISTS sys_group;
CREATE TABLE sys_group (
groupid int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description text NOT NULL,
PRIMARY KEY (groupid)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_group`
#
INSERT INTO sys_group VALUES (1, 'admin', 'Administrators group');
INSERT INTO sys_group VALUES (2, 'user', 'Users Group');
# --------------------------------------------------------
#
# Tabellenstruktur fr Tabelle `sys_user`
#
DROP TABLE IF EXISTS sys_user;
CREATE TABLE sys_user (
userid int(11) NOT NULL auto_increment,
sys_userid int(11) NOT NULL default '0',
sys_groupid int(11) NOT NULL default '0',
sys_perm_user varchar(5) NOT NULL default '',
sys_perm_group varchar(5) NOT NULL default '',
sys_perm_other varchar(5) NOT NULL default '',
username varchar(100) NOT NULL default '',
passwort varchar(100) NOT NULL default '',
modules varchar(255) NOT NULL default '',
startmodule varchar(255) NOT NULL default '',
app_theme varchar(100) NOT NULL default 'default',
typ varchar(20) NOT NULL default 'user',
active tinyint(4) NOT NULL default '1',
name varchar(100) NOT NULL default '',
vorname varchar(100) NOT NULL default '',
unternehmen varchar(100) NOT NULL default '',
strasse varchar(100) NOT NULL default '',
ort varchar(100) NOT NULL default '',
plz varchar(10) NOT NULL default '',
land varchar(50) NOT NULL default '',
email varchar(100) NOT NULL default '',
url varchar(255) NOT NULL default '',
telefon varchar(100) NOT NULL default '',
fax varchar(100) NOT NULL default '',
language varchar(10) NOT NULL default 'de',
groups varchar(255) NOT NULL default '',
default_group int(11) NOT NULL default '0',
PRIMARY KEY (userid)
) TYPE=MyISAM;
#
# Daten fr Tabelle `sys_user`
#
INSERT INTO sys_user VALUES (1, 1, 0, 'riud', 'riud', '', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin,clients,designer,resellers,sites', 'admin', 'default', 'admin', 1, '', 'Administrator', '', '', '', '', '', '', '', '', '', 'en', '1,2', 0);
<?php
/*
Form Definition
Tabledefinition
Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)
Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE
VALUE:
- Wert oder Array
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
*/
$form["title"] = "Server";
$form["description"] = "";
$form["name"] = "server";
$form["action"] = "server_edit.php";
$form["db_table"] = "server";
$form["db_table_idx"] = "server_id";
$form["db_history"] = "no";
$form["tab_default"] = "services";
$form["list_default"] = "server_list.php";
$form["auth"] = 'yes';
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 1; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['services'] = array (
'title' => "Services",
'width' => 100,
'template' => "templates/server_edit_services.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'server_name' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'mail_server' => array (
'datatype' => 'INTEGER',
'formtype' => 'CHECKBOX',
'default' => '0',
'value' => '1'
),
'web_server' => array (
'datatype' => 'INTEGER',
'formtype' => 'CHECKBOX',
'default' => '0',
'value' => '1'
),
'dns_server' => array (
'datatype' => 'INTEGER',
'formtype' => 'CHECKBOX',
'default' => '0',
'value' => '1'
),
'file_server' => array (
'datatype' => 'INTEGER',