#!/usr/local/bin/perl # edit_fshare.cgi # Display a form for editing or creating a new directory share require './samba-lib.pl'; &ReadParse(); $s = $in{'share'}; # check acls &error_setup("$text{'eacl_aviol'}"); if(!$s) { &error("$text{'eacl_np'} $text{'eacl_pcfs'}") unless $access{'c_fs'}; } else { &error("$text{'eacl_np'} $text{'eacl_pafs'}") unless &can('r', \%access, $in{'share'}); } # display if ($s) { &ui_print_header(undef, $s eq 'global' ? $text{'share_title1'} : $text{'share_title2'}, ""); &get_share($s); } else { &ui_print_header(undef, $text{'share_title3'}, ""); } print "
\n"; if ($s) { print "\n"; } # Vital share options.. print "\n"; print "\n"; print "
$text{'share_info'}
\n"; if ($s ne "global") { if ($copy = &getval("copy")) { print "\n"; } print "\n"; printf "\n"; } print "\n"; printf "\n"; if (!$s) { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; printf "\n", &getval("comment"); print "\n" if ($s eq "global"); print "
",&text('share_copy', $copy), "
$text{'share_name'}\n", $s eq "homes" ? "" : "checked"; printf "   \n", $s eq "homes" ? "" : $s; printf " $text{'share_home'}\n", $s eq "homes" ? "checked" : ""; print "
$text{'share_dir'}\n", &getval("path"); print &file_chooser_button("path", 1); print "
$text{'share_create'}",&yesno_input("create"),"$text{'share_owner'}",&ui_user_textbox("createowner", "root"),"
$text{'share_createperms'}",&ui_textbox("createperms", "755", 5),"$text{'share_group'}",&ui_group_textbox("creategroup", "root"),"
$text{'share_available'}",&yesno_input("available"),"$text{'share_browseable'}",&yesno_input("browseable"),"
$text{'share_comment'}
$text{'share_samedesc2'}

\n"; if ($s eq "global") { print "

\n"; } elsif ($s) { print "\n"; print "\n" if &can('rw', \%access, $s); print "\n"; print "\n"; print "\n" if &can('rv', \%access, $s); print "\n"; print "\n"; print "\n"; print "\n" if &can('rw', \%access, $s); print "
\n"; } else { print " \n"; } if ($s) { # Icons for other share options $us = "share=".&urlize($s); local (@url, @text, @icon, $disp); if (&can('rs',\%access, $s)) { push(@url, "edit_sec.cgi?$us"); push(@text, $text{'share_security'}); push(@icon, "images/icon_2.gif"); $disp++; } if (&can('rp',\%access, $s)) { push(@url, "edit_fperm.cgi?$us"); push(@text, $text{'share_permission'}); push(@icon, "images/icon_7.gif"); $disp++; } if (&can('rn',\%access, $s)) { push(@url, "edit_fname.cgi?$us"); push(@text, $text{'share_naming'}); push(@icon, "images/icon_8.gif"); $disp++; } if (&can('ro',\%access, $s)) { push(@url, "edit_fmisc.cgi?$us"); push(@text, $text{'share_misc'}); push(@icon, "images/icon_4.gif"); $disp++; } if ($disp) { print &ui_hr(); print &ui_subheading($text{'share_option'}); &icons_table(\@url, \@text, \@icon); } } &ui_print_footer("", $text{'index_sharelist'});