From 0cef61a3fd0c988cf46f5e45f7e06ab4e1a720d6 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Mon, 23 Mar 2009 18:27:52 +0000 Subject: [PATCH] Added several input checks. --- install/tpl/config.inc.php.master | 306 ++--- interface/lib/app.inc.php | 405 +++--- interface/web/admin/form/users.tform.php | 908 ++++++------- interface/web/capp.php | 107 +- interface/web/clang.php | 70 - interface/web/client/form/client.tform.php | 1390 ++++++++++---------- interface/web/content.php | 155 ++- interface/web/index.php | 140 +- interface/web/login/index.php | 344 ++--- interface/web/nav.php | 203 ++- 10 files changed, 1954 insertions(+), 2074 deletions(-) delete mode 100644 interface/web/clang.php diff --git a/install/tpl/config.inc.php.master b/install/tpl/config.inc.php.master index b38390c64..2c016bbc6 100644 --- a/install/tpl/config.inc.php.master +++ b/install/tpl/config.inc.php.master @@ -1,153 +1,153 @@ - MYSQL: "utf-8" --> "utf8", "iso-8859-1" --> "latin1") - -define("DB_TYPE",$conf["db_type"]); -define("DB_HOST",$conf["db_host"]); -define("DB_DATABASE",$conf["db_database"]); -define("DB_USER",$conf["db_user"]); -define("DB_PASSWORD",$conf["db_password"]); -define("DB_CHARSET",$conf["db_charset"]); - - -//** Database settings for the master DB. This setting is only used in multiserver setups -$conf["dbmaster_type"] = 'mysql'; -$conf["dbmaster_host"] = '{mysql_master_server_host}'; -$conf["dbmaster_database"] = '{mysql_master_server_database}'; -$conf["dbmaster_user"] = '{mysql_master_server_ispconfig_user}'; -$conf["dbmaster_password"] = '{mysql_master_server_ispconfig_password}'; - - -//** Paths -define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../')); // The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes. -define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib'); -define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes'); -define('ISPC_WEB_PATH', ISPC_ROOT_PATH.'/web'); -define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes'); -define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser -define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache'); - -//** Paths (Do not change!) -$conf["rootpath"] = substr(dirname(__FILE__),0,-4); -$conf["fs_div"] = "/"; // File system divider, "\\" on windows and "/"" on linux and unix -$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes"; -$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp"; - -define("FS_DIV",$conf["fs_div"]); -define("SERVER_ROOT",$conf["rootpath"]); -define("INCLUDE_ROOT",SERVER_ROOT.FS_DIV."lib"); -define("CLASSES_ROOT",INCLUDE_ROOT.FS_DIV."classes"); - - -//** Server -$conf['app_title'] = ISPC_APP_TITLE; -$conf['app_version'] = ISPC_APP_VERSION; -$conf['app_link'] = 'http://www.ispconfig.org/'; -$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns,help'; -$conf["server_id"] = "{server_id}"; - - -//** Interface -define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools'); - - -//** Logging -$conf["log_file"] = '/var/log/ispconfig/ispconfig.log'; -$conf["log_priority"] = {ispconfig_log_priority}; // 0 = Debug, 1 = Warning, 2 = Error - - -//** Allow software package installations -$conf['software_updates_enabled'] = false; - - -//** Themes -$conf["theme"] = 'default'; -$conf["html_content_encoding"] = 'utf-8'; // example: utf-8, iso-8859-1, ... -$conf["logo"] = 'themes/default/images/ispc_logo.png'; - - -//** Default Language -$conf["language"] = 'en'; - - -//** Misc. -$conf["interface_logout_url"] = ""; // example: http://www.domain.tld/ - - -//** Auto Load Modules -$conf["start_db"] = true; -$conf["start_session"] = true; - - -//** Constants -define("LOGLEVEL_DEBUG",0); -define("LOGLEVEL_WARN",1); -define("LOGLEVEL_ERROR",2); - -?> + MYSQL: "utf-8" --> "utf8", "iso-8859-1" --> "latin1") + +define("DB_TYPE",$conf["db_type"]); +define("DB_HOST",$conf["db_host"]); +define("DB_DATABASE",$conf["db_database"]); +define("DB_USER",$conf["db_user"]); +define("DB_PASSWORD",$conf["db_password"]); +define("DB_CHARSET",$conf["db_charset"]); + + +//** Database settings for the master DB. This setting is only used in multiserver setups +$conf["dbmaster_type"] = 'mysql'; +$conf["dbmaster_host"] = '{mysql_master_server_host}'; +$conf["dbmaster_database"] = '{mysql_master_server_database}'; +$conf["dbmaster_user"] = '{mysql_master_server_ispconfig_user}'; +$conf["dbmaster_password"] = '{mysql_master_server_ispconfig_password}'; + + +//** Paths +define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../')); // The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes. +define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib'); +define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes'); +define('ISPC_WEB_PATH', ISPC_ROOT_PATH.'/web'); +define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes'); +define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser +define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache'); + +//** Paths (Do not change!) +$conf["rootpath"] = substr(dirname(__FILE__),0,-4); +$conf["fs_div"] = "/"; // File system divider, "\\" on windows and "/"" on linux and unix +$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes"; +$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp"; + +define("FS_DIV",$conf["fs_div"]); +define("SERVER_ROOT",$conf["rootpath"]); +define("INCLUDE_ROOT",SERVER_ROOT.FS_DIV."lib"); +define("CLASSES_ROOT",INCLUDE_ROOT.FS_DIV."classes"); + + +//** Server +$conf['app_title'] = ISPC_APP_TITLE; +$conf['app_version'] = ISPC_APP_VERSION; +$conf['app_link'] = 'http://www.ispconfig.org/'; +$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns,help'; +$conf["server_id"] = "{server_id}"; + + +//** Interface +define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools'); + + +//** Logging +$conf["log_file"] = '/var/log/ispconfig/ispconfig.log'; +$conf["log_priority"] = {ispconfig_log_priority}; // 0 = Debug, 1 = Warning, 2 = Error + + +//** Allow software package installations +$conf['software_updates_enabled'] = false; + + +//** Themes +$conf["theme"] = 'default'; +$conf["html_content_encoding"] = 'utf-8'; // example: utf-8, iso-8859-1, ... +$conf["logo"] = 'themes/default/images/ispc_logo.png'; + + +//** Default Language +$conf["language"] = 'en'; + + +//** Misc. +$conf["interface_logout_url"] = ""; // example: http://www.domain.tld/ + + +//** Auto Load Modules +$conf["start_db"] = true; +$conf["start_session"] = true; + + +//** Constants +define("LOGLEVEL_DEBUG",0); +define("LOGLEVEL_WARN",1); +define("LOGLEVEL_ERROR",2); + +?> diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php index e515fc09f..1d94463e7 100644 --- a/interface/lib/app.inc.php +++ b/interface/lib/app.inc.php @@ -1,201 +1,206 @@ -_conf = $conf; - if($this->_conf['start_db'] == true) { - $this->load('db_'.$this->_conf['db_type']); - $this->db = new db; - } - - //* Start the session - if($this->_conf['start_session'] == true) { - session_start(); - - //* Initialize session variables - if(!isset($_SESSION['s']['id']) ) $_SESSION['s']['id'] = session_id(); - if(empty($_SESSION['s']['theme'])) $_SESSION['s']['theme'] = $conf['theme']; - if(empty($_SESSION['s']['language'])) $_SESSION['s']['language'] = $conf['language']; - } - - $this->uses('auth'); - } - - public function uses($classes) - { - $cl = explode(',', $classes); - if(is_array($cl)) { - foreach($cl as $classname){ - $classname = trim($classname); - //* Class is not loaded so load it - if(!array_key_exists($classname, $this->_loaded_classes)){ - include_once(ISPC_CLASS_PATH."/$classname.inc.php"); - $this->$classname = new $classname(); - $this->_loaded_classes[$classname] = true; - } - } - } - } - - public function load($files) - { - $fl = explode(',', $files); - if(is_array($fl)) { - foreach($fl as $file){ - $file = trim($file); - include_once(ISPC_CLASS_PATH."/$file.inc.php"); - } - } - } - - /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ - public function log($msg, $priority = 0) - { - if($priority >= $this->_conf['log_priority']) { - if (is_writable($this->_conf['log_file'])) { - if (!$fp = fopen ($this->_conf['log_file'], 'a')) { - $this->error('Unable to open logfile.'); - } - if (!fwrite($fp, date('d.m.Y-H:i').' - '. $msg."\r\n")) { - $this->error('Unable to write to logfile.'); - } - fclose($fp); - } else { - $this->error('Unable to write to logfile.'); - } - } - } - - /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ - public function error($msg, $next_link = '', $stop = true, $priority = 1) - { - //$this->uses("error"); - //$this->error->message($msg, $priority); - if($stop == true){ - $msg = ' - - -Error - - - - -
-
-

Error

-
    -
  1. '.$msg; - if($next_link != '') $msg .= 'Next'; - $msg .= '
  2. -
-
-
- -'; - die($msg); - } else { - echo $msg; - if($next_link != '') echo "Next"; - } - } - - /** Loads language */ - public function lng($text) - { - if($this->_language_inc != 1) { - //* loading global and module Wordbook - // TODO: this need to be made clearer somehow - pedro - @include_once(ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng'); - if(isset($_SESSION['s']['module']['name']) && isset($_SESSION['s']['language'])) { - $lng_file = ISPC_ROOT_PATH.'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng'; - if(!file_exists($lng_file)) $lng_file = ISPC_ROOT_PATH.'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng'; - @include_once($lng_file); - } - $this->_wb = $wb; - $this->_language_inc = 1; - } - if(!empty($this->_wb[$text])) { - $text = $this->_wb[$text]; - } - return $text; - } - - public function tpl_defaults() - { - $this->tpl->setVar('app_title', $this->_conf['app_title']); - $this->tpl->setVar('app_version', $this->_conf['app_version']); - $this->tpl->setVar('app_link', $this->_conf['app_link']); - if(isset($this->_conf['app_logo']) && $this->_conf['app_logo'] != '' && @is_file($this->_conf['app_logo'])){ - $this->tpl->setVar('app_logo', ''); - } else { - $this->tpl->setVar('app_logo', ' '); - } - - $this->tpl->setVar('phpsessid', session_id()); - - $this->tpl->setVar('theme', $_SESSION['s']['theme']); - $this->tpl->setVar('html_content_encoding', $this->_conf['html_content_encoding']); - - $this->tpl->setVar('delete_confirmation', $this->lng('delete_confirmation')); - //print_r($_SESSION); - if(isset($_SESSION['s']['module']['name'])) { - $this->tpl->setVar('app_module', $_SESSION['s']['module']['name']); - } - if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') { - $this->tpl->setVar('is_admin', 1); - } - if(isset($_SESSION['s']['user']) && $this->auth->has_clients($_SESSION['s']['user']['userid'])) { - $this->tpl->setVar('is_reseller', 1); - } - } - -} // end class - -//** Initialize application (app) object -//* possible future = new app($conf); -$app = new app(); - +_conf = $conf; + if($this->_conf['start_db'] == true) { + $this->load('db_'.$this->_conf['db_type']); + $this->db = new db; + } + + //* Start the session + if($this->_conf['start_session'] == true) { + session_start(); + + //* Initialize session variables + if(!isset($_SESSION['s']['id']) ) $_SESSION['s']['id'] = session_id(); + if(empty($_SESSION['s']['theme'])) $_SESSION['s']['theme'] = $conf['theme']; + if(empty($_SESSION['s']['language'])) $_SESSION['s']['language'] = $conf['language']; + } + + $this->uses('auth'); + } + + public function uses($classes) + { + $cl = explode(',', $classes); + if(is_array($cl)) { + foreach($cl as $classname){ + $classname = trim($classname); + //* Class is not loaded so load it + if(!array_key_exists($classname, $this->_loaded_classes)){ + include_once(ISPC_CLASS_PATH."/$classname.inc.php"); + $this->$classname = new $classname(); + $this->_loaded_classes[$classname] = true; + } + } + } + } + + public function load($files) + { + $fl = explode(',', $files); + if(is_array($fl)) { + foreach($fl as $file){ + $file = trim($file); + include_once(ISPC_CLASS_PATH."/$file.inc.php"); + } + } + } + + /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ + public function log($msg, $priority = 0) + { + if($priority >= $this->_conf['log_priority']) { + if (is_writable($this->_conf['log_file'])) { + if (!$fp = fopen ($this->_conf['log_file'], 'a')) { + $this->error('Unable to open logfile.'); + } + if (!fwrite($fp, date('d.m.Y-H:i').' - '. $msg."\r\n")) { + $this->error('Unable to write to logfile.'); + } + fclose($fp); + } else { + $this->error('Unable to write to logfile.'); + } + } + } + + /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ + public function error($msg, $next_link = '', $stop = true, $priority = 1) + { + //$this->uses("error"); + //$this->error->message($msg, $priority); + if($stop == true){ + $msg = ' + + +Error + + + + +
+
+

Error

+
    +
  1. '.$msg; + if($next_link != '') $msg .= 'Next'; + $msg .= '
  2. +
+
+
+ +'; + die($msg); + } else { + echo $msg; + if($next_link != '') echo "Next"; + } + } + + /** Loads language */ + public function lng($text) + { + if($this->_language_inc != 1) { + //* loading global and module Wordbook + // TODO: this need to be made clearer somehow - pedro + @include_once(ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng'); + if(isset($_SESSION['s']['module']['name']) && isset($_SESSION['s']['language'])) { + $lng_file = ISPC_ROOT_PATH.'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng'; + if(!file_exists($lng_file)) $lng_file = ISPC_ROOT_PATH.'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng'; + @include_once($lng_file); + } + $this->_wb = $wb; + $this->_language_inc = 1; + } + if(!empty($this->_wb[$text])) { + $text = $this->_wb[$text]; + } + return $text; + } + + public function tpl_defaults() + { + $this->tpl->setVar('app_title', $this->_conf['app_title']); + $this->tpl->setVar('app_version', $this->_conf['app_version']); + $this->tpl->setVar('app_link', $this->_conf['app_link']); + if(isset($this->_conf['app_logo']) && $this->_conf['app_logo'] != '' && @is_file($this->_conf['app_logo'])){ + $this->tpl->setVar('app_logo', ''); + } else { + $this->tpl->setVar('app_logo', ' '); + } + + $this->tpl->setVar('phpsessid', session_id()); + + $this->tpl->setVar('theme', $_SESSION['s']['theme']); + $this->tpl->setVar('html_content_encoding', $this->_conf['html_content_encoding']); + + $this->tpl->setVar('delete_confirmation', $this->lng('delete_confirmation')); + //print_r($_SESSION); + if(isset($_SESSION['s']['module']['name'])) { + $this->tpl->setVar('app_module', $_SESSION['s']['module']['name']); + } + if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') { + $this->tpl->setVar('is_admin', 1); + } + if(isset($_SESSION['s']['user']) && $this->auth->has_clients($_SESSION['s']['user']['userid'])) { + $this->tpl->setVar('is_reseller', 1); + } + } + +} // end class + +//** Initialize application (app) object +//* possible future = new app($conf); +$app = new app(); + ?> \ No newline at end of file diff --git a/interface/web/admin/form/users.tform.php b/interface/web/admin/form/users.tform.php index 43c4cc700..2466b23d0 100644 --- a/interface/web/admin/form/users.tform.php +++ b/interface/web/admin/form/users.tform.php @@ -1,455 +1,455 @@ - 0 id must match with id of current user -$form['auth_preset']['userid'] = 0; -//* 0 = default groupid of the user, > 0 id must match with groupid of current user -$form['auth_preset']['groupid'] = 0; - -//** Permissions are: r = read, i = insert, u = update, d = delete -$form['auth_preset']['perm_user'] = 'riud'; -$form['auth_preset']['perm_group'] = 'riud'; -$form['auth_preset']['perm_other'] = ''; - -//* Pick out modules -$modules_list = array(); -$handle = @opendir(ISPC_WEB_PATH); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_dir(ISPC_WEB_PATH."/$file")) { - if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer') { - $modules_list[$file] = $file; - } - } - } -} - -//* Load themes -$themes_list = array(); -$handle = @opendir(ISPC_THEMES_PATH); -while ($file = @readdir ($handle)) { - if (substr($file, 0, 1) != '.') { - if(@is_dir(ISPC_THEMES_PATH."/$file")) { - $themes_list[$file] = $file; - } - } -} - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -//* Pick out groups -$groups_list = array(); -$tmp_records = $app->db->queryAllRecords('SELECT groupid, name FROM sys_group ORDER BY name'); -if(is_array($tmp_records)) { - foreach($tmp_records as $tmp_rec) { - $groups_list[$tmp_rec['groupid']] = $tmp_rec['name']; - } -} - -$form['tabs']['users'] = array ( - 'title' => 'Users', - 'width' => 80, - 'template' => 'templates/users_user_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_empty'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'username_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,50}$/', - 'errmsg'=> 'username_err'), - ), - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '30', - 'rows' => '', - 'cols' => '' - ), - 'passwort' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '100', - 'rows' => '', - 'cols' => '' - ), - 'modules' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'regex' => '', - 'errmsg' => '', - 'default' => 'admin,forms', - 'value' => $modules_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'startmodule' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $modules_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'app_theme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'RADIO', - 'regex' => '', - 'errmsg' => '', - 'default' => 'default', - 'value' => $themes_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'typ' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'RADIO', - 'regex' => '', - 'errmsg' => '', - 'default' => 'user', - 'value' => array ('user' => 'user', 'admin' => 'admin'), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'active' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'CHECKBOX', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => array(0 => 0,1 => 1), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '2', - 'rows' => '', - 'cols' => '' - ) - ################################## - # ENDE Datenbankfelder - ################################## - ) -); -/* -$form['tabs']['address'] = array ( - 'title' => 'Address', - 'width' => 80, - 'template' => 'templates/users_address_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'vorname' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'unternehmen' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'strasse' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'ort' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'plz' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'land' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'telefon' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ) - - ################################## - # ENDE Datenbankfelder - ################################## - ) -); -*/ - -$form['tabs']['groups'] = array ( - 'title' => 'Groups', - 'width' => 80, - 'template' => 'templates/users_groups_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'default_group' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $groups_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'groups' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $groups_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ) - - ################################## - # ENDE Datenbankfelder - ################################## - ) -); - + 0 id must match with id of current user +$form['auth_preset']['userid'] = 0; +//* 0 = default groupid of the user, > 0 id must match with groupid of current user +$form['auth_preset']['groupid'] = 0; + +//** Permissions are: r = read, i = insert, u = update, d = delete +$form['auth_preset']['perm_user'] = 'riud'; +$form['auth_preset']['perm_group'] = 'riud'; +$form['auth_preset']['perm_other'] = ''; + +//* Pick out modules +$modules_list = array(); +$handle = @opendir(ISPC_WEB_PATH); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_dir(ISPC_WEB_PATH."/$file")) { + if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer') { + $modules_list[$file] = $file; + } + } + } +} + +//* Load themes +$themes_list = array(); +$handle = @opendir(ISPC_THEMES_PATH); +while ($file = @readdir ($handle)) { + if (substr($file, 0, 1) != '.') { + if(@is_dir(ISPC_THEMES_PATH."/$file")) { + $themes_list[$file] = $file; + } + } +} + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +//* Pick out groups +$groups_list = array(); +$tmp_records = $app->db->queryAllRecords('SELECT groupid, name FROM sys_group ORDER BY name'); +if(is_array($tmp_records)) { + foreach($tmp_records as $tmp_rec) { + $groups_list[$tmp_rec['groupid']] = $tmp_rec['name']; + } +} + +$form['tabs']['users'] = array ( + 'title' => 'Users', + 'width' => 80, + 'template' => 'templates/users_user_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'username_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_err'), + ), + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '30', + 'rows' => '', + 'cols' => '' + ), + 'passwort' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '100', + 'rows' => '', + 'cols' => '' + ), + 'modules' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'regex' => '', + 'errmsg' => '', + 'default' => 'admin,forms', + 'value' => $modules_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'startmodule' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $modules_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'app_theme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'RADIO', + 'regex' => '', + 'errmsg' => '', + 'default' => 'default', + 'value' => $themes_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'typ' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'RADIO', + 'regex' => '', + 'errmsg' => '', + 'default' => 'user', + 'value' => array ('user' => 'user', 'admin' => 'admin'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'active' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'CHECKBOX', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => array(0 => 0,1 => 1), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '2', + 'rows' => '', + 'cols' => '' + ) + ################################## + # ENDE Datenbankfelder + ################################## + ) +); +/* +$form['tabs']['address'] = array ( + 'title' => 'Address', + 'width' => 80, + 'template' => 'templates/users_address_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'vorname' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'unternehmen' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'strasse' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'ort' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'plz' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'land' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'telefon' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ) + + ################################## + # ENDE Datenbankfelder + ################################## + ) +); +*/ + +$form['tabs']['groups'] = array ( + 'title' => 'Groups', + 'width' => 80, + 'template' => 'templates/users_groups_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'default_group' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $groups_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'groups' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $groups_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ) + + ################################## + # ENDE Datenbankfelder + ################################## + ) +); + ?> \ No newline at end of file diff --git a/interface/web/capp.php b/interface/web/capp.php index 636088122..354652ce3 100644 --- a/interface/web/capp.php +++ b/interface/web/capp.php @@ -1,53 +1,56 @@ -error($app->lng(301)); - -// lade Moduldaten in Session -if(is_file($mod."/lib/module.conf.php")) { - include_once($mod."/lib/module.conf.php"); - $_SESSION["s"]["module"] = $module; - echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; -} else { - $app->error($app->lng(302)); -} +error($app->lng(301)); + +// lade Moduldaten in Session +if(is_file($mod."/lib/module.conf.php")) { + include_once($mod."/lib/module.conf.php"); + $_SESSION["s"]["module"] = $module; + echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; +} else { + $app->error($app->lng(302)); +} ?> \ No newline at end of file diff --git a/interface/web/clang.php b/interface/web/clang.php deleted file mode 100644 index 518471291..000000000 --- a/interface/web/clang.php +++ /dev/null @@ -1,70 +0,0 @@ - - - - -42go - - - - - - - diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index f74977ac7..7497fdaed 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -1,696 +1,696 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 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 - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -$form["tabs"]['address'] = array ( - 'title' => "Address", - 'width' => 100, - 'template' => "templates/client_edit_address.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'company_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'contact_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'contact_error_empty'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_error_empty'), - 1 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'username_unique', - 'errmsg'=> 'username_error_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,50}$/', - 'errmsg'=> 'username_error_regex'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'MD5', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => $conf["language"], - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'usertheme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'default', - 'value' => array('default' => 'default'), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'street' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'zip' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'city' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'state' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'country' => array ( - 'datatype' => 'VARCHAR', - - 'formtype' => 'SELECT', - 'default' => 'DE', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', - 'keyfield'=> 'iso', - 'valuefield'=> 'printable_name' - ), - 'value' => '' - ), - 'telephone' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'mobile' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'internet' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => 'http://', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'icq' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'notes' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -$form["tabs"]['limits'] = array ( - 'title' => "Limits", - 'width' => 80, - 'template' => "templates/client_edit_limits.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'template_master' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'master_templates' - ), - 'value' => '' - ), - 'template_additional' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - ), - 'default_mailserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_maildomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_maildomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailbox' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailbox_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailalias' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailalias_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailforward' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailforward_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailcatchall' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailcatchall_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailrouting' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailrouting_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailfilter' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfilter_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_fetchmail' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfetchmail_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailquota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailquota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_wblist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_policy' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_policy_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_webserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_web_domain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'web_php_options' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') - ), - 'limit_web_aliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_aliasdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_subdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_subdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_ftp_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_ftp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_shell_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_shell_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'ssh_chroot' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') - ), - 'default_dnsserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_dns_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_zone_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_record' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_record_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_client' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_client_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_dbserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_database' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_database_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -/* -$form["tabs"]['ipaddress'] = array ( - 'title' => "IP Addresses", - 'width' => 100, - 'template' => "templates/client_edit_ipaddress.htm", - 'fields' => array ( - ################################## - # Beginn Datatable fields - ################################## - 'ip_address' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), - 'separator' => ';' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); -*/ - - + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 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 + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +$form["tabs"]['address'] = array ( + 'title' => "Address", + 'width' => 100, + 'template' => "templates/client_edit_address.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'company_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'contact_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'contact_error_empty'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_client', + 'function' => 'username_unique', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'MD5', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => $conf["language"], + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'usertheme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'default', + 'value' => array('default' => 'default'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'street' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'zip' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'city' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'state' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'country' => array ( + 'datatype' => 'VARCHAR', + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' + ), + 'telephone' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'mobile' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'internet' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'icq' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'notes' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'TEXTAREA', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '', + 'maxlength' => '', + 'rows' => '10', + 'cols' => '30' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/client_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), + 'default_mailserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_maildomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_maildomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailbox' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailbox_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailalias' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailforward' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailforward_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailcatchall' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailcatchall_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailrouting' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailrouting_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailfilter' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfilter_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_fetchmail' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfetchmail_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailquota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailquota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_wblist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_policy' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_policy_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_webserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_web_domain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_domain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + 'limit_web_aliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_aliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_subdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_subdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_ftp_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_ftp_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_shell_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_shell_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), + 'default_dnsserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_dns_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_record' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_record_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +/* +$form["tabs"]['ipaddress'] = array ( + 'title' => "IP Addresses", + 'width' => 100, + 'template' => "templates/client_edit_ipaddress.htm", + 'fields' => array ( + ################################## + # Beginn Datatable fields + ################################## + 'ip_address' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), + 'separator' => ';' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +*/ + + ?> \ No newline at end of file diff --git a/interface/web/content.php b/interface/web/content.php index cd19cd429..1b7690349 100644 --- a/interface/web/content.php +++ b/interface/web/content.php @@ -1,79 +1,78 @@ -render(); - if($page->status == 'OK') { - echo $content; - } elseif($page->status == 'REDIRECT') { - $target_parts = explode(':',$page->target); - $module = $target_parts[0]; - $page = $target_parts[1]; - if(!preg_match("/^[a-z]{2,20}$/i", $module)) die('target module name contains unallowed chars.'); - if(!preg_match("/^[a-z]{2,20}$/i", $page)) die('target page name contains unallowed chars.'); - - if(is_file("$module/$page.php")) { - include_once("$module/$page.php"); - - $classname = $module.'_'.$page; - $page = new $classname(); - - $content = $page->render(); - if($page->status == 'OK') { - echo $content; - } - } - - } - -} elseif (is_array($_SESSION["s"]['user']) or is_array($_SESSION["s"]["module"])) { - // If the user is logged in, we try to load the default page of the module - die('hhhhh'); - -} else { - die('Page does not exist.'); -} - +render(); + if($page->status == 'OK') { + echo $content; + } elseif($page->status == 'REDIRECT') { + $target_parts = explode(':',$page->target); + $module = $target_parts[0]; + $page = $target_parts[1]; + if(!preg_match("/^[a-z]{2,20}$/i", $module)) die('target module name contains unallowed chars.'); + if(!preg_match("/^[a-z]{2,20}$/i", $page)) die('target page name contains unallowed chars.'); + + if(is_file("$module/$page.php")) { + include_once("$module/$page.php"); + + $classname = $module.'_'.$page; + $page = new $classname(); + + $content = $page->render(); + if($page->status == 'OK') { + echo $content; + } + } + + } + +} elseif (is_array($_SESSION["s"]['user']) or is_array($_SESSION["s"]["module"])) { + // If the user is logged in, we try to load the default page of the module + die('- error -'); +} else { + die('Page does not exist.'); +} + ?> \ No newline at end of file diff --git a/interface/web/index.php b/interface/web/index.php index 8ec46be5e..9c312824e 100644 --- a/interface/web/index.php +++ b/interface/web/index.php @@ -1,101 +1,41 @@ -uses('tpl'); -$app->tpl->newTemplate('main.tpl.htm'); - -/* - -// Checke User Login and current module -if(!is_array($_SESSION["s"]['user']) or !is_array($_SESSION["s"]["module"])) { - // Loading Login Module - include_once('login/lib/module.conf.php'); - $_SESSION["s"]['module'] = $module; - $topnav[] = array( 'title' => "Login", - 'active' => 1); - $module = null; - unset($module); -} else { - // Loading modules of the user and building top navigation - $modules = explode(',',$_SESSION["s"]["user"]["modules"]); - if(is_array($modules)) { - foreach($modules as $mt) { - if(is_file($mt."/lib/module.conf.php")) { - include_once($mt."/lib/module.conf.php"); - $active = ($module["name"] == $_SESSION["s"]["module"]["name"])?1:0; - $topnav[] = array( 'title' => $app->lng($module["title"]), - 'active' => $active, - 'module' => $module["name"]); - } - } - } -} - -// Topnavigation -$app->tpl->setLoop('nav_top',$topnav); - -// Loading Module part -$app->tpl->setInclude('module_tpl',$_SESSION["s"]["module"]["template"]); - -// translating module navigation -$nav_translated = array(); -if(is_array($_SESSION["s"]["module"]["nav"])) { - foreach($_SESSION["s"]["module"]["nav"] as $nav) { - $tmp_items = array(); - foreach($nav["items"] as $item) { - $item["title"] = $app->lng($item["title"]); - $tmp_items[] = $item; - } - $nav["title"] = $app->lng($nav["title"]); - $nav["items"] = $tmp_items; - $nav_translated[] = $nav; - } -} else { - $nav_translated = null; -} - -// Loading left navigation -//$app->tpl->setLoop('nav_left',$_SESSION["s"]["module"]["nav"]); -$app->tpl->setLoop('nav_left',$nav_translated); - -// Setting startpage -$app->tpl->setVar('startpage',$_SESSION["s"]["module"]["startpage"]); -$app->tpl->setVar('navframe_page',$_SESSION["s"]["module"]["navframe_page"]); - -*/ - -$app->tpl_defaults(); -$app->tpl->pparse(); +uses('tpl'); +$app->tpl->newTemplate('main.tpl.htm'); + +$app->tpl_defaults(); +$app->tpl->pparse(); ?> \ No newline at end of file diff --git a/interface/web/login/index.php b/interface/web/login/index.php index b4e26b544..782aaed1c 100644 --- a/interface/web/login/index.php +++ b/interface/web/login/index.php @@ -1,171 +1,175 @@ -uses('tpl'); - $app->tpl->newTemplate('form.tpl.htm'); - - $error = ''; - - - //* Login Form was send - if(count($_POST) > 0) { - - // iporting variables - $ip = $app->db->quote(ip2long($_SERVER['REMOTE_ADDR'])); - $username = $app->db->quote($_POST['username']); - $passwort = $app->db->quote($_POST['passwort']); - - if($username != '' and $passwort != '') { - /* - * Check, if there is a "login as" instead of a "normal" login - */ - if (isset($_SESSION['s']['user'])){ - /* - * only the admin can "login as" so if the user is NOT a admin, we - * open the startpage (after killing the old session), so the user - * is logout and has to start again! - */ - if ($_SESSION['s']['user']['typ'] != 'admin') { - /* - * The actual user is NOT a admin, but maybe the admin - * has logged in as "normal" user bevore... - */ - if (isset($_SESSION['s_old'])&& ($_SESSION['s_old']['user']['typ'] == 'admin')){ - /* The "old" user is admin, so everything is ok */ - } - else { - die("You don't have the right to 'login as'!"); - } - } - $loginAs = true; - } - else { - /* normal login */ - $loginAs = false; - } - - //* Check if there already wrong logins - $sql = "SELECT * FROM `attempts_login` WHERE `ip`= '{$ip}' AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1"; - $alreadyfailed = $app->db->queryOneRecord($sql); - //* login to much wrong - if($alreadyfailed['times'] > 5) { - $error = $app->lng(1004); - } else { - if ($loginAs){ - $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and PASSWORT = '". $passwort. "'"; - } - else { - $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and ( PASSWORT = '".md5($passwort)."' or PASSWORT = password('$passwort') )"; - } - $user = $app->db->queryOneRecord($sql); - if($user) { - if($user['active'] == 1) { - // User login right, so attempts can be deleted - $sql = "DELETE FROM `attempts_login` WHERE `ip`='{$ip}'"; - $app->db->query($sql); - $user = $app->db->toLower($user); - if ($loginAs) $oldSession = $_SESSION['s']; - $_SESSION = array(); - if ($loginAs) $_SESSION['s_old'] = $oldSession; // keep the way back! - $_SESSION['s']['user'] = $user; - $_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default'; - $_SESSION['s']['language'] = $user['language']; - $_SESSION["s"]['theme'] = $_SESSION['s']['user']['theme']; - - if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) { - include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php'); - $_SESSION['s']['module'] = $module; - } - echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']; - - exit; - } else { - $error = $app->lng(1003); - } - } else { - if(!$alreadyfailed['times'] ) - { - //* user login the first time wrong - $sql = "INSERT INTO `attempts_login` (`ip`, `times`, `login_time`) VALUES ('{$ip}', 1, NOW())"; - $app->db->query($sql); - } elseif($alreadyfailed['times'] >= 1) { - //* update times wrong - $sql = "UPDATE `attempts_login` SET `times`=`times`+1, `login_time`=NOW() WHERE `login_time` >= '{$time}' LIMIT 1"; - $app->db->query($sql); - } - //* Incorrect login - Username and password incorrect - $error = $app->lng(1002); - if($app->db->errorMessage != '') $error .= '
'.$app->db->errorMessage != ''; - } - } - } else { - //* Username or password empty - $error = $app->lng(1001); - } - } - if($error != ''){ - $error = '

Error

'.$error.'
'; - } - - - - $app->tpl->setVar('error', $error); - $app->tpl->setInclude('content_tpl','login/templates/index.htm'); - $app->tpl_defaults(); - - $this->status = 'OK'; - - return $app->tpl->grab(); - - } // << end function - -} // << end class - +uses('tpl'); + $app->tpl->newTemplate('form.tpl.htm'); + + $error = ''; + + + //* Login Form was send + if(count($_POST) > 0) { + + //** Check variables + if(!preg_match("/^[\w\.\-\_]{1,64}$/", $_POST['username'])) $error = 'Username contains unallowed characters or is longer then 64 characters.'; + if(!preg_match("/^.{1,64}$/i", $_POST['passwort'])) $error = 'The password length is > 64 characters.'; + + //** iporting variables + $ip = $app->db->quote(ip2long($_SERVER['REMOTE_ADDR'])); + $username = $app->db->quote($_POST['username']); + $passwort = $app->db->quote($_POST['passwort']); + $loginAs = false; + + if($username != '' && $passwort != '' && $error == '') { + /* + * Check, if there is a "login as" instead of a "normal" login + */ + if (isset($_SESSION['s']['user']) && $_SESSION['s']['user']['active'] == 1){ + /* + * only the admin can "login as" so if the user is NOT a admin, we + * open the startpage (after killing the old session), so the user + * is logout and has to start again! + */ + if ($_SESSION['s']['user']['typ'] != 'admin') { + /* + * The actual user is NOT a admin, but maybe the admin + * has logged in as "normal" user bevore... + */ + if (isset($_SESSION['s_old'])&& ($_SESSION['s_old']['user']['typ'] == 'admin')){ + /* The "old" user is admin, so everything is ok */ + } + else { + die("You don't have the right to 'login as'!"); + } + } + $loginAs = true; + } + else { + /* normal login */ + $loginAs = false; + } + + //* Check if there are already wrong logins + $sql = "SELECT * FROM `attempts_login` WHERE `ip`= '{$ip}' AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1"; + $alreadyfailed = $app->db->queryOneRecord($sql); + //* login to much wrong + if($alreadyfailed['times'] > 5) { + $error = $app->lng(1004); + } else { + if ($loginAs){ + $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and PASSWORT = '". $passwort. "'"; + } else { + $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and ( PASSWORT = '".md5($passwort)."' or PASSWORT = password('$passwort') )"; + } + $user = $app->db->queryOneRecord($sql); + if($user) { + if($user['active'] == 1) { + // User login right, so attempts can be deleted + $sql = "DELETE FROM `attempts_login` WHERE `ip`='{$ip}'"; + $app->db->query($sql); + $user = $app->db->toLower($user); + if ($loginAs) $oldSession = $_SESSION['s']; + $_SESSION = array(); + if ($loginAs) $_SESSION['s_old'] = $oldSession; // keep the way back! + $_SESSION['s']['user'] = $user; + $_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default'; + $_SESSION['s']['language'] = $user['language']; + $_SESSION["s"]['theme'] = $_SESSION['s']['user']['theme']; + + if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) { + include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php'); + $_SESSION['s']['module'] = $module; + } + echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']; + + exit; + } else { + $error = $app->lng(1003); + } + } else { + if(!$alreadyfailed['times'] ) + { + //* user login the first time wrong + $sql = "INSERT INTO `attempts_login` (`ip`, `times`, `login_time`) VALUES ('{$ip}', 1, NOW())"; + $app->db->query($sql); + } elseif($alreadyfailed['times'] >= 1) { + //* update times wrong + $sql = "UPDATE `attempts_login` SET `times`=`times`+1, `login_time`=NOW() WHERE `login_time` >= '{$time}' LIMIT 1"; + $app->db->query($sql); + } + //* Incorrect login - Username and password incorrect + $error = $app->lng(1002); + if($app->db->errorMessage != '') $error .= '
'.$app->db->errorMessage != ''; + } + } + } else { + //* Username or password empty + $error = $app->lng(1001); + } + } + if($error != ''){ + $error = '

Error

'.$error.'
'; + } + + + + $app->tpl->setVar('error', $error); + $app->tpl->setInclude('content_tpl','login/templates/index.htm'); + $app->tpl_defaults(); + + $this->status = 'OK'; + + return $app->tpl->grab(); + + } // << end function + +} // << end class + ?> \ No newline at end of file diff --git a/interface/web/nav.php b/interface/web/nav.php index d48951730..73a637172 100644 --- a/interface/web/nav.php +++ b/interface/web/nav.php @@ -1,103 +1,102 @@ -uses('tpl'); - -//die('HHH'); - -//** Top Naviation -if(isset($_GET['nav']) && $_GET['nav'] == 'top') { - - $app->tpl->newTemplate('topnav.tpl.htm'); - - //* Check User Login and current module - if(!isset($_SESSION['s']['user']) or !is_array($_SESSION['s']['user']) or !is_array($_SESSION['s']['module'])) { - //* Loading Login Module - include_once('login/lib/module.conf.php'); - $_SESSION['s']['module'] = $module; - $topnav[] = array( 'title' => 'Login', - 'active' => 1); - $module = null; - unset($module); - } else { - //* Loading modules of the user and building top navigation - $modules = explode(',', $_SESSION['s']['user']['modules']); - if(is_array($modules)) { - foreach($modules as $mt) { - if(is_file($mt.'/lib/module.conf.php')) { - include_once($mt.'/lib/module.conf.php'); - $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; - $topnav[] = array( 'title' => $app->lng($module['title']), - 'active' => $active, - 'module' => $module['name']); - } - } - } - } - - //* Topnavigation - $app->tpl->setLoop('nav_top',$topnav); - -} - -//** Side Naviation -if(isset($_GET['nav']) && $_GET['nav'] == 'side') { - - $app->tpl->newTemplate('sidenav.tpl.htm'); - - //* translating module navigation - $nav_translated = array(); - if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) { - foreach($_SESSION['s']['module']['nav'] as $nav) { - $tmp_items = array(); - foreach($nav['items'] as $item) { - $item['title'] = $app->lng($item['title']); - $tmp_items[] = $item; - } - $nav['title'] = $app->lng($nav['title']); - $nav['startpage'] = $nav['items'][0]['link']; - $nav['items'] = $tmp_items; - $nav_translated[] = $nav; - } - } else { - $nav_translated = null; - } - - $app->tpl->setLoop('nav_left',$nav_translated); - -} - -$app->tpl_defaults(); -$app->tpl->pparse(); - +uses('tpl'); + +//** Top Naviation +if(isset($_GET['nav']) && $_GET['nav'] == 'top') { + + $app->tpl->newTemplate('topnav.tpl.htm'); + + //* Check User Login and current module + if(isset($_SESSION["s"]["user"]) && $_SESSION["s"]["user"]['active'] == 1 && is_array($_SESSION['s']['module'])) { + //* Loading modules of the user and building top navigation + $modules = explode(',', $_SESSION['s']['user']['modules']); + if(is_array($modules)) { + foreach($modules as $mt) { + if(is_file($mt.'/lib/module.conf.php')) { + if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); + include_once($mt.'/lib/module.conf.php'); + $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; + $topnav[] = array( 'title' => $app->lng($module['title']), + 'active' => $active, + 'module' => $module['name']); + } + } + } + } else { + //* Loading Login Module + include_once('login/lib/module.conf.php'); + $_SESSION['s']['module'] = $module; + $topnav[] = array( 'title' => 'Login', + 'active' => 1); + $module = null; + unset($module); + } + + //* Topnavigation + $app->tpl->setLoop('nav_top',$topnav); + +} + +//** Side Naviation +if(isset($_GET['nav']) && $_GET['nav'] == 'side') { + + $app->tpl->newTemplate('sidenav.tpl.htm'); + + //* translating module navigation + $nav_translated = array(); + if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) { + foreach($_SESSION['s']['module']['nav'] as $nav) { + $tmp_items = array(); + foreach($nav['items'] as $item) { + $item['title'] = $app->lng($item['title']); + $tmp_items[] = $item; + } + $nav['title'] = $app->lng($nav['title']); + $nav['startpage'] = $nav['items'][0]['link']; + $nav['items'] = $tmp_items; + $nav_translated[] = $nav; + } + } else { + $nav_translated = null; + } + + $app->tpl->setLoop('nav_left',$nav_translated); + +} + +$app->tpl_defaults(); +$app->tpl->pparse(); + ?> \ No newline at end of file -- GitLab