Michael Posted April 1, 2015 Report Share Posted April 1, 2015 Currently the module has a Text box, I changed this because customers tried to enter the full country name and not the ISO that control panels like InterWorx, cPanel use when generating the CSR. This is what I've been using for over a year and it comes in handy and a few of my customers use this because they asked about the same issue. private function getCountriesList() { return array( "--" => "--- Please select your country ---", "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina", "BW" => "Botswana", "BR" => "Brazil", "IO" => "British Indian Ocean Territory", "VG" => "British Virgin Islands", "BN" => "Brunei", "BG" => "Bulgaria", "BF" => "Burkina Faso", "MM" => "Burma (Myanmar)", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos (Keeling) Islands", "CO" => "Colombia", "KM" => "Comoros", "CK" => "Cook Islands", "CR" => "Costa Rica", "HR" => "Croatia", "CU" => "Cuba", "CY" => "Cyprus", "CZ" => "Czech Republic", "CD" => "Democratic Republic of the Congo", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands", "FO" => "Faroe Islands", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "PF" => "French Polynesia", "GA" => "Gabon", "GM" => "Gambia", " " => "Gaza Strip", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GU" => "Guam", "GT" => "Guatemala", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "VA" => "Holy See (Vatican City)", "HN" => "Honduras", "HK" => "Hong Kong", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IR" => "Iran", "IQ" => "Iraq", "IE" => "Ireland", "IM" => "Isle of Man", "IL" => "Israel", "IT" => "Italy", "CI" => "Ivory Coast", "JM" => "Jamaica", "JP" => "Japan", "JE" => "Jersey", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", " " => "Kosovo", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Laos", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macau", "MK" => "Macedonia", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "MX" => "Mexico", "FM" => "Micronesia", "MD" => "Moldova", "MC" => "Monaco", "MN" => "Mongolia", "ME" => "Montenegro", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", " " => "Norfolk Island", "KP" => "North Korea (Democratic People's Republic of Korea)", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn Islands", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "CG" => "Republic of the Congo", "RO" => "Romania", "RU" => "Russia", "RW" => "Rwanda", "BL" => "Saint Barthelemy", "SH" => "Saint Helena", "KN" => "Saint Kitts and Nevis", "LC" => "Saint Lucia", "MF" => "Saint Martin", "PM" => "Saint Pierre and Miquelon", "VC" => "Saint Vincent and the Grenadines", "WS" => "Samoa", "SM" => "San Marino", "ST" => "Sao Tome and Principe", "SA" => "Saudi Arabia", "SN" => "Senegal", "RS" => "Serbia", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "KR" => "South Korea", "ES" => "Spain", "LK" => "Sri Lanka", "SD" => "Sudan", "SR" => "Suriname", "SJ" => "Svalbard", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "SY" => "Syria", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand", "TL" => "Timor-Leste", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "GB" => "United Kingdom", "US" => "United States", "UY" => "Uruguay", "VI" => "US Virgin Islands", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VE" => "Venezuela", "VN" => "Vietnam", "WF" => "Wallis and Futuna", " " => "West Bank", "EH" => "Western Sahara", "YE" => "Yemen", "ZM" => "Zambia", "ZW" => "Zimbabwe" ); } eva2000, LukesUbuntu, Blesta Addons and 1 other 4 Quote Link to comment Share on other sites More sharing options...
serge Posted April 3, 2015 Report Share Posted April 3, 2015 Great! For info: Norfolk Island is ISO : NF Gambia is ISO : GM West Bank is ISO: PS Gaza Strip is ISO: PS Kosovo is ISO: XK and you missed my country of heart "Réunion" ISO : RE http://en.wikipedia.org/wiki/ISO_3166-2:RE Quote Link to comment Share on other sites More sharing options...
Michael Posted April 3, 2015 Author Report Share Posted April 3, 2015 Great! For info: Norfolk Island is ISO : NF Gambia is ISO : GM West Bank is ISO: PS Gaza Strip is ISO: PS Kosovo is ISO: XK and you missed my country of heart "Réunion" ISO : RE http://en.wikipedia.org/wiki/ISO_3166-2:RE I didn't use that list mate I used: http://countrycode.org/ Quote Link to comment Share on other sites More sharing options...
serge Posted April 3, 2015 Report Share Posted April 3, 2015 Countries I given have empty ISO code in your list, so that why I did notice to you, example from you: " " => "Norfolk Island", --------- So I suppose it will be later an issue at selecting one of these country in your application? Michael 1 Quote Link to comment Share on other sites More sharing options...
Michael Posted April 3, 2015 Author Report Share Posted April 3, 2015 Countries I given have empty ISO code in your list, so that why I did notice to you, example from you: " " => "Norfolk Island", --------- So I suppose it will be later an issue at selecting one of these country in your application? Not sure according to the list I used they don't have an official one only a valid 3 digit code. If you use them others and people don't enter one because they don't use one it could muck up and error out. Quote Link to comment Share on other sites More sharing options...
Tyson Posted April 3, 2015 Report Share Posted April 3, 2015 How does your list differ from the countries Blesta already stores? Quote Link to comment Share on other sites More sharing options...
Michael Posted April 3, 2015 Author Report Share Posted April 3, 2015 How does your list differ from the countries Blesta already stores? Not sure, but the module itself doesn't have a list I just wanted a dropdown box instead of a text area. kwimberl and eva2000 2 Quote Link to comment Share on other sites More sharing options...
Daniel B Posted May 28, 2015 Report Share Posted May 28, 2015 Can you add a bit more information to your post for those who might be new to modifying things...like where this needs to be added, what file, etc? Quote Link to comment Share on other sites More sharing options...
Michael Posted May 28, 2015 Author Report Share Posted May 28, 2015 Can you add a bit more information to your post for those who might be new to modifying things...like where this needs to be added, what file, etc? the main thesslstore.php in /components/modules/thesslstore/ and you just search the top bit and then replace the section. eva2000 1 Quote Link to comment Share on other sites More sharing options...
Daniel B Posted May 28, 2015 Report Share Posted May 28, 2015 that's what I was thinking, but I'm not finding the top bit Find: Can't find the text "private function getCountriesList()" Quote Link to comment Share on other sites More sharing options...
Michael Posted May 28, 2015 Author Report Share Posted May 28, 2015 that's what I was thinking, but I'm not finding the top bit Find: Can't find the text "private function getCountriesList()" Sorry mate looks like I did more editing than that (been so long since I did it), here's what I found in my thesslstore.php Find: $thesslstore_country = $fields->label(Language::_("TheSSLStore.service_field.thesslstore_country", true), "thesslstore_country"); $thesslstore_country->attach($fields->fieldText("thesslstore_country", $this->Html->ifSet($vars->thesslstore_country), array('id' => "thesslstore_country"))); $fields->setField($thesslstore_country); unset($thesslstore_country); Change with: // Old Country list code #$thesslstore_country = $fields->label(Language::_("TheSSLStore.service_field.thesslstore_country", true), "thesslstore_country"); #$thesslstore_country->attach($fields->fieldText("thesslstore_country", $this->Html->ifSet($vars->thesslstore_country), array('id' => "thesslstore_country"))); #$fields->setField($thesslstore_country); #unset($thesslstore_country); $thesslstore_country = $fields->label(Language::_("TheSSLStore.service_field.thesslstore_country", true), "thesslstore_country"); $thesslstore_country->attach($fields->fieldSelect("thesslstore_country", $this->getCountriesList(), $this->Html->ifSet($vars->thesslstore_country), array('id' => "thesslstore_country"))); $fields->setField($thesslstore_country); unset($thesslstore_country); Find: private function getWebserverTypes() { //Dumped from https://www.thesslstore.com/api/web-server-types //No API for this return array( Above it put: private function getCountriesList() { return array( "--" => "--- Please select your country ---", "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina", "BW" => "Botswana", "BR" => "Brazil", "IO" => "British Indian Ocean Territory", "VG" => "British Virgin Islands", "BN" => "Brunei", "BG" => "Bulgaria", "BF" => "Burkina Faso", "MM" => "Burma (Myanmar)", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos (Keeling) Islands", "CO" => "Colombia", "KM" => "Comoros", "CK" => "Cook Islands", "CR" => "Costa Rica", "HR" => "Croatia", "CU" => "Cuba", "CY" => "Cyprus", "CZ" => "Czech Republic", "CD" => "Democratic Republic of the Congo", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands", "FO" => "Faroe Islands", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "PF" => "French Polynesia", "GA" => "Gabon", "GM" => "Gambia", " " => "Gaza Strip", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GU" => "Guam", "GT" => "Guatemala", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "VA" => "Holy See (Vatican City)", "HN" => "Honduras", "HK" => "Hong Kong", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IR" => "Iran", "IQ" => "Iraq", "IE" => "Ireland", "IM" => "Isle of Man", "IL" => "Israel", "IT" => "Italy", "CI" => "Ivory Coast", "JM" => "Jamaica", "JP" => "Japan", "JE" => "Jersey", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", " " => "Kosovo", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Laos", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macau", "MK" => "Macedonia", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "MX" => "Mexico", "FM" => "Micronesia", "MD" => "Moldova", "MC" => "Monaco", "MN" => "Mongolia", "ME" => "Montenegro", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", " " => "Norfolk Island", "KP" => "North Korea (Democratic People's Republic of Korea)", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn Islands", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "CG" => "Republic of the Congo", "RO" => "Romania", "RU" => "Russia", "RW" => "Rwanda", "BL" => "Saint Barthelemy", "SH" => "Saint Helena", "KN" => "Saint Kitts and Nevis", "LC" => "Saint Lucia", "MF" => "Saint Martin", "PM" => "Saint Pierre and Miquelon", "VC" => "Saint Vincent and the Grenadines", "WS" => "Samoa", "SM" => "San Marino", "ST" => "Sao Tome and Principe", "SA" => "Saudi Arabia", "SN" => "Senegal", "RS" => "Serbia", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "KR" => "South Korea", "ES" => "Spain", "LK" => "Sri Lanka", "SD" => "Sudan", "SR" => "Suriname", "SJ" => "Svalbard", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "SY" => "Syria", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand", "TL" => "Timor-Leste", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "GB" => "United Kingdom", "US" => "United States", "UY" => "Uruguay", "VI" => "US Virgin Islands", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VE" => "Venezuela", "VN" => "Vietnam", "WF" => "Wallis and Futuna", " " => "West Bank", "EH" => "Western Sahara", "YE" => "Yemen", "ZM" => "Zambia", "ZW" => "Zimbabwe" ); } There we go haha sorry again Daniel B and eva2000 2 Quote Link to comment Share on other sites More sharing options...
Daniel B Posted May 28, 2015 Report Share Posted May 28, 2015 thanks much Quote Link to comment Share on other sites More sharing options...
Michael Posted May 28, 2015 Author Report Share Posted May 28, 2015 thanks much No probs mate Quote Link to comment Share on other sites More sharing options...
Tyson Posted May 28, 2015 Report Share Posted May 28, 2015 If we were going to add this, we would very likely use the countries list from Blesta rather than the OP's list. Would that suffice? kwimberl and Blesta Addons 2 Quote Link to comment Share on other sites More sharing options...
Daniel B Posted May 28, 2015 Report Share Posted May 28, 2015 Is there a difference between the two? Shouldn't they use the same codes? Quote Link to comment Share on other sites More sharing options...
Michael Posted May 28, 2015 Author Report Share Posted May 28, 2015 If we were going to add this, we would very likely use the countries list from Blesta rather than the OP's list. Would that suffice? I don't mind mate a list just makes life easier Is there a difference between the two? Shouldn't they use the same codes? I'm hoping he means for example pulling them from the database and then using that in an array which is better than text. Daniel B 1 Quote Link to comment Share on other sites More sharing options...
Blesta Addons Posted May 28, 2015 Report Share Posted May 28, 2015 If we were going to add this, we would very likely use the countries list from Blesta rather than the OP's list. Would that suffice? that is the best option . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.