diff --git a/.gitattributes b/.gitattributes index 07a640ae..9b976ee2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -68,7 +68,6 @@ bureau/admin/adm_donosu.php -text bureau/admin/adm_dorenew.php -text bureau/admin/adm_dosu.php -text bureau/admin/adm_edit.php -text -bureau/admin/adm_editvar.php -text bureau/admin/adm_email.php -text bureau/admin/adm_list.php -text bureau/admin/adm_lockpanel.php -text @@ -85,6 +84,7 @@ bureau/admin/adm_tlddoadd.php -text bureau/admin/adm_tlddoedit.php -text bureau/admin/adm_tldedit.php -text bureau/admin/adm_update_domains.php -text +bureau/admin/adm_var_edit.php -text bureau/admin/adm_variables.php -text bureau/admin/aide/help.php -text bureau/admin/aide/help.png -text diff --git a/bureau/admin/adm_editvar.php b/bureau/admin/adm_editvar.php deleted file mode 100644 index 1333ed77..00000000 --- a/bureau/admin/adm_editvar.php +++ /dev/null @@ -1 +0,0 @@ -TODO diff --git a/bureau/admin/adm_var_edit.php b/bureau/admin/adm_var_edit.php new file mode 100644 index 00000000..a5179c28 --- /dev/null +++ b/bureau/admin/adm_var_edit.php @@ -0,0 +1,191 @@ + array ("get", "string", null), + "var_id" => array ("post", "integer", null), + "var_value" => array ("post", "string", null), + "var_name" => array ("post", "string", null), + "strata" => array ("post", "string", null), + "strata_id" => array ("post", "integer", null), + "delete" => array ("post", "boolean", false), +); +getFields($fields); + +if (empty($var)) { + echo "
";__("Missing var name");echo "
"; + include_once("foot.php"); +} + +if ( $var_id && $delete ) { + $variables->del($var_id); +} else if ( $strata && $var_name && $var_value ) { + $variables->variable_update_or_create($var_name, $var_value, $strata, $strata_id); +} else if ( $var_id && $var_value ) { + $variables->variable_update_or_create($var_name, $var_value, null, null, $var_id); +} + +echo ""; __($strata); echo " | "; + switch($strata) { + case 'DEFAULT': + echo "".$allvars['DEFAULT'][null][$var]['value']." | "; + break; + case 'GLOBAL': + echo ""; + if ( isset($allvars['GLOBAL'][null][$var]) && is_array($allvars['GLOBAL'][null][$var])){ + echo "".$allvars['GLOBAL'][null][$var]['value'].""; + edit_var($allvars['GLOBAL'][null][$var]); + } else { + echo ""._("Add").""; + add_var($strata); + } + echo " | "; + break; + case 'FQDN_CREATOR': + echo "";
+ foreach ($allvars['FQDN_CREATOR'] as $ttk => $ttv ) {
+ if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
+ echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
+ echo "".$ttv[$var]['value']."";
+ edit_var($ttv[$var]);
+ }
+ echo " "; + } + echo ""._("Add").""; + add_var($strata, $members_list); + echo " | ";
+ break;
+ case 'FQDN':
+ echo "";
+ foreach ($allvars['FQDN'] as $ttk => $ttv ) {
+ if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
+ echo sprintf(_("Overwritted by %s"), $panel_url[$ttk])." → ";
+ echo "".$ttv[$var]['value']."";
+ edit_var($ttv[$var]);
+ }
+ echo " "; + } + echo ""._("Add").""; + add_var($strata, $panel_url); + echo " | ";
+ break;
+ case 'CREATOR':
+ echo "";
+ foreach ($allvars['CREATOR'] as $ttk => $ttv ) {
+ if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
+ echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
+ echo "".$ttv[$var]['value']."";
+ edit_var($ttv[$var]);
+ }
+ echo " "; + } + echo ""._("Add").""; + add_var($strata, $creators_list ); + echo " | ";
+ break;
+ case 'MEMBER':
+ echo "";
+ foreach ($allvars['MEMBER'] as $ttk => $ttv ) {
+ if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
+ echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
+ echo "".$ttv[$var]['value']."";
+ edit_var($ttv[$var]);
+ }
+ echo " "; + } + echo ""._("Add").""; + add_var($strata, $members_list); + echo " | ";
+ break;
+ case 'DOMAIN':
+ //FIXME TODO
+ echo "Todo. | "; + break; + } //switch + + echo "