[L]ACL Edit[/L]

[if-mm !super] [bounce href="[area @@MM_BASE@@/violation]"] [/if-mm] [tag flag write]__MINIMATE_TABLE__[/tag]
[if value mm_edit_user] [set name=arg int][value mm_edit_user][/set] [else] [set name=arg int][data session mm_username][/set] [/else] [/if] [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 left 5 font -1', 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]Manage MiniMate Users[/L][if scratch export_ok](exported)[/if][/title-bar]

[title-bar 200 2][L]Links[/L][/title-bar] [scratch menu] [set Login_now] [userdb logout] [if type=explicit compare="[userdb login]"] mv_nextpage=@@MM_BASE@@/menu [else] mv_nextpage=@@MM_BASE@@/violation [/else] [/if] [/set] Log in as | [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; 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=5][L]User[/L] [scratch arg][/title-bar] [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]

[L]Column[/L] | [L]Value[/L]
--- | ---
Super-user |
Change/View Config |
Reconfig |
Omit Functions Don't offer confusing stuff. | [widget name=no_functions type="checkbox left 3 font -1" default="sql error"] none=All options (uncheck rest), change_db=Change DB box, spreadsheet=Spreadsheet, display_configure=Fields to display, entities=Decode HTML entities, error=View error log, config=Configure/Reconfig, home=Open catalog home, search=Search for keys option, [/widget]
Allow Dangerous Functions Make sure you trust users of these | [widget name=yes_functions type="checkbox left 3 font -1" default="report"] pages=Upload/download pages, files=Upload/download files, add_field=Add/Delete DB fields, journal_update=Partial upload, report=Report generator, mml=Allow MML tags in data (affects reports), sql=SQL Search option, [/widget]
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]
Tables for ACL (only applicable to allowed tables) | ALL [perl __MINIMATE_TABLE__] display_checkbox_tables('acl'); [/perl]
Page Upload/Download (blank means all) Careful!!! Don't allow untrusted users to use this! It can breach security! | [value pages]
File Upload/Download (blank means all) Careful!!! Don't allow untrusted users to use this! If you do, make sure you bring in with the [file ...] tag and not the [include ...] tag. Do not use these to set a Variable. | [value files]
[loop list="[value acl]"]
[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 |
Owner field |
[/loop]

[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]