app_defaults.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2019
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. //process this only one time
  22. if ($domains_processed == 1) {
  23. //default settings - change the type from var to text
  24. $sql = "update v_default_settings ";
  25. $sql .= "set default_setting_name = 'text' ";
  26. $sql .= "where default_setting_name = 'var' ";
  27. $database->execute($sql, null);
  28. unset($sql);
  29. //set domains with enabled status of empty or null to true
  30. $sql = "delete from v_default_settings ";
  31. $sql .= "where (default_setting_category is null and default_setting_subcategory is null) ";
  32. $sql .= "or (default_setting_category = '' and default_setting_subcategory = '') ";
  33. $database->execute($sql, null);
  34. unset($sql);
  35. //populate the languages table, if necessary
  36. $sql = "select count(*) from v_languages";
  37. $num_rows = $database->select($sql, null, 'column');
  38. if ($num_rows == 0) {
  39. $sql = "insert into v_languages (language_uuid, language, code) values ";
  40. $sql .= "('".uuid()."', 'Afrikaans', 'af'), ";
  41. $sql .= "('".uuid()."', 'Albanian', 'sq'), ";
  42. $sql .= "('".uuid()."', 'Amharic', 'am'), ";
  43. $sql .= "('".uuid()."', 'Arabic - Algeria', 'ar-dz'), ";
  44. $sql .= "('".uuid()."', 'Arabic - Bahrain', 'ar-bh'), ";
  45. $sql .= "('".uuid()."', 'Arabic - Egypt', 'ar-eg'), ";
  46. $sql .= "('".uuid()."', 'Arabic - Iraq', 'ar-iq'), ";
  47. $sql .= "('".uuid()."', 'Arabic - Jordan', 'ar-jo'), ";
  48. $sql .= "('".uuid()."', 'Arabic - Kuwait', 'ar-kw'), ";
  49. $sql .= "('".uuid()."', 'Arabic - Lebanon', 'ar-lb'), ";
  50. $sql .= "('".uuid()."', 'Arabic - Libya', 'ar-ly'), ";
  51. $sql .= "('".uuid()."', 'Arabic - Morocco', 'ar-ma'), ";
  52. $sql .= "('".uuid()."', 'Arabic - Oman', 'ar-om'), ";
  53. $sql .= "('".uuid()."', 'Arabic - Qatar', 'ar-qa'), ";
  54. $sql .= "('".uuid()."', 'Arabic - Saudi Arabia', 'ar-sa'), ";
  55. $sql .= "('".uuid()."', 'Arabic - Syria', 'ar-sy'), ";
  56. $sql .= "('".uuid()."', 'Arabic - Tunisia', 'ar-tn'), ";
  57. $sql .= "('".uuid()."', 'Arabic - United Arab Emirates', 'ar-ae'), ";
  58. $sql .= "('".uuid()."', 'Arabic - Yemen', 'ar-ye'), ";
  59. $sql .= "('".uuid()."', 'Armenian', 'hy'), ";
  60. $sql .= "('".uuid()."', 'Assamese', 'as'), ";
  61. $sql .= "('".uuid()."', 'Azeri - Cyrillic, Latin', 'az-az'), ";
  62. $sql .= "('".uuid()."', 'Basque', 'eu'), ";
  63. $sql .= "('".uuid()."', 'Belarusian', 'be'), ";
  64. $sql .= "('".uuid()."', 'Bengali - India, Bangladesh', 'bn'), ";
  65. $sql .= "('".uuid()."', 'Bosnian', 'bs'), ";
  66. $sql .= "('".uuid()."', 'Bulgarian', 'bg'), ";
  67. $sql .= "('".uuid()."', 'Burmese', 'my'), ";
  68. $sql .= "('".uuid()."', 'Catalan', 'ca'), ";
  69. $sql .= "('".uuid()."', 'Chinese - China', 'zh-cn'), ";
  70. $sql .= "('".uuid()."', 'Chinese - Hong Kong SAR', 'zh-hk'), ";
  71. $sql .= "('".uuid()."', 'Chinese - Macau SAR', 'zh-mo'), ";
  72. $sql .= "('".uuid()."', 'Chinese - Singapore', 'zh-sg'), ";
  73. $sql .= "('".uuid()."', 'Chinese - Taiwan', 'zh-tw'), ";
  74. $sql .= "('".uuid()."', 'Croatian', 'hr'), ";
  75. $sql .= "('".uuid()."', 'Czech', 'cs'), ";
  76. $sql .= "('".uuid()."', 'Danish', 'da'), ";
  77. $sql .= "('".uuid()."', 'Divehi, Dhivehi, Maldivian', 'dv'), ";
  78. $sql .= "('".uuid()."', 'Dutch - Belgium', 'nl-be'), ";
  79. $sql .= "('".uuid()."', 'Dutch - Netherlands', 'nl-nl'), ";
  80. $sql .= "('".uuid()."', 'English - Australia', 'en-au'), ";
  81. $sql .= "('".uuid()."', 'English - Belize', 'en-bz'), ";
  82. $sql .= "('".uuid()."', 'English - Canada', 'en-ca'), ";
  83. $sql .= "('".uuid()."', 'English - Caribbean', 'en-cb'), ";
  84. $sql .= "('".uuid()."', 'English - Great Britain', 'en-gb'), ";
  85. $sql .= "('".uuid()."', 'English - India', 'en-in'), ";
  86. $sql .= "('".uuid()."', 'English - Ireland', 'en-ie'), ";
  87. $sql .= "('".uuid()."', 'English - Jamaica', 'en-jm'), ";
  88. $sql .= "('".uuid()."', 'English - New Zealand', 'en-nz'), ";
  89. $sql .= "('".uuid()."', 'English - Phillippines', 'en-ph'), ";
  90. $sql .= "('".uuid()."', 'English - Southern Africa', 'en-za'), ";
  91. $sql .= "('".uuid()."', 'English - Trinidad', 'en-tt'), ";
  92. $sql .= "('".uuid()."', 'English - United States', 'en-us'), ";
  93. $sql .= "('".uuid()."', 'Estonian', 'et'), ";
  94. $sql .= "('".uuid()."', 'Faroese', 'fo'), ";
  95. $sql .= "('".uuid()."', 'Farsi - Persian', 'fa'), ";
  96. $sql .= "('".uuid()."', 'Finnish', 'fi'), ";
  97. $sql .= "('".uuid()."', 'French - Belgium', 'fr-be'), ";
  98. $sql .= "('".uuid()."', 'French - Canada', 'fr-ca'), ";
  99. $sql .= "('".uuid()."', 'French - France', 'fr-fr'), ";
  100. $sql .= "('".uuid()."', 'French - Luxembourg', 'fr-lu'), ";
  101. $sql .= "('".uuid()."', 'French - Switzerland', 'fr-ch'), ";
  102. $sql .= "('".uuid()."', 'FYRO Macedonia', 'mk'), ";
  103. $sql .= "('".uuid()."', 'Gaelic - Ireland', 'gd-ie'), ";
  104. $sql .= "('".uuid()."', 'Gaelic - Scotland', 'gd'), ";
  105. $sql .= "('".uuid()."', 'German - Austria', 'de-at'), ";
  106. $sql .= "('".uuid()."', 'German - Germany', 'de-de'), ";
  107. $sql .= "('".uuid()."', 'German - Liechtenstein', 'de-li'), ";
  108. $sql .= "('".uuid()."', 'German - Luxembourg', 'de-lu'), ";
  109. $sql .= "('".uuid()."', 'German - Switzerland', 'de-ch'), ";
  110. $sql .= "('".uuid()."', 'Greek - Cyprus', 'el-cy'), ";
  111. $sql .= "('".uuid()."', 'Greek - Greece', 'el-gr'), ";
  112. $sql .= "('".uuid()."', 'Guarani - Paraguay', 'gn'), ";
  113. $sql .= "('".uuid()."', 'Gujarati', 'gu'), ";
  114. $sql .= "('".uuid()."', 'Hebrew', 'he'), ";
  115. $sql .= "('".uuid()."', 'Hindi', 'hi'), ";
  116. $sql .= "('".uuid()."', 'Hungarian', 'hu'), ";
  117. $sql .= "('".uuid()."', 'Icelandic', 'is'), ";
  118. $sql .= "('".uuid()."', 'Indonesian', 'id'), ";
  119. $sql .= "('".uuid()."', 'Italian - Italy', 'it-it'), ";
  120. $sql .= "('".uuid()."', 'Italian - Switzerland', 'it-ch'), ";
  121. $sql .= "('".uuid()."', 'Japanese', 'ja'), ";
  122. $sql .= "('".uuid()."', 'Kannada', 'kn'), ";
  123. $sql .= "('".uuid()."', 'Kashmiri', 'ks'), ";
  124. $sql .= "('".uuid()."', 'Kazakh', 'kk'), ";
  125. $sql .= "('".uuid()."', 'Khmer', 'km'), ";
  126. $sql .= "('".uuid()."', 'Korean', 'ko'), ";
  127. $sql .= "('".uuid()."', 'Lao', 'lo'), ";
  128. $sql .= "('".uuid()."', 'Latin', 'la'), ";
  129. $sql .= "('".uuid()."', 'Latvian', 'lv'), ";
  130. $sql .= "('".uuid()."', 'Lithuanian', 'lt'), ";
  131. $sql .= "('".uuid()."', 'Malayalam', 'ml'), ";
  132. $sql .= "('".uuid()."', 'Malay - Brunei', 'ms-bn'), ";
  133. $sql .= "('".uuid()."', 'Malay - Malaysia', 'ms-my'), ";
  134. $sql .= "('".uuid()."', 'Maltese', 'mt'), ";
  135. $sql .= "('".uuid()."', 'Maori', 'mi'), ";
  136. $sql .= "('".uuid()."', 'Marathi', 'mr'), ";
  137. $sql .= "('".uuid()."', 'Nepali', 'ne'), ";
  138. $sql .= "('".uuid()."', 'Norwegian - Bokml, Nynorsk', 'no-no'), ";
  139. $sql .= "('".uuid()."', 'Oriya', 'or'), ";
  140. $sql .= "('".uuid()."', 'Polish', 'pl'), ";
  141. $sql .= "('".uuid()."', 'Portuguese - Brazil', 'pt-br'), ";
  142. $sql .= "('".uuid()."', 'Portuguese - Portugal', 'pt-pt'), ";
  143. $sql .= "('".uuid()."', 'Punjabi', 'pa'), ";
  144. $sql .= "('".uuid()."', 'Raeto-Romance', 'rm'), ";
  145. $sql .= "('".uuid()."', 'Romanian - Moldova', 'ro-mo'), ";
  146. $sql .= "('".uuid()."', 'Romanian - Romania', 'ro'), ";
  147. $sql .= "('".uuid()."', 'Russian', 'ru-ru'), ";
  148. $sql .= "('".uuid()."', 'Russian - Moldova', 'ru-mo'), ";
  149. $sql .= "('".uuid()."', 'Sanskrit', 'sa'), ";
  150. $sql .= "('".uuid()."', 'Serbian - Cyrillic, Latin', 'sr-sp'), ";
  151. $sql .= "('".uuid()."', 'Setsuana', 'tn'), ";
  152. $sql .= "('".uuid()."', 'Sindhi', 'sd'), ";
  153. $sql .= "('".uuid()."', 'Sinhala, Sinhalese', 'si'), ";
  154. $sql .= "('".uuid()."', 'Slovak', 'sk'), ";
  155. $sql .= "('".uuid()."', 'Slovenian', 'sl'), ";
  156. $sql .= "('".uuid()."', 'Somali', 'so'), ";
  157. $sql .= "('".uuid()."', 'Sorbian', 'sb'), ";
  158. $sql .= "('".uuid()."', 'Spanish - Argentina', 'es-ar'), ";
  159. $sql .= "('".uuid()."', 'Spanish - Bolivia', 'es-bo'), ";
  160. $sql .= "('".uuid()."', 'Spanish - Chile', 'es-cl'), ";
  161. $sql .= "('".uuid()."', 'Spanish - Colombia', 'es-co'), ";
  162. $sql .= "('".uuid()."', 'Spanish - Costa Rica', 'es-cr'), ";
  163. $sql .= "('".uuid()."', 'Spanish - Dominican Republic', 'es-do'), ";
  164. $sql .= "('".uuid()."', 'Spanish - Ecuador', 'es-ec'), ";
  165. $sql .= "('".uuid()."', 'Spanish - El Salvador', 'es-sv'), ";
  166. $sql .= "('".uuid()."', 'Spanish - Guatemala', 'es-gt'), ";
  167. $sql .= "('".uuid()."', 'Spanish - Honduras', 'es-hn'), ";
  168. $sql .= "('".uuid()."', 'Spanish - Mexico', 'es-mx'), ";
  169. $sql .= "('".uuid()."', 'Spanish - Nicaragua', 'es-ni'), ";
  170. $sql .= "('".uuid()."', 'Spanish - Panama', 'es-pa'), ";
  171. $sql .= "('".uuid()."', 'Spanish - Paraguay', 'es-py'), ";
  172. $sql .= "('".uuid()."', 'Spanish - Peru', 'es-pe'), ";
  173. $sql .= "('".uuid()."', 'Spanish - Puerto Rico', 'es-pr'), ";
  174. $sql .= "('".uuid()."', 'Spanish - Spain (Traditional)', 'es-es'), ";
  175. $sql .= "('".uuid()."', 'Spanish - Uruguay', 'es-uy'), ";
  176. $sql .= "('".uuid()."', 'Spanish - Venezuela', 'es-ve'), ";
  177. $sql .= "('".uuid()."', 'Swahili', 'sw'), ";
  178. $sql .= "('".uuid()."', 'Swedish - Finland', 'sv-fi'), ";
  179. $sql .= "('".uuid()."', 'Swedish - Sweden', 'sv-se'), ";
  180. $sql .= "('".uuid()."', 'Tajik', 'tg'), ";
  181. $sql .= "('".uuid()."', 'Tamil', 'ta'), ";
  182. $sql .= "('".uuid()."', 'Tatar', 'tt'), ";
  183. $sql .= "('".uuid()."', 'Telugu', 'te'), ";
  184. $sql .= "('".uuid()."', 'Thai', 'th'), ";
  185. $sql .= "('".uuid()."', 'Tibetan', 'bo'), ";
  186. $sql .= "('".uuid()."', 'Tsonga', 'ts'), ";
  187. $sql .= "('".uuid()."', 'Turkish', 'tr'), ";
  188. $sql .= "('".uuid()."', 'Turkmen', 'tk'), ";
  189. $sql .= "('".uuid()."', 'Ukrainian', 'uk'), ";
  190. $sql .= "('".uuid()."', 'Urdu', 'ur'), ";
  191. $sql .= "('".uuid()."', 'Uzbek - Cyrillic, Latin', 'uz-uz'), ";
  192. $sql .= "('".uuid()."', 'Vietnamese', 'vi'), ";
  193. $sql .= "('".uuid()."', 'Welsh', 'cy'), ";
  194. $sql .= "('".uuid()."', 'Xhosa', 'xh'), ";
  195. $sql .= "('".uuid()."', 'Yiddish', 'yi') ";
  196. $database->execute($sql, null);
  197. unset($sql, $parameters);
  198. }
  199. //populate the countries table, if necessary
  200. $sql = "select count(*) from v_countries";
  201. $num_rows = $database->select($sql, null, 'column');
  202. if ($num_rows == 0) {
  203. $sql = "insert into v_countries (country_uuid, country, iso_a2, iso_a3, num, country_code) values ";
  204. $sql .= "('".uuid()."', 'Afghanistan', 'AF', 'AFG', 4, '93'), ";
  205. $sql .= "('".uuid()."', 'Albania', 'AL', 'ALB', 8, '355'), ";
  206. $sql .= "('".uuid()."', 'Algeria', 'DZ', 'DZA', 12, '213'), ";
  207. $sql .= "('".uuid()."', 'American Samoa', 'AS', 'ASM', 16, '1-684'), ";
  208. $sql .= "('".uuid()."', 'Andorra', 'AD', 'AND', 20, '376'), ";
  209. $sql .= "('".uuid()."', 'Angola', 'AO', 'AGO', 24, '244'), ";
  210. $sql .= "('".uuid()."', 'Anguilla', 'AI', 'AIA', 660, '1-264'), ";
  211. $sql .= "('".uuid()."', 'Antarctica', 'AQ', 'ATA', 10, '672'), ";
  212. $sql .= "('".uuid()."', 'Antigua and Barbuda', 'AG', 'ATG', 28, '1-268'), ";
  213. $sql .= "('".uuid()."', 'Argentina', 'AR', 'ARG', 32, '54'), ";
  214. $sql .= "('".uuid()."', 'Armenia', 'AM', 'ARM', 51, '374'), ";
  215. $sql .= "('".uuid()."', 'Aruba', 'AW', 'ABW', 533, '297'), ";
  216. $sql .= "('".uuid()."', 'Australia', 'AU', 'AUS', 36, '61'), ";
  217. $sql .= "('".uuid()."', 'Austria', 'AT', 'AUT', 40, '43'), ";
  218. $sql .= "('".uuid()."', 'Azerbaijan', 'AZ', 'AZE', 31, '994'), ";
  219. $sql .= "('".uuid()."', 'Bahamas', 'BS', 'BHS', 44, '1-242'), ";
  220. $sql .= "('".uuid()."', 'Bahrain', 'BH', 'BHR', 48, '973'), ";
  221. $sql .= "('".uuid()."', 'Bangladesh', 'BD', 'BGD', 50, '880'), ";
  222. $sql .= "('".uuid()."', 'Barbados', 'BB', 'BRB', 52, '1-246'), ";
  223. $sql .= "('".uuid()."', 'Belarus', 'BY', 'BLR', 112, '375'), ";
  224. $sql .= "('".uuid()."', 'Belgium', 'BE', 'BEL', 56, '32'), ";
  225. $sql .= "('".uuid()."', 'Belize', 'BZ', 'BLZ', 84, '501'), ";
  226. $sql .= "('".uuid()."', 'Benin', 'BJ', 'BEN', 204, '229'), ";
  227. $sql .= "('".uuid()."', 'Bermuda', 'BM', 'BMU', 60, '1-441'), ";
  228. $sql .= "('".uuid()."', 'Bhutan', 'BT', 'BTN', 64, '975'), ";
  229. $sql .= "('".uuid()."', 'Bolivia', 'BO', 'BOL', 68, '591'), ";
  230. $sql .= "('".uuid()."', 'Bonaire', 'BQ', 'BES', 535, '599'), ";
  231. $sql .= "('".uuid()."', 'Bosnia and Herzegovina', 'BA', 'BIH', 70, '387'), ";
  232. $sql .= "('".uuid()."', 'Botswana', 'BW', 'BWA', 72, '267'), ";
  233. $sql .= "('".uuid()."', 'Bouvet Island', 'BV', 'BVT', 74, '47'), ";
  234. $sql .= "('".uuid()."', 'Brazil', 'BR', 'BRA', 76, '55'), ";
  235. $sql .= "('".uuid()."', 'British Indian Ocean Territory', 'IO', 'IOT', 86, '246'), ";
  236. $sql .= "('".uuid()."', 'Brunei Darussalam', 'BN', 'BRN', 96, '673'), ";
  237. $sql .= "('".uuid()."', 'Bulgaria', 'BG', 'BGR', 100, '359'), ";
  238. $sql .= "('".uuid()."', 'Burkina Faso', 'BF', 'BFA', 854, '226'), ";
  239. $sql .= "('".uuid()."', 'Burundi', 'BI', 'BDI', 108, '257'), ";
  240. $sql .= "('".uuid()."', 'Cambodia', 'KH', 'KHM', 116, '855'), ";
  241. $sql .= "('".uuid()."', 'Cameroon', 'CM', 'CMR', 120, '237'), ";
  242. $sql .= "('".uuid()."', 'Canada', 'CA', 'CAN', 124, '1'), ";
  243. $sql .= "('".uuid()."', 'Cape Verde', 'CV', 'CPV', 132, '238'), ";
  244. $sql .= "('".uuid()."', 'Cayman Islands', 'KY', 'CYM', 136, '1-345'), ";
  245. $sql .= "('".uuid()."', 'Central African Republic', 'CF', 'CAF', 140, '236'), ";
  246. $sql .= "('".uuid()."', 'Chad', 'TD', 'TCD', 148, '235'), ";
  247. $sql .= "('".uuid()."', 'Chile', 'CL', 'CHL', 152, '56'), ";
  248. $sql .= "('".uuid()."', 'China', 'CN', 'CHN', 156, '86'), ";
  249. $sql .= "('".uuid()."', 'Christmas Island', 'CX', 'CXR', 162, '61'), ";
  250. $sql .= "('".uuid()."', 'Cocos (Keeling) Islands', 'CC', 'CCK', 166, '61'), ";
  251. $sql .= "('".uuid()."', 'Colombia', 'CO', 'COL', 170, '57'), ";
  252. $sql .= "('".uuid()."', 'Comoros', 'KM', 'COM', 174, '269'), ";
  253. $sql .= "('".uuid()."', 'Congo', 'CG', 'COG', 178, '242'), ";
  254. $sql .= "('".uuid()."', 'Democratic Republic of the Congo', 'CD', 'COD', 180, '243'), ";
  255. $sql .= "('".uuid()."', 'Cook Islands', 'CK', 'COK', 184, '682'), ";
  256. $sql .= "('".uuid()."', 'Costa Rica', 'CR', 'CRI', 188, '506'), ";
  257. $sql .= "('".uuid()."', 'Croatia', 'HR', 'HRV', 191, '385'), ";
  258. $sql .= "('".uuid()."', 'Cuba', 'CU', 'CUB', 192, '53'), ";
  259. $sql .= "('".uuid()."', 'Curaçao', 'CW', 'CUW', 531, '599'), ";
  260. $sql .= "('".uuid()."', 'Cyprus', 'CY', 'CYP', 196, '357'), ";
  261. $sql .= "('".uuid()."', 'Czech Republic', 'CZ', 'CZE', 203, '420'), ";
  262. $sql .= "('".uuid()."', 'Côte d''Ivoire', 'CI', 'CIV', 384, '225'), ";
  263. $sql .= "('".uuid()."', 'Denmark', 'DK', 'DNK', 208, '45'), ";
  264. $sql .= "('".uuid()."', 'Djibouti', 'DJ', 'DJI', 262, '253'), ";
  265. $sql .= "('".uuid()."', 'Dominica', 'DM', 'DMA', 212, '1-767'), ";
  266. $sql .= "('".uuid()."', 'Dominican Republic', 'DO', 'DOM', 214, '1-809,1-829,1-849'), ";
  267. $sql .= "('".uuid()."', 'Ecuador', 'EC', 'ECU', 218, '593'), ";
  268. $sql .= "('".uuid()."', 'Egypt', 'EG', 'EGY', 818, '20'), ";
  269. $sql .= "('".uuid()."', 'El Salvador', 'SV', 'SLV', 222, '503'), ";
  270. $sql .= "('".uuid()."', 'Equatorial Guinea', 'GQ', 'GNQ', 226, '240'), ";
  271. $sql .= "('".uuid()."', 'Eritrea', 'ER', 'ERI', 232, '291'), ";
  272. $sql .= "('".uuid()."', 'Estonia', 'EE', 'EST', 233, '372'), ";
  273. $sql .= "('".uuid()."', 'Ethiopia', 'ET', 'ETH', 231, '251'), ";
  274. $sql .= "('".uuid()."', 'Falkland Islands (Malvinas)', 'FK', 'FLK', 238, '500'), ";
  275. $sql .= "('".uuid()."', 'Faroe Islands', 'FO', 'FRO', 234, '298'), ";
  276. $sql .= "('".uuid()."', 'Fiji', 'FJ', 'FJI', 242, '679'), ";
  277. $sql .= "('".uuid()."', 'Finland', 'FI', 'FIN', 246, '358'), ";
  278. $sql .= "('".uuid()."', 'France', 'FR', 'FRA', 250, '33'), ";
  279. $sql .= "('".uuid()."', 'French Guiana', 'GF', 'GUF', 254, '594'), ";
  280. $sql .= "('".uuid()."', 'French Polynesia', 'PF', 'PYF', 258, '689'), ";
  281. $sql .= "('".uuid()."', 'French Southern Territories', 'TF', 'ATF', 260, '262'), ";
  282. $sql .= "('".uuid()."', 'Gabon', 'GA', 'GAB', 266, '241'), ";
  283. $sql .= "('".uuid()."', 'Gambia', 'GM', 'GMB', 270, '220'), ";
  284. $sql .= "('".uuid()."', 'Georgia', 'GE', 'GEO', 268, '995'), ";
  285. $sql .= "('".uuid()."', 'Germany', 'DE', 'DEU', 276, '49'), ";
  286. $sql .= "('".uuid()."', 'Ghana', 'GH', 'GHA', 288, '233'), ";
  287. $sql .= "('".uuid()."', 'Gibraltar', 'GI', 'GIB', 292, '350'), ";
  288. $sql .= "('".uuid()."', 'Greece', 'GR', 'GRC', 300, '30'), ";
  289. $sql .= "('".uuid()."', 'Greenland', 'GL', 'GRL', 304, '299'), ";
  290. $sql .= "('".uuid()."', 'Grenada', 'GD', 'GRD', 308, '1-473'), ";
  291. $sql .= "('".uuid()."', 'Guadeloupe', 'GP', 'GLP', 312, '590'), ";
  292. $sql .= "('".uuid()."', 'Guam', 'GU', 'GUM', 316, '1-671'), ";
  293. $sql .= "('".uuid()."', 'Guatemala', 'GT', 'GTM', 320, '502'), ";
  294. $sql .= "('".uuid()."', 'Guernsey', 'GG', 'GGY', 831, '44'), ";
  295. $sql .= "('".uuid()."', 'Guinea', 'GN', 'GIN', 324, '224'), ";
  296. $sql .= "('".uuid()."', 'Guinea-Bissau', 'GW', 'GNB', 624, '245'), ";
  297. $sql .= "('".uuid()."', 'Guyana', 'GY', 'GUY', 328, '592'), ";
  298. $sql .= "('".uuid()."', 'Haiti', 'HT', 'HTI', 332, '509'), ";
  299. $sql .= "('".uuid()."', 'Heard Island and McDonald Islands', 'HM', 'HMD', 334, '672'), ";
  300. $sql .= "('".uuid()."', 'Holy See (Vatican City State)', 'VA', 'VAT', 336, '379'), ";
  301. $sql .= "('".uuid()."', 'Honduras', 'HN', 'HND', 340, '504'), ";
  302. $sql .= "('".uuid()."', 'Hong Kong', 'HK', 'HKG', 344, '852'), ";
  303. $sql .= "('".uuid()."', 'Hungary', 'HU', 'HUN', 348, '36'), ";
  304. $sql .= "('".uuid()."', 'Iceland', 'IS', 'ISL', 352, '354'), ";
  305. $sql .= "('".uuid()."', 'India', 'IN', 'IND', 356, '91'), ";
  306. $sql .= "('".uuid()."', 'Indonesia', 'ID', 'IDN', 360, '62'), ";
  307. $sql .= "('".uuid()."', 'Iran, Islamic Republic of', 'IR', 'IRN', 364, '98'), ";
  308. $sql .= "('".uuid()."', 'Iraq', 'IQ', 'IRQ', 368, '964'), ";
  309. $sql .= "('".uuid()."', 'Ireland', 'IE', 'IRL', 372, '353'), ";
  310. $sql .= "('".uuid()."', 'Isle of Man', 'IM', 'IMN', 833, '44'), ";
  311. $sql .= "('".uuid()."', 'Israel', 'IL', 'ISR', 376, '972'), ";
  312. $sql .= "('".uuid()."', 'Italy', 'IT', 'ITA', 380, '39'), ";
  313. $sql .= "('".uuid()."', 'Jamaica', 'JM', 'JAM', 388, '1-876'), ";
  314. $sql .= "('".uuid()."', 'Japan', 'JP', 'JPN', 392, '81'), ";
  315. $sql .= "('".uuid()."', 'Jersey', 'JE', 'JEY', 832, '44'), ";
  316. $sql .= "('".uuid()."', 'Jordan', 'JO', 'JOR', 400, '962'), ";
  317. $sql .= "('".uuid()."', 'Kazakhstan', 'KZ', 'KAZ', 398, '7'), ";
  318. $sql .= "('".uuid()."', 'Kenya', 'KE', 'KEN', 404, '254'), ";
  319. $sql .= "('".uuid()."', 'Kiribati', 'KI', 'KIR', 296, '686'), ";
  320. $sql .= "('".uuid()."', 'Korea, Democratic People''s Republic of', 'KP', 'PRK', 408, '850'), ";
  321. $sql .= "('".uuid()."', 'Korea, Republic of', 'KR', 'KOR', 410, '82'), ";
  322. $sql .= "('".uuid()."', 'Kuwait', 'KW', 'KWT', 414, '965'), ";
  323. $sql .= "('".uuid()."', 'Kyrgyzstan', 'KG', 'KGZ', 417, '996'), ";
  324. $sql .= "('".uuid()."', 'Lao People''s Democratic Republic', 'LA', 'LAO', 418, '856'), ";
  325. $sql .= "('".uuid()."', 'Latvia', 'LV', 'LVA', 428, '371'), ";
  326. $sql .= "('".uuid()."', 'Lebanon', 'LB', 'LBN', 422, '961'), ";
  327. $sql .= "('".uuid()."', 'Lesotho', 'LS', 'LSO', 426, '266'), ";
  328. $sql .= "('".uuid()."', 'Liberia', 'LR', 'LBR', 430, '231'), ";
  329. $sql .= "('".uuid()."', 'Libya', 'LY', 'LBY', 434, '218'), ";
  330. $sql .= "('".uuid()."', 'Liechtenstein', 'LI', 'LIE', 438, '423'), ";
  331. $sql .= "('".uuid()."', 'Lithuania', 'LT', 'LTU', 440, '370'), ";
  332. $sql .= "('".uuid()."', 'Luxembourg', 'LU', 'LUX', 442, '352'), ";
  333. $sql .= "('".uuid()."', 'Macao', 'MO', 'MAC', 446, '853'), ";
  334. $sql .= "('".uuid()."', 'Macedonia, the Former Yugoslav Republic of', 'MK', 'MKD', 807, '389'), ";
  335. $sql .= "('".uuid()."', 'Madagascar', 'MG', 'MDG', 450, '261'), ";
  336. $sql .= "('".uuid()."', 'Malawi', 'MW', 'MWI', 454, '265'), ";
  337. $sql .= "('".uuid()."', 'Malaysia', 'MY', 'MYS', 458, '60'), ";
  338. $sql .= "('".uuid()."', 'Maldives', 'MV', 'MDV', 462, '960'), ";
  339. $sql .= "('".uuid()."', 'Mali', 'ML', 'MLI', 466, '223'), ";
  340. $sql .= "('".uuid()."', 'Malta', 'MT', 'MLT', 470, '356'), ";
  341. $sql .= "('".uuid()."', 'Marshall Islands', 'MH', 'MHL', 584, '692'), ";
  342. $sql .= "('".uuid()."', 'Martinique', 'MQ', 'MTQ', 474, '596'), ";
  343. $sql .= "('".uuid()."', 'Mauritania', 'MR', 'MRT', 478, '222'), ";
  344. $sql .= "('".uuid()."', 'Mauritius', 'MU', 'MUS', 480, '230'), ";
  345. $sql .= "('".uuid()."', 'Mayotte', 'YT', 'MYT', 175, '262'), ";
  346. $sql .= "('".uuid()."', 'Mexico', 'MX', 'MEX', 484, '52'), ";
  347. $sql .= "('".uuid()."', 'Micronesia, Federated States of', 'FM', 'FSM', 583, '691'), ";
  348. $sql .= "('".uuid()."', 'Moldova, Republic of', 'MD', 'MDA', 498, '373'), ";
  349. $sql .= "('".uuid()."', 'Monaco', 'MC', 'MCO', 492, '377'), ";
  350. $sql .= "('".uuid()."', 'Mongolia', 'MN', 'MNG', 496, '976'), ";
  351. $sql .= "('".uuid()."', 'Montenegro', 'ME', 'MNE', 499, '382'), ";
  352. $sql .= "('".uuid()."', 'Montserrat', 'MS', 'MSR', 500, '1-664'), ";
  353. $sql .= "('".uuid()."', 'Morocco', 'MA', 'MAR', 504, '212'), ";
  354. $sql .= "('".uuid()."', 'Mozambique', 'MZ', 'MOZ', 508, '258'), ";
  355. $sql .= "('".uuid()."', 'Myanmar', 'MM', 'MMR', 104, '95'), ";
  356. $sql .= "('".uuid()."', 'Namibia', 'NA', 'NAM', 516, '264'), ";
  357. $sql .= "('".uuid()."', 'Nauru', 'NR', 'NRU', 520, '674'), ";
  358. $sql .= "('".uuid()."', 'Nepal', 'NP', 'NPL', 524, '977'), ";
  359. $sql .= "('".uuid()."', 'Netherlands', 'NL', 'NLD', 528, '31'), ";
  360. $sql .= "('".uuid()."', 'New Caledonia', 'NC', 'NCL', 540, '687'), ";
  361. $sql .= "('".uuid()."', 'New Zealand', 'NZ', 'NZL', 554, '64'), ";
  362. $sql .= "('".uuid()."', 'Nicaragua', 'NI', 'NIC', 558, '505'), ";
  363. $sql .= "('".uuid()."', 'Niger', 'NE', 'NER', 562, '227'), ";
  364. $sql .= "('".uuid()."', 'Nigeria', 'NG', 'NGA', 566, '234'), ";
  365. $sql .= "('".uuid()."', 'Niue', 'NU', 'NIU', 570, '683'), ";
  366. $sql .= "('".uuid()."', 'Norfolk Island', 'NF', 'NFK', 574, '672'), ";
  367. $sql .= "('".uuid()."', 'Northern Mariana Islands', 'MP', 'MNP', 580, '1-670'), ";
  368. $sql .= "('".uuid()."', 'Norway', 'NO', 'NOR', 578, '47'), ";
  369. $sql .= "('".uuid()."', 'Oman', 'OM', 'OMN', 512, '968'), ";
  370. $sql .= "('".uuid()."', 'Pakistan', 'PK', 'PAK', 586, '92'), ";
  371. $sql .= "('".uuid()."', 'Palau', 'PW', 'PLW', 585, '680'), ";
  372. $sql .= "('".uuid()."', 'Palestine, State of', 'PS', 'PSE', 275, '970'), ";
  373. $sql .= "('".uuid()."', 'Panama', 'PA', 'PAN', 591, '507'), ";
  374. $sql .= "('".uuid()."', 'Papua New Guinea', 'PG', 'PNG', 598, '675'), ";
  375. $sql .= "('".uuid()."', 'Paraguay', 'PY', 'PRY', 600, '595'), ";
  376. $sql .= "('".uuid()."', 'Peru', 'PE', 'PER', 604, '51'), ";
  377. $sql .= "('".uuid()."', 'Philippines', 'PH', 'PHL', 608, '63'), ";
  378. $sql .= "('".uuid()."', 'Pitcairn', 'PN', 'PCN', 612, '870'), ";
  379. $sql .= "('".uuid()."', 'Poland', 'PL', 'POL', 616, '48'), ";
  380. $sql .= "('".uuid()."', 'Portugal', 'PT', 'PRT', 620, '351'), ";
  381. $sql .= "('".uuid()."', 'Puerto Rico', 'PR', 'PRI', 630, '1'), ";
  382. $sql .= "('".uuid()."', 'Qatar', 'QA', 'QAT', 634, '974'), ";
  383. $sql .= "('".uuid()."', 'Romania', 'RO', 'ROU', 642, '40'), ";
  384. $sql .= "('".uuid()."', 'Russian Federation', 'RU', 'RUS', 643, '7'), ";
  385. $sql .= "('".uuid()."', 'Rwanda', 'RW', 'RWA', 646, '250'), ";
  386. $sql .= "('".uuid()."', 'Reunion', 'RE', 'REU', 638, '262'), ";
  387. $sql .= "('".uuid()."', 'Saint Barthelemy', 'BL', 'BLM', 652, '590'), ";
  388. $sql .= "('".uuid()."', 'Saint Helena', 'SH', 'SHN', 654, '290'), ";
  389. $sql .= "('".uuid()."', 'Saint Kitts and Nevis', 'KN', 'KNA', 659, '1-869'), ";
  390. $sql .= "('".uuid()."', 'Saint Lucia', 'LC', 'LCA', 662, '1-758'), ";
  391. $sql .= "('".uuid()."', 'Saint Martin (French part)', 'MF', 'MAF', 663, '590'), ";
  392. $sql .= "('".uuid()."', 'Saint Pierre and Miquelon', 'PM', 'SPM', 666, '508'), ";
  393. $sql .= "('".uuid()."', 'Saint Vincent and the Grenadines', 'VC', 'VCT', 670, '1-784'), ";
  394. $sql .= "('".uuid()."', 'Samoa', 'WS', 'WSM', 882, '685'), ";
  395. $sql .= "('".uuid()."', 'San Marino', 'SM', 'SMR', 674, '378'), ";
  396. $sql .= "('".uuid()."', 'Sao Tome and Principe', 'ST', 'STP', 678, '239'), ";
  397. $sql .= "('".uuid()."', 'Saudi Arabia', 'SA', 'SAU', 682, '966'), ";
  398. $sql .= "('".uuid()."', 'Senegal', 'SN', 'SEN', 686, '221'), ";
  399. $sql .= "('".uuid()."', 'Serbia', 'RS', 'SRB', 688, '381'), ";
  400. $sql .= "('".uuid()."', 'Seychelles', 'SC', 'SYC', 690, '248'), ";
  401. $sql .= "('".uuid()."', 'Sierra Leone', 'SL', 'SLE', 694, '232'), ";
  402. $sql .= "('".uuid()."', 'Singapore', 'SG', 'SGP', 702, '65'), ";
  403. $sql .= "('".uuid()."', 'Sint Maarten (Dutch part)', 'SX', 'SXM', 534, '1-721'), ";
  404. $sql .= "('".uuid()."', 'Slovakia', 'SK', 'SVK', 703, '421'), ";
  405. $sql .= "('".uuid()."', 'Slovenia', 'SI', 'SVN', 705, '386'), ";
  406. $sql .= "('".uuid()."', 'Solomon Islands', 'SB', 'SLB', 90, '677'), ";
  407. $sql .= "('".uuid()."', 'Somalia', 'SO', 'SOM', 706, '252'), ";
  408. $sql .= "('".uuid()."', 'South Africa', 'ZA', 'ZAF', 710, '27'), ";
  409. $sql .= "('".uuid()."', 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 239, '500'), ";
  410. $sql .= "('".uuid()."', 'South Sudan', 'SS', 'SSD', 728, '211'), ";
  411. $sql .= "('".uuid()."', 'Spain', 'ES', 'ESP', 724, '34'), ";
  412. $sql .= "('".uuid()."', 'Sri Lanka', 'LK', 'LKA', 144, '94'), ";
  413. $sql .= "('".uuid()."', 'Sudan', 'SD', 'SDN', 729, '249'), ";
  414. $sql .= "('".uuid()."', 'Suriname', 'SR', 'SUR', 740, '597'), ";
  415. $sql .= "('".uuid()."', 'Svalbard and Jan Mayen', 'SJ', 'SJM', 744, '47'), ";
  416. $sql .= "('".uuid()."', 'Swaziland', 'SZ', 'SWZ', 748, '268'), ";
  417. $sql .= "('".uuid()."', 'Sweden', 'SE', 'SWE', 752, '46'), ";
  418. $sql .= "('".uuid()."', 'Switzerland', 'CH', 'CHE', 756, '41'), ";
  419. $sql .= "('".uuid()."', 'Syrian Arab Republic', 'SY', 'SYR', 760, '963'), ";
  420. $sql .= "('".uuid()."', 'Taiwan, Province of China', 'TW', 'TWN', 158, '886'), ";
  421. $sql .= "('".uuid()."', 'Tajikistan', 'TJ', 'TJK', 762, '992'), ";
  422. $sql .= "('".uuid()."', 'United Republic of Tanzania', 'TZ', 'TZA', 834, '255'), ";
  423. $sql .= "('".uuid()."', 'Thailand', 'TH', 'THA', 764, '66'), ";
  424. $sql .= "('".uuid()."', 'Timor-Leste', 'TL', 'TLS', 626, '670'), ";
  425. $sql .= "('".uuid()."', 'Togo', 'TG', 'TGO', 768, '228'), ";
  426. $sql .= "('".uuid()."', 'Tokelau', 'TK', 'TKL', 772, '690'), ";
  427. $sql .= "('".uuid()."', 'Tonga', 'TO', 'TON', 776, '676'), ";
  428. $sql .= "('".uuid()."', 'Trinidad and Tobago', 'TT', 'TTO', 780, '1-868'), ";
  429. $sql .= "('".uuid()."', 'Tunisia', 'TN', 'TUN', 788, '216'), ";
  430. $sql .= "('".uuid()."', 'Turkey', 'TR', 'TUR', 792, '90'), ";
  431. $sql .= "('".uuid()."', 'Turkmenistan', 'TM', 'TKM', 795, '993'), ";
  432. $sql .= "('".uuid()."', 'Turks and Caicos Islands', 'TC', 'TCA', 796, '1-649'), ";
  433. $sql .= "('".uuid()."', 'Tuvalu', 'TV', 'TUV', 798, '688'), ";
  434. $sql .= "('".uuid()."', 'Uganda', 'UG', 'UGA', 800, '256'), ";
  435. $sql .= "('".uuid()."', 'Ukraine', 'UA', 'UKR', 804, '380'), ";
  436. $sql .= "('".uuid()."', 'United Arab Emirates', 'AE', 'ARE', 784, '971'), ";
  437. $sql .= "('".uuid()."', 'United Kingdom', 'GB', 'GBR', 826, '44'), ";
  438. $sql .= "('".uuid()."', 'United States', 'US', 'USA', 840, '1'), ";
  439. $sql .= "('".uuid()."', 'United States Minor Outlying Islands', 'UM', 'UMI', 581, '1'), ";
  440. $sql .= "('".uuid()."', 'Uruguay', 'UY', 'URY', 858, '598'), ";
  441. $sql .= "('".uuid()."', 'Uzbekistan', 'UZ', 'UZB', 860, '998'), ";
  442. $sql .= "('".uuid()."', 'Vanuatu', 'VU', 'VUT', 548, '678'), ";
  443. $sql .= "('".uuid()."', 'Venezuela', 'VE', 'VEN', 862, '58'), ";
  444. $sql .= "('".uuid()."', 'Viet Nam', 'VN', 'VNM', 704, '84'), ";
  445. $sql .= "('".uuid()."', 'British Virgin Islands', 'VG', 'VGB', 92, '1-284'), ";
  446. $sql .= "('".uuid()."', 'US Virgin Islands', 'VI', 'VIR', 850, '1-340'), ";
  447. $sql .= "('".uuid()."', 'Wallis and Futuna', 'WF', 'WLF', 876, '681'), ";
  448. $sql .= "('".uuid()."', 'Western Sahara', 'EH', 'ESH', 732, '212'), ";
  449. $sql .= "('".uuid()."', 'Yemen', 'YE', 'YEM', 887, '967'), ";
  450. $sql .= "('".uuid()."', 'Zambia', 'ZM', 'ZMB', 894, '260'), ";
  451. $sql .= "('".uuid()."', 'Zimbabwe', 'ZW', 'ZWE', 716, '263'), ";
  452. $sql .= "('".uuid()."', 'Aland Islands', 'AX', 'ALA', 248, '358') ";
  453. $database->execute($sql, null);
  454. unset($sql);
  455. }
  456. //update any defaults set to legacy languages
  457. $language = new text;
  458. foreach ($language->legacy_map as $language_code => $legacy_code) {
  459. if(strlen($legacy_code) == 5) {
  460. continue;
  461. }
  462. $sql = "update v_default_settings set default_setting_value = :language_code ";
  463. $sql .= "where default_setting_value = :legacy_code ";
  464. $sql .= "and default_setting_name = 'code' ";
  465. $sql .= "and default_setting_subcategory = 'language' ";
  466. $sql .= "and default_setting_category = 'domain' ";
  467. $parameters['language_code'] = $language_code;
  468. $parameters['legacy_code'] = $legacy_code;
  469. $database->execute($sql, $parameters);
  470. unset($sql, $parameters);
  471. }
  472. //set domain > time_zone to UTC if not set
  473. $sql = "update v_default_settings set ";
  474. $sql .= "default_setting_value = 'UTC', ";
  475. $sql .= "default_setting_enabled = 'true' ";
  476. $sql .= "where ( ";
  477. $sql .= " default_setting_value is null or ";
  478. $sql .= " default_setting_value = '' ";
  479. $sql .= ") ";
  480. $sql .= "and default_setting_category = 'domain' ";
  481. $sql .= "and default_setting_subcategory = 'time_zone' ";
  482. $sql .= "and default_setting_name = 'name' ";
  483. $database->execute($sql);
  484. unset($sql);
  485. //update login destination
  486. $sql = "update v_default_settings set ";
  487. $sql .= "default_setting_uuid = 'e2b9406f-37cf-4226-8111-e5d11d0bfd73', ";
  488. $sql .= "default_setting_name = 'text' ";
  489. $sql .= "where default_setting_category = 'login' ";
  490. $sql .= "and default_setting_subcategory = 'destination' ";
  491. $sql .= "and default_setting_name = 'url' ";
  492. $database->execute($sql);
  493. unset($sql);
  494. }
  495. ?>