21 define(
'SLAVE_FLAG',
"/run/alternc/refresh_slave");
79 global $L_FQDN, $domislocked;
80 $this->tld_no_check_at_all = variable_get(
'tld_no_check_at_all', 0,
'Disable ALL check on the TLD (users will be able to add any domain)', array(
'desc' =>
'Disabled',
'type' =>
'boolean'));
81 variable_get(
'mailname_bounce', $L_FQDN,
'FQDN of the mail server, used to create vhost virtual mail_adress.', array(
'desc' =>
'FQDN',
'type' =>
'string'));
88 $msg->debug(
"dom",
"get_panel_url_list");
89 $db->query(
"SELECT sd.id as sub_id, if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) as fqdn from sub_domaines sd where type = 'PANEL';");
91 while ($db->next_record()) {
92 $t[intval($db->f(
'sub_id'))] = $db->f(
'fqdn');
103 $msg->debug(
"dom",
"get_sub_domain_by_name");
104 $db->query(
"select sd.* from sub_domaines sd where if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) = ?;", array($fqdn));
105 if (!$db->next_record()) {
108 return array(
'sub_id' => intval($db->f(
'id')),
'member_id' => intval($db->f(
'compte')));
119 'title' => _(
"Domains"),
125 if ($quota->cancreate(
"dom")) {
126 $obj[
'links'][] = array(
127 'txt' => _(
"Add a domain"),
128 'url' =>
"dom_add.php",
133 $obj[
'links'][] = array(
134 'txt' => htmlentities($d),
135 'url' =>
"dom_edit.php?domain=" . urlencode($d),
151 $msg->debug(
"dom",
"domains_type_lst");
152 if (empty($this->cache_domains_type_lst)) {
153 $db->query(
"select * from domaines_type order by advanced;");
154 $this->cache_domains_type_lst = array();
155 while ($db->next_record()) {
156 $this->cache_domains_type_lst[strtolower($db->Record[
"name"])] = $db->Record;
165 global $db, $msg, $cuid;
166 $msg->debug(
"dom",
"domains_type_enable_values");
167 $db->query(
"desc domaines_type;");
169 while ($db->next_record()) {
170 if ($db->f(
'Field') ==
'enable') {
171 $tab = explode(
",", substr($db->f(
'Type'), 5, -1));
172 foreach ($tab as $t) {
173 $r[] = substr($t, 1, -1);
187 $msg->debug(
"dom",
"domains_type_target_values");
188 if (is_null($type)) {
189 $db->query(
"desc domaines_type;");
191 while ($db->next_record()) {
192 if ($db->f(
'Field') ==
'target') {
193 $tab = explode(
",", substr($db->f(
'Type'), 5, -1));
194 foreach ($tab as $t) {
195 $r[] = substr($t, 1, -1);
201 $db->query(
"select target from domaines_type where name= ? ;", array($type));
202 if (!$db->next_record()) {
205 return $db->f(
'target');
214 $msg->raise(
"ERROR",
'dom', _(
"Err: failed to prepare the zone"));
220 foreach (explode(
"\n", $zone) as $z) {
236 $msg->log(
"dom",
"import_manual_dns_entry");
242 $domain = trim($domain);
243 if (empty($domain)) {
244 $msg->raise(
"ERROR",
"dom", _(
"Missing domain name"));
250 'comment' =>
'no val',
251 'entry_old' => $zone,
252 'entry_new' => array(
'domain' => $domain),
257 if (preg_match(
'/^;/', $zone, $ret)) {
258 $val[
'status'] =
'ok';
259 $val[
'comment'] =
'Just a comment, do not import';
263 if (preg_match(
'/^\$TTL\h+(?P<ttl>[\dMHDmhd]+)/', $zone, $ret)) {
264 $val[
'status'] =
'ok';
265 $val[
'comment'] =
'Set TTL to ' . $ret[
'ttl'];
266 $val[
'entry_new'][
'type'] =
'set_ttl';
267 $val[
'entry_new'][
'value'] = $ret[
'ttl'];
273 if (preg_match(
'/^(?P<sub>[\w\.@\-]*)\h*(?P<ttl>\d*)\h*IN\h+AAAA\h+(?P<target>[0-9A-F:]{2,40})/i', $zone, $ret)) {
276 if (substr($ret[
'sub'], -1) ==
'.') {
277 $url =
"http://" . $ret[
'sub'];
279 if ($ret[
'sub'] ==
'@' || empty($ret[
'sub'])) {
280 $url =
"http://" . $domain;
282 $url =
"http://" . $ret[
'sub'] .
"." . $domain;
286 $val[
'status'] =
'warn';
287 $val[
'comment'] =
"Became a redirect to $dst_url";
288 $val[
'entry_new'][
'type'] =
'URL';
289 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
290 $val[
'entry_new'][
'value'] = $dst_url;
292 $val[
'status'] =
'ok';
293 $val[
'comment'] =
"Create entry AAAA with " . $ret[
'sub'] .
" go to " . $ret[
'target'] .
" with ttl " . $ret[
'ttl'];
294 $val[
'entry_new'][
'type'] =
'IPV6';
295 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
296 $val[
'entry_new'][
'value'] = $ret[
'target'];
304 if (preg_match(
'/^(?P<sub>[\w\.@\-]*)\h*(?P<ttl>\d*)\h*IN\h+A\h+(?P<target>\d+\.\d+\.\d+\.\d+)/i', $zone, $ret)) {
306 if (substr($ret[
'sub'], -1) ==
'.') {
307 $url =
"http://" . $ret[
'sub'];
309 if ($ret[
'sub'] ==
'@' || empty($ret[
'sub'])) {
310 $url =
"http://" . $domain;
312 $url =
"http://" . $ret[
'sub'] .
"." . $domain;
316 $val[
'status'] =
'warn';
317 $val[
'comment'] =
"Became a redirect to $dst_url";
318 $val[
'entry_new'][
'type'] =
'URL';
319 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
320 $val[
'entry_new'][
'value'] = $dst_url;
322 $val[
'status'] =
'ok';
323 $val[
'comment'] =
"Create entry A with " . $ret[
'sub'] .
" go to " . $ret[
'target'] .
" with ttl " . $ret[
'ttl'];
324 $val[
'entry_new'][
'type'] =
'IP';
325 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
326 $val[
'entry_new'][
'value'] = $ret[
'target'];
333 if (preg_match(
'/^(?P<sub>[\-\w\.@]*)\h*(?P<ttl>\d*)\h*IN\h+NS\h+(?P<target>[\w\.\-]+)/i', $zone, $ret)) {
334 if (empty($ret[
'sub']) || $ret[
'sub'] ==
'@') {
335 $val[
'status'] =
'warn';
336 $val[
'comment'] =
"Won't migrate it, there will get a new value";
338 $val[
'status'] =
'ok';
339 $val[
'comment'] =
"Create entry NS with " . $ret[
'sub'] .
" go to " . $ret[
'target'] .
" with ttl " . $ret[
'ttl'];
340 $val[
'entry_new'][
'type'] =
'FIXME-NS';
341 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
342 $val[
'entry_new'][
'value'] = $ret[
'target'];
349 if (preg_match(
'/^(?P<sub>[\-\w\.@]*)\h*(?P<ttl>\d*)\h*IN\h+CNAME\h+(?P<target>[@\w+\.\-]+)/i', $zone, $ret)) {
350 if (substr($ret[
'sub'], -1) ==
'.') {
351 $url =
"http://" . $ret[
'sub'];
353 if ($ret[
'sub'] ==
'@' || empty($ret[
'sub'])) {
354 $url =
"http://" . $domain;
356 $url =
"http://" . $ret[
'sub'] .
"." . $domain;
360 $val[
'status'] =
'warn';
361 $val[
'comment'] =
"Became a redirect to $dst_url";
362 $val[
'entry_new'][
'type'] =
'URL';
363 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
364 $val[
'entry_new'][
'value'] = $dst_url;
366 $val[
'status'] =
'ok';
367 $val[
'comment'] =
"Create entry CNAME with " . $ret[
'sub'] .
" go to " . $ret[
'target'] .
" with ttl " . $ret[
'ttl'];
368 $val[
'entry_new'][
'type'] =
'CNAME';
369 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
370 $val[
'entry_new'][
'value'] = $ret[
'target'];
377 if (preg_match(
'/^(?P<sub>[\-\w\.@]*)\h*(?P<ttl>\d*)\h*IN\h+MX\h+(?P<weight>\d+)\h+(?P<target>[@\w+\.\-]+)/i', $zone, $ret)) {
378 $val[
'status'] =
'warn';
379 $val[
'comment'] =
"Create entry MX with " . $ret[
'sub'] .
" go to " . $ret[
'target'] .
" with ttl " . $ret[
'ttl'] .
" and weight 5 (initial weight was " . $ret[
'weight'] .
")";
380 $val[
'entry_new'][
'type'] =
'MX';
381 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
382 $val[
'entry_new'][
'value'] = $ret[
'target'];
387 if (preg_match(
'/^(?P<sub>[\_\w\.@\-]+)\h+(?P<ttl>\d*)\h*IN\h+SRV\h+/i', $zone, $ret)) {
388 $val[
'status'] =
'err';
389 $val[
'comment'] =
"Please add yourself the entry $zone";
394 if (preg_match(
'/^(?P<sub>[\_\w\.@\-]*)\h*(?P<ttl>\d*)\h*IN\h+TXT\h+\"(?P<target>.+)\"/i', $zone, $ret)) {
395 $val[
'status'] =
'ok';
396 $val[
'comment'] =
"Create TXT entry with " . $ret[
'sub'] .
" go to " . $ret[
'target'];
397 $val[
'entry_new'][
'type'] =
'TXT';
398 $val[
'entry_new'][
'sub'] = $ret[
'sub'];
399 $val[
'entry_new'][
'value'] = $ret[
'target'];
403 $val[
'comment'] =
"Unknow: $zone";
415 $entry[
'did_it'] = 0;
416 if ($entry[
'status'] ==
'err') {
420 $val = $entry[
'entry_new'];
422 if (empty($val[
'type'])) {
426 switch ($val[
'type']) {
433 if (!array_key_exists(strtolower($val[
'type']), $this->
domains_type_lst())) {
434 echo
"what is this shit ?\n";
440 if ($val[
'sub'] ==
'@') {
445 $entry[
'did_it'] = $this->
set_sub_domain($val[
'domain'], $val[
'sub'], $val[
'type'], $val[
'value']);
461 if (!$this->
add_domain($domain,
true,
false,
true)) {
462 $msg->raise(
"ERROR",
'dom',
"Error adding domain");
470 foreach ($d[
'sub'] as $sd) {
489 $params = array(
'http' => array(
491 'ignore_errors' =>
true
494 $context = stream_context_create($params);
495 $fp = @fopen($url,
'rb',
false, $context);
496 $result = @stream_get_contents($fp);
498 if ($result ===
false) {
499 throw new Exception(
"Could not read data from {$url}");
501 if (strstr($http_response_header[0],
'301') || strstr($http_response_header[0],
'302')) {
503 if (preg_match(
'/Location:\h+(?P<target>[\-\w:\/.\?\=.]+)/', implode(
"\n", $http_response_header), $ret)) {
505 preg_match(
'/\/\/(?P<host>[\w\.\-]+)\//', ( substr($url, -1) ==
'/' ? $url : $url .
'/'), $original_cname);
506 preg_match(
'/\/\/(?P<host>[\w\.\-]+)\//', $ret[
'target'], $target_url);
507 if (isset($target_url[
'host']) && ( $target_url[
'host'] == $original_cname[
'host'] )) {
513 if (substr($ret[
'target'], 0, 4) !=
'http') {
514 return 'http://' . $original_cname[
'host'] .
'/' . $ret[
'target'];
516 return $ret[
'target'];
521 }
catch (Exception $e) {
528 global $db, $msg, $cuid;
529 $db->query(
"update sub_domaines set web_action='UPDATE' where lower(type) = lower(?) ;", array($name));
530 $db->query(
"update domaines d, sub_domaines sd set d.dns_action = 'UPDATE' where lower(sd.type)=lower(?);", array($name));
537 $db->query(
"select * from domaines_type where name= ?;", array($name));
545 $db->query(
"delete domaines_type where name= ? ;", array($name));
550 function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced, $create_tmpdir, $create_targetdir,$has_https_option=0) {
553 if (!preg_match(
"#^[a-z0-9]+$#", $name)) {
554 $msg->raise(
"ERROR",
"dom", _(
"The name MUST contain only letter and digits"));
557 $only_dns = intval($only_dns);
558 $need_dns = intval($need_dns);
559 $advanced = intval($advanced);
560 $has_https_option = intval($has_https_option);
561 $create_tmpdir = intval($create_tmpdir);
562 $create_targetdir = intval($create_targetdir);
563 $db->query(
"UPDATE domaines_type SET description= ?, target= ?, entry= ?, compatibility= ?, enable= ?, need_dns= ?, only_dns= ?, advanced= ?,create_tmpdir= ?,create_targetdir= ?, has_https_option=? where name= ?;", array($description, $target, $entry, $compatibility, $enable, $need_dns, $only_dns, $advanced, $create_tmpdir, $create_targetdir, $has_https_option, $name));
570 $msg->log(
"dom",
"sub_domain_change_status");
571 $sub_id = intval($sub_id);
572 $status = strtoupper($status);
573 if (!in_array($status, array(
'ENABLE',
'DISABLE'))) {
578 if ($status ==
'ENABLE') {
580 $msg->raise(
"ERROR",
"dom", _(
"The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility"));
585 $db->query(
"update sub_domaines set enable= ? where id = ? ;", array($status, intval($sub_id)));
601 global $db, $msg, $cuid;
602 $msg->debug(
"dom",
"enum_domains");
606 $db->query(
"SELECT * FROM domaines WHERE compte= ? ORDER BY domaine ASC;", array($uid));
607 $this->domains = array();
608 if ($db->num_rows() > 0) {
609 while ($db->next_record()) {
610 $this->domains[] = $db->f(
"domaine");
617 global $db, $msg, $classes, $cuid;
618 $msg->log(
"dom",
"del_domain_cancel", $dom);
619 $dom = strtolower($dom);
620 $db->query(
"UPDATE sub_domaines SET web_action='UPDATE' WHERE domaine= ?;", array($dom));
622 # TODO : some work with domain sensitive classes
639 global $db, $msg, $hooks;
640 $msg->log(
"dom",
"del_domain", $domain);
641 $domain = strtolower($domain);
651 $hooks->invoke(
"alternc_del_domain", array($domain));
652 $hooks->invoke(
"alternc_del_mx_domain", array($domain));
654 $hooks->invoke(
"hook_dom_del_domain", array($r[
"id"]));
655 $hooks->invoke(
"hook_dom_del_mx_domain", array($r[
"id"]));
658 $db->query(
"UPDATE sub_domaines SET web_action='DELETE' WHERE domaine= ?;", array($domain));
666 return str_replace(
"-",
"", str_replace(
".",
"", empty($sub) ?
"" :
"$sub.") . $domain);
689 function add_domain($domain,
$dns, $noerase =
false, $force =
false, $isslave =
false, $slavedom =
"") {
690 global $db, $msg, $quota, $L_FQDN, $tld, $cuid, $hooks, $domislocked;
691 $msg->log(
"dom",
"add_domain", $domain);
695 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
699 $domain = strtolower($domain);
700 $t = checkfqdn($domain);
702 $msg->raise(
"ERROR",
"dom", _(
"The domain name is syntaxically incorrect"));
706 $db->query(
"SELECT domain FROM forbidden_domains WHERE domain= ? ;", array($domain));
707 if ($db->num_rows() && !$force) {
708 $msg->raise(
"ERROR",
"dom", _(
"The requested domain is forbidden in this server, please contact the administrator"));
711 if ($domain == $L_FQDN || $domain ==
"www.$L_FQDN") {
712 $msg->raise(
"ERROR",
"dom", _(
"This domain is the server's domain! You cannot host it on your account!"));
715 $db->query(
"SELECT compte FROM domaines WHERE domaine= ?;", array($domain));
716 if ($db->num_rows()) {
717 $msg->raise(
"ERROR",
"dom", _(
"The domain already exist"));
720 $db->query(
"SELECT compte FROM `sub_domaines` WHERE sub != \"\" AND concat( sub, \".\", domaine )= ? OR domaine= ?;", array($domain, $domain));
721 if ($db->num_rows()) {
722 $msg->raise(
"ERROR",
"dom", _(
"The domain already exist"));
725 $this->dns = $this->
whois($domain);
727 $v = checkhostallow($domain, $this->dns);
729 $msg->raise(
"ERROR",
"dom", _(
"The last member of the domain name is incorrect or cannot be hosted in that server"));
732 if (
$dns && $v == -2) {
733 $msg->raise(
"ALERT",
"dom", _(
"The domain cannot be found in the whois database"));
736 if (
$dns && $v == -3) {
737 $msg->raise(
"ALERT",
"dom", _(
"The domain cannot be found in the whois database"));
752 $v = checkhostallow_nodns($domain);
754 $msg->raise(
"ERROR",
"dom", _(
"The requested domain is forbidden in this server, please contact the administrator"));
760 if (!$quota->cancreate(
"dom")) {
761 $msg->raise(
"ALERT",
"dom", _(
"Your domain quota is over, you cannot create more domain names"));
774 $db->query(
"INSERT INTO domaines (compte,domaine,gesdns,gesmx,noerase,dns_action) VALUES (?, ?, ?, ?, ?, 'UPDATE');", array($cuid,$domain,
$dns,$gesmx,$noerase));
775 if (!($id = $db->lastid())) {
776 $msg->raise(
"ERROR",
"dom", _(
"An unexpected error occured when creating the domain"));
782 $db->query(
"SELECT domaine FROM domaines WHERE compte= ? AND domaine= ?;", array($cuid, $slavedom));
784 if (!$db->Record[
"domaine"]) {
785 $msg->raise(
"ERROR",
"dom", _(
"Domain '%s' not found"), $slavedom);
796 $hooks->invoke(
"alternc_add_domain", array($domain));
798 $hooks->invoke(
"alternc_add_slave_domain", array($domain));
801 $hooks->invoke(
"hook_dom_add_domain", array($id));
803 $hooks->invoke(
"hook_dom_add_mx_domain", array($id));
806 $hooks->invoke(
"hook_dom_add_slave_domain", array($id, $slavedom));
817 $msg->log(
"dom",
"create_default_subdomains", $domain);
818 $query =
"SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE (concerned = 'SLAVE' or concerned = 'BOTH') and enabled=1;";
819 if (empty($target_domain)) {
820 $query =
"SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE (concerned = 'MAIN' or concerned = 'BOTH') and enabled=1;";
825 while ($db->next_record()) {
826 $jj[] = Array(
"domain_type_parameter" => $db->f(
'domain_type_parameter'),
"sub" => $db->f(
'sub'),
"domain_type" => $db->f(
'domain_type'));
828 $src_var = array(
"%%SUB%%",
"%%DOMAIN%%",
"%%DOMAINDIR%%",
"%%TARGETDOM%%");
829 foreach ($jj as $j) {
830 $trg_var = array($j[
'sub'], $domain, $domaindir, $target_domain);
831 $domain_type_parameter = str_ireplace($src_var, $trg_var, $j[
'domain_type_parameter']);
832 $this->
set_sub_domain($domain, $j[
'sub'], strtolower($j[
'domain_type']), $domain_type_parameter);
841 return "/www/" . $this->
domshort($domain);
847 exec(
'/usr/bin/dig AXFR "' . escapeshellcmd($domain) .
'" @"' . escapeshellcmd($ns) .
'"', $axfr);
854 $msg->debug(
"dom",
"lst_default_subdomains");
856 $db->query(
"select * from default_subdomains;");
858 while ($db->next_record()) {
859 $c[] = array(
'id' => $db->f(
'id'),
860 'sub' => $db->f(
'sub'),
861 'domain_type' => $db->f(
'domain_type'),
862 'domain_type_parameter' => $db->f(
'domain_type_parameter'),
863 'concerned' => $db->f(
'concerned'),
864 'enabled' => $db->f(
'enabled')
874 $msg->log(
"dom",
"update_default_subdomains");
876 foreach ($arr as $a) {
877 if (!isset($a[
'id'])) {
880 if (!empty($a[
'sub']) || !empty($a[
'domain_type_parameter'])) {
882 if (!isset($a[
'enabled'])) {
885 if (!$this->
update_one_default($a[
'domain_type'], $a[
'sub'], $a[
'domain_type_parameter'], $a[
'concerned'], $a[
'enabled'], $a[
'id'])) {
894 function update_one_default($domain_type, $sub, $domain_type_parameter, $concerned, $enabled, $id =
null) {
896 $msg->log(
"dom",
"update_one_default");
899 $db->query(
"INSERT INTO default_subdomains values ('', ?, ?, ?, ?, ?);", array($sub, $domain_type, $domain_type_parameter, $concerned, $enabled));
901 $db->query(
"UPDATE default_subdomains set sub= ?, domain_type= ?, domain_type_parameter= ?, concerned= ?, enabled= ? where id= ?;", array($sub, $domain_type, $domain_type_parameter, $concerned, $enabled, $id));
910 $msg->log(
"dom",
"del_default_type");
912 if (!$db->query(
"delete from default_subdomains where id= ?;", array($id))) {
913 $msg->raise(
"ERROR",
"dom", _(
"Could not delete default type"));
931 $msg->debug(
"dom",
"whois", $domain);
933 $domain=trim($domain,
".");
934 $parent=$domain; $loopmax=32;
936 $parent=substr($parent,strpos($parent,
".")+1);
937 $parent=trim($parent,
".");
939 $msg->raise(
"ALERT",
"dom", _(
"The domain has no parent. Check syntax"));
944 exec(
"dig +short NS ".escapeshellarg($parent),$out);
946 }
while (!count($out) && $loopmax);
950 $parentns=trim($out[0]);
954 exec(
"dig NS ".escapeshellarg($domain).
" ".escapeshellarg(
"@".$parentns),$out);
957 foreach($out as $line) {
958 if (preg_match(
'#^'.str_replace(
".",
"\\.",$domain).
'\..*IN\s*NS\s*(.*)$#',$line,$mat)) {
974 function checkmx($domaine, $ref_domain =
'') {
975 global $L_DEFAULT_MX, $L_DEFAULT_SECONDARY_MX;
979 if (!empty($ref_domain)) {
980 getmxrr($ref_domain, $ref_mx);
982 $ref_mx = array($L_DEFAULT_MX, $L_DEFAULT_SECONDARY_MX);
985 if (empty($ref_mx)) {
991 if (!getmxrr($domaine, $mxhosts)) {
996 if (empty($mxhosts)) {
1001 $intersect = array_intersect($mxhosts, $ref_mx);
1003 if (empty($intersect)) {
1033 global $db, $msg, $cuid, $domislocked;
1034 $msg->debug(
"dom",
"get_domain_all", $dom);
1036 if (!$domislocked) {
1037 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1040 $t = checkfqdn($dom);
1042 $msg->raise(
"ERROR",
"dom", _(
"The domain name is syntaxically incorrect"));
1047 $db->query(
"SELECT * FROM domaines WHERE compte= ? AND domaine= ?;", array($cuid, $dom));
1048 if ($db->num_rows() == 0) {
1049 $msg->raise(
"ERROR",
"dom", sprintf(_(
"Domain '%s' not found"), $dom));
1053 $r[
"id"] = $db->Record[
"id"];
1054 $r[
"dns"] = $db->Record[
"gesdns"];
1055 $r[
"dns_action"] = $db->Record[
"dns_action"];
1056 $r[
"dns_result"] = $db->Record[
"dns_result"];
1057 $r[
"mail"] = $db->Record[
"gesmx"];
1058 $r[
"zonettl"] = $db->Record[
"zonettl"];
1059 $r[
'noerase'] = $db->Record[
'noerase'];
1061 $db->query(
"SELECT COUNT(*) AS cnt FROM sub_domaines WHERE compte= ? AND domaine= ?;", array($cuid, $dom));
1063 $r[
"nsub"] = $db->Record[
"cnt"];
1065 $db->query(
"SELECT sd.*, dt.description AS type_desc, dt.only_dns, dt.advanced, dt.has_https_option FROM sub_domaines sd LEFT JOIN domaines_type dt on UPPER(dt.name)=UPPER(sd.type) WHERE compte= ? AND domaine= ? ORDER BY dt.advanced,sd.sub,sd.type ;", array($cuid, $dom));
1067 $r[
"sub"] = array();
1069 while ($record=$db->fetch()) {
1070 $r[
"sub"][$i] = $record;
1072 $r[
"sub"][$i][
"name"] = $record[
"sub"];
1073 $r[
"sub"][$i][
"dest"] = $record[
"valeur"];
1074 $r[
"sub"][$i][
"fqdn"] = ((!empty($r[
"sub"][$i][
"name"])) ? $r[
"sub"][$i][
"name"] .
"." :
"") . $r[
"name"];
1095 global $db, $msg, $cuid, $domislocked;
1096 $msg->debug(
"dom",
"get_sub_domain_all", $sub_domain_id);
1098 if (!$domislocked) {
1099 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1102 $db->query(
"select sd.*, dt.description as type_desc, dt.only_dns, dt.advanced from sub_domaines sd, domaines_type dt where compte= ? and sd.id= ? and upper(dt.name)=upper(sd.type) ORDER BY dt.advanced, sd.sub;", array($cuid, $sub_domain_id));
1103 if ($db->num_rows() == 0) {
1104 $msg->raise(
"ERROR",
"dom", _(
"The sub-domain does not exist"));
1109 $r[
"id"] = $db->Record[
"id"];
1110 $r[
"name"] = $db->Record[
"sub"];
1111 $r[
"domain"] = $db->Record[
"domaine"];
1112 $r[
"dest"] = $db->Record[
"valeur"];
1113 $r[
"enable"] = $db->Record[
"enable"];
1114 $r[
"type"] = $db->Record[
"type"];
1115 $r[
"type_desc"] = $db->Record[
"type_desc"];
1116 $r[
"only_dns"] = $db->Record[
"only_dns"];
1117 $r[
"web_action"] = $db->Record[
"web_action"];
1118 $r[
"https"] = $db->Record[
"https"];
1126 $db->query(
"select has_https_option from domaines_type where name= ? ;", array($type));
1127 if (!$db->next_record()) {
1130 if ($db->Record[
"has_https_option"]) {
1131 $https=strtolower($https);
1132 if ($https!=
"http" && $https!=
"https" && $https!=
"both") {
1150 if (empty($value) or is_null($value)) {
1155 if ($value == strval($value)) {
1156 if (filter_var($value, FILTER_VALIDATE_URL)) {
1159 $msg->raise(
"ERROR",
"dom", _(
"invalid url"));
1165 if (substr($value, 0, 1) !=
"/") {
1166 $value =
"/" . $value;
1168 if (!checkuserpath($value)) {
1169 $msg->raise(
"ERROR",
"dom", _(
"The folder you entered is incorrect or does not exist"));
1174 if (checkip($value)) {
1177 $msg->raise(
"ERROR",
"dom", _(
"The ip address is invalid"));
1182 if (checkipv6($value)) {
1185 $msg->raise(
"ERROR",
"dom", _(
"The ip address is invalid"));
1190 if (checkcname($value)) {
1193 $msg->raise(
"ERROR",
"dom", _(
"The name you entered is incorrect or not fully qualified (it must end with a DOT, like example.com<b>.</b>)"));
1198 if ($value == strval($value)) {
1201 $msg->raise(
"ERROR",
"dom", _(
"The TXT value you entered is incorrect"));
1206 $msg->raise(
"ERROR",
"dom", _(
"Invalid domain type selected, please check"));
1224 $sub_domain_id=intval($sub_domain_id);
1225 $msg->log(
"dom",
"can_create_subdomain", $dom .
"/" . $sub .
"/" .$type .
"/" . $sub_domain_id);
1228 $db->query(
"select upper(compatibility) as compatibility from domaines_type where upper(name)=upper(?);", array($type));
1229 if (!$db->next_record()) {
1232 $compatibility_lst = explode(
",", $db->f(
'compatibility'));
1235 $db->query(
"select * from sub_domaines where sub= ? and domaine= ? and not id = ? and web_action != 'DELETE' and enable not in ('DISABLED', 'DISABLE') ", array($sub, $dom, $sub_domain_id));
1236 #$db->query("select * from sub_domaines where sub='$sub' and domaine='$dom';");
1237 while ($db->next_record()) {
1239 if (!in_array(strtoupper($db->f(
'type')), $compatibility_lst)) {
1245 if ($type ==
'cname' && $sub ==
'')
1260 global $db, $msg, $cuid, $ssl, $domislocked;
1261 $msg->log(
"dom",
"set_sub_domain_ssl_provider", $sub_domain_id.
" / ".$provider);
1263 if (!$domislocked) {
1264 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1267 $db->query(
"SELECT * FROM sub_domaines WHERE id=?",array($sub_domain_id));
1268 if (!$db->next_record() || $db->Record[
"compte"]!=$cuid) {
1269 $msg->raise(
"ERROR",
"dom", _(
"Subdomain not found"));
1272 $fqdn=$db->Record[
"sub"].(($db->Record[
"sub"])?
".":
"").$db->Record[
"domaine"];
1273 $certs = $ssl->get_valid_certs($fqdn);
1274 $provider=strtolower(trim($provider));
1277 foreach($certs as $cert) {
1278 if ($cert[
"provider"]==$provider) {
1283 $msg->raise(
"ERROR",
"dom", _(
"No certificate found for this provider and this subdomain"));
1287 $db->query(
"UPDATE sub_domaines SET web_action=?, provider=? WHERE id=?",array(
"UPDATE",$provider,$sub_domain_id));
1309 global $db, $msg, $cuid, $bro, $domislocked;
1310 $msg->log(
"dom",
"set_sub_domain", $dom .
"/" . $sub .
"/" . $type .
"/" . $dest);
1312 if (!$domislocked) {
1313 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1316 $dest = trim($dest);
1317 $sub = trim(trim($sub),
".");
1318 $dom = strtolower($dom);
1319 $sub = strtolower($sub);
1321 $fqdn = checkfqdn($sub);
1323 if (($sub !=
'*' && $sub !=
'') && !($fqdn == 0 || $fqdn == 4)) {
1324 $msg->raise(
"ALERT",
"dom", _(
"There is some forbidden characters in the sub domain (only A-Z 0-9 and - are allowed)"));
1335 if (($t = checkfqdn($dom))) {
1336 $msg->raise(
"ERROR",
"dom", _(
"The domain name is syntaxically incorrect"));
1341 $msg->raise(
"ERROR",
"dom", _(
"The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility"));
1345 if ($sub_domain_id!=0) {
1350 if (!$db->query(
"INSERT INTO sub_domaines (compte,domaine,sub,valeur,type,web_action,https) VALUES (?, ?, ?, ?, ?, 'UPDATE',?);", array( $cuid , $dom , $sub , $dest , $type, $https ))) {
1351 $msg->raise(
"ERROR",
"dom", _(
"The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility"));
1356 $dest_root = $bro->get_userid_root($cuid);
1358 $db->query(
"select create_tmpdir, create_targetdir from domaines_type where name = ?;", array($type));
1360 if ($db->f(
'create_tmpdir')) {
1361 if (!is_dir($dest_root .
"/tmp")) {
1362 if (!@mkdir($dest_root .
"/tmp", 0777,
true)) {
1363 $msg->raise(
"ERROR",
"dom", _(
"Cannot write to the destination folder"));
1367 if ($db->f(
'create_targetdir')) {
1368 $dirr = $dest_root . $dest;
1369 $dirr = str_replace(
'//',
'/', $dirr);
1371 if (!is_dir($dirr)) {
1373 if (!@mkdir($dirr, 0770,
true)) {
1374 $msg->raise(
"ERROR",
"dom", _(
"Cannot write to the destination folder"));
1381 $db->query(
"update domaines set dns_action='UPDATE' where domaine= ?;", array($dom));
1394 global $db, $msg, $domislocked;
1395 $msg->log(
"dom",
"del_sub_domain", $sub_domain_id);
1397 if (!$domislocked) {
1398 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1402 $msg->raise(
"ERROR",
"dom", _(
"The sub-domain does not exist"));
1405 $db->query(
"update sub_domaines set web_action='DELETE' where id= ?; ", array($sub_domain_id));
1406 $db->query(
"update domaines set dns_action='UPDATE' where domaine= ?;", array($r[
'domain']));
1417 $msg->log(
"dom",
"set_ttl",
"$dom_id / $ttl");
1422 $j = $this->
edit_domain($domaine, $d[
'dns'], $d[
'mail'],
false, $ttl);
1441 global $db, $msg, $hooks, $domislocked;
1442 $msg->log(
"dom",
"edit_domain", $dom .
"/" .
$dns .
"/" . $gesmx);
1444 if (!$domislocked && !$force) {
1445 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1448 if (
$dns ==
true && !$force) {
1449 $this->dns = $this->
whois($dom);
1450 $v = checkhostallow($dom, $this->dns);
1452 $msg->raise(
"ERROR",
"dom", _(
"The last member of the domain name is incorrect or cannot be hosted in that server"));
1455 if (
$dns && $v == -2) {
1456 $msg->raise(
"ALERT",
"dom", _(
"The domain cannot be found in the Whois database"));
1459 if (
$dns && $v == -3) {
1460 $msg->raise(
"ALERT",
"dom", _(
"The DNS of this domain do not match the server's DNS. Please change your domain's DNS before you install it again"));
1470 $t = checkfqdn($dom);
1472 $msg->raise(
"ERROR",
"dom", _(
"The domain name is syntaxically incorrect"));
1477 $msg->raise(
"ERROR",
"dom", _(
"The domain name %s does not exist"), $dom);
1484 if ($r[
"dns"] ==
$dns && $r[
"mail"] == $gesmx && $r[
"zonettl"] == $ttl) {
1485 $msg->raise(
"INFO",
"dom", _(
"No change has been requested..."));
1490 if (
$dns ==
"0" && $gesmx ==
"1" && !$force) {
1493 $msg->raise(
"ALERT",
"dom", _(
"There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received"));
1498 $msg->raise(
"ALERT",
"dom", _(
"There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received"));
1502 if ($gesmx && !$r[
"mail"]) {
1503 $hooks->invoke(
"hook_dom_add_mx_domain", array($r[
"id"]));
1506 if (!$gesmx && $r[
"mail"]) {
1507 $hooks->invoke(
"hook_dom_del_mx_domain", array($r[
"id"]));
1510 $db->query(
"UPDATE domaines SET gesdns= ?, gesmx= ?, zonettl= ? WHERE domaine= ?", array(
$dns, $gesmx, $ttl, $dom));
1525 $db->query(
"SELECT * FROM slaveip;");
1526 if (!$db->next_record()) {
1531 $res[] = $db->Record;
1532 }
while ($db->next_record());
1542 if (!checkip($ip)) {
1543 $msg->raise(
"ERROR",
"dom", _(
"The IP address you entered is incorrect"));
1546 $class = intval($class);
1547 if ($class < 8 || $class > 32) {
1550 $db->query(
"SELECT * FROM slaveip WHERE ip= ? AND class= ?;", array($ip, $class));
1551 if ($db->next_record()) {
1552 $msg->raise(
"ERROR",
"err", _(
"The requested domain is forbidden in this server, please contact the administrator"));
1555 $db->query(
"INSERT INTO slaveip (ip,class) VALUES (?, ?);", array($ip, $class));
1568 if (!checkip($ip)) {
1569 $msg->raise(
"ERROR",
"dom", _(
"The IP address you entered is incorrect"));
1572 $db->query(
"DELETE FROM slaveip WHERE ip= ?;", array($ip));
1585 $db->query(
"SELECT * FROM slaveaccount WHERE login= ? AND pass= ?;", array($login, $pass));
1586 if ($db->next_record()) {
1597 $db->query(
"SELECT domaine FROM domaines WHERE gesdns=1 ORDER BY domaine");
1599 while ($db->next_record()) {
1600 #echo $db->f("domaine")."\n";
1601 $tt.=$db->f(
"domaine") .
"\n";
1605 echo md5($tt) .
"\n";
1616 $uid = intval($uid);
1620 $query =
"SELECT domaine FROM domaines WHERE gesdns=1 ";
1621 $query_args = array();
1623 $query .=
" AND compte= ? ";
1624 array_push($query_args, $uid);
1626 $query .=
" ORDER BY domaine;";
1627 $db->query($query, $query_args);
1628 while ($db->next_record()) {
1629 $res[] = $db->f(
"domaine");
1641 $db->query(
"SELECT domaine, gesdns, gesmx, dns_action, zonettl FROM domaines ORDER BY domaine");
1642 while ($db->next_record()) {
1643 $res[$db->f(
"domaine")] = array(
1644 "gesdns" => $db->f(
"gesdns"),
1645 "gesmx" => $db->f(
"gesmx"),
1646 "dns_action" => $db->f(
"dns_action"),
1647 "zonettl" => $db->f(
"zonettl"),
1659 global $db, $msg, $cuid;
1660 $dom_id = intval($dom_id);
1661 $db->query(
"SELECT domaine FROM domaines WHERE id= ? AND compte= ?;", array($dom_id, $cuid));
1662 if ($db->next_record()) {
1663 $domain = $db->f(
"domaine");
1665 $msg->raise(
"ERROR",
"dom", _(
"This domain is not installed in your account"));
1671 $msg->raise(
"ERROR",
"dom", _(
"This domain is not installed in your account"));
1682 global $db, $msg, $cuid;
1683 $domain = trim($domain);
1684 $db->query(
"SELECT id FROM domaines WHERE domaine= ? AND compte= ?;", array($domain, $cuid));
1685 if ($db->next_record()) {
1688 $msg->raise(
"ERROR",
"dom", _(
"This domain is not installed in your account"));
1694 $msg->raise(
"ERROR",
"dom", _(
"This domain is not installed in your account"));
1705 $db->query(
"SELECT COUNT(*) AS count FROM domaines;");
1706 if ($db->next_record()) {
1707 return $db->f(
'count');
1719 $db->query(
"SELECT * FROM slaveaccount;");
1721 while ($db->next_record()) {
1722 $res[] = $db->Record;
1736 $db->query(
"SELECT * FROM slaveaccount WHERE login= ?", array($login));
1737 if ($db->next_record()) {
1738 $msg->raise(
"ERROR",
"dom", _(
"The specified slave account already exists"));
1741 $db->query(
"INSERT INTO slaveaccount (login,pass) VALUES (?, ?)", array($login, $pass));
1751 $db->query(
"DELETE FROM slaveaccount WHERE login= ?", array($login));
1763 global $msg,$domislocked;
1764 $msg->debug(
"dom",
"lock");
1766 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- Lock already obtained!"));
1774 $domislocked =
true;
1776 register_shutdown_function(array(
"m_dom",
"unlock"),1);
1787 global $msg,$domislocked;
1788 $msg->debug(
"dom",
"unlock");
1789 if (!$isshutdown && !$domislocked) {
1790 $msg->raise(
"ERROR",
"dom", _(
"--- Program error --- No lock on the domains!"));
1794 $domislocked =
false;
1806 $msg->log(
"dom",
"hook_dom_add_mx_domain");
1808 if (!empty($GLOBALS[
'L_DEFAULT_SECONDARY_MX'])) {
1820 $msg->log(
"dom",
"alternc_del_member");
1822 foreach ($li as $dom) {
1836 global $db, $msg, $cuid;
1837 $msg->debug(
"dom",
"get_quota");
1838 $q = Array(
"name" =>
"dom",
"description" => _(
"Domain name"),
"used" => 0);
1839 $db->query(
"SELECT COUNT(*) AS cnt FROM domaines WHERE compte= ?", array($cuid));
1840 if ($db->next_record()) {
1841 $q[
'used'] = $db->f(
"cnt");
1853 $msg->log(
"dom",
"export");
1856 foreach ($this->domains as $d) {
1857 $str.=
" <domaines>\n";
1858 $str.=
" <nom>" . $d .
"</nom>\n";
1862 if (empty($s[
"dns"])) {
1867 $str.=
" <dns>" . $s[
"dns"] .
"</dns>\n";
1869 if (empty($s[
"mx"])) {
1875 $str.=
" <mx>" . $s[
"mx"] .
"</mx>\n";
1877 if (empty($s[
"mail"])) {
1880 $str.=
" <mail>" . $s[
"mail"] .
"</mail>\n";
1881 if (is_array($s[
"sub"])) {
1882 foreach ($s[
"sub"] as $sub) {
1883 $str.=
" <subdomain>\n";
1884 $str.=
" <enabled>" . $sub[
"enable"] .
" </enabled>\n";
1885 $str.=
" <destination>" . $sub[
"dest"] .
" </destination>\n";
1886 $str.=
" <type>" . $sub[
"type"] .
" </type>\n";
1887 $str.=
" </subdomain>\n";
1890 $str.=
" </domaines>\n";
1904 if (posix_getuid()!=0) {
1905 echo
"FATAL: please lauch me as root\n";
1912 $db->query(
"UPDATE sub_domaines sd, domaines d SET sd.web_action = 'DELETE' WHERE sd.domaine = d.domaine AND sd.compte=d.compte AND d.dns_action = 'DELETE';");
1915 $db->query(
"SELECT * FROM domaines WHERE dns_action!='OK';");
1917 while ($db->next_record()) {
1918 $alldoms[$db->Record[
"id"]]=$db->Record;
1921 if (count($alldoms)) {
1922 $hooks->invoke(
"hook_updatedomains_dns_pre");
1923 foreach($alldoms as $id=>$onedom) {
1924 if ($onedom[
"gesdns"]==0 || $onedom[
"dns_action"]==
"DELETE") {
1925 $ret = $hooks->invoke(
"hook_updatedomains_dns_del",array($onedom));
1927 $ret = $hooks->invoke(
"hook_updatedomains_dns_add",array($onedom));
1930 if ($onedom[
"dns_action"]==
"DELETE") {
1931 $db->query(
"DELETE FROM domaines WHERE domaine=?;",array($onedom[
'domaine']));
1934 rsort($ret,SORT_NUMERIC); $returncode=$ret[0];
1935 $db->query(
"UPDATE domaines SET dns_result=?, dns_action='OK' WHERE domaine=?;",array($returncode,$onedom[
"domaine"]));
1938 $hooks->invoke(
"hook_updatedomains_dns_post");
1943 $db->query(
"SELECT sd.*, dt.only_dns FROM domaines_type dt, sub_domaines sd WHERE dt.name=sd.type AND sd.web_action!='OK';");
1947 while ($db->next_record()) {
1949 if ($db->Record[
"only_dns"]) {
1950 if ($db->Record[
"web_action"]==
"DELETE") {
1951 $delete[]=$db->Record[
"id"];
1953 $ignore[]=$db->Record[
"id"];
1956 $alldoms[$db->Record[
"id"]]=$db->Record;
1959 foreach($delete as $id) {
1960 $db->query(
"DELETE FROM sub_domaines WHERE id=?;",array($id));
1962 foreach($ignore as $id) {
1964 $db->query(
"UPDATE sub_domaines SET web_action='OK' WHERE id=?;",array($id));
1967 if (count($alldoms)) {
1968 $hooks->invoke(
"hook_updatedomains_web_pre");
1969 foreach($alldoms as $id=>$subdom) {
1971 if ($subdom[
"web_action"]==
"DELETE" || strtoupper(substr($subdom[
"enable"],0,7))==
"DISABLE") {
1972 $ret = $hooks->invoke(
"hook_updatedomains_web_del",array($subdom[
"id"]));
1974 $hooks->invoke(
"hook_updatedomains_web_before",array($subdom[
"id"]));
1975 $ret = $hooks->invoke(
"hook_updatedomains_web_add",array($subdom[
"id"]));
1976 $hooks->invoke(
"hook_updatedomains_web_after",array($subdom[
"id"]));
1979 if ($subdom[
"web_action"]==
"DELETE") {
1980 $db->query(
"DELETE FROM sub_domaines WHERE id=?;",array($id));
1983 rsort($ret,SORT_NUMERIC); $returncode=$ret[0];
1984 $db->query(
"UPDATE sub_domaines SET web_result=?, web_action='OK' WHERE id=?;",array($returncode,$id));
1987 $hooks->invoke(
"hook_updatedomains_web_post");
1999 $db->query(
"UPDATE domaines SET dns_action= ? WHERE domaine= ?; ", array($dns_action, $domain));
2017 foreach ($da[
'sub'] as $sub) {
2018 if ($sub[
'web_action'] !=
'OK') {
2021 if (!$sub[
'only_dns']) {
2022 if (!isset($tmp[$sub[
'fqdn']])) {
2023 $tmp[$sub[
'fqdn']] = 0;
2025 $tmp[$sub[
'fqdn']] ++;
2026 if ($tmp[$sub[
'fqdn']] >= 2) {
2027 $errors[$sub[
'fqdn']] = sprintf(_(
"Problem on %s: there is more than 1 web configuration going to be generated for this sub-domain."), $sub[
'fqdn']);
2034 foreach ($da[
'sub'] as $sub) {
2035 if (is_null($sub[
'type_desc'])) {
2036 $errors[$sub[
'fqdn']] = sprintf(_(
"Problem on %s: we do not know domain's type <b>%s</b>."), $sub[
'fqdn'], $sub[
'type']);
2048 _(
"Locally hosted");
2049 _(
"URL redirection");
2051 _(
"Webmail access");
2052 _(
"Squirrelmail Webmail access");
2053 _(
"Roundcube Webmail access");
2055 _(
"CNAME DNS entry");
2058 _(
"secondary MX DNS entry");
2059 _(
"Default mail server");
2060 _(
"Default backup mail server");
2061 _(
"AlternC panel access");
2063 _(
"Email autoconfiguration");
Classe de gestion des domaines de l'hébergé.
get_domain_byid($dom_id)
Returns the name of a domain for the current user, from it's domain_id.
update_domains()
complex process to manage domain and subdomain updates Launched every minute by a cron as root should...
unlock($isshutdown=0)
Unlock the cron for domain management return true @access private.
$webmail
Flag : a-t-on trouvé un sous-domaine Webmail pour ce domaine ? @access private.
whois($domain)
Return the NS of a server by interrogating its parent zone.
domains_type_lst()
Retourne un tableau contenant les types de domaines.
sub_domain_change_status($sub_id, $status)
const fic_lock_cron
Systéme de verrouillage du cron Ce fichier permet de verrouiller le cron en attendant la validation d...
count_domains_all()
Count all domains, for all users.
import_manual_dns_prep_zone($domain)
import_manual_dns_entry($zone, $domain, $detect_redirect=true, $save=false)
add_slave_account($login, $pass)
Add a slave account that will be allowed to access the domain list.
domshort($domain, $sub="")
admin_del_member()
Delete an account (all his domains)
dump_axfr($domain, $ns='localhost')
add_domain($domain, $dns, $noerase=false, $force=false, $isslave=false, $slavedom="")
Installe un domaine sur le compte courant.
check_type_value($type, $value)
get_problems($domain)
List if there are problems on the domain.
set_dns_action($domain, $dns_action)
get_domain_byname($domain)
Returns the id of a domain for the current user, from it's domain name.
edit_domain($dom, $dns, $gesmx, $force=false, $ttl=3600)
Modifie les information du domaine précisé.
can_create_subdomain($dom, $sub, $type, $sub_domain_id=0)
Check the compatibility of the POSTed parameters with the chosen domain type.
static get_sub_domain_id_and_member_by_name($fqdn)
get_domain_all($dom)
retourne TOUTES les infos d'un domaine
import_manual_dns_entry_doit($entry)
domains_type_enable_values()
add_slave_ip($ip, $class="32")
Add an ip address (or a ip class) to the list of allowed slave ip access list.
domains_type_regenerate($name)
alternc_export_conf()
Returns the global domain(s) configuration(s) of a particular user No parameters needed.
domains_type_target_values($type=null)
lock()
Try to lock a domain @access private.
get_sub_domain_all($sub_domain_id)
Retourne TOUTES les infos d'un sous domaine du compte courant.
get_domain_list($uid=-1)
Returns the complete hosted domain list :
del_domain($domain)
Efface un domaine du membre courant, et tous ses sous-domaines.
clean_https_value($type, $https)
hook_quota_get()
Returns the used quota for the $name service for the current user.
checkmx($domaine, $ref_domain='')
vérifie la presence d'un champs mx valide sur un serveur DNS $domaine est le domaine dont on veux vér...
set_subdomain_ssl_provider($sub_domain_id, $provider)
set the HTTPS preference for a subdomain.
hook_dom_add_mx_domain($dom_id)
Declare that a domain's emails are hosted in this server : This adds 2 MX entries in this domain (if ...
enum_slave_ip()
Return the list of ip addresses and classes that are allowed access to domain list through AXFR Trans...
update_default_subdomains($arr)
$dns
$dns : Liste des dns trouvés par la fonction whois @access private
domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced, $create_tmpdir, $create_targetdir, $has_https_option=0)
create_default_subdomains($domain, $target_domain="")
del_sub_domain($sub_domain_id)
Supprime le sous-domaine demandé
enum_slave_account()
Return the list of allowed slave accounts.
update_one_default($domain_type, $sub, $domain_type_parameter, $concerned, $enabled, $id=null)
hook_menu()
hook function called by the menu class to add menu to the left panel
enum_domains($uid=-1)
Retourne un tableau contenant les domaines d'un membre.
import_manual_dns_zone($zone, $domain, $detect_redirect=true, $save=false)
del_slave_ip($ip)
Remove an ip address (or a ip class) from the list of allowed slave ip access list.
$domains
$domains : Cache des domaines du membre @access private
check_slave_account($login, $pass)
Check for a slave account.
set_sub_domain($dom, $sub, $type, $dest, $sub_domain_id=0, $https="")
Modifier les information du sous-domaine demandé.
echo_domain_list($integrity=false)
Out (echo) the complete hosted domain list :
del_slave_account($login)
Remove a slave account.