Merge branch 'master' of github.com:webmin/webmin
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled

This commit is contained in:
Jamie Cameron
2026-04-23 21:30:08 -07:00
50 changed files with 922 additions and 1603 deletions

View File

@@ -5,115 +5,84 @@ require 'apache-lib.pl';
# Output HTML for editing security options for the apache module
sub acl_security_form
{
print "<tr> <td valign=top rowspan=4><b>$text{'acl_virts'}</b></td>\n";
print "<td rowspan=4 valign=top>\n";
printf "<input type=radio name=virts_def value=1 %s> %s\n",
$_[0]->{'virts'} eq '*' ? 'checked' : '', $text{'acl_vall'};
printf "<input type=radio name=virts_def value=0 %s> %s<br>\n",
$_[0]->{'virts'} eq '*' ? '' : 'checked', $text{'acl_vsel'};
print "<select name=virts multiple size=5>\n";
local $conf = &get_config();
local @virts = ( { 'value' => '__default__' },
&find_directive_struct("VirtualHost", $conf) );
local %vcan = map { $_, 1 } split(/\s+/, $_[0]->{'virts'});
local $v;
foreach $v (@virts) {
local @vn = &virt_acl_name($v);
local ($can) = grep { $vcan{$_} } @vn;
local $vn = $can || $vn[0];
printf "<option value=\"%s\" %s>%s</option>\n",
$vn, $can ? "selected" : "",
$vn eq "__default__" ? $text{'acl_defserv'} : $vn;
my ($o) = @_;
my $conf = &get_config();
my @virts = ( { 'value' => '__default__' },
&find_directive_struct("VirtualHost", $conf) );
my @vsel = $o->{'virts'} eq '*' ? () : split(/\s+/, $o->{'virts'});
my %vcan = map { $_, 1 } @vsel;
my @vopts;
foreach my $v (@virts) {
my @vn = &virt_acl_name($v);
my ($can) = grep { $vcan{$_} } @vn;
my $show = $can || $vn[0];
push(@vopts, [ $show,
$show eq "__default__" ? $text{'acl_defserv'}
: $show ]);
delete($vcan{$can}) if ($can);
}
foreach $vn (keys %vcan) {
next if ($vn eq "*");
printf "<option value=\"%s\" %s>%s</option>\n",
$vn, "selected",
$vn eq "__default__" ? $text{'acl_defserv'} : $vn;
print &ui_table_row($text{'acl_virts'},
&ui_radio("virts_def", $o->{'virts'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_vall'} ],
[ 0, $text{'acl_vsel'} ] ])."<br>\n".
&ui_select("virts", \@vsel, \@vopts, 5, 1, 1),
3);
print &ui_table_row($text{'acl_global'},
&ui_select("global",
defined($o->{'global'}) && $o->{'global'} ne '' ?
$o->{'global'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_htaccess'} ],
[ 0, $text{'no'} ] ]));
print &ui_table_row($text{'acl_create'},
&ui_yesno_radio("create", $o->{'create'}));
print &ui_table_row($text{'acl_vuser'},
&ui_yesno_radio("vuser", $o->{'vuser'}));
print &ui_table_row($text{'acl_vaddr'},
&ui_yesno_radio("vaddr", $o->{'vaddr'}));
print &ui_table_row($text{'acl_pipe'},
&ui_yesno_radio("pipe", $o->{'pipe'}));
print &ui_table_row($text{'acl_stop'},
&ui_yesno_radio("stop", $o->{'stop'}));
print &ui_table_row($text{'acl_apply'},
&ui_yesno_radio("apply", $o->{'apply'}));
print &ui_table_row($text{'acl_names'},
&ui_yesno_radio("names", $o->{'names'}));
print &ui_table_row($text{'acl_dir'},
&ui_textbox("dir", $o->{'dir'}, 30)." ".
&file_chooser_button("dir", 1),
3);
print &ui_table_row($text{'acl_aliasdir'},
&ui_textbox("aliasdir", $o->{'aliasdir'}, 30)." ".
&file_chooser_button("aliasdir", 1),
3);
my @typesel = $o->{'types'} eq '*' ? () : split(/\s+/, $o->{'types'});
my @typeopts;
for (my $i = 0; $text{"type_$i"}; $i++) {
push(@typeopts, [ $i, $text{"type_$i"} ]);
}
print "</select></td>\n";
print &ui_table_row($text{'acl_types'},
&ui_radio("types_def", $o->{'types'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_all'} ],
[ 0, $text{'acl_sel'} ] ])."<br>\n".
&ui_select("types", \@typesel, \@typeopts, 5, 1),
3);
print "<td><b>$text{'acl_global'}</b></td> <td><select name=global>\n";
printf "<option value=1 %s>$text{'yes'}</option>\n",
$_[0]->{'global'} == 1 ? "selected" : "";
printf "<option value=2 %s>$text{'acl_htaccess'}</option>\n",
$_[0]->{'global'} == 2 ? "selected" : "";
printf "<option value=0 %s>$text{'no'}</option></select></td> </tr>\n",
$_[0]->{'global'} == 0 ? "selected" : "";
print "<tr> <td><b>$text{'acl_create'}</b></td> <td>\n";
printf "<input type=radio name=create value=1 %s> $text{'yes'}\n",
$_[0]->{'create'} ? "checked" : "";
printf "<input type=radio name=create value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'create'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_vuser'}</b></td> <td>\n";
printf "<input type=radio name=vuser value=1 %s> $text{'yes'}\n",
$_[0]->{'vuser'} ? "checked" : "";
printf "<input type=radio name=vuser value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'vuser'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_vaddr'}</b></td> <td>\n";
printf "<input type=radio name=vaddr value=1 %s> $text{'yes'}\n",
$_[0]->{'vaddr'} ? "checked" : "";
printf "<input type=radio name=vaddr value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'vaddr'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_pipe'}</b></td> <td>\n";
printf "<input type=radio name=pipe value=1 %s> $text{'yes'}\n",
$_[0]->{'pipe'} ? "checked" : "";
printf "<input type=radio name=pipe value=0 %s> $text{'no'}</td>\n",
$_[0]->{'pipe'} ? "" : "checked";
print "<td><b>$text{'acl_stop'}</b></td> <td>\n";
printf "<input type=radio name=stop value=1 %s> $text{'yes'}\n",
$_[0]->{'stop'} ? "checked" : "";
printf "<input type=radio name=stop value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'stop'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_apply'}</b></td> <td>\n";
printf "<input type=radio name=apply value=1 %s> $text{'yes'}\n",
$_[0]->{'apply'} ? "checked" : "";
printf "<input type=radio name=apply value=0 %s> $text{'no'}</td>\n",
$_[0]->{'apply'} ? "" : "checked";
print "<td><b>$text{'acl_names'}</b></td> <td>\n";
printf "<input type=radio name=names value=1 %s> $text{'yes'}\n",
$_[0]->{'names'} ? "checked" : "";
printf "<input type=radio name=names value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'names'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_dir'}</b></td>\n";
printf "<td colspan=3><input name=dir size=30 value='%s'> %s</td> </tr>\n",
$_[0]->{'dir'}, &file_chooser_button("dir", 1);
print "<tr> <td><b>$text{'acl_aliasdir'}</b></td>\n";
printf "<td colspan=3><input name=aliasdir size=30 value='%s'> %s</td> </tr>\n",
$_[0]->{'aliasdir'}, &file_chooser_button("aliasdir", 1);
print "<tr> <td valign=top><b>$text{'acl_types'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=radio name=types_def value=1 %s> $text{'acl_all'}&nbsp;\n",
$_[0]->{'types'} eq '*' ? "checked" : "";
printf "<input type=radio name=types_def value=0 %s> $text{'acl_sel'}<br>\n",
$_[0]->{'types'} eq '*' ? "" : "checked";
map { $types{$_}++ } split(/\s+/, $_[0]->{'types'});
print "<select name=types size=5 multiple>\n";
for($i=0; $text{"type_$i"}; $i++) {
printf "<option value=\"%d\" %s>%s</option>\n",
$i, $types{$i} ? "selected" : "", $text{"type_$i"};
}
print "</select></td> </tr>\n";
print "<tr> <td valign=top><b>$text{'acl_dirs'}</b></td>\n";
print "<td colspan=3>\n";
print &ui_radio("dirsmode", $_[0]->{'dirsmode'},
[ [ 0, $text{'acl_dirs0'} ],
[ 1, $text{'acl_dirs1'} ],
[ 2, $text{'acl_dirs2'} ] ]),"<br>\n";
print &ui_textarea("dirs", join("\n", split(/\s+/, $_[0]->{'dirs'})), 5, 50);
print "</td> </tr>\n";
print &ui_table_row($text{'acl_dirs'},
&ui_radio("dirsmode", $o->{'dirsmode'},
[ [ 0, $text{'acl_dirs0'} ],
[ 1, $text{'acl_dirs1'} ],
[ 2, $text{'acl_dirs2'} ] ])."<br>\n".
&ui_textarea("dirs", join("\n", split(/\s+/, $o->{'dirs'})), 5, 50),
3);
}
# acl_security_save(&options)
@@ -141,4 +110,3 @@ $_[0]->{'names'} = $in{'names'};
$_[0]->{'dirsmode'} = $in{'dirsmode'};
$_[0]->{'dirs'} = join(" ", split(/\s+/, $in{'dirs'}));
}

View File

@@ -330,7 +330,7 @@ acl_types=أنواع التوجيه المتاحة
acl_all=الكل
acl_sel=المحدد ..
acl_names=يمكن تعديل أسماء الخادم؟
acl_dirs=Apache directives available<br><font size=-1>(Subject to types limit above)</font>
acl_dirs=توجيهات Apache المتاحة، وفقًا لأنواع التوجيهات المحددة أعلاه
acl_dirs0=الكل
acl_dirs1=المدرجة فقط ..
acl_dirs2=كل ما عدا المدرجة ..

View File

@@ -329,7 +329,7 @@ acl_types=Налични видове директиви
acl_all=Всички
acl_sel=Избрани..
acl_names=Може да редактира имена на сървъри?
acl_dirs=Достъпни директиви на Apache<br><font size=-1>(съгласно лимита на типове по-горе)</font>
acl_dirs=Налични директиви на Apache, ограничени от избраните по-горе типове директиви
acl_dirs0=Всички
acl_dirs1=Само изброените ..
acl_dirs2=Всички освен изброените ..

View File

@@ -329,7 +329,7 @@ acl_types=Tipus de directives disponibles
acl_all=Tots
acl_sel=Seleccionats...
acl_names=Pot editar els noms dels servidors
acl_dirs=Directives Apache disponibles<br><font size=-1>(Subjectes al límit de tipus superior)</font>
acl_dirs=Directives Apache disponibles, limitades pels tipus de directiva seleccionats a sobre
acl_dirs0=Totes
acl_dirs1=Només les llistades
acl_dirs2=Totes excepte les llistades

View File

@@ -320,7 +320,7 @@ acl_types=Typy direktiv k dispozici
acl_all=Všechny
acl_sel=Vybrané..
acl_names=Mohu upravovat názvy serverů?
acl_dirs=Direktivy Apache jsou přístupné<br><font size=-1>(Subject to types limit above)</font>
acl_dirs=Dostupné direktivy Apache, omezené typy direktiv vybranými výše
acl_dirs0=Vše
acl_dirs1=Jen vybrané ..
acl_dirs2=Vše kromě vybraných ..

View File

@@ -78,7 +78,7 @@ acl_types=Tilgængelige direktiv typer
acl_all=Alle
acl_sel=Valgte ..
acl_names=Kan redigere servernavne?
acl_dirs=Apache direktiver tilgængelige<br><font size=-1>(Subjekt tor type begrænsinger ovenfor)</font>
acl_dirs=Tilgængelige Apache-direktiver, begrænset af de direktivtyper, der er valgt ovenfor
acl_dirs0=Alle
acl_dirs1=Kun listede ..
acl_dirs2=Alle undtagen listede ..

View File

@@ -331,7 +331,7 @@ acl_types=Verfügbare Direktiventypen
acl_all=Alle
acl_sel=Ausgewählt..
acl_names=Kann Servernamen bearbeiten?
acl_dirs=Verfügbare Apache-Direktiven<br><font size=-1>(Abhängig von obigen Typenbeschränkungen)</font>
acl_dirs=Verfügbare Apache-Direktiven, eingeschränkt durch die oben ausgewählten Direktivtypen
acl_dirs0=Alle
acl_dirs1=Nur aufgeführte ..
acl_dirs2=Alle außer aufgeführte ..

View File

@@ -329,7 +329,7 @@ acl_types=Directive types available
acl_all=All
acl_sel=Selected..
acl_names=Can edit server names?
acl_dirs=Apache directives available<br><font size=-1>(Subject to types limit above)</font>
acl_dirs=Διαθέσιμες οδηγίες Apache, περιορισμένες από τους τύπους οδηγιών που έχουν επιλεγεί παραπάνω
acl_dirs0=All
acl_dirs1=Only listed ..
acl_dirs2=All except listed ..

View File

@@ -332,7 +332,7 @@ acl_types=Directive types available
acl_all=All
acl_sel=Selected..
acl_names=Can edit server names?
acl_dirs=Apache directives available<br><font size=-1>(Subject to types limit above)</font>
acl_dirs=Available Apache directives, limited by the directive types selected above
acl_dirs0=All
acl_dirs1=Only listed ..
acl_dirs2=All except listed ..

View File

@@ -33,7 +33,7 @@ htaccess_err=Error al crear el archivo de opciones
defines_list=Parámetros definidos
acl_aliasdir=Limite los alias al directorio
acl_dirs=Directivas de Apache disponibles <br><font size=-1> (Sujeto al límite de tipos anterior) </font>
acl_dirs=Directivas de Apache disponibles, limitadas por los tipos de directiva seleccionados arriba
acl_dirs0=Todos
acl_dirs1=Solo listado ..
acl_dirs2=Todos excepto los enumerados.

View File

@@ -331,7 +331,7 @@ acl_types=Zuzentarau motak eskuragarri
acl_all=guztiak
acl_sel=Hautatutako ..
acl_names=Editatu al ditzakezu zerbitzariaren izenak?
acl_dirs=Apache zuzentzaileak eskuragarri daude <font size=-1>(Aurreko muga moten menpe)</font>
acl_dirs=Eskuragarri dauden Apache zuzentarauak, goian hautatutako zuzentarau motez mugatuta
acl_dirs0=guztiak
acl_dirs1=Zerrenda bakarra ..
acl_dirs2=Zerrendatu guztiak ..

View File

@@ -35,7 +35,7 @@ defines_list=پارامترهای تعریف شده
acl_aliasdir=نام مستعار را به فهرست راهنما محدود كنيد
acl_names=آیا می توانید نام سرور را ویرایش کنید؟
acl_dirs=Apache directives available<br><font size=-1>(Subject to types limit above)</font>
acl_dirs=دستورهای Apache موجود، محدود به انواع دستور انتخاب‌شده در بالا
acl_dirs0=همه
acl_dirs1=فقط ذکر شده ..
acl_dirs2=همه به جز ذکر شده ..

View File

@@ -331,7 +331,7 @@ acl_types=Direktiivityyppejä saatavana
acl_all=Kaikki
acl_sel=Valitut ..
acl_names=Voiko palvelimen nimiä muokata?
acl_dirs=Apache-direktiivit saatavilla <br><font size=-1> (Ellei tyyppirajoitusta ole yllä) </font>
acl_dirs=Saatavilla olevat Apache-direktiivit, joita yllä valitut direktiivityypit rajoittavat
acl_dirs0=Kaikki
acl_dirs1=Vain listattu ..
acl_dirs2=Kaikki paitsi luetellut ..

View File

@@ -331,7 +331,7 @@ acl_types=Types de directives disponibles
acl_all=Tous
acl_sel=Sélectionnés...
acl_names=Peut modifier les noms de serveurs?
acl_dirs=Directives Apache disponibles<br><font size=-1>(assujetties aux limites ci-dessus)</font>
acl_dirs=Directives Apache disponibles, limitées par les types de directives sélectionnés ci-dessus
acl_dirs0=Toutes
acl_dirs1=Seulement les suivantes ...
acl_dirs2=Toutes sauf les suivantes ...

View File

@@ -322,7 +322,7 @@ acl_types=Tipovi propisa dostupni
acl_all=Sve
acl_sel=Odabrano..
acl_names=Ne možete urediti nazive poslužitelja?
acl_dirs=Apache propisi dostupni<br><font size=-1>(Mterija tipova limita je iznad)</font>
acl_dirs=Dostupne Apache direktive, ograničene vrstama direktiva odabranima iznad
acl_dirs0=Sve
acl_dirs1=Samo izlistano ..
acl_dirs2=Sve prihvaćene liste ..

View File

@@ -32,7 +32,7 @@ htaccess_err=Nem sikerült létrehozni az opciós fájlt
defines_list=Meghatározott paraméterek
acl_aliasdir=Korlátozza az álneveket a könyvtárba
acl_dirs=Apache-irányelvek elérhetőek <br><font size=-1> (A fenti típuskorlátozástól függően) </font>
acl_dirs=Elérhető Apache-irányelvek, a fent kiválasztott irányelvtípusok által korlátozva
acl_dirs0=Összes
acl_dirs1=Csak felsorolt ..
acl_dirs2=Minden, kivéve a felsorolt ..

View File

@@ -45,7 +45,7 @@ restart_ecannot=Non è consentito applicare modifiche
acl_apply=È possibile applicare le modifiche?
acl_aliasdir=Limita gli alias alla directory
acl_names=Puoi modificare i nomi dei server?
acl_dirs=Direttive Apache disponibili <br><font size=-1> (Soggetto al limite di tipi sopra) </font>
acl_dirs=Direttive Apache disponibili, limitate dai tipi di direttiva selezionati sopra
acl_dirs0=Tutti
acl_dirs1=Solo elencato ..
acl_dirs2=Tutti tranne quelli elencati. ..

View File

@@ -322,7 +322,7 @@ acl_types=利用可能なディレクティブのタイプ
acl_all=すべて
acl_sel=選択済み..
acl_names=サーバー名を編集できますか?
acl_dirs=利用可能なApacheディレクティブ<br> <font size = -1>(上記のタイプ制限に従う)</font>
acl_dirs=利用可能な Apache ディレクティブ。上で選択したディレクティブタイプ制限されます
acl_dirs0=All
acl_dirs1=のみ記載..
acl_dirs2=All except listed ..

View File

@@ -77,7 +77,7 @@ restart_ecannot=변경 사항을 적용 할 수 없습니다
acl_apply=변경 사항을 적용 할 수 있습니까?
acl_aliasdir=디렉토리로 별명 제한
acl_names=서버 이름을 편집 할 수 있습니까?
acl_dirs=Apache 지시문 사용 가능 <br><font size=-1> (위의 유형 제한에 따름) </font>
acl_dirs=사용 가능한 Apache 지시문, 위에서 선택한 지시문 유형으로 제한
acl_dirs0=모두
acl_dirs1=목록 만 ..
acl_dirs2=목록을 제외한 모든 ..

View File

@@ -297,7 +297,7 @@ acl_types=Jenis arahan boleh didapati
acl_all=Semua
acl_sel=Dipilih ..
acl_names=Boleh sunting nama pelayan?
acl_dirs=Arahan Apache yang tersedia <br> <font size=-1> (Tertakluk kepada jenis had seperti diatas) </font>
acl_dirs=Arahan Apache yang tersedia, dihadkan oleh jenis arahan yang dipilih di atas
acl_dirs0=Semua
acl_dirs1=Hanya disenaraikan ..
acl_dirs2=Semua kecuali yang disenaraikan ..

View File

@@ -328,7 +328,7 @@ acl_types=Beschikbare soorten richtlijnen
acl_all=Alles
acl_sel=Geselecteerd..
acl_names=Mag server namen bewerken?
acl_dirs=Beschikbare Apache richtlijnen<br><font size=-1>(Behalve de soorten hierboven)</font>
acl_dirs=Beschikbare Apache-richtlijnen, beperkt door de hierboven geselecteerde richtlijntypen
acl_dirs0=Alles
acl_dirs1=Alleen die in de lijst
acl_dirs2=Alles behalve die in de lijst ..

View File

@@ -331,7 +331,7 @@ acl_types=Tilgjengelige direktivtyper
acl_all=Alle
acl_sel=Valgte..
acl_names=Kan redigere tjenernavn?
acl_dirs=Tilgjengelig Apache direktiver<br><font size=-1>(Med typebegrensninger som angitt ovenfor)</font>
acl_dirs=Tilgjengelige Apache-direktiver, begrenset av direktivtypene som er valgt ovenfor
acl_dirs0=Alle
acl_dirs1=Kun de i listen ..
acl_dirs2=Alle unntatt de i listen ..

View File

@@ -331,7 +331,7 @@ acl_types=Dostępne typy dyrektyw
acl_all=Wszystkie
acl_sel=Wybrane..
acl_names=Może edytować nazwy serwerów?
acl_dirs=Dostępne dyrektywy Apache<br><font size=-1>(Zależne od ograniczeń typów powyżej)</font>
acl_dirs=Dostępne dyrektywy Apache, ograniczone przez wybrane powyżej typy dyrektyw
acl_dirs0=Wszystkie
acl_dirs1=Tylko wymienione ..
acl_dirs2=Wszystkie oprócz wymienionych ..

View File

@@ -120,7 +120,7 @@ acl_defserv=Servidor Padrão
acl_apply=Pode aplicar alterações?
acl_aliasdir=Limitar aliases ao diretório
acl_names=Pode editar nomes de servidores?
acl_dirs=Diretivas Apache disponíveis <br><font size=-1> (Sujeito ao limite de tipos acima) </font>
acl_dirs=Diretivas Apache disponíveis, limitadas pelos tipos de diretiva selecionados acima
acl_dirs0=Todos
acl_dirs1=Apenas listado ..
acl_dirs2=Todos, exceto listados ..

View File

@@ -323,7 +323,7 @@ acl_types=Tipos de diretivas disponíveis
acl_all=Todos
acl_sel=Selecionados..
acl_names=Editar nome de servidores?
acl_dirs=Diretivas do Apache disponíveis<br><font size=-1>(Assunto para os tipos abaixo permitidos)</font>
acl_dirs=Diretivas do Apache disponíveis, limitadas pelos tipos de diretiva selecionados acima
acl_dirs0=Todos
acl_dirs1=Somente listados ..
acl_dirs2=Todos exceto os listados ..

View File

@@ -318,7 +318,7 @@ acl_types=Доступные типы директив
acl_all=Все
acl_sel=Выбранные..
acl_names=Отредактировать имена серверов?
acl_dirs=Имеющиеся директивы Apache <br><font size=-1>(С учетом типов ограничить выше) </font>
acl_dirs=Доступные директивы Apache, ограниченные выбранными выше типами директив
acl_dirs0=Все
acl_dirs1=Только перечисленные...
acl_dirs2=Все, кроме перечисленных...

View File

@@ -331,7 +331,7 @@ acl_types=Dostupné typy smernice
acl_all=všetko
acl_sel=Vybraný ..
acl_names=Môžete upravovať názvy serverov?
acl_dirs=Dostupné direktívy Apache <br><font size=-1> (podľa obmedzenia typov vyššie) </font>
acl_dirs=Dostupné direktívy Apache, obmedzené typmi direktív vybranými vyššie
acl_dirs0=všetko
acl_dirs1=Iba uvedené ..
acl_dirs2=Všetky okrem uvedených ..

View File

@@ -323,7 +323,7 @@ acl_types=Tillgängliga direktiv typer
acl_all=Alla
acl_sel=Angivna ...
acl_names=Kan ändra server namn?
acl_dirs=Apache direktiv tillgängliga<br><font size=-1> (Ämnen av typ begränsning under) </font>
acl_dirs=Tillgängliga Apache-direktiv, begränsade av de direktivtyper som valts ovan
acl_dirs0=Alla
acl_dirs1=Endast listade ..
acl_dirs2=Alla utom listade ..

View File

@@ -134,7 +134,7 @@ acl_defserv=Varsayılan Sunucu
acl_apply=Değişiklikler uygulayabilir mi?
acl_aliasdir=Diğer adları dizine sınırla
acl_names=Sunucu adlarını düzenleyebilir mi?
acl_dirs=Apache yönergeleri mevcut <br><font size=-1> (Yukarıdaki tür sınırlamasına tabidir) </font>
acl_dirs=Kullanılabilir Apache yönergeleri, yukarıda seçilen yönerge türleriyle sınırlıdır
acl_dirs0=Herşey
acl_dirs1=Sadece listelenmiş ..
acl_dirs2=Listelenenler hariç tümü ..

View File

@@ -54,7 +54,7 @@ restart_ecannot=Вам заборонено застосовувати змін
acl_apply=Чи можна застосувати зміни?
acl_aliasdir=Обмежте псевдоніми до каталогу
acl_names=Чи можна редагувати імена серверів?
acl_dirs=Доступні директиви Apache <br><font size=-1> (За умови обмеження типів вище) </font>
acl_dirs=Доступні директиви Apache, обмежені вибраними вище типами директив
acl_dirs0=Усі
acl_dirs1=Тільки перераховані ..
acl_dirs2=Усі, крім перерахованих ..

View File

@@ -331,7 +331,7 @@ acl_types=可用的指令类型
acl_all=全部
acl_sel=选择的…
acl_names=是否编辑服务器名称吗
acl_dirs=Apache指令可用<br><font size=-1>(受上述类型限制)</font>
acl_dirs=可用的 Apache 指令,受上方所选指令类型限制
acl_dirs0=全部
acl_dirs1=仅列出 ..
acl_dirs2=除列出外的所有内容 ..

View File

@@ -39,7 +39,7 @@ start_eafter=Apache似乎沒有運行
acl_aliasdir=將別名限制為目錄
acl_names=可以編輯服務器名稱嗎?
acl_dirs=可用的Apache指令<br><font size=-1>(受上述類型限制)</font>
acl_dirs=可用的 Apache 指令,受上方所選指令類型限制
acl_dirs0=所有
acl_dirs1=只列出 ..
acl_dirs2=除了列出的所有 ..

View File

@@ -11,18 +11,10 @@ our (%config, %text, %in);
# Output HTML for editing security options for the bind8 module
sub acl_security_form
{
my $m = $_[0]->{'zones'} eq '*' ? 1 :
$_[0]->{'zones'} =~ /^\!/ ? 2 : 0;
print "<tr> <td valign=top><b>$text{'acl_zones'}</b></td>\n";
print "<td colspan=3><table cellpadding=0 cellspacing=0> <tr><td valign=top>\n";
printf "<input type=radio name=zones_def value=1 %s> %s<br>\n",
$m == 1 ? 'checked' : '', $text{'acl_zall'};
printf "<input type=radio name=zones_def value=0 %s> %s<br>\n",
$m == 0 ? 'checked' : '', $text{'acl_zsel'};
printf "<input type=radio name=zones_def value=2 %s> %s</td>\n",
$m == 2 ? 'checked' : '', $text{'acl_znsel'};
my ($o) = @_;
my $m = $o->{'zones'} eq '*' ? 1 :
$o->{'zones'} =~ /^\!/ ? 2 : 0;
print "<td><select name=zones multiple size=4 width=150>\n";
my $conf = &get_config();
my @zones = grep { $_->{'value'} ne "." }
&find("zone", $conf);
@@ -31,188 +23,117 @@ foreach my $v (@views) {
push(@zones, grep { $_->{'value'} ne "." }
&find("zone", $v->{'members'}));
}
my %zcan;
map { $zcan{$_}++ } split(/\s+/, $_[0]->{'zones'});
my @zoneopts;
foreach my $z (sort { $a->{'value'} cmp $b->{'value'} } @zones) {
printf "<option value='%s' %s>%s</option>\n",
$z->{'value'},
$zcan{$z->{'value'}} ? "selected" : "",
&arpa_to_ip($z->{'value'});
push(@zoneopts, [ $z->{'value'}, &arpa_to_ip($z->{'value'}) ]);
}
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
printf "<option value='%s' %s>%s</option>\n",
'view_'.$v->{'value'},
$zcan{'view_'.$v->{'value'}} ? "selected" : "",
&text('acl_inview', $v->{'value'});
push(@zoneopts, [ 'view_'.$v->{'value'},
&text('acl_inview', $v->{'value'}) ]);
}
print "</select></td> </tr></table></td></tr>\n";
print &ui_table_row($text{'acl_zones'},
&ui_radio("zones_def", $m,
[ [ 1, $text{'acl_zall'} ],
[ 0, $text{'acl_zsel'} ],
[ 2, $text{'acl_znsel'} ] ])."<br>\n".
&ui_select("zones", [ split(/\s+/, $o->{'zones'}) ], \@zoneopts, 4, 1),
3);
if (@views) {
print "<tr> <td valign=top><b>$text{'acl_inviews'}</b></td>\n";
print "<td colspan=3>\n";
print &ui_radio("inviews_def", $_[0]->{'inviews'} eq "*" ? 1 : 0,
[ [ 1, $text{'acl_vall'} ],
[ 0, $text{'acl_vsel'} ] ]),"<br>\n";
print "<select name=inviews multiple size=4 width=150>\n";
my %vcan;
map { $vcan{$_}++ } split(/\s+/, $_[0]->{'inviews'});
printf "<option value='%s' %s>%s</option>\n",
"_", $vcan{"_"} ? "selected" : "",
"&lt;".$text{'acl_toplevel'}."&gt;";
my @viewopts = [ "_", "&lt;".$text{'acl_toplevel'}."&gt;" ];
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
printf "<option value='%s' %s>%s</option>\n",
$v->{'value'},
$vcan{$v->{'value'}} ? "selected" : "", $v->{'value'};
push(@viewopts, [ $v->{'value'}, $v->{'value'} ]);
}
print "</select></td></tr>\n";
print &ui_table_row($text{'acl_inviews'},
&ui_radio("inviews_def", $o->{'inviews'} eq "*" ? 1 : 0,
[ [ 1, $text{'acl_vall'} ],
[ 0, $text{'acl_vsel'} ] ])."<br>\n".
&ui_select("inviews", [ split(/\s+/, $o->{'inviews'}) ], \@viewopts,
4, 1),
3);
}
print "<tr> <td><b>$text{'acl_types'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=types_def value=1 %s> %s\n",
$_[0]->{'types'} ? "" : "checked", $text{'acl_types1'};
printf "<input type=radio name=types_def value=0 %s> %s\n",
$_[0]->{'types'} ? "checked" : "", $text{'acl_types0'};
printf "<input name=types size=40 value='%s'></td> </tr>\n",
$_[0]->{'types'};
print &ui_table_row($text{'acl_types'},
&ui_opt_textbox("types", $o->{'types'}, 40,
$text{'acl_types1'}, $text{'acl_types0'}),
3);
print "<tr> <td valign=top><b>$text{'acl_dir'}</b></td>\n";
printf "<td colspan=3><input name=dir size=30 value='%s'> %s<br>\n",
$_[0]->{'dir'}, &file_chooser_button("dir", 1);
printf "<input type=checkbox name=dironly value=1 %s> %s</td> </tr>\n",
$_[0]->{'dironly'} ? "checked" : "", $text{'acl_dironly'};
print &ui_table_row($text{'acl_dir'},
&ui_textbox("dir", $o->{'dir'}, 30)." ".&file_chooser_button("dir", 1).
"<br>\n".&ui_checkbox("dironly", 1, $text{'acl_dironly'}, $o->{'dironly'}),
3);
print "<tr> <td><b>$text{'acl_defaults'}</b></td> <td nowrap>\n";
printf "<input type=radio name=defaults value=1 %s> $text{'yes'}\n",
$_[0]->{'defaults'} ? "checked" : "";
printf "<input type=radio name=defaults value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'defaults'} ? "" : "checked";
print &ui_table_row($text{'acl_defaults'},
&ui_yesno_radio("defaults", $o->{'defaults'}));
print "<tr> <td><b>$text{'acl_ztypes'}</b></td> <td colspan=3>\n";
foreach my $t ("master", "slave", "forward", "delegation") {
printf "<input type=checkbox name=%s %s> %s\n",
$t, $_[0]->{$t} ? "checked" : "", $text{'acl_ztypes_'.$t};
}
print "</td> </tr>\n";
print &ui_table_row($text{'acl_ztypes'},
join("", map { &ui_checkbox($_, 1, $text{'acl_ztypes_'.$_}, $o->{$_}) }
("master", "slave", "forward", "delegation")),
3);
print "<tr> <td><b>$text{'acl_reverse'}</b></td> <td nowrap>\n";
printf "<input type=radio name=reverse value=1 %s> $text{'yes'}\n",
$_[0]->{'reverse'} ? "checked" : "";
printf "<input type=radio name=reverse value=0 %s> $text{'no'}</td>\n",
$_[0]->{'reverse'} ? "" : "checked";
print &ui_table_row($text{'acl_reverse'},
&ui_yesno_radio("reverse", $o->{'reverse'}));
print &ui_table_row($text{'acl_multiple'},
&ui_yesno_radio("multiple", $o->{'multiple'}));
print "<td><b>$text{'acl_multiple'}</b></td> <td nowrap>\n";
printf "<input type=radio name=multiple value=1 %s> $text{'yes'}\n",
$_[0]->{'multiple'} ? "checked" : "";
printf "<input type=radio name=multiple value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'multiple'} ? "" : "checked";
print &ui_table_row($text{'acl_ro'},
&ui_yesno_radio("ro", $o->{'ro'}));
print &ui_table_row($text{'acl_apply'},
&ui_select("apply",
defined($o->{'apply'}) && $o->{'apply'} ne '' ? $o->{'apply'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_applyonly'} ],
[ 3, $text{'acl_applygonly'} ],
[ 0, $text{'no'} ] ]));
print "<tr> <td><b>$text{'acl_ro'}</b></td> <td nowrap>\n";
printf "<input type=radio name=ro value=1 %s> $text{'yes'}\n",
$_[0]->{'ro'} ? "checked" : "";
printf "<input type=radio name=ro value=0 %s> $text{'no'}</td>\n",
$_[0]->{'ro'} ? "" : "checked";
print &ui_table_row($text{'acl_file'},
&ui_yesno_radio("file", $o->{'file'}));
print &ui_table_row($text{'acl_params'},
&ui_yesno_radio("params", $o->{'params'}));
print "<td><b>$text{'acl_apply'}</b></td> <td nowrap>\n";
print &ui_select("apply", $_[0]->{'apply'},
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_applyonly'} ],
[ 3, $text{'acl_applygonly'} ],
[ 0, $text{'no'} ] ]),"</td> </tr>\n";
print &ui_table_row($text{'acl_opts'},
&ui_yesno_radio("opts", $o->{'opts'}));
print &ui_table_row($text{'acl_delete'},
&ui_yesno_radio("delete", $o->{'delete'}));
print "<tr> <td><b>$text{'acl_file'}</b></td> <td nowrap>\n";
printf "<input type=radio name=file value=1 %s> $text{'yes'}\n",
$_[0]->{'file'} ? "checked" : "";
printf "<input type=radio name=file value=0 %s> $text{'no'}</td>\n",
$_[0]->{'file'} ? "" : "checked";
print &ui_table_row($text{'acl_gen'},
&ui_yesno_radio("gen", $o->{'gen'}));
print &ui_table_row($text{'acl_whois'},
&ui_yesno_radio("whois", $o->{'whois'}));
print "<td><b>$text{'acl_params'}</b></td> <td nowrap>\n";
printf "<input type=radio name=params value=1 %s> $text{'yes'}\n",
$_[0]->{'params'} ? "checked" : "";
printf "<input type=radio name=params value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'params'} ? "" : "checked";
print &ui_table_row($text{'acl_findfree'},
&ui_yesno_radio("findfree", $o->{'findfree'}));
print &ui_table_row($text{'acl_remote'},
&ui_yesno_radio("remote", $o->{'remote'}));
print "<tr> <td><b>$text{'acl_opts'}</b></td> <td nowrap>\n";
printf "<input type=radio name=opts value=1 %s> $text{'yes'}\n",
$_[0]->{'opts'} ? "checked" : "";
printf "<input type=radio name=opts value=0 %s> $text{'no'}</td>\n",
$_[0]->{'opts'} ? "" : "checked";
print &ui_table_row($text{'acl_slaves'},
&ui_yesno_radio("slaves", $o->{'slaves'}));
print &ui_table_row($text{'acl_dnssec'},
&ui_yesno_radio("dnssec", $o->{'dnssec'}));
print "<td><b>$text{'acl_delete'}</b></td> <td nowrap>\n";
printf "<input type=radio name=delete value=1 %s> $text{'yes'}\n",
$_[0]->{'delete'} ? "checked" : "";
printf "<input type=radio name=delete value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'delete'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_gen'}</b></td> <td nowrap>\n";
printf "<input type=radio name=gen value=1 %s> $text{'yes'}\n",
$_[0]->{'gen'} ? "checked" : "";
printf "<input type=radio name=gen value=0 %s> $text{'no'}</td>\n",
$_[0]->{'gen'} ? "" : "checked";
print "<td><b>$text{'acl_whois'}</b></td> <td nowrap>\n";
printf "<input type=radio name=whois value=1 %s> $text{'yes'}\n",
$_[0]->{'whois'} ? "checked" : "";
printf "<input type=radio name=whois value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'whois'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_findfree'}</b></td> <td nowrap>\n";
printf "<input type=radio name=findfree value=1 %s> $text{'yes'}\n",
$_[0]->{'findfree'} ? "checked" : "";
printf "<input type=radio name=findfree value=0 %s> $text{'no'}</td>\n",
$_[0]->{'findfree'} ? "" : "checked";
print "<td><b>$text{'acl_remote'}</b></td> <td nowrap>\n";
printf "<input type=radio name=remote value=1 %s> $text{'yes'}\n",
$_[0]->{'remote'} ? "checked" : "";
printf "<input type=radio name=remote value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'remote'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_slaves'}</b></td> <td nowrap>\n";
printf "<input type=radio name=slaves value=1 %s> $text{'yes'}\n",
$_[0]->{'slaves'} ? "checked" : "";
printf "<input type=radio name=slaves value=0 %s> $text{'no'}</td>\n",
$_[0]->{'slaves'} ? "" : "checked";
print "<td><b>$text{'acl_dnssec'}</b></td> <td nowrap>\n";
printf "<input type=radio name=dnssec value=1 %s> $text{'yes'}\n",
$_[0]->{'dnssec'} ? "checked" : "";
printf "<input type=radio name=dnssec value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'dnssec'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td><b>$text{'acl_views'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=views value=1 %s> $text{'yes'}\n",
$_[0]->{'views'} == 1 ? "checked" : "";
printf "<input type=radio name=views value=2 %s> $text{'acl_edonly'}\n",
$_[0]->{'views'} == 2 ? "checked" : "";
printf "<input type=radio name=views value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'views'} ? "" : "checked";
print &ui_table_row($text{'acl_views'},
&ui_radio("views", defined($o->{'views'}) ? $o->{'views'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_edonly'} ],
[ 0, $text{'no'} ] ]),
3);
if (@views) {
my $m = $_[0]->{'vlist'} eq '*' ? 1 :
$_[0]->{'vlist'} =~ /^\!/ ? 2 :
$_[0]->{'vlist'} eq '' ? 3 : 0;
print "<tr> <td valign=top><b>$text{'acl_vlist'}</b></td>\n";
print "<td colspan=3><table cellpadding=0 cellspacing=0> <tr><td valign=top>\n";
printf "<input type=radio name=vlist_def value=1 %s> %s<br>\n",
$m == 1 ? 'checked' : '', $text{'acl_vall'};
printf "<input type=radio name=vlist_def value=0 %s> %s<br>\n",
$m == 0 ? 'checked' : '', $text{'acl_vsel'};
printf "<input type=radio name=vlist_def value=2 %s> %s<br>\n",
$m == 2 ? 'checked' : '', $text{'acl_vnsel'};
printf "<input type=radio name=vlist_def value=3 %s> %s</td>\n",
$m == 3 ? 'checked' : '', $text{'acl_vnone'};
print "<td><select name=vlist multiple size=4 width=150>\n";
my ($v, %vcan);
map { $vcan{$_}++ } split(/\s+/, $_[0]->{'vlist'});
foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) {
printf "<option value='%s' %s>%s</option>\n",
$v->{'value'},
$vcan{$v->{'value'}} ? "selected" : "", $v->{'value'};
}
print "</select></td> </tr></table></td></tr>\n";
my $vm = $o->{'vlist'} eq '*' ? 1 :
$o->{'vlist'} =~ /^\!/ ? 2 :
$o->{'vlist'} eq '' ? 3 : 0;
my @vopts = map { [ $_->{'value'}, $_->{'value'} ] }
sort { $a->{'value'} cmp $b->{'value'} } @views;
print &ui_table_row($text{'acl_vlist'},
&ui_radio("vlist_def", $vm,
[ [ 1, $text{'acl_vall'} ],
[ 0, $text{'acl_vsel'} ],
[ 2, $text{'acl_vnsel'} ],
[ 3, $text{'acl_vnone'} ] ])."<br>\n".
&ui_select("vlist", [ split(/\s+/, $o->{'vlist'}) ], \@vopts, 4, 1),
3);
}
}

View File

@@ -5,66 +5,47 @@ require 'cluster-passwd-lib.pl';
# Output HTML for editing security options for the passwd module
sub acl_security_form
{
print "<tr> <td valign=top><b>$passwd::text{'acl_users'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=mode value=0 %s> %s\n",
$_[0]->{'mode'} == 0 ? 'checked' : '', $passwd::text{'acl_mode0'};
my ($o) = @_;
printf "<input type=radio name=mode value=3 %s> %s<br>\n",
$_[0]->{'mode'} == 3 ? 'checked' : '', $passwd::text{'acl_mode3'};
print &ui_table_row($passwd::text{'acl_users'},
&ui_radio_table("mode", defined($o->{'mode'}) ? $o->{'mode'} : 0,
[ [ 0, $passwd::text{'acl_mode0'} ],
[ 3, $passwd::text{'acl_mode3'} ],
[ 1, $passwd::text{'acl_mode1'},
&ui_textbox("users1", $o->{'mode'} == 1 ? $o->{'users'} : "",
40)." ".&user_chooser_button("users1", 1) ],
[ 2, $passwd::text{'acl_mode2'},
&ui_textbox("users2", $o->{'mode'} == 2 ? $o->{'users'} : "",
40)." ".&user_chooser_button("users2", 1) ],
[ 4, $passwd::text{'acl_mode4'},
&ui_textbox("low", $o->{'mode'} == 4 ? $o->{'low'} : "", 8).
" - ".&ui_textbox("high",
$o->{'mode'} == 4 ? $o->{'high'} : "", 8) ],
[ 5, $passwd::text{'acl_mode5'},
&ui_textbox("groups", $o->{'mode'} == 5 ? $o->{'users'} : "",
20)." ".&group_chooser_button("groups", 1)."<br>\n".
&ui_checkbox("sec", 1, $passwd::text{'acl_sec'}, $o->{'sec'}) ],
[ 6, $passwd::text{'acl_mode6'},
&ui_textbox("match", $o->{'mode'} == 6 ? $o->{'users'} : "",
15) ] ], 1),
3);
printf "<input type=radio name=mode value=1 %s> %s\n",
$_[0]->{'mode'} == 1 ? 'checked' : '', $passwd::text{'acl_mode1'};
printf "<input name=users1 size=40 value='%s'> %s<br>\n",
$_[0]->{'mode'} == 1 ? $_[0]->{'users'} : '',
&user_chooser_button("users1", 1);
print &ui_table_row($passwd::text{'acl_repeat'},
&ui_yesno_radio("repeat", $o->{'repeat'}), 3);
printf "<input type=radio name=mode value=2 %s> %s\n",
$_[0]->{'mode'} == 2 ? 'checked' : '', $passwd::text{'acl_mode2'};
printf "<input name=users2 size=40 value='%s'> %s<br>\n",
$_[0]->{'mode'} == 2 ? $_[0]->{'users'} : '',
&user_chooser_button("users2", 1);
print &ui_table_row($passwd::text{'acl_others'},
&ui_radio("others", defined($o->{'others'}) ? $o->{'others'} : 0,
[ [ 1, $passwd::text{'yes'} ],
[ 2, $passwd::text{'acl_opt'} ],
[ 0, $passwd::text{'no'} ] ]),
3);
printf "<input type=radio name=mode value=4 %s> %s\n",
$_[0]->{'mode'} == 4 ? 'checked' : '', $passwd::text{'acl_mode4'};
printf "<input name=low size=8 value='%s'> -\n",
$_[0]->{'mode'} == 4 ? $_[0]->{'low'} : '';
printf "<input name=high size=8 value='%s'><br>\n",
$_[0]->{'mode'} == 4 ? $_[0]->{'high'} : '';
printf "<input type=radio name=mode value=5 %s> %s\n",
$_[0]->{'mode'} == 5 ? 'checked' : '', $passwd::text{'acl_mode5'};
printf "<input name=groups size=20 value='%s'> %s<br>\n",
$_[0]->{'mode'} == 5 ? $_[0]->{'users'} : '',
&group_chooser_button("groups", 1);
printf "%s <input type=checkbox name=sec value=1 %s> %s<br>\n",
"&nbsp;" x 5, $_[0]->{'sec'} ? 'checked' : '',$passwd::text{'acl_sec'};
printf "<input type=radio name=mode value=6 %s> %s\n",
$_[0]->{'mode'} == 6 ? 'checked' : '', $passwd::text{'acl_mode6'};
printf "<input name=match size=15 value='%s'></td> </tr>\n",
$_[0]->{'mode'} == 6 ? $_[0]->{'users'} : '';
print "<tr> <td><b>$passwd::text{'acl_repeat'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=repeat value=1 %s> $passwd::text{'yes'}\n",
$_[0]->{'repeat'} ? "checked" : "";
printf "<input type=radio name=repeat value=0 %s> $passwd::text{'no'}</td> </tr>\n",
$_[0]->{'repeat'} ? "" : "checked";
print "<td><b>$passwd::text{'acl_others'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=others value=1 %s> $passwd::text{'yes'}\n",
$_[0]->{'others'} == 1 ? "checked" : "";
printf "<input type=radio name=others value=2 %s> $passwd::text{'acl_opt'}\n",
$_[0]->{'others'} == 2 ? "checked" : "";
printf "<input type=radio name=others value=0 %s> $passwd::text{'no'}</td> </tr>\n",
$_[0]->{'others'} == 0 ? "checked" : "";
print "<tr> <td><b>$passwd::text{'acl_old'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=old value=1 %s> $passwd::text{'yes'}\n",
$_[0]->{'old'} == 1 ? "checked" : "";
printf "<input type=radio name=old value=2 %s> $passwd::text{'acl_old_this'}\n",
$_[0]->{'old'} == 2 ? "checked" : "";
printf "<input type=radio name=old value=0 %s> $passwd::text{'no'}</td> </tr>\n",
$_[0]->{'old'} == 0 ? "checked" : "";
print &ui_table_row($passwd::text{'acl_old'},
&ui_radio("old", defined($o->{'old'}) ? $o->{'old'} : 0,
[ [ 1, $passwd::text{'yes'} ],
[ 2, $passwd::text{'acl_old_this'} ],
[ 0, $passwd::text{'no'} ] ]),
3);
}
# acl_security_save(&options)

View File

@@ -5,9 +5,11 @@ require 'dfsadmin-lib.pl';
# Output HTML for editing security options for the format module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
print "<td>",&ui_radio("view", $access{'view'},
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]),"</td> </tr>\n";
my ($o) = @_;
print &ui_table_row($text{'acl_view'},
&ui_radio("view", $o->{'view'},
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
}
# acl_security_save(&options)

View File

@@ -5,164 +5,53 @@ require 'dhcpd-lib.pl';
# Output HTML for editing security options for the dhcpd module
sub acl_security_form
{
print "<tr>\n<td><b>$text{'acl_apply'}</b></td> <td>\n";
printf "<input type=radio name=apply value=1 %s> $text{'yes'}\n",
$_[0]->{'apply'} ? "checked" : "";
printf "<input type=radio name=apply value=0 %s> $text{'no'}</td>\n",
$_[0]->{'apply'} ? "" : "checked";
print "</tr>\n";
my ($o) = @_;
print "<tr>\n<td><b>$text{'acl_global'}</b></td> <td>\n";
printf "<input type=radio name=global value=1 %s> $text{'yes'}\n",
$_[0]->{'global'} ? "checked" : "";
printf "<input type=radio name=global value=0 %s> $text{'no'}</td>\n",
$_[0]->{'global'} ? "" : "checked";
print "</tr>\n";
foreach my $f ('apply', 'global', 'r_leases', 'w_leases', 'zones') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print "<tr>\n<td><b>$text{'acl_r_leases'}</b></td> <td>\n";
printf "<input type=radio name=r_leases value=1 %s> $text{'yes'}\n",
$_[0]->{'r_leases'} ? "checked" : "";
printf "<input type=radio name=r_leases value=0 %s> $text{'no'}</td>\n",
$_[0]->{'r_leases'} ? "" : "checked";
print "</tr>\n";
print &ui_table_hr();
print "<tr>\n<td><b>$text{'acl_w_leases'}</b></td> <td>\n";
printf "<input type=radio name=w_leases value=1 %s> $text{'yes'}\n",
$_[0]->{'w_leases'} ? "checked" : "";
printf "<input type=radio name=w_leases value=0 %s> $text{'no'}</td>\n",
$_[0]->{'w_leases'} ? "" : "checked";
print "</tr>\n";
foreach my $f ('uniq_hst', 'uniq_sub', 'uniq_sha') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print "<tr>\n<td><b>$text{'acl_zones'}</b></td> <td>\n";
printf "<input type=radio name=zones value=1 %s> $text{'yes'}\n",
$_[0]->{'zones'} ? "checked" : "";
printf "<input type=radio name=zones value=0 %s> $text{'no'}</td>\n",
$_[0]->{'zones'} ? "" : "checked";
print "</tr>\n";
print &ui_table_hr();
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_row($text{'acl_seclevel'},
&ui_radio("smode", defined($o->{'smode'}) ? $o->{'smode'} : 0,
[ map { [ $_, $_ ] } 0 .. 3 ]),
3);
# uniqs
print "<tr>\n<td><b>$text{'acl_uniq_hst'}</b></td> <td>\n";
printf "<input type=radio name=uniq_hst value=1 %s> $text{'yes'}\n",
$_[0]->{'uniq_hst'} ? "checked" : "";
printf "<input type=radio name=uniq_hst value=0 %s> $text{'no'}</td>\n",
$_[0]->{'uniq_hst'} ? "" : "checked";
print "</tr>\n";
print &ui_table_row($text{'acl_hide'},
&ui_yesno_radio("hide", defined($o->{'hide'}) ? $o->{'hide'} : 0));
print "<tr>\n<td><b>$text{'acl_uniq_sub'}</b></td> <td>\n";
printf "<input type=radio name=uniq_sub value=1 %s> $text{'yes'}\n",
$_[0]->{'uniq_sub'} ? "checked" : "";
printf "<input type=radio name=uniq_sub value=0 %s> $text{'no'}</td>\n",
$_[0]->{'uniq_sub'} ? "" : "checked";
print "</tr>\n";
print &ui_table_hr();
print "<tr>\n<td><b>$text{'acl_uniq_sha'}</b></td> <td>\n";
printf "<input type=radio name=uniq_sha value=1 %s> $text{'yes'}\n",
$_[0]->{'uniq_sha'} ? "checked" : "";
printf "<input type=radio name=uniq_sha value=0 %s> $text{'no'}</td>\n",
$_[0]->{'uniq_sha'} ? "" : "checked";
print "</tr>\n";
foreach my $type (['hst', 'acl_ahst'], ['grp', 'acl_agrp'],
['sub', 'acl_asub'], ['sha', 'acl_asha']) {
print &ui_table_row($text{$type->[1]},
join("", map { &ui_checkbox($_."_".$type->[0], 1,
$text{"acl_".$_},
$o->{$_."_".$type->[0]}) }
qw(c r w)),
3);
}
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_hr();
# security mode settings
print "<tr>\n<td><b>$text{'acl_seclevel'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=smode value=0 %s> 0\n",
$_[0]->{'smode'} == 0 ? "checked" : "";
printf "<input type=radio name=smode value=1 %s> 1\n",
$_[0]->{'smode'} == 1 ? "checked" : "";
printf "<input type=radio name=smode value=2 %s> 2\n",
$_[0]->{'smode'} == 2 ? "checked" : "";
printf "<input type=radio name=smode value=3 %s> 3\n",
$_[0]->{'smode'} == 3 ? "checked" : "";
print "</td>\n</tr>\n";
foreach my $f ('per_sub_acls', 'per_sha_acls',
'per_hst_acls', 'per_grp_acls') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print "<tr>\n<td><b>$text{'acl_hide'}</b></td> <td>\n";
printf "<input type=radio name=hide value=1 %s> $text{'yes'}\n",
$_[0]->{'hide'} == 1 ? "checked" : "";
printf "<input type=radio name=hide value=0 %s> $text{'no'}</td>\n",
$_[0]->{'hide'} == 0 ? "checked" : "";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# global acls
print "<tr>\n<td><b>$text{'acl_ahst'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_hst value=1 %s> %s\n",
$_[0]->{'c_hst'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_hst value=1 %s> %s\n",
$_[0]->{'r_hst'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_hst value=1 %s> %s\n",
$_[0]->{'w_hst'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_agrp'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_grp value=1 %s> %s\n",
$_[0]->{'c_grp'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_grp value=1 %s> %s\n",
$_[0]->{'r_grp'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_grp value=1 %s> %s\n",
$_[0]->{'w_grp'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_asub'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_sub value=1 %s> %s\n",
$_[0]->{'c_sub'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_sub value=1 %s> %s\n",
$_[0]->{'r_sub'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_sub value=1 %s> %s\n",
$_[0]->{'w_sub'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_asha'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_sha value=1 %s> %s\n",
$_[0]->{'c_sha'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_sha value=1 %s> %s\n",
$_[0]->{'r_sha'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_sha value=1 %s> %s\n",
$_[0]->{'w_sha'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# per-subnet and per-host acls
print "<tr><td><b>$text{'acl_per_sub_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_sub_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_sub_acls'} ? "checked" : "";
printf "<input type=radio name=per_sub_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_sub_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr><td><b>$text{'acl_per_sha_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_sha_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_sha_acls'} ? "checked" : "";
printf "<input type=radio name=per_sha_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_sha_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr><td><b>$text{'acl_per_hst_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_hst_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_hst_acls'} ? "checked" : "";
printf "<input type=radio name=per_hst_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_hst_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr><td><b>$text{'acl_per_grp_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_grp_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_grp_acls'} ? "checked" : "";
printf "<input type=radio name=per_grp_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_grp_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
print "<tr>\n<td $tb><b>$text{'acl_per_obj_acls'}</b></td></tr> \n";
&display_tree($_[0],&get_parent_config(),-2);
print &ui_table_hr();
print &ui_table_span($text{'acl_per_obj_acls'});
&display_tree($o, &get_parent_config(), -2);
}
# acl_security_save(&options)
@@ -254,36 +143,18 @@ if (!$name && $node->{'name'} eq 'group') {
}
local $nodetype=$onames{$node->{'name'}};
local $aclname='ACL'.$nodetype.'_'.$name;
print "<tr>\n<td>","&nbsp"x$padding,
" $node->{'name'}: <b>$name</b></td>\n";
if (($nodetype eq 'hst')||($nodetype eq 'sub')||
($nodetype eq 'grp')||($nodetype eq 'sha')) {
print "<td colspan=3>\n";
if($acc->{$aclname}) {
printf "<input type=radio name=$aclname value='' %s> %s\n",
!&perm_to('r',$nodetype,$acc,$name) ?
"checked" : "", $text{"acl_na"};
printf "<input type=radio name=$aclname value='r' %s> %s\n",
&perm_to('r',$nodetype,$acc,$name) &&
!&perm_to('rw',$nodetype,$acc,$name) ?
"checked" : "",$text{"acl_r1"};
printf "<input type=radio name=$aclname value='rw' %s> %s\n",
&perm_to('rw',$nodetype,$acc,$name) ?
"checked" : "", $text{"acl_rw"};
}
else {
printf "<input type=radio name=$aclname value='' checked> %s\n",
$text{"acl_na"};
printf "<input type=radio name=$aclname value='r'> %s\n",
$text{"acl_r1"};
printf "<input type=radio name=$aclname value='rw'> %s\n",
$text{"acl_rw"};
}
print "</td>\n";
my $sel = !$acc->{$aclname} || !&perm_to('r', $nodetype, $acc, $name) ? '' :
&perm_to('rw', $nodetype, $acc, $name) ? 'rw' : 'r';
print &ui_table_row(
("&nbsp;" x $padding)." ".$node->{'name'}.": <b>$name</b>",
&ui_radio($aclname, $sel,
[ [ '', $text{'acl_na'} ],
[ 'r', $text{'acl_r1'} ],
[ 'rw', $text{'acl_rw'} ] ]),
3);
}
print "</tr>\n";
}
1;

View File

@@ -5,27 +5,24 @@ require 'format-lib.pl';
# Output HTML for editing security options for the format module
sub acl_security_form
{
local @dlist = &list_disks();
local ($d, %dcan);
map { $dcan{$_}++ } split(/\s+/, $_[0]->{'disks'});
print "<tr> <td valign=top><b>$text{'acl_disks'}</b></td> <td>\n";
printf "<input type=radio name=disks_def value=1 %s> %s\n",
$_[0]->{'disks'} eq '*' ? 'checked' : '', $text{'acl_dall'};
printf "<input type=radio name=disks_def value=0 %s> %s<br>\n",
$_[0]->{'disks'} eq '*' ? '' : 'checked', $text{'acl_dsel'};
print "<select name=disks size=4 multiple>\n";
foreach $d (@dlist) {
my ($o) = @_;
my @dlist = &list_disks();
my @dopts;
foreach my $d (@dlist) {
$d->{'device'} =~ s/^.*\///;
printf "<option value='%s' %s>%s</option>\n",
$d->{'device'},
$dcan{$d->{'device'}} ? "selected" : "",
"$d->{'desc'} ($d->{'type'})";
push(@dopts, [ $d->{'device'}, "$d->{'desc'} ($d->{'type'})" ]);
}
print "</select></td> </tr>\n";
print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
print "<td>",&ui_radio("view", $access{'view'},
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]),"</td> </tr>\n";
print &ui_table_row($text{'acl_disks'},
&ui_radio("disks_def", $o->{'disks'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_dall'} ],
[ 0, $text{'acl_dsel'} ] ])."<br>\n".
&ui_select("disks", [ split(/\s+/, $o->{'disks'}) ], \@dopts, 4, 1),
3);
print &ui_table_row($text{'acl_view'},
&ui_radio("view", $o->{'view'},
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
}
# acl_security_save(&options)

View File

@@ -7,102 +7,82 @@ require 'ldap-useradmin-lib.pl';
sub acl_security_form
{
local $o = $_[0];
my $uedit_group = $o->{'uedit_mode'} == 5 ?
join(" ", map { "".getgrgid($_) } split(/\s+/, $o->{'uedit'})) : "";
print "<tr> <td valign=top><b>$text{'acl_uedit'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=uedit_mode value=0 %s> $text{'acl_uedit_all'}&nbsp;&nbsp;\n",
$o->{'uedit_mode'} == 0 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=1 %s> $text{'acl_uedit_none'}&nbsp;\n",
$o->{'uedit_mode'} == 1 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=6 %s> $text{'acl_uedit_this'}<br>\n",
$o->{'uedit_mode'} == 6 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=2 %s> $text{'acl_uedit_only'}\n",
$o->{'uedit_mode'} == 2 ? "checked" : "";
printf "<input name=uedit_can size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 2 ? $o->{'uedit'} : "",
&user_chooser_button("uedit_can", 1);
printf "<input type=radio name=uedit_mode value=3 %s> $text{'acl_uedit_except'}\n",
$o->{'uedit_mode'} == 3 ? "checked" : "";
printf "<input name=uedit_cannot size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 3 ? $o->{'uedit'} : "",
&user_chooser_button("uedit_cannot", 1);
printf "<input type=radio name=uedit_mode value=4 %s> $text{'acl_uedit_uid'}\n",
$o->{'uedit_mode'} == 4 ? "checked" : "";
printf "<input name=uedit_uid size=6 value='%s'> - \n",
$o->{'uedit_mode'} == 4 ? $o->{'uedit'} : "";
printf "<input name=uedit_uid2 size=6 value='%s'><br>\n",
$o->{'uedit_mode'} == 4 ? $o->{'uedit2'} : "";
printf "<input type=radio name=uedit_mode value=5 %s> $text{'acl_uedit_group'}\n",
$o->{'uedit_mode'} == 5 ? "checked" : "";
printf "<input name=uedit_group size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 5 ?
join(" ", map { "".getgrgid($_) } split(/\s+/, $o->{'uedit'})) :"",
&group_chooser_button("uedit_group", 1);
printf "%s <input type=checkbox name=uedit_sec value=1 %s> %s<br>\n",
"&nbsp;" x 5, $o->{'uedit_sec'} ? 'checked' : '',$text{'acl_uedit_sec'};
printf "<input type=radio name=uedit_mode value=7 %s> $text{'acl_uedit_re'}\n",
$o->{'uedit_mode'} == 7 ? "checked" : "";
printf "<input name=uedit_re size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 7 ? $o->{'uedit_re'} : "";
print "</td> </tr>\n";
print &ui_table_row($text{'acl_uedit'},
&ui_radio_table("uedit_mode",
defined($o->{'uedit_mode'}) ? $o->{'uedit_mode'} : 0,
[ [ 0, $text{'acl_uedit_all'} ],
[ 1, $text{'acl_uedit_none'} ],
[ 6, $text{'acl_uedit_this'} ],
[ 2, $text{'acl_uedit_only'},
&ui_textbox("uedit_can",
$o->{'uedit_mode'} == 2 ? $o->{'uedit'} : "", 40).
" ".&user_chooser_button("uedit_can", 1) ],
[ 3, $text{'acl_uedit_except'},
&ui_textbox("uedit_cannot",
$o->{'uedit_mode'} == 3 ? $o->{'uedit'} : "", 40).
" ".&user_chooser_button("uedit_cannot", 1) ],
[ 4, $text{'acl_uedit_uid'},
&ui_textbox("uedit_uid",
$o->{'uedit_mode'} == 4 ? $o->{'uedit'} : "", 6).
" - ".&ui_textbox("uedit_uid2",
$o->{'uedit_mode'} == 4 ? $o->{'uedit2'} : "", 6) ],
[ 5, $text{'acl_uedit_group'},
&ui_textbox("uedit_group", $uedit_group, 40)." ".
&group_chooser_button("uedit_group", 1)."<br>\n".
&ui_checkbox("uedit_sec", 1, $text{'acl_uedit_sec'},
$o->{'uedit_sec'}) ],
[ 7, $text{'acl_uedit_re'},
&ui_textbox("uedit_re",
$o->{'uedit_mode'} == 7 ? $o->{'uedit_re'} : "", 40) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_ucreate'}</b></td> <td>\n";
printf "<input type=radio name=ucreate value=1 %s> $text{'yes'}\n",
$o->{'ucreate'} ? "checked" : "";
printf "<input type=radio name=ucreate value=0 %s> $text{'no'}</td>\n",
$o->{'ucreate'} ? "" : "checked";
print &ui_table_row($text{'acl_ucreate'},
&ui_yesno_radio("ucreate", $o->{'ucreate'}));
print &ui_table_row($text{'acl_batch'},
&ui_yesno_radio("batch", $o->{'batch'}));
print "<td><b>$text{'acl_batch'}</b></td> <td>\n";
printf "<input type=radio name=batch value=1 %s> $text{'yes'}\n",
$o->{'batch'} ? "checked" : "";
printf "<input type=radio name=batch value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'batch'} ? "" : "checked";
print &ui_table_row($text{'acl_home'},
&ui_textbox("home", $o->{'home'}, 40)." ".
&file_chooser_button("home", 1)."<br>\n".
&ui_checkbox("autohome", 1, $text{'acl_autohome'}, $o->{'autohome'}),
3);
print "<tr> <td valign=top><b>$text{'acl_home'}</b></td>\n";
printf "<td colspan=3><input name=home size=40 value='%s'> %s<br>\n",
$o->{'home'}, &file_chooser_button("home", 1);
printf "<input type=checkbox name=autohome value=1 %s> %s</td> </tr>\n",
$o->{'autohome'} ? "checked" : "",
$text{'acl_autohome'};
print &ui_table_row($text{'acl_uid'},
join("", map { &ui_checkbox($_, 1, $text{'acl_'.$_}, $o->{$_}) }
('umultiple', 'gmultiple')),
3);
print "<tr> <td valign=top><b>$text{'acl_uid'}</b></td>\n";
print "<td colspan=3>";
printf "<input type=checkbox name=umultiple value=1 %s> %s<br>\n",
$o->{'umultiple'} ? "checked" : "", $text{'acl_umultiple'};
printf "<input type=checkbox name=gmultiple value=1 %s> %s<br>\n",
$o->{'gmultiple'} ? "checked" : "", $text{'acl_gmultiple'};
print "</td> </tr>\n";
print &ui_table_hr();
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_row($text{'acl_gedit'},
&ui_radio_table("gedit_mode",
defined($o->{'gedit_mode'}) ? $o->{'gedit_mode'} : 0,
[ [ 0, $text{'acl_gedit_all'} ],
[ 1, $text{'acl_gedit_none'} ],
[ 2, $text{'acl_gedit_only'},
&ui_textbox("gedit_can",
$o->{'gedit_mode'} == 2 ? $o->{'gedit'} : "", 40).
" ".&group_chooser_button("gedit_can", 1) ],
[ 3, $text{'acl_gedit_except'},
&ui_textbox("gedit_cannot",
$o->{'gedit_mode'} == 3 ? $o->{'gedit'} : "", 40).
" ".&group_chooser_button("gedit_cannot", 1) ],
[ 4, $text{'acl_gedit_gid'},
&ui_textbox("gedit_gid",
$o->{'gedit_mode'} == 4 ? $o->{'gedit'} : "", 6).
" - ".&ui_textbox("gedit_gid2",
$o->{'gedit_mode'} == 4 ? $o->{'gedit2'} : "", 6) ] ], 1),
3);
print "<tr> <td valign=top><b>$text{'acl_gedit'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=gedit_mode value=0 %s> $text{'acl_gedit_all'}&nbsp;&nbsp;\n",
$o->{'gedit_mode'} == 0 ? "checked" : "";
printf "<input type=radio name=gedit_mode value=1 %s> $text{'acl_gedit_none'}<br>\n",
$o->{'gedit_mode'} == 1 ? "checked" : "";
printf "<input type=radio name=gedit_mode value=2 %s> $text{'acl_gedit_only'}\n",
$o->{'gedit_mode'} == 2 ? "checked" : "";
printf "<input name=gedit_can size=40 value='%s'> %s<br>\n",
$o->{'gedit_mode'} == 2 ? $o->{'gedit'} : "",
&group_chooser_button("gedit_can", 1);
printf "<input type=radio name=gedit_mode value=3 %s> $text{'acl_gedit_except'}\n",
$o->{'gedit_mode'} == 3 ? "checked" : "";
printf "<input name=gedit_cannot size=40 value='%s'> %s<br>\n",
$o->{'gedit_mode'} == 3 ? $o->{'gedit'} : "",
&group_chooser_button("gedit_cannot", 1);
printf "<input type=radio name=gedit_mode value=4 %s> $text{'acl_gedit_gid'}\n",
$o->{'gedit_mode'} == 4 ? "checked" : "";
printf "<input name=gedit_gid size=6 value='%s'> -\n",
$o->{'gedit_mode'} == 4 ? $o->{'gedit'} : "";
printf "<input name=gedit_gid2 size=6 value='%s'></td> </tr>\n",
$o->{'gedit_mode'} == 4 ? $o->{'gedit2'} : "";
print "<tr> <td><b>$text{'acl_gcreate'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=gcreate value=1 %s> $text{'yes'}\n",
$o->{'gcreate'}==1 ? "checked" : "";
printf "<input type=radio name=gcreate value=2 %s> $text{'acl_gnew'}\n",
$o->{'gcreate'}==2 ? "checked" : "";
printf "<input type=radio name=gcreate value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'gcreate'}==0 ? "checked" : "";
print &ui_table_row($text{'acl_gcreate'},
&ui_radio("gcreate", defined($o->{'gcreate'}) ? $o->{'gcreate'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_gnew'} ],
[ 0, $text{'no'} ] ]),
3);
}
# acl_security_save(&options)

View File

@@ -5,90 +5,55 @@ require 'lpadmin-lib.pl';
# Output HTML for editing security options for the lpadmin module
sub acl_security_form
{
print "<tr> <td valign=top><b>$text{'acl_printers'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input name=printers_def type=radio value=1 %s> %s\n",
$_[0]->{'printers'} eq '*' ? 'checked' : '', $text{'acl_pall'};
printf "<input name=printers_def type=radio value=0 %s> %s<br>\n",
$_[0]->{'printers'} eq '*' ? '' : 'checked', $text{'acl_psel'};
print "<select name=printers multiple size=4 width=15>\n";
local @plist = &list_printers();
local ($p, %pcan);
map { $pcan{$_}++ } split(/\s+/, $_[0]->{'printers'});
foreach $p (@plist) {
local $prn = &get_printer($p);
printf "<option value=%s %s>%s (%s)</option>\n",
$p, $pcan{$p} ? 'selected' : '',
$prn->{'desc'}, $p;
}
print "</select></td> </tr>\n";
my ($o) = @_;
my @plist = &list_printers();
my @popts = map {
my $prn = &get_printer($_);
[ $_, $prn->{'desc'}." ($_)" ]
} @plist;
print "<tr> <td valign=top><b>$text{'acl_cancel'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=cancel value=0 %s> $text{'no'}\n",
$_[0]->{'cancel'} == 0 ? "checked" : "";
printf "<input type=radio name=cancel value=1 %s> $text{'yes'}\n",
$_[0]->{'cancel'} == 1 ? "checked" : "";
printf "<input type=radio name=cancel value=2 %s> $text{'acl_listed'}<br>\n",
$_[0]->{'cancel'} == 2 ? "checked" : "";
print "<select name=jobs multiple size=4 width=15>\n";
map { $jcan{$_}++ } split(/\s+/, $_[0]->{'jobs'});
foreach $p (@plist) {
local $prn = &get_printer($p);
printf "<option value=%s %s>%s (%s)</option>\n",
$p, $jcan{$p} ? 'selected' : '',
$prn->{'desc'}, $p;
}
print "</select></td> </tr>\n";
print &ui_table_row($text{'acl_printers'},
&ui_radio("printers_def", $o->{'printers'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_pall'} ],
[ 0, $text{'acl_psel'} ] ])."<br>\n".
&ui_select("printers", [ split(/\s+/, $o->{'printers'}) ], \@popts, 4, 1),
3);
print "<tr> <td><b>$text{'acl_user'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=user_def value=1 %s> %s\n",
$_[0]->{'user'} eq '*' ? 'checked' : '', $text{'acl_user_all'};
printf "<input type=radio name=user_def value=2 %s> %s\n",
$_[0]->{'user'} ? '' : 'checked', $text{'acl_user_this'};
printf "<input type=radio name=user_def value=0 %s>\n",
$_[0]->{'user'} eq '*' || !$_[0]->{'user'} ? '' : 'checked';
printf "<input name=user size=13 value='%s'></td> </tr>\n",
$_[0]->{'user'} eq '*' || !$_[0]->{'user'} ? '' : $_[0]->{'user'};
print &ui_table_row($text{'acl_cancel'},
&ui_radio_table("cancel",
defined($o->{'cancel'}) ? $o->{'cancel'} : 0,
[ [ 0, $text{'no'} ],
[ 1, $text{'yes'} ],
[ 2, $text{'acl_listed'},
&ui_select("jobs", [ split(/\s+/, $o->{'jobs'}) ], \@popts, 4, 1) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_add'}</b></td>\n";
printf "<td><input type=radio name=add value=1 %s> $text{'yes'}\n",
$_[0]->{'add'} ? "checked" : "";
printf "<input type=radio name=add value=0 %s> $text{'no'}</td>\n",
$_[0]->{'add'} ? "" : "checked";
my $user_def = $o->{'user'} eq '*' ? 1 : $o->{'user'} ? 0 : 2;
print &ui_table_row($text{'acl_user'},
&ui_radio_table("user_def", $user_def,
[ [ 1, $text{'acl_user_all'} ],
[ 2, $text{'acl_user_this'} ],
[ 0, "", &ui_textbox("user",
$user_def == 0 ? $o->{'user'} : "", 13) ] ], 1),
3);
print "<td><b>$text{'acl_stop'}</b></td>\n";
printf "<td><input type=radio name=stop value=1 %s> $text{'yes'}\n",
$_[0]->{'stop'} == 1 ? "checked" : "";
printf "<input type=radio name=stop value=2 %s> $text{'acl_restart'}\n",
$_[0]->{'stop'} == 2 ? "checked" : "";
printf "<input type=radio name=stop value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'stop'} == 0 ? "checked" : "";
print &ui_table_row($text{'acl_add'},
&ui_yesno_radio("add", $o->{'add'}));
print &ui_table_row($text{'acl_stop'},
&ui_radio("stop", defined($o->{'stop'}) ? $o->{'stop'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_restart'} ],
[ 0, $text{'no'} ] ]));
print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
printf "<td><input type=radio name=view value=1 %s> $text{'yes'}\n",
$_[0]->{'view'} ? "checked" : "";
printf "<input type=radio name=view value=0 %s> $text{'no'}</td>\n",
$_[0]->{'view'} ? "" : "checked";
print &ui_table_row($text{'acl_view'},
&ui_yesno_radio("view", $o->{'view'}));
print &ui_table_row($text{'acl_test'},
&ui_yesno_radio("test", $o->{'test'}));
print "<td><b>$text{'acl_test'}</b></td>\n";
printf "<td><input type=radio name=test value=1 %s> $text{'yes'}\n",
$_[0]->{'test'} ? "checked" : "";
printf "<input type=radio name=test value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'test'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_delete'}</b></td>\n";
printf "<td><input type=radio name=delete value=1 %s> $text{'yes'}\n",
$_[0]->{'delete'} ? "checked" : "";
printf "<input type=radio name=delete value=0 %s> $text{'no'}</td>\n",
$_[0]->{'delete'} ? "" : "checked";
print "<td><b>$text{'acl_cluster'}</b></td>\n";
printf "<td><input type=radio name=cluster value=1 %s> $text{'yes'}\n",
$_[0]->{'cluster'} ? "checked" : "";
printf "<input type=radio name=cluster value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'cluster'} ? "" : "checked";
print "</tr>\n";
print &ui_table_row($text{'acl_delete'},
&ui_yesno_radio("delete", $o->{'delete'}));
print &ui_table_row($text{'acl_cluster'},
&ui_yesno_radio("cluster", $o->{'cluster'}));
}
# acl_security_save(&options)

View File

@@ -68,8 +68,21 @@ if ($in{'scale'}) {
else {
# Just output the attachment
print "X-no-links: 1\n";
$fn = $attach->{'filename'} ? &decode_mimewords($attach->{'filename'})
: "attachment";
$fn =~ s/[\r\n\0"\\\/]//g;
$fn ||= "attachment";
@download = split(/\t+/, $config{'download'});
if ($in{'type'}) {
if ($attach->{'type'} =~ /^image\/svg(\+xml)?/i ||
$in{'type'} =~ /^image\/svg(\+xml)?/i ||
$fn =~ /\.svgz?$/i) {
# SVG can execute scripts when served from the Webmin origin.
print "Content-Disposition: Attachment; filename=\"$fn\"\n"
if ($in{'save'});
print "Content-type: text/plain\n\n";
print $attach->{'data'};
}
elsif ($in{'type'}) {
# Display as a specific MIME type
print "Content-type: $in{'type'}\n\n";
print $attach->{'data'};
@@ -78,7 +91,7 @@ else {
# Auto-detect type
if ($in{'save'}) {
# Force download
print "Content-Disposition: Attachment; filename=\"$attach->{'filename'}\"\n";
print "Content-Disposition: Attachment; filename=\"$fn\"\n";
}
if ($attach->{'type'} eq 'message/delivery-status') {
print "Content-type: text/plain\n\n";

View File

@@ -37,6 +37,11 @@ foreach $a (@attach) {
else {
$fn = "file".(++$n).".".&type_to_extension($a->{'type'});
}
$fn =~ s/[\r\n\0]//g;
$fn =~ s/\\/\//g;
$fn =~ s/^.*\///g;
$fn =~ /^\.+$/ && ($fn = "");
$fn ||= "file".(++$n);
# Write the file
&open_tempfile(FILE, ">$temp/$fn", 0, 1);

View File

@@ -5,85 +5,63 @@ require 'mysql-lib.pl';
# Output HTML for editing security options for the mysql module
sub acl_security_form
{
print "<tr> <td valign=top rowspan=3><b>$text{'acl_dbs'}</b></td>\n";
print "<td rowspan=3 valign=top>\n";
printf "<input type=radio name=dbs_def value=1 %s> %s\n",
$_[0]->{'dbs'} eq '*' ? 'checked' : '', $text{'acl_dall'};
printf "<input type=radio name=dbs_def value=0 %s> %s<br>\n",
$_[0]->{'dbs'} eq '*' ? '' : 'checked', $text{'acl_dsel'};
print "<select name=dbs size=3 multiple width=100>\n";
map { $dcan{$_}++ } split(/\s+/, $_[0]->{'dbs'});
foreach $d (&list_databases()) {
printf "<option %s>%s</option>\n",
$dcan{$d} ? 'selected' : '', $d;
}
print "</select></td>\n";
my ($o) = @_;
my @dbs = &list_databases();
print "<td><b>$text{'acl_delete'}</b></td> <td>\n";
printf "<input type=radio name=delete value=1 %s> %s\n",
$_[0]->{'delete'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=delete value=0 %s> %s</td> </tr>\n",
$_[0]->{'delete'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_dbs'},
&ui_radio("dbs_def", $o->{'dbs'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_dall'} ],
[ 0, $text{'acl_dsel'} ] ])."<br>\n".
&ui_select("dbs", [ split(/\s+/, $o->{'dbs'}) ], \@dbs, 3, 1),
3);
print "<tr> <td><b>$text{'acl_stop'}</b></td> <td>\n";
printf "<input type=radio name=stop value=1 %s> %s\n",
$_[0]->{'stop'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=stop value=0 %s> %s</td> </tr>\n",
$_[0]->{'stop'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_delete'},
&ui_yesno_radio("delete", $o->{'delete'}));
print &ui_table_row($text{'acl_stop'},
&ui_yesno_radio("stop", $o->{'stop'}));
print &ui_table_row($text{'acl_edonly'},
&ui_yesno_radio("edonly", $o->{'edonly'}));
print "<tr> <td><b>$text{'acl_edonly'}</b></td> <td>\n";
printf "<input type=radio name=edonly value=1 %s> %s\n",
$_[0]->{'edonly'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=edonly value=0 %s> %s</td> </tr>\n",
$_[0]->{'edonly'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_indexes'},
&ui_yesno_radio("indexes", $o->{'indexes'}));
print &ui_table_row($text{'acl_views'},
&ui_yesno_radio("views", $o->{'views'}));
print "<tr> <td><b>$text{'acl_indexes'}</b></td>\n";
print "<td>",&ui_yesno_radio("indexes", $_[0]->{'indexes'}),"</td>\n";
print &ui_table_row($text{'acl_create'},
&ui_radio_table("create",
defined($o->{'create'}) ? $o->{'create'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_max'},
&ui_textbox("max", $o->{'max'}, 5) ],
[ 0, $text{'no'} ] ], 1),
3);
print "<td><b>$text{'acl_views'}</b></td>\n";
print "<td>",&ui_yesno_radio("views", $_[0]->{'views'}),"</td> </tr>\n";
print &ui_table_row($text{'acl_perms'},
&ui_radio("perms", defined($o->{'perms'}) ? $o->{'perms'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_only'} ],
[ 0, $text{'no'} ] ]),
3);
print "<tr> <td><b>$text{'acl_create'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=create value=1 %s> %s\n",
$_[0]->{'create'} == 1 ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=create value=2 %s> %s\n",
$_[0]->{'create'} == 2 ? 'checked' : '', $text{'acl_max'};
printf "<input name=max size=5 value='%s'>\n",
$_[0]->{'max'};
printf "<input type=radio name=create value=0 %s> %s</td> </tr>\n",
$_[0]->{'create'} == 0 ? 'checked' : '', $text{'no'};
print &ui_table_row($text{'acl_login'},
&ui_radio_table("user_def", $o->{'user'} ? 0 : 1,
[ [ 1, $text{'acl_user_def'} ],
[ 0, "",
$text{'acl_user'}." ".
&ui_textbox("user", $o->{'user'}, 10)." ".
$text{'acl_pass'}." ".
&ui_password("pass", $o->{'pass'}, 10) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_perms'}</b></td> <td colspan=3>\n";
printf "<input name=perms type=radio value=1 %s> %s\n",
$_[0]->{'perms'} == 1 ? 'checked' : '', $text{'yes'};
printf "<input name=perms type=radio value=2 %s> %s\n",
$_[0]->{'perms'} == 2 ? 'checked' : '', $text{'acl_only'};
printf "<input name=perms type=radio value=0 %s> %s\n",
$_[0]->{'perms'} == 0 ? 'checked' : '', $text{'no'};
print "</td> </tr>\n";
print "<tr> <td valign=top><b>$text{'acl_login'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=user_def value=1 %s> %s<br>\n",
$_[0]->{'user'} ? '' : 'checked', $text{'acl_user_def'};
printf "<input type=radio name=user_def value=0 %s>\n",
$_[0]->{'user'} ? 'checked' : '';
printf "%s <input name=user size=10 value='%s'>\n",
$text{'acl_user'}, $_[0]->{'user'};
printf "%s <input name=pass type=password size=10 value='%s'></td> </tr>\n",
$text{'acl_pass'}, $_[0]->{'pass'};
print "<tr> <td><b>$text{'acl_buser'}</b></td>\n";
printf "<td colspan=3><input type=radio name=buser_def value=1 %s> %s\n",
$_[0]->{'buser'} ? "" : "checked", $text{'acl_bnone'};
printf "<input type=radio name=buser_def value=0 %s>\n",
$_[0]->{'buser'} ? "checked" : "";
printf "<input name=buser size=8 value='%s'> %s</td> </tr>\n",
$_[0]->{'buser'}, &user_chooser_button("buser");
print "<tr> <td><b>$text{'acl_bpath'}</b></td>\n";
printf "<td colspan=3><input name=bpath size=40 value='%s'> %s</td> </tr>\n",
$_[0]->{'bpath'}, &file_chooser_button("bpath", 1);
print &ui_table_row($text{'acl_buser'},
&ui_opt_textbox("buser", $o->{'buser'}, 8, $text{'acl_bnone'})." ".
&user_chooser_button("buser"),
3);
print &ui_table_row($text{'acl_bpath'},
&ui_textbox("bpath", $o->{'bpath'}, 40)." ".
&file_chooser_button("bpath", 1),
3);
}
# acl_security_save(&options)

View File

@@ -5,108 +5,62 @@ require 'postgresql-lib.pl';
# Output HTML for editing security options for the postgresql module
sub acl_security_form
{
my (@listdb)=&list_databases();
print "<tr> <td valign=top rowspan=4><b>$text{'acl_dbs'}</b>\n";
print "<br>$text{'acl_dbscannot'}" unless @listdb;
print "</td>\n";
print "<td rowspan=4 valign=top>\n";
my ($o) = @_;
my @listdb = &list_databases();
if (@listdb) {
printf "<input type=radio name=dbs_def value=1 %s> %s\n",
$_[0]->{'dbs'} eq '*' ? 'checked' : '', $text{'acl_dall'};
printf "<input type=radio name=dbs_def value=0 %s> %s<br>\n",
$_[0]->{'dbs'} eq '*' ? '' : 'checked', $text{'acl_dsel'};
print "<select name=dbs size=5 multiple width=100>\n";
map { $dcan{$_}++ } split(/\s+/, $_[0]->{'dbs'});
foreach $d (@listdb) {
printf "<option %s>%s</option>\n",
$dcan{$d} ? 'selected' : '', $d;
}
print "</select>";
print "<input type=hidden name=dblist value=\"1\">\n";
}
else {
print "<input type=hidden name=dblist value=\"0 ".$_[0]->{'dbs'}."\">\n";
print &ui_table_row($text{'acl_dbs'},
&ui_radio("dbs_def", $o->{'dbs'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_dall'} ],
[ 0, $text{'acl_dsel'} ] ])."<br>\n".
&ui_select("dbs", [ split(/\s+/, $o->{'dbs'}) ], \@listdb, 5, 1).
&ui_hidden("dblist", "1"),
3);
}
else {
print &ui_table_row($text{'acl_dbs'},
$text{'acl_dbscannot'}.&ui_hidden("dblist", "0 ".$o->{'dbs'}),
3);
}
print "</td>\n";
print "<td><b>$text{'acl_create'}</b></td> <td>\n";
printf "<input type=radio name=create value=1 %s> %s\n",
$_[0]->{'create'} == 1 ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=create value=2 %s> %s\n",
$_[0]->{'create'} == 2 ? 'checked' : '', $text{'acl_max'};
printf "<input name=max size=5 value='%s'>\n",
$_[0]->{'max'};
printf "<input type=radio name=create value=0 %s> %s</td> </tr>\n",
$_[0]->{'create'} == 0 ? 'checked' : '', $text{'no'};
print &ui_table_row($text{'acl_create'},
&ui_radio_table("create",
defined($o->{'create'}) ? $o->{'create'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_max'}, &ui_textbox("max", $o->{'max'}, 5) ],
[ 0, $text{'no'} ] ], 1),
3);
print "<tr> <td><b>$text{'acl_delete'}</b></td> <td>\n";
printf "<input type=radio name=delete value=1 %s> %s\n",
$_[0]->{'delete'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=delete value=0 %s> %s</td> </tr>\n",
$_[0]->{'delete'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_delete'},
&ui_yesno_radio("delete", $o->{'delete'}));
print &ui_table_row($text{'acl_stop'},
&ui_yesno_radio("stop", $o->{'stop'}));
print &ui_table_row($text{'acl_users'},
&ui_yesno_radio("users", $o->{'users'}));
print "<tr> <td><b>$text{'acl_stop'}</b></td> <td>\n";
printf "<input type=radio name=stop value=1 %s> %s\n",
$_[0]->{'stop'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=stop value=0 %s> %s</td> </tr>\n",
$_[0]->{'stop'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_login'},
&ui_radio_table("user_def", $o->{'user'} ? 0 : 1,
[ [ 1, $text{'acl_user_def'} ],
[ 0, "",
$text{'acl_user'}." ".&ui_textbox("user", $o->{'user'}, 10)." ".
$text{'acl_pass'}." ".&ui_password("pass", $o->{'pass'}, 10)."<br>\n".
&ui_checkbox("sameunix", 1, $text{'acl_sameunix'}, $o->{'sameunix'}) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_users'}</b></td> <td>\n";
printf "<input type=radio name=users value=1 %s> %s\n",
$_[0]->{'users'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=users value=0 %s> %s</td> </tr>\n",
$_[0]->{'users'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_backup'},
&ui_yesno_radio("backup", $o->{'backup'}));
print &ui_table_row($text{'acl_restore'},
&ui_yesno_radio("restore", $o->{'restore'}));
print "<tr> <td valign=top><b>$text{'acl_login'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=user_def value=1 %s> %s<br>\n",
$_[0]->{'user'} ? '' : 'checked', $text{'acl_user_def'};
printf "<input type=radio name=user_def value=0 %s>\n",
$_[0]->{'user'} ? 'checked' : '';
printf "%s <input name=user size=10 value='%s'>\n",
$text{'acl_user'}, $_[0]->{'user'};
printf "%s <input name=pass type=password size=10 value='%s'><br>\n",
$text{'acl_pass'}, $_[0]->{'pass'};
print "&nbsp;&nbsp;&nbsp;\n";
printf "<input type=checkbox name=sameunix value=1 %s> %s</td> </tr>\n",
$_[0]->{'sameunix'} ? "checked" : "", $text{'acl_sameunix'};
print &ui_table_row($text{'acl_cmds'},
&ui_yesno_radio("cmds", $o->{'cmds'}));
print &ui_table_row($text{'acl_views'},
&ui_yesno_radio("views", $o->{'views'}));
print "<tr> <td><b>$text{'acl_backup'}</b></td> <td>\n";
printf "<input type=radio name=backup value=1 %s> %s\n",
$_[0]->{'backup'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=backup value=0 %s> %s</td>\n",
$_[0]->{'backup'} ? '' : 'checked', $text{'no'};
print "<td><b>$text{'acl_restore'}</b></td> <td>\n";
printf "<input type=radio name=restore value=1 %s> %s\n",
$_[0]->{'restore'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=restore value=0 %s> %s</td> </tr>\n",
$_[0]->{'restore'} ? '' : 'checked', $text{'no'};
print "<tr> <td valign=top><b>$text{'acl_cmds'}</b></td> <td>\n";
printf "<input type=radio name=cmds value=1 %s> %s\n",
$_[0]->{'cmds'} ? "checked" : "", $text{'yes'};
printf "<input type=radio name=cmds value=0 %s> %s</td>\n",
$_[0]->{'cmds'} ? "" : "checked", $text{'no'};
print "<td><b>$text{'acl_views'}</b></td> <td>\n";
printf "<input type=radio name=views value=1 %s> %s\n",
$_[0]->{'views'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=views value=0 %s> %s</td> </tr>\n",
$_[0]->{'views'} ? '' : 'checked', $text{'no'};
print "<tr> <td valign=top><b>$text{'acl_indexes'}</b></td> <td>\n";
printf "<input type=radio name=indexes value=1 %s> %s\n",
$_[0]->{'indexes'} ? "checked" : "", $text{'yes'};
printf "<input type=radio name=indexes value=0 %s> %s</td>\n",
$_[0]->{'indexes'} ? "" : "checked", $text{'no'};
print "<td><b>$text{'acl_seqs'}</b></td> <td>\n";
printf "<input type=radio name=seqs value=1 %s> %s\n",
$_[0]->{'seqs'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=seqs value=0 %s> %s</td> </tr>\n",
$_[0]->{'seqs'} ? '' : 'checked', $text{'no'};
print "</tr>\n";
print &ui_table_row($text{'acl_indexes'},
&ui_yesno_radio("indexes", $o->{'indexes'}));
print &ui_table_row($text{'acl_seqs'},
&ui_yesno_radio("seqs", $o->{'seqs'}));
}
# acl_security_save(&options)

View File

@@ -5,222 +5,83 @@ require 'samba-lib.pl';
# Output HTML for editing security options for the samba module
sub acl_security_form
{
print "<tr>\n<td><b>$text{'acl_apply'}</b></td> <td>\n";
printf "<input type=radio name=apply value=1 %s> $text{'yes'}\n",
$_[0]->{'apply'} ? "checked" : "";
printf "<input type=radio name=apply value=0 %s> $text{'no'}</td>\n",
$_[0]->{'apply'} ? "" : "checked";
print "</tr>\n";
my ($o) = @_;
print "<tr>\n<td><b>$text{'acl_view_all_con'}</b></td> <td>\n";
printf "<input type=radio name=view_all_con value=1 %s> $text{'yes'}\n",
$_[0]->{'view_all_con'} ? "checked" : "";
printf "<input type=radio name=view_all_con value=0 %s> $text{'no'}</td>\n",
$_[0]->{'view_all_con'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_kill_con'}</b></td> <td>\n";
printf "<input type=radio name=kill_con value=1 %s> $text{'yes'}\n",
$_[0]->{'kill_con'} ? "checked" : "";
printf "<input type=radio name=kill_con value=0 %s> $text{'no'}</td>\n",
$_[0]->{'kill_con'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_conf_net'}</b></td> <td>\n";
printf "<input type=radio name=conf_net value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_net'} ? "checked" : "";
printf "<input type=radio name=conf_net value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_net'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_conf_smb'}</b></td> <td>\n";
printf "<input type=radio name=conf_smb value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_smb'} ? "checked" : "";
printf "<input type=radio name=conf_smb value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_smb'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_conf_pass'}</b></td> <td>\n";
printf "<input type=radio name=conf_pass value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_pass'} ? "checked" : "";
printf "<input type=radio name=conf_pass value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_pass'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_conf_print'}</b></td> <td>\n";
printf "<input type=radio name=conf_print value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_print'} ? "checked" : "";
printf "<input type=radio name=conf_print value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_print'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_conf_misc'}</b></td> <td>\n";
printf "<input type=radio name=conf_misc value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_misc'} ? "checked" : "";
printf "<input type=radio name=conf_misc value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_misc'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_swat'}</b></td> <td>\n";
printf "<input type=radio name=swat value=1 %s> $text{'yes'}\n",
$_[0]->{'swat'} ? "checked" : "";
printf "<input type=radio name=swat value=0 %s> $text{'no'}</td>\n",
$_[0]->{'swat'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_manual'}</b></td> <td>\n";
printf "<input type=radio name=manual value=1 %s> $text{'yes'}\n",
$_[0]->{'manual'} ? "checked" : "";
printf "<input type=radio name=manual value=0 %s> $text{'no'}</td>\n",
$_[0]->{'manual'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_winbind'}</b></td> <td>\n";
printf "<input type=radio name=winbind value=1 %s> $text{'yes'}\n",
$_[0]->{'winbind'} ? "checked" : "";
printf "<input type=radio name=winbind value=0 %s> $text{'no'}</td>\n",
$_[0]->{'winbind'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_bind'}</b></td> <td>\n";
printf "<input type=radio name=conf_bind value=1 %s> $text{'yes'}\n",
$_[0]->{'conf_bind'} ? "checked" : "";
printf "<input type=radio name=conf_bind value=0 %s> $text{'no'}</td>\n",
$_[0]->{'conf_bind'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# encripted passwords
print "<tr>\n<td $tb><b>$text{'acl_enc_passwd_opts'}</b></td></tr> \n";
print "<tr>\n<td><b>$text{'acl_view_users'}</b></td> <td>\n";
printf "<input type=radio name=view_users value=1 %s> $text{'yes'}\n",
$_[0]->{'view_users'} ? "checked" : "";
printf "<input type=radio name=view_users value=0 %s> $text{'no'}</td>\n",
$_[0]->{'view_users'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_maint_users'}</b></td> <td>\n";
printf "<input type=radio name=maint_users value=1 %s> $text{'yes'}\n",
$_[0]->{'maint_users'} ? "checked" : "";
printf "<input type=radio name=maint_users value=0 %s> $text{'no'}</td>\n",
$_[0]->{'maint_users'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_maint_makepass'}</b></td> <td>\n";
printf "<input type=radio name=maint_makepass value=1 %s> $text{'yes'}\n",
$_[0]->{'maint_makepass'} ? "checked" : "";
printf "<input type=radio name=maint_makepass value=0 %s> $text{'no'}</td>\n",
$_[0]->{'maint_makepass'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_maint_sync'}</b></td> <td>\n";
printf "<input type=radio name=maint_sync value=1 %s> $text{'yes'}\n",
$_[0]->{'maint_sync'} ? "checked" : "";
printf "<input type=radio name=maint_sync value=0 %s> $text{'no'}</td>\n",
$_[0]->{'maint_sync'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# encripted passwords
print "<tr>\n<td $tb><b>$text{'acl_group_opts'}</b></td></tr> \n";
print "<tr>\n<td><b>$text{'acl_maint_groups'}</b></td> <td>\n";
printf "<input type=radio name=maint_groups value=1 %s> $text{'yes'}\n",
$_[0]->{'maint_groups'} ? "checked" : "";
printf "<input type=radio name=maint_groups value=0 %s> $text{'no'}</td>\n",
$_[0]->{'maint_groups'} ? "" : "checked";
print "</tr>\n";
print "<tr>\n<td><b>$text{'acl_maint_gsync'}</b></td> <td>\n";
printf "<input type=radio name=maint_gsync value=1 %s> $text{'yes'}\n",
$_[0]->{'maint_gsync'} ? "checked" : "";
printf "<input type=radio name=maint_gsync value=0 %s> $text{'no'}</td>\n",
$_[0]->{'maint_gsync'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# hide
print "<tr>\n<td><b>$text{'acl_hide'}</b></td> <td>\n";
printf "<input type=radio name=hide value=1 %s> $text{'yes'}\n",
$_[0]->{'hide'} == 1 ? "checked" : "";
printf "<input type=radio name=hide value=0 %s> $text{'no'}</td>\n",
$_[0]->{'hide'} == 0 ? "checked" : "";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# global acls
print "<tr>\n<td><b>$text{'acl_afs'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_fs value=1 %s> %s\n",
$_[0]->{'c_fs'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_fs value=1 %s> %s\n",
$_[0]->{'r_fs'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_fs value=1 %s> %s\n",
$_[0]->{'w_fs'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_aps'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=checkbox name=c_ps value=1 %s> %s\n",
$_[0]->{'c_ps'} ? "checked" : "", $text{"acl_c"};
printf "<input type=checkbox name=r_ps value=1 %s> %s\n",
$_[0]->{'r_ps'} ? "checked" : "", $text{"acl_r"};
printf "<input type=checkbox name=w_ps value=1 %s> %s\n",
$_[0]->{'w_ps'} ? "checked" : "", $text{"acl_w"};
print "</td> </tr>\n";
print "<tr>\n<td><b>$text{'acl_copy'}</b></td> <td>\n";
printf "<input type=radio name=copy value=1 %s> $text{'yes'}\n",
$_[0]->{'copy'} ? "checked" : "";
printf "<input type=radio name=copy value=0 %s> $text{'no'}</td>\n",
$_[0]->{'copy'} ? "" : "checked";
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# per-share acls
print "<tr><td><b>$text{'acl_per_fs_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_fs_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_fs_acls'} ? "checked" : "";
printf "<input type=radio name=per_fs_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_fs_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr><td><b>$text{'acl_per_ps_acls'}</b></td> <td>\n";
printf "<input type=radio name=per_ps_acls value=1 %s> $text{'yes'}\n",
$_[0]->{'per_ps_acls'} ? "checked" : "";
printf "<input type=radio name=per_ps_acls value=0 %s> $text{'no'}\n",
$_[0]->{'per_ps_acls'} ? "" : "checked";
print "</td></tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
# table
print "<tr> <td colspan=4>\n<table border width=100%>\n";
printf "<th $tb colspan=7><b>%s</b></th>\n", $text{'acl_per_share_acls'};
print "<tr $tb>\n";
printf "<td rowspan=2><b>%s</b></td>\n", $text{'acl_sname'};
printf "<td rowspan=2><b>%s</b></td>\n", $text{'acl_saccess'};
printf "<td rowspan=2><b>%s</b></td>\n", $text{'acl_sconn'};
printf "<th colspan=4><b>%s</b></th>\n", $text{'acl_sopthdr'};
print "</tr>\n<tr $tb>\n";
printf "<td><b>%s</b></td>\n", $text{'acl_ssec'};
printf "<td><b>%s</b></td>\n", $text{'acl_sperm'};
printf "<td><b>%s</b></td>\n", $text{'acl_snaming'};
printf "<td><b>%s<br>%s</b></td>\n", $text{'acl_smisc'}, $text{'acl_sprn'};
print "</tr>\n";
foreach (&list_shares()) {
&display_acl_row($_[0], $_);
foreach my $f ('apply', 'view_all_con', 'kill_con') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print "</table> </td> </tr>\n";
print &ui_table_hr();
foreach my $f ('conf_net', 'conf_smb', 'conf_pass', 'conf_print',
'conf_misc', 'swat', 'manual', 'winbind') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print &ui_table_row($text{'acl_bind'},
&ui_yesno_radio("conf_bind", $o->{'conf_bind'}));
print &ui_table_hr();
print &ui_table_span($text{'acl_enc_passwd_opts'});
foreach my $f ('view_users', 'maint_users', 'maint_makepass', 'maint_sync') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print &ui_table_hr();
print &ui_table_span($text{'acl_group_opts'});
foreach my $f ('maint_groups', 'maint_gsync') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print &ui_table_hr();
print &ui_table_row($text{'acl_hide'},
&ui_yesno_radio("hide", defined($o->{'hide'}) ? $o->{'hide'} : 0));
print &ui_table_hr();
print &ui_table_row($text{'acl_afs'},
join("", map { &ui_checkbox($_."_fs", 1, $text{"acl_".$_}, $o->{$_."_fs"}) }
qw(c r w)),
3);
print &ui_table_row($text{'acl_aps'},
join("", map { &ui_checkbox($_."_ps", 1, $text{"acl_".$_}, $o->{$_."_ps"}) }
qw(c r w)),
3);
print &ui_table_row($text{'acl_copy'},
&ui_yesno_radio("copy", $o->{'copy'}));
print &ui_table_hr();
print &ui_table_row($text{'acl_per_fs_acls'},
&ui_yesno_radio("per_fs_acls", $o->{'per_fs_acls'}));
print &ui_table_row($text{'acl_per_ps_acls'},
&ui_yesno_radio("per_ps_acls", $o->{'per_ps_acls'}));
print &ui_table_hr();
my @heads = (
$text{'acl_sname'},
$text{'acl_saccess'},
$text{'acl_sconn'},
$text{'acl_ssec'},
$text{'acl_sperm'},
$text{'acl_snaming'},
$text{'acl_smisc'}." / ".$text{'acl_sprn'},
);
my $stable = &ui_columns_start(\@heads, 100);
foreach (&list_shares()) {
$stable .= &display_acl_row($o, $_);
}
$stable .= &ui_columns_end();
print &ui_table_row($text{'acl_per_share_acls'}, $stable, 3);
}
# acl_security_save(&options)
@@ -285,25 +146,23 @@ local %share;
local $stype=&istrue('printable') ? 'ps' : 'fs';
local $aclname='ACL' . $stype . '_' . $name;
#display row
print "<tr>\n";
printf $stype eq 'fs' ? "<td><b>%s</b></td>\n" :
"<td><b><i>%s</i></td>\n", $name;
&display_acl_cell($acc, $name, 'r', 'w', $aclname,
$text{'acl_na'}, $text{'acl_r1'}, $text{'acl_rw'});
&display_acl_cell($acc, $name, 'v', 'V', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_kill'});
&display_acl_cell($acc, $name, 's', 'S', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'});
$stype eq 'fs' ? &display_acl_cell($acc, $name, 'p', 'P', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'}) :
print "<td> </td>\n";
$stype eq 'fs' ? &display_acl_cell($acc, $name, 'n', 'N', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'}) :
print "<td> </td>\n";
&display_acl_cell($acc, $name, 'o', 'O', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'});
print "</tr>\n";
return &ui_columns_row([
$stype eq 'fs' ? "<b>$name</b>" : "<i>$name</i>",
&display_acl_cell($acc, $name, 'r', 'w', $aclname,
$text{'acl_na'}, $text{'acl_r1'}, $text{'acl_rw'}),
&display_acl_cell($acc, $name, 'v', 'V', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_kill'}),
&display_acl_cell($acc, $name, 's', 'S', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'}),
$stype eq 'fs' ? &display_acl_cell($acc, $name, 'p', 'P', $aclname,
$text{'acl_na'}, $text{'acl_view'},
$text{'acl_edit'}) : "",
$stype eq 'fs' ? &display_acl_cell($acc, $name, 'n', 'N', $aclname,
$text{'acl_na'}, $text{'acl_view'},
$text{'acl_edit'}) : "",
&display_acl_cell($acc, $name, 'o', 'O', $aclname,
$text{'acl_na'}, $text{'acl_view'}, $text{'acl_edit'}),
]);
}
#display_acl_cell(\%access, $name,
@@ -313,29 +172,12 @@ sub display_acl_cell
{
local ($acc, $name, $rp, $wp, $aclname, $text1, $text2, $text3) = @_;
local $rn = $rp . $wp . '_' . $aclname;
print "<td>\n";
if($acc->{$aclname}) {
printf "<input type=radio name=$rn value='' %s> %s<br>\n",
!&perm_to($rp, $acc, $aclname) ?
"checked" : "", $text1;
printf "<input type=radio name=$rn value='$rp' %s> %s<br>\n",
&perm_to($rp, $acc, $aclname) &&
!&perm_to($rp.$wp, $acc, $aclname) ?
"checked" : "",$text2;
printf "<input type=radio name=$rn value='$rp$wp' %s> %s\n",
&perm_to($rp.$wp, $acc, $aclname) ?
"checked" : "", $text3;
}
else {
printf "<input type=radio name=$rn value='' checked> %s<br>\n",
$text1;
printf "<input type=radio name=$rn value='$rp'> %s<br>\n",
$text2;
printf "<input type=radio name=$rn value='$rp$wp'> %s\n",
$text3;
}
print "</td>\n";
my $sel = !$acc->{$aclname} || !&perm_to($rp, $acc, $aclname) ? '' :
&perm_to($rp.$wp, $acc, $aclname) ? $rp.$wp : $rp;
return &ui_radio($rn, $sel,
[ [ '', $text1."<br>" ],
[ $rp, $text2."<br>" ],
[ $rp.$wp, $text3 ] ]);
}
# perm_to($permissions_string,\%access,$ACLname)

View File

@@ -5,202 +5,112 @@ require 'sendmail-lib.pl';
# Output HTML for editing security options for the sendmail module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_opts'}</b></td> <td>\n";
printf "<input type=radio name=opts value=1 %s> $text{'yes'}\n",
$_[0]->{'opts'} ? "checked" : "";
printf "<input type=radio name=opts value=0 %s> $text{'no'}</td>\n",
$_[0]->{'opts'} ? "" : "checked";
my ($o) = @_;
print "<td><b>$text{'acl_cws'}</b></td> <td>\n";
printf "<input type=radio name=cws value=1 %s> $text{'yes'}\n",
$_[0]->{'cws'} ? "checked" : "";
printf "<input type=radio name=cws value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'cws'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_masq'}</b></td> <td>\n";
printf "<input type=radio name=masq value=1 %s> $text{'yes'}\n",
$_[0]->{'masq'} ? "checked" : "";
printf "<input type=radio name=masq value=0 %s> $text{'no'}</td>\n",
$_[0]->{'masq'} ? "" : "checked";
print "<td><b>$text{'acl_trusts'}</b></td> <td>\n";
printf "<input type=radio name=trusts value=1 %s> $text{'yes'}\n",
$_[0]->{'trusts'} ? "checked" : "";
printf "<input type=radio name=trusts value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'trusts'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_cgs'}</b></td> <td>\n";
printf "<input type=radio name=cgs value=1 %s> $text{'yes'}\n",
$_[0]->{'cgs'} ? "checked" : "";
printf "<input type=radio name=cgs value=0 %s> $text{'no'}</td>\n",
$_[0]->{'cgs'} ? "" : "checked";
print "<td><b>$text{'acl_relay'}</b></td> <td>\n";
printf "<input type=radio name=relay value=1 %s> $text{'yes'}\n",
$_[0]->{'relay'} ? "checked" : "";
printf "<input type=radio name=relay value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'relay'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_mailers'}</b></td> <td>\n";
printf "<input type=radio name=mailers value=1 %s> $text{'yes'}\n",
$_[0]->{'mailers'} ? "checked" : "";
printf "<input type=radio name=mailers value=0 %s> $text{'no'}</td>\n",
$_[0]->{'mailers'} ? "" : "checked";
print "<td><b>$text{'acl_access'}</b></td> <td>\n";
printf "<input type=radio name=access value=1 %s> $text{'yes'}\n",
$_[0]->{'access'} ? "checked" : "";
printf "<input type=radio name=access value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'access'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_domains'}</b></td> <td>\n";
printf "<input type=radio name=domains value=1 %s> $text{'yes'}\n",
$_[0]->{'domains'} ? "checked" : "";
printf "<input type=radio name=domains value=0 %s> $text{'no'}</td>\n",
$_[0]->{'domains'} ? "" : "checked";
print "<td><b>$text{'acl_stop'}</b></td> <td>\n";
printf "<input type=radio name=stop value=1 %s> $text{'yes'}\n",
$_[0]->{'stop'} ? "checked" : "";
printf "<input type=radio name=stop value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'stop'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_manual'}</b></td> <td>\n";
printf "<input type=radio name=manual value=1 %s> $text{'yes'}\n",
$_[0]->{'manual'} ? "checked" : "";
printf "<input type=radio name=manual value=0 %s> $text{'no'}</td>\n",
$_[0]->{'manual'} ? "" : "checked";
print "<td><b>$text{'acl_mailq'}</b></td> <td><select name=mailq>\n";
printf "<option value=2 %s>$text{'acl_viewdel'}</option>\n",
$_[0]->{'mailq'} == 2 ? "selected" : "";
printf "<option value=1 %s>$text{'acl_view'}</option>\n",
$_[0]->{'mailq'} == 1 ? "selected" : "";
printf "<option value=0 %s>$text{'no'}</option>\n",
$_[0]->{'mailq'} == 0 ? "selected" : "";
print "</select></td> </tr>\n";
print "<tr> <td><b>$text{'acl_qdoms'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=qdoms_def value=1 %s> %s\n",
$_[0]->{'qdoms'} ? "" : "checked", $text{'acl_all'};
printf "<input type=radio name=qdoms_def value=0 %s> %s\n",
$_[0]->{'qdoms'} ? "checked" : "", $text{'acl_matching'};
printf "<input name=qdoms size=40 value='%s'></td> </tr>\n",
$_[0]->{'qdoms'};
print "<tr> <td><b>$text{'acl_qdomsmode'}</b></td> <td colspan=3>\n";
foreach $m (0 .. 2) {
printf "<input type=radio name=qdomsmode value=%s %s> %s\n",
$m, $_[0]->{'qdomsmode'} == $m ? "checked" : "",
$text{'acl_qdomsmode'.$m};
foreach my $f ('opts', 'cws', 'masq', 'trusts', 'cgs', 'relay',
'mailers', 'access', 'domains', 'stop', 'manual') {
print &ui_table_row($text{'acl_'.$f},
&ui_yesno_radio($f, $o->{$f}));
}
print "</td> </tr>\n";
print "<tr> <td><b>$text{'acl_flushq'}</b></td> <td>\n";
printf "<input type=radio name=flushq value=1 %s> $text{'yes'}\n",
$_[0]->{'flushq'} ? "checked" : "";
printf "<input type=radio name=flushq value=0 %s> $text{'no'}</td>\n",
$_[0]->{'flushq'} ? "" : "checked";
print &ui_table_row($text{'acl_mailq'},
&ui_select("mailq",
defined($o->{'mailq'}) && $o->{'mailq'} ne '' ? $o->{'mailq'} : 0,
[ [ 2, $text{'acl_viewdel'} ],
[ 1, $text{'acl_view'} ],
[ 0, $text{'no'} ] ]));
print "<td><b>$text{'acl_ports'}</b></td> <td>\n";
printf "<input type=radio name=ports value=1 %s> $text{'yes'}\n",
$_[0]->{'ports'} ? "checked" : "";
printf "<input type=radio name=ports value=0 %s> $text{'no'}</td>\n",
$_[0]->{'ports'} ? "" : "checked";
print &ui_table_row($text{'acl_qdoms'},
&ui_radio_table("qdoms_def", $o->{'qdoms'} ? 0 : 1,
[ [ 1, $text{'acl_all'} ],
[ 0, $text{'acl_matching'},
&ui_textbox("qdoms", $o->{'qdoms'}, 40) ] ], 1),
3);
# Virtusers
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_row($text{'acl_qdomsmode'},
&ui_radio("qdomsmode",
defined($o->{'qdomsmode'}) ? $o->{'qdomsmode'} : 0,
[ map { [ $_, $text{'acl_qdomsmode'.$_} ] } 0 .. 2 ]),
3);
print "<tr> <td valign=top><b>$text{'acl_virtusers'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=vmode value=0 %s> $text{'acl_none'}\n",
$_[0]->{'vmode'} == 0 ? "checked" : "";
printf "<input type=radio name=vmode value=1 %s> $text{'acl_all'}\n",
$_[0]->{'vmode'} == 1 ? "checked" : "";
printf "<input type=radio name=vmode value=3 %s> $text{'acl_vsame'}<br>\n",
$_[0]->{'vmode'} == 3 ? "checked" : "";
printf "<input type=radio name=vmode value=2 %s> $text{'acl_matching'}\n",
$_[0]->{'vmode'} == 2 ? "checked" : "";
printf "<input name=vaddrs size=40 value='%s'></td> </tr>\n",
$_[0]->{'vaddrs'};
print &ui_table_row($text{'acl_flushq'},
&ui_yesno_radio("flushq", $o->{'flushq'}));
print &ui_table_row($text{'acl_ports'},
&ui_yesno_radio("ports", $o->{'ports'}));
print "<tr> <td><b>$text{'acl_vtypes'}</b></td>\n";
print "<td colspan=3>\n";
for($n=0; $n<3; $n++) {
printf "<input type=checkbox name=vedit_%s value=1 %s> %s\n",
$n, $_[0]->{"vedit_$n"} ? "checked" : "", $text{"acl_vtype$n"};
}
print "</td> </tr>\n";
print &ui_table_hr();
print "<tr> <td><b>$text{'acl_vmax'}</b></td>\n";
printf "<td><input type=radio name=vmax_def value=1 %s> %s\n",
$_[0]->{'vmax'} ? "" : "checked", $text{'acl_unlimited'};
printf "<input type=radio name=vmax_def value=0 %s>\n",
$_[0]->{'vmax'} ? "checked" : "";
printf "<input name=vmax size=5 value='%s'></td>\n",
$_[0]->{'vmax'};
print &ui_table_row($text{'acl_virtusers'},
&ui_radio_table("vmode",
defined($o->{'vmode'}) ? $o->{'vmode'} : 0,
[ [ 0, $text{'acl_none'} ],
[ 1, $text{'acl_all'} ],
[ 3, $text{'acl_vsame'} ],
[ 2, $text{'acl_matching'},
&ui_textbox("vaddrs", $o->{'vaddrs'}, 40) ] ], 1),
3);
print "<td><b>$text{'acl_vcatchall'}</b></td>\n";
print "<td>",&ui_yesno_radio("vcatchall",
int($_[0]->{'vcatchall'})),"</td> </tr>\n";
print &ui_table_row($text{'acl_vtypes'},
join("", map { &ui_checkbox("vedit_".$_, 1, $text{"acl_vtype".$_},
$o->{"vedit_".$_}) } 0 .. 2),
3);
# Aliases
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_row($text{'acl_vmax'},
&ui_radio_table("vmax_def", $o->{'vmax'} ? 0 : 1,
[ [ 1, $text{'acl_unlimited'} ],
[ 0, "", &ui_textbox("vmax", $o->{'vmax'}, 5) ] ], 1),
3);
print "<tr> <td valign=top><b>$text{'acl_aliases'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=amode value=0 %s> $text{'acl_none'}\n",
$_[0]->{'amode'} == 0 ? "checked" : "";
printf "<input type=radio name=amode value=1 %s> $text{'acl_all'}\n",
$_[0]->{'amode'} == 1 ? "checked" : "";
printf "<input type=radio name=amode value=3 %s> $text{'acl_asame'}<br>\n",
$_[0]->{'amode'} == 3 ? "checked" : "";
printf "<input type=radio name=amode value=2 %s> $text{'acl_matching'}\n",
$_[0]->{'amode'} == 2 ? "checked" : "";
printf "<input name=aliases size=40 value='%s'></td> </tr>\n",
$_[0]->{'aliases'};
print &ui_table_row($text{'acl_vcatchall'},
&ui_yesno_radio("vcatchall", int($o->{'vcatchall'})));
print "<tr> <td><b>$text{'acl_atypes'}</b></td> <td colspan=3>\n";
for($n=1; $n<=6; $n++) {
printf "<input type=checkbox name=aedit_%s value=1 %s> %s\n",
$n, $_[0]->{"aedit_$n"} ? "checked" : "",
$text{"acl_atype$n"};
}
print "</td> </tr>\n";
print &ui_table_hr();
print "<tr> <td><b>$text{'acl_amax'}</b></td>\n";
printf "<td colspan=3><input type=radio name=amax_def value=1 %s> %s\n",
$_[0]->{'amax'} ? "" : "checked", $text{'acl_unlimited'};
printf "<input type=radio name=amax_def value=0 %s>\n",
$_[0]->{'amax'} ? "checked" : "";
printf "<input name=amax size=5 value='%s'></td> </tr>\n",
$_[0]->{'amax'};
print &ui_table_row($text{'acl_aliases'},
&ui_radio_table("amode",
defined($o->{'amode'}) ? $o->{'amode'} : 0,
[ [ 0, $text{'acl_none'} ],
[ 1, $text{'acl_all'} ],
[ 3, $text{'acl_asame'} ],
[ 2, $text{'acl_matching'},
&ui_textbox("aliases", $o->{'aliases'}, 40) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_apath'}</b></td>\n";
printf "<td colspan=3><input name=apath size=40 value='%s'> %s</td> </tr>\n",
$_[0]->{'apath'}, &file_chooser_button("apath", 1);
print &ui_table_row($text{'acl_atypes'},
join("", map { &ui_checkbox("aedit_".$_, 1, $text{"acl_atype".$_},
$o->{"aedit_".$_}) } 1 .. 6),
3);
# Outgoing address mappings
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_row($text{'acl_amax'},
&ui_radio_table("amax_def", $o->{'amax'} ? 0 : 1,
[ [ 1, $text{'acl_unlimited'} ],
[ 0, "", &ui_textbox("amax", $o->{'amax'}, 5) ] ], 1),
3);
print "<tr> <td valign=top><b>$text{'acl_outgoing'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=omode value=0 %s> $text{'acl_none'}\n",
$_[0]->{'omode'} == 0 ? "checked" : "";
printf "<input type=radio name=omode value=1 %s> $text{'acl_all'}<br>\n",
$_[0]->{'omode'} == 1 ? "checked" : "";
printf "<input type=radio name=omode value=2 %s> $text{'acl_matching'}\n",
$_[0]->{'omode'} == 2 ? "checked" : "";
printf "<input name=oaddrs size=40 value='%s'></td> </tr>\n",
$_[0]->{'oaddrs'};
print &ui_table_row($text{'acl_apath'},
&ui_textbox("apath", $o->{'apath'}, 40)." ".
&file_chooser_button("apath", 1),
3);
# Spam control rules
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_hr();
print "<tr> <td valign=top><b>$text{'acl_spam'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=smode value=1 %s> $text{'acl_all'}\n",
$_[0]->{'smode'} == 1 ? "checked" : "";
printf "<input type=radio name=smode value=2 %s> $text{'acl_matching'}\n",
$_[0]->{'smode'} == 2 ? "checked" : "";
printf "<input name=saddrs size=40 value='%s'></td> </tr>\n",
$_[0]->{'saddrs'};
print &ui_table_row($text{'acl_outgoing'},
&ui_radio_table("omode",
defined($o->{'omode'}) ? $o->{'omode'} : 0,
[ [ 0, $text{'acl_none'} ],
[ 1, $text{'acl_all'} ],
[ 2, $text{'acl_matching'},
&ui_textbox("oaddrs", $o->{'oaddrs'}, 40) ] ], 1),
3);
print &ui_table_hr();
print &ui_table_row($text{'acl_spam'},
&ui_radio_table("smode", $o->{'smode'},
[ [ 1, $text{'acl_all'} ],
[ 2, $text{'acl_matching'},
&ui_textbox("saddrs", $o->{'saddrs'}, 40) ] ], 1),
3);
}
# acl_security_save(&options)

View File

@@ -5,47 +5,41 @@ require 'servers-lib.pl';
# Output HTML for editing security options for the servers module
sub acl_security_form
{
print "<tr> <td valign=top><b>$text{'acl_servers'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=radio name=servers_def value=1 %s> %s\n",
$_[0]->{'servers'} eq '*' ? 'checked' : '', $text{'acl_sall'};
printf "<input type=radio name=servers_def value=0 %s> %s<br>\n",
$_[0]->{'servers'} eq '*' ? '' : 'checked', $text{'acl_ssel'};
print "<select name=servers multiple size=4 width=15>\n";
local @servers = sort { $a->{'host'} cmp $b->{'host'} } &list_servers();
local ($z, %zcan);
map { $zcan{$_}++ } split(/\s+/, $_[0]->{'servers'});
foreach $z (sort { $a->{'value'} cmp $b->{'value'} } @servers) {
printf "<option value='%s' %s>%s</option>\n",
$z->{'id'},
$zcan{$z->{'host'}} || $zcan{$z->{'id'}} ? "selected" : "",
$z->{'host'} ;
}
print "</select></td></tr>\n";
my ($o) = @_;
my @servers = sort { $a->{'host'} cmp $b->{'host'} } &list_servers();
my %scan = map { $_, 1 } split(/\s+/, $o->{'servers'});
my (@sopts, @ssel);
foreach my $s (sort { $a->{'value'} cmp $b->{'value'} } @servers) {
push(@sopts, [ $s->{'id'}, $s->{'host'} ]);
push(@ssel, $s->{'id'}) if ($scan{$s->{'host'}} || $scan{$s->{'id'}});
}
print "<tr> <td><b>$text{'acl_edit'}</b></td> <td>\n";
print &ui_yesno_radio("edit", $_[0]->{'edit'}),"</td>\n";
print &ui_table_row($text{'acl_servers'},
&ui_radio("servers_def", $o->{'servers'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_sall'} ],
[ 0, $text{'acl_ssel'} ] ])."<br>\n".
&ui_select("servers", \@ssel, \@sopts, 4, 1),
3);
print "<td><b>$text{'acl_find'}</b></td> <td>\n";
print &ui_yesno_radio("find", $_[0]->{'find'}),"</td> </tr>\n";
print &ui_table_row($text{'acl_edit'},
&ui_yesno_radio("edit", $o->{'edit'}));
print &ui_table_row($text{'acl_find'},
&ui_yesno_radio("find", $o->{'find'}));
print "<tr> <td><b>$text{'acl_auto'}</b></td> <td>\n";
print &ui_yesno_radio("auto", $_[0]->{'auto'}),"</td>\n";
print &ui_table_row($text{'acl_auto'},
&ui_yesno_radio("auto", $o->{'auto'}));
print &ui_table_row($text{'acl_add'},
&ui_yesno_radio("add", $o->{'add'}));
print "<td><b>$text{'acl_add'}</b></td> <td>\n";
print &ui_yesno_radio("add", $_[0]->{'add'}),"</td> </tr>\n";
print &ui_table_row($text{'acl_forcefast'},
&ui_yesno_radio("forcefast", $o->{'forcefast'}));
print &ui_table_row($text{'acl_forcetype'},
&ui_yesno_radio("forcetype", $o->{'forcetype'}));
print "<tr> <td><b>$text{'acl_forcefast'}</b></td> <td>\n";
print &ui_yesno_radio("forcefast", $_[0]->{'forcefast'}),"</td>\n";
print "<td><b>$text{'acl_forcetype'}</b></td> <td>\n";
print &ui_yesno_radio("forcetype", $_[0]->{'forcetype'}),"</td> </tr>\n";
print "<tr> <td><b>$text{'acl_forcelink'}</b></td> <td>\n";
print &ui_yesno_radio("forcelink", $_[0]->{'forcelink'}),"</td>\n";
print "<td><b>$text{'acl_links'}</b></td> <td>\n";
print &ui_yesno_radio("links", $_[0]->{'links'}),"</td> </tr>\n";
print &ui_table_row($text{'acl_forcelink'},
&ui_yesno_radio("forcelink", $o->{'forcelink'}));
print &ui_table_row($text{'acl_links'},
&ui_yesno_radio("links", $o->{'links'}));
}
# acl_security_save(&options)

View File

@@ -5,20 +5,18 @@ do 'shorewall-lib.pl';
# Output HTML for editing security options for the acl module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_nochange'}</b></td> <td>\n";
printf "<input type=radio name=nochange value=0 %s> $text{'yes'}\n",
$_[0]->{'nochange'} ? '' : 'checked';
printf "<input type=radio name=nochange value=1 %s> $text{'no'}</td>\n",
$_[0]->{'nochange'} ? 'checked' : '';
my ($o) = @_;
print "</tr>\n";
print &ui_table_row($text{'acl_nochange'},
&ui_yesno_radio("nochange", int($o->{'nochange'}), 0, 1));
print "<tr> <td valign=top><b>$text{'acl_files'}</b></td> <td>\n";
print &ui_radio("files_def", $_[0]->{'files'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_all'} ], [ 0, $text{'acl_sel'} ] ]),"<br>\n";
print &ui_select("files", [ split(/\s+/, $_[0]->{'files'}) ],
[ map { [ $_, $text{$_."_title"}." ($_)" ] }
@shorewall_files ], 5, 1);
print &ui_table_row($text{'acl_files'},
&ui_radio("files_def", $o->{'files'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_all'} ], [ 0, $text{'acl_sel'} ] ])."<br>\n".
&ui_select("files", [ split(/\s+/, $o->{'files'}) ],
[ map { [ $_, $text{$_."_title"}." ($_)" ] }
@shorewall_files ], 5, 1),
3);
}
# acl_security_save(&options)

View File

@@ -5,20 +5,18 @@ do 'shorewall6-lib.pl';
# Output HTML for editing security options for the acl module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_nochange'}</b></td> <td>\n";
printf "<input type=radio name=nochange value=0 %s> $text{'yes'}\n",
$_[0]->{'nochange'} ? '' : 'checked';
printf "<input type=radio name=nochange value=1 %s> $text{'no'}</td>\n",
$_[0]->{'nochange'} ? 'checked' : '';
my ($o) = @_;
print "</tr>\n";
print &ui_table_row($text{'acl_nochange'},
&ui_yesno_radio("nochange", int($o->{'nochange'}), 0, 1));
print "<tr> <td valign=top><b>$text{'acl_files'}</b></td> <td>\n";
print &ui_radio("files_def", $_[0]->{'files'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_all'} ], [ 0, $text{'acl_sel'} ] ]),"<br>\n";
print &ui_select("files", [ split(/\s+/, $_[0]->{'files'}) ],
[ map { [ $_, $text{$_."_title"}." ($_)" ] }
@shorewall6_files ], 5, 1);
print &ui_table_row($text{'acl_files'},
&ui_radio("files_def", $o->{'files'} eq '*' ? 1 : 0,
[ [ 1, $text{'acl_all'} ], [ 0, $text{'acl_sel'} ] ])."<br>\n".
&ui_select("files", [ split(/\s+/, $o->{'files'}) ],
[ map { [ $_, $text{$_."_title"}." ($_)" ] }
@shorewall6_files ], 5, 1),
3);
}
# acl_security_save(&options)

View File

@@ -9,29 +9,23 @@ require 'squid-lib.pl';
# Output HTML for editing security options for the squid module
sub acl_security_form
{
print "<tr> <td valign=top><b>$text{'acl_sections'}</b></td>\n";
print "<td colspan=3><select name=sections multiple size=6>\n";
foreach $s (@accopts) {
printf "<option value=%s %s>%s</option>\n",
$s, $_[0]->{$s} ? 'selected' : '', $text{"index_${s}"};
}
print "</select></td> </tr>\n";
my ($o) = @_;
print "<tr> <td><b>$text{'acl_root'}</b></td>\n";
printf "<td colspan=3><input name=root size=40 value='%s'> %s</td> </tr>\n",
$_[0]->{'root'}, &file_chooser_button("root", 1);
print &ui_table_row($text{'acl_sections'},
&ui_select("sections",
[ grep { $o->{$_} } @accopts ],
[ map { [ $_, $text{"index_${_}"} ] } @accopts ],
6, 1),
3);
print "<tr> <td><b>$text{'acl_start'}</b></td>\n";
printf "<td><input type=radio name=start value=1 %s> %s\n",
$_[0]->{'start'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=start value=0 %s> %s</td> </tr>\n",
$_[0]->{'start'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_root'},
&ui_textbox("root", $o->{'root'}, 40)." ".&file_chooser_button("root", 1),
3);
print "<tr> <td><b>$text{'acl_restart'}</b></td>\n";
printf "<td><input type=radio name=restart value=1 %s> %s\n",
$_[0]->{'restart'} ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=restart value=0 %s> %s</td> </tr>\n",
$_[0]->{'restart'} ? '' : 'checked', $text{'no'};
print &ui_table_row($text{'acl_start'},
&ui_yesno_radio("start", $o->{'start'}));
print &ui_table_row($text{'acl_restart'},
&ui_yesno_radio("restart", $o->{'restart'}));
}
# acl_security_save(&options)

View File

@@ -6,225 +6,173 @@ require 'user-lib.pl';
sub acl_security_form
{
local $o = $_[0];
my $uedit_group = $o->{'uedit_mode'} == 5 ?
join(" ", map { "".&my_getgrgid($_) } split(/\s+/, $o->{'uedit'})) : "";
print "<tr> <td valign=top><b>$text{'acl_uedit'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=uedit_mode value=0 %s> $text{'acl_uedit_all'}&nbsp;&nbsp;\n",
$o->{'uedit_mode'} == 0 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=1 %s> $text{'acl_uedit_none'}&nbsp;\n",
$o->{'uedit_mode'} == 1 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=6 %s> $text{'acl_uedit_this'}<br>\n",
$o->{'uedit_mode'} == 6 ? "checked" : "";
printf "<input type=radio name=uedit_mode value=2 %s> $text{'acl_uedit_only'}\n",
$o->{'uedit_mode'} == 2 ? "checked" : "";
printf "<input name=uedit_can size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 2 ? $o->{'uedit'} : "",
&user_chooser_button("uedit_can", 1);
printf "<input type=radio name=uedit_mode value=3 %s> $text{'acl_uedit_except'}\n",
$o->{'uedit_mode'} == 3 ? "checked" : "";
printf "<input name=uedit_cannot size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 3 ? $o->{'uedit'} : "",
&user_chooser_button("uedit_cannot", 1);
printf "<input type=radio name=uedit_mode value=4 %s> $text{'acl_uedit_uid'}\n",
$o->{'uedit_mode'} == 4 ? "checked" : "";
printf "<input name=uedit_uid size=6 value='%s'> - \n",
$o->{'uedit_mode'} == 4 ? $o->{'uedit'} : "";
printf "<input name=uedit_uid2 size=6 value='%s'><br>\n",
$o->{'uedit_mode'} == 4 ? $o->{'uedit2'} : "";
printf "<input type=radio name=uedit_mode value=5 %s> $text{'acl_uedit_group'}\n",
$o->{'uedit_mode'} == 5 ? "checked" : "";
printf "<input name=uedit_group size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 5 ?
join(" ", map { "".&my_getgrgid($_) } split(/\s+/, $o->{'uedit'})) :"",
&group_chooser_button("uedit_group", 1);
printf "%s <input type=checkbox name=uedit_sec value=1 %s> %s<br>\n",
"&nbsp;" x 5, $o->{'uedit_sec'} ? 'checked' : '',$text{'acl_uedit_sec'};
printf "<input type=radio name=uedit_mode value=7 %s> $text{'acl_uedit_re'}\n",
$o->{'uedit_mode'} == 7 ? "checked" : "";
printf "<input name=uedit_re size=40 value='%s'> %s<br>\n",
$o->{'uedit_mode'} == 7 ? $o->{'uedit_re'} : "";
print "</td> </tr>\n";
print &ui_table_row($text{'acl_uedit'},
&ui_radio_table("uedit_mode",
defined($o->{'uedit_mode'}) ? $o->{'uedit_mode'} : 0,
[ [ 0, $text{'acl_uedit_all'} ],
[ 1, $text{'acl_uedit_none'} ],
[ 6, $text{'acl_uedit_this'} ],
[ 2, $text{'acl_uedit_only'},
&ui_textbox("uedit_can",
$o->{'uedit_mode'} == 2 ? $o->{'uedit'} : "", 40).
" ".&user_chooser_button("uedit_can", 1) ],
[ 3, $text{'acl_uedit_except'},
&ui_textbox("uedit_cannot",
$o->{'uedit_mode'} == 3 ? $o->{'uedit'} : "", 40).
" ".&user_chooser_button("uedit_cannot", 1) ],
[ 4, $text{'acl_uedit_uid'},
&ui_textbox("uedit_uid",
$o->{'uedit_mode'} == 4 ? $o->{'uedit'} : "", 6).
" - ".&ui_textbox("uedit_uid2",
$o->{'uedit_mode'} == 4 ? $o->{'uedit2'} : "", 6) ],
[ 5, $text{'acl_uedit_group'},
&ui_textbox("uedit_group", $uedit_group, 40)." ".
&group_chooser_button("uedit_group", 1)."<br>\n".
&ui_checkbox("uedit_sec", 1, $text{'acl_uedit_sec'},
$o->{'uedit_sec'}) ],
[ 7, $text{'acl_uedit_re'},
&ui_textbox("uedit_re",
$o->{'uedit_mode'} == 7 ? $o->{'uedit_re'} : "", 40) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_ucreate'}</b></td> <td>\n";
printf "<input type=radio name=ucreate value=1 %s> $text{'yes'}\n",
$o->{'ucreate'} ? "checked" : "";
printf "<input type=radio name=ucreate value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'ucreate'} ? "" : "checked";
print &ui_table_row($text{'acl_ucreate'},
&ui_yesno_radio("ucreate", $o->{'ucreate'}));
print &ui_table_row($text{'acl_batch'},
&ui_yesno_radio("batch", $o->{'batch'}));
print "<tr> <td><b>$text{'acl_batch'}</b></td> <td>\n";
printf "<input type=radio name=batch value=1 %s> $text{'yes'}\n",
$o->{'batch'} ? "checked" : "";
printf "<input type=radio name=batch value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'batch'} ? "" : "checked";
print &ui_table_row($text{'acl_export'},
&ui_radio("export", defined($o->{'export'}) ? $o->{'export'} : 0,
[ [ 2, $text{'yes'} ],
[ 1, $text{'acl_export1'} ],
[ 0, $text{'no'} ] ]),
3);
print "<tr> <td><b>$text{'acl_export'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=export value=2 %s> $text{'yes'}\n",
$o->{'export'} == 2 ? "checked" : "";
printf "<input type=radio name=export value=1 %s> $text{'acl_export1'}\n",
$o->{'export'} == 1 ? "checked" : "";
printf "<input type=radio name=export value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'export'} == 0 ? "checked" : "";
print "<tr> <td valign=top><b>$text{'acl_uid'}</b></td>\n";
print "<td colspan=3><input name=lowuid size=6 value='$o->{'lowuid'}'> -\n";
print "<input name=hiuid size=6 value='$o->{'hiuid'}'><br>\n";
printf "<input type=checkbox name=autouid value=1 %s> %s<br>\n",
$o->{'autouid'} ? "checked" : "", $text{'acl_autouid'};
printf "<input type=checkbox name=calcuid value=1 %s> %s<br>\n",
$o->{'calcuid'} ? "checked" : "", $text{'acl_calcuid'};
printf "<input type=checkbox name=useruid value=1 %s> %s<br>\n",
$o->{'useruid'} ? "checked" : "", $text{'acl_useruid'};
printf "<input type=checkbox name=umultiple value=1 %s> %s<br>\n",
$o->{'umultiple'} ? "checked" : "", $text{'acl_umultiple'};
printf "<input type=checkbox name=uuid value=1 %s> %s</td> </tr>\n",
$o->{'uuid'} ? "checked" : "", $text{'acl_uuid'};
print &ui_table_row($text{'acl_uid'},
&ui_textbox("lowuid", $o->{'lowuid'}, 6)." - ".
&ui_textbox("hiuid", $o->{'hiuid'}, 6)."<br>\n".
join("<br>", map { &ui_checkbox($_, 1, $text{'acl_'.$_}, $o->{$_}) }
('autouid', 'calcuid', 'useruid', 'umultiple', 'uuid')),
3);
local $uedit_gmode = defined($o->{'uedit_gmode'}) ? $o->{'uedit_gmode'} :
$o->{'ugroups'} eq '*' ? 0 : 2;
print "<tr> <td valign=top><b>$text{'acl_ugroups'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=uedit_gmode value=0 %s> $text{'acl_gedit_all'}<br>\n",
$uedit_gmode == 0 ? "checked" : "";
printf "<input type=radio name=uedit_gmode value=2 %s> $text{'acl_gedit_only'}\n",
$uedit_gmode == 2 ? "checked" : "";
printf "<input name=uedit_gcan size=40 value='%s'> %s<br>\n",
$uedit_gmode == 2 ? $o->{'ugroups'} : "",
&group_chooser_button("uedit_gcan", 1);
printf "<input type=radio name=uedit_gmode value=3 %s> $text{'acl_gedit_except'}\n",
$uedit_gmode == 3 ? "checked" : "";
printf "<input name=uedit_gcannot size=40 value='%s'> %s<br>\n",
$uedit_gmode == 3 ? $o->{'ugroups'} : "",
&group_chooser_button("uedit_gcannot", 1);
printf "<input type=radio name=uedit_gmode value=4 %s> $text{'acl_gedit_gid'}\n",
$uedit_gmode == 4 ? "checked" : "";
printf "<input name=uedit_gid size=6 value='%s'> -\n",
$uedit_gmode == 4 ? $o->{'ugroups'} : "";
printf "<input name=uedit_gid2 size=6 value='%s'></td> </tr>\n",
$uedit_gmode == 4 ? $o->{'ugroups2'} : "";
print "<tr> <td valign=top><b>$text{'acl_shells'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=shells_def value=1 %s> $text{'acl_any'}\n",
$o->{'shells'} eq "*" ? "checked" : "";
printf "<input type=radio name=shells_def value=0 %s> $text{'acl_listed'}<br>\n",
$o->{'shells'} eq "*" ? "" : "checked";
print "<textarea name=shells rows=3 cols=40>",
$o->{'shells'} eq "*" ? "" : join("\n", split(/\s+/, $o->{'shells'})),
"</textarea></td> </tr>\n";
print &ui_table_row($text{'acl_ugroups'},
&ui_radio_table("uedit_gmode", $uedit_gmode,
[ [ 0, $text{'acl_gedit_all'} ],
[ 2, $text{'acl_gedit_only'},
&ui_textbox("uedit_gcan",
$uedit_gmode == 2 ? $o->{'ugroups'} : "", 40).
" ".&group_chooser_button("uedit_gcan", 1) ],
[ 3, $text{'acl_gedit_except'},
&ui_textbox("uedit_gcannot",
$uedit_gmode == 3 ? $o->{'ugroups'} : "", 40).
" ".&group_chooser_button("uedit_gcannot", 1) ],
[ 4, $text{'acl_gedit_gid'},
&ui_textbox("uedit_gid",
$uedit_gmode == 4 ? $o->{'ugroups'} : "", 6).
" - ".&ui_textbox("uedit_gid2",
$uedit_gmode == 4 ? $o->{'ugroups2'} : "", 6) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_epeopt'}</b></td> <td>\n";
printf "<input type=radio name=peopt value=1 %s> $text{'yes'}\n",
$o->{'peopt'} ? "checked" : "";
printf "<input type=radio name=peopt value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'peopt'} ? "" : "checked";
print &ui_table_row($text{'acl_shells'},
&ui_radio_table("shells_def", $o->{'shells'} eq "*" ? 1 : 0,
[ [ 1, $text{'acl_any'} ],
[ 0, $text{'acl_listed'},
&ui_textarea("shells",
$o->{'shells'} eq "*" ? "" :
join("\n", split(/\s+/, $o->{'shells'} || "")),
3, 40) ] ], 1),
3);
print "<tr> <td valign=top><b>$text{'acl_home'}</b></td>\n";
printf "<td colspan=3><input name=home size=40 value='%s'> %s<br>\n",
$o->{'home'}, &file_chooser_button("home", 1);
printf "<input type=checkbox name=autohome value=1 %s> %s</td> </tr>\n",
$o->{'autohome'} ? "checked" : "",
$text{'acl_autohome'};
print &ui_table_row($text{'acl_epeopt'},
&ui_yesno_radio("peopt", $o->{'peopt'}));
print "<tr> <td><b>$text{'acl_udelete'}</b></td> <td>\n";
printf "<input type=radio name=udelete value=1 %s> $text{'yes'}\n",
$o->{'udelete'} ? "checked" : "";
printf "<input type=radio name=udelete value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'udelete'} ? "" : "checked";
print &ui_table_row($text{'acl_home'},
&ui_textbox("home", $o->{'home'}, 40)." ".
&file_chooser_button("home", 1)."<br>\n".
&ui_checkbox("autohome", 1, $text{'acl_autohome'}, $o->{'autohome'}),
3);
print "<tr> <td><b>$text{'acl_urename'}</b></td> <td>\n";
printf "<input type=radio name=urename value=1 %s> $text{'yes'}\n",
$o->{'urename'} ? "checked" : "";
printf "<input type=radio name=urename value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'urename'} ? "" : "checked";
print &ui_table_row($text{'acl_udelete'},
&ui_yesno_radio("udelete", $o->{'udelete'}));
print &ui_table_row($text{'acl_urename'},
&ui_yesno_radio("urename", $o->{'urename'}));
print "<tr> <td valign=top><b>$text{'acl_delhome'}</b></td>\n";
print "<td colspan=3>",&ui_radio("delhome", $o->{'delhome'},
[ [ 2, $text{'acl_option'} ],
[ 1, $text{'acl_always'} ],
[ 0, $text{'acl_never'} ] ]),"</td> </tr>\n";
print &ui_table_row($text{'acl_delhome'},
&ui_radio("delhome", $o->{'delhome'},
[ [ 2, $text{'acl_option'} ],
[ 1, $text{'acl_always'} ],
[ 0, $text{'acl_never'} ] ]),
3);
# 0 = always on, 1 = can edit, 2 = always off
print "<tr> <td valign=top><b>$text{'acl_saveopts'}</b></td> ",
"<td colspan=3><table>\n";
foreach $opt ('chuid', 'chgid', 'movehome', 'mothers',
'makehome', 'copy', 'cothers', 'dothers') {
print "<tr> <td>",$text{"uedit_$opt"},"</td>\n";
printf "<td><input type=radio name=$opt value=1 %s> %s\n",
$o->{$opt} == 1 ? "checked" : "", $text{'acl_canedit'};
printf "<input type=radio name=$opt value=0 %s> %s\n",
$o->{$opt} == 0 ? "checked" : "", $text{'acl_on'};
printf "<input type=radio name=$opt value=2 %s> %s</td> </tr>\n",
$o->{$opt} == 2 ? "checked" : "", $text{'acl_off'};
print &ui_table_span($text{'acl_saveopts'});
foreach my $opt ('chuid', 'chgid', 'movehome', 'mothers',
'makehome', 'copy', 'cothers', 'dothers') {
print &ui_table_row($text{"uedit_$opt"},
&ui_radio($opt, defined($o->{$opt}) ? $o->{$opt} : 0,
[ [ 1, $text{'acl_canedit'} ],
[ 0, $text{'acl_on'} ],
[ 2, $text{'acl_off'} ] ]),
3);
}
print "</table></td> </tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
print &ui_table_hr();
print "<tr> <td valign=top><b>$text{'acl_gedit'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=gedit_mode value=0 %s> $text{'acl_gedit_all'}&nbsp;&nbsp;\n",
$o->{'gedit_mode'} == 0 ? "checked" : "";
printf "<input type=radio name=gedit_mode value=1 %s> $text{'acl_gedit_none'}<br>\n",
$o->{'gedit_mode'} == 1 ? "checked" : "";
printf "<input type=radio name=gedit_mode value=2 %s> $text{'acl_gedit_only'}\n",
$o->{'gedit_mode'} == 2 ? "checked" : "";
printf "<input name=gedit_can size=40 value='%s'> %s<br>\n",
$o->{'gedit_mode'} == 2 ? $o->{'gedit'} : "",
&group_chooser_button("gedit_can", 1);
printf "<input type=radio name=gedit_mode value=3 %s> $text{'acl_gedit_except'}\n",
$o->{'gedit_mode'} == 3 ? "checked" : "";
printf "<input name=gedit_cannot size=40 value='%s'> %s<br>\n",
$o->{'gedit_mode'} == 3 ? $o->{'gedit'} : "",
&group_chooser_button("gedit_cannot", 1);
printf "<input type=radio name=gedit_mode value=4 %s> $text{'acl_gedit_gid'}\n",
$o->{'gedit_mode'} == 4 ? "checked" : "";
printf "<input name=gedit_gid size=6 value='%s'> -\n",
$o->{'gedit_mode'} == 4 ? $o->{'gedit'} : "";
printf "<input name=gedit_gid2 size=6 value='%s'></td> </tr>\n",
$o->{'gedit_mode'} == 4 ? $o->{'gedit2'} : "";
print &ui_table_row($text{'acl_gedit'},
&ui_radio_table("gedit_mode",
defined($o->{'gedit_mode'}) ? $o->{'gedit_mode'} : 0,
[ [ 0, $text{'acl_gedit_all'} ],
[ 1, $text{'acl_gedit_none'} ],
[ 2, $text{'acl_gedit_only'},
&ui_textbox("gedit_can",
$o->{'gedit_mode'} == 2 ? $o->{'gedit'} : "", 40).
" ".&group_chooser_button("gedit_can", 1) ],
[ 3, $text{'acl_gedit_except'},
&ui_textbox("gedit_cannot",
$o->{'gedit_mode'} == 3 ? $o->{'gedit'} : "", 40).
" ".&group_chooser_button("gedit_cannot", 1) ],
[ 4, $text{'acl_gedit_gid'},
&ui_textbox("gedit_gid",
$o->{'gedit_mode'} == 4 ? $o->{'gedit'} : "", 6).
" - ".&ui_textbox("gedit_gid2",
$o->{'gedit_mode'} == 4 ? $o->{'gedit2'} : "", 6) ] ], 1),
3);
print "<tr> <td><b>$text{'acl_gcreate'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=gcreate value=1 %s> $text{'yes'}\n",
$o->{'gcreate'}==1 ? "checked" : "";
printf "<input type=radio name=gcreate value=2 %s> $text{'acl_gnew'}\n",
$o->{'gcreate'}==2 ? "checked" : "";
printf "<input type=radio name=gcreate value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'gcreate'}==0 ? "checked" : "";
print &ui_table_row($text{'acl_gcreate'},
&ui_radio("gcreate", defined($o->{'gcreate'}) ? $o->{'gcreate'} : 0,
[ [ 1, $text{'yes'} ],
[ 2, $text{'acl_gnew'} ],
[ 0, $text{'no'} ] ]),
3);
print "<tr> <td valign=top><b>$text{'acl_gid'}</b></td>\n";
print "<td colspan=3><input name=lowgid size=6 value='$o->{'lowgid'}'> -\n";
print "<input name=higid size=6 value='$o->{'higid'}'><br>\n";
printf "<input type=checkbox name=autogid value=1 %s> %s<br>\n",
$o->{'autogid'} ? "checked" : "", $text{'acl_autogid'};
printf "<input type=checkbox name=calcgid value=1 %s> %s<br>\n",
$o->{'calcgid'} ? "checked" : "", $text{'acl_calcgid'};
printf "<input type=checkbox name=usergid value=1 %s> %s<br>\n",
$o->{'usergid'} ? "checked" : "", $text{'acl_usergid'};
printf "<input type=checkbox name=gmultiple value=1 %s> %s<br>\n",
$o->{'gmultiple'} ? "checked" : "", $text{'acl_gmultiple'};
printf "<input type=checkbox name=ggid value=1 %s> %s</td> </tr>\n",
$o->{'ggid'} ? "checked" : "", $text{'acl_ggid'};
print &ui_table_row($text{'acl_gid'},
&ui_textbox("lowgid", $o->{'lowgid'}, 6)." - ".
&ui_textbox("higid", $o->{'higid'}, 6)."<br>\n".
join("<br>", map { &ui_checkbox($_, 1, $text{'acl_'.$_}, $o->{$_}) }
('autogid', 'calcgid', 'usergid', 'gmultiple', 'ggid')),
3);
print "<tr> <td><b>$text{'acl_gdelete'}</b></td> <td>\n";
printf "<input type=radio name=gdelete value=1 %s> $text{'yes'}\n",
$o->{'gdelete'} ? "checked" : "";
printf "<input type=radio name=gdelete value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'gdelete'} ? "" : "checked";
print &ui_table_row($text{'acl_gdelete'},
&ui_yesno_radio("gdelete", $o->{'gdelete'}));
print &ui_table_row($text{'acl_grename'},
&ui_yesno_radio("grename", $o->{'grename'}));
print "<tr> <td><b>$text{'acl_grename'}</b></td> <td>\n";
printf "<input type=radio name=grename value=1 %s> $text{'yes'}\n",
$o->{'grename'} ? "checked" : "";
printf "<input type=radio name=grename value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'grename'} ? "" : "checked";
print &ui_table_hr();
print "<tr> <td colspan=4><hr></td> </tr>\n";
print "<tr><td valign=top><b>$text{'acl_logins'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=logins_mode value=0 %s> $text{'acl_lnone'}<br>\n",
$o->{'logins'} ? "" : "checked";
printf "<input type=radio name=logins_mode value=1 %s> $text{'acl_lall'}<br>\n",
$o->{'logins'} eq "*" ? "checked" : "";
printf "<input type=radio name=logins_mode value=2 %s>\n",
$o->{'logins'} =~ /[^\*]/ ? "checked" : "";
printf "<input name=logins size=40 value='%s'> %s</td> </tr>\n",
$o->{'logins'} =~ /[^\*]/ ? $o->{'logins'} : "",
&user_chooser_button("logins", 1);
my $logins_mode = !$o->{'logins'} ? 0 : $o->{'logins'} eq "*" ? 1 : 2;
print &ui_table_row($text{'acl_logins'},
&ui_radio_table("logins_mode", $logins_mode,
[ [ 0, $text{'acl_lnone'} ],
[ 1, $text{'acl_lall'} ],
[ 2, "",
&ui_textbox("logins",
$logins_mode == 2 ? $o->{'logins'} : "", 40)." ".
&user_chooser_button("logins", 1) ] ], 1),
3);
}
# acl_security_save(&options)