Private
Server IP : 195.201.23.43  /  Your IP : 3.141.43.16
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/mount/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/mount/smb_share.cgi
#!/usr/bin/perl
# smb_share.cgi
# Displays a list of shares available on some host

require './mount-lib.pl';
&ReadParse();
&header(&text('smb_choose2', $in{'server'}));
print <<EOF;
<script>
function choose(f)
{
top.opener.ifield.value = f;
window.close();
}
</script>
EOF

&execute_command("$config{'smbclient_path'} -d 0 -L $in{'server'} -N",
		 undef, \$out, \$out);
if ($?) {
	print "<b>",&text('smb_elist2', $in{'server'}),"</b>\n";
	exit;
	}
elsif ($out =~ /Unknown host/) {
	print "<b>",&text('smb_ehost', $in{'server'}),"</b>\n";
	exit;
	}
elsif ($out =~ /error connecting|connect error/) {
	print "<b>",&text('smb_edown', $in{'server'}),"</b>\n";
	exit;
	}

if ($out =~ /Sharename\s+Type\s+Comment\n((.+\n)+)/) {
	@shlist = split(/\n/, $1);
	foreach $sh (@shlist) {
		if ($sh =~ /^\s+(.{1,7}\S+)\s+Disk\s*(.*)$/) {
			push(@names, $1); push(@comms, $2);
			}
		}
	}
if (@names) {
	print "<b>$text{'smb_sel2'}</b><p>\n";
	print &ui_columns_start([ $text{'smb_share'},
				  $text{'smb_comment'} ]);
	for($i=0; $i<@names; $i++) {
		print &ui_columns_row([
            &ui_link("#", $names[$i], undef, "onClick='choose(\"$names[$i]\");return false;'" ),
			&html_escape($comms[$i]),
			]);
		}
	print &ui_columns_end();
	}
else {
	print "<b>",&text('smb_noshares', $in{'server'}),"</b><p>\n";
	}

&popup_footer();

Private