ISPConfig module for simplify the creation of websites and DNS zones in a only step
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

195 řádky
5.7 KiB

  1. <?php
  2. /*
  3. Form Definition
  4. Tabledefinition
  5. Datatypes:
  6. - INTEGER (Forces the input to Int)
  7. - DOUBLE
  8. - CURRENCY (Formats the values to currency notation)
  9. - VARCHAR (no format check, maxlength: 255)
  10. - TEXT (no format check)
  11. - DATE (Dateformat, automatic conversion to timestamps)
  12. Formtype:
  13. - TEXT (Textfield)
  14. - TEXTAREA (Textarea)
  15. - PASSWORD (Password textfield, input is not shown when edited)
  16. - SELECT (Select option field)
  17. - RADIO
  18. - CHECKBOX
  19. - CHECKBOXARRAY
  20. - FILE
  21. VALUE:
  22. - Wert oder Array
  23. Hint:
  24. The ID field of the database table is not part of the datafield definition.
  25. The ID field must be always auto incement (int or bigint).
  26. Search:
  27. - searchable = 1 or searchable = 2 include the field in the search
  28. - searchable = 1: this field will be the title of the search result
  29. - searchable = 2: this field will be included in the description of the search result
  30. */
  31. $form["title"] = "Database";
  32. $form["description"] = "";
  33. $form["name"] = "database";
  34. $form["action"] = "database_edit.php";
  35. $form["db_table"] = "web_database";
  36. $form["db_table_idx"] = "database_id";
  37. $form["db_history"] = "yes";
  38. $form["tab_default"] = "database";
  39. $form["list_default"] = "database_list.php";
  40. $form["auth"] = 'yes'; // yes / no
  41. $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
  42. $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
  43. $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
  44. $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
  45. $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
  46. $form["tabs"]['database'] = array (
  47. 'title' => "Database",
  48. 'width' => 100,
  49. 'template' => "templates/database_edit.htm",
  50. 'fields' => array (
  51. //#################################
  52. // Begin Datatable fields
  53. //#################################
  54. 'server_id' => array (
  55. 'datatype' => 'INTEGER',
  56. 'formtype' => 'SELECT',
  57. 'default' => '',
  58. 'datasource' => array ( 'type' => 'SQL',
  59. 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} AND db_server = 1 ORDER BY server_name',
  60. 'keyfield'=> 'server_id',
  61. 'valuefield'=> 'server_name'
  62. ),
  63. 'value' => ''
  64. ),
  65. 'parent_domain_id' => array (
  66. 'datatype' => 'INTEGER',
  67. 'formtype' => 'SELECT',
  68. 'default' => '',
  69. 'datasource' => array ( 'type' => 'SQL',
  70. 'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
  71. 'keyfield'=> 'domain_id',
  72. 'valuefield'=> 'parent_domain'
  73. ),
  74. 'value' => array('0' => 'select_site_txt')
  75. ),
  76. 'type' => array (
  77. 'datatype' => 'VARCHAR',
  78. 'formtype' => 'SELECT',
  79. 'default' => 'mysql',
  80. 'value' => array(
  81. /*'mongo' => 'MongoDB',*/
  82. 'mysql' => 'MySQL'
  83. )
  84. ),
  85. 'database_name' => array (
  86. 'datatype' => 'VARCHAR',
  87. 'formtype' => 'TEXT',
  88. 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
  89. 'errmsg'=> 'database_name_error_empty'),
  90. 1 => array ( 'type' => 'REGEX',
  91. 'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
  92. 'errmsg'=> 'database_name_error_regex'),
  93. ),
  94. 'default' => '',
  95. 'value' => '',
  96. 'width' => '30',
  97. 'maxlength' => '255',
  98. 'searchable' => 1
  99. ),
  100. 'database_name_prefix' => array (
  101. 'datatype' => 'VARCHAR',
  102. 'formtype' => 'TEXT',
  103. 'default' => '',
  104. 'value' => '',
  105. 'width' => '30',
  106. 'maxlength' => '25'
  107. ),
  108. 'database_quota' => array (
  109. 'datatype' => 'INTEGER',
  110. 'formtype' => 'TEXT',
  111. 'validators' => array ( 0 => array ( 'type' => 'ISINT',
  112. 'errmsg'=> 'limit_database_quota_error_notint'),
  113. ),
  114. 'default' => '-1',
  115. 'value' => '',
  116. 'separator' => '',
  117. 'width' => '10',
  118. 'maxlength' => '10',
  119. 'rows' => '',
  120. 'cols' => ''
  121. ),
  122. 'database_user_id' => array (
  123. 'datatype' => 'INTEGER',
  124. 'formtype' => 'SELECT',
  125. 'default' => '',
  126. 'datasource' => array ( 'type' => 'SQL',
  127. 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
  128. 'keyfield'=> 'database_user_id',
  129. 'valuefield'=> 'database_user'
  130. ),
  131. 'value' => array('0' => 'select_dbuser_txt')
  132. ),
  133. 'database_ro_user_id' => array (
  134. 'datatype' => 'INTEGER',
  135. 'formtype' => 'SELECT',
  136. 'default' => '',
  137. 'datasource' => array ( 'type' => 'SQL',
  138. 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
  139. 'keyfield'=> 'database_user_id',
  140. 'valuefield'=> 'database_user'
  141. ),
  142. 'value' => array('0' => 'no_dbuser_txt')
  143. ),
  144. 'database_charset' => array (
  145. 'datatype' => 'VARCHAR',
  146. 'formtype' => 'SELECT',
  147. 'default' => '',
  148. 'value' => array('' => 'DB-Default', 'latin1' => 'Latin 1', 'utf8' => 'UTF-8')
  149. ),
  150. 'remote_access' => array (
  151. 'datatype' => 'VARCHAR',
  152. 'formtype' => 'CHECKBOX',
  153. 'default' => 'n',
  154. 'value' => array(0 => 'n', 1 => 'y')
  155. ),
  156. 'active' => array (
  157. 'datatype' => 'VARCHAR',
  158. 'formtype' => 'CHECKBOX',
  159. 'default' => 'y',
  160. 'value' => array(0 => 'n', 1 => 'y')
  161. ),
  162. 'remote_ips' => array (
  163. 'datatype' => 'TEXT',
  164. 'formtype' => 'TEXT',
  165. 'validators' => array ( 0 => array ( 'type' => 'CUSTOM',
  166. 'class' => 'validate_database',
  167. 'function' => 'valid_ip_list',
  168. 'errmsg' => 'database_remote_error_ips'),
  169. ),
  170. 'default' => '',
  171. 'value' => '',
  172. 'width' => '60',
  173. 'searchable' => 2
  174. ),
  175. //#################################
  176. // ENDE Datatable fields
  177. //#################################
  178. )
  179. );
  180. ?>