Changeset 2821 for alternc/trunk/bureau/class/m_dom.php
- Timestamp:
- 01/29/11 18:58:19 (2 years ago)
- File:
-
- 1 edited
-
alternc/trunk/bureau/class/m_dom.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/class/m_dom.php
r2817 r2821 647 647 $r["nsub"]=$db->Record["cnt"]; 648 648 $db->free(); 649 $db->query("select sd.*, dt.description as type_desc from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and upper(dt.name)=upper(sd.type)");649 $db->query("select sd.*, dt.description as type_desc, dt.only_dns from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and upper(dt.name)=upper(sd.type)"); 650 650 // Pas de webmail, on le cochera si on le trouve. 651 651 $this->webmail=0; … … 656 656 $r["sub"][$i]["dest"]=$db->Record["valeur"]; 657 657 $r["sub"][$i]["type"]=$db->Record["type"]; 658 $r["sub"][$i]["enable"]=$db->Record["enable"]; 658 659 $r["sub"][$i]["type_desc"]=$db->Record["type_desc"]; 660 $r["sub"][$i]["only_dns"]=$db->Record["only_dns"]; 661 $r["sub"][$i]["web_action"]=$db->Record["web_action"]; 659 662 /* 660 663 if ($db->Record["type"]==3) { // Webmail … … 704 707 } 705 708 */ 706 $db->query("select sd.*, dt.description as type_desc from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and sub='$sub' and ( length('$type')=0 or type='$type') and (length('$value')=0 or '$value'=valeur) and upper(dt.name)=upper(sd.type);");709 $db->query("select sd.*, dt.description as type_desc, dt.only_dns from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and sub='$sub' and ( length('$type')=0 or type='$type') and (length('$value')=0 or '$value'=valeur) and upper(dt.name)=upper(sd.type);"); 707 710 if ($db->num_rows()==0) { 708 711 $err->raise("dom",14); … … 713 716 $r["name"]=$db->Record["sub"]; 714 717 $r["dest"]=$db->Record["valeur"]; 715 $r[" type"]=$db->Record["type"];718 $r["enable"]=$db->Record["enable"]; 716 719 $r["type_desc"]=$db->Record["type_desc"]; 720 $r["only_dns"]=$db->Record["only_dns"]; 721 $r["web_action"]=$db->Record["web_action"]; 717 722 $db->free(); 718 723 return $r; … … 738 743 return false; 739 744 } 745 return true; 740 746 break; 741 747 case 'IP': … … 759 765 760 766 761 function can_create_subdomain($dom,$sub,$type ) {767 function can_create_subdomain($dom,$sub,$type,$value_old='') { 762 768 global $db,$err,$cuid; 763 769 $err->log("dom","can_create_subdomain",$dom."/".$sub); … … 769 775 770 776 # Get the list of type of subdomains already here who have the same name 771 $db->query("select distinct type from sub_domaines where sub='$sub' and domaine='$dom';"); 777 $db->query("select * from sub_domaines where sub='$sub' and domaine='$dom' and not (type='$type' and valeur='$value_old')"); 778 #$db->query("select * from sub_domaines where sub='$sub' and domaine='$dom';"); 772 779 while ($db->next_record()) { 773 780 # And if there is a domain with a incompatible type, return false … … 829 836 } 830 837 831 if (! $this->can_create_subdomain($dom,$sub,$type )) {838 if (! $this->can_create_subdomain($dom,$sub,$type,$value_old)) { 832 839 # TODO have a real error code 833 840 $err->raise("dom", 654);
Note: See TracChangeset
for help on using the changeset viewer.
