CREATE TABLE admin (
  passwort varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  emailbetreff varchar(255) DEFAULT '' NOT NULL,
  emailtext blob DEFAULT '' NOT NULL,
  emailadresse varchar(255) DEFAULT '' NOT NULL,
  emailname varchar(255) DEFAULT '' NOT NULL,
  mysqlshelluser varchar(25) DEFAULT '' NOT NULL,
  mysqlshellpasswort varchar(25) DEFAULT '' NOT NULL,
  mysqlshellhost varchar(255) DEFAULT '' NOT NULL,
  pop tinyint(4) DEFAULT '0' NOT NULL,
  email tinyint(4) DEFAULT '0' NOT NULL,
  ftp tinyint(4) DEFAULT '0' NOT NULL,
  subdomains tinyint(4) DEFAULT '0' NOT NULL,
  mysql tinyint(4) DEFAULT '0' NOT NULL,
  php tinyint(4) DEFAULT '1' NOT NULL,
  perl tinyint(4) DEFAULT '0' NOT NULL,
  modpython tinyint(4) DEFAULT '1' NOT NULL, -- if mod_python should be used
  ssi tinyint(4) DEFAULT '0' NOT NULL,
  cssl tinyint(4) DEFAULT '0' NOT NULL,
  frontpage tinyint(4) DEFAULT '0' NOT NULL,
  shell tinyint(4) DEFAULT '0' NOT NULL,
  statistik tinyint(4) DEFAULT '0' NOT NULL,
  pwschutz tinyint(4) DEFAULT '0' NOT NULL,
  fehlerseiten tinyint(4) DEFAULT '0' NOT NULL,
  webftp tinyint(4) DEFAULT '0' NOT NULL,
  webmail tinyint(4) DEFAULT '0' NOT NULL,
  phpmyadmin tinyint(4) DEFAULT '0' NOT NULL,
  phpmyadminpfad varchar(255) DEFAULT '' NOT NULL,
  lokaleips blob DEFAULT '' NOT NULL,
  minuid mediumint(9) DEFAULT '2000' NOT NULL,
  maxuid mediumint(9) DEFAULT '1999' NOT NULL,
  quota tinyint(4) DEFAULT '0' NOT NULL,
  ftpmaxkb int(11) DEFAULT '5120' NOT NULL,
  popmaxkb int(11) DEFAULT '5120' NOT NULL,
  standardip varchar(15) NOT NULL,
  neukundenreload tinyint(4) DEFAULT '0' NOT NULL,
  indexcode blob,
  indexfile varchar(30),
  mysqlshelluid mediumint(9) DEFAULT '0' NOT NULL,
  mysqlshellpasswortcrypt varchar(25) DEFAULT '' NOT NULL,
  mysqlshelllongpwcrypt varchar(255) DEFAULT '' NOT NULL,
  autoresponder tinyint(4) DEFAULT '0' NOT NULL,
  stdcgi tinyint(4) DEFAULT '0' NOT NULL,
  stddomain tinyint(4) DEFAULT '1' NOT NULL,
  flock int(11) DEFAULT '0' NOT NULL,
  standarddomain varchar(255) DEFAULT '' NOT NULL,
  language varchar(2) DEFAULT 'de' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  httpdspezial blob DEFAULT '' NOT NULL,
  asp tinyint(4) DEFAULT '0' NOT NULL,
  wap tinyint(4) DEFAULT '0' NOT NULL,
  coldfusion tinyint(4) DEFAULT '0' NOT NULL,
  dirlist tinyint(4) DEFAULT '0' NOT NULL,
  login varchar(255) DEFAULT '' NOT NULL,
  ispemail varchar(255) DEFAULT '' NOT NULL,
  ispservername varchar(255) DEFAULT '' NOT NULL,
  isplastrun varchar(255) DEFAULT '' NOT NULL,
  httpdlogin blob DEFAULT '' NOT NULL,
  phpupload tinyint(4) DEFAULT '0' NOT NULL,
  dns tinyint(4) NOT NULL default '0',
  ip_pns varchar(255) NOT NULL default '',
  ip_sns varchar(255) NOT NULL default '',
  dnstemplate blob NOT NULL,
  dnr tinyint(4) NOT NULL default '0',
  spamfilter tinyint(4) NOT NULL default '0',
  userprefix varchar(16) DEFAULT '' NOT NULL,
  postconf tinyint(4) NOT NULL default '0',
  hostname varchar(255) NOT NULL default '',
  business tinyint(4) NOT NULL default '0',
  checkupdates tinyint(4) NOT NULL default '0',
  cronjobs tinyint(4) NOT NULL default '0',
  majordomo tinyint(4) not null default 0,
  majordomohome varchar(255) not null default '',
  majordomoml varchar(255) not null default '',
  idn tinyint(4) not null default 0,
  scponly tinyint(4) not null default 0,
  oldskins tinyint(4) NOT NULL default 1,
  imap_options varchar(50) NOT NULL default ''
);

CREATE TABLE allgemein (
  quota tinyint(4) DEFAULT '0' NOT NULL,
  domains tinyint(4) DEFAULT '0' NOT NULL,
  newips tinyint(4) DEFAULT '1' NOT NULL,
  frontpage tinyint(4) DEFAULT '0' NOT NULL,
  perl tinyint(4) DEFAULT '0' NOT NULL,
  modpython tinyint(4) DEFAULT '1' NOT NULL, -- if mod_python should be used
  webalizer tinyint(4) DEFAULT '0' NOT NULL,
  lokaleips tinyint(4) DEFAULT '0' NOT NULL,
  deluser tinyint(4) DEFAULT '0' NOT NULL,
  delpop tinyint(4) DEFAULT '0' NOT NULL,
  delftp tinyint(4) DEFAULT '0' NOT NULL,
  adduser tinyint(4) DEFAULT '0' NOT NULL,
  addpop tinyint(4) DEFAULT '0' NOT NULL,
  addftp tinyint(4) DEFAULT '0' NOT NULL,
  htaccess tinyint(4) DEFAULT '0' NOT NULL,
  newpwd tinyint(4) DEFAULT '0' NOT NULL,
  aliases tinyint(4) DEFAULT '0' NOT NULL,
  aliaseslr int(15) DEFAULT '0' NOT NULL,
  aliasesupdate int(11) DEFAULT '1' NOT NULL,
  httpd tinyint(4) DEFAULT '0' NOT NULL,
  httpdlr int(15) DEFAULT '1' NOT NULL,
  httpdupdate int(11) DEFAULT '0' NOT NULL,
  speicherlr int(15) DEFAULT '1' NOT NULL,
  speicherupdate int(11) DEFAULT '1' NOT NULL,
  ftptraffiklr int(15) DEFAULT '1' NOT NULL,
  ftptraffikupdate int(11) DEFAULT '0' NOT NULL,
  httpdtraffikupdate int(11) DEFAULT '0' NOT NULL,
  httpdtraffiklr int(15) DEFAULT '1' NOT NULL,
  lastrun int(15) DEFAULT '0' NOT NULL,
  frontpageadd tinyint(4) DEFAULT '0' NOT NULL,
  frontpagedel tinyint(4) DEFAULT '0' NOT NULL,
  frontpagepw tinyint(4) DEFAULT '0' NOT NULL,
  fpaliasadd tinyint(4) DEFAULT '0' NOT NULL,
  fpaliasdel tinyint(4) DEFAULT '0' NOT NULL,
  confixxupdate int(11) DEFAULT '0' NOT NULL,
  newsletter tinyint(4) DEFAULT '0' NOT NULL,
  webalizerpw tinyint(4) DEFAULT '0' NOT NULL,
  frontpageemail tinyint(4) DEFAULT '0' NOT NULL,
  stdcgi tinyint(4) DEFAULT '0' NOT NULL,
  cssl tinyint(4) DEFAULT '0' NOT NULL,
  dns tinyint(4) NOT NULL default '0',
  spamupdate tinyint(4) DEFAULT '0' NOT NULL,
  cronupdate tinyint(4) DEFAULT '0' NOT NULL,
  checknewversion int(11) DEFAULT '0' NOT NULL
);
CREATE TABLE anbieter (
  anbieter varchar(8) DEFAULT '' NOT NULL,
  passwort varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  maxkunden smallint(6) DEFAULT '0' NOT NULL,
  maxkundenlimit tinyint(4) DEFAULT '0' NOT NULL,
  maxpop smallint(6) DEFAULT '0' NOT NULL,
  maxpoplimit tinyint(4) DEFAULT '0' NOT NULL,
  maxkb int(11) DEFAULT '0' NOT NULL,
  maxkblimit tinyint(4) DEFAULT '0' NOT NULL,
  maxmysql smallint(6) DEFAULT '0' NOT NULL,
  maxmysqllimit tinyint(4) DEFAULT '0' NOT NULL,
  maxemail mediumint(9) DEFAULT '0' NOT NULL,
  maxemaillimit tinyint(4) DEFAULT '0' NOT NULL,
  maxftp mediumint(9) DEFAULT '0' NOT NULL,
  maxftplimit tinyint(4) DEFAULT '0' NOT NULL,
  maxtransfer int(11) DEFAULT '0' NOT NULL,
  maxsubdomains mediumint(9) DEFAULT '0' NOT NULL,
  maxsubdomainslimit tinyint(4) DEFAULT '0' NOT NULL,
  maxwildcards mediumint(9) DEFAULT '0' NOT NULL,
  maxwildcardslimit tinyint(4) DEFAULT '0' NOT NULL, -- if limit is hard
  maxatdomains mediumint(9) DEFAULT '0' NOT NULL, -- maximum number of at domains
  maxatdomainslimit tinyint(4) DEFAULT '0' NOT NULL, -- if limit is hard
  maxcronjobs mediumint(9) DEFAULT '0' NOT NULL,
  maxcronjobslimit tinyint(4) DEFAULT '0' NOT NULL,
  php tinyint(4) DEFAULT '0' NOT NULL,
  perl tinyint(4) DEFAULT '0' NOT NULL,
  modpython tinyint(4) DEFAULT '0' NOT NULL, -- if mod_python allowed
  ssi tinyint(4) DEFAULT '0' NOT NULL,
  cssl tinyint(4) DEFAULT '0' NOT NULL,
  shell tinyint(4) DEFAULT '0' NOT NULL,
  statistik tinyint(4) DEFAULT '0' NOT NULL,
  pwschutz tinyint(4) DEFAULT '0' NOT NULL,
  fehlerseiten tinyint(4) DEFAULT '0' NOT NULL,
  webftp tinyint(4) DEFAULT '0' NOT NULL,
  webmail tinyint(4) DEFAULT '0' NOT NULL,
  frontpage tinyint(4) DEFAULT '0' NOT NULL,
  anmeldedatum int(14) NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  firma varchar(255) DEFAULT '' NOT NULL,
  anschrift varchar(255) DEFAULT '' NOT NULL,
  plzort varchar(255) DEFAULT '' NOT NULL,
  telefon varchar(255) DEFAULT '' NOT NULL,
  fax varchar(255) DEFAULT '' NOT NULL,
  emailadresse varchar(255) DEFAULT '' NOT NULL,
  kundennummer varchar(255) DEFAULT '' NOT NULL,
  freifeldname1 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert1 varchar(255) DEFAULT '' NOT NULL,
  freifeldname2 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert2 varchar(255) DEFAULT '' NOT NULL,
  freifeldname3 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert3 varchar(255) DEFAULT '' NOT NULL,
  personendatenangeben tinyint(4) DEFAULT '0' NOT NULL,
  kundendatenanzeigen tinyint(4) DEFAULT '0' NOT NULL,
  kundendatenbeikundenanzeigen tinyint(4) DEFAULT '0' NOT NULL,
  emailbetreff varchar(255) DEFAULT '' NOT NULL,
  emailtext blob DEFAULT '' NOT NULL,
  emailemailadresse varchar(255) DEFAULT '' NOT NULL,
  emailname varchar(255) DEFAULT '' NOT NULL,
  number int(11) DEFAULT '0' NOT NULL,
  indexcode blob,
  indexfile varchar(30),
  emailbcc varchar(255) DEFAULT '' NOT NULL,
  hilfecode blob,
  stdcgi tinyint(4) DEFAULT '0' NOT NULL,
  maxautoresponder mediumint(9) DEFAULT '0' NOT NULL,
  maxautoresponderlimit tinyint(4) DEFAULT '0' NOT NULL,
  ftp tinyint(4) DEFAULT '0' NOT NULL,
  gesperrt tinyint(4) DEFAULT '0' NOT NULL,
  maxdomains mediumint(9) DEFAULT '-1' NOT NULL,
  maxdomainslimit tinyint(4) DEFAULT '0' NOT NULL,
  standardip varchar(15) DEFAULT '' NOT NULL,
  httpdspezial blob DEFAULT '' NOT NULL,
  language varchar(2) DEFAULT 'de' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  ispemail varchar(255) DEFAULT '' NOT NULL,
  ispservername varchar(255) DEFAULT '' NOT NULL,
  isplastrun varchar(255) DEFAULT '' NOT NULL,
  asp tinyint(4) DEFAULT '0' NOT NULL,
  wap tinyint(4) DEFAULT '0' NOT NULL,
  coldfusion tinyint(4) DEFAULT '0' NOT NULL,
  dirlist tinyint(4) DEFAULT '0' NOT NULL,
  logcopy tinyint(4) DEFAULT '0' NOT NULL,
  phpupload tinyint(4) DEFAULT '0' NOT NULL,
  dbext tinyint(4) DEFAULT '0' NOT NULL,
  dns tinyint(4) NOT NULL default '0',
  pns varchar(255) NOT NULL default '',
  sns varchar(255) NOT NULL default '',
  dnsspezial blob NOT NULL,
  dnr tinyint(4) NOT NULL default '0',
  gender varchar(255) NOT NULL default '',
  firstname varchar(255) NOT NULL default '',
  plz varchar(255) NOT NULL default '',
  land varchar(255) NOT NULL default '',
  spamfilter tinyint(4) NOT NULL default '0',
  maxidn int(11) NOT NULL default '0',
  maxidnlimit tinyint(4) NOT NULL default '0',
  maxmaillist int(11) NOT NULL default '0',
  maxmaillistlimit tinyint(4) NOT NULL default '0',  
  scponly tinyint(4) not null default 0,
  custom_skins tinyint(4) DEFAULT '1' NOT NULL,
  PRIMARY KEY (anbieter)
);
CREATE TABLE angebote (
  ident smallint(6) NOT NULL auto_increment,
  name varchar(255) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  maxpop smallint(6) DEFAULT '0' NOT NULL,
  maxkb int(11) DEFAULT '0' NOT NULL,
  maxmysql smallint(6) DEFAULT '0' NOT NULL,
  maxemail smallint(6) DEFAULT '0' NOT NULL,
  maxftp smallint(6) DEFAULT '0' NOT NULL,
  maxtransfer int(11) DEFAULT '0' NOT NULL,
  maxsubdomains smallint(6) DEFAULT '0' NOT NULL,
  maxcronjobs smallint(6) DEFAULT '0' NOT NULL,
  php tinyint(4) DEFAULT '0' NOT NULL,
  wildcard smallint(6) DEFAULT '0' NOT NULL,
  maxatdomains smallint(6) DEFAULT '0' NOT NULL, -- maximum number of at domains
  perl tinyint(4) DEFAULT '0' NOT NULL,
  modpython tinyint(4) DEFAULT '0' NOT NULL, -- if mod_python allowed
  ssi tinyint(4) DEFAULT '0' NOT NULL,
  shell tinyint(4) DEFAULT '0' NOT NULL,
  statistik tinyint(4) DEFAULT '0' NOT NULL,
  pwschutz tinyint(4) DEFAULT '0' NOT NULL,
  fehlerseiten tinyint(4) DEFAULT '0' NOT NULL,
  webftp tinyint(4) DEFAULT '0' NOT NULL,
  webmail tinyint(4) DEFAULT '0' NOT NULL,
  emailbetreff varchar(255) DEFAULT '' NOT NULL,
  emailtext blob DEFAULT '' NOT NULL,
  emailemailadresse varchar(255) DEFAULT '' NOT NULL,
  emailname varchar(255) DEFAULT '' NOT NULL,
  emailbcc varchar(255) DEFAULT '' NOT NULL,
  stdcgi tinyint(4) DEFAULT '0' NOT NULL,
  maxautoresponder smallint(6) DEFAULT '0' NOT NULL,
  ftp tinyint(4) DEFAULT '0' NOT NULL,
  wap tinyint(4) DEFAULT '0' NOT NULL,
  coldfusion tinyint(4) DEFAULT '0' NOT NULL,
  phpupload tinyint(4) DEFAULT '0' NOT NULL,
  dirlist tinyint(4) DEFAULT '0' NOT NULL,
  asp tinyint(4) DEFAULT '0' NOT NULL,
  spamfilter tinyint(4) DEFAULT '0' NOT NULL,
  maxidn int(11) NOT NULL default '0',
  maxmaillist int(11) NOT NULL default '0',
  scponly tinyint(4) not null default 0,
  frontpage tinyint(4) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE delaccs (
  account varchar(255) DEFAULT '' NOT NULL,
  type varchar(8) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  pfad varchar(255) DEFAULT '' NOT NULL
);

CREATE TABLE domains (
  domain varchar(255) DEFAULT '' NOT NULL unique,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  pfad varchar(255) DEFAULT '' NOT NULL,
  richtigedomain tinyint(4) DEFAULT 0 NOT NULL,
  cssl tinyint(4) DEFAULT 0 NOT NULL,
  frontpage tinyint(4) DEFAULT 0 NOT NULL,
  zusatz blob DEFAULT '' NOT NULL,
  lastchange int(14) DEFAULT 0 NOT NULL,
  id int(10) unsigned auto_increment primary key,
  dns tinyint(4) default 0 not null,
  dnr tinyint(4) default 0 not null
  
);

CREATE TABLE email (
  ident int(11) NOT NULL auto_increment,
  prefix varchar(65) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  pop3 varchar(255) DEFAULT '' NOT NULL,
  domain varchar(255) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  neu tinyint(4) DEFAULT '1' NOT NULL,
  pop3x blob NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE ereignisse (
  ident int(11) NOT NULL auto_increment,
  timestamp int(11) DEFAULT '0' NOT NULL,
  nachricht varchar(255) DEFAULT '' NOT NULL,
  script varchar(255) DEFAULT '' NOT NULL,
  code tinyint(4) DEFAULT '0' NOT NULL,
  anbieter varchar(8) NOT NULL,
  kunde varchar(16) NOT NULL,
  geloescht tinyint(4) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE fehlermeldungen (
  ident int(11) NOT NULL auto_increment,
  pfad varchar(255) DEFAULT '' NOT NULL,
  fehlertyp int(11) DEFAULT '0' NOT NULL,
  seite varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE frontpage (
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  passwort varchar(12) DEFAULT '' NOT NULL,
  pw tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '1' NOT NULL,
  loeschen tinyint(4) DEFAULT '0' NOT NULL,
  domain varchar(255) DEFAULT '' NOT NULL,
  benutzer varchar(16) DEFAULT '' NOT NULL,
  email tinyint(4) DEFAULT '0' NOT NULL,
  emailadresse varchar(255) DEFAULT '' NOT NULL
);
CREATE TABLE frontpagealias (
  domain varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  port smallint(6) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '0' NOT NULL,
  loeschen tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE ftp (
  account varchar(16) DEFAULT '' NOT NULL,
  uid mediumint(9) DEFAULT '0' NOT NULL,
  passwort varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  pfad varchar(255) DEFAULT '' NOT NULL,
  gesperrt tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '1' NOT NULL,
  pw tinyint(4) DEFAULT '0' NOT NULL,
  number int(11) DEFAULT '0' NOT NULL,
  quota tinyint(4) DEFAULT '0' NOT NULL,
  maxkb int(11) DEFAULT '0' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  language varchar(2) DEFAULT 'de' NOT NULL,
  PRIMARY KEY (account)
);
CREATE TABLE grep (
  kunde varchar(16) DEFAULT '' NOT NULL,
  type varchar(8) DEFAULT '' NOT NULL,
  pattern varchar(255) DEFAULT '' NOT NULL
);
CREATE TABLE htaccess (
  ident int(11) NOT NULL auto_increment,
  pfad varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE ipadressen (
  ip varchar(15) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ip)
);
CREATE TABLE kunden (
  kunde varchar(16) DEFAULT '' NOT NULL,
  uid mediumint(9) DEFAULT '0' NOT NULL,
  passwort varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  ip varchar(15) DEFAULT '' NOT NULL,
  maxpop smallint(6) DEFAULT '0' NOT NULL,
  maxkb int(11) DEFAULT '0' NOT NULL,
  kbhomedir int(11) DEFAULT '0' NOT NULL,
  kbdb int(11) DEFAULT '0' NOT NULL,
	kbpop int(11) DEFAULT 0 NOT NULL,
  maxmysql smallint(6) DEFAULT '0' NOT NULL,
  maxemail smallint(6) DEFAULT '0' NOT NULL,
  maxftp smallint(6) DEFAULT '0' NOT NULL,
  maxtransfer int(11) DEFAULT '0' NOT NULL,
  maxsubdomains smallint(6) DEFAULT '0' NOT NULL,
  maxatdomains smallint(6) DEFAULT '0' NOT NULL, -- maximum number of at domains
  maxcronjobs smallint(6) DEFAULT '0' NOT NULL,
  php tinyint(4) DEFAULT '0' NOT NULL,
  wildcard smallint(6) DEFAULT '0' NOT NULL,
  perl tinyint(4) DEFAULT '0' NOT NULL,
  modpython tinyint(4) DEFAULT '0' NOT NULL, -- if mod_python allowed
  ssi tinyint(4) DEFAULT '0' NOT NULL,
  shell tinyint(4) DEFAULT '0' NOT NULL,
  statistik tinyint(4) DEFAULT '0' NOT NULL,
  pwschutz tinyint(4) DEFAULT '0' NOT NULL,
  fehlerseiten tinyint(4) DEFAULT '0' NOT NULL,
  webftp tinyint(4) DEFAULT '0' NOT NULL,
  webmail tinyint(4) DEFAULT '0' NOT NULL,
  kundendatenanzeigen tinyint(4) DEFAULT '0' NOT NULL,
  anmeldedatum int(14) NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  firma varchar(255) DEFAULT '' NOT NULL,
  anschrift varchar(255) DEFAULT '' NOT NULL,
  plzort varchar(255) DEFAULT '' NOT NULL,
  telefon varchar(255) DEFAULT '' NOT NULL,
  fax varchar(255) DEFAULT '' NOT NULL,
  emailadresse varchar(255) DEFAULT '' NOT NULL,
  kundennummer varchar(255) DEFAULT '' NOT NULL,
  freifeldname1 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert1 varchar(255) DEFAULT '' NOT NULL,
  freifeldname2 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert2 varchar(255) DEFAULT '' NOT NULL,
  freifeldname3 varchar(255) DEFAULT '' NOT NULL,
  freifeldwert3 varchar(255) DEFAULT '' NOT NULL,
  anzahldateien int(11) DEFAULT '0' NOT NULL,
  gesperrt tinyint(4) DEFAULT '0' NOT NULL,
  pw tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT 1 NOT NULL,
  number int(11) DEFAULT '0' NOT NULL,
  quota tinyint(4) DEFAULT '0' NOT NULL,
  frontpage tinyint(4) DEFAULT '0' NOT NULL,
  stdcgi tinyint(4) DEFAULT '0' NOT NULL,
  ftp tinyint(4) DEFAULT '0' NOT NULL,
  maxautoresponder smallint(6) DEFAULT '0' NOT NULL,
  statistikpasswort varchar(20) DEFAULT '' NOT NULL,
  statistiklongpw varchar(255) DEFAULT '' NOT NULL,
  changedomains tinyint(4) DEFAULT '0' NOT NULL,
  hatalias tinyint(4) DEFAULT '0' NOT NULL,
  language varchar(2) DEFAULT 'de' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  countdomains int(14) DEFAULT '0' NOT NULL,
  httpdspezial blob DEFAULT '' NOT NULL,
  asp tinyint(4) DEFAULT '0' NOT NULL,
  wap tinyint(4) DEFAULT '0' NOT NULL,
  coldfusion tinyint(4) DEFAULT '0' NOT NULL,
  dirlist tinyint(4) DEFAULT '0' NOT NULL,
  logcopy tinyint(4) DEFAULT '0' NOT NULL,
  phpupload tinyint(4) DEFAULT '0' NOT NULL,
  gender varchar(255) NOT NULL default '',
  firstname varchar(255) NOT NULL default '',
  plz varchar(255) NOT NULL default '',
  land varchar(255) NOT NULL default '',
  spamfilter tinyint(4) DEFAULT '0' NOT NULL,
  maxidn int(11) NOT NULL default '0',
  list_size int(11) NOT NULL default '10',
  maxmaillist int(11) NOT NULL default '0',
  scponly tinyint(4) default 0 not null,
  PRIMARY KEY (kunde)
);
CREATE TABLE logout (
  acc varchar(12) DEFAULT '' NOT NULL,
  logout tinyint(4) DEFAULT '0' NOT NULL,
  PRIMARY KEY (acc)
);
CREATE TABLE mysql_datenbanken (
  dbname varchar(19) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  datenbank int(15) not null default '1',
  lastchange int(14) DEFAULT '0' NOT NULL,
  dbext tinyint(4) DEFAULT '0' NOT NULL,
  PRIMARY KEY (dbname)
);
CREATE TABLE perl (
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(16) DEFAULT '' NOT NULL,
  loeschen tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE pop3 (
  account varchar(16) DEFAULT '' NOT NULL,
  uid mediumint(9) DEFAULT '0' NOT NULL,
  passwort varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(15) DEFAULT '' NOT NULL,
  gesperrt tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '1' NOT NULL,
  number int(11) DEFAULT '0' NOT NULL,
  quota tinyint(4) DEFAULT '0' NOT NULL,
  maxkb int(11) DEFAULT '0' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  language varchar(2) DEFAULT 'de' NOT NULL,
  kommentar varchar(255) DEFAULT '' NOT NULL,
  auto_whitelist tinyint(4) DEFAULT '1' NOT NULL,
  spamfilter tinyint(4) DEFAULT '0' NOT NULL,
  PRIMARY KEY (account)
);
CREATE TABLE pwschutz (
  ident int(11) NOT NULL auto_increment,
  pfad varchar(255) DEFAULT '' NOT NULL,
  bereich varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  lastchange int(14) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE transfer (
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  tag tinyint(4) DEFAULT '0' NOT NULL,
  monat tinyint(4) DEFAULT '0' NOT NULL,
  jahr smallint(4) DEFAULT '0' NOT NULL,
  ftp int(11) DEFAULT '0' NOT NULL,
  web int(11) DEFAULT '0' NOT NULL,
  email int(11) DEFAULT '0' NOT NULL,
  geloescht tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE users (
  ident int(11) NOT NULL auto_increment,
  login varchar(35) DEFAULT '' NOT NULL,
  pass varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  parent int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE webalizer (
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(16) DEFAULT '' NOT NULL,
  loeschen tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE zeiten (
  httpdtraffikvon tinyint(4) DEFAULT 2 NOT NULL,
  httpdtraffikbis tinyint(4) DEFAULT 3 NOT NULL,
  httpdtraffiklast int(15) DEFAULT 0 NOT NULL,
  httpdtraffikfreq tinyint(4) DEFAULT 120 NOT NULL,
  ftptraffikvon tinyint(4) DEFAULT 3 NOT NULL,
  ftptraffikbis tinyint(4) DEFAULT 4 NOT NULL,
  ftptraffiklast int(15) DEFAULT 0 NOT NULL,
  ftptraffikfreq tinyint(4) DEFAULT 120 NOT NULL,
  speichervon tinyint(4) DEFAULT 4 NOT NULL,
  speicherbis tinyint(4) DEFAULT 5 NOT NULL,
  speicherfreq tinyint(4) DEFAULT 120 NOT NULL,
  speicherlast int(15) DEFAULT 0 NOT NULL,
  httpdlpr int(15) DEFAULT '0' NOT NULL,
  httpdfaktor int(15) DEFAULT '1' NOT NULL,
  aliaseslpr int(15) DEFAULT '0' NOT NULL,
  aliasesfaktor int(15) DEFAULT '3' NOT NULL,
  confixxfaktor int(15) DEFAULT '1' NOT NULL,
  checknewversion int(10) DEFAULT '12' NOT NULL,
  maillistvon tinyint(4) default 0 not null,
  maillistbis tinyint(4) default 24 not null,
  maillistfreq int(11) default 600 not null,
  maillistletzt int(15) default 0 not null
);
CREATE TABLE domainlog (
  domain varchar(255) DEFAULT '' NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  loeschen tinyint(4) DEFAULT '0' NOT NULL,
  neu tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE nlinhalt (
  ident int(11) NOT NULL auto_increment,
  mail blob NOT NULL,
  von varchar(255) NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE nladressen (
  ident int(11) NOT NULL auto_increment,
  mailid int(11) NOT NULL,
  emailadresse varchar(255) NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE autoresponder (
  ident int(11) NOT NULL,
  negvon tinyint(4) DEFAULT '0' NOT NULL,
  von varchar(255) DEFAULT '' NOT NULL,
  link tinyint(4) DEFAULT '0' NOT NULL,
  negrcpt tinyint(4) DEFAULT '0' NOT NULL,
  rcpt varchar(255) DEFAULT '' NOT NULL,
  absenderemail varchar(255) DEFAULT '' NOT NULL,
  absendername varchar(255) DEFAULT '' NOT NULL,
  emailbetreff varchar(255) DEFAULT '' NOT NULL,
  emailtext blob NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL
);
CREATE TABLE billing_del (
  date int(14) NOT NULL,
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  type varchar(255) NOT NULL,
  item varchar(255) NOT NULL
);
CREATE TABLE billing_exp (
  start int(14) NOT NULL,
  anbieter varchar(8) NOT NULL,
  email varchar(255) NOT NULL,
  modul varchar(255) NOT NULL
);
CREATE TABLE register (
  seriennummer varchar(255) DEFAULT '' NOT NULL,
  hwaddr varchar(255) DEFAULT '' NOT NULL,
  version varchar(255) DEFAULT '' NOT NULL,
  lizenz blob DEFAULT '' NOT NULL,
  hinweis blob DEFAULT '' NOT NULL,
  ip varchar(15) DEFAULT '' NOT NULL,
  ablauf varchar(255) DEFAULT '' NOT NULL,
  install tinyint(4) DEFAULT '' NOT NULL,
  pw_root varchar(255) DEFAULT '' NOT NULL,
  pw_db_root varchar(255) DEFAULT '' NOT NULL,
  pw_db_user varchar(255) DEFAULT '' NOT NULL,
  pw_admin varchar(255) DEFAULT '' NOT NULL,
  logindomain varchar(255) DEFAULT '' NOT NULL,
  loginip varchar(15) DEFAULT '' NOT NULL,
  standarddomain varchar(255) DEFAULT '' NOT NULL,
  standardip varchar(15) DEFAULT '' NOT NULL,
  hostname varchar(255) DEFAULT '' NOT NULL
);
CREATE TABLE cssl (
  kunde varchar(16) DEFAULT '' NOT NULL,
  anbieter varchar(8) DEFAULT '' NOT NULL,
  privatekey blob DEFAULT '' NOT NULL,
  crt blob DEFAULT '' NOT NULL,
  csr blob DEFAULT '' NOT NULL,
  neu tinyint(4) DEFAULT '0' NOT NULL,
  loeschen tinyint DEFAULT '0' NOT NULL,
  aendern tinyint DEFAULT '0' NOT NULL,
  countrycode varchar(4) DEFAULT '' NOT NULL,
  state varchar(255) DEFAULT '' NOT NULL,
  city varchar(255) DEFAULT '' NOT NULL,
  firm varchar(255) DEFAULT '' NOT NULL,
  unit varchar(255) DEFAULT '' NOT NULL,
  common varchar(255) DEFAULT '' NOT NULL,
  email varchar(255) DEFAULT '' NOT NULL,
  challenge varchar(255) DEFAULT '' NOT NULL,
  optional varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (kunde)
);
CREATE TABLE webmail_ab (
  ident int(11) NOT NULL auto_increment,
  pop3 varchar(16) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  email varchar(255) DEFAULT '' NOT NULL,
  first_name varchar(255),
  last_name varchar(255),
  tel_home varchar(255),
  tel_work varchar(255),
  tel_mobile varchar(255),
  tel_fax varchar(255),
  address text,
  PRIMARY KEY (ident)
);
CREATE TABLE webmail_session (
  ident bigint(20) NOT NULL auto_increment,
  pop3 varchar(16) DEFAULT '' NOT NULL,
  password varchar(20) DEFAULT '' NOT NULL,
  longpw varchar(255) DEFAULT '' NOT NULL,
  lang varchar(4) DEFAULT '' NOT NULL,
  timestamp timestamp(14),
  PRIMARY KEY (ident)
);
CREATE TABLE webmail_sign (
  ident int(11) NOT NULL auto_increment,
  alias varchar(255) DEFAULT '' NOT NULL,
  pop3 varchar(255) DEFAULT '' NOT NULL,
  signatur text,
  PRIMARY KEY (ident)
);
CREATE TABLE webmail_def_from (
  ident int(11) NOT NULL auto_increment,
  pop3 varchar(255) DEFAULT '' NOT NULL,
  email varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (ident)
);
CREATE TABLE skins (
  cuser varchar(255) DEFAULT '' NOT NULL,
  skin varchar(255) DEFAULT '' NOT NULL,
  skin_id int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (cuser)
);
CREATE TABLE dns (
  domain varchar(255) NOT NULL default '',
  kunde varchar(16) NOT NULL default '',
  anbieter varchar(8) NOT NULL default '',
  zonefile blob NOT NULL,
  lastchange int(10) NOT NULL default '0',
  neu tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (domain)
);
CREATE TABLE restore (
  html varchar(255) DEFAULT '' NOT NULL,
  files varchar(255) DEFAULT '' NOT NULL,
  mysql varchar(255) DEFAULT '' NOT NULL,
  id int auto_increment primary key not null,
  kunde varchar(16) not null default '',
  src varchar(255) DEFAULT '' NOT NULL	
);

CREATE TABLE backup (
  html varchar(255) DEFAULT '' NOT NULL,
  files varchar(255) DEFAULT '' NOT NULL,
  mysql varchar(255) DEFAULT '' NOT NULL,
  id int auto_increment primary key not null,
  kunde varchar(16) not null default '',
  dst varchar(255) DEFAULT '' NOT NULL	
);

-- the table stores new crontab files for the specified user
CREATE TABLE cronjobs (
    kunde       VARCHAR(16) DEFAULT '' NOT NULL,  
    cronfile    blob DEFAULT '' NOT NULL,
	lastchange int(10) NOT NULL default 0,
  	neu tinyint(4) NOT NULL default 0,
	PRIMARY KEY (kunde)
);
-- the table stores all skins (preinstalled and custom) for confixx
CREATE TABLE custom_skins (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
    name VARCHAR(255) NOT NULL DEFAULT '',      -- name of skin
    show_name VARCHAR(255) NOT NULL DEFAULT '',      -- name of skin
    owner_type ENUM('preinstalled','admin','reseller','user') NOT NULL DEFAULT 'preinstalled',
    anbieter varchar(8) DEFAULT '' NOT NULL,    -- reseller
	version VARCHAR(255) NOT NULL DEFAULT '',
	path VARCHAR(255) NOT NULL DEFAULT '',		-- path to skin dir
    PRIMARY KEY (id)
);
-- the table stores preferences for SpamAssassin
CREATE TABLE spampref (
  username varchar(100) NOT NULL,        -- localpart of postbox address (localpart@domain)
  preference varchar(30) NOT NULL,
  value varchar(100) NOT NULL,
  prefid int(11) NOT NULL auto_increment,
  PRIMARY KEY (prefid),
  INDEX (username)
) TYPE=MyISAM;
-- the table stores default server for Business
CREATE TABLE bdefault (
  defaultserver int(11) default NULL
);
-- the table stores default servers for Business
CREATE TABLE bmysql (
  KeyServer int(11) unsigned NOT NULL auto_increment,
  Servername varchar(64) default NULL,
  ip varchar(64) default NULL,
  cuser varchar(64) default NULL,
  cpassword varchar(64) default NULL,
  port int(11) default NULL,
  dbname varchar(64) default NULL,
  PRIMARY KEY  (KeyServer)
);

CREATE TABLE maillist (
  id int(10) unsigned not null auto_increment primary key,
  name varchar(64) not null,
  domain_id int(10) unsigned not null default 0,
  owner_mail varchar(255) not null,
  neu tinyint(4) default 1 not null,
  pwd varchar(32) default '' not null,
  gesperrt tinyint(4) DEFAULT 0 NOT NULL,
  quota tinyint(4) default 0 not null
);

CREATE TABLE traffic ( 
  id int(10) unsigned not null auto_increment primary key,
  kunde varchar(16) not null, 
  anbieter varchar(8) not null,
  year smallint(4) not null default 0, 
  month tinyint(4) not null default 0,
  day tinyint(4) not null default 0,
  sent int(11) unsigned not null default 0, 
  received int(11) unsigned not null default 0,
  local tinyint(4) not null default 0, 
  maillist_id int(10) unsigned not null default 0 
);

CREATE TABLE updates (
  id int(10) unsigned NOT NULL auto_increment,
  version varchar(50) NOT NULL default '',
  type varchar(30) NOT NULL default '',
  download_url varchar(255) NOT NULL default '',
  description_url varchar(255) NOT NULL default '',
  description_text text NOT NULL,
  release_date int(10) unsigned NOT NULL default '0',
  new tinyint(4) NOT NULL default '1',
  PRIMARY KEY  (id)
);

create table idn_aliases (
  id int auto_increment primary key,
  domain_id int references domains(id),
  idn_name varchar(255) default '' not null unique,
  charset varchar(32) default 'UTF8' not null,
  ascii_name varchar(255) default null unique,
  neu tinyint(4) DEFAULT 1 NOT NULL
);

-- Description of types
create table types ( 
  id int auto_increment primary key,
  grp char(8) not null, 
  code char(16) not null default '',
  descr varchar(80) 
);

create table events ( 
  id int auto_increment primary key,
  object_type int not null ,
  object_id int,
  object_prop char(16) not null default '',
  event_type int not null ,
  count int not null default 1,	
  event int not null default 0,
  event_prop char(16) not null default '' 
);
						
create table bin (
  id int auto_increment primary key,
  name char(64) not null unique,
  grp char(32) not null default '',
  path varchar(255)
);

CREATE TABLE iprestriction (
  id int(10) unsigned NOT NULL auto_increment,
  ip varchar(15) NOT NULL default '',
  rest enum('accept','deny') NOT NULL default 'accept',
  PRIMARY KEY  (id)
);		

CREATE TABLE sessions (
  id varchar(100) NOT NULL default '',
  startdate int(11) NOT NULL default '0',
  lastupdate int(11) NOT NULL default '0',
  sdata text NOT NULL,
  user varchar(255) NOT NULL default '',
  ip varchar(100) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY lastupdate (lastupdate)
);

CREATE TABLE pwdreminder (
  user varchar(16) NOT NULL default '',
  password varchar(255) NOT NULL default '',
  usertype tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (user,password)
);

CREATE TABLE atdomains (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -- identifier
  name VARCHAR(255) DEFAULT '' NOT NULL, -- name of user
  id_from INT(10) UNSIGNED, -- refers to domains.id, user will be redirected from this domain
  todomain VARCHAR(255) DEFAULT '' NOT NULL, -- user will be redirected to this domain
  PRIMARY KEY  (id),
  UNIQUE(name,id_from)
);

CREATE TABLE menublock (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -- identifier
  label VARCHAR(255) DEFAULT '' NOT NULL, -- text that should be shown
  overview TEXT NOT NULL, -- overview text
  usertype enum('reseller','user') NOT NULL default 'reseller', -- type of user
  PRIMARY KEY (id)
);

CREATE TABLE menuitem (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -- identifier
  menublock_id INT(10) UNSIGNED NOT NULL, -- refers to menublock.id
  label VARCHAR(255) DEFAULT '' NOT NULL, -- text that should be shown
  href VARCHAR(255) DEFAULT '' NOT NULL, -- href of menu
  in_frame TINYINT(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (id)
);
