diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index f9ad1ecdce63bac613c99b4165b638b831cb8aff..81810b9cfc3bfd591dc339231d910c8db9e09b6a 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -760,7 +760,7 @@ class tform { } else { if($primary_id != 0) { $sql_update = substr($sql_update,0,-2); - $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id; + $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->getAuthSQL('u')." AND ".$this->formDef['db_table_idx']." = ".$primary_id; if($sql_ext_where != '') $sql .= " and ".$sql_ext_where; } else { $app->error("Primary ID fehlt!"); @@ -796,20 +796,21 @@ class tform { // definiere Tabs foreach( $this->formDef["tabs"] as $key => $tab) { - $tab['name'] = $key; + $tab['name'] = $key; if($tab['name'] == $active_tab) { - // Wenn Modul gesetzt, dann setzte template pfad relativ zu modul. - if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"]; + // Wenn Modul gesetzt, dann setzte template pfad relativ zu modul. + if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"]; - // überprüfe, ob das Template existiert, wenn nicht - // dann generiere das Template - if(!is_file($tab["template"])) { - $app->uses('tform_tpl_generator'); - $app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']); - } + // überprüfe, ob das Template existiert, wenn nicht + // dann generiere das Template + + if(!is_file($tab["template"])) { + $app->uses('tform_tpl_generator'); + $app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']); + } - $app->tpl->setInclude('content_tpl',$tab["template"]); + $app->tpl->setInclude('content_tpl',$tab["template"]); $tab["active"] = 1; $_SESSION["s"]["form"]["tab"] = $tab['name']; } else { diff --git a/interface/web/admin/form/server_ip.tform.php b/interface/web/admin/form/server_ip.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..b54a3f1b03d55dd9cdf74b00b30da159d9da47d4 --- /dev/null +++ b/interface/web/admin/form/server_ip.tform.php @@ -0,0 +1,128 @@ + 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 + +$form["tabs"]['server_ip'] = array ( + 'title' => "IP Address", + 'width' => 80, + 'template' => "templates/server_ip_edit.htm", + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'ip_address' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'ip_error_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'ip_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9\.]{7,15}$/', + 'errmsg'=> 'ip_err'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '15', + 'rows' => '', + 'cols' => '' + ), + 'virtualhost' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datenbankfelder + ################################## + ) +); +?> \ No newline at end of file diff --git a/interface/web/admin/lib/lang/en_server_ip.lng b/interface/web/admin/lib/lang/en_server_ip.lng new file mode 100644 index 0000000000000000000000000000000000000000..c14566e3cd4c5f1ae1566b923be14a05b6404b35 --- /dev/null +++ b/interface/web/admin/lib/lang/en_server_ip.lng @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/interface/web/admin/lib/lang/en_server_ip_list.lng b/interface/web/admin/lib/lang/en_server_ip_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..be99ce86af1e03d06a48fe40da1bb5f5c4565673 --- /dev/null +++ b/interface/web/admin/lib/lang/en_server_ip_list.lng @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/interface/web/admin/lib/module.conf.php b/interface/web/admin/lib/module.conf.php index b4962b7c2fe5b15e0a8ef4a108043c80a90fad79..0471b785e4a351db5618b8e3ccf036e4b63caf4f 100644 --- a/interface/web/admin/lib/module.conf.php +++ b/interface/web/admin/lib/module.conf.php @@ -49,7 +49,15 @@ $items[] = array( 'title' => "Edit server", 'target' => 'content', 'link' => 'admin/server_list.php'); - +$items[] = array( 'title' => "Add Server IP", + 'target' => 'content', + 'link' => 'admin/server_ip_edit.php'); + +$items[] = array( 'title' => "Edit Server IP", + 'target' => 'content', + 'link' => 'admin/server_ip_list.php'); + + $module["nav"][] = array( 'title' => 'Servers', 'open' => 1, 'items' => $items); diff --git a/interface/web/admin/list/server_ip.list.php b/interface/web/admin/list/server_ip.list.php new file mode 100644 index 0000000000000000000000000000000000000000..e8a1148870e4fa970bbfec7d11335a59d265e1a4 --- /dev/null +++ b/interface/web/admin/list/server_ip.list.php @@ -0,0 +1,73 @@ + "server_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "ip_address", + 'datatype' => "VARCHAR", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => ""); + + + +?> \ No newline at end of file diff --git a/interface/web/admin/server_ip_del.php b/interface/web/admin/server_ip_del.php new file mode 100644 index 0000000000000000000000000000000000000000..532e970051aa3ff9c6fa0398c6ba3164e84fd915 --- /dev/null +++ b/interface/web/admin/server_ip_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/admin/server_ip_edit.php b/interface/web/admin/server_ip_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..48d42c05ec5ebd8a1dc864b64a8889ab741bd530 --- /dev/null +++ b/interface/web/admin/server_ip_edit.php @@ -0,0 +1,56 @@ +uses('tpl,tform,tform_actions'); + +// let tform_actions handle the page +$app->tform_actions->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/admin/server_ip_list.php b/interface/web/admin/server_ip_list.php new file mode 100644 index 0000000000000000000000000000000000000000..f70195344c7a162492eb2ac596387de439720876 --- /dev/null +++ b/interface/web/admin/server_ip_list.php @@ -0,0 +1,54 @@ +uses('listform_actions'); +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/admin/templates/server_ip_edit.htm b/interface/web/admin/templates/server_ip_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..6e8ce774a7083fd9861adf03c39de2aeb9f7fafd --- /dev/null +++ b/interface/web/admin/templates/server_ip_edit.htm @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='server_id_txt'}: + +
{tmpl_var name='ip_address_txt'}:
{tmpl_var name='virtualhost_txt'}:{tmpl_var name='virtualhost'}
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/admin/templates/server_ip_list.htm b/interface/web/admin/templates/server_ip_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..d6ab661b104665df308c734515b57f909c1b505f --- /dev/null +++ b/interface/web/admin/templates/server_ip_list.htm @@ -0,0 +1,25 @@ +

+


+ + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="server_id"}{tmpl_var name="ip_address"}[{tmpl_var name='delete_txt'}]
\ No newline at end of file diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php index fca18dfe4995d84485d838a23bd733f8f1f9d762..b7e9cfd6794258359932a2cc2182c4cd557c1d9e 100644 --- a/interface/web/client/client_edit.php +++ b/interface/web/client/client_edit.php @@ -66,7 +66,7 @@ class page_action extends tform_actions { $username = addslashes($this->dataRecord["username"]); $password = addslashes($this->dataRecord["password"]); - $modules = 'mail'; + $modules = 'mail,sites'; $startmodule = 'mail'; $usertheme = addslashes($this->dataRecord["usertheme"]); $type = 'user'; diff --git a/interface/web/js/scrigo.js b/interface/web/js/scrigo.js index f72a0fd67f18f5a3bb2e84da15aac42362388bbf..36d98a51d0c6d54c35ec399510a100cb0fa618af 100644 --- a/interface/web/js/scrigo.js +++ b/interface/web/js/scrigo.js @@ -194,4 +194,18 @@ function reportError(request) if(window.confirm("")) { loadContent(link); } +} + +function loadContentInto(elementid,pagename) { + var itemContentCallback = { + success: function(o) { + document.getElementById(elementid).innerHTML = o.responseText; + }, + failure: function(o) { + alert('Ajax Request was not successful.'); + } + } + + + var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback); } \ No newline at end of file diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php index 13333b19634343d981d03205f0d9f9b18624ee49..b8ca43bc3a6a8c58ae7ada751a50de5eee704f21 100644 --- a/interface/web/mail/mail_domain_edit.php +++ b/interface/web/mail/mail_domain_edit.php @@ -1,6 +1,6 @@ db->queryAllRecords($sql); + // $ip_select = ""; + $ip_select = ""; + if(is_array($ips)) { + foreach( $ips as $ip) { + //$selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':''; + $ip_select .= "\r\n"; + } + } + unset($tmp); + unset($ips); +} + +echo $ip_select; +?> \ No newline at end of file diff --git a/interface/web/sites/form/ftp_user.tform.php b/interface/web/sites/form/ftp_user.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..232561a35a5ef7c35a54b4ed13c8adab6642d9f4 --- /dev/null +++ b/interface/web/sites/form/ftp_user.tform.php @@ -0,0 +1,237 @@ + 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 + +$form["tabs"]['ftp'] = array ( + 'title' => "FTP User", + 'width' => 100, + 'template' => "templates/ftp_user_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'parent_domain_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'value' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{1,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'quota_size' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'quota_size_error_empty'), + ), + 'default' => '-1', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +if($_SESSION["s"]["user"]["typ"] == 'admin') { + +$form["tabs"]['advanced'] = array ( + 'title' => "Options", + 'width' => 100, + 'template' => "templates/ftp_user_advanced.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'uid' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'uid_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '5', + 'maxlength' => '5' + ), + 'gid' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'uid_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '5', + 'maxlength' => '5' + ), + 'dir' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'directory_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'quota_files' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'quota_files_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'ul_ratio' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'ul_ratio_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'dl_ratio' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'qdl_ratio_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'ul_bandwidth' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'ul_bandwidth_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'dl_bandwidth' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'dl_bandwidth_error_empty'), + ), + 'default' => '0', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +} + + +?> \ No newline at end of file diff --git a/interface/web/sites/form/web_aliasdomain.tform.php b/interface/web/sites/form/web_aliasdomain.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..7ad29e68c98fac46549a229f28c5e3944e9a18dd --- /dev/null +++ b/interface/web/sites/form/web_aliasdomain.tform.php @@ -0,0 +1,132 @@ + 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 + +$form["tabs"]['domain'] = array ( + 'title' => "Domain", + 'width' => 100, + 'template' => "templates/web_aliasdomain_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'domain' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'domain_error_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'domain_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/', + 'errmsg'=> 'domain_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain') + ), + 'parent_domain_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'value' => '' + ), + 'redirect_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L') + ), + 'redirect_path' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + +?> \ No newline at end of file diff --git a/interface/web/sites/form/web_domain.tform.php b/interface/web/sites/form/web_domain.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..383ac61637fed0ee154cbb18fd149ed025651294 --- /dev/null +++ b/interface/web/sites/form/web_domain.tform.php @@ -0,0 +1,260 @@ + 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 + +$form["tabs"]['domain'] = array ( + 'title' => "Domain", + 'width' => 100, + 'template' => "templates/web_domain_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'ip_address' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT ip_address,ip_address FROM server_ip WHERE {AUTHSQL} ORDER BY ip_address', + 'keyfield'=> 'ip_address', + 'valuefield'=> 'ip_address' + ), + 'value' => '' + ), + 'domain' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'domain_error_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'domain_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/', + 'errmsg'=> 'domain_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('vhost' => 'Site', 'alias' => 'Alias') + ), + 'parent_domain_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'site' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'value' => '' + ), + 'vhost_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('name' => 'Namebased', 'ip' => 'IP-Based') + ), + 'hd_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'hd_quota_error_empty'), + ), + 'default' => '-1', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'traffic_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'traffic_quota_error_empty'), + ), + 'default' => '-1', + 'value' => '', + 'width' => '7', + 'maxlength' => '7' + ), + 'cgi' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + 'ssi' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + 'suexec' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + 'php' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('' => 'Disabled', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +$form["tabs"]['redirect'] = array ( + 'title' => "Redirect", + 'width' => 100, + 'template' => "templates/web_domain_redirect.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'redirect_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L') + ), + 'redirect_path' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +if($_SESSION["s"]["user"]["typ"] == 'admin') { + +$form["tabs"]['advanced'] = array ( + 'title' => "Options", + 'width' => 100, + 'template' => "templates/web_domain_advanced.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'document_root' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'documentroot_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'system_user' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'sysuser_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'system_group' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'sysgroup_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +} + + +?> \ No newline at end of file diff --git a/interface/web/sites/form/web_subdomain.tform.php b/interface/web/sites/form/web_subdomain.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..46399c8059a23764b82988d701a9ca664cd94b94 --- /dev/null +++ b/interface/web/sites/form/web_subdomain.tform.php @@ -0,0 +1,132 @@ + 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 + +$form["tabs"]['domain'] = array ( + 'title' => "Domain", + 'width' => 100, + 'template' => "templates/web_subdomain_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'domain' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'domain_error_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'domain_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/', + 'errmsg'=> 'domain_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain') + ), + 'parent_domain_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'value' => '' + ), + 'redirect_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'y', + 'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L') + ), + 'redirect_path' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + +?> \ No newline at end of file diff --git a/interface/web/sites/ftp_user_del.php b/interface/web/sites/ftp_user_del.php new file mode 100644 index 0000000000000000000000000000000000000000..e9b536ff96f91813bf601300e531b916ad0c1e91 --- /dev/null +++ b/interface/web/sites/ftp_user_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/ftp_user_edit.php b/interface/web/sites/ftp_user_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..ba709b821874e52eeda4b528a3270c6a795c4fb7 --- /dev/null +++ b/interface/web/sites/ftp_user_edit.php @@ -0,0 +1,62 @@ +uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/ftp_user_list.php b/interface/web/sites/ftp_user_list.php new file mode 100644 index 0000000000000000000000000000000000000000..516739fc8dc97d27b634c3b7c00cadb00cf79e9c --- /dev/null +++ b/interface/web/sites/ftp_user_list.php @@ -0,0 +1,58 @@ +uses('listform_actions'); + +// Limit the results to alias domains +//$app->listform_actions->SQLExtWhere = "type = 'subdomain'"; + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/sites/lib/admin.conf.php b/interface/web/sites/lib/admin.conf.php new file mode 100644 index 0000000000000000000000000000000000000000..a45d4403455c5c46f438046f088398e241cbc3d9 --- /dev/null +++ b/interface/web/sites/lib/admin.conf.php @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_ftp_user.lng b/interface/web/sites/lib/lang/en_ftp_user.lng new file mode 100644 index 0000000000000000000000000000000000000000..45fb750908bfdbc383a124dc5b4929b1550296ce --- /dev/null +++ b/interface/web/sites/lib/lang/en_ftp_user.lng @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_ftp_user_list.lng b/interface/web/sites/lib/lang/en_ftp_user_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..582940c4b95175f02f8b6fca19e3dc74ff00f46f --- /dev/null +++ b/interface/web/sites/lib/lang/en_ftp_user_list.lng @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_aliasdomain_list.lng b/interface/web/sites/lib/lang/en_web_aliasdomain_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..90fe1ea167c9a5b67a9575274490632300b694f9 --- /dev/null +++ b/interface/web/sites/lib/lang/en_web_aliasdomain_list.lng @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_domain.lng b/interface/web/sites/lib/lang/en_web_domain.lng new file mode 100644 index 0000000000000000000000000000000000000000..38e0510f40c8e1d3f12a2d458b5276351435cc13 --- /dev/null +++ b/interface/web/sites/lib/lang/en_web_domain.lng @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_domain_list.lng b/interface/web/sites/lib/lang/en_web_domain_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..1d38f83caf2de79d5cf979a10156af39b96098f2 --- /dev/null +++ b/interface/web/sites/lib/lang/en_web_domain_list.lng @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_subdomain_list.lng b/interface/web/sites/lib/lang/en_web_subdomain_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..720b428759ab0b54be3c43d63724be1b77c21aa2 --- /dev/null +++ b/interface/web/sites/lib/lang/en_web_subdomain_list.lng @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php new file mode 100644 index 0000000000000000000000000000000000000000..8be6e6ef683f6c44120ee0f3c48e1883b37f3eb4 --- /dev/null +++ b/interface/web/sites/lib/module.conf.php @@ -0,0 +1,51 @@ + "Domain", + 'target' => 'content', + 'link' => 'sites/web_domain_list.php'); + + +$items[] = array( 'title' => "Subdomain", + 'target' => 'content', + 'link' => 'sites/web_subdomain_list.php'); + + +$items[] = array( 'title' => "Aliasdomain", + 'target' => 'content', + 'link' => 'sites/web_aliasdomain_list.php'); + +$module["nav"][] = array( 'title' => 'Websites', + 'open' => 1, + 'items' => $items); + +// aufräumen +unset($items); + +/* + FTP User menu +*/ + +$items[] = array( 'title' => "FTP-User", + 'target' => 'content', + 'link' => 'sites/ftp_user_list.php'); + + +$module["nav"][] = array( 'title' => 'FTP', + 'open' => 1, + 'items' => $items); + +// aufräumen +unset($items); + + +?> \ No newline at end of file diff --git a/interface/web/sites/list/ftp_user.list.php b/interface/web/sites/list/ftp_user.list.php new file mode 100644 index 0000000000000000000000000000000000000000..68fdb7515cf4d7e786531d7acbcf55e7c210b9f5 --- /dev/null +++ b/interface/web/sites/list/ftp_user.list.php @@ -0,0 +1,99 @@ + "active", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('y' => "Yes",'n' => "No")); + + +$liste["item"][] = array( 'field' => "server_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "parent_domain_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "username", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/sites/list/web_aliasdomain.list.php b/interface/web/sites/list/web_aliasdomain.list.php new file mode 100644 index 0000000000000000000000000000000000000000..a80d2f956ae4df04d63e58d74545b4487eb93644 --- /dev/null +++ b/interface/web/sites/list/web_aliasdomain.list.php @@ -0,0 +1,99 @@ + "active", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('y' => "Yes",'n' => "No")); + + +$liste["item"][] = array( 'field' => "server_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "parent_domain_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "domain", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/sites/list/web_domain.list.php b/interface/web/sites/list/web_domain.list.php new file mode 100644 index 0000000000000000000000000000000000000000..38ec403ff39d0273c6aa770a9ee9aea2e06d9bdb --- /dev/null +++ b/interface/web/sites/list/web_domain.list.php @@ -0,0 +1,85 @@ + "active", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('y' => "Yes",'n' => "No")); + + +$liste["item"][] = array( 'field' => "server_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "domain", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/sites/list/web_subdomain.list.php b/interface/web/sites/list/web_subdomain.list.php new file mode 100644 index 0000000000000000000000000000000000000000..85c61bd21f4762ec1629c960460873387d67c437 --- /dev/null +++ b/interface/web/sites/list/web_subdomain.list.php @@ -0,0 +1,99 @@ + "active", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('y' => "Yes",'n' => "No")); + + +$liste["item"][] = array( 'field' => "server_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "parent_domain_id", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", + 'keyfield'=> 'domain_id', + 'valuefield'=> 'domain' + ), + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "domain", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/sites/templates/ftp_user_advanced.htm b/interface/web/sites/templates/ftp_user_advanced.htm new file mode 100644 index 0000000000000000000000000000000000000000..81e55387b12f05ed1a35eb5ee50f3c50f9fa11e9 --- /dev/null +++ b/interface/web/sites/templates/ftp_user_advanced.htm @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='uid_txt'}:
{tmpl_var name='gid_txt'}:
{tmpl_var name='dir_txt'}:
{tmpl_var name='quota_files_txt'}:
{tmpl_var name='ul_ratio_txt'}:
{tmpl_var name='dl_ratio_txt'}:
{tmpl_var name='ul_bandwidth_txt'}:
{tmpl_var name='dl_bandwidth_txt'}:
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/ftp_user_edit.htm b/interface/web/sites/templates/ftp_user_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..3d3bd98d729d86fea1b9faaa235c3fffe5c5e89f --- /dev/null +++ b/interface/web/sites/templates/ftp_user_edit.htm @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='server_id_txt'}: + +
{tmpl_var name='parent_domain_id_txt'}: + +
{tmpl_var name='username_txt'}:
{tmpl_var name='password_txt'}:
{tmpl_var name='quota_size_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/ftp_user_list.htm b/interface/web/sites/templates/ftp_user_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..59b89f63c1a1b89996700d5a59b37e2d6abb026e --- /dev/null +++ b/interface/web/sites/templates/ftp_user_list.htm @@ -0,0 +1,31 @@ +

+


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="parent_domain_id"}{tmpl_var name="username"}[{tmpl_var name='delete_txt'}]
\ No newline at end of file diff --git a/interface/web/sites/templates/web_aliasdomain_edit.htm b/interface/web/sites/templates/web_aliasdomain_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..215153c6b9778dc5bbbedeb57123dcd02d07c6e9 --- /dev/null +++ b/interface/web/sites/templates/web_aliasdomain_edit.htm @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='domain_txt'}:
{tmpl_var name='parent_domain_id_txt'}: + +
{tmpl_var name='redirect_type_txt'}: + +
{tmpl_var name='redirect_path_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/web_aliasdomain_list.htm b/interface/web/sites/templates/web_aliasdomain_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..bc632bb184d3ead740dcc750c1c37b7c0bc31a58 --- /dev/null +++ b/interface/web/sites/templates/web_aliasdomain_list.htm @@ -0,0 +1,31 @@ +

+


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="parent_domain_id"}{tmpl_var name="domain"}[{tmpl_var name='delete_txt'}]
\ No newline at end of file diff --git a/interface/web/sites/templates/web_domain_advanced.htm b/interface/web/sites/templates/web_domain_advanced.htm new file mode 100644 index 0000000000000000000000000000000000000000..51e65268debedd18e4d1459e15ba291184076d49 --- /dev/null +++ b/interface/web/sites/templates/web_domain_advanced.htm @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='document_root_txt'}:
{tmpl_var name='system_user_txt'}:
{tmpl_var name='system_group_txt'}:
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/web_domain_edit.htm b/interface/web/sites/templates/web_domain_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..6310bd8689919a8817dc8cd86b51a4410fd28f33 --- /dev/null +++ b/interface/web/sites/templates/web_domain_edit.htm @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='server_id_txt'}: + +
{tmpl_var name='client_txt'}: + +
{tmpl_var name='ip_address_txt'}: + +
{tmpl_var name='domain_txt'}:
{tmpl_var name='hd_quota_txt'}: MB
{tmpl_var name='traffic_quota_txt'}: MB
{tmpl_var name='cgi_txt'}:{tmpl_var name='cgi'}
{tmpl_var name='ssi_txt'}:{tmpl_var name='ssi'}
{tmpl_var name='suexec_txt'}:{tmpl_var name='suexec'}
{tmpl_var name='php_txt'}: + +
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/web_domain_list.htm b/interface/web/sites/templates/web_domain_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..ed77d8fb312ad6c8f4290a79948412f1f3b2ee3b --- /dev/null +++ b/interface/web/sites/templates/web_domain_list.htm @@ -0,0 +1,28 @@ +

+


+ + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="domain"}[{tmpl_var name='delete_txt'}]
\ No newline at end of file diff --git a/interface/web/sites/templates/web_domain_redirect.htm b/interface/web/sites/templates/web_domain_redirect.htm new file mode 100644 index 0000000000000000000000000000000000000000..97000edea89bc3e618dc3855ae2d710826ae6d8e --- /dev/null +++ b/interface/web/sites/templates/web_domain_redirect.htm @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + +
{tmpl_var name='redirect_type_txt'}: + +
{tmpl_var name='redirect_path_txt'}:
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/web_subdomain_edit.htm b/interface/web/sites/templates/web_subdomain_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..794183e641eefdb91256fbaf7c0c6724d5748043 --- /dev/null +++ b/interface/web/sites/templates/web_subdomain_edit.htm @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='domain_txt'}: + . +
{tmpl_var name='redirect_type_txt'}: + +
{tmpl_var name='redirect_path_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
 
  +
+
+ \ No newline at end of file diff --git a/interface/web/sites/templates/web_subdomain_list.htm b/interface/web/sites/templates/web_subdomain_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..02033c34aa830915f29b2db647df3b04338f1dba --- /dev/null +++ b/interface/web/sites/templates/web_subdomain_list.htm @@ -0,0 +1,31 @@ +

+


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="parent_domain_id"}{tmpl_var name="domain"}[{tmpl_var name='delete_txt'}]
\ No newline at end of file diff --git a/interface/web/sites/web_aliasdomain_del.php b/interface/web/sites/web_aliasdomain_del.php new file mode 100644 index 0000000000000000000000000000000000000000..c4a600d92cc06a8154c5f398c13d2b55828a6a1a --- /dev/null +++ b/interface/web/sites/web_aliasdomain_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_aliasdomain_edit.php b/interface/web/sites/web_aliasdomain_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..e7cef105329f1ee87706e8def7733285bf9dcab6 --- /dev/null +++ b/interface/web/sites/web_aliasdomain_edit.php @@ -0,0 +1,91 @@ +uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + /* + function onShowEnd() { + global $app, $conf; + + // Get the record of the parent domain + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); + + $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]); + $app->tpl->setVar("domain",$this->dataRecord["domain"]); + + parent::onShowEnd(); + + } + */ + + function onSubmit() { + global $app, $conf; + + // Get the record of the parent domain + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); + + // Set a few fixed values + $this->dataRecord["type"] = 'alias'; + $this->dataRecord["server_id"] = $parent_domain["server_id"]; + //$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"]; + + + parent::onSubmit(); + } + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_aliasdomain_list.php b/interface/web/sites/web_aliasdomain_list.php new file mode 100644 index 0000000000000000000000000000000000000000..1cf1b6605e27022fd6daef3774758fa0c142abe9 --- /dev/null +++ b/interface/web/sites/web_aliasdomain_list.php @@ -0,0 +1,58 @@ +uses('listform_actions'); + +// Limit the results to alias domains +$app->listform_actions->SQLExtWhere = "type = 'alias'"; + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/sites/web_domain_del.php b/interface/web/sites/web_domain_del.php new file mode 100644 index 0000000000000000000000000000000000000000..27c64e662b29d4a02624fd573c9a4fce5eb5cea4 --- /dev/null +++ b/interface/web/sites/web_domain_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..e912002cc55538eb764917678faa3c6874342521 --- /dev/null +++ b/interface/web/sites/web_domain_edit.php @@ -0,0 +1,234 @@ +uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onShowEnd() { + global $app, $conf; + + if($_SESSION["s"]["user"]["typ"] != 'admin') { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + // Set the webserver to the default server of the client + $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_webserver]"); + $app->tpl->setVar("server_id",""); + unset($tmp); + + // Fill the IP select field with the IP addresses that are allowed for this client + + } else { + + // The user is admin, so we fill in all IP addresses of the server + if($this->id > 0) { + $server_id = $this->dataRecord["server_id"]; + } else { + // Get the first server ID + $tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1"); + $server_id = $tmp['server_id']; + } + + $sql = "SELECT ip_address FROM server_ip WHERE server_id = $server_id"; + $ips = $app->db->queryAllRecords($sql); + $ip_select = ""; + //$ip_select = ""; + if(is_array($ips)) { + foreach( $ips as $ip) { + $selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':''; + $ip_select .= "\r\n"; + } + } + $app->tpl->setVar("ip_address",$ip_select); + unset($tmp); + unset($ips); + + // Fill the client select field + $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; + $clients = $app->db->queryAllRecords($sql); + $client_select = ""; + if(is_array($clients)) { + foreach( $clients as $client) { + $selected = ($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':''; + $client_select .= "\r\n"; + } + } + $app->tpl->setVar("client_group_id",$client_select); + + + } + + parent::onShowEnd(); + } + + function onSubmit() { + global $app, $conf; + + // Set a few fixed values + $this->dataRecord["parent_domain_id"] = 0; + $this->dataRecord["type"] = 'vhost'; + $this->dataRecord["vhost_type"] = 'name'; + + if($_SESSION["s"]["user"]["typ"] != 'admin') { + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + // When the record is updated + if($this->id > 0) { + // restore the server ID if the user is not admin and record is edited + $tmp = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ".intval($this->id)); + $this->dataRecord["server_id"] = $tmp["server_id"]; + unset($tmp); + // When the record is inserted + } else { + // set the server ID to the default mailserver of the client + $this->dataRecord["server_id"] = $client["default_webserver"]; + + /* + // Check if the user may add another mail_domain + if($client["limit_maildomain"] >= 0) { + $tmp = $app->db->queryOneRecord("SELECT count(domain_id) as number FROM mail_domain WHERE sys_groupid = $client_group_id"); + if($tmp["number"] >= $client["limit_maildomain"]) { + $app->error($app->tform->wordbook["limit_webdomain_txt"]); + } + } + */ + } + + // Clients may not set the client_group_id, so we unset them if user is not a admin + unset($this->dataRecord["client_group_id"]); + } + + + parent::onSubmit(); + } + + function onAfterInsert() { + global $app, $conf; + + // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); + } + + // Get configuration for the web system + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web'); + $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]); + + // get the ID of the client + if($_SESSION["s"]["user"]["typ"] != 'admin') { + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + $client_id = intval($client["client_id"]); + } else { + $client_id = intval($this->dataRecord["client_group_id"]); + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"])); + $client_id = intval($client["client_id"]); + } + + // Set the values for document_root, system_user and system_group + $system_user = 'web'.$this->id; + $system_group = 'client'.$client_id; + $document_root = str_replace("[client_id]",$client_id,$document_root); + + $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id; + $app->db->query($sql); + } + + function onAfterUpdate() { + global $app, $conf; + + // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); + } + + // Get configuration for the web system + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web'); + $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]); + + // get the ID of the client + if($_SESSION["s"]["user"]["typ"] != 'admin') { + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + $client_id = intval($client["client_id"]); + } else { + $client_id = intval($this->dataRecord["client_group_id"]); + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"])); + $client_id = intval($client["client_id"]); + } + + // Set the values for document_root, system_user and system_group + $system_user = 'web'.$this->id; + $system_group = 'client'.$client_id; + $document_root = str_replace("[client_id]",$client_id,$document_root); + + $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id; + $app->db->query($sql); + + } + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_domain_list.php b/interface/web/sites/web_domain_list.php new file mode 100644 index 0000000000000000000000000000000000000000..edc7e7febf6c0b109a5e61e38ee6066eb2cb4927 --- /dev/null +++ b/interface/web/sites/web_domain_list.php @@ -0,0 +1,58 @@ +uses('listform_actions'); + +// Limit the results to alias domains +// $app->listform_actions->SQLExtWhere = "type = 'local'"; + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/sites/web_subdomain_del.php b/interface/web/sites/web_subdomain_del.php new file mode 100644 index 0000000000000000000000000000000000000000..6c00c95da889461cf8ac062db2e917b33cdd76d9 --- /dev/null +++ b/interface/web/sites/web_subdomain_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_subdomain_edit.php b/interface/web/sites/web_subdomain_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..e2aaca9e21798ae41eb31735ed711633d1940d08 --- /dev/null +++ b/interface/web/sites/web_subdomain_edit.php @@ -0,0 +1,89 @@ +uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onShowEnd() { + global $app, $conf; + + // Get the record of the parent domain + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); + + $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]); + $app->tpl->setVar("domain",$this->dataRecord["domain"]); + + parent::onShowEnd(); + + } + + function onSubmit() { + global $app, $conf; + + // Get the record of the parent domain + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); + + // Set a few fixed values + $this->dataRecord["type"] = 'subdomain'; + $this->dataRecord["server_id"] = $parent_domain["server_id"]; + $this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"]; + + + parent::onSubmit(); + } + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/web_subdomain_list.php b/interface/web/sites/web_subdomain_list.php new file mode 100644 index 0000000000000000000000000000000000000000..e104ace5c2bc38401162d8a8732904d81d72ec37 --- /dev/null +++ b/interface/web/sites/web_subdomain_list.php @@ -0,0 +1,58 @@ +uses('listform_actions'); + +// Limit the results to alias domains +$app->listform_actions->SQLExtWhere = "type = 'subdomain'"; + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/server/conf/apache.conf.master b/server/conf/apache.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..16f3875596eccda6b2f67e9ecb3078477284df41 --- /dev/null +++ b/server/conf/apache.conf.master @@ -0,0 +1,2 @@ + +NameVirtualHost *:80 diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..ca4aa341435446490d04554cb7655aa857490798 --- /dev/null +++ b/server/conf/vhost.conf.master @@ -0,0 +1,25 @@ +NameVirtualHost *:80 + +:80> + DocumentRoot + ServerName + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/mods-enabled/web_module.inc.php b/server/mods-enabled/web_module.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..a32b8b5e40c8dfa4eea22691717a6045034a753f --- /dev/null +++ b/server/mods-enabled/web_module.inc.php @@ -0,0 +1,86 @@ +plugins->announceEvents($this->module_name,$this->actions_available); + + /* + As we want to get notified of any changes on several database tables, + we register for them. + + The following function registers the function "functionname" + to be executed when a record for the table "dbtable" is + processed in the sys_datalog. "classname" is the name of the + class that contains the function functionname. + */ + + $app->modules->registerTableHook('web_domain','mail_module','process'); + + } + + /* + This function is called when a change in one of the registered tables is detected. + The function then raises the events for the plugins. + */ + + function process($tablename,$action,$data) { + global $app; + + switch ($tablename) { + case 'web_domain': + if($action == 'i') $app->plugins->raiseEvent('web_domain_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('web_domain_update',$data); + if($action == 'd') $app->plugins->raiseEvent('web_domain_delete',$data); + break; + } // end switch + } // end function + +} // end class + +?> \ No newline at end of file diff --git a/server/plugins-enabled/apache2_plugin.inc.php b/server/plugins-enabled/apache2_plugin.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..a96d317a45e104b87dfd8ef9b9052e86490bab27 --- /dev/null +++ b/server/plugins-enabled/apache2_plugin.inc.php @@ -0,0 +1,83 @@ +plugin_name; + + + + /* + This function is called when the plugin is loaded + */ + + function onLoad() { + global $app; + + /* + Register for the events + */ + + $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert'); + $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update'); + $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete'); + + } + + function insert($event_name,$data) { + global $app, $conf; + + + + + } + + + function update($event_name,$data) { + global $app, $conf; + + // load the server configuration options + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config($conf["server_id"], 'web'); + + + } + + function delete($event_name,$data) { + global $app, $conf; + + + } + + +} // end class + +?> \ No newline at end of file