diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4c9f544 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-webshare +# $Id: Makefile,v 1.1 2020/10/30 11:00:20 brianr Exp $ +NAME := smeserver-webshare +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index 9975aeb..3de0606 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ -# smeserver-webshare +# smeserver-webshare -SMEServer Koozali developed git repo for smeserver-webshare smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-webshare smecontribs + +## Wiki +
https://wiki.koozali.org/Webshare + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-webshare&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..9b7fd51 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +contribs10 diff --git a/createlinks b/createlinks new file mode 100755 index 0000000..ef46100 --- /dev/null +++ b/createlinks @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w +# This script creates the symlinks needed by this RPM +# Specific support exists to create symlinks within e-smith web "panels" +# and for links from named "events" directories into the "actions" directory +use esmith::Build::CreateLinks qw(:all); + +#-------------------------------------------------- +# functions for user and manager panel +#-------------------------------------------------- +my $panel = "manager"; +panel_link("webshare", $panel); + +my $event = "smeserver-webshare-update"; +event_templates($event, qw( +/etc/httpd/conf/httpd.conf +)); + +event_services($event, qw( + php-fpm restart + httpd-e-smith restart +)); + +use esmith::Build::Backup qw(:all); +backup_includes("smeserver-webshare", qw( +/opt/webshare +)); diff --git a/root/etc/e-smith/events/actions/webshare-adduser b/root/etc/e-smith/events/actions/webshare-adduser new file mode 100755 index 0000000..7e07a6b --- /dev/null +++ b/root/etc/e-smith/events/actions/webshare-adduser @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +use esmith::ConfigDB; +use Apache::Htpasswd; + +my $db = esmith::ConfigDB->open_ro("WebShare"); + +my $projectName = $ARGV[0]; +my $userName = $ARGV[1]; +my $password = $ARGV[2]; + +#------------------------------------------------------------ +# Create the MultiAccessWebshare account +#------------------------------------------------------------ + +my $MultiAccessWebshare = + $db->get_prop( "MultiAccess", "WebShareName" || "undefined" ); +my %MultiWebshares = + sort( split( /,/, $db->get_prop( "MultiAccess", "WebShares" ) || "" ) ); + +if ( ( "$MultiAccessWebshare" eq "$projectName" ) + && ( "%MultiWebshares" ne "" ) ) +{ + my $foo = + new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiAccessWebshare"); + $foo->htDelete("$userName"); + $foo->{'USEMD5'} = "MD5"; + $foo->htpasswd( "$userName", "$password" ); + + foreach my $MultiWebshares (%MultiWebshares) { + my $foo1 = + new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiWebshares"); + $foo1->htDelete("$userName");i + $foo->{'USEMD5'} = "MD5"; + $foo1->htpasswd( "$userName", "$password" ); + } +} + +else { + + #------------------------------------------------------------ + # Create the webshare account + #------------------------------------------------------------ + + my $foo = new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$projectName"); + $foo->{'USEMD5'} = "MD5"; + $foo->htpasswd( "$userName", "$password" ); +} + +exit(0) diff --git a/root/etc/e-smith/events/actions/webshare-create b/root/etc/e-smith/events/actions/webshare-create new file mode 100755 index 0000000..6022d5d --- /dev/null +++ b/root/etc/e-smith/events/actions/webshare-create @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w + +my $projectName = $ARGV [0]; +my $indexer = $ARGV [1]; + +#------------------------------------------------------------ +# Create the webshare project directory +#------------------------------------------------------------ + +if ( -e "/opt/webshare/$projectName") + { + print "webshare $projectName already exists\n"; + } + else + { + system ("/bin/mkdir /opt/webshare/$projectName"); + + if ("$indexer" eq "Full") + { + system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/"); + system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-full /opt/webshare/$projectName/conf/config.inc.php"); + } + elsif ("$indexer" eq "NoDelete") + { + system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/"); + system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-nodelete /opt/webshare/$projectName/conf/config.inc.php"); + } + elsif ("$indexer" eq "UpDown") + { + system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/"); + system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-updown /opt/webshare/$projectName/conf/config.inc.php"); + } + elsif ("$indexer" eq "View") + { + system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/"); + system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-view /opt/webshare/$projectName/conf/config.inc.php"); + } + + system ("/usr/bin/find /opt/webshare/$projectName -type f -exec chmod 644 {} ';'"); + system ("/usr/bin/find /opt/webshare/$projectName -type d -exec chmod 755 {} ';'"); + system ("/bin/chown -R www:www /opt/webshare/$projectName/files"); + + system ("/bin/touch /home/e-smith/db/webshare/htpasswd.$projectName"); + system ("/sbin/e-smith/signal-event ibay-modify"); + } + +exit (0); diff --git a/root/etc/e-smith/events/actions/webshare-delete b/root/etc/e-smith/events/actions/webshare-delete new file mode 100755 index 0000000..eb6944d --- /dev/null +++ b/root/etc/e-smith/events/actions/webshare-delete @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w + +my $projectName = $ARGV[0]; + +#------------------------------------------------------------ +# Delete the webshare project directory +#------------------------------------------------------------ + +if ( -e "/opt/webshare/$projectName" ) { + system("/bin/rm -Rf /opt/webshare/$projectName"); + system("/bin/rm -f /home/e-smith/db/webshare/htpasswd.$projectName"); + system("/sbin/e-smith/signal-event ibay-modify"); +} + +exit(0); + diff --git a/root/etc/e-smith/events/actions/webshare-deluser b/root/etc/e-smith/events/actions/webshare-deluser new file mode 100755 index 0000000..3b88fc9 --- /dev/null +++ b/root/etc/e-smith/events/actions/webshare-deluser @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w + +use esmith::ConfigDB; +use Apache::Htpasswd; + +my $db = esmith::ConfigDB->open_ro("WebShare"); + +my $projectName = $ARGV[0]; +my $userName = $ARGV[1]; +my $password = $ARGV[2]; + +#------------------------------------------------------------ +# Delete the MultiAccessWebshare account +#------------------------------------------------------------ + +my $MultiAccessWebshare = + $db->get_prop( "MultiAccess", "WebShareName" || "undefined" ); +my %MultiWebshares = + split( /,/, $db->get_prop( "MultiAccess", "WebShares" ) || "" ); + +if ( ( "$MultiAccessWebshare" eq "$projectName" ) + && ( "%MultiWebshares" ne "" ) ) +{ + my $foo = + new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiAccessWebshare"); + $foo->htDelete("$userName"); + + foreach my $MultiWebshares ( sort %MultiWebshares ) { + my $foo1 = + new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiWebshares"); + $foo1->htDelete("$userName"); + } +} + +else { + + #------------------------------------------------------------ + # Delete the webshare account + #------------------------------------------------------------ + + my $foo = new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$projectName"); + $foo->htDelete("$userName"); +} + +exit(0) diff --git a/root/etc/e-smith/events/actions/webshare-rebuild-htpasswd b/root/etc/e-smith/events/actions/webshare-rebuild-htpasswd new file mode 100755 index 0000000..e24d35e --- /dev/null +++ b/root/etc/e-smith/events/actions/webshare-rebuild-htpasswd @@ -0,0 +1,64 @@ +#!/usr/bin/perl -w + +use esmith::ConfigDB; +use Apache::Htpasswd; + +my $db = esmith::ConfigDB->open_ro("WebShare"); + +my @WebShare = $db->get_all_by_prop( type => 'WebShare' ); +my $MultiAccessWebshare = $db->get_prop( "MultiAccess", "WebShareName" ) || ""; +my %MultiWebshares = split( /,/, $db->get_prop( "MultiAccess", "WebShares" ) || "" ); + +foreach my $WebShare (@WebShare) { + my $ws = $WebShare->key; + my $rec = $db->get("$ws"); + + system( "/bin/rm -f /home/e-smith/db/webshare/htpasswd.$ws > /dev/null 2>&1" ); + system( "/bin/touch", "/home/e-smith/db/webshare/htpasswd.$ws" ); + + my %Users = split( /,/, $rec->prop("Users") || "" ); + + if ( "%Users" ne "" ) { + foreach my $Users ( sort %Users ) { + my @user = split( /:/, $Users ); + my $userName = $user[0]; + my $password = $user[1]; + + #------------------------------------------------------------ + # Create the MultiAccessWebshare account + #------------------------------------------------------------ + + if ( ( "$MultiAccessWebshare" eq "$ws" ) + && ( "%MultiWebshares" ne "" ) ) + { + my $foo = + new Apache::Htpasswd( + "/home/e-smith/db/webshare/htpasswd.$MultiAccessWebshare"); + $foo->htDelete("$userName"); + $foo->{'USEMD5'} = "MD5"; + $foo->htpasswd( "$userName", "$password" ); + + foreach my $MultiWebshares ( sort %MultiWebshares ) { + my $foo1 = + new Apache::Htpasswd( + "/home/e-smith/db/webshare/htpasswd.$MultiWebshares"); + $foo1->htDelete("$userName"); + $foo->{'USEMD5'} = "MD5"; + $foo1->htpasswd( "$userName", "$password" ); + } + } + else { + + #------------------------------------------------------------ + # Create the webshare account + #------------------------------------------------------------ + + my $foo = new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$ws"); + $foo->htDelete("$userName"); + $foo->{'USEMD5'} = "MD5"; + $foo->htpasswd( "$userName", "$password" ); + } + } + } +} +exit(0) diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86WebShareAlias b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86WebShareAlias new file mode 100644 index 0000000..e78ca31 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86WebShareAlias @@ -0,0 +1,26 @@ +{ + my $db = esmith::ConfigDB->open_ro("WebShare") + or return "# webshare disabled\n"; + + my @webshare = $db->get_all_by_prop( type => 'WebShare' ); + + foreach $webshare (@webshare) { + my $key = $webshare->key; + $OUT .= "# webshare\/$key\n"; + $OUT .= "Alias \/webshare\/$key \/opt\/webshare\/$key\n"; + $OUT .= "\n"; + $OUT .= " SSLRequireSSL\n"; + $OUT .= " Options +Indexes\n"; + $OUT .= " AllowOverride None\n"; + $OUT .= " AuthName \"Restricted $key access only\"\n"; + $OUT .= " AuthType Basic\n"; + $OUT .= " AuthUserFile \/home\/e-smith\/db\/webshare\/htpasswd.$key\n"; + $OUT .= " Require valid-user\n"; + $OUT .= " AddType application\/x-httpd-php \.php \.php3\n"; + $OUT .= " \n"; + $OUT .= ' SetHandler "proxy:unix:/var/run/php-fpm/php.sock|fcgi://localhost"'."\n"; + $OUT .= " \n"; + $OUT .= "<\/Directory>\n"; + $OUT .= "\n"; + } +} diff --git a/root/etc/e-smith/web/functions/webshare b/root/etc/e-smith/web/functions/webshare new file mode 100755 index 0000000..c2c355a --- /dev/null +++ b/root/etc/e-smith/web/functions/webshare @@ -0,0 +1,602 @@ +#!/usr/bin/perl -wT + +#---------------------------------------------------------------------- +# heading : Collaboration +# description : Web Shares +# navigation : 3000 3600 +# +# copyright (C) 2005 Darrell May, DMC myEZserver.com +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#---------------------------------------------------------------------- + +package esmith; + +use strict; +use CGI ':all'; +use CGI::Carp qw(fatalsToBrowser); + +use esmith::cgi; +use esmith::config; +use esmith::util; +use esmith::db; + + +sub showInitial ($$); +sub createproject ($); +sub performCreateShare ($); +sub deleteProject ($); +sub performDeleteProject ($); +sub createUser ($); +sub performCreateUser ($); +sub deleteUser ($); +sub performDeleteUser ($); +BEGIN +{ + # Clear PATH and related environment variables so that calls to + # external programs do not cause results to be tainted. See + # "perlsec" manual page for details. + + $ENV {'PATH'} = ''; + $ENV {'SHELL'} = '/bin/bash'; + delete $ENV {'ENV'}; +} + +esmith::util::setRealToEffective (); + +$CGI::POST_MAX=1024 * 100; # max 100K posts +$CGI::DISABLE_UPLOADS = 1; # no uploads + +my %conf; +tie %conf, 'esmith::config'; + +my %projects; +tie %projects, 'esmith::config', '/home/e-smith/db/WebShare'; + + +#------------------------------------------------------------ +# examine state parameter and display the appropriate form +#------------------------------------------------------------ + +my $q = new CGI; + +if (! grep (/^state$/, $q->param)) +{ + showInitial ($q, ''); +} + +elsif ($q->param ('state') eq "create") +{ + createproject ($q); +} + +elsif ($q->param ('state') eq "deleteProject") +{ + deleteProject ($q); +} + +elsif ($q->param ('state') eq "createShare") +{ + performCreateShare ($q); +} + +elsif ($q->param ('state') eq "addUser") +{ + createUser ($q); +} + +elsif ($q->param ('state') eq "createUser") +{ + performCreateUser ($q); +} + +elsif ($q->param ('state') eq "viewUser") +{ + deleteUser ($q); +} + +elsif ($q->param ('state') eq "delUser") +{ + performDeleteUser ($q); +} + +elsif ($q->param ('state') eq "performDelete") +{ + performDeleteProject ($q); +} + +else +{ + esmith::cgi::genStateError ($q, \%conf); +} + +exit (0); + +#------------------------------------------------------------ +# subroutine to display initial form +#------------------------------------------------------------ +sub showInitial ($$) +{ + my ($q, $msg) = @_; + +my @WebShareProjects = (); +foreach (sort keys %projects) + { + push (@WebShareProjects, $_) + if (db_get_type(\%projects, $_) eq "WebShare"); + } + + #------------------------------------------------------------ + # If there's a message, we just finished an operation so show the + # status report. If no message, this is a new list of accounts. + #------------------------------------------------------------ + + if ($msg eq '') + { + + esmith::cgi::genHeaderNonCacheable + ($q, \%conf, 'Create or modify web shares and users'); + + } + else + { + esmith::cgi::genHeaderNonCacheable + ($q, \%conf, 'Web share Operation status report'); + + print $q->div ({-class => "sme-error"}, $msg); + print $q->hr; + } + + + + print $q->startform (-method => 'POST', -action => $q->url (-absolute => 1)); + + print $q->p ($q->a ({href => $q->url (-absolute => 1) . "?state=create"}, + 'Click here'), + 'to create a new web share.'); + + print $q->p ('Web shares are Internet accessible', + 'file storage areas for securely sharing', + ' documents with external share members.'); + + + if (@WebShareProjects == 0) + { + print $q->p ($q->b ('There are no web shares currently defined.')); + } + else + { + print $q->table ({border => 1, cellspacing => 1, cellpadding => 4}); + + print $q->Tr (esmith::cgi::genSmallCell ($q, $q->b ('Name')), + esmith::cgi::genSmallCell ($q, $q->b ('Description')), + esmith::cgi::genSmallCell ($q, $q->b ('URL = https://yourdomain.com')), + $q->td (' '), + $q->td (' '), + $q->td (' ')); + + my $projectname; + foreach $projectname (sort @WebShareProjects) + { + my $description = db_get_prop(\%projects, $projectname, 'Description'); + my $url = "/webshare/" . $projectname; + + + print $q->Tr (esmith::cgi::genSmallCell ($q, $projectname), + esmith::cgi::genSmallCell ($q, $description), + esmith::cgi::genSmallCell ($q, $url), + esmith::cgi::genSmallCell ($q, + $q->a ({href => $q->url (-absolute => 1) + . "?state=addUser&project=" + . $projectname}, 'Add User..')), + esmith::cgi::genSmallCell ($q, + $q->a ({href => $q->url (-absolute => 1) + . "?state=viewUser&project=" + . $projectname}, 'View/Delete Users..')), + esmith::cgi::genSmallCell ($q, + $q->a ({href => $q->url (-absolute => 1) + . "?state=deleteProject&project=" + . $projectname}, 'Remove..'))); + } + } + + + print ''; + + + esmith::cgi::genFooter ($q); +} + +sub createproject ($) +{ + my ($q) = @_; + my $info =<startform (-method => 'POST', -action => $q->url (-absolute => 1)); + + print $q->p ($q->a ({href => $q->url (-absolute => 1)}, + 'Click here'), + 'to return.'); + + print $q->p ($info); + + print $q->table ({border => 0, cellspacing => 0, cellpadding => 4}, + + esmith::cgi::genNameValueRow ($q, + "Web share name", + "sharename", + ""), + + esmith::cgi::genNameValueRow ($q, + "Brief Description", + "description", + ""), + + esmith::cgi::genTextRow ($q, + $q->p ('Select your Web share indexer below. Your choices are either the default', + 'apache (ModIndex if installed) indexer or PHP FileManager. In addition', + 'PHP FileManager may be tailored to meet your needs by choicing the appropriate', + 'selection below:')), + + esmith::cgi::genTextRow ($q, + $q->p ('Default = default apache (ModIndex) indexer.
', + 'View = permitting view/download only.
', + 'UpDown = permitting view/upload/download.
', + 'NoDelete = permitting view/upload/download/create/rename/edit.
', + 'Full = permitting view/upload/download/create/rename/delete/edit
')), + + esmith::cgi::genWidgetRow ($q, "Indexer", + $q->popup_menu (-name => "indexer", + -values => ['Default', 'View', 'UpDown', ,'NoDelete', 'Full'], + -default => 'Full')), + + esmith::cgi::genButtonRow ($q, + $q->submit (-name => 'action', -value => 'Create'))); + + print $q->hidden (-name => 'state', -override => 1, -default => 'createShare'); + + + print $q->endform; + esmith::cgi::genFooter ($q); + +} + +sub performCreateShare ($) +{ + my ($q) = @_; + my $share = (); + my $description = (); + my $indexer = (); + + $share = $q->param ('sharename'); + if ($share =~ /^([a-zA-Z0-9][\-\_\.a-zA-Z0-9]*)$/) + { + $share = $1; + } + else + { + showInitial ($q, + "Error: unexpected characters in web share name \'$share\'."); + return; + } + + $indexer = $q->param ('indexer'); + if ($indexer =~ /^([a-zA-Z0-9][\-\_\.a-zA-Z0-9]*)$/) + { + $indexer = $1; + } + else + { + showInitial ($q, + "Error: unexpected characters in indexer \'$indexer\'."); + return; + } + + $description = $q->param ('description'); + + db_set(\%projects, $share, 'WebShare'); + db_set_prop(\%projects, "$share", "Description", "$description"); + + system("/etc/e-smith/events/actions/webshare-create", "$share", "$indexer") == "0" + or die("Error occured during webshare-create event.\n"); + + showInitial ($q, "Web share $share with $indexer indexer created."); + +} +sub createUser ($) +{ + my ($q) = @_; + my $project = $q->param ('project'); + + my $userinfo =<startform (-method => 'POST', -action => $q->url (-absolute => 1)); + + print $q->p ($q->a ({href => $q->url (-absolute => 1)}, + 'Click here'), + 'to return.'); + + print $q->p ($userinfo); + + print $q->table ({border => 0, cellspacing => 0, cellpadding => 4}, + + esmith::cgi::genNameValueRow ($q, + "Webshare", + "project", + "$project"), + + esmith::cgi::genNameValueRow ($q, + "Login", + "user", + ""), + + esmith::cgi::genNameValueRow ($q, + "Password", + "passwd", + ""), + + esmith::cgi::genButtonRow ($q, + $q->submit (-name => 'action', -value => 'Add user'))); + + print $q->hidden (-name => 'state', -override => 1, -default => 'createUser'); + + print $q->endform; + esmith::cgi::genFooter ($q); + return; +} + +sub performCreateUser ($) +{ + + my ($q) = @_; + my $user = $q->param ('user'); + + if ($user =~ /^([a-zA-Z0-9][\-\@\_\.a-zA-Z0-9]*)$/) + { + $user = $1; + } + else + { + + showInitial ($q, + "Error: unexpected characters in web share name \'$user\'."); + return; + } + + my $passwd = $q->param ('passwd'); + + if ($passwd =~ /^([a-zA-Z0-9]*)$/) + { + $passwd = $1; + } + else + { + + showInitial ($q, + "Error: unexpected characters in web share password \'$passwd\'."); + return; + } + + my $project = $q->param ('project'); + + + if ($project =~ /^([a-zA-Z0-9][\-\_\.a-zA-Z0-9]*)$/) + { + $project = $1; + } + else + { + + showInitial ($q, + "Error: unexpected characters in web share name \'$project\'."); + return; + } + my $ProjectUsers = db_get_prop(\%projects, "$project", "Users"); + + #------------------------------------------------------------ + # Update project users + #------------------------------------------------------------ + + if ("$ProjectUsers" ne "") + { + db_set_prop(\%projects, "$project", "Users", "$ProjectUsers,$user:$passwd") + or warn("Could not add user to WebShare database\n"); + } + else + { + db_set_prop(\%projects, "$project", "Users", "$user:$passwd") + or warn("Could not add user to WebShare database\n"); + } + + system("/etc/e-smith/events/actions/webshare-adduser", "$project", "$user", "$passwd") == "0" + or die("Error occured while adding user $user.\n"); + + showInitial ($q, "Web share user $user created."); + +} + +sub deleteUser ($) +{ + my ($q) = @_; + + my $project = $q->param ('project'); + + + esmith::cgi::genHeaderNonCacheable ($q, \%conf, "View/Delete Web share users: $project"); + + print $q->startform + (-method => 'POST', -action => $q->url (-absolute => 1)); + + print $q->p ($q->a ({href => $q->url (-absolute => 1)}, + 'Click here'), + 'to return.'); + + print $q->p ($q->b ('Current List of Users.')); + + print $q->table ({border => 1, cellspacing => 1, cellpadding => 4}); + + + print $q->Tr (esmith::cgi::genSmallCell ($q, $q->b ('User Name')), + esmith::cgi::genSmallCell ($q, $q->b ('Password')), + $q->td (' ')); + + + my %webshareUsers = split(/,/, db_get_prop(\%projects, "$project", "Users") || ''); + + foreach my $users (sort %webshareUsers) + + { + my $shareusers = (); + my @shareusers = split(/:/, $users); + + if ("$users" ne ""){ + + print $q->Tr (esmith::cgi::genSmallCell ($q, "$shareusers[0]"), + esmith::cgi::genSmallCell ($q, "$shareusers[1]"), + esmith::cgi::genSmallCell ($q, + $q->a ({href => $q->url (-absolute => 1). + "?state=delUser&webShareUser=$users&shareUser=$shareusers[0]&webShareProject=$project"}, 'Delete..'))); + } + } + + + print ''; + + esmith::cgi::genFooter ($q); + return; + +} + +sub performDeleteUser ($) +{ + my ($q) = @_; + my $project = $q->param ('webShareProject'); + if ($project =~ /^([a-zA-Z0-9][\-\_\.a-zA-Z0-9]*)$/) + { + $project = $1; + } + else + { + + showInitial ($q, + "Error: unexpected characters in web share name \'$project\'."); + return; + } + my @Users = (); + my @UsersOut = (); + my @USERlist = (); + my $webShareUser = $q->param ('webShareUser'); + my $ShareUser = $q->param ('shareUser'); + if ($ShareUser =~ /^([a-zA-Z0-9][\-\_\@\.a-zA-Z0-9]*)$/) + { + $ShareUser = $1; + } + else + { + + showInitial ($q, + "Error: unexpected characters in web share name \'$ShareUser\'."); + return; + } + + my %webshareUsers = split(/,/, db_get_prop(\%projects, "$project", "Users") || ''); + + +if ($webShareUser) + { + foreach my $users (sort %webshareUsers) + { + unless ($users eq $webShareUser) { push(@UsersOut, "$users") } + @USERlist = join(',', @UsersOut); + } + db_set_prop(\%projects, "$project", "Users", "@USERlist") + or warn("Error occured updating WebShare db.\n"); + + system("/etc/e-smith/events/actions/webshare-deluser", "$project", "$ShareUser") == "0" + or die("Error occured while deleting user $ShareUser.\n"); + } + showInitial ($q, "Successfully deleted Web share user $ShareUser from $project."); + return; +} + +sub deleteProject ($) + +{ + my ($q) = @_; + + esmith::cgi::genHeaderNonCacheable ($q, \%conf, 'Delete Web share project'); + + print $q->startform + (-method => 'POST', -action => $q->url (-absolute => 1)); + + print $q->p ($q->a ({href => $q->url (-absolute => 1)}, + 'Click here'), + 'to return.'); + + my $project = $q->param ('project'); + my $description = $q->param ('description'); + { + + print $q->p ("Are you sure you wish to delete the Web share $project ?"); + + print $q->submit (-name => 'action', -value => 'Delete'); + print $q->hidden (-name => 'project', -override => 1, -default => $project); + print $q->hidden (-name => 'state', + -override => 1, + -default => 'performDelete'); + } + + print $q->endform; + esmith::cgi::genFooter ($q); + return; +} +sub performDeleteProject ($) + +{ + my ($q) = @_; + + my $project = $q->param ('project'); + + if ($project =~ /^([a-zA-Z0-9][\-\_\.a-zA-Z0-9]*)$/) + { + $project = $1; + } + else + { + showInitial ($q, + 'Error: internal failure while removing web share '); + return; + } + + db_delete(\%projects, "$project"); + + system ("/etc/e-smith/events/actions/webshare-delete $project") == "0" + or die("Error occured while deleting Webshare $project.\n"); + + showInitial ($q, "Successfully deleted Web share $project."); + return; +} diff --git a/root/etc/e-smith/web/panels/manager/cgi-bin/.gitignore b/root/etc/e-smith/web/panels/manager/cgi-bin/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/home/e-smith/db/webshare/.gitignore b/root/home/e-smith/db/webshare/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/opt/webshare-tools/phpfm/conf/config.inc.php b/root/opt/webshare-tools/phpfm/conf/config.inc.php new file mode 100644 index 0000000..25c2fcc --- /dev/null +++ b/root/opt/webshare-tools/phpfm/conf/config.inc.php @@ -0,0 +1,187 @@ + "txt ini xml xsl ini inf cfg log nfo", + "layout.gif" => "html htm shtml htm pdf", + "script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", + "image2.gif" => "jpeg jpe jpg gif png bmp", + "c.gif" => "c cpp", + "compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", + "sound2.gif" => "wav mp1 mp2 mp3 mid", + "movie.gif" => "mpeg mpg mov avi rm", + "binary.gif" => "exe com dll bin dat rpm deb", +); + +# Files that can be edited in PHPFM's text editor +$EditableFiles = "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js txt ini html htm css xml xsl ini inf cfg log nfo bat"; + +# Files that can be viewed in PHPFM's image viewer. +$ViewableFiles = "jpeg jpe jpg gif png bmp"; + +# Format of last modification date +$ModifiedFormat = "H:i m-d-Y"; + +# Zoom levels for PHPFM's image viewer. +$ZoomArray = array( + 5, + 7, + 10, + 15, + 20, + 30, + 50, + 70, + 100, # Base zoom level (do not change) + 150, + 200, + 300, + 500, + 700, + 1000, +); + +# Hidden files and directories +$hide_file_extension = array( + "foo", + "bar", + ); + +$hide_file_string = array( + ".htaccess", + ); + +$hide_directory_string = array( + "secret dir", + ); + +$MIMEtypes = array( + "application/andrew-inset" => "ez", + "application/mac-binhex40" => "hqx", + "application/mac-compactpro" => "cpt", + "application/msword" => "doc", + "application/octet-stream" => "bin dms lha lzh exe class so dll", + "application/oda" => "oda", + "application/pdf" => "pdf", + "application/postscript" => "ai eps ps", + "application/smil" => "smi smil", + "application/vnd.ms-excel" => "xls", + "application/vnd.ms-powerpoint" => "ppt", + "application/vnd.wap.wbxml" => "wbxml", + "application/vnd.wap.wmlc" => "wmlc", + "application/vnd.wap.wmlscriptc" => "wmlsc", + "application/x-bcpio" => "bcpio", + "application/x-cdlink" => "vcd", + "application/x-chess-pgn" => "pgn", + "application/x-cpio" => "cpio", + "application/x-csh" => "csh", + "application/x-director" => "dcr dir dxr", + "application/x-dvi" => "dvi", + "application/x-futuresplash" => "spl", + "application/x-gtar" => "gtar", + "application/x-hdf" => "hdf", + "application/x-javascript" => "js", + "application/x-koan" => "skp skd skt skm", + "application/x-latex" => "latex", + "application/x-netcdf" => "nc cdf", + "application/x-sh" => "sh", + "application/x-shar" => "shar", + "application/x-shockwave-flash" => "swf", + "application/x-stuffit" => "sit", + "application/x-sv4cpio" => "sv4cpio", + "application/x-sv4crc" => "sv4crc", + "application/x-tar" => "tar", + "application/x-tcl" => "tcl", + "application/x-tex" => "tex", + "application/x-texinfo" => "texinfo texi", + "application/x-troff" => "t tr roff", + "application/x-troff-man" => "man", + "application/x-troff-me" => "me", + "application/x-troff-ms" => "ms", + "application/x-ustar" => "ustar", + "application/x-wais-source" => "src", + "application/zip" => "zip", + "audio/basic" => "au snd", + "audio/midi" => "mid midi kar", + "audio/mpeg" => "mpga mp2 mp3", + "audio/x-aiff" => "aif aiff aifc", + "audio/x-mpegurl" => "m3u", + "audio/x-pn-realaudio" => "ram rm", + "audio/x-pn-realaudio-plugin" => "rpm", + "audio/x-realaudio" => "ra", + "audio/x-wav" => "wav", + "chemical/x-pdb" => "pdb", + "chemical/x-xyz" => "xyz", + "image/bmp" => "bmp", + "image/gif" => "gif", + "image/ief" => "ief", + "image/jpeg" => "jpeg jpg jpe", + "image/png" => "png", + "image/tiff" => "tiff tif", + "image/vnd.wap.wbmp" => "wbmp", + "image/x-cmu-raster" => "ras", + "image/x-portable-anymap" => "pnm", + "image/x-portable-bitmap" => "pbm", + "image/x-portable-graymap" => "pgm", + "image/x-portable-pixmap" => "ppm", + "image/x-rgb" => "rgb", + "image/x-xbitmap" => "xbm", + "image/x-xpixmap" => "xpm", + "image/x-xwindowdump" => "xwd", + "model/iges" => "igs iges", + "model/mesh" => "msh mesh silo", + "model/vrml" => "wrl vrml", + "text/css" => "css", + "text/html" => "html htm", + "text/plain" => "asc txt", + "text/richtext" => "rtx", + "text/rtf" => "rtf", + "text/sgml" => "sgml sgm", + "text/tab-separated-values" => "tsv", + "text/vnd.wap.wml" => "wml", + "text/vnd.wap.wmlscript" => "wmls", + "text/x-setext" => "etx", + "text/xml" => "xml xsl", + "video/mpeg" => "mpeg mpg mpe", + "video/quicktime" => "qt mov", + "video/vnd.mpegurl" => "mxu", + "video/x-msvideo" => "avi", + "video/x-sgi-movie" => "movie", + "x-conference/x-cooltalk" => "ice", +); + +?> diff --git a/root/opt/webshare-tools/phpfm/conf/config.inc.php-full b/root/opt/webshare-tools/phpfm/conf/config.inc.php-full new file mode 100644 index 0000000..25c2fcc --- /dev/null +++ b/root/opt/webshare-tools/phpfm/conf/config.inc.php-full @@ -0,0 +1,187 @@ + "txt ini xml xsl ini inf cfg log nfo", + "layout.gif" => "html htm shtml htm pdf", + "script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", + "image2.gif" => "jpeg jpe jpg gif png bmp", + "c.gif" => "c cpp", + "compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", + "sound2.gif" => "wav mp1 mp2 mp3 mid", + "movie.gif" => "mpeg mpg mov avi rm", + "binary.gif" => "exe com dll bin dat rpm deb", +); + +# Files that can be edited in PHPFM's text editor +$EditableFiles = "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js txt ini html htm css xml xsl ini inf cfg log nfo bat"; + +# Files that can be viewed in PHPFM's image viewer. +$ViewableFiles = "jpeg jpe jpg gif png bmp"; + +# Format of last modification date +$ModifiedFormat = "H:i m-d-Y"; + +# Zoom levels for PHPFM's image viewer. +$ZoomArray = array( + 5, + 7, + 10, + 15, + 20, + 30, + 50, + 70, + 100, # Base zoom level (do not change) + 150, + 200, + 300, + 500, + 700, + 1000, +); + +# Hidden files and directories +$hide_file_extension = array( + "foo", + "bar", + ); + +$hide_file_string = array( + ".htaccess", + ); + +$hide_directory_string = array( + "secret dir", + ); + +$MIMEtypes = array( + "application/andrew-inset" => "ez", + "application/mac-binhex40" => "hqx", + "application/mac-compactpro" => "cpt", + "application/msword" => "doc", + "application/octet-stream" => "bin dms lha lzh exe class so dll", + "application/oda" => "oda", + "application/pdf" => "pdf", + "application/postscript" => "ai eps ps", + "application/smil" => "smi smil", + "application/vnd.ms-excel" => "xls", + "application/vnd.ms-powerpoint" => "ppt", + "application/vnd.wap.wbxml" => "wbxml", + "application/vnd.wap.wmlc" => "wmlc", + "application/vnd.wap.wmlscriptc" => "wmlsc", + "application/x-bcpio" => "bcpio", + "application/x-cdlink" => "vcd", + "application/x-chess-pgn" => "pgn", + "application/x-cpio" => "cpio", + "application/x-csh" => "csh", + "application/x-director" => "dcr dir dxr", + "application/x-dvi" => "dvi", + "application/x-futuresplash" => "spl", + "application/x-gtar" => "gtar", + "application/x-hdf" => "hdf", + "application/x-javascript" => "js", + "application/x-koan" => "skp skd skt skm", + "application/x-latex" => "latex", + "application/x-netcdf" => "nc cdf", + "application/x-sh" => "sh", + "application/x-shar" => "shar", + "application/x-shockwave-flash" => "swf", + "application/x-stuffit" => "sit", + "application/x-sv4cpio" => "sv4cpio", + "application/x-sv4crc" => "sv4crc", + "application/x-tar" => "tar", + "application/x-tcl" => "tcl", + "application/x-tex" => "tex", + "application/x-texinfo" => "texinfo texi", + "application/x-troff" => "t tr roff", + "application/x-troff-man" => "man", + "application/x-troff-me" => "me", + "application/x-troff-ms" => "ms", + "application/x-ustar" => "ustar", + "application/x-wais-source" => "src", + "application/zip" => "zip", + "audio/basic" => "au snd", + "audio/midi" => "mid midi kar", + "audio/mpeg" => "mpga mp2 mp3", + "audio/x-aiff" => "aif aiff aifc", + "audio/x-mpegurl" => "m3u", + "audio/x-pn-realaudio" => "ram rm", + "audio/x-pn-realaudio-plugin" => "rpm", + "audio/x-realaudio" => "ra", + "audio/x-wav" => "wav", + "chemical/x-pdb" => "pdb", + "chemical/x-xyz" => "xyz", + "image/bmp" => "bmp", + "image/gif" => "gif", + "image/ief" => "ief", + "image/jpeg" => "jpeg jpg jpe", + "image/png" => "png", + "image/tiff" => "tiff tif", + "image/vnd.wap.wbmp" => "wbmp", + "image/x-cmu-raster" => "ras", + "image/x-portable-anymap" => "pnm", + "image/x-portable-bitmap" => "pbm", + "image/x-portable-graymap" => "pgm", + "image/x-portable-pixmap" => "ppm", + "image/x-rgb" => "rgb", + "image/x-xbitmap" => "xbm", + "image/x-xpixmap" => "xpm", + "image/x-xwindowdump" => "xwd", + "model/iges" => "igs iges", + "model/mesh" => "msh mesh silo", + "model/vrml" => "wrl vrml", + "text/css" => "css", + "text/html" => "html htm", + "text/plain" => "asc txt", + "text/richtext" => "rtx", + "text/rtf" => "rtf", + "text/sgml" => "sgml sgm", + "text/tab-separated-values" => "tsv", + "text/vnd.wap.wml" => "wml", + "text/vnd.wap.wmlscript" => "wmls", + "text/x-setext" => "etx", + "text/xml" => "xml xsl", + "video/mpeg" => "mpeg mpg mpe", + "video/quicktime" => "qt mov", + "video/vnd.mpegurl" => "mxu", + "video/x-msvideo" => "avi", + "video/x-sgi-movie" => "movie", + "x-conference/x-cooltalk" => "ice", +); + +?> diff --git a/root/opt/webshare-tools/phpfm/conf/config.inc.php-nodelete b/root/opt/webshare-tools/phpfm/conf/config.inc.php-nodelete new file mode 100644 index 0000000..2fecf08 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/conf/config.inc.php-nodelete @@ -0,0 +1,187 @@ + "txt ini xml xsl ini inf cfg log nfo", + "layout.gif" => "html htm shtml htm pdf", + "script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", + "image2.gif" => "jpeg jpe jpg gif png bmp", + "c.gif" => "c cpp", + "compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", + "sound2.gif" => "wav mp1 mp2 mp3 mid", + "movie.gif" => "mpeg mpg mov avi rm", + "binary.gif" => "exe com dll bin dat rpm deb", +); + +# Files that can be edited in PHPFM's text editor +$EditableFiles = "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js txt ini html htm css xml xsl ini inf cfg log nfo bat"; + +# Files that can be viewed in PHPFM's image viewer. +$ViewableFiles = "jpeg jpe jpg gif png bmp"; + +# Format of last modification date +$ModifiedFormat = "H:i m-d-Y"; + +# Zoom levels for PHPFM's image viewer. +$ZoomArray = array( + 5, + 7, + 10, + 15, + 20, + 30, + 50, + 70, + 100, # Base zoom level (do not change) + 150, + 200, + 300, + 500, + 700, + 1000, +); + +# Hidden files and directories +$hide_file_extension = array( + "foo", + "bar", + ); + +$hide_file_string = array( + ".htaccess", + ); + +$hide_directory_string = array( + "secret dir", + ); + +$MIMEtypes = array( + "application/andrew-inset" => "ez", + "application/mac-binhex40" => "hqx", + "application/mac-compactpro" => "cpt", + "application/msword" => "doc", + "application/octet-stream" => "bin dms lha lzh exe class so dll", + "application/oda" => "oda", + "application/pdf" => "pdf", + "application/postscript" => "ai eps ps", + "application/smil" => "smi smil", + "application/vnd.ms-excel" => "xls", + "application/vnd.ms-powerpoint" => "ppt", + "application/vnd.wap.wbxml" => "wbxml", + "application/vnd.wap.wmlc" => "wmlc", + "application/vnd.wap.wmlscriptc" => "wmlsc", + "application/x-bcpio" => "bcpio", + "application/x-cdlink" => "vcd", + "application/x-chess-pgn" => "pgn", + "application/x-cpio" => "cpio", + "application/x-csh" => "csh", + "application/x-director" => "dcr dir dxr", + "application/x-dvi" => "dvi", + "application/x-futuresplash" => "spl", + "application/x-gtar" => "gtar", + "application/x-hdf" => "hdf", + "application/x-javascript" => "js", + "application/x-koan" => "skp skd skt skm", + "application/x-latex" => "latex", + "application/x-netcdf" => "nc cdf", + "application/x-sh" => "sh", + "application/x-shar" => "shar", + "application/x-shockwave-flash" => "swf", + "application/x-stuffit" => "sit", + "application/x-sv4cpio" => "sv4cpio", + "application/x-sv4crc" => "sv4crc", + "application/x-tar" => "tar", + "application/x-tcl" => "tcl", + "application/x-tex" => "tex", + "application/x-texinfo" => "texinfo texi", + "application/x-troff" => "t tr roff", + "application/x-troff-man" => "man", + "application/x-troff-me" => "me", + "application/x-troff-ms" => "ms", + "application/x-ustar" => "ustar", + "application/x-wais-source" => "src", + "application/zip" => "zip", + "audio/basic" => "au snd", + "audio/midi" => "mid midi kar", + "audio/mpeg" => "mpga mp2 mp3", + "audio/x-aiff" => "aif aiff aifc", + "audio/x-mpegurl" => "m3u", + "audio/x-pn-realaudio" => "ram rm", + "audio/x-pn-realaudio-plugin" => "rpm", + "audio/x-realaudio" => "ra", + "audio/x-wav" => "wav", + "chemical/x-pdb" => "pdb", + "chemical/x-xyz" => "xyz", + "image/bmp" => "bmp", + "image/gif" => "gif", + "image/ief" => "ief", + "image/jpeg" => "jpeg jpg jpe", + "image/png" => "png", + "image/tiff" => "tiff tif", + "image/vnd.wap.wbmp" => "wbmp", + "image/x-cmu-raster" => "ras", + "image/x-portable-anymap" => "pnm", + "image/x-portable-bitmap" => "pbm", + "image/x-portable-graymap" => "pgm", + "image/x-portable-pixmap" => "ppm", + "image/x-rgb" => "rgb", + "image/x-xbitmap" => "xbm", + "image/x-xpixmap" => "xpm", + "image/x-xwindowdump" => "xwd", + "model/iges" => "igs iges", + "model/mesh" => "msh mesh silo", + "model/vrml" => "wrl vrml", + "text/css" => "css", + "text/html" => "html htm", + "text/plain" => "asc txt", + "text/richtext" => "rtx", + "text/rtf" => "rtf", + "text/sgml" => "sgml sgm", + "text/tab-separated-values" => "tsv", + "text/vnd.wap.wml" => "wml", + "text/vnd.wap.wmlscript" => "wmls", + "text/x-setext" => "etx", + "text/xml" => "xml xsl", + "video/mpeg" => "mpeg mpg mpe", + "video/quicktime" => "qt mov", + "video/vnd.mpegurl" => "mxu", + "video/x-msvideo" => "avi", + "video/x-sgi-movie" => "movie", + "x-conference/x-cooltalk" => "ice", +); + +?> diff --git a/root/opt/webshare-tools/phpfm/conf/config.inc.php-updown b/root/opt/webshare-tools/phpfm/conf/config.inc.php-updown new file mode 100644 index 0000000..584cc49 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/conf/config.inc.php-updown @@ -0,0 +1,187 @@ + "txt ini xml xsl ini inf cfg log nfo", + "layout.gif" => "html htm shtml htm pdf", + "script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", + "image2.gif" => "jpeg jpe jpg gif png bmp", + "c.gif" => "c cpp", + "compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", + "sound2.gif" => "wav mp1 mp2 mp3 mid", + "movie.gif" => "mpeg mpg mov avi rm", + "binary.gif" => "exe com dll bin dat rpm deb", +); + +# Files that can be edited in PHPFM's text editor +$EditableFiles = "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js txt ini html htm css xml xsl ini inf cfg log nfo bat"; + +# Files that can be viewed in PHPFM's image viewer. +$ViewableFiles = "jpeg jpe jpg gif png bmp"; + +# Format of last modification date +$ModifiedFormat = "H:i m-d-Y"; + +# Zoom levels for PHPFM's image viewer. +$ZoomArray = array( + 5, + 7, + 10, + 15, + 20, + 30, + 50, + 70, + 100, # Base zoom level (do not change) + 150, + 200, + 300, + 500, + 700, + 1000, +); + +# Hidden files and directories +$hide_file_extension = array( + "foo", + "bar", + ); + +$hide_file_string = array( + ".htaccess", + ); + +$hide_directory_string = array( + "secret dir", + ); + +$MIMEtypes = array( + "application/andrew-inset" => "ez", + "application/mac-binhex40" => "hqx", + "application/mac-compactpro" => "cpt", + "application/msword" => "doc", + "application/octet-stream" => "bin dms lha lzh exe class so dll", + "application/oda" => "oda", + "application/pdf" => "pdf", + "application/postscript" => "ai eps ps", + "application/smil" => "smi smil", + "application/vnd.ms-excel" => "xls", + "application/vnd.ms-powerpoint" => "ppt", + "application/vnd.wap.wbxml" => "wbxml", + "application/vnd.wap.wmlc" => "wmlc", + "application/vnd.wap.wmlscriptc" => "wmlsc", + "application/x-bcpio" => "bcpio", + "application/x-cdlink" => "vcd", + "application/x-chess-pgn" => "pgn", + "application/x-cpio" => "cpio", + "application/x-csh" => "csh", + "application/x-director" => "dcr dir dxr", + "application/x-dvi" => "dvi", + "application/x-futuresplash" => "spl", + "application/x-gtar" => "gtar", + "application/x-hdf" => "hdf", + "application/x-javascript" => "js", + "application/x-koan" => "skp skd skt skm", + "application/x-latex" => "latex", + "application/x-netcdf" => "nc cdf", + "application/x-sh" => "sh", + "application/x-shar" => "shar", + "application/x-shockwave-flash" => "swf", + "application/x-stuffit" => "sit", + "application/x-sv4cpio" => "sv4cpio", + "application/x-sv4crc" => "sv4crc", + "application/x-tar" => "tar", + "application/x-tcl" => "tcl", + "application/x-tex" => "tex", + "application/x-texinfo" => "texinfo texi", + "application/x-troff" => "t tr roff", + "application/x-troff-man" => "man", + "application/x-troff-me" => "me", + "application/x-troff-ms" => "ms", + "application/x-ustar" => "ustar", + "application/x-wais-source" => "src", + "application/zip" => "zip", + "audio/basic" => "au snd", + "audio/midi" => "mid midi kar", + "audio/mpeg" => "mpga mp2 mp3", + "audio/x-aiff" => "aif aiff aifc", + "audio/x-mpegurl" => "m3u", + "audio/x-pn-realaudio" => "ram rm", + "audio/x-pn-realaudio-plugin" => "rpm", + "audio/x-realaudio" => "ra", + "audio/x-wav" => "wav", + "chemical/x-pdb" => "pdb", + "chemical/x-xyz" => "xyz", + "image/bmp" => "bmp", + "image/gif" => "gif", + "image/ief" => "ief", + "image/jpeg" => "jpeg jpg jpe", + "image/png" => "png", + "image/tiff" => "tiff tif", + "image/vnd.wap.wbmp" => "wbmp", + "image/x-cmu-raster" => "ras", + "image/x-portable-anymap" => "pnm", + "image/x-portable-bitmap" => "pbm", + "image/x-portable-graymap" => "pgm", + "image/x-portable-pixmap" => "ppm", + "image/x-rgb" => "rgb", + "image/x-xbitmap" => "xbm", + "image/x-xpixmap" => "xpm", + "image/x-xwindowdump" => "xwd", + "model/iges" => "igs iges", + "model/mesh" => "msh mesh silo", + "model/vrml" => "wrl vrml", + "text/css" => "css", + "text/html" => "html htm", + "text/plain" => "asc txt", + "text/richtext" => "rtx", + "text/rtf" => "rtf", + "text/sgml" => "sgml sgm", + "text/tab-separated-values" => "tsv", + "text/vnd.wap.wml" => "wml", + "text/vnd.wap.wmlscript" => "wmls", + "text/x-setext" => "etx", + "text/xml" => "xml xsl", + "video/mpeg" => "mpeg mpg mpe", + "video/quicktime" => "qt mov", + "video/vnd.mpegurl" => "mxu", + "video/x-msvideo" => "avi", + "video/x-sgi-movie" => "movie", + "x-conference/x-cooltalk" => "ice", +); + +?> diff --git a/root/opt/webshare-tools/phpfm/conf/config.inc.php-view b/root/opt/webshare-tools/phpfm/conf/config.inc.php-view new file mode 100644 index 0000000..61569e3 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/conf/config.inc.php-view @@ -0,0 +1,187 @@ + "txt ini xml xsl ini inf cfg log nfo", + "layout.gif" => "html htm shtml htm pdf", + "script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", + "image2.gif" => "jpeg jpe jpg gif png bmp", + "c.gif" => "c cpp", + "compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", + "sound2.gif" => "wav mp1 mp2 mp3 mid", + "movie.gif" => "mpeg mpg mov avi rm", + "binary.gif" => "exe com dll bin dat rpm deb", +); + +# Files that can be edited in PHPFM's text editor +$EditableFiles = "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js txt ini html htm css xml xsl ini inf cfg log nfo bat"; + +# Files that can be viewed in PHPFM's image viewer. +$ViewableFiles = "jpeg jpe jpg gif png bmp"; + +# Format of last modification date +$ModifiedFormat = "H:i m-d-Y"; + +# Zoom levels for PHPFM's image viewer. +$ZoomArray = array( + 5, + 7, + 10, + 15, + 20, + 30, + 50, + 70, + 100, # Base zoom level (do not change) + 150, + 200, + 300, + 500, + 700, + 1000, +); + +# Hidden files and directories +$hide_file_extension = array( + "foo", + "bar", + ); + +$hide_file_string = array( + ".htaccess", + ); + +$hide_directory_string = array( + "secret dir", + ); + +$MIMEtypes = array( + "application/andrew-inset" => "ez", + "application/mac-binhex40" => "hqx", + "application/mac-compactpro" => "cpt", + "application/msword" => "doc", + "application/octet-stream" => "bin dms lha lzh exe class so dll", + "application/oda" => "oda", + "application/pdf" => "pdf", + "application/postscript" => "ai eps ps", + "application/smil" => "smi smil", + "application/vnd.ms-excel" => "xls", + "application/vnd.ms-powerpoint" => "ppt", + "application/vnd.wap.wbxml" => "wbxml", + "application/vnd.wap.wmlc" => "wmlc", + "application/vnd.wap.wmlscriptc" => "wmlsc", + "application/x-bcpio" => "bcpio", + "application/x-cdlink" => "vcd", + "application/x-chess-pgn" => "pgn", + "application/x-cpio" => "cpio", + "application/x-csh" => "csh", + "application/x-director" => "dcr dir dxr", + "application/x-dvi" => "dvi", + "application/x-futuresplash" => "spl", + "application/x-gtar" => "gtar", + "application/x-hdf" => "hdf", + "application/x-javascript" => "js", + "application/x-koan" => "skp skd skt skm", + "application/x-latex" => "latex", + "application/x-netcdf" => "nc cdf", + "application/x-sh" => "sh", + "application/x-shar" => "shar", + "application/x-shockwave-flash" => "swf", + "application/x-stuffit" => "sit", + "application/x-sv4cpio" => "sv4cpio", + "application/x-sv4crc" => "sv4crc", + "application/x-tar" => "tar", + "application/x-tcl" => "tcl", + "application/x-tex" => "tex", + "application/x-texinfo" => "texinfo texi", + "application/x-troff" => "t tr roff", + "application/x-troff-man" => "man", + "application/x-troff-me" => "me", + "application/x-troff-ms" => "ms", + "application/x-ustar" => "ustar", + "application/x-wais-source" => "src", + "application/zip" => "zip", + "audio/basic" => "au snd", + "audio/midi" => "mid midi kar", + "audio/mpeg" => "mpga mp2 mp3", + "audio/x-aiff" => "aif aiff aifc", + "audio/x-mpegurl" => "m3u", + "audio/x-pn-realaudio" => "ram rm", + "audio/x-pn-realaudio-plugin" => "rpm", + "audio/x-realaudio" => "ra", + "audio/x-wav" => "wav", + "chemical/x-pdb" => "pdb", + "chemical/x-xyz" => "xyz", + "image/bmp" => "bmp", + "image/gif" => "gif", + "image/ief" => "ief", + "image/jpeg" => "jpeg jpg jpe", + "image/png" => "png", + "image/tiff" => "tiff tif", + "image/vnd.wap.wbmp" => "wbmp", + "image/x-cmu-raster" => "ras", + "image/x-portable-anymap" => "pnm", + "image/x-portable-bitmap" => "pbm", + "image/x-portable-graymap" => "pgm", + "image/x-portable-pixmap" => "ppm", + "image/x-rgb" => "rgb", + "image/x-xbitmap" => "xbm", + "image/x-xpixmap" => "xpm", + "image/x-xwindowdump" => "xwd", + "model/iges" => "igs iges", + "model/mesh" => "msh mesh silo", + "model/vrml" => "wrl vrml", + "text/css" => "css", + "text/html" => "html htm", + "text/plain" => "asc txt", + "text/richtext" => "rtx", + "text/rtf" => "rtf", + "text/sgml" => "sgml sgm", + "text/tab-separated-values" => "tsv", + "text/vnd.wap.wml" => "wml", + "text/vnd.wap.wmlscript" => "wmls", + "text/x-setext" => "etx", + "text/xml" => "xml xsl", + "video/mpeg" => "mpeg mpg mpe", + "video/quicktime" => "qt mov", + "video/vnd.mpegurl" => "mxu", + "video/x-msvideo" => "avi", + "video/x-sgi-movie" => "movie", + "x-conference/x-cooltalk" => "ice", +); + +?> diff --git a/root/opt/webshare-tools/phpfm/docs/changelog.txt b/root/opt/webshare-tools/phpfm/docs/changelog.txt new file mode 100644 index 0000000..56a6f2e --- /dev/null +++ b/root/opt/webshare-tools/phpfm/docs/changelog.txt @@ -0,0 +1,67 @@ +Changelog for PHPFM: +------------------------------------------------------------------------------------- + +PHPFM version 0.2.3: + + - login problems are (hopefully) fixed now. + - problems with magic quotes fixed. + - various code clean-ups - not that it matters. + - folders will be created with 777 permissions now. + - an IE bug that caused an error when opening a file at the download prompt + has been fixed now. + - slashes are now stripped form uploaded files' names. + - each language now has it's own charset. + - and guess what - more languages! :) + + +PHPFM version 0.2.2: + + - problems using view and download now fixed! + - each folder is now a link in the "Index of" path. + - create new folder, create new file and upload files can no longer be seen + when they are disabled in the configuration file. + - changed all occurrences of //". A sample URL would look like this: + "http://localhost/phpfm.0.2.0/". + 7) If you did everything right, you should see the login screen of PHPFM now. + +Installing remotely on a Windows server: +----------------------------------------------- + 1) Make sure that the webserver has PHP 4.1.0 or higher installed. + 2) Go to PHPFM's website and download the ".zip" version of the script. The website + is located at http://phpfm.zalon.dk/ + 3) Unzip the downloaded archive to a temporary folder. Be sure to extract subdirectories + as well. + 4) Open "config.inc.php" in the directory "conf" with a text editor and set the home + directory, username and password. Save the file and close the text editor. + 5) Upload all files including all subdirectories to the server (e.g. via FTP). + 6) Start up your internet browser and input the URL to PHPFM. It should look like this: + "http:////". A sample URL would look like this: + "http://www.some-site.com/phpfm.0.2.0/". + 7) If you did everything right, you should see the login screen of PHPFM now. + +Installing remotely on a Linux or Unix server: +----------------------------------------------- + 1) Make sure that the webserver has PHP 4.1.0 or higher installed. + 2) Go to PHPFM's website and download the ".tar.gz" version of the script. The website + is located at http://phpfm.zalon.dk/ + 3) Untar the downloaded archive to a temporary folder. Be sure to extract subdirectories + as well. Use "tar zxvvf phpfm.x.x.x.tar.gz" or similar. + 4) Open "config.inc.php" in the directory "conf" with a text editor and set the home + directory, username and password. Save the file and close the text editor. + 5) Upload all files including all subdirectories to the server (e.g. via FTP). + 6) CHMOD all files and directories to 777 (not sure). + 6) Start up your internet browser and input the URL to PHPFM. It should look like this: + "http:////". A sample URL would look like this: + "http://www.some-site.com/phpfm.0.2.0/". + 7) If you did everything right, you should see the login screen of PHPFM now. \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/docs/license.txt b/root/opt/webshare-tools/phpfm/docs/license.txt new file mode 100644 index 0000000..2e3a6a5 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/docs/license.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/root/opt/webshare-tools/phpfm/docs/requirements.txt b/root/opt/webshare-tools/phpfm/docs/requirements.txt new file mode 100644 index 0000000..f8d683c --- /dev/null +++ b/root/opt/webshare-tools/phpfm/docs/requirements.txt @@ -0,0 +1,26 @@ +System requirements: +------------------------------------------------------------------------------------- + +System requirements for PHPFM: + +Webserver +PHP 4.1.0 or higher + +PHPFM has been tested on the following systems: +------------------------------------------------------------------------------------- + +System 1: +Operating System Windows 98 Second Edition +Webserver Apache 1.3.23 +PHP version PHP 4.2.2 +- error_reporting E_ALL +- register_globals Off +- magic_quotes_gpc On + +System 2: +Operation System: GNU/Linux +Webserver Apache 1.3.23 +PHP version PHP 4.1.2 +- error_reporting E_ALL +- register_globals Off +- magic_quotes_gpc On \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/docs/todo.txt b/root/opt/webshare-tools/phpfm/docs/todo.txt new file mode 100644 index 0000000..a1f3e16 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/docs/todo.txt @@ -0,0 +1,21 @@ +Todo list for PHPFM: +------------------------------------------------------------------------------------- + +- find work-around for permissions on GNU/Linux & UNIX systems. +- make a login system where each user has his/hers own home directory and permissions. +- some kind of logging system. +- make an install script which makes it easier to install PHPFM. +- make hidden files unaccessible by the script (again). +- index with thumbnails of all images in the current directory (uncertain). +- make it possible to change permissions (chmod) on files and directories. +- make it so you can compress a directory and download it. +- do so you can see the full size of a directory (including sub-directories) and how + many files that are in the directory. +- templates for new (created) files. For instance PHP, HTML etc. +- unix style permissions (e.g. -rw-rw-rw-) +- too long directory- and filenames are shortened so they do not ruin the design. +- templates for PHPFM. Change the look of PHPFM easily! (not provisional) +- more languages. +- add some nifty DHTML? +- add the drive browser again? +- PDF viewer and text/PHP viewer with highlighting. \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/files/.gitignore b/root/opt/webshare-tools/phpfm/files/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/opt/webshare-tools/phpfm/icon/back.gif b/root/opt/webshare-tools/phpfm/icon/back.gif new file mode 100644 index 0000000..62639b8 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/back.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/binary.gif b/root/opt/webshare-tools/phpfm/icon/binary.gif new file mode 100644 index 0000000..9a15cba Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/binary.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/c.gif b/root/opt/webshare-tools/phpfm/icon/c.gif new file mode 100644 index 0000000..7555b6c Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/c.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/compressed.gif b/root/opt/webshare-tools/phpfm/icon/compressed.gif new file mode 100644 index 0000000..39e7327 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/compressed.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/delete.gif b/root/opt/webshare-tools/phpfm/icon/delete.gif new file mode 100644 index 0000000..5fa9929 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/delete.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/download.gif b/root/opt/webshare-tools/phpfm/icon/download.gif new file mode 100644 index 0000000..bca4556 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/download.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/drive.gif b/root/opt/webshare-tools/phpfm/icon/drive.gif new file mode 100644 index 0000000..7664cd0 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/drive.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/edit.gif b/root/opt/webshare-tools/phpfm/icon/edit.gif new file mode 100644 index 0000000..1f46366 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/edit.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/folder.gif b/root/opt/webshare-tools/phpfm/icon/folder.gif new file mode 100644 index 0000000..4826460 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/folder.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/image2.gif b/root/opt/webshare-tools/phpfm/icon/image2.gif new file mode 100644 index 0000000..751faee Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/image2.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/layout.gif b/root/opt/webshare-tools/phpfm/icon/layout.gif new file mode 100644 index 0000000..c96338a Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/layout.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/logout.gif b/root/opt/webshare-tools/phpfm/icon/logout.gif new file mode 100644 index 0000000..c2645fa Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/logout.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/minus.gif b/root/opt/webshare-tools/phpfm/icon/minus.gif new file mode 100644 index 0000000..b44cd25 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/minus.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/movie.gif b/root/opt/webshare-tools/phpfm/icon/movie.gif new file mode 100644 index 0000000..0035183 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/movie.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/newfile.gif b/root/opt/webshare-tools/phpfm/icon/newfile.gif new file mode 100644 index 0000000..7acb91d Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/newfile.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/newfolder.gif b/root/opt/webshare-tools/phpfm/icon/newfolder.gif new file mode 100644 index 0000000..c8e6581 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/newfolder.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/next.gif b/root/opt/webshare-tools/phpfm/icon/next.gif new file mode 100644 index 0000000..b640485 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/next.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/original.gif b/root/opt/webshare-tools/phpfm/icon/original.gif new file mode 100644 index 0000000..5441184 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/original.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/plus.gif b/root/opt/webshare-tools/phpfm/icon/plus.gif new file mode 100644 index 0000000..9162183 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/plus.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/previous.gif b/root/opt/webshare-tools/phpfm/icon/previous.gif new file mode 100644 index 0000000..64298e6 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/previous.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/rename.gif b/root/opt/webshare-tools/phpfm/icon/rename.gif new file mode 100644 index 0000000..2530da0 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/rename.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/script.gif b/root/opt/webshare-tools/phpfm/icon/script.gif new file mode 100644 index 0000000..d8a853b Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/script.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/sound2.gif b/root/opt/webshare-tools/phpfm/icon/sound2.gif new file mode 100644 index 0000000..48e6a7f Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/sound2.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/text.gif b/root/opt/webshare-tools/phpfm/icon/text.gif new file mode 100644 index 0000000..4c62390 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/text.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/unknown.gif b/root/opt/webshare-tools/phpfm/icon/unknown.gif new file mode 100644 index 0000000..32b1ea2 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/unknown.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/upload.gif b/root/opt/webshare-tools/phpfm/icon/upload.gif new file mode 100644 index 0000000..bca4556 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/upload.gif differ diff --git a/root/opt/webshare-tools/phpfm/icon/valid-css.jpg b/root/opt/webshare-tools/phpfm/icon/valid-css.jpg new file mode 100644 index 0000000..754a609 Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/valid-css.jpg differ diff --git a/root/opt/webshare-tools/phpfm/icon/valid-html401.jpg b/root/opt/webshare-tools/phpfm/icon/valid-html401.jpg new file mode 100644 index 0000000..869c8cf Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/valid-html401.jpg differ diff --git a/root/opt/webshare-tools/phpfm/icon/view.gif b/root/opt/webshare-tools/phpfm/icon/view.gif new file mode 100644 index 0000000..0d029ea Binary files /dev/null and b/root/opt/webshare-tools/phpfm/icon/view.gif differ diff --git a/root/opt/webshare-tools/phpfm/incl/auth.inc.php b/root/opt/webshare-tools/phpfm/incl/auth.inc.php new file mode 100644 index 0000000..5c325a1 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/auth.inc.php @@ -0,0 +1,15 @@ +Access Denied!"); + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/create.inc.php b/root/opt/webshare-tools/phpfm/incl/create.inc.php new file mode 100644 index 0000000..20713d6 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/create.inc.php @@ -0,0 +1,73 @@ +$StrFolderInvalidName"; + else if (file_exists($home_directory.$path.stripslashes($_POST['directory_name']."/"))) + print "$StrAlreadyExists"; + else if (@mkdir($home_directory.$path.stripslashes($_POST['directory_name']), 0777)) + print "$StrCreateFolderSuccess"; + else + { + print "$StrCreateFolderFail

"; + print $StrCreateFolderFailHelp; + } + umask($umask); +} + +else if ($AllowCreateFile && isset($_GET['create']) && isset($_POST['filename'])) +{ + if (!is_valid_name(stripslashes($_POST['filename']))) + print "$StrFileInvalidName"; + else if (file_exists($home_directory.$path.stripslashes($_POST['filename']))) + print "$StrAlreadyExists"; + else if (@fopen($home_directory.$path.stripslashes($_POST['filename']), "w+")) + print "$StrCreateFileSuccess"; + else + { + print "$StrCreateFileFail

"; + print $StrCreateFileFailHelp; + } +} + +else if ($AllowCreateFolder || $AllowCreateFile) +{ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + if ($_GET['type'] == "directory") print " $StrCreateFolder"; + else if ($_GET['type'] == "file") print " $StrCreateFile"; + print ""; + print "$StrBack"; + print "
"; + + print "

"; + + if ($_GET['type'] == "directory") print "$StrCreateFolderQuestion

"; + else if ($_GET['type'] == "file") print "$StrCreateFileQuestion

"; + print "
"; + if ($_GET['type'] == "directory") print " "; + else if ($_GET['type'] == "file") print " "; + print ""; + print ""; + print "
"; + + print "

"; + + print "
"; +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/delete.inc.php b/root/opt/webshare-tools/phpfm/incl/delete.inc.php new file mode 100644 index 0000000..6bacb78 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/delete.inc.php @@ -0,0 +1,83 @@ +$StrFolderInvalidName"; + else if (!file_exists($home_directory.$path.$directory_name)) + print "$StrDeleteFolderNotFound"; + else if (remove_directory($home_directory.$path.$directory_name) && @rmdir($home_directory.$path.$directory_name)) + print "$StrDeleteFolderSuccess"; + else + { + print "$StrDeleteFolderFail

"; + print $StrDeleteFolderFailHelp; + } + } + + else if (isset($_GET['delete']) && isset($_GET['filename'])) + { + if ($_GET['filename'] == ".." || ($_GET['filename'] == ".")) + print "$StrFileInvalidName"; + else if (!file_exists($home_directory.$path.$filename)) + print "$StrDeleteFileNotFound"; + else if (@unlink($home_directory.$path.$filename)) + print "$StrDeleteFileSuccess"; + else + { + print "$StrDeleteFileFail

"; + print $StrDeleteFileFailHelp; + } + } + + else + { + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + if (isset($_GET['directory_name'])) print " $StrDeleteFolder \"".htmlentities(basename($directory_name))."\"?"; + else if (isset($_GET['filename'])) print " $StrDeleteFile \"".htmlentities($filename)."\"?"; + print ""; + print "$StrBack"; + print "
"; + + print "

"; + + if (isset($_GET['directory_name'])) + { + print "$StrDeleteFolderQuestion

"; + print "/".htmlentities($path.$directory_name); + } + else if (isset($_GET['filename'])) + { + print "$StrDeleteFileQuestion

"; + print "/".htmlentities($path.$filename); + } + + print "

"; + + if (isset($_GET['directory_name'])) print "$StrYes"; + else if (isset($_GET['filename'])) print "$StrYes"; + print " $StrOr "; + print "$StrCancel"; + + print "

"; + + print "
"; + } +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/download.inc.php b/root/opt/webshare-tools/phpfm/incl/download.inc.php new file mode 100644 index 0000000..fa22dc6 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/download.inc.php @@ -0,0 +1,30 @@ +"; + print ""; + print ""; + print " $StrDownload \"".htmlentities($filename)."\""; + print ""; + print ""; + print "$StrBack"; + print ""; + print ""; + print ""; + print ""; + print "

"; + print "$StrDownloadClickLink

"; + print "$StrDownloadClickHere \"".htmlentities($filename)."\""; + print "

"; + print ""; + print ""; + print ""; +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/edit.inc.php b/root/opt/webshare-tools/phpfm/incl/edit.inc.php new file mode 100644 index 0000000..e22d24d --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/edit.inc.php @@ -0,0 +1,69 @@ +$StrFileInvalidName"; + else if ($fp = @fopen ($home_directory.$path.stripslashes($_POST['filename']), "wb")) + { + fwrite($fp, $text); + fclose($fp); + print "$StrSaveFileSuccess"; + } + else + print "$StrSaveFileFail"; + +} + +else if ($AllowEdit && isset($_GET['filename'])) +{ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print " $StrEditing \"".htmlentities($filename)."\""; + print ""; + print "$StrBack"; + print "
"; + + print "

"; + + if ($fp = @fopen($home_directory.$path.$filename, "rb")) + { + print "
"; + + print ""; + + print "

"; + print "$StrFilename "; + + print "

"; + print " "; + + print ""; + print "
"; + } + else + print "$StrErrorOpeningFile"; + + print "

"; + + print "
"; +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/filebrowser.inc.php b/root/opt/webshare-tools/phpfm/incl/filebrowser.inc.php new file mode 100644 index 0000000..369ecfb --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/filebrowser.inc.php @@ -0,0 +1,151 @@ +"; + print ""; + if ($AllowCreateFolder) print "$StrMenuCreateFolder $StrMenuCreateFolder"; + if ($AllowCreateFile) print "$StrMenuCreateFile $StrMenuCreateFile"; + if ($AllowUpload) print "$StrMenuUploadFiles $StrMenuUploadFiles"; + if ($phpfm_auth) print "$StrMenuLogOut $StrMenuLogOut"; + print ""; +print "
"; + +print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; +print "
"; + print "$StrIndexOf ".get_linked_path($path,$base_url).""; + print "
 "; + + + + if ($open = @opendir($home_directory.$path)) + { + for($i=0;($directory = readdir($open)) != FALSE;$i++) + if (is_dir($home_directory.$path.$directory) && $directory != "." && $directory != ".." && !is_hidden_directory($home_directory.$path.$directory)) + $directories[$i] = array($directory,$directory); + closedir($open); + + if (isset($directories)) + { + sort($directories); + reset($directories); + } + } + + print ""; + print ""; + print ""; + print ""; + if ($AllowRename) print ""; + if ($AllowDelete) print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + if (isset($directories)) foreach($directories as $directory) + { + print ""; + print ""; + print ""; + if ($AllowRename) print ""; + if ($AllowDelete) print ""; + print ""; + } + print ""; + print "
  $StrFolderNameShort$StrRenameShort$StrDeleteShort
$StrOpenFolder .  
$StrOpenFolder ..  
$StrOpenFolder ".htmlentities($directory[0])."$StrRenameFolder$StrDeleteFolder
 
"; + + print "
 "; + + + + if ($open = @opendir($home_directory.$path)) + { + for($i=0;($file = readdir($open)) != FALSE;$i++) + if (is_file($home_directory.$path.$file) && !is_hidden_file($home_directory.$path.$file)) + { + $icon = get_icon($file); + $filesize = filesize($home_directory.$path.$file); + $permissions = decoct(fileperms($home_directory.$path.$file)%01000); + $modified = filemtime($home_directory.$path.$file); + $extension = ""; + $files[$i] = array( + "icon" => $icon, + "filename" => $file, + "filesize" => $filesize, + "permissions" => $permissions, + "modified" => $modified, + "extension" => $extension, + ); + } + closedir($open); + + if (isset($files)) + { + usort($files, "compare_filedata"); + reset($files); + } + } + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + if ($AllowView) print ""; + if ($AllowEdit) print ""; + if ($AllowRename) print ""; + if ($AllowDownload) print ""; + if ($AllowDelete) print ""; + print ""; + if (isset($files)) foreach($files as $file) + { + $file['filesize'] = get_better_filesize($file['filesize']); + $file['modified'] = date($ModifiedFormat, $file['modified']); + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + if ($AllowView && is_viewable_file($file['filename'])) print ""; + else if ($AllowView) print ""; + if ($AllowEdit && is_editable_file($file['filename'])) print ""; + else if ($AllowEdit) print ""; + if ($AllowRename) print ""; + if ($AllowDownload) print ""; + if ($AllowEdit) print ""; + print ""; + + } + print ""; + print "
  $StrFileNameShort$StrFileSizeShort$StrPermissionsShort$StrLastModifiedShort$StrViewShort$StrEditShort$StrRenameShort$StrDownloadShort$StrDeleteShort
$StrFile ".htmlentities($file['filename'])."".$file['filesize']."".$file['permissions']."".$file['modified']."$StrViewFile $StrEditFile $StrRenameFile$StrDownloadFile$StrDeleteFile
 
"; + + + print "
"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/footer.inc.php b/root/opt/webshare-tools/phpfm/incl/footer.inc.php new file mode 100644 index 0000000..645a38e --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/footer.inc.php @@ -0,0 +1,19 @@ +
"; +print ""; +print ""; +print ""; +print "
 
This page was produced in $total_time seconds.
"; + +print "

"; + +print ""; +print ""; +print ""; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/footer.inc.php.dist b/root/opt/webshare-tools/phpfm/incl/footer.inc.php.dist new file mode 100644 index 0000000..8f36acf --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/footer.inc.php.dist @@ -0,0 +1,26 @@ +
"; +print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; +print "
Powered by PHPFM ".VERSION."
Copyright © 2002 Morten Bojsen-Hansen
 
"; + print "Valid HTML 4.01!"; + print "Valid CSS!"; + print "
 
This page was produced in $total_time seconds.
"; + +print "

"; + +print ""; +print ""; +print ""; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/functions.inc.php b/root/opt/webshare-tools/phpfm/incl/functions.inc.php new file mode 100644 index 0000000..bdd4ec0 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/functions.inc.php @@ -0,0 +1,258 @@ + $b[$_GET['sortby']]) return 1; + else return -1; + } + else if ($_GET['order'] == "desc") + { + if ($a[$_GET['sortby']] < $b[$_GET['sortby']]) return 1; + else return -1; + } + } + + else if (is_string($a[$_GET['sortby']]) && is_string($b[$_GET['sortby']]) && $_GET['order'] == "asc") + return strcmp($a[$_GET['sortby']], $b[$_GET['sortby']]); + else if (is_string($a[$_GET['sortby']]) && is_string($b[$_GET['sortby']]) && $_GET['order'] == "desc") + return -strcmp($a[$_GET['sortby']], $b[$_GET['sortby']]); +} + +function get_opposite_order($input, $order) ## Get opposite order +{ + if ($_GET['sortby'] == $input) + { + if ($order == "asc") + return "desc"; + else if ($order == "desc") + return "asc"; + } + else + return "asc"; +} + +function is_editable_file($filename) ## Checks whether a file is editable +{ + global $EditableFiles; + + $extension = strtolower(substr(strrchr($filename, "."),1)); + + foreach(explode(" ", $EditableFiles) as $type) + if ($extension == $type) + return TRUE; + + return FALSE; +} + +function is_viewable_file($filename) ## Checks whether a file is viewable +{ + global $ViewableFiles; + + $extension = strtolower(substr(strrchr($filename, "."),1)); + + foreach(explode(" ", $ViewableFiles) as $type) + if ($extension == $type) + return TRUE; + + return FALSE; +} + +function is_valid_name($input) ## Checks whether the directory- or filename is valid +{ + if (strstr($input, "\\")) + return FALSE; + else if (strstr($input, "/")) + return FALSE; + else if (strstr($input, ":")) + return FALSE; + else if (strstr($input, "?")) + return FALSE; + else if (strstr($input, "*")) + return FALSE; + else if (strstr($input, "\"")) + return FALSE; + else if (strstr($input, "<")) + return FALSE; + else if (strstr($input, ">")) + return FALSE; + else if (strstr($input, "|")) + return FALSE; + else + return TRUE; +} + +function get_better_filesize($filesize) ## Converts filesize to KB/MB/GB/TB +{ + $kilobyte = 1024; + $megabyte = 1048576; + $gigabyte = 1073741824; + $terabyte = 1099511627776; + + if ($filesize >= $terabyte) + return number_format($filesize/$terabyte, 2, ',', '.')." TB"; + else if ($filesize >= $gigabyte) + return number_format($filesize/$gigabyte, 2, ',', '.')." GB"; + else if ($filesize >= $megabyte) + return number_format($filesize/$megabyte, 2, ',', '.')." MB"; + else if ($filesize >= $kilobyte) + return number_format($filesize/$kilobyte, 2, ',', '.')." KB"; + else + return number_format($filesize, 0, ',', '.')." B"; +} + +function get_current_zoom_level($current_zoom_level, $zoom) ## Get current zoom level +{ + global $ZoomArray; + + reset($ZoomArray); + + while(list($number, $zoom_level) = each($ZoomArray)) + if ($zoom_level == $current_zoom_level) + if (($number+$zoom) < 0) return $number; + else if (($number+$zoom) >= count($ZoomArray)) return $number; + else return $number+$zoom; +} + +function validate_path($path) ## Validate path +{ + global $StrAccessDenied; + + if (stristr($path, "../") || stristr($path, "..\\")) + return TRUE; + else + return stripslashes($path); +} + +function authenticate_user() ## Authenticate user using cookies +{ + global $username, $password; + + if (isset($_COOKIE['cookie_username']) && $_COOKIE['cookie_username'] == $username && isset($_COOKIE['cookie_password']) && $_COOKIE['cookie_password'] == md5($password)) + return TRUE; + else + return FALSE; +} + +function is_hidden_file($path) ## Checks whether the file is hidden. +{ + global $hide_file_extension, $hide_file_string, $hide_directory_string; + + $extension = strtolower(substr(strrchr($path, "."),1)); + + foreach ($hide_file_extension as $hidden_extension) + if ($hidden_extension == $extension) + return TRUE; + + foreach ($hide_file_string as $hidden_string) + if (stristr(basename($path), $hidden_string)) + return TRUE; + + foreach ($hide_directory_string as $hidden_string) + if (stristr(dirname($path), $hidden_string)) + return TRUE; + + return FALSE; +} + +function is_hidden_directory($path) ## Checks whether the directory is hidden. +{ + global $hide_directory_string; + + foreach ($hide_directory_string as $hidden_string) + if (stristr($path, $hidden_string)) + return TRUE; + + return FALSE; +} + +function get_mimetype($filename) ## Get MIME-type for file +{ + global $MIMEtypes; + + reset($MIMEtypes); + + $extension = strtolower(substr(strrchr($filename, "."),1)); + + if ($extension == "") + return "Unknown/Unknown"; + + while (list($mimetype, $file_extensions) = each($MIMEtypes)) + foreach (explode(" ", $file_extensions) as $file_extension) + if ($extension == $file_extension) + return $mimetype; + + return "Unknown/Unknown"; +} + +function get_linked_path($path,$base_url) ## Get path with links to each folder +{ + $string = ". / "; + $array = explode("/",htmlentities($path)); + unset($array[count($array)-1]); + foreach ($array as $entry) + { + @$temppath .= $entry."/"; + $string .= "$entry / "; + } + + return $string; +} + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/header.inc.php b/root/opt/webshare-tools/phpfm/incl/header.inc.php new file mode 100644 index 0000000..731c924 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/header.inc.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/html.header.inc.php b/root/opt/webshare-tools/phpfm/incl/html.header.inc.php new file mode 100644 index 0000000..559890e --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/html.header.inc.php @@ -0,0 +1,17 @@ +"; + +print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print ""; + print ""; + print ""; + print ""; + print "

"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/html.header.inc.php.dist b/root/opt/webshare-tools/phpfm/incl/html.header.inc.php.dist new file mode 100644 index 0000000..618bde4 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/html.header.inc.php.dist @@ -0,0 +1,18 @@ +"; + +print ""; + print ""; + print "PHPFM ".VERSION." - a file manager written in PHP"; + print ""; + print ""; + print ""; + print "
"; + print ""; + print ""; + print ""; + print ""; + print "
PHPFM ".VERSION."

"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/libfile.php b/root/opt/webshare-tools/phpfm/incl/libfile.php new file mode 100644 index 0000000..0b11e2b --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/libfile.php @@ -0,0 +1,50 @@ +$StrAccessDenied"; + exit(); + } + + header("Pragma:"); + header("Content-Type: ".get_mimetype($filename)); + header("Content-Length: ".filesize($fullpath)); + if ($_GET['action'] == "download"); + header("Content-Disposition: attachment; filename=\"$filename\""); + + readfile($fullpath); + } + else + print "$StrDownloadFail"; +} + +?> diff --git a/root/opt/webshare-tools/phpfm/incl/login.inc.php b/root/opt/webshare-tools/phpfm/incl/login.inc.php new file mode 100644 index 0000000..23cd97e --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/login.inc.php @@ -0,0 +1,32 @@ +"; + print ""; + print ""; + print "$StrLoginSystem"; + print ""; + print ""; + print ""; + print ""; + + print "

"; + + print "$StrLoginInfo
"; + print "
"; + + print ""; + print ""; + print ""; + print ""; + print "
$StrUsername
$StrPassword
 
"; + + print ""; + print "
"; + + print "

"; + + print ""; + print ""; +print ""; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/phpfm.css b/root/opt/webshare-tools/phpfm/incl/phpfm.css new file mode 100644 index 0000000..9b390de --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/phpfm.css @@ -0,0 +1,31 @@ +body { margin : 0px; font-family : Tahoma, serif; font-size : 8pt; color : #000000; background-color: transparent; } + +font.headline { font-family : Tahoma, serif; font-size : 25pt; color : #000000; font-weight : bold; background-color: transparent; } +font.iheadline { font-family : Tahoma, serif; font-size : 10pt; color : #FFFFFF; font-weight : bold; background-color: transparent; } + +table.top { width: 100%; border-bottom : 1px solid #000000; background-color: transparent; } +table.bottom { width: 100%; border-top : 1px solid #000000; font-family : Tahoma, serif; font-size : 8pt; background-color: transparent; } +table.index { background-color : #EEEEEE; color : #000000; border : 1px solid #000000; font-family : Tahoma, serif; font-size : 8pt; } +table.directories { font-family : Tahoma, serif; font-size : 10pt; background-color: transparent; } +table.files { font-family : Tahoma, serif; font-size : 10pt; background-color: transparent; } +table.menu { font-family : Tahoma, serif; font-size : 10pt; background-color: transparent; } +table.upload { font-family : Tahoma, serif; font-size : 8pt; background-color: transparent; } +table.output { font-family : Tahoma, serif; font-size : 8pt; background-color : #EEEEEE; color : #000000; } + +td.iheadline { background-color : #5485C9; color : #000000; border-bottom : 1px solid #000000; } +td.fbborder { border-right : 1px solid #000000; background-color: transparent; } + +a:link { text-decoration : none; color : #000000; background-color: transparent; } +a:visited { text-decoration : none; color : #000000; background-color: transparent; } +a:hover { text-decoration : underline; color : #000000; background-color: transparent; } + +a.bottom:link { text-decoration : none; color : #000088; background-color: transparent; } +a.bottom:visited { text-decoration : none; color : #000088; background-color: transparent; } +a.bottom:hover { text-decoration : underline; color : #000088; background-color: transparent; } + +input { background-color : #DDDDDD; border : 1px solid #000000; font-family : Tahoma, serif; font-size : 8pt; color : #000000; } +input.button { width : 50px; } +input.bigbutton { width : 100px; } +textarea { background-color : #FFFFFF; color : #000000; border : 1px solid #000000; font-family : Tahoma, serif; font-size : 10pt; } + +.bold { font-weight : bold; background-color: transparent; } \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/rename.inc.php b/root/opt/webshare-tools/phpfm/incl/rename.inc.php new file mode 100644 index 0000000..825c440 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/rename.inc.php @@ -0,0 +1,76 @@ +$StrFolderInvalidName"; + else if (@file_exists($home_directory.$path.$new_directory_name)) + print "$StrAlreadyExists"; + else if (@rename($home_directory.$path.$directory_name, $home_directory.$path.$new_directory_name)) + print "$StrRenameFolderSuccess"; + else + { + print "$StrRenameFolderFail

"; + print $StrRenameFolderFailHelp; + } + } + + else if (isset($_GET['rename']) && isset($_POST['filename'])) + { + if (!is_valid_name($new_filename)) + print "$StrFileInvalidName"; + else if (@file_exists($home_directory.$path.$new_filename)) + print "$StrAlreadyExists"; + else if (@rename($home_directory.$path.$filename, $home_directory.$path.$new_filename)) + print "$StrRenameFileSuccess"; + else + { + print "$StrRenameFileFail

"; + print $StrRenameFileFailHelp; + } + } + + else + { + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + if (isset($_GET['directory_name'])) print " $StrRenameFolder \"".htmlentities(basename($directory_name))."\""; + else if (isset($_GET['filename'])) print " $StrRenameFile \"".htmlentities($filename)."\""; + print ""; + print "$StrBack"; + print "
"; + + print "

"; + + if (isset($_GET['directory_name'])) print "$StrRenameFolderQuestion

"; + else if (isset($_GET['filename'])) print "$StrRenameFileQuestion

"; + print "
"; + if (isset($_GET['directory_name'])) print " "; + else if (isset($_GET['filename'])) print " "; + print ""; + if (isset($_GET['directory_name'])) print ""; + else if (isset($_GET['filename'])) print ""; + print ""; + print "
"; + + print "

"; + + print "
"; + } +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/upload.inc.php b/root/opt/webshare-tools/phpfm/incl/upload.inc.php new file mode 100644 index 0000000..2ef734a --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/upload.inc.php @@ -0,0 +1,66 @@ +"; + + if (!isset($_FILES['userfile'])) + // maximum post size reached + print $StrUploadFailPost; + else + { + for($i=0;$i<=3;$i++) + { + $_FILES['userfile']['name'][$i] = stripslashes($_FILES['userfile']['name'][$i]); + if (@move_uploaded_file($_FILES['userfile']['tmp_name'][$i], realpath($home_directory.$path)."/".$_FILES['userfile']['name'][$i])) + print "$StrUploading ".$_FILES['userfile']['name'][$i]."[$StrUploadSuccess]"; + else if ($_FILES['userfile']['name'][$i]) + print "$StrUploading ".$_FILES['userfile']['name'][$i]."[$StrUploadFail]"; + } + } + print ""; +} + +else if ($AllowUpload) +{ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print " $StrUploadFilesTo \"/".htmlentities($path)."\""; + print ""; + print "$StrBack"; + print "
"; + + print "

"; + + print "$StrUploadQuestion
"; + print "
"; + + print ""; + print ""; + print ""; + print ""; + print ""; + print "
$StrFirstFile
$StrSecondFile
$StrThirdFile
$StrFourthFile
"; + + print ""; + print ""; + print "
"; + + print "

"; + + print "
"; +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/incl/view.inc.php b/root/opt/webshare-tools/phpfm/incl/view.inc.php new file mode 100644 index 0000000..5e34252 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/incl/view.inc.php @@ -0,0 +1,85 @@ +"; + print ""; + print ""; + print " $StrViewing \"".htmlentities($filename)."\" $StrAt ".$_GET['size']."%"; + print ""; + print ""; + print "$StrBack"; + print ""; + print ""; + print ""; + print ""; + + print "

"; + + if (is_file($home_directory.$path.$filename) && is_viewable_file($filename)) + { + $image_info = GetImageSize($home_directory.$path.$filename); + $size = $_GET['size']; + $zoom_in = $ZoomArray[get_current_zoom_level($size, 1)]; + $zoom_out = $ZoomArray[get_current_zoom_level($size, -1)]; + $width = $image_info[0] * $size / 100; + $height = $image_info[1] * $size / 100; + + $files = array(); + if ($open = opendir($home_directory.$path)) + { + while ($file = readdir($open)) + if (is_file($home_directory.$path.$file) && is_viewable_file($file)) + $files[] = $file; + closedir($open); + sort($files); + + if (count($files)>1) + { + for($i=0;$files[$i]!=$filename;$i++); + if ($i==0) $prev = $files[$i+count($files)-1]; + else $prev = $files[$i-1]; + if ($i==(count($files)-1)) $next = $files[$i-count($files)+1]; + else $next = $files[$i+1]; + } + else + { + $prev = $filename; + $next = $filename; + } + } + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print "$StrImage"; + } + else + { + print "$StrViewFail

"; + print "$StrViewFailHelp"; + } + + print "

"; + + print ""; + print ""; + print ""; + + print ""; +} +else + print "$StrAccessDenied"; + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/index.php b/root/opt/webshare-tools/phpfm/index.php new file mode 100644 index 0000000..a5ca8e5 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/index.php @@ -0,0 +1,93 @@ +"; + print ""; + + if (!(@opendir($home_directory))) + print "$StrInvalidHomeFolder"; + else if (!(@opendir($home_directory.$path))) + print "$StrInvalidPath"; + if (substr($home_directory, -1) != "/") + print " $StrMissingTrailingSlash"; + + print ""; + print "
"; + } + + if (isset($_GET['action']) && is_file("incl/".$_GET['action'].".inc.php") && is_valid_name($_GET['action'])) + include("./incl/".basename($_GET['action']).".inc.php"); + else if (isset($_GET['output']) && is_file("incl/".$_GET['output'].".inc.php") && is_valid_name($_GET['output'])) + { + print ""; + print ""; + print "
"; + include("./incl/".basename($_GET['output']).".inc.php"); + print "

"; + + include("./incl/filebrowser.inc.php"); + } + else + { + include("./incl/filebrowser.inc.php"); + } +} +else +{ + include("./incl/login.inc.php"); +} + +include("./incl/footer.inc.php"); + +?> \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/bulgarian.inc.php b/root/opt/webshare-tools/phpfm/lang/bulgarian.inc.php new file mode 100644 index 0000000..671dbc5 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/bulgarian.inc.php @@ -0,0 +1,128 @@ + diff --git a/root/opt/webshare-tools/phpfm/lang/danish.inc.php b/root/opt/webshare-tools/phpfm/lang/danish.inc.php new file mode 100644 index 0000000..dcc9555 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/danish.inc.php @@ -0,0 +1,127 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/dutch.inc.php b/root/opt/webshare-tools/phpfm/lang/dutch.inc.php new file mode 100644 index 0000000..dcad667 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/dutch.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/english.inc.php b/root/opt/webshare-tools/phpfm/lang/english.inc.php new file mode 100644 index 0000000..e9a329c --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/english.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/finnish.inc.php b/root/opt/webshare-tools/phpfm/lang/finnish.inc.php new file mode 100644 index 0000000..ae740d7 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/finnish.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/french.inc.php b/root/opt/webshare-tools/phpfm/lang/french.inc.php new file mode 100644 index 0000000..791051e --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/french.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/french2.inc.php b/root/opt/webshare-tools/phpfm/lang/french2.inc.php new file mode 100644 index 0000000..1a6978a --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/french2.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/german.inc.php b/root/opt/webshare-tools/phpfm/lang/german.inc.php new file mode 100644 index 0000000..46c1e32 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/german.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/italian.inc.php b/root/opt/webshare-tools/phpfm/lang/italian.inc.php new file mode 100644 index 0000000..61ff3c2 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/italian.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/portugues.inc.php b/root/opt/webshare-tools/phpfm/lang/portugues.inc.php new file mode 100644 index 0000000..89f699c --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/portugues.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/russian.inc.php b/root/opt/webshare-tools/phpfm/lang/russian.inc.php new file mode 100644 index 0000000..bb62776 --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/russian.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/lang/spanish.inc.php b/root/opt/webshare-tools/phpfm/lang/spanish.inc.php new file mode 100644 index 0000000..e05901a --- /dev/null +++ b/root/opt/webshare-tools/phpfm/lang/spanish.inc.php @@ -0,0 +1,128 @@ + \ No newline at end of file diff --git a/root/opt/webshare-tools/phpfm/readme.txt b/root/opt/webshare-tools/phpfm/readme.txt new file mode 100644 index 0000000..f13913a --- /dev/null +++ b/root/opt/webshare-tools/phpfm/readme.txt @@ -0,0 +1,65 @@ +Readme for PHPFM: +------------------------------------------------------------------------------------- + + PHPFM - a file manager written in PHP + + ---------------------- + http://phpfm.zalon.dk/ + + Copyright (C) 2002 Morten Bojsen-Hansen + Email: raz0@worldonline.dk + + PHPFM 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. + + PHPFM 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. + + You should have received a copy of the GNU General Public License + along with PHPFM; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Summary: + PHPFM is meant to handle administration of a webserver or web hotel via HTTP. + It can currently: + - create, rename and delete folders. + - create, upload, rename, download and delete files. + - edit text files. + - view image files. + - sort files by name, size, permissions and last modification date both + ascending and descending. + - communicate in more languages. + + License: + Check docs/license.txt for more information. + + Download: + The newest version of PHPFM is always availible from http://phpfm.zalon.dk/ + + Requirements: + Check docs/requirements.txt for more information. + + Installing: + Check docs/install.txt for more information. + + Configurating: + Check docs/configurating.txt for more information. + + Changelog: + Check docs/changelog.txt for more information. + + Todo: + Check docs/todo.txt for more information. + + Frequently Asked Questions (FAQ): + Check docs/faq.txt for more information. + + + Hope you will enjoy using PHPFM as + much as I enjoyed creating it! + + Morten Bojsen-Hansen \ No newline at end of file diff --git a/root/opt/webshare/.gitignore b/root/opt/webshare/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/smeserver-webshare.spec b/smeserver-webshare.spec new file mode 100644 index 0000000..3639312 --- /dev/null +++ b/smeserver-webshare.spec @@ -0,0 +1,122 @@ +# $Id: smeserver-webshare.spec,v 1.3 2022/08/02 03:48:34 jpp Exp $ +# Authority: darrellmay +# Name: Darrell May + +Summary: Webshare addon for SME Server +%define name smeserver-webshare +Name: %{name} +%define version 1.0.0 +%define release 14 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: SME Server/addon +Source: %{name}-%{version}.tar.xz +BuildRoot: /var/tmp/%{name}-%{version} +BuildArchitectures: noarch +Requires: e-smith-base, perl-Apache-Htpasswd, perl-Crypt-PasswdMD5 +BuildRequires: e-smith-devtools >= 1.13.1-03 +AutoReqProv: no +Obsoletes: devinfo-mitel-webshare dmc-mitel-webshare + + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 1.0.0-14.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Mon Aug 01 2022 Jean-Philippe Pialasse 1.0.0-13.sme +- update to httpd 2.4 access syntax [SME: 12066] + thanks to Vasarhelyi Zsolt +- add to core backup [SME: 12030] +- add update event, use php-fpm [SME: 11078] + might need its dedicated pool + +* Thu Mar 02 2017 Jean-Philipe Pialasse 1.0.0-12.sme +- imported to SME9 [SME: 10129] + +* Sat May 25 2013 JP Pialasse - 1.0.0-11.sme +- fix spacename problem with firefox [SME: 6256] +- fix password limited to 7 digits [SME: 7097] +- fix biggest error message for incorrect password [SME: 3601] + +* Wed Oct 12 2011 Greg Swallow - 1.0.0-10.sme +- Patch for added SME8 compatibility +- should fix [SME 3600], [SME 6256], [SME 6454] + +* Mon Apr 21 2008 Shad L. Lords +- Prep for import into buildsys +- Clean up spec + +* Fri Dec 1 2006 Darrell May +- move htpasswd files to /home/e-smith/db/webshare +- ugraders must run: /etc/e-smith/events/actions/webshare-rebuild-htpasswd; signal-event ibay-modify +- [1.0.0-8] +* Thu Oct 12 2006 Darrell May +- updated httpd.conf fragment for SME 7 compliance +- Note: rewrite for full SME 7 support is still needed +- [1.0.0-7] +* Mon Jan 30 2006 Darrell May +- bugfix to support IE/https file downloads +- added to /incl/libfile.php 'header("Pragma:");' +- [1.0.0-6] +* Tue May 17 2005 Darrell May +- added support for numeric project names +- [1.0.0-5] +* Tue May 17 2005 Darrell May +- update to phpfm-0.2.3 +- added NoDelete webshare create/config option +- [1.0.0-4] +* Thu May 12 2005 Darrell May +- bugfix webshare panel for SME 7.x +- [1.0.0-3] +* Fri Apr 22 2005 Darrell May +- added support for SME 7.x +- [1.0.0-2] +* Sun Feb 08 2004 Darrell May +- repackaged for SME Server 6.x +- [1.0.0-1] +* Sun Jan 12 2003 Darrell May +- added Requires: perl-Apache-Htpasswd +- [0.0.1-5] +* Sat Jan 11 2003 Darrell May +- name change obsolete devinfo-mitel-webshare +- updated webshare panel +- updated webshare-tools to use phpfm +- [0.0.1-4] +* Fri May 10 2002 Darrell May +- updated webshare panel +- updated webshare-tools scripts +- original public release +- [0.0.1-3] +* Thu May 09 2002 Darrell May +- added httpd.conf template and updated action scripts +- incorporated index.php from ruffdogs,com +- incorporate webshare panel and action scripts from Jon Blakely +- [0.0.1-2] +* Sun May 05 2002 Darrell May +- initial release +- [0.0.1-1] + +%description +%name is an addon for SME Server that provides secure web accessible file and directory storage. + +%prep +%setup + +%build +perl createlinks + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist + +%clean +/bin/rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root)