Samba Status und Logauswertung fertiggestelllt
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sat, 31 Mar 2007 13:26:25 +0000 (13:26 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sat, 31 Mar 2007 13:26:25 +0000 (13:26 +0000)
ausserdem eine Menge Codefixes
einige Icons eingefügt

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@474 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

html/cgi-bin/samba.cgi
html/cgi-bin/upnp.cgi
html/html/images/dialog-error.png [new file with mode: 0755]
html/html/images/edit-redo.png [new file with mode: 0755]
html/html/images/network-error.png [new file with mode: 0755]
html/html/images/user-multiple.png [new file with mode: 0755]
html/html/images/user-option-add.png [new file with mode: 0755]
html/html/images/user-option-remove.png [new file with mode: 0755]
lfs/linux-igd
src/misc-progs/sambactrl.c

index af8152a..e45ca26 100644 (file)
@@ -22,6 +22,8 @@ my %netsettings = ();
 my %ovpnsettings = ();
 my $message = "";
 my $errormessage = "";
+my @Logs = qx(ls /var/log/samba/);
+my $Log ='kein Log ausgewählt';
 my $defaultoption= "[Share]\npath = /var/samba/share1\ncomment = Share - Public Access\nbrowseable = yes\nwriteable = yes\ncreate mask = 0777\ndirectory mask = 0777\nguest ok = yes\npublic = yes\nforce user = samba";
 my $userentry = "";
 my @user = ();
@@ -53,6 +55,7 @@ my @shareline = ();
 my $sharefile = "/var/ipfire/samba/shares";
 my $EOF = qx(cat $sharefile | wc -l);
 my $Status = qx(/usr/local/bin/sambactrl smbstatus);
+$Status=~s/\n/<br \/>/g;
 
 @shares = `grep -n '^\\[' $sharefile`;
 foreach $shareentry (@shares)
@@ -65,8 +68,8 @@ foreach $shareentry (@shares)
 #################################### Initialisierung von Samba Variablen fr global Settings ###############################
 
 $sambasettings{'WORKGRP'} = 'homeip.net';
-$sambasettings{'NETBIOSNAME'} = 'IPFIRE';
-$sambasettings{'SRVSTRING'} = 'Samba Server running on IPFire 2.0';
+$sambasettings{'NETBIOSNAME'} = 'IPFire';
+$sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.0';
 $sambasettings{'INTERFACES'} = '';
 $sambasettings{'SECURITY'} = 'share';
 $sambasettings{'OSLEVEL'} = '65';
@@ -74,14 +77,17 @@ $sambasettings{'GREEN'} = 'on';
 $sambasettings{'BLUE'} = 'off';
 $sambasettings{'ORANGE'} = 'off';
 $sambasettings{'VPN'} = 'off';
-$sambasettings{'WINSSRV'} = "$netsettings{'GREEN_NETADDRESS'}";
-$sambasettings{'WINSSUPPORT'} = 'off';
+$sambasettings{'WINSSRV'} = '';
+$sambasettings{'WINSSUPPORT'} = 'on';
+$sambasettings{'REMOTEANNOUNCE'} = '';
 $sambasettings{'PASSWORDSYNC'} = 'off';
 $sambasettings{'OTHERINTERFACES'} = '';
 $sambasettings{'GUESTACCOUNT'} = 'samba';
 $sambasettings{'MAPTOGUEST'} = 'Never';
+$sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:10 winbind:2';
 ### Values that have to be initialized
-$cgisettings{'ACTION'} = '';
+$sambasettings{'ACTION'} = '';
+$sambasettings{'LOGLINES'} = '15';
 
 ################################################## Samba PDC Variablen #####################################################
 
@@ -100,7 +106,7 @@ my $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 ############################################################################################################################
-############################################# Samba Rootskript aufrufe fr SU-Actions ######################################
+############################################# Samba Rootskript aufrufe fr SU-Actions #######################################
 
 if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system("/usr/local/bin/sambactrl smbuserdisable $sambasettings{'NAME'}");}
 if ($sambasettings{'ACTION'} eq 'smbuserenable'){system("/usr/local/bin/sambactrl smbuserenable $sambasettings{'NAME'}");}
@@ -111,11 +117,38 @@ if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/usr/local/bin/sambactrl s
 if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl smbstart");}
 if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");}
 if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");}
-if ($sambasettings{'ACTION'} eq 'globalreset'){system("/usr/local/bin/sambactrl smbglobalreset");}
+if ($sambasettings{'ACTION'} eq 'globalresetyes')
+       {
+       system("/usr/local/bin/sambactrl smbglobalreset");
+       $sambasettings{'WORKGRP'} = 'homeip.net';
+       $sambasettings{'NETBIOSNAME'} = 'IPFire';
+       $sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.0';
+       $sambasettings{'INTERFACES'} = '';
+       $sambasettings{'SECURITY'} = 'share';
+       $sambasettings{'OSLEVEL'} = '65';
+       $sambasettings{'GREEN'} = 'on';
+       $sambasettings{'BLUE'} = 'off';
+       $sambasettings{'ORANGE'} = 'off';
+       $sambasettings{'VPN'} = 'off';
+       $sambasettings{'WINSSRV'} = '';
+       $sambasettings{'WINSSUPPORT'} = 'on';
+       $sambasettings{'REMOTEANNOUNCE'} = '';
+       $sambasettings{'PASSWORDSYNC'} = 'off';
+       $sambasettings{'OTHERINTERFACES'} = '';
+       $sambasettings{'GUESTACCOUNT'} = 'samba';
+       $sambasettings{'MAPTOGUEST'} = 'Never';
+       $sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:10 winbind:2';
+### Values that have to be initialized
+       $sambasettings{'ACTION'} = '';
+       $sambasettings{'LOCALMASTER'} = 'off';
+       $sambasettings{'DOMAINMASTER'} = 'off';
+       $sambasettings{'PREFERREDMASTER'} = 'off';
+       $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
+       }
 
 # smbsafeconf is directly called by the if clause
 
-if ($sambasettings{'ACTION'} eq 'sharesreset')
+if ($sambasettings{'ACTION'} eq 'sharesresetyes')
 {
 system('/usr/local/bin/sambactrl smbsharesreset');
  @Zeilen = ();
@@ -134,17 +167,49 @@ system('/usr/local/bin/sambactrl smbsharesreset');
 }
 
 ############################################################################################################################
-########################################### Samba Benutzer oder PC l�chen #################################################
+################################################ Sicherheitsabfrage für den Reset ##########################################
 
-if ($sambasettings{'ACTION'} eq 'userdelete' && $sambasettings{'NAME'} =~ /\$/)
-{
-system("/usr/local/bin/sambactrl smbpcdelete $sambasettings{'NAME'}");
-}
-elsif ($sambasettings{'ACTION'} eq 'userdelete')
-{
-system("/usr/local/bin/sambactrl smbuserdelete $sambasettings{'NAME'}");
+if ($sambasettings{'ACTION'} eq 'globalreset')
+       {
+       print <<END
+       <table width='95%' cellspacing='0'>
+       <tr><td colspan='2'><br /></td></tr>
+       <tr><td bgcolor='${Header::table1colour}' colspan='3' align='center'><b>Globals zurück setzen?</b>
+       <tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                        Yes <input type='image' alt='Yes' src='/images/edit-redo.png' />
+                                       <input type='hidden' name='ACTION' value='globalresetyes' /></form></td>
+                       <td align='left'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                       <input type='image' alt='No' src='/images/dialog-error.png' /> No 
+                                       <input type='hidden' name='ACTION' value='cancel' /></form></td>
+       </tr>
+       </table>
+END
+;
 }
 
+if ($sambasettings{'ACTION'} eq 'sharesreset')
+       {
+       print <<END
+       <table width='95%' cellspacing='0'>
+       <tr><td colspan='2'><br /></td></tr>
+       <tr><td bgcolor='${Header::table1colour}' colspan='3' align='center'><b>Shares zurück setzen?</b>
+       <tr><td align='right'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                        Yes <input type='image' alt='Yes' src='/images/edit-redo.png' />
+                                       <input type='hidden' name='ACTION' value='sharesresetyes' /></form></td>
+                       <td align='left'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                       <input type='image' alt='No' src='/images/dialog-error.png' /> No 
+                                       <input type='hidden' name='ACTION' value='cancel' /></form></td>
+       </tr>
+       </table>
+END
+;
+       }
+
+############################################################################################################################
+########################################### Samba Benutzer oder PC l�chen #################################################
+
+if ($sambasettings{'ACTION'} eq 'userdelete'){system("/usr/local/bin/sambactrl smbuserdelete $sambasettings{'NAME'}");}
+
 ############################################################################################################################
 ############################################## Samba Share neu anlegen #####################################################
 
@@ -317,11 +382,10 @@ if ($sambasettings{'OTHERINTERFACES'} ne ''){ $sambasettings{'INTERFACES'} .= "
   &General::writehash("${General::swroot}/samba/settings", \%sambasettings);
   
 if ($sambasettings{'PASSWORDSYNC'} eq 'on'){ $sambasettings{'PASSWORDSYNC'} = "true";} else { $sambasettings{'PASSWORDSYNC'} = "false";}
-if ($sambasettings{'WINSSUPPORT'} eq 'on'){ $sambasettings{'WINSSUPPORT'} = "true";} else { $sambasettings{'WINSSUPPORT'} = "false";}
+if ($sambasettings{'WINSSUPPORT'} eq 'on'){ $sambasettings{'WINSSUPPORT'} = "true";$sambasettings{'WINSSRV'} = "";} else { $sambasettings{'WINSSUPPORT'} = "false";}
 if ($sambasettings{'LOCALMASTER'} eq 'on'){ $sambasettings{'LOCALMASTER'} = "true";} else { $sambasettings{'LOCALMASTER'} = "false";}
 if ($sambasettings{'DOMAINMASTER'} eq 'on'){ $sambasettings{'DOMAINMASTER'} = "true";} else { $sambasettings{'DOMAINMASTER'} = "false";}
 if ($sambasettings{'PREFERREDMASTER'} eq 'on'){ $sambasettings{'PREFERREDMASTER'} = "true";} else { $sambasettings{'PREFERREDMASTER'} = "false";}
-if ($sambasettings{'MAPTOGUEST'} eq 'on'){ $sambasettings{'MAPTOGUEST'} = "true";} else { $sambasettings{'MAPTOGUEST'} = "false";}
 
 ############################################################################################################################
 ############################################# Schreiben der Samba globals ##################################################
@@ -355,13 +419,16 @@ null passwords = yes
 bind interfaces only = true
 interfaces = $sambasettings{'INTERFACES'}
 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE
+remote announce = $sambasettings{'REMOTEANNOUNCE'}
 
 username level = 1
 wins support = $sambasettings{'WINSSUPPORT'}
+wins server = $sambasettings{'WINSSRV'}
 
 log file       = /var/log/samba/samba-log.%m
 lock directory = /var/lock/samba
 pid directory = /var/run/
+log level = $sambasettings{'LOGLEVEL'}
        
 preferred master = $sambasettings{'PREFERREDMASTER'}
 domain master = $sambasettings{'DOMAINMASTER'}
@@ -388,6 +455,7 @@ END
  }
 }
   &General::readhash("${General::swroot}/samba/settings", \%sambasettings);
+  
 
 if ($errormessage) {
         &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
@@ -454,7 +522,7 @@ END
 my $key = '';
 foreach $key (sort keys %servicenames)
        {
-       print "<tr><td align='left'>$key";
+       print "<tr><td align='left' width='40%'>$key";
        my $shortname = $servicenames{$key};
        my $status = &isrunning($shortname);
        print "$status";
@@ -468,8 +536,8 @@ END
        }
 
 print <<END
-<tr><td colspan='2'><br /></td></tr>
-<tr><td colspan='2' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<tr><td colspan='3'><br /></td></tr>
+<tr><td colspan='3' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                                                                                                                                <input type='submit' name='ACTION' value='Start' />
                                                                                                                                                <input type='submit' name='ACTION' value='Stop' />
                                                                                                                                                <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
@@ -481,13 +549,14 @@ print <<END
 <table width='95%' cellspacing='0'>
 <tr><td colspan='2'><br /></td></tr>
 <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Basisoptionen</b></td></tr>
-<tr><td align='left'>Workgroup:</td><td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}' size="30" /></td></tr>
-<tr><td align='left'>NetBIOS-Name:</td><td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}' size="30" /></td></tr>
-<tr><td align='left'>Server-String:</td><td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}' size="30" /></td></tr>
-<tr><td align='left'>Interfaces:</td><td>on <input type='radio' name='VPN' value='on' $checked{'VPN'}{'on'} />/
+<tr><td align='left' width='40%'>Workgroup:</td><td align='left'><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>NetBIOS-Name:</td><td align='left'><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>Server-String:</td><td align='left'><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>Log Level:</td><td align='left'><input type='text' name='LOGLEVEL' value='$sambasettings{'LOGLEVEL'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>Interfaces:</td><td align='left'>on <input type='radio' name='VPN' value='on' $checked{'VPN'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='VPN' value='off' $checked{'VPN'}{'off'} /> off |
                                                                                                                                                                                <font size='2' color='$Header::colourovpn'><b>   OpenVpn  -  $ovpnsettings{'DDEVICE'}</b></font></td></tr>
-<tr><td align='left'></td><td>on <input type='radio' name='GREEN' value='on' $checked{'GREEN'}{'on'} />/
+<tr><td align='left' width='40%'></td><td align='left'>on <input type='radio' name='GREEN' value='on' $checked{'GREEN'}{'on'} />/
                                                                                                                                        <input type='radio' name='GREEN' value='off' $checked{'GREEN'}{'off'} /> off |
                                                                                                                                        <font size='2' color='$Header::colourgreen'><b>   $Lang::tr{'green'}  -  $netsettings{'GREEN_DEV'}</b></font></td></tr>
 END
@@ -496,7 +565,7 @@ END
 if (&Header::blue_used())
        {
        print <<END
-       <tr><td align='left'></td><td>on <input type='radio' name='BLUE' value='on' $checked{'BLUE'}{'on'} />/
+       <tr><td align='left' width='40%'></td><td align='left'>on <input type='radio' name='BLUE' value='on' $checked{'BLUE'}{'on'} />/
                                                                                                                                                <input type='radio' name='BLUE' value='off' $checked{'BLUE'}{'off'} /> off |
                                                                                                                                                <font size='2' color='$Header::colourblue'><b>   $Lang::tr{'wireless'}  -  $netsettings{'BLUE_DEV'}</b></font></td></tr>
 END
@@ -506,7 +575,7 @@ END
 if (&Header::orange_used())
        {
        print <<END
-       <tr><td align='left'></td><td>on <input type='radio' name='ORANGE' value='on' $checked{'ORANGE'}{'on'} />/
+       <tr><td align='left' width='40%'></td><td align='left'>on <input type='radio' name='ORANGE' value='on' $checked{'ORANGE'}{'on'} />/
                                                                                                                                                <input type='radio' name='ORANGE' value='off' $checked{'ORANGE'}{'off'} /> off |
                                                                                                                                                <font size='2' color='$Header::colourorange'><b>   $Lang::tr{'dmz'}  -  $netsettings{'ORANGE_DEV'}</b></font></td></tr>
 END
@@ -514,40 +583,44 @@ END
        }
 
 print <<END
-<tr><td align='center'>weitere</td><td><input type='text' name='OTHERINTERFACES' value='$sambasettings{'OTHERINTERFACES'}' size="30" /></td></tr>
+<tr><td align='center' width='40%'>weitere</td><td align='left'><input type='text' name='OTHERINTERFACES' value='$sambasettings{'OTHERINTERFACES'}' size="30" /></td></tr>
 <tr><td align='left'><br /></td><td></td></tr>
 <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Sicherheitsoptionen</b></td></tr>
-<tr><td align='left'>Security:</td><td><select name='SECURITY'>
+<tr><td align='left' width='40%'>Security:</td><td align='left'><select name='SECURITY' style="width: 165px">
                                                                                                                                                                <option value='share' $selected{'SECURITY'}{'share'}>Share</option>
                                                                                                                                                                <option value='user' $selected{'SECURITY'}{'user'}>User</option>
                                                                                                                                                                <option value='domain' $selected{'SECURITY'}{'domain'}>Domain</option>
                                                                                                                                                                <option value='ADS' $selected{'SECURITY'}{'ADS'}>ADS</option>
                                                                                                                                                                <option value='server' $selected{'SECURITY'}{'server'}>Server</option>
                                                                                                                                                                </select></td></tr>
-<tr><td align='left'>Map to guest:</td><td><select name='MAPTOGUEST'>
+<tr><td align='left' width='40%'>Map to guest:</td><td align='left'><select name='MAPTOGUEST' style="width: 165px">
                                                                                                                                                                                <option value='Never' $selected{'MAPTOGUEST'}{'Never'}>Never</option>
                                                                                                                                                                                <option value='Bad User' $selected{'MAPTOGUEST'}{'Bad User'}>Bad User</option>
                                                                                                                                                                                <option value='Bad Password' $selected{'MAPTOGUEST'}{'Bad Password'}>Bad Password</option>
                                                                                                                                                                                </select></td></tr>
-<tr><td align='left'>Unix Passwort Sync:</td><td>on <input type='radio' name='PASSWORDSYNC' value='on' $checked{'PASSWORDSYNC'}{'on'} />/
+<tr><td align='left' width='40%'>Unix Passwort Sync:</td><td align='left'>on <input type='radio' name='PASSWORDSYNC' value='on' $checked{'PASSWORDSYNC'}{'on'} />/
                                                                                                                                                                                                                <input type='radio' name='PASSWORDSYNC' value='off' $checked{'PASSWORDSYNC'}{'off'} /> off</td></tr>
-<tr><td align='left'><br /></td><td></td></tr>
+<tr><td align='left'><br /></td><td /></tr>
 <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Netzwerkoptionen</b></td></tr>
-<tr><td align='left'>OS Level:</td><td><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}' size="30" /></td></tr>
-<tr><td align='left'>WINS-Server:</td><td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>OS Level:</td><td align='left'><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}' size="30" /></td></tr>
+<tr><td align='left' width='40%'>Remote Announce:</td><td align='left'><input type='text' name='REMOTEANNOUNCE' value='$sambasettings{'REMOTEANNOUNCE'}' size="30" /></td></tr>
+END
+;
+if ($sambasettings{'WINSSUPPORT'} eq 'off') {print"<tr><td align='left' width='40%'>WINS-Server:</td><td align='left'><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}' size='30' /></td></tr>";}
+       print <<END
+<tr><td align='left' width='40%'>WINS-Support:</td><td align='left'>on <input type='radio' name='WINSSUPPORT' value='on' $checked{'WINSSUPPORT'}{'on'} />/
+                                                                                                                                                                                               <input type='radio' name='WINSSUPPORT' value='off' $checked{'WINSSUPPORT'}{'off'} /> off</td></tr>
 END
 ;
 
 if ($sambasettings{'SECURITY'} eq 'user')
        {
        print <<END
-       <tr><td align='left'>WINS-Support:</td><td>on <input type='radio' name='WINSSUPPORT' value='on' $checked{'WINSSUPPORT'}{'on'} />/
-                                                                                                                                                                                               <input type='radio' name='WINSSUPPORT' value='off' $checked{'WINSSUPPORT'}{'off'} /> off</td></tr>
-<tr><td align='left'>Local Master:</td><td>on <input type='radio' name='LOCALMASTER' value='on' $checked{'LOCALMASTER'}{'on'} />/
+<tr><td align='left' width='40%'>Local Master:</td><td align='left'>on <input type='radio' name='LOCALMASTER' value='on' $checked{'LOCALMASTER'}{'on'} />/
                                                                                                                                                                                        <input type='radio' name='LOCALMASTER' value='off' $checked{'LOCALMASTER'}{'off'} /> off</td></tr>
-<tr><td align='left'>Domain Master:</td><td>on <input type='radio' name='DOMAINMASTER' value='on' $checked{'DOMAINMASTER'}{'on'} />/
+<tr><td align='left' width='40%'>Domain Master:</td><td align='left'>on <input type='radio' name='DOMAINMASTER' value='on' $checked{'DOMAINMASTER'}{'on'} />/
                                                                                                                                                                                                <input type='radio' name='DOMAINMASTER' value='off' $checked{'DOMAINMASTER'}{'off'} /> off</td></tr>
-<tr><td align='left'>Preferred Master:</td><td>on <input type='radio' name='PREFERREDMASTER' value='on' $checked{'PREFERREDMASTER'}{'on'} />/
+<tr><td align='left' width='40%'>Preferred Master:</td><td align='left'>on <input type='radio' name='PREFERREDMASTER' value='on' $checked{'PREFERREDMASTER'}{'on'} />/
                                                                                                                                                                                                        <input type='radio' name='PREFERREDMASTER' value='off' $checked{'PREFERREDMASTER'}{'off'} /> off</td></tr>
 END
 ;
@@ -567,7 +640,7 @@ END
 print <<END
 </table>
 <table width='10%' cellspacing='0'>
-<tr><td colspan='2'><br /></td></tr>
+<tr><td colspan='3'><br /></td></tr>
 <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                                                                                <input type='hidden' name='ACTION' value=$Lang::tr{'save'} />
                                                                                                <input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif' /></form></td>
@@ -586,9 +659,9 @@ if ($sambasettings{'ACTION'} eq 'globalcaption')
        print <<END
        <table width='95%' cellspacing='0'>
        <tr><td colspan='2'><br /></td></tr>
-       <tr><td><b>Legende:</b></td></tr>
-       <tr><td><img src='/images/floppy.gif' />Einstellungen speichern</td></tr>
-       <tr><td><img src='/images/reload.gif' />Auf default zurueck setzen</td></tr>
+       <tr><td align='center' colspan='2'><b>Legende:</b></td></tr>
+       <tr><td align='right' width='33%'><img src='/images/floppy.gif' /></td><td align='left'>Einstellungen speichern</td></tr>
+       <tr><td align='right' width='33%'><img src='/images/reload.gif' /></td><td align='left'>Auf default zurueck setzen</td></tr>
        </table>
 END
 ;
@@ -615,7 +688,7 @@ if ($sambasettings{'SECURITY'} eq 'user')
        <tr><td colspan='6'><br /></td></tr>
        <tr><td colspan='6' align='left'></td></tr>
        <tr><td bgcolor='${Header::table1colour}' colspan='7' align='left'><b>Benutzerverwaltung</b></td></tr>
-       <tr><td><u>Name</u></td><td><u>Passwort</u></td>
+       <tr><td align='left'><u>Name</u></td><td align='left'><u>Passwort</u></td>
 END
 ;
 
@@ -625,10 +698,10 @@ END
                }
        else
                {
-               print "<td><u>Typ</u></td>";
+               print "<td align='left'><u>Typ</u></td>";
                }
 
-       print "<td><u>Status</u></td><td colspan='3' width='5'><u>Optionen</u></td></tr>";
+       print "<td align='left'><u>Status</u></td><td colspan='3' width='5%' align='center'><u>Optionen</u></td></tr>";
        system('/usr/local/bin/sambactrl readsmbpasswd');
        open(FILE, "</var/ipfire/samba/private/smbpasswd") or die "Can't read user file: $!";
        @user = <FILE>;
@@ -637,29 +710,29 @@ END
        foreach $userentry (sort @user)
                {
                @userline = split( /\:/, $userentry );
-               print "<tr><td align='left'>$userline[0]</td><td>";
+               print "<tr><td align='left'>$userline[0]</td><td align='left'>";
                if ($userline[4] =~ /N/)
                        {
-                       print "nicht gesetzt</td><td>";
+                       print "nicht gesetzt</td><td align='left'>";
                        }
                else
                        {
-                       print "gesetzt</td><td>";
+                       print "gesetzt</td><td align='left'>";
                        }
 
                if ($sambasettings{'DOMAINMASTER'} eq 'off')
                        {
-                       print "</td><td>";
+                       print "</td><td align='left'>";
                        }
                else
                        {
                        if ($userline[0] =~ /\$/)
                                {
-                               print "PC</td><td>";
+                               print "PC</td><td align='left'>";
                                }
                        else
                                {
-                               print "User</td><td>";
+                               print "User</td><td align='left'>";
                                }
                        }
 
@@ -667,7 +740,7 @@ END
                        {
                        print <<END
                        inaktiv</td>
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                        <input type='hidden' name='NAME' value='$userline[0]' />
                                        <input type='hidden' name='ACTION' value='smbuserenable' />
                                        <input type='image' alt='Aktivieren' src='/images/on.gif' />
@@ -679,7 +752,7 @@ END
                        {
                        print <<END
                        aktiv</td>
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                        <input type='hidden' name='NAME' value='$userline[0]' />
                                        <input type='hidden' name='ACTION' value='smbuserdisable' />
                                        <input type='image' alt='Deaktivieren' src='/images/off.gif' />
@@ -695,7 +768,7 @@ END
                else
                        {
                        print <<END
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                        <input type='hidden' name='NAME' value='$userline[0]' />
                                        <input type='hidden' name='ACTION' value='userchangepw' />
                                        <input type='image' alt='Bearbeiten' src='/images/edit.gif' />
@@ -704,14 +777,28 @@ END
 ;
                        }
 
-               print <<END
-               <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                               <input type='hidden' name='NAME' value='$userline[0]' />
-                               <input type='hidden' name='ACTION' value='userdelete' />
-                               <input type='image' alt='Loeschen' src='/images/delete.gif' />
-               </form></td></tr>
+                       if ($sambasettings{'DOMAINMASTER'} eq 'on' && $userline[0] =~ /\$/)
+                               {
+                               print <<END
+                               <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                               <input type='hidden' name='NAME' value='$userline[0]' />
+                                               <input type='hidden' name='ACTION' value='userdelete' />
+                                               <input type='image' alt='Loeschen' src='/images/network-error.png' />
+                                               </form></td></tr>
+END
+;
+                               }
+                       else
+                               {
+                               print <<END
+                               <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                               <input type='hidden' name='NAME' value='$userline[0]' />
+                                               <input type='hidden' name='ACTION' value='userdelete' />
+                                               <input type='image' alt='Loeschen' src='/images/user-option-remove.png' />
+                               </form></td></tr>
 END
 ;
+                               }
                }
        print <<END
        </table>
@@ -719,7 +806,7 @@ END
        <tr><td colspan='3'><br /></td></tr>
        <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                                                                                        <input type='hidden' name='ACTION' value='useradd' />
-                                                                                                       <input type='image' alt='Benutzer anlegen' src='/images/add.gif' /></form></td>
+                                                                                                       <input type='image' alt='Benutzer anlegen' src='/images/user-option-add.png' /></form></td>
 END
 ;
 
@@ -728,7 +815,7 @@ END
                print <<END
                <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                                                                                <input type='hidden' name='ACTION' value='pcadd' />
-                                                                                               <input type='image' alt='Legende' src='/images/comp.blue.gif' /></form>
+                                                                                               <input type='image' alt='PC anlegen' src='/images/network.png' /></form>
 END
 ;
                }
@@ -745,15 +832,16 @@ END
                {
                print <<END
                <table width='95%' cellspacing='0'>
-               <tr><td><br /></td></tr>
-               <tr><td><b>Legende:</b></td></tr>
-               <tr><td><img src='/images/add.gif' />Benutzer neu anlegen</td></tr>
-               <tr><td><img src='/images/comp.blue.gif' />Client Account neu anlegen</td></tr>
-               <tr><td><img src='/images/on.gif' />Benutzer aktivieren</td></tr>
-               <tr><td><img src='/images/off.gif' />Benutzer deaktivieren</td></tr>
-               <tr><td><img src='/images/floppy.gif' />Einstellungen speichern</td></tr>
-               <tr><td><img src='/images/edit.gif' />Passwort wechseln</td></tr>
-               <tr><td><img src='/images/delete.gif' />Benutzer loeschen</td></tr>
+               <tr><td align='center' colspan='2'><br /></td></tr>
+               <tr><td align='center' colspan='2'><b>Legende:</b></td></tr>
+               <tr><td align='right' width='33%'><img src='/images/user-option-add.png' /></td><td align='left'>Benutzer neu anlegen</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/network.png' /></td><td align='left'>Client Account neu anlegen</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/user-option-remove.png' /></td><td align='left'>Benutzer loeschen</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/network-error.png' /></td><td align='left'>Client Account loeschen</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/on.gif' /></td><td align='left'>Benutzer aktivieren</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/off.gif' /></td><td align='left'>Benutzer deaktivieren</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/edit.gif' /></td><td align='left'>Passwort wechseln</td></tr>
+               <tr><td align='right' width='33%'><img src='/images/floppy.gif' /></td><td align='left'>Einstellungen speichern</td></tr>
                </table>
 END
 ;
@@ -769,8 +857,8 @@ END
                <table width='95%' cellspacing='0'>
                <tr><td colspan='2'><br /></td></tr>
                <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Passwort wechseln</b></td></tr>
-               <tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size="30" /></td></tr>
-               <tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size="30" /></td></tr>
+               <tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size='30' /></td></tr>
+               <tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size='30' /></td></tr>
                <tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value='smbchangepw' />
                                                                                                                                                                <input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif' /></td></tr>
                </table>
@@ -793,10 +881,10 @@ END
                <table width='95%' cellspacing='0'>
                <tr><td colspan='2'><br /></td></tr>
                <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Benutzer neu anlegen</b></td></tr>
-               <tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size="30" /></td></tr>
-               <tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size="30" /></td></tr>
-               <tr><td align='left'>Unix Gruppe</td><td><input type='text' name='GROUP' value='sambauser' size="30" /></td></tr>
-               <tr><td align='left'>Unix Shell</td><td><input type='text' name='SHELL' value='/bin/false' size="30" /></td></tr>
+               <tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size='30' /></td></tr>
+               <tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size='30' /></td></tr>
+               <tr><td align='left'>Unix Gruppe</td><td><input type='text' name='GROUP' value='sambauser' size='30' /></td></tr>
+               <tr><td align='left'>Unix Shell</td><td><input type='text' name='SHELL' value='/bin/false' size='30' /></td></tr>
                <tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value='smbuseradd' />
                                                                                                                                                                <input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif' /></td></tr>
                </table>
@@ -816,9 +904,9 @@ END
                <table width='95%' cellspacing='0'>
                <tr><td colspan='2'><br /></td></tr>
                <tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Client Account neu anlegen</b></td></tr>
-               <tr><td align='left'>Clientname</td><td><input type='text' name='PCNAME' value='$pcname' size="30" /></td></tr>
-               <tr><td align='left'>Unix Gruppe</td><td><input type='text' name='GROUP' value='sambawks' size="30" /></td></tr>
-               <tr><td align='left'>Unix Shell</td><td><input type='text' name='SHELL' value='/bin/false' size="30" /></td></tr>
+               <tr><td align='left'>Clientname</td><td><input type='text' name='PCNAME' value='$pcname' size='30' /></td></tr>
+               <tr><td align='left'>Unix Gruppe</td><td><input type='text' name='GROUP' value='sambawks' size='30' /></td></tr>
+               <tr><td align='left'>Unix Shell</td><td><input type='text' name='SHELL' value='/bin/false' size='30' /></td></tr>
                <tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value='smbpcadd' />
                                                                                                                                                                <input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif' /></td></tr>
                </table>
@@ -832,7 +920,7 @@ END
 
 ############################################################################################################################
 ############################################### Verwalten von Freigaben ####################################################
-        
+
 &Header::openbox('100%', 'center', 'Shares');
 
 print <<END
@@ -840,7 +928,7 @@ print <<END
 <table width='95%' cellspacing='0'>
 <tr><td colspan='3'><br /></td></tr>
 <tr><td bgcolor='${Header::table1colour}' colspan='3' align='left'><b>Shareverwaltung</b>
-<tr><td><u>Names des Shares</u></td><td colspan='2' width="5"><u>Optionen</u></td></tr>
+<tr><td align='left'><u>Names des Shares</u></td><td colspan='2' width="5%" align='center'><u>Optionen</u></td></tr>
 END
 ;
 
@@ -886,13 +974,13 @@ if ($sambasettings{'ACTION'} eq 'sharecaption')
        {
        print <<END
        <table width='95%' cellspacing='0'>
-       <tr><td><br /></td></tr>
-       <tr><td><b>Legende:</b></td></tr>
-       <tr><td><img src='/images/add.gif' />Share neu anlegen</td></tr>
-       <tr><td><img src='/images/edit.gif' />Share bearbeiten</td></tr>
-       <tr><td><img src='/images/floppy.gif' />Einstellungen speichern</td></tr>
-       <tr><td><img src='/images/reload.gif' />Shares zurueck setzen</td></tr>
-       <tr><td><img src='/images/delete.gif' />Share loeschen</td></tr>
+       <tr><td align='center' colspan='2'><br /></td></tr>
+       <tr><td align='center' colspan='2'><b>Legende:</b></td></tr>
+       <tr><td align='right' width='33%'><img src='/images/add.gif' /></td><td align='left'>Share neu anlegen</td></tr>
+       <tr><td align='right' width='33%'><img src='/images/edit.gif' /></td><td align='left'>Share bearbeiten</td></tr>
+       <tr><td align='right' width='33%'><img src='/images/floppy.gif' /></td><td align='left'>Einstellungen speichern</td></tr>
+       <tr><td align='right' width='33%'><img src='/images/reload.gif' /></td><td align='left'>Shares zurueck setzen</td></tr>
+       <tr><td align='right' width='33%'><img src='/images/delete.gif' /></td><td align='left'>Share loeschen</td></tr>
        </table>
 END
 ;
@@ -949,13 +1037,14 @@ if ($sambasettings{'ACTION'} eq 'sharechange' || $sambasettings{'ACTION'} eq 'op
        <tr><td colspan='2' align='center'></td></tr>
        <tr><td colspan='2' align='center'>Anzeige der Optionen fuer Shares<form method='post' action='$ENV{'SCRIPT_NAME'}'>
                                                                                                                                                                                                                                                                                        <input type='hidden' name='ACTION' value='optioncaption2' />
-                                                                                                                                                                                                                                                                                       <input type='image' alt='Legende' src='/images/info.gif' /></td></tr></form>
+                                                                                                                                                                                                                                                                                       <input type='image' alt='Legende' src='/images/info.gif' /></form></td></tr>
        <tr><td colspan='2' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><textarea name="SHAREOPTION" cols="50" rows="15" Wrap="off">$shareoption</textarea></td></tr>
        </table>
        <table width='10%' cellspacing='0'>
        <tr><td><br /></td></tr>
        <tr><td align='center'><input type='hidden' name='NAME' value='$sambasettings{'NAME'}' />
-                                                                                                       <input type='submit' name='ACTION' value='smbsharechange' /></td></tr></form>
+                                                                                                       <input type='image' alt='Share ändern' src='/images/floppy.gif' />
+                                                                                                       <input type='hidden' name='ACTION' value='smbsharechange' /></form></td></tr>
        </table>
 END
 ;
@@ -1030,10 +1119,47 @@ END
 print <<END
 <hr />
 <table width='95%' cellspacing='0'>
-<tr><td colspan='4'><br /></td></tr>
+<tr><td colspan='4'  align='left'><br /></td></tr>
 <tr><td bgcolor='${Header::table1colour}' colspan='3' align='left'><b>Samba Status</b></td></tr>
-<tr><td>$Status</td></tr>
+<tr><td  align='left'>$Status</td></tr>
+</table>
+END
+;
+&Header::closebox();
+
+############################################################################################################################
+############################################### Anzeige des Sambastatus ####################################################
+
+
+if ($sambasettings{'ACTION'} eq 'showlog')
+{
+$Log = qx(tail -n $sambasettings{'LOGLINES'} /var/log/samba/$sambasettings{'LOG'});
+$Log=~s/\n/<br \/>/g;
+}
+
+&Header::openbox('100%', 'center', 'Logs');
+
+print <<END
+<hr />
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<table width='95%' cellspacing='0'>
+<tr><td colspan='3'  align='left'><br /></td></tr>
+<tr><td bgcolor='${Header::table1colour}' colspan='3' align='left'><b>Loganzeige</b></td></tr>
+<tr><td colspan='3'  align='left'><br /></td></tr>
+<tr><td  align='left'><select name='LOG' style="width: 200px">
+END
+;
+foreach my $log (@Logs) {chomp $log;print"<option value='$log'>$log</option>";}
+print <<END
+
+</select></td><td  align='left'>anzeige der letzen x Zeilen <input type='text' name='LOGLINES' value='$sambasettings{'LOGLINES'}' size="3" /></td>
+                       <td  align='left'><input type='submit' name='ACTION' value='showlog' /></td></tr>
+<tr><td colspan='3'  align='left'><br /></td></tr>
+<tr><td colspan='3'  align='left'><font size=2>$Log</font></td></tr>
+<tr><td colspan='3'  align='left'><br /></td></tr>
+<tr><td colspan='3'  align='center'>$sambasettings{'LOG'}</td></tr>
 </table>
+</form>
 END
 ;
 
@@ -1042,7 +1168,7 @@ END
 &Header::closepage();
 
 ############################################################################################################################
-############################################ Subfunktion fr Sambadienste ##################################################
+############################################ Subfunktion fr Sambadienste ###################################################
 
 sub isrunning
        {
index 3d84955..d2faaa1 100644 (file)
@@ -156,7 +156,8 @@ print <<END
 <tr><td align='left'>Description Document:</td><td><input type='text' name='DESCRIPTION' value='$upnpsettings{'DESCRIPTION'}' size="30" /></td></tr>
 <tr><td align='left'>Upnp Device Name:</td><td><input type='text' name='friendlyName' value='$upnpsettings{'friendlyName'}' size="30" /></td></tr>
 <tr><td colspan='2' align='left'><br></br></td></tr>
-<tr><td colspan='2' align='center'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
+<tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value=$Lang::tr{'save'} />
+                                                                                                                                               <input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif' /></td></tr>
 </table></form>
 <br />
 <hr />
@@ -173,7 +174,7 @@ END
 sub isrunning
        {
        my $cmd = $_[0];
-       my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
+       my $status = "<td bgcolor='${Header::colourred}' align='center'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
        my $pid = '';
        my $testcmd = '';
        my $exename;
diff --git a/html/html/images/dialog-error.png b/html/html/images/dialog-error.png
new file mode 100755 (executable)
index 0000000..3bbbb4a
Binary files /dev/null and b/html/html/images/dialog-error.png differ
diff --git a/html/html/images/edit-redo.png b/html/html/images/edit-redo.png
new file mode 100755 (executable)
index 0000000..c3b0df0
Binary files /dev/null and b/html/html/images/edit-redo.png differ
diff --git a/html/html/images/network-error.png b/html/html/images/network-error.png
new file mode 100755 (executable)
index 0000000..3f18ed0
Binary files /dev/null and b/html/html/images/network-error.png differ
diff --git a/html/html/images/user-multiple.png b/html/html/images/user-multiple.png
new file mode 100755 (executable)
index 0000000..1b2696c
Binary files /dev/null and b/html/html/images/user-multiple.png differ
diff --git a/html/html/images/user-option-add.png b/html/html/images/user-option-add.png
new file mode 100755 (executable)
index 0000000..0c9ca48
Binary files /dev/null and b/html/html/images/user-option-add.png differ
diff --git a/html/html/images/user-option-remove.png b/html/html/images/user-option-remove.png
new file mode 100755 (executable)
index 0000000..1304c03
Binary files /dev/null and b/html/html/images/user-option-remove.png differ
index ff5dbce..c28b5a5 100644 (file)
@@ -74,6 +74,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && make $(MAKETUNING) #HAVE_LIBIPTC=1
        cd $(DIR_APP) && make install
-       cp -vf $(DIR_SRC)/config/upnp/* /etc/linuigd/
+       cp -vf $(DIR_SRC)/config/upnp/* /etc/linuxigd/
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 463f915..d6964b5 100644 (file)
@@ -63,6 +63,7 @@ int main(int argc, char *argv[])
             safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf");
             safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/samba/settings");
             safe_system("/bin/cat /var/ipfire/samba/default.global > /var/ipfire/samba/global");
+            safe_system("/bin/cat /var/ipfire/samba/default.pdc > /var/ipfire/samba/pdc");
             return 0;
         }
 
@@ -85,6 +86,8 @@ int main(int argc, char *argv[])
 
         if (strcmp(argv[1], "smbstart")==0)
         {
+            snprintf(command, BUFFER_SIZE-1, "smbd -D && nmbd -D && winbindd -D",);
+            safe_system(command);
             return 0;
         }
 
@@ -92,7 +95,6 @@ int main(int argc, char *argv[])
         {
             snprintf(command, BUFFER_SIZE-1, "/usr/sbin/smbstatus");
             safe_system(command);
-            printf(command);
             return 0;
         }