\n";
+print &ui_form_start("save_euser.cgi", "post");
+print &ui_hidden("idx", $in{'idx'});
+print &ui_table_start($text{'euser_title'}, undef, 2);
-print " | $text{'euser_name'} | \n";
-print "$u->{'name'} | \n";
+print &ui_table_row($text{'euser_name'},
+ "".&html_escape($u->{'name'})."");
-print "$text{'euser_uid'} | \n";
-print "{'uid'}\"> | \n";
+print &ui_table_row($text{'euser_uid'},
+ &ui_textbox("uid", $u->{'uid'}, 6));
-print " | $text{'euser_passwd'} | \n";
if ($samba_version >= 3) {
# In the new Samba, the password field is not really used for locking
# accounts any more, so don't both with the no access/no password
# options.
- print " ",
- "$text{'euser_currpw'}\n";
+ $pwfield = &ui_radio("ptype", 2,
+ [ [ 2, $text{'euser_currpw'} ],
+ [ 3, $text{'euser_newpw'}." ".
+ &ui_password("pass", undef, 20) ] ]);
}
else {
# In the old Samba, you can set the password to deny a login to the
# account or allow logins without a password
$locked = ($u->{'pass1'} eq ("X" x 32));
$nopass = ($u->{'pass1'} =~ /^NO PASSWORD/);
- printf " | $text{'euser_noaccess'}\n",
- $locked ? "checked" : "";
- printf " $text{'euser_nopw'}\n",
- $nopass ? "checked" : "";
- printf " $text{'euser_currpw'}\n",
- $locked||$nopass ? "" : "checked";
+ $pwfield = &ui_radio("ptype", $locked ? 0 : $nopass ? 1 : 2,
+ [ [ 0, $text{'euser_noaccess'} ],
+ [ 1, $text{'euser_nopw'} ],
+ [ 2, $text{'euser_currpw'} ],
+ [ 3, $text{'euser_newpw'}." ".
+ &ui_password("pass", undef, 20) ] ]);
}
-print " $text{'euser_newpw'}\n";
-print " | \n";
+print &ui_table_row($text{'euser_passwd'}, $pwfield);
if (!$u->{'opts'}) {
# Old-style samba user
- print " | $text{'euser_realname'} | \n";
- print " | \n";
+ print &ui_table_row($text{'euser_realname'},
+ &ui_textbox("realname", $u->{'real'}, 40));
- print " | $text{'euser_homedir'} | \n";
- print " | \n";
+ print &ui_table_row($text{'euser_homedir'},
+ &ui_textbox("homedir", $u->{'home'}, 40));
- print "$text{'euser_shell'} | \n";
- printf " | \n",
- $u->{'shell'};
+ print &ui_table_row($text{'euser_shell'},
+ &ui_textbox("shell", $u->{'shell'}, 15));
}
else {
# New-style samba user
- print "\n";
+ print &ui_hidden("new", 1);
map { $opt{uc($_)}++ } @{$u->{'opts'}};
- print " | $text{'euser_option'} | \n";
@ol = ($text{'euser_normal'}, "U", $text{'euser_nopwrequired'}, "N",
$text{'euser_disable'}, "D", $text{'euser_locked'}, "L" ,$text{'euser_noexpire'}, "X", $text{'euser_trust'}, "W");
for($i=0; $i<@ol; $i+=2) {
- printf " %s \n",
- $ol[$i+1], $opt{$ol[$i+1]} ? "checked" : "", $ol[$i];
+ push(@checks, &ui_checkbox("opts", $ol[$i+1], $ol[$i],
+ $opt{$ol[$i+1]}));
delete($opt{$ol[$i+1]});
}
+ print &ui_table_row($text{'euser_option'},
+ join(" \n", @checks));
foreach $oo (keys %opt) {
- print "\n";
+ print &ui_hidden("opts", $oo);
}
- print " | \n";
}
-print " |