New UI conversion

This commit is contained in:
Jamie Cameron
2012-03-20 23:00:35 -07:00
parent 2b0854249d
commit 41cc6fb1b5

View File

@@ -13,65 +13,48 @@ require './samba-lib.pl';
&get_share("global");
print "<form action=save_pass.cgi>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'passwd_title'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
print "<tr> <td><b>$text{'passwd_encrypt'}</b></td>\n";
printf "<td><input type=radio name=encrypt_passwords value=yes %s> $text{'yes'}\n",
&istrue("encrypt passwords") ? "checked" : "";
printf "&nbsp; <input type=radio name=encrypt_passwords value=no %s> $text{'no'}</td>\n",
&istrue("encrypt passwords") ? "" : "checked";
print &ui_form_start("save_pass.cgi", "post");
print &ui_table_start($text{'passwd_title'}, undef, 2);
print "<td><b>$text{'passwd_allownull'}</b></td>\n";
printf "<td><input type=radio name=null_passwords value=yes %s> $text{'yes'}\n",
&istrue("null passwords") ? "checked" : "";
printf "$gap <input type=radio name=null_passwords value=no %s> $text{'no'}</td></tr>\n",
&istrue("null passwords") ? "" : "checked";
print &ui_table_row($text{'passwd_encrypt'},
&yesno_input("encrypt passwords"));
print "<tr> <td><b>$text{'passwd_program'}</b></td>\n";
printf "<td><input type=radio name=passwd_program_def value=1 %s> $text{'default'}\n",
&getval("passwd program") eq "" ? "checked" : "";
printf "<input type=radio name=passwd_program_def value=0 %s>\n",
&getval("passwd program") eq "" ? "" : "checked";
printf "<input size=15 name=passwd_program value=\"%s\"></td>\n",
&getval("passwd program");
print &ui_table_row($text{'passwd_allownull'},
&yesno_input("null passwords"));
print "<td><b>$text{'passwd_sync'}</b></td>\n";
printf "<td><input type=radio name=unix_password_sync value=yes %s> $text{'yes'}\n",
&istrue("unix password sync") ? "checked" : "";
printf "$gap <input type=radio name=unix_password_sync value=no %s> $text{'no'}</td></tr>\n",
&istrue("unix password sync") ? "" : "checked";
print &ui_table_row($text{'passwd_program'},
&ui_opt_textbox("passwd_program", &getval("passwd program"), 25,
$text{'default'}));
print &ui_table_row($text{'passwd_sync'},
&yesno_input("unix password sync"));
print "<tr> <td valign=top><b>$text{'passwd_chat'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=radio name=passwd_chat_def value=1 %s> $text{'default'}\n",
&getval("passwd chat") eq "" ? "checked" : "";
printf "<input type=radio name=passwd_chat_def value=0 %s> $text{'passwd_below'}<br>\n",
&getval("passwd chat") eq "" ? "" : "checked";
print "<table border> <tr><td><b>$text{'passwd_waitfor'}</b></td> <td><b>$text{'passwd_send'}</b></td></tr>\n";
$pc = &getval("passwd chat");
$chat = &ui_radio("passwd_chat_def", $pc eq "" ? 1 : 0,
[ [ 1, $text{'default'} ],
[ 0, $text{'passwd_below'} ] ])."<br>\n";
$chat .= &ui_columns_start([ $text{'passwd_waitfor'},
$text{'passwd_send'} ]);
while($pc =~ /^"([^"]*)"\s*(.*)/ || $pc =~ /^(\S+)\s*(.*)/) {
if ($send) { push(@send, $1); $send = 0; }
else { push(@recv, $1); $send = 1; }
$pc = $2;
}
for($i=0; $i<(@recv < 5 ? 5 : @recv+1); $i++) {
printf "<tr><td><input name=chat_recv_$i value=\"%s\" size=20></td>\n",
$recv[$i] eq "." ? "" : $recv[$i];
printf "<td><input name=chat_send_$i value=\"%s\" size=20></td></tr>\n",
$send[$i];
$chat .= &ui_columns_row([
&ui_textbox("chat_recv_$i",
$recv[$i] eq "." ? "" : $recv[$i], 20),
&ui_textbox("chat_send_$i", $send[$i], 20),
]);
}
print "</table></td> </tr>\n";
$chat .= &ui_columns_end();
print &ui_table_row($text{'passwd_chat'}, $chat);
print "<tr> <td valign=top><b>$text{'passwd_map'}</b></td>\n";
print "<td colspan=3>\n";
printf "<input type=radio name=username_map_def value=1 %s> $text{'config_none'}\n",
&getval("username map") eq "" ? "checked" : "";
printf"<input type=radio name=username_map_def value=0 %s> $text{'passwd_below'}<br>\n",
&getval("username map") eq "" ? "" : "checked";
print "<table border> <tr><td><b>$text{'passwd_unixuser'}</b></td>\n";
print " <td><b>$text{'passwd_winuser'}</b></td></tr>\n";
$map = &ui_radio("username_map_def", &getval("username map") eq "" ? 1 : 0,
[ [ 1, $text{'config_none'} ],
[ 0, $text{'passwd_below'} ] ])."<br>\n";
$map .= &ui_columns_start([ $text{'passwd_unixuser'},
$text{'passwd_winuser'} ]);
open(UMAP, &getval("username map"));
while(<UMAP>) {
s/\r|\n//g;
@@ -89,14 +72,15 @@ while(<UMAP>) {
}
close(UMAP);
for($i=0; $i<@uunix+1; $i++) {
printf "<tr> <td><input name=umap_unix_$i size=8 value=\"%s\"></td>\n",
$uunix[$i];
printf "<td><input name=umap_win_$i size=30 value=\"%s\"></td> </tr>\n",
$uwin[$i];
$map .= &ui_columns_row([
&ui_textbox("umap_unix_$i", $uunix[$i], 15),
&ui_textbox("umap_win_$i", $uwin[$i], 30),
]);
}
print "</table></td> </tr>\n";
$map .= &ui_columns_end();
print &ui_table_row($text{'passwd_map'}, $map);
print "</table></td></tr></table><p>\n";
print "<input type=submit value=$text{'save'}></form>\n";
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_sharelist'});