Changeset 3089
- Timestamp:
- 09/26/11 19:46:51 (20 months ago)
- Location:
- alternc/branches/stable-1.0/bureau
- Files:
-
- 2 edited
-
class/m_dom.php (modified) (5 diffs)
-
locales/fr_FR/LC_MESSAGES/manual.po (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
alternc/branches/stable-1.0/bureau/class/m_dom.php
r3082 r3089 187 187 global $err,$cuid,$db; 188 188 $id=intval($id); 189 // The name MUST contain only letter and digits, it's an identifier after all ... 190 if (!preg_match("#^[a-z0-9]+$#",$name)) { 191 $err->raise("dom", 26); 192 return false; 193 } 189 194 $name=mysql_real_escape_string($name); 190 195 $description=mysql_real_escape_string($description); … … 800 805 801 806 807 /* ----------------------------------------------------------------- */ 808 /** 809 * Check the compatibility of the POSTed parameters with the chosen 810 * domain type 811 * 812 * @param string $dom FQDN of the domain name 813 * @param string $sub SUBdomain 814 * @return boolean tell you if the subdomain can be installed there 815 */ 802 816 function can_create_subdomain($dom,$sub,$type,$type_old='', $value_old='') { 803 817 global $db,$err,$cuid; 804 818 $err->log("dom","can_create_subdomain",$dom."/".$sub); 805 819 806 #Get the compatibility list for this domain type820 // Get the compatibility list for this domain type 807 821 $db->query("select upper(compatibility) as compatibility from domaines_type where upper(name)=upper('$type');"); 808 822 if (!$db->next_record()) return false; 809 823 $compatibility_lst = explode(",",$db->f('compatibility')); 810 824 811 #Get the list of type of subdomains already here who have the same name825 // Get the list of type of subdomains already here who have the same name 812 826 $db->query("select * from sub_domaines where sub='$sub' and domaine='$dom' and not (type='$type_old' and valeur='$value_old') and web_action != 'DELETE'"); 813 827 #$db->query("select * from sub_domaines where sub='$sub' and domaine='$dom';"); 814 828 while ($db->next_record()) { 815 #And if there is a domain with a incompatible type, return false829 // And if there is a domain with a incompatible type, return false 816 830 if (! in_array(strtoupper($db->f('type')),$compatibility_lst)) return false; 817 831 } 818 832 819 #All is right, go ! Create ur domain !833 // All is right, go ! Create ur domain ! 820 834 return true; 821 835 } … … 837 851 * @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon. 838 852 */ 839 // TODO : j'ai viré le type action, valider que plus personne ne l'utilise (quatrieme argument)840 853 function set_sub_domain($dom,$sub,$type,$dest, $type_old=null,$sub_old=null,$value_old=null) { 841 854 global $db,$err,$cuid; … … 860 873 861 874 if (! $this->check_type_value($type,$dest)) { 862 # TODO have a real err code863 $err->raise("dom", 667);875 // Invalid domain type selected, please check. 876 $err->raise("dom",27); 864 877 return false; 865 878 } … … 872 885 873 886 if (! $this->can_create_subdomain($dom,$sub,$type,$type_old,$value_old)) { 874 # TODO have a real error code875 $err->raise("dom", 654);887 // The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility 888 $err->raise("dom", 28); 876 889 return false; 877 890 } -
alternc/branches/stable-1.0/bureau/locales/fr_FR/LC_MESSAGES/manual.po
r3035 r3089 196 196 "d'héberger le mail ici." 197 197 198 #. The name of the domain type MUST contain only digits and letters 199 msgid "err_dom_26" 200 msgstr "Le nom des types de domaines ne doit être composé que de chiffres ou de lettres." 201 202 #. Invalid domain type selected, please check. 203 msgid "err_dom_27" 204 msgstr "Un type de domaine invalide a été sélectionné, merci de vérifier." 205 206 #. The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility 207 msgid "err_dom_28" 208 msgstr "Les paramètres pour ce sous-domaine et ce type de domaine sont invalide. Vérifiez qu'aucune incompatibilité n'existe sur ce sous-domaine." 209 198 210 #. - Entrez le nom du domaine que vous souhaitez héberger. Le nom de domaine 199 211 #. doit être complet, mais <b>sans le www.</b><br /> IMPORTANT : Si vous voulez
Note: See TracChangeset
for help on using the changeset viewer.
