diff --git a/.gitattributes b/.gitattributes
index 942a245d..a66f9580 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -22,6 +22,9 @@ bureau/admin/adm_dodel.php -text
bureau/admin/adm_doedit.php -text
bureau/admin/adm_domlock.php -text
bureau/admin/adm_doms.php -text
+bureau/admin/adm_domstype.php -text
+bureau/admin/adm_domstypedoedit.php -text
+bureau/admin/adm_domstypeedit.php -text
bureau/admin/adm_donosu.php -text
bureau/admin/adm_dorenew.php -text
bureau/admin/adm_dosu.php -text
diff --git a/bureau/admin/adm_domstype.php b/bureau/admin/adm_domstype.php
new file mode 100644
index 00000000..441f68d3
--- /dev/null
+++ b/bureau/admin/adm_domstype.php
@@ -0,0 +1,85 @@
+enabled) {
+ __("This page is restricted to authorized staff");
+ exit();
+}
+
+include_once("head.php");
+
+?>
+
+
+
+$error";
+ }
+
+$dom = new m_dom();
+$r=$dom->domains_type_lst;
+// die(print_r($dom->domains_type_lst()));
+
+?>
+
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+domains_type_lst() as $d) {
+++$pair;
+?>
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
+
diff --git a/bureau/admin/adm_domstypedoedit.php b/bureau/admin/adm_domstypedoedit.php
new file mode 100644
index 00000000..91c78a66
--- /dev/null
+++ b/bureau/admin/adm_domstypedoedit.php
@@ -0,0 +1,17 @@
+enabled) {
+ __("This page is restricted to authorized staff");
+ exit();
+}
+
+
+if ( ! $dom->domains_type_update($id, $name, $description, $ask_dest, $entry, $compatibility) ) {
+ die($err->errstr());
+} else {
+include("adm_domstype.php");
+}
+
+?>
+
+
diff --git a/bureau/admin/adm_domstypeedit.php b/bureau/admin/adm_domstypeedit.php
new file mode 100644
index 00000000..37c70d46
--- /dev/null
+++ b/bureau/admin/adm_domstypeedit.php
@@ -0,0 +1,97 @@
+enabled) {
+ __("This page is restricted to authorized staff");
+ exit();
+}
+
+include_once("head.php");
+
+$fields = array (
+ "id" => array ("request", "integer", ""),
+ "name" => array ("request", "string", ""),
+ "description" => array ("request", "string", ""),
+ "ask_dest" => array ("request", "boolean", ""),
+ "entry" => array ("request", "string", ""),
+ "compatibility" => array ("request", "string", ""),
+);
+getFields($fields);
+
+
+if (! $d=$dom->domains_type_get($id)) {
+ $error=$err->errstr();
+ echo $error;
+} else {
+?>
+
+
+
+
+$error_edit";
+ $error_edit="";
+
+} ?>
+
+
+
+
diff --git a/bureau/admin/adm_panel.php b/bureau/admin/adm_panel.php
index eef23924..640c3fdc 100644
--- a/bureau/admin/adm_panel.php
+++ b/bureau/admin/adm_panel.php
@@ -62,6 +62,7 @@ include_once("head.php");
+
diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php
index b7a3f2e8..cbe9d90a 100644
--- a/bureau/class/m_dom.php
+++ b/bureau/class/m_dom.php
@@ -92,6 +92,65 @@ class m_dom {
function alternc_quota_names() {
return "dom";
}
+ /* ----------------------------------------------------------------- */
+ /**
+ * Retourne un tableau contenant les types de domaines
+ *
+ * @return array retourne un tableau indexé contenant la liste types de domaines
+ * authorisé. Retourne FALSE si une erreur s'est produite.
+ */
+ function domains_type_lst() {
+ global $db,$err,$cuid;
+ $err->log("dom","domains_type_lst");
+ $db->query("select * from domaines_type order by id;");
+ $this->domains_type_lst=false;
+ while ($db->next_record()) {
+ $this->domains_type_lst[] = $db->Record;
+ }
+ return $this->domains_type_lst;
+ }
+
+ function domains_type_get($id) {
+ global $db,$err,$cuid;
+ $id=intval($id);
+ $db->query("select * from domaines_type where id = $id ;");
+ $db->next_record();
+ return $db->Record;
+ }
+
+ function domains_type_del($id) {
+ global $db,$err,$cuid;
+ $id=intval($id);
+ $db->query("delete domaines_type where id=$id;");
+ return true;
+ }
+
+ function domains_type_disable($id) {
+ global $db,$err,$cuid;
+ $id=intval($id);
+ $db->query("update domaines_type set enable=false where id=$id;");
+ return true;
+ }
+
+ function domains_type_enable($id) {
+ global $db,$err,$cuid;
+ $id=intval($id);
+ $db->query("update domaines_type set enable=true where id=$id;");
+ return true;
+ }
+
+ function domains_type_update($id, $name, $description, $ask_dest, $entry, $compatibility) {
+ global $err,$cuid,$db;
+ $id=intval($id);
+ $name=mysql_real_escape_string($name);
+ $description=mysql_real_escape_string($description);
+ $ask_dest=intval($ask_dest);
+ $entry=mysql_real_escape_string($entry);
+ $compatibility=mysql_real_escape_string($compatibility);
+ $db->query("UPDATE domaines_type SET name='$name', description='$description', ask_dest='$ask_dest', entry='$entry', compatibility='$compatibility' where id='$id';");
+ return true;
+ }
+
/* ----------------------------------------------------------------- */
/**
@@ -108,7 +167,7 @@ class m_dom {
$this->domains=array();
if ($db->num_rows()>0) {
while ($db->next_record()) {
- $this->domains[]=$db->f("domaine");
+ $this->domains[]=$db->f("domaine");
}
}
return $this->domains;