diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index e0a3a925b23c68f6a404539281308bb2b4d314c5..062bea78a605121bf99a3f0031409e02bb46b829 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -89,6 +89,7 @@ CREATE TABLE `client` ( `limit_ftp_user` int(11) NOT NULL default '-1', `limit_shell_user` int(11) NOT NULL default '0', `ssh_chroot` varchar(255) NOT NULL DEFAULT 'no,jailkit,ssh-chroot', + `limit_webdav_user` int(11) NOT NULL default '0', `default_dnsserver` int(11) unsigned NOT NULL default '1', `limit_dns_zone` int(11) NOT NULL default '-1', `limit_dns_record` int(11) NOT NULL default '-1', @@ -145,6 +146,7 @@ CREATE TABLE `client_template` ( `limit_web_aliasdomain` int(11) NOT NULL default '-1', `limit_ftp_user` int(11) NOT NULL default '-1', `limit_shell_user` int(11) NOT NULL default '0', + `limit_webdav_user` int(11) NOT NULL default '0', `limit_dns_zone` int(11) NOT NULL default '-1', `limit_dns_record` int(11) NOT NULL default '-1', `limit_database` int(11) NOT NULL default '-1', @@ -1124,6 +1126,29 @@ CREATE TABLE `web_traffic` ( ) ENGINE=MyISAM; +-- -------------------------------------------------------- + +-- +-- Table structure for table `webdav_user` +-- + +CREATE TABLE `webdav_user` ( + `webdav_user_id` int(11) unsigned NOT NULL auto_increment, + `sys_userid` int(11) unsigned NOT NULL default '0', + `sys_groupid` int(11) unsigned NOT NULL default '0', + `sys_perm_user` varchar(5) default NULL, + `sys_perm_group` varchar(5) default NULL, + `sys_perm_other` varchar(5) default NULL, + `server_id` int(11) unsigned NOT NULL default '0', + `parent_domain_id` int(11) unsigned NOT NULL default '0', + `username` varchar(64) default NULL, + `password` varchar(64) default NULL, + `active` enum('n','y') NOT NULL default 'y', + `dir` varchar(255) default NULL, + PRIMARY KEY (`webdav_user_id`) +) ENGINE=MyISAM + + -- -------------------------------------------------------- -- diff --git a/install/tpl/config.inc.php.master b/install/tpl/config.inc.php.master index c5a2d52ae3cc49a837c8a00271f7221b0a14a822..63d95fb8d5ce1d36e05a21484eb0e36c35de5157 100644 --- a/install/tpl/config.inc.php.master +++ b/install/tpl/config.inc.php.master @@ -1,7 +1,6 @@ diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master index 4459ca2b9c6b5b74902099ce135be55ed3794f52..bf85ec5145c2a8f4812c6a75463102bfdd7436b8 100644 --- a/install/tpl/system.ini.master +++ b/install/tpl/system.ini.master @@ -17,6 +17,7 @@ dbname_prefix=c[CLIENTID] dbuser_prefix=c[CLIENTID] ftpuser_prefix=[CLIENTNAME] shelluser_prefix=[CLIENTNAME] +webdavuser_prefix=[CLIENTNAME] dblist_phpmyadmin_link=y phpmyadmin_url= diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index db0d35383350bdc9672b2a2523ef4f09ff333add..b7764006441f1a88e4c707d8b50fc09848a80498 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -106,6 +106,18 @@ $form["tabs"]['sites'] = array ( 'width' => '30', 'maxlength' => '255' ), + 'webdavuser_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'webdavuser_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), 'dblist_phpmyadmin_link' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', diff --git a/interface/web/admin/lib/lang/de_system_config.lng b/interface/web/admin/lib/lang/de_system_config.lng index a4e618217b828e5b957345297c72e3acac76ea53..d3d907eaef53e178f85543b8d6b86aa672d0b240 100644 --- a/interface/web/admin/lib/lang/de_system_config.lng +++ b/interface/web/admin/lib/lang/de_system_config.lng @@ -3,11 +3,13 @@ $wb['warning'] = 'Bearbeiten Sie diese Werte sorgfältig! Entfernen Sie die Pref $wb['dbname_prefix_txt'] = 'Datenbanknamen Prefix'; $wb['dbuser_prefix_txt'] = 'Datenbankbenutzer Prefix'; $wb['shelluser_prefix_txt'] = 'Shellbenutzer Prefix'; +$wb['webdavuser_prefix_txt'] = 'Webdavbenutzer Prefix'; $wb['ftpuser_prefix_txt'] = 'FTP Benutzer Prefix'; $wb['dbname_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbanknamen Prefix.'; $wb['dbuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbankbenutzer Prefix.'; $wb['ftpuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in FTP Benutzer Prefix.'; $wb['shelluser_prefix_error_regex'] = 'Zeichen nicht erlaubt in Shellbenutzer Prefix.'; +$wb['webdavuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in Webdavbenutzer Prefix.'; $wb['dblist_phpmyadmin_link_txt'] = 'Link zu phpMyAdmin in der Datenbankliste'; $wb['mailboxlist_webmail_link_txt'] = 'Link zu Webmail in der Mailboxliste'; $wb['webmail_url_txt'] = 'Webmail URL'; diff --git a/interface/web/admin/lib/lang/en_system_config.lng b/interface/web/admin/lib/lang/en_system_config.lng index 3cb319cb299b8e531684802a8ad276564c6cfdb9..69957ce7b75918bff68914024ea0fe7acb1d44fd 100644 --- a/interface/web/admin/lib/lang/en_system_config.lng +++ b/interface/web/admin/lib/lang/en_system_config.lng @@ -4,11 +4,13 @@ $wb['warning'] = 'Edit these values carefully! Do not remove the prefixes on a s $wb['dbname_prefix_txt'] = 'Database name prefix'; $wb['dbuser_prefix_txt'] = 'Database user prefix'; $wb['shelluser_prefix_txt'] = 'Shell user prefix'; +$wb['webdavuser_prefix_txt'] = 'Webdav user prefix'; $wb['ftpuser_prefix_txt'] = 'FTP user prefix'; $wb['dbname_prefix_error_regex'] = 'Char not allowed in database name prefix.'; $wb['dbuser_prefix_error_regex'] = 'Char not allowed in database user prefix.'; $wb['ftpuser_prefix_error_regex'] = 'Char not allowed in ftp user prefix.'; $wb['shelluser_prefix_error_regex'] = 'Char not allowed in shell user prefix.'; +$wb['webdavuser_prefix_error_regex'] = 'Char not allowed in webdav user prefix.'; $wb['dblist_phpmyadmin_link_txt'] = 'Link to phpmyadmin in DB list'; $wb['mailboxlist_webmail_link_txt'] = 'Link to webmail in Mailbox list'; $wb['webmail_url_txt'] = 'Webmail URL'; diff --git a/interface/web/admin/system_config_edit.php b/interface/web/admin/system_config_edit.php index f6a4c05d05ba943c780f8c01d7ba564a057c076a..70f26befb4aa485ac8501003f039367a1594b288 100644 --- a/interface/web/admin/system_config_edit.php +++ b/interface/web/admin/system_config_edit.php @@ -1,6 +1,6 @@ {tmpl_var name='shelluser_prefix_txt'} +
+ + +

{tmpl_var name='dblist_phpmyadmin_link_txt'}

diff --git a/interface/web/client/client_template_del.php b/interface/web/client/client_template_del.php index 1dcdbac3470833c5c68a07f020e70c7175884091..dbe8639c077f9729afbd069144383a4821cb98a9 100644 --- a/interface/web/client/client_template_del.php +++ b/interface/web/client/client_template_del.php @@ -1,6 +1,6 @@ 'client:ssh_chroot', 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') ), + 'limit_webdav_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_webdav_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), 'default_dnsserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php index 1b7ed25a9560f9714dd0d945fb55712d40769a5e..9b9a3a5b92300faf969ed9eb4eab2e408b700314 100644 --- a/interface/web/client/form/client_template.tform.php +++ b/interface/web/client/form/client_template.tform.php @@ -367,6 +367,20 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), + 'limit_webdav_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_webdav_user_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), 'limit_dns_zone' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', diff --git a/interface/web/client/lib/lang/de_client.lng b/interface/web/client/lib/lang/de_client.lng index 6237798fb449de6005d1e356a0db93fec5e19b06..1e45f854fe80645a03305b3eb28da4ebaca0e2d4 100644 --- a/interface/web/client/lib/lang/de_client.lng +++ b/interface/web/client/lib/lang/de_client.lng @@ -55,6 +55,7 @@ $wb['default_dnsserver_txt'] = 'Standard DNS Server'; $wb['limit_dns_zone_txt'] = 'Max. Anzahl an DNS Zonen'; $wb['limit_dns_record_txt'] = 'Max. Anzahl an DNS Einträge'; $wb['limit_shell_user_txt'] = 'Max. Anzahl an Shell Benutzer'; +$wb['limit_webdav_user_txt'] = 'Max. Anzahl an Webdav Benutzer'; $wb['username_error_empty'] = 'Benutzername ist leer.'; $wb['username_error_unique'] = 'Der Benutzername muss einzigartig sein.'; $wb['limit_maildomain_error_notint'] = 'Das Email Domain Limit muss eine Nummer sein.'; @@ -74,6 +75,7 @@ $wb['limit_web_aliasdomain_error_notint'] = 'Das Webseite Aliasdomain Limit muss $wb['limit_web_subdomain_error_notint'] = 'Das Webseite Subdomain Limit muss eine Nummer sein.'; $wb['limit_ftp_user_error_notint'] = 'Das FTP Benutzer Limit muss eine Nummer sein.'; $wb['limit_shell_user_error_notint'] = 'Das Shell Benutzer Limit muss eine Nummer sein.'; +$wb['limit_webdav_user_error_notint'] = 'Das Webdav Benutzer Limit muss eine Nummer sein.'; $wb['limit_dns_zone_error_notint'] = 'Das DNS Einträge Limit muss eine Nummer sein.'; $wb['default_dbserver_txt'] = 'Standarddatenbankserver'; $wb['limit_database_error_notint'] = 'Das Datenbank Limit muss eine Nummer sein.'; diff --git a/interface/web/client/lib/lang/de_client_template.lng b/interface/web/client/lib/lang/de_client_template.lng index c2b0f03324eedded59d2a9265f8488e61357895a..8d43fbf9da35088f50b00932412e0d0e9a487f11 100644 --- a/interface/web/client/lib/lang/de_client_template.lng +++ b/interface/web/client/lib/lang/de_client_template.lng @@ -26,7 +26,8 @@ $wb['limit_web_subdomain_txt'] = 'Max. Anzahl an Web Subdomains'; $wb['limit_ftp_user_txt'] = 'Max. Anzahl an FTP Benutzer'; $wb['limit_dns_zone_txt'] = 'Max. Anzahl an DNS Zonen'; $wb['limit_dns_record_txt'] = 'Max. Anzahl an DNS Einträgen'; -$wb['limit_shell_user_txt'] = 'Max. Anzahl an Shellbenutzer'; +$wb['limit_shell_user_txt'] = 'Max. Anzahl an Shell Benutzer'; +$wb["limit_webdav_user_txt"] = 'Max. Anzahl an Webdav Benutzer'; $wb['limit_maildomain_error_notint'] = 'Das Emaildomain Limit muss eine Nummer sein.'; $wb['limit_mailbox_error_notint'] = 'Das Mailbox Limit muss eine Nummer sein.'; $wb['limit_mailalias_error_notint'] = 'Das Emailalias Limit muss eine Nummer sein.'; @@ -44,6 +45,7 @@ $wb['limit_web_aliasdomain_error_notint'] = 'Das Webseiten Aliasdomain Limit mus $wb['limit_web_subdomain_error_notint'] = 'Das Webseiten Subdomain Limit muss eine Nummer sein.'; $wb['limit_ftp_user_error_notint'] = 'Das FTP Benutzer Limit muss eine Nummer sein.'; $wb['limit_shell_user_error_notint'] = 'Das Shell Benutzer Limit muss eine Nummer sein.'; +$wb["limit_webdav_user_error_notint"] = 'Das Webdav Benutzer Limit muss eine Nummer sein.'; $wb['limit_dns_zone_error_notint'] = 'Das DNS Einträge Limit muss eine Nummer sein.'; $wb['limit_database_error_notint'] = 'Das Datenbanken Limit muss eine Nummer sein.'; $wb['limit_cron_error_notint'] = 'Das Cron Job Limit muss eine Nummer sein.'; diff --git a/interface/web/client/lib/lang/en_client.lng b/interface/web/client/lib/lang/en_client.lng index e87ba45e073c66489d2e0bdcb5adf9e307bf44f8..9c028f3905efa028d14e24f9a53710102766355f 100644 --- a/interface/web/client/lib/lang/en_client.lng +++ b/interface/web/client/lib/lang/en_client.lng @@ -56,6 +56,7 @@ $wb["default_dnsserver_txt"] = 'Default DNS Server'; $wb["limit_dns_zone_txt"] = 'Max. number of DNS zones'; $wb["limit_dns_record_txt"] = 'Max. number DNS records'; $wb["limit_shell_user_txt"] = 'Max. number of Shell users'; +$wb["limit_webdav_user_txt"] = 'Max. number of Webdav users'; $wb["limit_client_txt"] = 'Max. number of Clients'; $wb["username_error_empty"] = 'Username is empty.'; $wb["username_error_unique"] = 'The username must be unique.'; @@ -77,6 +78,7 @@ $wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must $wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.'; $wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.'; $wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.'; +$wb["limit_webdav_user_error_notint"] = 'The webdav user limit must be a number.'; $wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.'; $wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.'; $wb["limit_client_error_notint"] = 'The sub client limit must be a number.'; diff --git a/interface/web/client/lib/lang/en_client_template.lng b/interface/web/client/lib/lang/en_client_template.lng index 39726634eec45ab87035b9ddf7a988a392bb18fd..ca8d4f794d7a60ddca0338305655320f1c8819b1 100644 --- a/interface/web/client/lib/lang/en_client_template.lng +++ b/interface/web/client/lib/lang/en_client_template.lng @@ -28,6 +28,7 @@ $wb["limit_ftp_user_txt"] = 'Max. number of FTP users'; $wb["limit_dns_zone_txt"] = 'Max. number of DNS zones'; $wb["limit_dns_record_txt"] = 'Max. number DNS records'; $wb["limit_shell_user_txt"] = 'Max. number of Shell users'; +$wb["limit_webdav_user_txt"] = 'Max. number of Webdav users'; $wb["limit_client_txt"] = 'Max. number of Clients'; $wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.'; $wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.'; @@ -47,6 +48,7 @@ $wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must $wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.'; $wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.'; $wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.'; +$wb["limit_webdav_user_error_notint"] = 'The webdav user limit must be a number.'; $wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.'; $wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.'; $wb["limit_database_txt"] = 'Max. number of Databases'; diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index ba1850870918be03975d0ed442a013cf8ccfd203..aa35ded38e9a5fb075f75d44d45d845163665730 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -3,188 +3,192 @@
- -
-
{tmpl_var name="toolsarea_head_txt"} -
- - -
-
-
-
- -
-
Limits - -
- - {tmpl_var name='template_master'} - -
-
- - +
+
+ + -


{tmpl_var name='template_additional_list'}
- -
-
-   -
-
-
- - +


{tmpl_var name='template_additional_list'}
+ +
+
+   +
+ +
+ + -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - -
-
- - -
-
- - -
-
- - +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + +
+
+ + +
+
+ + +
+
+ + -
-
- - -
-
- -  MB -
-
+
+
+ + +
+
+ +  MB +
+

{tmpl_var name='web_php_options_txt'}

-
+
{tmpl_var name='web_php_options'} -
+
-
- - +
+ +
-
- - +
+ +
-
- - +
+ +
-
- - +
+ +
-
+

{tmpl_var name='ssh_chroot_txt'}

-
+
{tmpl_var name='ssh_chroot'} -
+
+
+
+ +
-
- - {tmpl_var name='default_dnsserver'} -
-
- - -
-
- - -
-
- - +
+
+ + +
+
+ + -
-
- - -
-
- - +
+
+ + +
+
+ +
-
- - +
+ +
-
- - +
+ +
-
- -  MB -
-
+
+ +  MB +
+ + + - +
+ + +
+
-
- - -
-
-
diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index 6509329eed8d2bd7c9626b24839a6a33d8722609..43cdda3ad6a9e0284683469e4dcd5aa073347d3e 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -3,122 +3,126 @@
-
-
Limits -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - +
+
Limits +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
-
- - +
+ +
-
- - +
+ +
-
- -  MB -
-
+
+ +  MB +
+
+ + - +
+ + +
+
-
- - -
-
-
diff --git a/interface/web/sites/form/webdav_user.tform.php b/interface/web/sites/form/webdav_user.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..35132feafc76c5958af8198d12cd4269f0974bb1 --- /dev/null +++ b/interface/web/sites/form/webdav_user.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"]['webdav'] = array ( + 'title' => "Webdav User", + 'width' => 100, + 'template' => "templates/webdav_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 mirror_server_id = 0 AND {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' => 'UNIQUE', + 'errmsg'=> 'username_error_unique'), + 1 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption' => 'CRYPT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + 'dir' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'directory_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +?> \ No newline at end of file diff --git a/interface/web/sites/lib/lang/de.lng b/interface/web/sites/lib/lang/de.lng index d921ad4d86d679df4a4c1dbc506be0c475282364..54231a4eb21d85be9b6cbdd507958b3fa1a40680 100644 --- a/interface/web/sites/lib/lang/de.lng +++ b/interface/web/sites/lib/lang/de.lng @@ -11,6 +11,8 @@ $wb['Aliasdomain'] = 'Aliasdomain'; $wb['FTP-User'] = 'FTP Benutzer'; $wb['FTP'] = 'FTP'; $wb['Shell-User'] = 'Shell Benutzer'; +$wb['Webdav-User'] = 'Webdav Benutzer'; +$wb['Webdav'] = 'Webdav'; $wb['Shell'] = 'Shell'; $wb['Websites'] = 'Websites'; $wb['Stats'] = 'Statistiken'; diff --git a/interface/web/sites/lib/lang/de_webdav_user.lng b/interface/web/sites/lib/lang/de_webdav_user.lng new file mode 100644 index 0000000000000000000000000000000000000000..8b14415d6bce76d6d78ff1bad938ff7642e46cdc --- /dev/null +++ b/interface/web/sites/lib/lang/de_webdav_user.lng @@ -0,0 +1,16 @@ + diff --git a/interface/web/sites/lib/lang/de_webdav_user_list.lng b/interface/web/sites/lib/lang/de_webdav_user_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..a9ae0c97795b52a0b1d03ac2b40e6e3b2029d6cd --- /dev/null +++ b/interface/web/sites/lib/lang/de_webdav_user_list.lng @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en.lng b/interface/web/sites/lib/lang/en.lng index 36c63bc5b368f4385796ca4956129329be404621..669a971d5d298a8b566c5f9f4059870d96cdf95c 100644 --- a/interface/web/sites/lib/lang/en.lng +++ b/interface/web/sites/lib/lang/en.lng @@ -13,6 +13,8 @@ $wb['FTP-User'] = 'FTP-User'; $wb['FTP'] = 'FTP'; $wb['Shell-User'] = 'Shell-User'; $wb['Shell'] = 'Shell'; +$wb['Webdav-User'] = 'Webdav Benutzer'; +$wb['Webdav'] = 'Webdav'; $wb['Websites'] = 'Websites'; $wb["Stats"] = 'Statistics'; $wb["Cron"] = 'Cron'; diff --git a/interface/web/sites/lib/lang/en_webdav_user.lng b/interface/web/sites/lib/lang/en_webdav_user.lng new file mode 100644 index 0000000000000000000000000000000000000000..09cf6ff40ea4f8726fb249a72dd5c8ebfa2fea1f --- /dev/null +++ b/interface/web/sites/lib/lang/en_webdav_user.lng @@ -0,0 +1,16 @@ + diff --git a/interface/web/sites/lib/lang/en_webdav_user_list.lng b/interface/web/sites/lib/lang/en_webdav_user_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..072e3ea0277ed6bb1758366f7b87a8b3601a230d --- /dev/null +++ b/interface/web/sites/lib/lang/en_webdav_user_list.lng @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php index 09fdfe898503a2d8f45bc51d91d9b9f9492d49e1..3b727ee04c65ac90e8bbbfb608460bc94ad2e8d9 100644 --- a/interface/web/sites/lib/module.conf.php +++ b/interface/web/sites/lib/module.conf.php @@ -11,25 +11,25 @@ $module["tab_width"] = ''; */ $items[] = array( 'title' => "Website", - 'target' => 'content', - 'link' => 'sites/web_domain_list.php', - 'html_id' => 'domain_list'); + 'target' => 'content', + 'link' => 'sites/web_domain_list.php', + 'html_id' => 'domain_list'); $items[] = array( 'title' => "Subdomain", - 'target' => 'content', - 'link' => 'sites/web_subdomain_list.php', - 'html_id' => 'subdomain_list'); + 'target' => 'content', + 'link' => 'sites/web_subdomain_list.php', + 'html_id' => 'subdomain_list'); $items[] = array( 'title' => "Aliasdomain", - 'target' => 'content', - 'link' => 'sites/web_aliasdomain_list.php', - 'html_id' => 'aliasdomain_list'); + 'target' => 'content', + 'link' => 'sites/web_aliasdomain_list.php', + 'html_id' => 'aliasdomain_list'); $module["nav"][] = array( 'title' => 'Websites', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); // clean up unset($items); @@ -39,48 +39,65 @@ unset($items); */ $items[] = array( 'title' => "FTP-User", - 'target' => 'content', - 'link' => 'sites/ftp_user_list.php', - 'html_id' => 'ftp_user_list'); + 'target' => 'content', + 'link' => 'sites/ftp_user_list.php', + 'html_id' => 'ftp_user_list'); $module["nav"][] = array( 'title' => 'FTP', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); // clean up unset($items); /* - FTP User menu + Shell User menu */ $items[] = array( 'title' => "Shell-User", - 'target' => 'content', - 'link' => 'sites/shell_user_list.php', - 'html_id' => 'shell_user_list'); + 'target' => 'content', + 'link' => 'sites/shell_user_list.php', + 'html_id' => 'shell_user_list'); $module["nav"][] = array( 'title' => 'Shell', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); // clean up unset($items); +/* + * Webdav User menu + */ +$items[] = array( 'title' => "Webdav-User", + 'target' => 'content', + 'link' => 'sites/webdav_user_list.php', + 'html_id' => 'webdav_user_list'); + + +$module["nav"][] = array( 'title' => 'Webdav', + 'open' => 1, + 'items' => $items); + +// clean up +unset($items); + + /* Databases menu */ $items[] = array( 'title' => "Database", - 'target' => 'content', - 'link' => 'sites/database_list.php', - 'html_id' => 'database_list'); + 'target' => 'content', + 'link' => 'sites/database_list.php', + 'html_id' => 'database_list'); $module["nav"][] = array( 'title' => 'Database', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); /* @@ -89,28 +106,28 @@ $module["nav"][] = array( 'title' => 'Database', $items = array(); $items[] = array( 'title' => "Cron Jobs", - 'target' => 'content', - 'link' => 'sites/cron_list.php', - 'html_id' => 'cron_list'); + 'target' => 'content', + 'link' => 'sites/cron_list.php', + 'html_id' => 'cron_list'); $module["nav"][] = array( 'title' => 'Cron', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); //**** Statistics menu $items = array(); $items[] = array( 'title' => 'Web traffic', - 'target' => 'content', - 'link' => 'sites/web_sites_stats.php', - 'html_id' => 'websites_stats'); + 'target' => 'content', + 'link' => 'sites/web_sites_stats.php', + 'html_id' => 'websites_stats'); $module['nav'][] = array( 'title' => 'Statistics', - 'open' => 1, - 'items' => $items); + 'open' => 1, + 'items' => $items); diff --git a/interface/web/sites/list/webdav_user.list.php b/interface/web/sites/list/webdav_user.list.php new file mode 100644 index 0000000000000000000000000000000000000000..fc3ed0ce5856648b52b4dff30e934e45fe31dc77 --- /dev/null +++ b/interface/web/sites/list/webdav_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' => "=", + '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/templates/webdav_user_edit.htm b/interface/web/sites/templates/webdav_user_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..4b5063f4b6b56486b01f0f88af9b3039f0004f20 --- /dev/null +++ b/interface/web/sites/templates/webdav_user_edit.htm @@ -0,0 +1,58 @@ +

+

+ +
+ +
+
+
+ + + + + + + + +
+
+ +
{tmpl_var name='username_prefix'}
+ +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ +
webdav/
+ +
+ +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/webdav_user_list.htm b/interface/web/sites/templates/webdav_user_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..2f6d69ce04a071834558ae0256fb0ed291ada2b9 --- /dev/null +++ b/interface/web/sites/templates/webdav_user_list.htm @@ -0,0 +1,59 @@ +

+

+ +
+ +
+
{tmpl_var name="toolsarea_head_txt"} +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="parent_domain_id"}{tmpl_var name="username"} + +
+
+
+ +
diff --git a/interface/web/sites/webdav_user_del.php b/interface/web/sites/webdav_user_del.php new file mode 100644 index 0000000000000000000000000000000000000000..ca92412ca8d777fceb1c54b32fbde48329e5a37a --- /dev/null +++ b/interface/web/sites/webdav_user_del.php @@ -0,0 +1,50 @@ +auth->check_module_permissions('sites'); + +$app->uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/webdav_user_edit.php b/interface/web/sites/webdav_user_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..19a0f787a8c8fe76692c99daf132bb58dbd24219 --- /dev/null +++ b/interface/web/sites/webdav_user_edit.php @@ -0,0 +1,201 @@ +auth->check_module_permissions('sites'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onShowNew() { + global $app, $conf; + + // we will check only users, not admins + if($_SESSION["s"]["user"]["typ"] == 'user') { + if(!$app->tform->checkClientLimit('limit_webdav_user')) { + $app->error($app->tform->wordbook["limit_webdav_user_txt"]); + } + if(!$app->tform->checkResellerLimit('limit_webdav_user')) { + $app->error('Reseller: '.$app->tform->wordbook["limit_webdav_user_txt"]); + } + } + + parent::onShowNew(); + } + + function onShowEnd() { + global $app, $conf, $interfaceConf; + /* + * If the names are restricted -> remove the restriction, so that the + * data can be edited + */ + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + $webdavuser_prefix = replacePrefix($global_config['webdavuser_prefix'], $this->dataRecord); + + if ($this->dataRecord['username'] != ""){ + /* REMOVE the restriction */ + $app->tpl->setVar("username", str_replace($webdavuser_prefix , '', $this->dataRecord['username'])); + } + if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { + $app->tpl->setVar("username_prefix", $global_config['webdavuser_prefix']); + } else { + $app->tpl->setVar("username_prefix", $webdavuser_prefix); + } + + if($this->id > 0) { + //* we are editing a existing record + $app->tpl->setVar("edit_disabled", 1); + $app->tpl->setVar("parent_domain_id_value", $this->dataRecord["parent_domain_id"]); + } else { + $app->tpl->setVar("edit_disabled", 0); + } + + 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["server_id"] = $parent_domain["server_id"]; + + if(isset($this->dataRecord['username']) && trim($this->dataRecord['username']) == '') $app->tform->errorMessage .= $app->tform->lng('username_error_empty').'
'; + if(isset($this->dataRecord['username']) && empty($this->dataRecord['parent_domain_id'])) $app->tform->errorMessage .= $app->tform->lng('parent_domain_id_error_empty').'
'; + + parent::onSubmit(); + } + + function onBeforeInsert() { + global $app, $conf, $interfaceConf; + + /* + * If the names should be restricted -> do it! + */ + if ($app->tform->errorMessage == ''){ + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + $webdavuser_prefix = replacePrefix($global_config['webdavuser_prefix'], $this->dataRecord); + + /* restrict the names */ + $this->dataRecord['username'] = $webdavuser_prefix . $this->dataRecord['username']; + } + parent::onBeforeInsert(); + } + + function onAfterInsert() { + global $app, $conf; + + $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); + $server_id = $web["server_id"]; + $dir = $web["document_root"]; + + // The Webdav user shall be owned by the same group then the website + $sys_groupid = $web['sys_groupid']; + + $sql = "UPDATE webdav_user SET server_id = $server_id, dir = '$dir', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id; + $app->db->query($sql); + + } + + function onBeforeUpdate() { + global $app, $conf, $interfaceConf; + + /* + * If the names should be restricted -> do it! + */ + if ($app->tform->errorMessage == '') { + /* + * If the names should be restricted -> do it! + */ + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + $webdavuser_prefix = replacePrefix($global_config['webdavuser_prefix'], $this->dataRecord); + + /* restrict the names */ + $this->dataRecord['username'] = $webdavuser_prefix . $this->dataRecord['username']; + } + } + + function onAfterUpdate() { + global $app, $conf; + + + } + + function getClientName() { + global $app, $conf; + + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { + // Get the group-id of the user + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + } else { + // Get the group-id from the data itself + $web = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = ".intval($this->dataRecord['parent_domain_id'])); + $client_group_id = $web['sys_groupid']; + } + /* get the name of the client */ + $tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = " . $client_group_id); + $clientName = $tmp['name']; + if ($clientName == "") $clientName = 'default'; + $clientName = convertClientName($clientName); + + return $clientName; + + } + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/webdav_user_list.php b/interface/web/sites/webdav_user_list.php new file mode 100644 index 0000000000000000000000000000000000000000..bac3de98c9264c776775f0b4b3d53767f7e07930 --- /dev/null +++ b/interface/web/sites/webdav_user_list.php @@ -0,0 +1,51 @@ +auth->check_module_permissions('sites'); + +$app->uses('listform_actions'); + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file