netatalk/ 40700 0 1 0 7202607077 10426 5ustar rootbinnetatalk/status.txt100644 0 1 1310 7202572463 12614 0ustar rootbinNetatalk Webmin Module Status The Official status of this module is BETA Known Issues: ~ German language support incomplete - TODO ~ None, but they are out there Todo: ~ Cleanly merge netapple.pl into netatalk-funcs.pl ~ Online help ~ Document code ~ Document file map ~ Document the O-O design ~ Testing ~ Re-write File types editor (AppleVolumes.system) (to Sven's O-O model) ~ Netatalk PAM config editor ~ Re-write Interfaces editor (atalkd.conf) (to Sven's O-O model) ~ Bring server editor (afpd.conf) up to current specs ~ Printer config editor (papd.conf) ~ Language ports (English done, German started) ~ Testing testing testing See credits.txt for information on how to submit code. netatalk/help/ 40700 0 1 0 7202551147 11352 5ustar rootbinnetatalk/help/volumehelp.cgi100755 0 1 6364 7202575747 14355 0ustar rootbin#!/usr/bin/perl # # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # do '../../web-lib.pl'; require '../netatalk-funcs.pl'; &header("Volume Config Help", "", undef, 1, 1); my $CX="PRE"; print <the variables: <$CX> \$c -> client's ip or appletalk address \$f -> full name (whatever's in the gecos field) \$g -> group \$h -> hostname \$s -> server name (can be the hostname) \$u -> username (if guest, it's whatever user guest is running as) \$v -> volume name (either ADEID_NAME or basename of path) \$z -> zone (may not exist) \$\$ -> \$

casefold options [syntax: casefold:option]:

<$CX> tolower -> lowercases names in both directions toupper -> uppercases names in both directions xlatelower -> client sees lowercase, server sees uppercase xlateupper -> client sees uppercase, server sees lowercase

allow/deny/rwlist/rolist format [syntax: allow:user1,\@group]:

<$CX> user1,\@group,user2 -> allows/denies access from listed users/groups rwlist/rolist control whether or not the volume is ro for those users.

miscellaneous options [syntax: options:option1,option2]:

<$CX> prodos -> make compatible with appleII clients. crlf -> enable crlf translation for TEXT files. noadouble -> don't create .AppleDouble unless a resource fork needs to be created. ro -> mount the volume as read-only. mswindows -> enforce filename restrictions imposed by MS Windows. this will also invoke a default codepage (iso8859-1) if one isn't already specified. nohex -> don't do :hex translations for anything except dot files. specify usedots as well if you want that turned off. note: this option makes the / character illegal. usedots -> don't do :hex translation for dot files. note: when this option gets set, certain file names become illegal. these are .Parent and anything that starts with .Apple. also, dot files created on the unix side are marked invisible. limitsize -> limit disk size reporting to 2GB. this is here for older macintoshes using newer appleshare clients. yucko. codepage:filename -> load filename from nls directory. dbpath:path -> store the database stuff in the following path. password:password -> set a volume password (8 characters max) EOF netatalk/images/ 40755 0 1 0 7177354675 11723 5ustar rootbinnetatalk/images/icon.gif100400 0 1 4060 7177354675 13425 0ustar rootbinGIF89a00!QR|ṔΏx\ݠqp778 +-1lpxX\b׼ =>>OPPCDDܞ Ә   -/- )*)KLKXYXǗ^V2  UUTuutȕ۵ /ЦO@;)YD ܢ؟ &٭0m`9͕ԙ ؜ ,1, ƴ٘|m7&ĊӖ͓gȍuH1tP }PѪsnd Y (x5`uӠIҩhdN,ʪ ooogggcccaaa^^^[[[ZZZGGG@@@333000$$$ ,00 H`t.໗" 9#J!ǿDȱ#Av1B(#"0D3@1-/vƿzl֔3tBSһX5p.)Jz5 q1f\Tb#=0FsJ0+Q!,:P`;#'.1 Zđ.LUּG ݦdILM.MeRtڔIc̙A.+W۠UT)sO|xA%?Z}zF(JʢoDOx_?#uK':`6RHF3PuC7`DȰ@쀑 Ԗ?;a /0R 3Y8u8ވ!3]sQ 8# 會DÏ =^]&cA ICL0X CG >$ 4 0 F6K=V}c73FSPqER:EXXވO'$>43jaŨU\+[|!}E,$,EUPAjA*;Bx1C 2, 0Ì4-e@Gިp q 121KCxER4O(/0 1C1$CP}:C)SFH5Ts5̳);E9Ќ<аAh3@5pM5@  :wpM7k>T @08d) 'WXbS갺[ 8 H%K C YH@D<7Ab(!q=$C," L$"},L0 І.Da󙏅z" BT1$a!i!E<" YBXA1v:B(F|tTP [BPB d„Q(DAb"Haa##Jb A+ P|b#1TbP<9M"(D $Q JhH7( i* $IE*V\*A/ZUBGA+La S,H@;netatalk/images/icon_4.gif100644 0 1 714 7177354436 13637 0ustar rootbinGIF89a00!,00 ͋TVc}hc#+vݸh%A 9@Z K9=Ze/L|]7&[gƵg*U{ag&2%' XXSgGG(Fu²Ys)y9%33:` { zK;;`{P ܪ0m۬ D-1,,L:-N.l-gn6<, e#Kˆ 5AchZi5rI#+vwBTHB O 1=cY4MO|*閦NwʇR,tFN^ uiY\'QZ' 3q꾅w Jd~ qup(EJnj;)kV!Ȓ1;netatalk/images/what.gif100644 0 1 474 7177354436 13432 0ustar rootbinGIF89a00UUU999rrr㎎!Made with GIMP,00I8ͻρ 1AS!p r+r}co3~ q ;"%BԆ];netatalk/lang/ 40755 0 1 0 7202567571 11365 5ustar rootbinnetatalk/lang/en100644 0 1 7746 7202555575 12026 0ustar rootbin lang=en index_title=Netatalk Apple File/Print Services interfaces_title=Netatalk Interfaces volumes_title=Netatalk Volumes servers_title=Netatalk Servers users_title=Netatalk Users edit_file_title=Edit File Share author=Matthew Keller module_author=Matthew Keller homepage=netatalk.sourceforge.net copyright=see module source license=GPL global_ON=ON global_OFF=OFF global_Delete=Delete global_Save=Save index_interfaces=Edit Interfaces index_users=Show Current Users index_sharename=Share Name index_path=Path index_secutity=Security index_create_file_share=Create New File Share index_delete_file_share=Delete File Share index_max_users=Specifies the maximum number index_max_users_2=of connections to allow for this afpd index_stop_service=Stop Service index_not_running=Service is not running index_start_service=Start Service index_running_service=Service is running index_restart=Restart Netatalk index_stop=Stop Netatalk index_start_but=Start Apple File Sharing index_ever=The Atalk program $1 was not found on your system. Maybe Atalk is not installed, or your module configuration incorrect. index_global=Global Configurations and Options index_servername=Server-Name index_tcp=TCP/IP index_ddp=Apple-Talk index_port=Port index_address=address index_newServer=Create New Server server_header=Servers index_misc=Miscellaneous Options index_server=Servers restart_failed=Restart failed start_1=$1 failed edit_header=Create New Apple File Share edit_tableheader=Share Infos edit_sharename=Share name edit_homedirectory=Home Directories share edit_directory=Directory edit_Casefold=Casefold Options edit_Casefolddefault=default edit_Casefoldtolower=tolower -> lowercases names in both directions edit_Casefoldtoupper=toupper -> uppercases names in both directions edit_Casefoldxlatelower=xlatelower -> client sees lowercase, server sees uppercase edit_Casefoldxlateupper=xlateupper -> client sees uppercase, server sees lowercase edit_CodePage=Code Page edit_CodePagedefault=default edit_MisceOptions=Miscellaneous Options edit_MisceOptionsprodos= prodos -> make compatible with appleII clients edit_MisceOptionscrlf= crlf -> enable crlf translation for TEXT files edit_MisceOptionsnoadouble= noadouble -> don't create .AppleDouble unless a resource fork needs to be created edit_MisceOptionsro= ro -> mount the volume as read-only edit_MisceOptionsmswindows= mswindows -> enforce filename restrictions imposed by MS Windows edit_MisceOptionsnohex= nohex -> don't do :hex translations for anything except dot files edit_MisceOptionsusedots= usedots -> don't do :hex translation for dot files edit_MisceOptionslimitsize= limitsize -> limit disk size reporting to 2GB. edit_DataBase=Database Path edit_Password=Password edit_Allow=Allow edit_users=Users edit_groups=Groups edit_Deny=Deny edit_Rolist=RO edit_Rwlist=RW edit_Save=Save edit_create=Create edit_delete=Delete edit_return=Share List modi_tableheader=Modify File Shre modi_save=Save create_server_header=Create New Server create_server_tabelheader=Create New Servers create_server_ServerName=Server Name create_server_localhost=Name of localhost create_server_TCP=TCP/IP create_server_AppleTalk=Apple Talk create_server_Port=Port create_server_Address=Address create_server_return=Servers create_server_pass=Set Password create_server_setpass=Save Password create_server_lgmesg=Login Message editexist_server_header=Edit Server editexist_server_table_header=Edit Server misc_options_header=Miscellaneous Options file=file not_readable=not readable give_correct_path=Please give correct path indicate_sharename=Please indicate sharename copy_failed=Failed to copy file delete_failed=Can't delete file not_valid_path=Not Valid Path no_path=No Path volume_help=Volume Config Help module_status=This module is officially listed as BETA. disclaim_power=This is a powerful module and it doesn't ask "Are you Sure?" questions. If you say "Do it", it does. If you wanted confirmation boxes, you should've stuck with MacOS Servers. netatalk/lang/de100644 0 1 436 7202555537 11757 0ustar rootbinfile=datei not_readable=nicht einlesbar give_correct_path=Bitte geben Sie einen Pfad oder korrekten Pfad ein indicate_sharename=Sie haben vergessen einen Share-Name anzugeben copy_failed=Kopieren fehlgeschlagen delete_failed=Konnte nicht Datei lschen not_valid_path=Kein gltiger Pfad netatalk/config100644 0 1 712 7202604023 11671 0ustar rootbinapplevolumedefault_c=/usr/local/atalk/etc/AppleVolumes.default applevolumesystem_c=/usr/local/atalk/etc/AppleVolumes.system atalkd_d=/usr/local/atalk/sbin/atalkd select_minUsers= netatalk_c=/etc/pam.d/netatalk papd_c=/usr/local/atalk/etc/papd.conf select_maxUsers= papd_d=/usr/local/atalk/sbin/papd atalk_nls= atalk_start=/etc/rc.d/init.d/atalk afpd_c=/usr/local/atalk/etc/afpd.conf afpd_d=/usr/local/atalk/sbin/afpd atalk_c=/usr/local/atalk/etc/atalkd.conf netatalk/config-suse-linux100400 0 1 712 7202604041 13771 0ustar rootbinapplevolumedefault_c=/usr/local/atalk/etc/AppleVolumes.default applevolumesystem_c=/usr/local/atalk/etc/AppleVolumes.system atalkd_d=/usr/local/atalk/sbin/atalkd select_minUsers= netatalk_c=/etc/pam.d/netatalk papd_c=/usr/local/atalk/etc/papd.conf select_maxUsers= papd_d=/usr/local/atalk/sbin/papd atalk_nls= atalk_start=/etc/rc.d/init.d/atalk afpd_c=/usr/local/atalk/etc/afpd.conf afpd_d=/usr/local/atalk/sbin/afpd atalk_c=/usr/local/atalk/etc/atalkd.conf netatalk/config.info100644 0 1 620 7177564552 12650 0ustar rootbinatalk_start=Atalk init script atalkd_d=Path to atalkd papd_d=Path to papd afpd_d=Path to afpd applevolumedefault_c=Path to AppleVolumes.default applevolumesystem_c=Path to AppleVolumes.system afpd_c=Path to afpd.conf atalk_c=Path to atalkd.conf papd_c=Path to papd.conf netatalk_c=Path to netatalk.pamd atalk_nls=Path to NLS folder select_minUsers=Select min. Users select_maxUsers=Select max. Users netatalk/delete_FShare.cgi100644 0 1 1474 7202575747 13731 0ustar rootbin#!/usr/bin/perl # save_fshare.cgi # Save a new file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; &ReadParse(); if($in{delete}){ $info = $in{delete}; $lines = deleteLine($datei,$info); } &redirect(""); netatalk/delete_fshare.cgi100644 0 1 2450 7202575747 14024 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for editing or creating a new directory share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; $path="NoPath"; $s="homes"; &header("Delete Apple File Share", ""); print"

\n"; print "


\n"; print"

\n"; print "

\n"; print"

Select File Share

\n"; print"\n"; print "
\n"; print "
\n"; print"

\n"; &footer("","Share List"); netatalk/edit_fshare.cgi100755 0 1 15235 7202575747 13537 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for creating a new file share # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Some code (C) 2000 by Sven Mosimann/EcoLogic # Contributions from: # Sven Mosimann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # This module is mostly Sven's with my overhaul additions and changed. # I had written one as well, but liked his O-O approach to things (after # some tweaking). require './netapple-lib.pl'; require 'netatalk-funcs.pl'; $path="NoPath"; $s="homes"; &header($text{'edit_header'},"", "intro", 1, 1, undef, output_credits()); print"

\n"; print "


\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'edit_tableheader'}
\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"; print "\n"; print "\n"; print "\n"; print "\n"; print"\n"; print "\n", &user_chooser_button("allow_users", 1); print ""; print"\n"; print "\n",&group_chooser_button("allow_groups", 1); print"\n"; print "\n", &user_chooser_button("deny_users", 1); print ""; print"\n"; print "\n",&group_chooser_button("deny_groups", 1); print"\n"; print "\n", &user_chooser_button("rolist_users", 1); print ""; print"\n"; print "\n",&group_chooser_button("rolist_groups", 1); print"\n"; print "\n", &user_chooser_button("rwlist_users", 1); print ""; print"\n"; print "\n",&group_chooser_button("rwlist_groups", 1); print "
$text{'edit_sharename'}"; print "\n"; print "   \n"; print "$text{'edit_homedirectory'}\n"; print "
$text{'edit_directory'}\n"; print &file_chooser_button("path", 1); print "

$text{'edit_Casefold'} \n"; print"  $text{'edit_Casefolddefault'}
\n"; print"  $text{'edit_Casefoldtolower'}
\n"; print"  $text{'edit_Casefoldtoupper'}
\n"; print"  $text{'edit_Casefoldxlatelower'}
\n"; print"  $text{'edit_Casefoldxlateupper'}
$text{'edit_CodePage'}\n"; print"
$text{'edit_MisceOptions'} \n"; print"  $text{'edit_MisceOptionsprodos'}
\n"; print"  $text{'edit_MisceOptionscrlf'}
\n"; print"  $text{'edit_MisceOptionsnoadouble'}
\n"; print"  $text{'edit_MisceOptionsro'}
\n"; print"  $text{'edit_MisceOptionsmswindows'}
\n"; print"  $text{'edit_MisceOptionsnohex'}
\n"; print"  $text{'edit_MisceOptionsusedots'}
\n"; print"  $text{'edit_MisceOptionslimitsize'}
\n"; print "
$text{'edit_DataBase'}\n"; print &file_chooser_button("dbpath", 1); print "
$text{'edit_Password'}\n"; print "
$text{'edit_Allow'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Deny'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Rolist'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Rwlist'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s

\n"; print "\n"; print""; print "\n"; print "
\n"; print"

"; print "
\n"; print"

\n"; &footer("index.cgi",$text{'edit_return'}); netatalk/index.cgi100755 0 1 10140 7202575747 12357 0ustar rootbin#!/usr/bin/perl # # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Some code (C) 2000 by Sven Mosimann/EcoLogic # Contributions from: # Sven Mosimann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # This module inherited from the Webmin Module Template 0.79.1 do '../web-lib.pl'; # Webmin's lib require 'netatalk-funcs.pl'; # Matt's lib + merges do './netapple-lib.pl'; # Sven's lib ## put in ACL checks here if needed &header($text{'index_title'}, "", undef, 1, 1, undef, output_credits()); print "$text{volume_help}

\n"; print "


\n"; print "

$text{module_status}

\n"; print "

$text{disclaim_power}

\n"; if (!-x $config{'atalkd_d'}) { print &text('index_ever'," $config{'netapple'}", "/config.cgi?$module_name"); print "

\n


\n"; &footer("/", $text{'index'}); exit; } if (!-x $config{'papd_d'}) { print &text('index_ever'," $config{'netapple'}", "/config.cgi?$module_name"); print "

\n


\n"; &footer("/", $text{'index'}); exit; } if (!-x $config{'afpd_d'}) { print &text('index_ever'," $config{'netapple'}", "/config.cgi?$module_name"); print "

\n


\n"; &footer("/", $text{'index'}); exit; } $share= "shareName="; $Path="path="; #Test ob alle Files vorhanden sind #mgk: Test whether all files available are ##Tabelle zeichnen und infos auslesen-------------------- ##mgk: Table draw and information select print"

"; print "\n"; print ""; print""; print"\n"; print" \n"; foreach $s (open_afile()){ $sharename = getShareName($s); $path = getPath($s); print"\n"; print""; print""; print""; } print "
$text{'index_sharename'}$text{'index_path'}
$sharename$path
\n"; print"

"; print "$text{'index_create_file_share'}\n   "; print "$text{'index_delete_file_share'}\n"; print"

"; print"


\n"; print"

\n"; print"

$text{index_global}

\n"; my @links = ("servers.cgi","edit_interfaces.cgi","show_users.cgi", "misc_opt.cgi"); my @titles = ($text{'index_server'},$text{'index_interfaces'},$text{'index_users'},$text{'index_misc'}); my @icons = ("images/what.gif","images/interface.gif","images/procs.gif","images/icon_4.gif"); icons_table(\@links, \@titles, \@icons); print"
\n"; print"
\n"; #pid finden @atlkd = &find_byname("atalkd"); if(@atlkd){ print "
\n"; print "\n"; print "\n"; print "\n"; print "
$text{'index_running_service'}
$text{'index_restart'}
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "
$text{'index_stop_service'}
$text{'index_stop'}
\n"; } else{ print "
\n"; print "\n"; print "\n"; print "\n"; print "
$text{'index_not_running'}
$text{'index_start_service'}
\n"; } print"

"; print "


\n"; &footer("/", $text{'index'}); ### END of index.cgi ###. netatalk/modi_fshare.cgi100644 0 1 24147 7202575747 13541 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for editing directory share # # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Some code (C) 2000 by Sven Mosimann/EcoLogic # Contributions from: # Sven Mosimann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # This module is mostly Sven's with my overhaul additions and changed. # I had written one as well, but liked his O-O approach to things (after # some tweaking). require './netapple-lib.pl'; require 'netatalk-funcs.pl'; &ReadParse(); open_afile(); $path="NoPath"; $s="homes"; @usres =(); @groups =(); &header($text{'edit_file_title'}, "", "intro", 1, 1, undef,output_credits()); if($in{shareName}){ $Old_shareName= $in{shareName}; } if($in{path}){ $Old_path=$in{path}; } $Casefold = getCasfold($Old_shareName); $Codepage = getCodepage($Old_shareName); $Options = getOptions($Old_shareName); #mgk: added new options while( $Options =~ /\b([A-Za-z]+)\b/g) { if($1 eq "prodos"){ $prodos=1; } elsif($1 eq "crlf"){ $crlf=1; } elsif($1 eq "noadouble"){ $noadouble=1; } elsif($1 eq "ro"){ $ro=1; } elsif($1 eq "mswindows"){ $mswindows=1; } elsif($1 eq "nohex"){ $nohex=1; } elsif($1 eq "usedots"){ $usedots=1; } elsif($1 eq "limitsize"){ $limitsize=1; } } $Database = getDatabase($Old_shareName); $Password = getPassword($Old_shareName); #mgk: reconstruction for new system (new loops, 0-9 characters and '$') $Allow = getAllow($Old_shareName); while( $Allow =~ /([A-Za-z0-9@\$]+)/g) { #print "users : $1
\n"; if($1 =~ /^([@].*)/){ if($1 =~ /([A-Za-z0-9\$]+)/){ push(@allow_groups,$1); } } else{ push(@allow_users,$1); } } $Deny = getDeny($Old_shareName); while( $Deny =~ /([A-Za-z0-9@\$]+)/g) { if($1 =~ /^([@].*)/){ if($1 =~ /([A-Za-z0-9\$]+)/){ push(@deny_groups,$1); } } else{ push(@deny_users,$1); } } $Rolist = getRolist($Old_shareName); while( $Rolist =~ /([A-Za-z0-9@\$]+)/g) { if($1 =~ /^([@].*)/){ if($1 =~ /([A-Za-z0-9\$]+)/){ push(@rolist_groups,$1); } } else{ push(@rolist_users,$1); } } $Rwlist = getRwlist($Old_shareName); while( $Rwlist =~ /([A-Za-z0-9@\$]+)/g) { if($1 =~ /^([@].*)/){ if($1 =~ /([A-Za-z0-9\$]+)/){ push(@rwlist_groups,$1); } } else{ push(@rwlist_users,$1); } } $Oldpath= "oldpath"; print "
\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "\n"; print "
$text{'modi_tableheader'}
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n", $limitsize eq "1" ? "checked" : ""; print "\n"; printf "\n"; print "\n"; printf "\n"; print"\n"; print "\n", join(' ', @allow_users), &user_chooser_button("allow_users", 1); print "\n"; print"\n"; print" \n", join(' ', grep { !/^@/ } @allow_groups), &group_chooser_button("allow_groups", 1); print"\n"; print "\n", join(' ', @deny_users), &user_chooser_button("deny_users", 1); print "\n"; print"\n"; print" \n", join(' ', grep { !/^@/ } @deny_groups), &group_chooser_button("deny_groups", 1); print"\n"; print "\n", join(' ', @rolist_users), &user_chooser_button("rolist_users", 1); print "\n"; print"\n"; print" \n", join(' ', grep { !/^@/ } @rolist_groups), &group_chooser_button("rolist_groups", 1); print"\n"; print "\n", join(' ', @rwlist_users), &user_chooser_button("rwlist_users", 1); print "\n"; print"\n"; print" \n", join(' ', grep { !/^@/ } @rwlist_groups), &group_chooser_button("rwlist_groups", 1); print "
$text{'edit_sharename'}"; printf "\n", $Old_path ne "~" ? "checked" : ""; printf "\n", $Old_path ne "~" ? $Old_shareName: ""; printf "$text{'edit_homedirectory'}\n", $Old_path eq "~" ? "checked" : ""; print "
$text{'edit_directory'}\n"; printf "\n", $Old_path ne "~" ? $Old_path : "" ; print &file_chooser_button("path", 1); print "

$text{'edit_Casefold'} \n"; printf "  $text{'edit_Casefolddefault'}
\n", $Casefold eq "" ? "checked" : ""; printf "  $text{'edit_Casefoldtolower'}
\n", $Casefold eq "tolower" ? "checked" : ""; printf "  $text{'edit_Casefoldtoupper'}
\n", $Casefold eq "toupper" ? "checked" : ""; printf "  $text{'edit_Casefoldxlatelower'}
\n", $Casefold eq "xlatelower" ? "checked" : ""; printf "  $text{'edit_Casefoldxlateupper'}
\n", $Casefold eq "xlateupper" ? "checked" : ""; print"
$text{'edit_CodePage'}\n"; print"
$text{'edit_MisceOptions'} \n"; printf "  $text{'edit_MisceOptionsprodos'}
\n", $prodos eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionscrlf'}
\n", $crlf eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionsnoadouble'}
\n", $noadouble eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionsro'}
\n", $ro eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionsmswindows'}
\n", $mswindows eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionsnohex'}
\n", $crlf eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionsusedots'}
\n", $usedots eq "1" ? "checked" : ""; printf "  $text{'edit_MisceOptionslimitsize'}
$text{'edit_DataBase'}\n", $Database ne "" ? $Database : ""; print &file_chooser_button("dbpath", 1); print "
$text{'edit_Password'}\n", $Password ne "" ? $Password : ""; print "
$text{'edit_Allow'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Deny'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Rolist'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s
$text{'edit_Rwlist'}$text{'edit_users'} \n"; printf " %s
  $text{'edit_groups'} \n"; printf " %s

\n"; print"\n"; print "\n"; print"\n"; print "\n"; print"
\n"; print"\n"; print"
\n"; print "


\n"; print"

\n"; &footer("",$text{'edit_return'}); netatalk/module.info100644 0 1 424 7202573226 12655 0ustar rootbinname=Netatalk Manager depends=0.81 category=servers os_support=solaris redhat-linux debian-linux slackware-linux aix suse-linux hpux freebsd osf1 irix open-linux openserver unixware turbo-linux openbsd corel-linux cobalt-linux lfs-linux desc=Netatalk Apple File/Print Sharing netatalk/netapple-lib.pl100644 0 1 64531 7202575750 13501 0ustar rootbin#!/usr/bin/perl #Common function for editing the atalk config files # # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Some code (C) 2000 by Sven Mosimann/EcoLogic # Contributions from: # Sven Mosimann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # This module is almost all Sven's. I'm merging it into "the" # Netatalk webmin lib module. I've had to update it to the "new" # config file format, as it was using the older format. # I've held off merging some of this, but it is on my TODO. Before this # module comes out of "BETA" I want ONE function module, not 2. do '../web-lib.pl'; use File::Copy; use CGI qw/:standard/; &init_config("netapple"); #mgk: datei means "file" $datei = $config{'applevolumedefault_c'}; $temp = "$datei.temp"; $slash="/"; $pername = (); $hostname= `hostname`; #strcut volume_format verwaltet alle Informationen einer "Zeile" #mgk: struct volume_format administers all information of a " line " use Class::Struct; struct volume_format => { path=>'$', name=>'$', casefold=>'$', codepage=>'$', options=>'$', dbpath=>'$', password=>'$', allow=>'$', deny=>'$', rwlist=>'$', rolist=>'$', }; $|=1; #damit users aufgelistet werden knnen #mgk: so that users to be listed can foreign_require("useradmin","user-lib.pl"); #------------------------------------------------------------------------------------- #liest file AppleVolumes.default aus und durchfortset es nach #mgk: file AppleVolumes.default picks out and through away set it after #Infos #------------------------------------------------------------------------------------- sub open_afile { local(@rv,$line); #mgk: File $datei not readable open(FH,"<$datei") || die "$text{file} $datei $text{not_readable}"; while(defined($line = ) ) { local($longName); #Zeile mit Fortsetzungszeichen einlesen #mgk: Line with continuation characters read in chomp $line; if($line =~ s/\\$// ) { $line .=; redo unless eof(FH); } #Zeile einlesen welche mit '~' oder '/' beginnen #mgk: Which read line in with ' ~ ' or ' / ' begin if($line=~/^[$slash~]+/ ) { #neue Klasse volume_format erzeugen #mgk: new class volume_format produces my $volume = volume_format->new(); #home dir abfangen #mgk: home dir intercept if($line =~ /^([~]+)/) { $volume->path($1); $volume->name("Home directory"); push(@rv,$volume->name); } $count=0; #alle anderes Dir abfangen #mgk: all other dir intercept #mgk: added '\$' to maintain compatibility # with new format while($line=~/([A-Za-z$slash"\$=~,-_.0-9]+)/g ) { #PATH einlesen #mgk: path read in if($count == 0) { ##print "PATH: $1\n"; $volume->path($1); if($1 eq "~"){ $count++; } } #Dir Name einlesen #mgk: dir name read in elsif($count == 1) { if($1 =~/^(["])/){ #print"Line $line
\n"; if($line =~/"(.*?)"/){ #$volume->name($1); #print"INFO $1
\n"; $volume->name($1); push(@rv,$1); } } else{ $volume->name($1); push(@rv,$1); } } #options einlesen #mgk: options read in #mgk: Changed to the new ":" delimiter, # added new allow,deny,rwlist,rolist options, # added the '\$' to the allowable characters elsif($1 =~/(\w+):([A-Za-z$slash\$@,.0-9]+)/) { if("casefold" eq $1){ $volume->casefold($2); } elsif("codepage" eq $1){ $volume->codepage($2); } elsif("options" eq $1){ $volume->options($2); } elsif("allow" eq $1){ $volume->allow($2); } elsif("deny" eq $1){ $volume->deny($2); } elsif("rwlist" eq $1){ $volume->rwlist($2); } elsif("rolist" eq $1){ $volume->rolist($2); } elsif("dbpath" eq $1){ $volume->dbpath($2); } elsif("password" eq $1){ $volume->password($2); } } $count++; } #vorhandene Options in $volume schreiben #mgk: available options in $volume write $pername{$volume->name} = $volume; } } close(FH); return @rv; } #------------------------------------------------------------------------------ #returns shareName #------------------------------------------------------------------------------ sub getShareName { my ($var1) = @_; $shareName = 1; if ($rp = $pername{$var1}){ $shareName = $rp->name; } return $shareName; } #------------------------------------------------------------------------------ #gibt Path zurck #mgk: give Path back #------------------------------------------------------------------------------ sub getPath { my ($var1) = @_; $path =0; if ($rp = $pername{$var1}){ $path = $rp->path; } return $path; } #------------------------------------------------------------------------------ #gibt casefold zurck #mgk: give casefold back #------------------------------------------------------------------------------ sub getCasfold { my ($var1) = @_; $casefold = ""; if ($rp = $pername{$var1}){ $casefold = $rp->casefold; } return $casefold; } #------------------------------------------------------------------------------ #gibt Options zurck #give options back #------------------------------------------------------------------------------ sub getOptions { my ($var1) = @_; $Options =""; if ($rp = $pername{$var1}){ $Options = $rp->options; } return $Options; } #------------------------------------------------------------------------------ #gibt Codepage zurck #give codepage back #------------------------------------------------------------------------------ sub getCodepage { my ($var1) = @_; $Codepage =""; if ($rp = $pername{$var1}){ $Codepage = $rp->codepage; } return $Codepage; } #------------------------------------------------------------------------------ #gibt Access zurck #give access back #mgk: Updated and added 3 new funcs to allow for the new # allow/deny/rolist/rwlist format #------------------------------------------------------------------------------ #mgk: legacy sub getAccess { return getAllow(@_); } sub getAllow { my ($var1) = @_; $Access =""; if ($rp = $pername{$var1}){ $Access = $rp->allow; } return $Access; } sub getDeny { my ($var1) = @_; $Access =""; if ($rp = $pername{$var1}){ $Access = $rp->deny; } return $Access; } sub getRwlist { my ($var1) = @_; $Access =""; if ($rp = $pername{$var1}){ $Access = $rp->rwlist; } return $Access; } sub getRolist { my ($var1) = @_; $Access =""; if ($rp = $pername{$var1}){ $Access = $rp->rolist; } return $Access; } #------------------------------------------------------------------------------ #gibt Access zurck #mgk: give password back #------------------------------------------------------------------------------ sub getPassword { my ($var1) = @_; $Password =""; if ($rp = $pername{$var1}){ $Password = $rp->password; } return $Password; } #------------------------------------------------------------------------------ #gibt Database Path zurck #mgk: give database path back #------------------------------------------------------------------------------ sub getDatabase { my ($var1) = @_; $Database =""; if ($rp = $pername{$var1}){ $Database = $rp->dbpath; } return $Database; } #------------------------------------------------------------------------------ #erfasst alle dateien im Verzeichnis /atalk/nls/ #mgk: enters all files in the directory /atalk/nls/ #------------------------------------------------------------------------------ sub getMacCodeFiles { local(@rv,@rs,$direntry,$realDir); #$near="/nls"; #$dir=$config{'atalk_nls'}; $realDir=$config{'atalk_nls'}; opendir(DIR,$realDir); foreach $direntry (readdir(DIR)){ next if $direntry eq "."; #Sonderverzeichnisse #mgk: Special directories next if $direntry eq ".."; #ignorieren #mgk: ignore if(-f "$realDir/$direntry"){ push(@rv,"$realDir/$direntry"); } } closedir(DIR); return @rv; } #------------------------------------------------------------------------------ #berprft ob angegebener Pfad existiert #mgk: checked whether indicated path exists #------------------------------------------------------------------------------ sub getPathOK { my ($var1) = @_; local($rv); $rv =0; opendir(DIR,$var1); if(readdir(DIR)){ $rv = "1"; } closedir(DIR); return $rv; } #------------------------------------------------------------------------------ #listet alle users mit ID >=500 auf #mgk: list all users with ID >=500 #------------------------------------------------------------------------------ sub getUsers { local(@rv); @ulist = foreign_call("useradmin","list_users"); for($i=0; $i<@ulist; $i++){ if( $ulist[$i]->{'uid'}> 499 || $ulist[$i]->{'uid'} eq 0){ $user= $ulist[$i]->{'user'}; push(@rv,$user); } } return @rv; } #------------------------------------------------------------------------------ #listet alle Gruppen mit ID >=100auf plus root mot gid = 0 #mgk: list all groups with ID >=100 and root gid == 0 #------------------------------------------------------------------------------ sub getGroups { local(@rv); @glist = foreign_call("useradmin","list_groups"); for($i=0; $i<@glist; $i++){ if( $glist[$i]->{'gid'}> 99 || $glist[$i]->{'gid'} eq 0){ $group = $glist[$i]->{'group'}; push(@rv,$group); } } return @rv; } #------------------------------------------------------------------------------ #schreibt neues File Share #mgk: writes new file Share #indem neue Zeile generiert wird oder Zeilen generiert werden #mgk: as new line is generated or lines to be generated # #------------------------------------------------------------------------------ sub writeNewFileShare { $space =" "; local($line_1,$line_2,$setSlash,$zeichen); #&ReadParse(); my ($in) = @_; $zeichen='"'; #homes oder anderer Path #mgk: homes or other Path if($in{homes}){ $line_1 ="~ "; } else{ $pathli = $in{path}; if($pathli && 1 eq getPathOK($pathli)){ $path = $in{path}; $line_1 = $path; $line_1 .= " "; } else{ showMessage($text{give_correct_path}); return 0; } #Share Name erfassen #mgk: Enter share name if($in{share}){ $sharename=$in{share}; $line_1.=$zeichen; $line_1.=$sharename; $line_1.=$zeichen; $line_1.=" "; #mgk: zeichen == characters } else{ showMessage($text{indicate_sharename}); return 0; } } #options einlesen--------------------- #mgk: options read in if($in{casefold_options} && $in{casefold_options} ne "default"){ $caseFoldOption =$in{casefold_options}; $line_1.="casefold:"; $line_1.=$caseFoldOption; } if($in{codepage} && $in{codepage} ne "default"){ $codePage =$in{codepage}; $line_1.=" codepage:"; $line_1.=$codePage; } if($in{misc_options}){ $line_1.=" options:"; foreach $name(param(misc_options)){ @values = param(misc_options); $input_misc = join(',',@values); } $line_1.=$input_misc; } if($in{password}){ $PassWord=$in{password}; $line_1.=" password:"; $line_1.=$PassWord; } if($in{dbpath}){ $dataPath=$in{dbpath}; $line_1.=" dbpath:"; $line_1.=$dataPath; } #mgk: revamped the rest of this function to properly handle the # newer format (allow/deny/rwlist/rolist) #Allow if($in{allow_users} || $in{allow_groups} ){ $line_1.=" allow:"; if($in{allow_users}){ $line_1.=join(',',split(/\s+/, $in{allow_users})); } #Komma zwischen Gruppen Users setzen #mgk: Comma between groups of users set if($in{allow_users} && $in{allow_groups} ){ $line_1.=",@"; } elsif($in{allow_groups}) { #mgk: added to handle other case $line_1.="@"; } if($in{allow_groups}){ $line_1.=join(',@',split(/\s+/,$in{allow_groups})); } } #Deny if($in{deny_users} || $in{deny_groups} ){ $line_1.=" deny:"; if($in{deny_users}){ $line_1.=join(',',split(/\s+/, $in{deny_users})); } #Komma zwischen Gruppen Users setzen #mgk: Comma between groups of users set if($in{deny_users} && $in{deny_groups} ){ $line_1.=",@"; } elsif($in{deny_groups}) { #mgk: added to handle other case $line_1.="@"; } if($in{deny_groups}){ $line_1.=join(',@',split(/\s+/,$in{deny_groups})); } } #rolist if($in{rolist_users} || $in{rolist_groups} ){ $line_1.=" rolist:"; if($in{rolist_users}){ $line_1.=join(',',split(/\s+/, $in{rolist_users})); } #Komma zwischen Gruppen Users setzen #mgk: Comma between groups of users set if($in{rolist_users} && $in{rolist_groups} ){ $line_1.=",@"; } elsif($in{rolist_groups}) { #mgk: added to handle other case $line_1.="@"; } if($in{rolist_groups}){ $line_1.=join(',@',split(/\s+/,$in{rolist_groups})); } } #rwlist if($in{rwlist_users} || $in{rwlist_groups} ){ $line_1.=" rwlist:"; if($in{rwlist_users}){ $line_1.=join(',',split(/\s+/, $in{rwlist_users})); } #Komma zwischen Gruppen Users setzen #mgk: Comma between groups of users set if($in{rwlist_users} && $in{rwlist_groups} ){ $line_1.=",@"; } elsif($in{rwlist_groups}) { #mgk: added to handle other case $line_1.="@"; } if($in{rwlist_groups}){ $line_1.=join(',@',split(/\s+/,$in{rwlist_groups})); } } writeLine( $line_1 ,$line_2); } #------------------------------------------------------------------------------ #schreibt neue Zeile in AppleVolumes.default #mgk: new line writes in AppleVolumes.default # #var1 erste Linie welche zu schreiben ist #mgk: var1 first line to write #var2 zweite Linie welche zu schreiben ist #mgk: var2 second line to write #solle keine zweite geschrieben werden Linie ,var2=" " bergeben #mgk: no second line, var2 = " " is to be written transferred #----------------------------------------------------------------------------- sub writeLine() { my ($var1,$var2) = @_; @line = getLines($datei); copy($datei,$temp) or die "$text{copy_failed}: $!"; &lock_file("$temp"); open(OLD,"<$datei") || die "$text{file} $datei $text{not_readable}"; open(NEW,">$temp") || die "$text{file} $temp $text{not_readable}"; while(){ if($.== @line[0]){ #if($.== 17){ print NEW "$var1\n"; } print NEW $_; } close(OLD); close(NEW); &unlock_file("$temp"); #umbenans rename($datei,"$datei.orig"); rename($temp,$datei); #lschen der Datei AppleVolumes.sven.old #mgk: delete the file AppleVolumes.sven.old unlink("$datei.orig") or die "$text{delete_failed}: $datei.orig\n"; } #------------------------------------------------------------------ #lscht eine bestimmte Zeile in File #mgk: deletes a certain line in file #mgk: #$var1 =>Datei #mgk: $var1 => File #$var2 =>Anfang der Zeile, welche gefunden werden soll (sprich Verzeichnis) #mgk: var2 => Start of the line, which is to be found (speak directory) #------------------------------------------------------------------ sub deleteLine(){ my ($var1,$var2) = @_; local($counter,$lines); if( ! defined $var1){ return 0; } if( ! defined $var2){ return 0; } @lines = getLines($datei,$var2); copy( $datei , $temp) or die "$text{copy_failed}: $!"; &lock_file("$temp"); open(OLD,"<$datei") || die "$text{file} $datei $text{not_readable}"; open(NEW,">$temp") || die "$text{file} $datei $text{not_readable}"; $counter =0; while(){ if($counter != @lines[0] && $counter != @lines[1] ){ print NEW $_; } $counter++; } close(OLD); close(NEW); &unlock_file("$temp"); #umbenans rename($datei,"$datei.orig"); rename($temp,$datei); #lschen der Datei AppleVolumes.sven.old #mgk: Delete the file AppleVolumes.sven.old unlink("$datei.orig") or die "$text{delete_failed}: $datei.orig\n"; return 1; } #------------------------------------------------------------------ #Seite, welche einen Eingabefehler anzeigen soll #mgk: Page, which displays input error # #$var1 Info-Text #------------------------------------------------------------------ sub showMessage { my ($var1) = @_; &header("Warning", ""); print "

**** $var1 ***

\n"; &footer("","Share List"); } #------------------------------------------------------------------ #Funktion zum erfassen der maximalen zulssigen user # in file atalk #mgk: Function to enter the max. admissible user # #------------------------------------------------------------------ sub getMaxUser { local(@rv,$atalkstart.$start.$path,$currentString,$zeichen,$zeichen2,@rv,$connections); $atalkstart = $config{'atalk_start'}; $connections="-c"; $path= $config{'afpd_d'}; #"/usr/sbin/afpd"; $start="startproc"; $currentString ="\t"; $zeichen="/"; $zeichen2='$'; push(@rv,"0"); open(OLD,"<$atalkstart") || die "$text{file} $old $text{not_readable}"; while() { if($_ =~ /$path/ && /$start/) { if($_ =~/$connections\s*([0-9]*)/){ shift(@rv); push(@rv,$1); } } } return @rv; close(OLD); } #------------------------------------------------------------------ #Funktion liest File afpd.conf ein und speichert Infos in struct #afpd in array @afpd[server,tcp(tcp,notcp),ddp(ddp,noddp),port,address] # in file atalk #mgk:Function reads file in afpd.conf and stores # #------------------------------------------------------------------ sub readAfpd { local($fileToRead,$zeichen1,@afpd,@afpd_all); local($notcp,$nodpp,$port,$address,$logimMessage,$savepass,$setpass); push(@afpd_all,1); $hostname= `hostname`; $zeichen1='-'; $notcp="-notcp";$nodpp="-noddp",$port="-port";$address="-address"; $logimMessage="-loginmesg";$savepass="savepassword";$setpass="setpassword"; $fileToRead = $config{'afpd_c'}; open(FH,"<$fileToRead") || die "$text{file} $fileToRead $text{not_readable}"; while() { #Zeile mit Fortsetzungszeichen einlesen #mgk: Line with continuation characters read in if($_=~/(^[0-9A-Za-z$zeichen1"].*)/ ){ #print "$1
\n"; @afpds = ($hostname,"-tcp","-ddp","-","-"); #server auslesen #mgk: servers select if($1 =~ /^(\w+)/) { @afpds[0]=$1; #print"Servername $1
\n"; } if($_ =~ /$notcp/){ @afpds[1]=$notcp; } if($_ =~ /$nodpp/){ @afpds[2]=$nodpp; } if($_ =~ /$port\s*([0-9]*)/){ @afpds[3]=$1; } if($_ =~ /$address\s*([0-9.]*)/){ @afpds[4]=$1; } push(@afpd_all,@afpds); } } close(FH); return @afpd_all; } #------------------------------------------------------------------ #Funktion liest File afpd.conf ein und speichert Infos in struct #afpd in array @afpd[server,tcp(tcp,notcp),ddp(ddp,noddp),port,address] # in file atalk #mgk: Function reads file in afpd.conf and stores # #------------------------------------------------------------------ sub getAllAfpd { local($fileToRead,$zeichen1,@afpd,@afpd_all); local($notcp,$nodpp,$port,$address,$logimMessage,$savepass,$setpass); push(@afpd_all); $hostname= `hostname`; $zeichen1='-'; $notcp="-notcp";$nodpp="-noddp",$port="-port";$address="-address"; $logimMessage="-loginmesg";$savepass="savepassword";$setpass="setpassword"; $fileToRead = $config{'afpd_c'}; open(FH,"<$fileToRead") || die "Datei $fileToRead nicht einlesbar"; while() { #Zeile mit Fortsetzungszeichen einlesen #mgk: Line with continuation characters read in if($_=~/(^[0-9A-Za-z$zeichen1"].*)/ ){ #print "$1
\n"; @afpd = ($hostname,"-tcp","-ddp","-","-","","-","-"); #server auslesen #mgk: servers select if($1 =~ /^(\w+)/) { @afpd[0]=$1; } if($_ =~ /$notcp/){ @afpd[1]=$notcp; } if($_ =~ /$nodpp/){ @afpd[2]=$nodpp; } if($_ =~ /$port\s*([0-9]*)/){ @afpd[3]=$1; } if($_ =~ /$address\s*([0-9.]*)/){ @afpd[4]=$1; } if($_ =~ /$logimMessage\s*"(.*?)"/){ @afpd[5]=$1; } if($_ =~ /$savepass/){ @afpd[6]=$savepass; } if($_ =~ /$setpass/){ @afpd[7]=$setpass; } push(@afpd_all,@afpd); } } close(FH); return @afpd_all; } #------------------------------------------------------------------------------ #Funktion hngt eine neue Linie an file #mgk: Function hangs a new line on file # # #$var1 Linie die hinzugefgt wird #mgk: var1 Line is added #$var2 File an das Linie angehngt werden soll #mgk: var2 File at line should be attached #------------------------------------------------------------------------------ sub addLineToFile() { my ($var1,$var2) = @_; local($temporary,$lin); $lin = getLinesSpezFile($var1); $temporary = "$var1.temp"; copy($var1,$temporary) or die "$text{copy_failed}: $!"; lock_file("$temporary"); open(OLD,"<$var1") || die "$text{file} $var1 $text{not_readable}"; open(NEW,">$temporary") || die "$text{file} $temporary $text{not_readable}"; while(){ print NEW $_; if($.== $lin){ print NEW "$var2\n"; } } close(OLD); close(NEW); unlock_file("$temporary"); #umbenans rename($var1,"$var1.orig"); rename($temporary,$var1); #lschen der Datei AppleVolumes.sven.old #mgk: Delete file AppleVolumes.sven.old unlink("$var1.orig") or die "$text{delete_failed}: $var1.orig\n"; } #------------------------------------------------------------------ #gibt die Anzahl Zeilen des angeben Files zurck oder einer bestimmten Zeile #mgk: gives the number of lines, indicates files back or to a certain line # #$var1 File das zu ffenen ist #$var2 Linie, von welcher die ZeilenNummer zu ermitteln ist #mgk: Line, from which the line number is to determine #------------------------------------------------------------------ sub getLines(){ my ($var1,$var2,$var3) = @_; local($counter,$output,@rv); $counter = 0;$output = 1; #Testen ob die Varibel bergeben worden ist #mgk: Tests whether the variable transferred(?) if( ! defined $var1){ return 0; } #Testen ob die zweite #mgk: Tests the second elsif( ! defined $var2){ open(FH,"<$var1") || die return 0; while(defined($line = ) ){ if($line=~/^[$slash~]+/ ){ push(@rv,$output); } $output++; } } else{ open(FH,"<$var1") || die return 0; while(defined($line = ) ) { if($line=~/^[$slash~]+/ ){ if($line =~ /([A-Za-z$slash=~,-_\\]+)/){ if($1 =~ /$var2/){ $output = $counter; push(@rv,$output); $output++; if($line =~ /[\\]/){ push(@rv,$output); } else{ push(@rv,-1); } } } } $counter++; } } return @rv; } #------------------------------------------------------------------ #lscht eine bestimmte Zeile in File #mgk: deletes a certain line in file #$var1 =>Datei #mgk: File #$var2 =>Anfang der Zeile, welche gefunden werden soll (sprich Verzeichnis) #mgk: Start of the line, which is to be found (speak directory) #------------------------------------------------------------------ sub deleteSpezLine(){ my ($var1,$var2) = @_; local($temporary); if( ! defined $var1){ return 0; } if( ! defined $var2){ return 0; } $line = getSpezLine($var1,$var2); $temporary="$var1.temp"; #print "Lines : @lines[1] @lines[0]
\n"; copy($var1, $temp) or die "$text{copy_failed}: $!"; lock_file("$temporary"); open(OLD,"<$var1") || die "$text{file} $datei $text{not_readable}"; open(NEW,">$temporary") || die "$text{file} $temp $text{not_readable}"; while(){ if($. != $line ){ print NEW $_; } } close(OLD); close(NEW); unlock_file("$temporary"); #umbenans rename($var1,"$var1.orig"); rename($temporary,$var1); #lschen der Datei AppleVolumes.sven.old #mgk: delete the file unlink("$var1.orig") or die "$text{delete_failed}: $var1.orig\n"; return 1; } sub getSpezLine { my ($var1,$var2) = @_; local($counter,$outputli); $counter = 0; open(OLD,"<$var1") || die "$text{file} $datei $text{not_readable}"; while(){ $counter++; if($_ =~ /^$var2/ ){ $outputli=$counter; } } close(OLD); return $outputli; } #------------------------------------------------------------------------------- #Funktion ermittelt Anzahl Linien eines Files #mgk: Function determines number of lines of the files # #$var1 File das auszulesen ist #mgk: $var1 is the file #------------------------------------------------------------------------------- sub getLinesSpezFile() { my ($var1) = @_; local($counting); $counting = 0; #Testen ob die Varibel bergeben worden ist #mgk: Test the file open(FileHandle,"<$var1") || die return 0; while(){ $counting++; } close(FileHandle); return $counting; } sub getHostName(){ return $hostname; } netatalk/restart.cgi100644 0 1 1643 7202575747 12721 0ustar rootbin#!/usr/bin/perl # restart.cgi # Kill all smbd and nmdb processes and re-start them # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; @atalkpids = &find_byname("atalkd"); kill('TERM', @atalkpids ); $rv = system("$config{atalkd_d} # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. use CGI qw/:standard/; require './netapple-lib.pl'; &ReadParse(); #test ob pfad existiert #mgk: test whether the path exists $all=$in;$ok =0; if($in{path}){ $pathli = $in{path}; $ok = getPathOK($pathli); if($ok ne 1){ showMessage ("$text{not_valid_path}"); } } else{ showMessage ("$text{no_path}"); } if($in{oldpath} && $ok eq 1){ $info = $in{oldpath}; deleteLine($datei,$info); writeNewFileShare($in); } &redirect(""); netatalk/save_fshare.cgi100644 0 1 1444 7202575747 13522 0ustar rootbin#!/usr/bin/perl # save_fshare.cgi # Save a new or edited file share # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. use CGI qw/:standard/; require './netapple-lib.pl'; &ReadParse(); writeNewFileShare($in); &redirect(""); netatalk/settings.cgi100644 0 1 14030 7202607051 13067 0ustar rootbin#!/usr/bin/perl # save_fshare.cgi # Save a new or edited file share # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. use CGI qw/:standard/; do '../web-lib.pl'; #do './netapple-lib.pl'; use File::Copy; &init_config("netapple"); $afpd_path= $config{'afpd_d'}; #"/usr/sbin/afpd"; $start="startproc"; $currentString ="\t"; $zeichen="/"; $zeichen2='$'; #$atalk_datei=$atalk_old="/home/sven/dev/perl/atalk"; #$atalk_datei=$atalk_old="/sbin/init.d/atalk"; $atalk_datei=$atalk_old= $config{'atalk_start'}; $atalk_temp = "$atalk_datei.temp"; &ReadParse(); if($in{maxClients}){ $maxusers = $in{maxClients}; #getLinetoModify(); writeAtalkLine($maxusers); } &redirect("misc_opt.cgi"); #------------------------------------------------------------------------------- #schreibt neue Anzahl max users in File atalk # mgk: write new max users to file atalk # # #$var1 = Anzahl users # mgk: = max users #------------------------------------------------------------------------------ sub writeAtalkLine() { my ($var1) = @_; local($lineNumber,$newString,$lineNumbertoModify); if( ! defined $var1){ return 0; } $lineNumbertoModify = 0; $lineNumbertoModify = getAtalkLinetoModify(); #print"Debug Output $lineNumbertoModify \n"; $newString =newString($lineNumbertoModify,$var1); #print"Debug Output $newString \n"; deleteAtalkLine($atalk_datei,$lineNumbertoModify); #da eine linie fehlt eine #$lineNumbertoModify--; #name der temporr Datei # mgk: temporary file #Kopie anegen # mgk: copy again copy( $atalk_datei , $atalk_temp) or die "$text{copy_failed}: $!"; #erfassen der Zeile welche gendert werden sol lock_file("$atalk_temp"); open(OLD,"<$atalk_datei") || die "$text{file} $atalk_datei $text{not_readable}"; open(NEW,">$atalk_temp") || die "$text{file} $atalk_temp $text{not_readable}"; while(){ if($.eq $lineNumbertoModify ){ print NEW "\t$newString\n"; # if($var2 ne " "){ # print NEW "$var2\n"; # } } print NEW $_; } close(OLD); close(NEW); unlock_file("$atalk_temp"); #umbenans rename($atalk_datei,"$atalk_datei.orig"); rename($atalk_temp,$atalk_datei); #lschen der Datei AppleVolumes.sven.old unlink("$atalk_datei.orig") or die "$text{delete_failed}\n"; } #-------------------------------------------------- #Erfassen der Zeile, welche neuen Eintrag bentigt #mgk: Enter the line, which the new entry needs # #keine Parameter bergabe alle bentigten sind global #mgk: no parameters are transfered. All necessary are global #return value Linien-Number #mgk: Return value is the line number #-------------------------------------------------- sub getAtalkLinetoModify { local($count,$lines,$connections); $connections="-c"; $count = 0;$lines =0; open(OLD,"<$atalk_old") || die "$text{file} $atalk_old $text{not_readable}"; while() { #eine Zeile mehr $count++; if($_ =~ /$afpd_path/ && /$start/){ $lines = $count; } } close(OLD); return $lines; } #----------------------------------------------------------- #Methode kreiert neuen String der die Anzahl users definiert #mgk: Method creates new string that is the number of users defined # # #$var1 Zeilen Nummer welche editert werden soll #mgk: Lines number which should be editted #$var2 max users #return neuer String #mgk: return new string #----------------------------------------------------------- sub newString { my ($var1,$var2) = @_; local($currentString,$maxUsers,$line); if( ! defined $var1){ return 0; } if( ! defined $var2){ return 0; } $maxUsers = getUsers(); open(OLD,"<$atalk_old") || die "$text{file} $atalk_old $text{not_readable}"; $. =0; do {$line = } until $. eq $var1 || eof; while($line=~/([A-Za-z0-9$zeichen$zeichen2|=-]*)/g){ if($afpd_path eq $1){ $currentString.="$afpd_path -c $var2"; $currentString.=" "; } elsif($1 ne "" && $1 ne $afpd_path && $1 ne "-c" && $1 ne "$maxUsers"){ $currentString.=$1; $currentString.=" "; } } close(OLD); return $currentString; } #------------------------------------------------------------------ #lscht eine bestimmte Zeile in File #mgk: deletes a certain line in file #$var1 =>Datei #mgk: file #$var2 =>Zeilen NR, welche gelscht werden soll #mgk: Lines which should be deleted #------------------------------------------------------------------ sub deleteAtalkLine(){ my ($var1,$var2) = @_; local($counter,$lines); if( ! defined $var1){ return 0; } if( ! defined $var2){ return 0; } #print "Lines : @lines[1] @lines[0]
\n"; copy( $var1 , $atalk_temp) or die "$text{copy_failed}: $!"; lock_file("$atalk_temp"); open(OLD,"<$atalk_datei") || die "$text{file} $atalk_datei $text{not_readable}"; open(NEW,">$atalk_temp") || die "$text{file} $atalk_temp $text{not_readable}"; $counter =0; while(){ $counter++; if($counter != $var2 ){ print NEW $_; } } close(OLD); close(NEW); unlock_file("$atalk_temp"); #umbenans rename($atalk_datei,"$atalk_datei.orig"); rename($atalk_temp,$atalk_datei); #lschen der Datei AppleVolumes.sven.old # mgk: delete file unlink("$atalk_datei.orig") or die "$text{delete_failed}\n"; return 1; } sub getUsers { local($users,$connections,$users); $connections="-c"; $users=0; open(OLD,"<$atalk_datei") || die "$text{file} $atalk_datei $text{not_readable}"; while() { if($_ =~ /$afpd_path/ && /$start/) { if($_ =~/$connections\s*([0-9]*)/){ #shift(@rv); $users=$1; } } } return $users; close(OLD); } netatalk/start.cgi100644 0 1 1664 7202575747 12375 0ustar rootbin#!/usr/bin/perl # start.cgi # Attempt to start the smbd and nmbd processes # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; $whatfailed = $text{'start_0'}; $rv = system("$config{atalkd_d} # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; @atalkpids = &find_byname("atalkd"); kill('TERM', @atalkpids ); &redirect(""); netatalk/.directory100644 0 1 77 7177354436 12517 0ustar rootbin# KDE Config File [KDE Desktop Entry] BgImage= MiniIcon= Icon= netatalk/credits.txt100644 0 1 1627 7202573143 12735 0ustar rootbinNetatalk Webmin Module Credits - GPL Protected Webmin Module for Netatalk Maintainer and Lead Coder - Matthew Keller ~ Accept/Reject and then Edit and Commit submitted Code ~ Original code set ~ File locking ~ Language neutralization ~ Consistent Interface Design ~ Various modules ~ Various documentation ~ etc. Significant Code Contribution - EcoLogic [http://www.ecologic.ch/] Sven Mosimann ~ Object Oriented Design ~ SuSE Configs and testing ~ Good portion of the volume config interface (old config style) ~ Nearly all of the committed server config interface I'm always looking for GPL'd code submissions and tweaks, so feel free to play and send on anything you've got. I'm pretty picky about what code I use and what code I don't ('tis the job of the maintainer), but I'd love to look over anything you've got. M@ netatalk/create_server.cgi100644 0 1 6517 7202575747 14073 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for creating a new file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # require './netapple-lib.pl'; require 'netatalk-funcs.pl'; $path="NoPath"; $s="homes"; &header($text{'create_server_header'},"", "intro", 1, 1, undef, output_credits()); print"

\n"; print "


\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'create_server_tabelheader'}
\n"; print "\n"; print "\n"; print""; print""; print""; print""; print""; print""; print""; print""; print"\n"; print""; print""; print""; print""; print""; print""; print""; print""; print""; print""; print""; print""; print""; print "
$text{'create_server_ServerName'}"; print "\n"; print "   \n"; print "   $text{'create_server_localhost'}\n"; print "
$text{'create_server_TCP'}$text{'global_ON'}"; print"$text{'global_OFF'}"; print"$text{'create_server_AppleTalk'}$text{'global_ON'}"; print"$text{'global_OFF'}"; print"
$text{'create_server_Port'} $text{'create_server_Address'}
$text{'create_server_pass'}$text{'global_ON'}"; print"$text{'global_OFF'}"; print"$text{'create_server_setpass'}$text{'global_ON'}"; print"$text{'global_OFF'}"; print"
$text{'create_server_lgmesg'}

\n"; print"
\n"; print "\n"; print "\n"; print "


\n"; print "
\n"; print"

\n"; &footer("servers.cgi",$text{'create_server_return'}); netatalk/edit_server.cgi100644 0 1 5006 7202575747 13545 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for creating a new file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # NOTE: require './netapple-lib.pl'; require 'netatalk-funcs.pl'; $path="NoPath"; $s="homes"; &header($text{'create_server_header'},"", "intro", 1, 1, undef, output_credits()); print"

\n"; print "


\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'create_server_tabelheader'}
\n"; print "\n"; print "\n"; print""; print""; print""; #print" "; #print""; print""; print""; print""; print""; print""; print""; #print""; #print""; print""; print""; print""; print "
$text{'create_server_ServerName'}"; print "\n"; print "   \n"; print "   $text{'create_server_localhost'}\n"; print "
TCP/IPON"; print"OFF"; print"
Apple TalkON"; print"OFF"; print"
Port
Address

\n"; print "\n"; print""; print "\n"; print "\n"; print""; print"
"; print "


\n"; print"

\n"; &footer("servers.cgi","Servers"); netatalk/save_newServer.cgi100644 0 1 4532 7202575747 14233 0ustar rootbin#!/usr/bin/perl # save_fshare.cgi # Save a new or edited file share # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. use CGI qw/:standard/; require './netapple-lib.pl'; &ReadParse(); $hostname=getHostName(); $filetoedit = $config{'afpd_c'}; if($in{old_servername}){ $server=$in{old_servername}; $server =~ /$hostname*/ ? $server="-" : "" ; } deleteSpezLine($filetoedit ,$server); createNewLine(); addLineToFile($filetoedit); &redirect("servers.cgi"); #&footer("",$text{'edit_return'}); #----------------------------------------------------------------------------- #Funktion kreiert neue Zeile mit Eintrag fr Server #in File afpd.conf # mgk: Function creates new line with entry for servers # in afpd.conf # # #----------------------------------------------------------------------------- sub createNewLine(){ local($newString); if($in{server}){ $newString="- "; } else{ if($in{servername}){ $newString=$in{servername}; $newString.=" "; } else{ error($text{'save_newServer_errorMessage'}); } } if($in{tcpip}){ $newString.=$in{tcpip}; $newString.=" "; } if($in{ddp}){ $newString.=$in{ddp}; $newString.=" "; } if($in{port}){ $newString.=$in{port}; $newString.=" "; } if($in{address}){ $newString.=$in{address}; $newString.=" "; } if($in{savepassword} || $in{setpassword}){ $newString.=" passwd: "; } if($in{setpassword}){ $newString.=$in{setpassword}; $newString.=" "; } if($in{savepassword} && $in{setpassword}){ $newString.=","; } if($in{savepassword}){ $newString.=$in{savepassword}; $newString.=" "; } if($in{logmesg}){ $newString.="-loginmesg \""; $newString.=$in{logmesg}; $newString.="\" "; } addLineToFile($filetoedit,$newString); } netatalk/editexist_server.cgi100644 0 1 12763 7202575747 14652 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for creating a new file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; require 'netatalk-funcs.pl'; &ReadParse(); &header($text{'editexist_server_header'},"", "intro", 1, 1, undef,output_credits()); print"

\n"; $ddpon="-ddp"; $tcp="-tcp"; $hostname=getHostName();#$hostli;#chomp($host); #$hostname="dellux"; if($in{offset}){ #print"Offset: $in{offset}
\n"; $offset=$in{offset}; #print"Port : $port
\n"; } else{ #print"Offset: 0
\n"; $offset=0; } @allServer = getAllAfpd(); $off= $offset*7; $off= $off+$offset; for($i=0;$i<=7;$i++){ if($i eq 0){ $servername= @allServer[$off]; } elsif($i eq 1){ $tcpip= @allServer[$off]; } elsif($i eq 2){ $ddp= @allServer[$off]; } elsif($i eq 3){ $address= @allServer[$off]; } elsif($i eq 4){ $port= @allServer[$off]; } elsif($i eq 5){ $loginmesg= @allServer[$off]; } elsif($i eq 6){ $savepassw= @allServer[$off]; } elsif($i eq 7){ $setpass= @allServer[$off]; } $off++; } print "


\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'editexist_server_table_header'}
\n"; print "\n"; print "\n"; print""; print""; print""; print""; print""; print""; print""; print""; printf"", $port =~ /[0-9]/ ? $port : ""; print""; printf"", $address =~ /[0-9.]/ ? $address : ""; print""; print""; print"";$setpassw="setpassword"; printf""; print"";$savepass="savepassword"; printf""; print""; print""; print""; print""; print""; print "
$text{'create_server_ServerName'}"; printf "\n", $servername =~ /$hostname*/ ? "" : "checked"; print "   \n"; #print "   $text{'create_server_localhost'}\n"; printf "   $text{'create_server_localhost'}\n", $servername =~ /$hostname*/ ? "checked" : ""; print "
$text{'create_server_TCP'}"; printf"$text{'global_ON'}", $tcpip =~ /$tcp*/ ? "checked" : ""; printf"$text{'global_OFF'}", $tcpip =~ /$tcp*/ ? "" : "checked"; print"$text{'create_server_AppleTalk'}"; printf"$text{'global_ON'}", $ddp =~ /$ddpon*/ ? "checked" : ""; printf"$text{'global_OFF'}", $ddp =~ /$ddpon*/ ? "" : "checked"; print"
$text{'create_server_Port'} $text{'create_server_Address'}
$text{'create_server_pass'}$text{'global_ON'}", $setpass =~ /$setpassw/ ? "checked" : ""; printf"$text{'global_OFF'}", $setpass =~ /$setpassw/ ? "" : "checked"; print"$text{'create_server_setpass'}$text{'global_ON'}", $savepassw =~ /$savepass*/ ? "checked" : ""; printf"$text{'global_OFF'}", $savepassw =~ /$savepass*/ ? "" : "checked"; print"
$text{'create_server_lgmesg'}

\n"; print "\n"; print""; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print""; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print"
"; print "


\n"; print"

\n"; &footer("servers.cgi","Servers"); netatalk/delete_server.cgi100644 0 1 2046 7202575747 14063 0ustar rootbin#!/usr/bin/perl # save_fshare.cgi # Save a new or edited file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. use CGI qw/:standard/; require './netapple-lib.pl'; &ReadParse(); $hostname=getHostName(); $filetoedit = $config{'afpd_c'}; if($in{servername}){ $server=$in{servername}; $server =~ /$hostname*/ ? $server="-" : "" ; } deleteSpezLine($filetoedit ,$server); #addLineToFile($filetoedit); redirect("servers.cgi"); #&footer("",$text{'edit_return'}); netatalk/servers.cgi100644 0 1 4771 7202575747 12733 0ustar rootbin#!/usr/bin/perl # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. do './netapple-lib.pl'; require 'netatalk-funcs.pl'; &header($text{'server_header'}, "", "intro", 1, 1, undef,output_credits()); #Test ob alle Files vorhanden sind # mgk: Test whether all files are available ##Tabelle zeichnen und infos auslesen-------------------- # mgk: Table draw and information select print"


"; print"
\n"; #link damit die verschieden Server spezifiziert werden knnen # mgk: link to the different server options @Servers = readAfpd(); if(@Servers[1] ne ""){ print "\n"; print ""; print""; print"\n"; print""; print""; print""; print" \n"; print""; $offset = 0; $servername="servername=";$tcp="tcpip=";$ddp="ddp=";$port="port=";$address="address=";$offsetStr="offset="; for($i=0;$i<=$#Servers;$i++){ if( ($i%5 ==0) && ($i ne 0)){ print""; $i++; $pointer=$i; $offset++; print""; } elsif($i ne 0 && $i >1){ print""; } elsif($i ne 0 && $i eq 1){ $pointer=$i; print""; } } print "
$text{'index_servername'}$text{'index_tcp'}$text{'index_ddp'}$text{'index_port'}$text{'index_address'}
$Servers[$i]
$Servers[$i]$Servers[$i]$Servers[$i]
\n"; } print"

"; print "$text{'index_newServer'}\n   "; print"

"; print"


\n"; &footer("index.cgi", "Share List"); ### END of servers.cgi ###. netatalk/misc_opt.cgi100644 0 1 3357 7202575747 13056 0ustar rootbin#!/usr/bin/perl # edit_fshare.cgi # Display a form for creating a new file share # # Netatalk Webmin Module # Copyright (C) 2000 by Sven Mosimann/EcoLogic # Some code (C) 2000 by Matthew Keller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. require './netapple-lib.pl'; require 'netatalk-funcs.pl'; &header($text{'misc_options_header'},"", "intro", 1, 1, undef,output_credits()); print"

\n"; print "


\n"; print"

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'misc_options_header'}
\n"; print "\n"; print "\n"; print "\n"; print "
$text{'index_max_users'}
$text{'index_max_users_2'}
"; @users = getMaxUser(); $minUser=$config{'select_minUsers'}; $maxUsers=$config{'select_maxUsers'}; print"

\n"; print "

\n"; print "
\n"; print"

\n"; &footer("","$text{'edit_return'}"); netatalk/show_users.cgi100755 0 1 3501 7202575747 13434 0ustar rootbin#!/usr/bin/perl # # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Portion of code contributed from somebody-- I can't find the e-mail # referencing who it was though. *sigh* # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # do '../web-lib.pl'; require 'netatalk-funcs.pl'; $|=1; &init_config(); &header($text{users_title}, "", undef, 1, 1,undef,output_credits()); &ReadParse(); print "

\n"; print "

You click \"Kill\", and they are gone.

"; print "
\n"; if($in{kill}) { $in{kill} =~ s/\D//gi; if(kill(9,$in{kill})) { print "

User killed

\n"; } else { print "

User NOT killed!!!

\n"; } } open(USERS, "/bin/ps aucx|"); while() { chop ; next if !/afpd/; split ; push(@users,join(":::",$_[0],$_[1],$_[8])); } close USERS; print "

There are currently " . scalar(@users) . " users connected.

\n"; print "\n"; # width=100%>\n"; print "\n"; print startform(); foreach (sort @users) { #username,PID,date split ":::"; print "\n"; } print "\n"; print "
UserConnected SinceKill
$_[0] $_[2]
\n"; print "

\n"; &footer("index.cgi",$text{'edit_return'}); netatalk/netatalk-funcs.pl100755 0 1 4334 7202604402 14005 0ustar rootbin # Netatalk Webmin Module # Copyright (C) 2000 by Matthew Keller # Some code (C) 2000 by Sven Mosimann/EcoLogic # Contributions from: # Sven Mosimann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. sub output_credits { my $line="Module Credits
\nSpecial Thanks:
\nEcoLogic\n"; return "$line"; } sub create_entry { my($filename,$line)=@_; unless($filename and $line) { die "Not enough infor for create_entry to work!\n"; } lock_file("$filename"); open(CNF,">>$filename") or die "Cannot open $filename for appending: $!\n"; print CNF "$line\n"; close CNF; unlock_file("$filename"); } sub startform { return "
"; } sub checkbox { my $out="".join('',@_).""; } sub TR { return "".join('',@_).""; } sub center { return "
".join('',@_)."
"; } sub parse_str { my $line = shift @_; local(@lines,@ret); @lines = split(/\s/,$line); while($#lines >= 0) { $_ = $lines[0]; while((/^\"/ && !/\"$/) || ($_ eq "\"")) { $a = shift(@lines); $lines[0] = "$a $lines[0]"; $_ = $lines[0]; } $lines[0] =~ s/\"//g; push(@ret,shift(@lines)); } return @ret; } 1; netatalk/version100644 0 0 40 7202603352 12301 0ustar rootrootNetatalk Webmin Module 0.9 BETA netatalk/README.txt100644 0 0 361 7202603652 12420 0ustar rootroot This module requires: ~ Webmin version 0.81 or better. (older versions may work, but are not supported) ~ Netatalk 1.4b2+asun2.1.4 or better (older versions may work, but are not supported) Read the credits.txt and status.txt.