ISPConfig module for simplify the creation of websites and DNS zones in a only step
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

123 Zeilen
4.7 KiB

  1. <?php
  2. /*
  3. Copyright (c) 2017, David Ramos García, Open6Hosting <dramos@open6hosting.com>
  4. All rights reserved.
  5. Redistribution and use in source and binary forms, with or without modification,
  6. are permitted provided that the following conditions are met:
  7. * Redistributions of source code must retain the above copyright notice,
  8. this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright notice,
  10. this list of conditions and the following disclaimer in the documentation
  11. and/or other materials provided with the distribution.
  12. * Neither the name of ISPConfig nor the names of its contributors
  13. may be used to endorse or promote products derived from this software without
  14. specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  18. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  19. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  20. BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  22. OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  23. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  24. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. Form Definition
  26. Tabledefinition
  27. Datatypes:
  28. - INTEGER (Forces the input to Int)
  29. - DOUBLE
  30. - CURRENCY (Formats the values to currency notation)
  31. - VARCHAR (no format check, maxlength: 255)
  32. - TEXT (no format check)
  33. - DATE (Dateformat, automatic conversion to timestamps)
  34. Formtype:
  35. - TEXT (Textfield)
  36. - TEXTAREA (Textarea)
  37. - PASSWORD (Password textfield, input is not shown when edited)
  38. - SELECT (Select option field)
  39. - RADIO
  40. - CHECKBOX
  41. - CHECKBOXARRAY
  42. - FILE
  43. VALUE:
  44. - Wert oder Array
  45. Hint:
  46. The ID field of the database table is not part of the datafield definition.
  47. The ID field must be always auto incement (int or bigint).
  48. Search:
  49. - searchable = 1 or searchable = 2 include the field in the search
  50. - searchable = 1: this field will be the title of the search result
  51. - searchable = 2: this field will be included in the description of the search result
  52. */
  53. $form["title"] = "Nuevo servicio Web";
  54. $form["description"] = "";
  55. $form["name"] = "new_service_webdns";
  56. $form["action"] = "new_service_webdns.php";
  57. $form["db_table"] = "server";
  58. $form["db_table_idx"] = "server_id";
  59. $form["db_history"] = "no";
  60. $form["tab_default"] = "webdns";
  61. $form["auth"] = 'yes'; // yes / no
  62. $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
  63. $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
  64. $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
  65. $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
  66. $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
  67. $form["tabs"]['webdns'] = array(
  68. 'title' => "Alta",
  69. 'description' => 'Crea un el sitio web y su dominio.',
  70. 'width' => 100,
  71. 'template' => "templates/new_service_webdns.htm",
  72. 'fields' => array (
  73. 'domain' => array (
  74. 'datatype' => 'VARCHAR',
  75. 'formtype' => 'TEXT',
  76. 'filters' => array(
  77. 0 => array( 'event' => 'SAVE',
  78. 'type' => 'IDNTOASCII'),
  79. 1 => array( 'event' => 'SHOW',
  80. 'type' => 'IDNTOUTF8'),
  81. 2 => array( 'event' => 'SAVE',
  82. 'type' => 'TOLOWER')
  83. ),
  84. 'validators' => array (
  85. 0 => array ( 'type' => 'NOTEMPTY',
  86. 'errmsg'=> 'domain_error_empty'),
  87. 2 => array ( 'type' => 'REGEX',
  88. 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/',
  89. 'errmsg'=> 'domain_error_regex'),
  90. ),
  91. 'default' => '',
  92. 'value' => '',
  93. 'width' => '30',
  94. 'maxlength' => '255'
  95. ),
  96. 'client_id' => array (
  97. 'datatype' => 'INTEGER',
  98. 'formtype' => 'SELECT',
  99. 'default' => '',
  100. 'datasource' => array ( 'type' => 'SQL',
  101. 'querystring' => "SELECT sys_group.groupid, sys_group.client_id, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name",
  102. 'keyfield'=> 'client_id',
  103. 'valuefield'=> 'contactname'
  104. ),
  105. 'value' => ''
  106. ),
  107. )
  108. );