#!/usr/local/bin/perl # edit_pshare.cgi # Display a form for editing or creating a new printer share require './samba-lib.pl'; &ReadParse(); $s = $in{'share'}; # check acls &error_setup(""); if(!$s) { &error("$text{'eacl_np'} $text{'eacl_pcps'}") unless $access{'c_ps'}; } else { &error("$text{'eacl_np'} $text{'eacl_paps'}") unless &can('r', \%access, $in{'share'}); } # display if ($s) { &ui_print_header(undef, $s eq 'global' ? $text{'pshare_title1'} : $text{'pshare_title2'}, ""); &get_share($s); } else { &ui_print_header(undef, $text{'pshare_title3'}, ""); } print "
\n"; } elsif ($s) { print "
\n" if &can('rw', \%access, $s); print " |
\n"; } else { print "
\n"; } if ($s) { # Icons for other share options $us = "share=".&urlize($s)."&printer=1"; 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('ro',\%access, $s)) { push(@url, "edit_popts.cgi?$us"); push(@text, $text{'print_option'}); push(@icon, "images/icon_3.gif"); $disp++; } if ($disp) { print &ui_hr(); print &ui_subheading($text{'share_option'}); &icons_table(\@url, \@text, \@icon); } } &ui_print_footer("", $text{'index_sharelist'});