[tag flag write]__MINIMATE_TABLE__[/tag] [L]ACL Edit[/L] [if value mm_edit_user] [set name=arg int][value mm_edit_user][/set] [else] [set name=arg int][data session username][/set] [/else] [/if] [if-key-exists table="__MINIMATE_TABLE__" key="[value mm_edit_user]"] [else] [/else] [/if-key-exists] [perl tables="__MINIMATE_TABLE__"] my $table = $Variable->{MINIMATE_TABLE} || 'minimate'; my $uid = $Scratch->{arg}; my $db = $Db{$table}; $Values->{mvc_data_key_name} = $db->config('KEY'); my @fields = $db->columns(); for(@fields) { $Values->{$_} = $db->field($uid, $_); } my @tables = sort keys %{$Config->{Database}}; $Values->{mvc_data_fields} = join " ", @fields; if ($table ne $Values->{mv_data_table}) { $Values->{mvc_data_table} = $Values->{mv_data_table} = $table; } $Values->{mvc_data_table} = $table; sub display_checkbox_tables { my ($field) = @_; my $string = join ",", @tables; my @args = ( '', '', { attribute => $field, name => $field, type => 'check', passed => $string, }, { $field => $Values->{$field}, } ); return $Tag->accessories(@args); } if($table eq delete $Values->{mvc_auto_export}) { return "[set name=export_ok int][tag export $table][/tag][/set]"; } else { return '[set name=export_ok][/set]'; } [/perl] [title-bar 500 6][L]Table[/L] [value mv_data_table][if scratch export_ok](exported)[/if][/title-bar]
[title-bar 200 2][L]Links[/L][/title-bar]
  • [scratch menu]
[title-bar 200 2][L]Another User[/L][/title-bar]
[title-bar 200 2][L]New User[/L][/title-bar]
[set process_acl] [tag flag write]__MINIMATE_TABLE__[/tag] [perl tables="__MINIMATE_TABLE__"] my $table = $Values->{mv_data_table}; my $db = $Db{$table}; my $uid = $CGI->{$CGI->{mv_data_key}}; $Scratch->{mv_data_enable} = 0; $CGI->{mv_todo} = 'return'; if(! $uid) { Log('Tried to write empty uid'); return; } for($db->columns()) { next unless defined $CGI->{$_}; $CGI->{$_} =~ s/\0+/ /g; $CGI->{$_} = '' if $CGI->{$_} =~ /^ /; $CGI->{$_} =~ s/^\s+//; $CGI->{$_} =~ s/\s+$//; #$db->set_field($uid, $_, $CGI->{$_}); } my @colon_keys = grep /:/, keys %$CGI; my $structure = {}; if(@colon_keys) { for(@colon_keys) { my $item = $_; my $val = $CGI->{$_}; $val =~ s/\0+/ /g; next unless length($val); my($key, $subkey) = split /:/, $item, 2; $structure->{$key} = {} unless $structure->{$key}; $structure->{$key}{$subkey} = $val; } $CGI->{table_control} = uneval($structure); #$db->set_field($uid, 'table_control', $CGI->{table_control}); } $CGI->{mv_todo} = 'set'; $Scratch->{mv_data_enable} = 1; return; [/perl] [/set] [title-bar size=3][L]Edit key[/L] "[scratch arg]"[/title-bar]
[perl __MINIMATE_TABLE__] [/perl] [if-key-exists table="[value mv_data_table]" key="[scratch arg]"] [L]Update[/L] [L]Insert[/L] [L]Delete[/L] [L]Yes, delete[/L] [else] [L]Update[/L] [L]Insert[/L] [/else] [/if-key-exists] [loop list="[value acl]"] [/loop]
[L]Column[/L][L]Value[/L]
Super-user Yes No
Change/View Config Yes No
Reconfig Yes No
Tables allowed
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('yes_tables'); [/perl]
Tables not allowed
[perl __MINIMATE_TABLE__] display_checkbox_tables('no_tables'); [/perl]
Upload allowed
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('upload'); [/perl]
Export allowed
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('export'); [/perl]
Edit allowed
(only allowed when in allowed tables)
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('export'); [/perl]
MetaInformation
(only applicable to allowed tables)
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('meta'); [/perl]
Tables for ACL
(only applicable to allowed tables)
ALL
[perl __MINIMATE_TABLE__] display_checkbox_tables('acl'); [/perl]
Page Upload/Download
(blank means all)
File Upload/Download
(blank means all)
[title-bar 400 4][L]Table[/L] [loop-code] ACL[/title-bar]
Columns allowed
(must have primary key)
Columns not allowed
Keys allowed
Keys not allowed
[calc] my $check = $Values->{mvc_data_fields} || $Tag->db_columns(); return if $check =~ /\b$Values->{mvc_data_key_name}\b/; my $name = $Values->{mvc_data_key_name}; my $val = $Scratch->{arg}; $val =~ s/"/"/g; return qq{}; [/calc]
    [if !value mvc_too_large] [L]Auto-export[/L] [/if]
[value name=mvc_data_fields set=""]

[L]Edit menu for table[/L] [value mv_data_table]
[L]Upload/download/export menu for table[/L] [value mv_data_table]
[scratch menu]