initial commit of file from CVS for e-smith-ibays on Wed 12 Jul 08:56:45 BST 2023

This commit is contained in:
Brian Read 2023-07-12 08:56:45 +01:00
parent 7ea7fdccf4
commit 1f503a7f0d
33 changed files with 2751 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.xz

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: e-smith-ibays
# $Id: Makefile,v 1.1 2016/02/05 22:53:13 stephdl Exp $
NAME := e-smith-ibays
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)

View File

@ -1,3 +1,17 @@
# e-smith-ibays # <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> e-smith-ibays
SMEServer Koozali developed git repo for e-smith-ibays smeserver SMEServer Koozali developed git repo for e-smith-ibays smeserver
## Wiki
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-ibays&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*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*
<br />
E-Smith-iBays is a powerful and versatile software package developed by e-smith. It provides users with the ability to easily create and manage virtual file systems on their Linux-based systems. This allows users to securely store their data and files in a virtual environment with a high degree of control. The software is easy to use and allows users to manage their files and data using a simple, intuitive web based interface. E-Smith-iBays also offers advanced features such as backup and restore, encryption, and access control for users. Additionally, the software provides an extensive library of plugins which can be used to customize the system to the user's needs. Overall, E-Smith-iBays is a great choice for users looking for a reliable and secure file system management solution.

340
additional/COPYING Normal file
View File

@ -0,0 +1,340 @@
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
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

1
contriborbase Normal file
View File

@ -0,0 +1 @@
sme10

46
createlinks Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("ibays", $panel);
#--------------------------------------------------
# actions for group-delete event
#--------------------------------------------------
$event = "group-delete";
event_link("group-ibay-modify", $event, "10");
#--------------------------------------------------
# actions for ibay-delete event
#--------------------------------------------------
$event = "ibay-delete";
event_link("ibay-delete", $event, "15");
foreach my $event (qw(ibay-create ibay-modify ibay-modify-files))
{
event_link("ibay-modify", $event, "15");
}
foreach my $event (qw(post-install post-upgrade e-smith-ibays-update))
{
event_link("init-ibays", $event, "15");
}
my $event = "e-smith-ibays-update";
templates2events("/etc/httpd/conf/httpd.conf", $event);
templates2events("/samba/smb.conf", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smbd");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/nmbd");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
event_link('store-ldap-smbpasswd', $_, "06");
event_link("systemd-reload", $event, "89");
event_link("systemd-default", $event, "88");

437
e-smith-ibays.spec Normal file
View File

@ -0,0 +1,437 @@
# $Id: e-smith-ibays.spec,v 1.21 2022/05/27 02:02:31 jpp Exp $
Summary: e-smith server and gateway - ibays module
%define name e-smith-ibays
Name: %{name}
%define version 2.6.0
%define release 20
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.xz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
Requires: e-smith-base >= 4.13.15-76
Requires: perl(CGI::FormMagick)
Requires: e-smith-formmagick >= 1.4.0-12
#Conflicts: e-smith-apache < 0.1.1
Requires: e-smith-apache >= 2.6.0-19
BuildRequires: perl, perl(Test::Inline)
BuildRequires: e-smith-devtools >= 1.11.0-03
AutoReqProv: no
%description
e-smith server and gateway software - ibays module.
%changelog
* Wed Jul 12 2023 cvs2git.sh aka Brian Read <brianr@koozali.org> 2.6.0-20.sme
- Roll up patches and move to git repo [SME: 12338]
* Wed Jul 12 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Thu May 26 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.6.0-19.sme
- add missing elements to e-smith-ibays-update event to activate changes [SME: 11774]
* Sat Apr 16 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.6.0-18.sme
- fix AH01797: client denied by server conf [SME: 11774]
use new require syntax for httpd 2.4
* Wed Mar 10 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-17.sme
- fix patch for SSLRequireSSL [SME: 8150]
* Tue Mar 09 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-16.sme
- force https if auth or dav are enabled [SME: 11407]
* Tue Mar 09 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-15.sme
- merge SSL and SSLRequireSSL properties [SME: 8150]
now SSLRequireSSL will force SSL to the html ibay directory and redirect to https
* Mon Mar 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-14.sme
- update php properties and folders [SME: 11412]
- remove last bit of atalk [SME: 668]
* Fri Jan 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-13.sme
- add update event [SME: 11139]
* Sat Jun 27 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-12.sme
- remove hardcoded ports [SME: 10968]
* Tue Jun 23 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-11.sme
- remove php3 reference [SME: 10869]
* Mon Jun 22 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-10.sme
- fix apache failing if ibay has dynamic content enabled and phpmodule is disabled [SME: 10871]
* Thu Jan 30 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-9.sme
- revert patch, wrong rpm [SME: 10871]
* Tue Jan 28 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-8.sme
- add support for php-fpm [SME: 10871]
* Wed Jul 06 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-7.sme
- fix typo thanks to Stephane de Labrusse [SME: 7011]
- ibay to ibays
* Sun Jun 26 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-6.sme
- as per comment 2 of bug 0600 instead of 0700 for perms [SME: 9621]
* Sun Jun 26 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-5.sme
- as discussed, moving cache and tmp out of ibay folder [SME: 9105] [SME: 9621]
- creating basedir /var/cache/e-smith/files/ibays for tmp and cache
* Thu Jun 23 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-4.sme
- create tmp folder in ibays when needed [SME: 9105]
- create session folder in ibays when needed [SME: 9621]
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
Fri Apr 17 2008 --> Fri Apr 11 2008 or Thu Apr 17 2008 or Fri Apr 18 2008 or ....
Sat Dec 08 2013 --> Sat Dec 07 2013 or Sun Dec 08 2013 or Sat Dec 14 2013 or ....
Sat May 04 2014 --> Sat May 03 2014 or Sun May 04 2014 or Sat May 10 2014 or ....
* Thu May 12 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-2.sme
- Rebuild for [SME: 9393]
* Fri Feb 05 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme
- Initial release to sme10
* Wed Jan 20 2016 Daniel Berteaud <daniel@firewall-services.com> 2.4.0-14.sme
- Remove double / in SSL RewriteRule [SME: 9195]
* Tue Jun 23 2015 Daniel Berteaud <daniel@firewall-services.com> 2.4.0-13.sme
- Revert the upload_tmp_folder patch as it needs some more work [SME: 7011]
* Sun Jan 4 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-12.sme
- Add an upload_tmp_folder setting by db command [SME: 7011]
- Thanks to Michael McCarn and Jean-philippe Pialasse
- init-ibays create the folder tmp within all i-bays root directory
- ibay-modify create/chown/chmod the folder tmp within the i-bays root directory
* Sun May 04 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-11.sme
Sat May 04 2014 --> Sat May 03 2014 or Sun May 04 2014 or Sat May 10 2014 or ....
- Add an upload_tmp_folder setting by db command [SME: 7011]
- Thanks to Michael McCarn and Jean-philippe Pialasse
* Thu Apr 24 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-10.sme
- Force SSL following ibays settings to the relevant domain [SME: 8332]
* Tue Apr 8 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-9.sme
- Perl::critic syntax modifications [SME: 8239]
- Add more PHP options to ibays only by db commands [SME: 8239]
- Add SSLRequireSSL to ibays when SSL is set to enabled [SME: 8239]
* Sat Mar 15 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-8.sme
- Add more PHP options to ibays only by db commands [SME: 8239]
- Add SSLRequireSSL to ibays when SSL is set to enabled [SME: 8239]
* Sun Mar 9 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-7.sme
- Force https per ibay should not be the default for existing ibays [SME: 3675]
* Thu Jan 2 2014 Ian Wells <esmith@wellsi.com> 2.4.0-6.sme
- Provide the ability to restrict ibay access to https, by JPP [SME: 882]
- Remove old migrate fragment [SME: 8080]
- Whitespace cleanup, mainly tab removal, of 90e-smithAccess40ibays
* Sun Dec 08 2013 Chris Burnat <devlist@burnat.com> 2.4.0-5.sme
Sat Dec 08 2013 --> Sat Dec 07 2013 or Sun Dec 08 2013 or Sat Dec 14 2013 or ....
- Update en-us translation file by Stephane de Labrusse [SME: 3675]
* Sat Nov 30 2013 Ian Wells <esmith@wellsi.com> 2.4.0-4.sme
- Provide the ability to force https per ibay by Stephane de Labrusse [SME: 3675]
* Mon Sep 30 2013 John H. Bennett III <bennettj@johnbennettservices.com> 2.4.0-3.sme
- Patch to remove symlink to Primary ibay from /home/e-smith/files/primary [SME: 3730]
* Mon Sep 30 2013 John H. Bennett III <bennettj@johnbennettservices.com> 2.4.0-2.sme
- Patch to correct issue with not being able to access a password protected ibay [SME: 7794]
* Thu Jan 31 2013 Shad L. Lords <slords@mail.com> 2.4.0-1.sme
- Roll new stream for sme9
* Fri Dec 23 2011 Jonathan Martens <smeserver-contribs@snetram.nl> 2.2.0-11.sme
- Fix non-translated locale in ibays panel [SME: 6718]
* Thu Oct 27 2011 Daniel B. <daniel@firewall-services.com> 2.2.0-10.sme
- Don't try to modify Primary unix/ldap account [SME:6770]
* Thu Nov 4 2010 Shad L. Lords <slords@mail.com> 2.2.0-9.sme
- All ibay account commands as system accounts in LDAP [SME: 6326]
* Thu Nov 4 2010 Daniel Berteaud <daniel@firewall-services.com> 2.2.0-8.sme
- Create ibay accounts as system accounts in LDAP [SME: 6326]
* Thu Nov 4 2010 Shad L. Lords <slords@mail.com> 2.2.0-7.sme
- Fix cpu critical patch missing ) [SME: 6330]
* Wed Nov 3 2010 Shad L. Lords <slords@mail.com> 2.2.0-6.sme
- Fix cpu critical patch missing ' [SME: 6330]
* Wed Nov 3 2010 Shad L. Lords <slords@mail.com> 2.2.0-5.sme
- Make cpu calls critical only with ldap{Auth} is enabled [SME: 6330]
* Tue Nov 2 2010 Shad L. Lords <slords@mail.com> 2.2.0-4.sme
- Always use cpu, do unix if ldap{Auth} is disabled [SME: 6326]
* Mon Nov 1 2010 Shad L. Lords <slords@mail.com> 2.2.0-3.sme
- Switch to cpu commands if ldap is master [SME: 6326]
* Mon Oct 13 2008 Shad L. Lords <slords@mail.com> 2.2.0-2.sme
- Fix maxIbayNameLength logic [SME: 4457]
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme
- Roll new stream to separate sme7/sme8 trees [SME: 4633]
* Sun Jul 27 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.2.0-12
- Fix password verify entry text box description [SME: 4460]
* Thu Jul 24 2008 Shad L. Lords <slords@mail.com> 1.2.0-11
- Really fix faulty patch for maxIbayNameLength [SME: 4457]
* Fri May 9 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.2.0-10
- Fixed faulty patch for maxIbayNameLength [SME: 424]
* Sun Apr 27 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.2.0-9
- Add common <base> tags to e-smith-formmagick's general [SME: 4283]
* Thu Apr 17 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.2.0-8
Fri Apr 17 2008 --> Fri Apr 11 2008 or Thu Apr 17 2008 or Fri Apr 18 2008 or ....
- Move maxIbayNameLength from ibays.pm to config DB [SME: 424]
* Mon Apr 7 2008 Charlie Brady <charlie_brady@mitel.com> 1.2.0-7
- Include index.shtml in DirectoryIndex list.[SME: 4180]
* Wed Feb 13 2008 Stephen Noble <support@dungog.net> 1.2.0-6
- Remove <base> tags now in general [SME: 3924]
* Thu Aug 30 2007 Charlie Brady <charlie_brady@mitel.com>
- Fix warnings generated by panel. [SME: 1309]
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Fri Dec 08 2006 Shad L. Lords <slords@mail.com> 1.2.0-4
- Make non-dynamic indexes not look for dynamic content. [SME: 1908]
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
- Update to new release naming. No functional changes.
- Make Packager generic
* Wed Apr 5 2006 Gordon Rowell <gordonr@gormand.com.au> 1.2.0-02
- Fix typo in ibays http.conf template [SME: 1173]
* Wed Mar 15 2006 Charlie Brady <charlie_brady@mitel.com> 1.2.0-01
- Roll stable stream version. [SME: 1016]
* Thu Feb 23 2006 Charlie Brady <charlie_brady@mitel.com> 1.1.3-06
- Fix php register_globals directive. [SME: 820]
* Thu Jan 19 2006 Charlie Brady <charlieb@e-smith.com> 1.1.3-05
- Remove bogus IbayPlugin symlink. [SME: 519]
* Wed Nov 30 2005 Gordon Rowell <gordonr@gormand.com.au> 1.1.3-04
- Bump release number only
* Sun Oct 16 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.1.3-03]
- Allow per-ibay override for PHP register_globals setting. To enable:
/sbin/e-smith/db accounts setprop <ibay> PHPRegisterGlobals enabled
Thanks John Bennett [SF: 1328236]
* Fri Oct 14 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.3-02]
- Fix missing 'use esmith::util' in ibay-modify action.
[SF: 1327138]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.1.3-01]
- Remove L10Ns from base packages [SF: 1309520]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.1.2-01]
- New dev stream before relocating L10Ns
* Thu Oct 6 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-18]
- Strip out plugin stuff, for now at least. [SF: 1304496]
* Fri Sep 30 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.1.1-17]
- Added Italian L10N - Thanks Filippo Carletti [SF: 1309266]
* Mon Sep 26 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.1.1-16]
- Added German L10N - Thanks Dietmar Berteld [SF: 1293325]
* Wed Sep 14 2005 Tony Clayton <apc@e-smith.com>
- [1.1.1-15]
- Don't version 'none' plugin [SF: 1292084]
* Mon Sep 5 2005 Tony Clayton <apc@e-smith.com>
- [1.1.1-14]
- Add dependency on e-smith-formmagick >= 1.3.0-10
- Fix default plugin display [SF: 1271745,1263740]
- Clean up, add POD to IbayPlugin modules [SF: 1263740]
- Support versioning of plugins, do version checks in ibay panel
* Wed Aug 24 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-13]
- Default plugin to none in esFM::ibay::create_ibay(). [SF: 1267897]
* Mon Aug 22 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-12]
- Fix missing "use esmith::util" in ibay plugin lib. [SF: 1265684]
- Don't display ibay Plugin choice if "none" is the only choice. [SF: 1263740]
* Fri Aug 19 2005 Gordon Rowell <gordonr@gormand.com.au>
- [1.1.1-11]
- Need to check $ibay->prop('type') not $ibay->type [SF: 1260237]
* Tue Aug 9 2005 Shad Lords <slords@mail.com>
- [1.1.1-10]
- Remove 90e-smithAccess10common (belongs in e-smith-apache)
- Move some ibay options to database
* Thu Aug 4 2005 Gordon Rowell <gordonr@gormand.com.au>
- [1.1.1-09]
- Syntactic fix to perl code from 1.1.1-08 change
* Thu Jul 28 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-08]
- Update all uses of deprecated esmith::config and db_ APIs.
- Rewrite ibay-delete action in shell.
* Wed Jan 19 2005 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-07]
- Fix untaint RE. [charlieb MN00050161]
- Fix "will not stay shared" warnings in IbayPlugin/none.pm
* Thu Nov 11 2004 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-06]
- Untaint name before using in system(). [charlieb MN00050161]
* Fri Sep 3 2004 Charlie Brady <charlieb@e-smith.com>
- [1.1.1-05]
- Updated requires with new perl dependencies. [msoulier MN00040240]
- Clean BuildRequires. [charlieb MN00043055]
* Fri Feb 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.1.1-04]
- Fixed two issues with previous change. [msoulier 7475]
* Fri Feb 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.1.1-03]
- Updating default repair method to set CGIs as executable if enabled.
[msoulier 7475]
* Wed Nov 19 2003 Tony Clayton <apc@e-smith.com>
- [1.1.1-02]
- Fix processTemplate call in IbayPlugin::none [tonyc 9924]
- Merge ibay-conf-plugin into ibay-modify action [tonyc 9924]
* Wed Nov 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.1.1-01]
- Collecting patches.
* Wed Nov 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.1.0-02]
- Adding 6.0 styling to ibay panel. [msoulier 10415]
- Converted createlinks to new api.
- Add IbayPlugin stuff [tonyc 9924]
- Add dependency on perl-CGI-FormMagick >= 0.91-04 [tonyc 9924]
* Fri Sep 5 2003 Tony Clayton <apc@e-smith.com>
- [1.1.0-01]
- Changing version to development stream number - 1.1.0
- Rolling to development stream [tonyc 9924]
* Wed Aug 13 2003 Michael Soulier <msoulier@e-smith.com>
- [1.0.3-05]
- Fixed the content ibay showing up in the ibay list of the primary domain's
virtual host block. [msoulier 9649]
* Wed Aug 13 2003 Michael Soulier <msoulier@e-smith.com>
- [1.0.3-04]
- Correcting the previous revision, and limiting ibay access as sub-urls to
the primary domain only. [msoulier 9649]
* Wed Aug 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.0.3-03]
- Unify ibay handling, since 15PrimaryContent is now obsolete, and changing
the primary domain's content was breaking access to ibays. [msoulier 9649]
* Wed Jul 2 2003 Charlie Brady <charlieb@e-smith.com>
- [1.0.3-02]
- Fix path of created starter website index file (don't rely on symlink
which "should" point to correct place). [charlieb 9241]
* Thu Jun 12 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.0.3-01]
- Added order to migrate fragments [gordonr 9015]
* Wed Jun 11 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.0.2-04]
- Fixed Conflicts header - should be <, not <= [gordonr 8903]
* Wed Jun 11 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.0.2-03]
- Missing 'use esmith::util' [gordonr 8973]
* Tue Jun 10 2003 Charlie Brady <charlieb@e-smith.com>
- [1.0.2-02]
- Fix broken symlinks in post-{install,upgrade}. [charlieb 8973]
* Fri Jun 6 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.0.2-01]
- Shuffled some httpd.conf fragments from e-smith-apache [gordonr 8903]
* Tue May 27 2003 Charlie Brady <charlieb@e-smith.com>
- [1.0.1-01]
- Fix typo in createlinks script. Rolling version of package
to correct build problem. [charlieb 8841]
* Tue May 27 2003 Charlie Brady <charlieb@e-smith.com>
- [1.0.0-02]
- Add some code from init-accounts action which depends on
/home/e-smith/files/ibays directory, which isn't included
in base. New action is init-ibays. [charlieb 8841]
* Thu May 8 2003 Mark Knox <markk@e-smith.com>
- [1.0.0-01]
- Initial release. Split out from e-smith-base. [markk 8610]
%prep
%setup
/bin/mkdir -p root/var/cache/e-smith/files/ibays
%pre
%post
%build
LEXICONS=$(find root/etc/e-smith/web/functions \
-type f | grep -v CVS | grep -v pleasewait)
for lexicon in $LEXICONS
do
/sbin/e-smith/validate-lexicon $lexicon
done
/sbin/e-smith/generate-lexicons
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}-%{release}-filelist
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)

View File

@ -0,0 +1,18 @@
{
foreach my $ibay ($DB->get_all_by_prop(type => 'ibay'))
{
# SME9 introduced SSLRequireSSL with enabled/disabled.
# This replaces local customisation, so migrate 'on' to 'enabled'
$ibay->set_prop ('SSLRequireSSL', 'enabled') if (($ibay->prop ('SSLRequireSSL') || '') eq 'on');
# SME10 merge SSL property (setting to redirect to https) with SSLRequireSSL (setting to force SSL in a directory)
# while they have two different purpose, most admin will want to protect one directory with SSL and ease access to their
# client to gently redirect them to https, hence the merge.
my $SSL = $DB->get_prop_and_delete($ibay->key, 'SSL') || 'disabled';
# if SSL is enabled or SSLRequireSSL is enabled we want the new one enabled
# default remains empty for disabled for the moment
$ibay->set_prop('SSLRequireSSL','enabled') if ($SSL eq 'enabled');
}
}

View File

@ -0,0 +1,30 @@
#!/usr/bin/perl -w
use strict;
use esmith::AccountsDB;
use esmith::event;
my $accounts = esmith::AccountsDB->open() or
die "Unable to open accounts db: $!";
my ($self, $groupName) = @ARGV;
# Find all "i-bay" entries in the e-smith accounts database and
# if the group matches this one, change it to group "admin".
my @modified_ibays;
foreach my $ibay ( $accounts->ibays ) {
if ( $ibay->prop('Group') eq $groupName ) {
$ibay->set_prop( 'Group', 'admin' );
push @modified_ibays, $ibay->key;
event_signal("ibay-modify-files", $ibay->key) or
die ("Error occurred while updating i-bay.\n");
}
}
my $count = @modified_ibays;
if ( $count > 0 ) {
event_signal("ibay-modify-servers" ) or
die ("Error occurred after updating i-bays.\n");
}

View File

@ -0,0 +1,49 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2005 Mitel Networks Corporation
#
# 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
#
#----------------------------------------------------------------------
#------------------------------------------------------------
# Delete the Unix account and files for the ibay.
#------------------------------------------------------------
event=$1
ibay=$2
if [ -z "$ibay" ]
then
echo ibayName argument missing
exit 1
fi
ldapauth=$(/sbin/e-smith/config getprop ldap Authentication || echo disabled)
x=0 # exit value
/bin/rm -rf /home/e-smith/files/ibays/$ibay
if [ "$ldapauth" != "enabled" ]
then
/usr/sbin/userdel "$ibay" || x=1
/usr/sbin/cpu -C/etc/cpu-system.conf userdel "$ibay"
/usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay"
else
/usr/sbin/cpu userdel "$ibay" || x=1
/usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay" || x=1
fi
exit $x

View File

@ -0,0 +1,232 @@
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 1999-2005 Mitel Networks Corporation
#
# 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 Errno;
use File::Find;
use esmith::util;
use esmith::templates;
use esmith::AccountsDB;
use esmith::ConfigDB;
my $conf = esmith::ConfigDB->open_ro
or die "Could not open Config DB";
my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
my $x = 0; # exit value
$ENV{'PATH'} = "/bin";
my $event = $ARGV [0];
my $ibayName = $ARGV [1];
die "ibayName argument missing" unless defined ($ibayName);
my $accountdb = esmith::AccountsDB->open_ro();
my $ibay = $accountdb->get($ibayName) or
die "Couldn't find $ibayName record in accounts db\n";
die "Account $ibayName is not an ibay account; modify ibay event failed.\n"
unless ($ibay->prop('type') eq 'ibay');
if ($event eq 'ibay-create')
{
#------------------------------------------------------------
# Check the Unix account.
#------------------------------------------------------------
# Create the ibay's unique group first
if ($ldapauth ne 'enabled')
{
system(
"/usr/sbin/groupadd",
"-g",
$ibay->prop("Gid"),
$ibayName
) == 0 or ( $x = 255, warn "Failed to create (unix) group $ibayName.\n" );
system(
"/usr/sbin/useradd",
"-u",
$ibay->prop("Uid"),
"-g",
$ibay->prop("Gid"),
"-c",
$ibay->prop("Name"),
"-d",
"/home/e-smith/files/ibays/$ibayName/files",
"-G",
"shared,"
. $ibay->prop("Group"),
"-M",
"-s",
"/bin/false",
"$ibayName"
) == 0 or ( $x = 255, warn "Failed to create (unix) account $ibayName.\n" );
}
system(
"/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupadd",
"-g",
$ibay->prop("Gid"),
$ibayName
) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" );
system(
"/usr/sbin/cpu", "-C/etc/cpu-system.conf", "useradd",
"-u",
$ibay->prop("Uid"),
"-g",
$ibay->prop("Gid"),
"-c",
$ibay->prop("Name"),
"-d",
"/home/e-smith/files/ibays/$ibayName/files",
"-G",
"shared,"
. $ibay->prop("Group"),
"-s",
"/bin/false",
"$ibayName"
) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" );
#------------------------------------------------------------
# Create the ibay files and set the password.
#------------------------------------------------------------
system("/bin/cp", "-Rp", "/etc/e-smith/skel/ibay",
"/home/e-smith/files/ibays/$ibayName") == 0
or ( $x = 255, warn "Error copying ibay skeletal files" );
processTemplate( {
TEMPLATE_PATH=>"/home/e-smith/files/ibays/html/index.html",
OUTPUT_FILENAME=>"/home/e-smith/files/ibays/$ibayName/html/index.html",
MORE_DATA=>{IBAY_NAME=>$ibayName},
} );
if ($ldapauth ne 'enabled')
{
system("/usr/bin/passwd", "-l", $ibayName) == 0
or ( $x = 255, warn "Error locking (unix) account $ibayName" );
}
system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-L", $ibayName) == 0
or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Error locking (ldap) account $ibayName" );
}
elsif ($event eq 'ibay-modify' and $ibayName ne 'Primary')
{
#------------------------------------------------------------
# Modify ibay description in /etc/passwd using "usermod"
#------------------------------------------------------------
if ($ldapauth ne 'enabled')
{
system("/usr/sbin/usermod", "-c", $ibay->prop("Name"),
"-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0
or ( $x = 255, warn "Failed to modify (unix) account $ibayName.\n" );
}
system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", $ibay->prop("Name"),
"-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0
or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify (ldap) account $ibayName.\n" );
}
#------------------------------------------------------------
# Fix permissions on ibay files.
#------------------------------------------------------------
#--------------------------------------------------
# main directory is writeable only by root
#--------------------------------------------------
chdir "/home/e-smith/files/ibays/$ibayName"
or ( $x = 255, warn "Could not chdir to /home/e-smith/files/ibays/$ibayName" );
esmith::util::chownFile("root", "root", ".");
chmod 0755, ".";
#--------------------------------------------------
# fix ownership of subdirectories
#--------------------------------------------------
#--------------------------------------------------
# Set the group as www if it was admin, since
# while set as admin, the web server no longer has
# access to the ibay HTML directory, and web pages.
#--------------------------------------------------
my %properties = $ibay->props;
$::group = ($properties{'Group'} eq "admin") ? "www" : $properties {'Group'};
# Make sensible defaults
$::owner = undef;
$::fileperm = 0600;
$::dirperm = 0550;
if ($properties {'UserAccess'} eq 'wr-admin-rd-group')
{
$::owner = "admin";
$::fileperm = 0640;
$::dirperm = 02750;
}
elsif ($properties {'UserAccess'} eq 'wr-group-rd-group')
{
$::fileperm = 0660;
$::dirperm = 02770;
}
elsif ($properties {'UserAccess'} eq 'wr-group-rd-everyone')
{
$::fileperm = 0664;
$::dirperm = 02775;
}
else
{
warn("Value of UserAccess bad or unset");
}
sub process
{
if (-l)
{
$File::Find::prune = 1;
}
else
{
esmith::util::chownFile($::owner, $::group, $_);
if (-d)
{
chmod $::dirperm, $_;
}
elsif (-f)
{
# Preserve execute permissions on files
my $experm = (stat($_))[2] & 0111;
$experm |= $::fileperm;
chmod $experm, $_;
}
}
}
find(\&process, glob("*"));
exit ($x);

View File

@ -0,0 +1,64 @@
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 1999-2003 Mitel Networks Corporation
#
# 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
#
# Technical support for this program is available from Mitel Networks
# Please visit our web site www.mitel.com/sme/ for details.
#----------------------------------------------------------------------
package esmith;
use strict;
use Errno;
use esmith::util;
use esmith::AccountsDB;
# Populate pre-defined Primary i-bay
# Start with top level owner/permissions
my $files = "/home/e-smith/files";
my $perms = 0755;
my $owner = 'root';
my $group = 'root';
foreach (qw(Primary Primary/cgi-bin Primary/html Primary/files))
{
my $dir = "$files/ibays/$_";
unless (-d "$dir")
{
mkdir ($dir, $perms) or warn "Could not create dir $dir: $!";
chmod ($perms, $dir) or warn "Could not chmod dir $dir: $!";
esmith::util::chownFile($owner, $group, $dir);
}
# Switch to subdir owner/permissions
$perms = 02750;
$owner = 'admin';
$group = 'shared';
}
# Create a starter website index page if necessary
if( !grep /\.\w+$/, </home/e-smith/files/ibays/Primary/html/index.*> )
{
system("/bin/cp", "-p",
"/etc/e-smith/skel/e-smith/files/primary/html/index.htm",
"/home/e-smith/files/ibays/Primary/html/index.htm");
chmod 0640, "/home/e-smith/files/ibays/Primary/html/index.htm";
esmith::util::chownFile('admin', 'shared',
"/home/e-smith/files/ibays/Primary/html/index.htm");
}
exit (0);

View File

@ -0,0 +1,286 @@
<!-- vim: ft=xml ts=4 sw=8 noet:
-->
<lexicon lang="en-us" params="getExtraParams()">
<entry>
<base>FORM_TITLE</base>
<trans>
Create, modify, or remove i-bays
</trans>
</entry>
<entry>
<base>FIRSTPAGE_DESC</base>
<trans>
<![CDATA[
<p>
<a class="button-like" href="ibays?page=0&page_stack=&Next=Next&wherenext=CreateModify">Add i-bay</a>
</p>
<p>
You can remove any information bay or reset its password by
clicking on the corresponding command
next to the information bay. If the information bay shows up
in red, that means that the password has not
yet been changed from the default, and should be changed
soon.
</p>
]]>
</trans>
</entry>
<entry>
<base>ADD_TITLE</base>
<trans>
Create or modify an i-bay
</trans>
</entry>
<entry>
<base>NAME_FIELD_DESC</base>
<trans>
The information bay name should contain only lower-case
letters, numbers, periods, hyphens and underscores, and
should start with a lower-case letter. For example
"johnson", "intra", and "cust3.prj12" are all valid
names, but "3associates", "John Smith" and
"Bus!Partner" are not. The name is limited to
{$maxLength} characters.
</trans>
</entry>
<entry>
<base>NAME_LABEL</base>
<trans>
Information bay name
</trans>
</entry>
<entry>
<base>USER_ACCESS</base>
<trans>
User access via file sharing or user ftp
</trans>
</entry>
<entry>
<base>PUBLIC_ACCESS</base>
<trans>
Public access via web or anonymous ftp
</trans>
</entry>
<entry>
<base>PUBLIC_ACCESS_DESCRIPTION</base>
<trans>
The public access mode "password required outside local
network" is not supported by the FTP server component. If
you select this mode, the FTP server will require a
password both inside and outside the local network for this
i-bay.
</trans>
</entry>
<entry>
<base>ALLOW_DYNAMIC_CONTENT</base>
<trans>
Execution of dynamic content (CGI, PHP, SSI)
</trans>
</entry>
<entry>
<base>HTTPS_Only</base>
<trans>
Force secure connections
</trans>
</entry>
<entry>
<base>REMOVE_TITLE</base>
<trans>
Remove information bay
</trans>
</entry>
<entry>
<base>REMOVE_DESC</base>
<trans>
<![CDATA[
<p>
You are about to remove the information bay "{$name}"
({$description}).
</p>
<p>
All files belonging to this information bay will be deleted.
</p>
<p>
Are you sure you wish to remove this information bay?
</p>
]]>
</trans>
</entry>
<entry>
<base>ERROR_WHILE_CREATING_IBAY</base>
<trans>
An error occurred while creating the i-bay.
</trans>
</entry>
<entry>
<base>SUCCESSFULLY_CREATED_IBAY</base>
<trans>
Successfully created i-bay.
</trans>
</entry>
<entry>
<base>NO_IBAYS</base>
<trans>
There are no i-bays currently configured.
</trans>
</entry>
<entry>
<base>CANT_FIND_IBAY</base>
<trans>
Can't find account for {$name} (does it exist?)
</trans>
</entry>
<entry>
<base>CANT_CREATE_IBAY</base>
<trans>
Can't create new account for {$name} (does it already exist?)
</trans>
</entry>
<entry>
<base>ERROR_WHILE_MODIFYING_IBAY</base>
<trans>
An error occurred while modifying the i-bay.
</trans>
</entry>
<entry>
<base>SUCCESSFULLY_MODIFIED_IBAY</base>
<trans>
Successfully modified i-bay.
</trans>
</entry>
<entry>
<base>VIRTUAL_HOST_MESSAGE</base>
<trans>
The following virtual domains were using this information
bay as their content and will be changed to the primary web
site (you can change them to something else afterward).
</trans>
</entry>
<entry>
<base>SUCCESSFULLY_DELETED_IBAY</base>
<trans>
Successfully deleted i-bay.
</trans>
</entry>
<entry>
<base>ERROR_WHILE_DELETING_IBAY</base>
<trans>
An error occurred while deleting the i-bay.
</trans>
</entry>
<entry>
<base>PASSWORD_DESC</base>
<trans>
You are about to change the password for the i-bay {$name}.
</trans>
</entry>
<entry>
<base>IBAY_PASSWD_VALIDATION_ERROR</base>
<trans>
The password may contain only letters and numbers.
</trans>
</entry>
<entry>
<base>IBAY_PASSWD_VERIFY_ERROR</base>
<trans>
The passwords do not match.
</trans>
</entry>
<entry>
<base>SUCCESSFULLY_RESET_PASSWORD</base>
<trans>
Successfully reset password.
</trans>
</entry>
<entry>
<base>ERROR_WHILE_RESETTING_PASSWORD</base>
<trans>
Error while resetting password.
</trans>
</entry>
<entry>
<base>VHOST_MESSAGE</base>
<trans>
<![CDATA[
<P>The following virtual domains were using this information bay
as their content and will be changed to the primary web site
(you can change them to something else afterward):</P>
<ul>{$vhostList}</ul>
]]>
</trans>
</entry>
<entry>
<base>Information bays</base>
<trans>Information bays</trans>
</entry>
<entry>
<base>WGRG</base>
<trans>Write = group, Read = group</trans>
</entry>
<entry>
<base>WGRE</base>
<trans>Write = group, Read = everyone</trans>
</entry>
<entry>
<base>WARG</base>
<trans>Write = admin, Read = group</trans>
</entry>
<entry>
<base>NONE</base>
<trans>No access</trans>
</entry>
<entry>
<base>LOCAL_NETWORK_NO_PASSWORD</base>
<trans>Local network (no password required)</trans>
</entry>
<entry>
<base>LOCAL_NETWORK_PASSWORD</base>
<trans>Local network (password required)</trans>
</entry>
<entry>
<base>ENTIRE_INTERNET_NO_PASSWORD</base>
<trans>Entire Internet (no password required)</trans>
</entry>
<entry>
<base>ENTIRE_INTERNET_PASSWORD</base>
<trans>Entire Internet (password required)</trans>
</entry>
<entry>
<base>ENTIRE_INTERNET_PASSWORD_REMOTE</base>
<trans>Entire Internet (password required outside local network)</trans>
</entry>
<entry>
<base>INVALID_IBAY_DESCRIPTION</base>
<trans>Error: unexpected or missing characters in i-bay description</trans>
</entry>
<entry>
<base>ACCT_NAME_HAS_INVALID_CHARS</base>
<trans>The i-bay name "{$acctName}" contains invalid characters.
I-bay names must start with a lower case letter and contain
only lower case letters, numbers, and hyphens.
</trans>
</entry>
<entry>
<base>MAX_IBAY_NAME_LENGTH_ERROR</base>
<trans>
The i-bay name "{$name}" is too long. The maximum is
{$maxIbayNameLength} characters.
</trans>
</entry>
<entry>
<base>ACCT_CLASHES_WITH_PSEUDONYM</base>
<trans>
<![CDATA[
The account "{$acctName}" clashes with pseudonym
details for {$acctType} account "{$acct}".
<p>{$acctName} is a pseudonym for {$acct}.</p>
]]>
</trans>
</entry>
<entry>
<base>ACCOUNT_EXISTS</base>
<trans>
The account "{$acctName}" is an existing {$acctType} account.
</trans>
</entry>
</lexicon>

View File

View File

View File

View File

View File

View File

@ -0,0 +1,9 @@
{
use esmith::AccountsDB;
$OUT = join("\n",
map { $_->key }
grep { $_->prop('PasswordSet') eq 'yes' }
esmith::AccountsDB->open_ro->ibays
);
}

View File

@ -0,0 +1,198 @@
#------------------------------------------------------------
# Information bay directories
#------------------------------------------------------------
{
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
$OUT = "";
foreach my $ibay ($adb->ibays)
{
my %properties = $ibay->props;
my $key = $ibay->key;
#------------------------------------------------------------
# Figure out which combination of parameters to use. If
# PublicAccess parameter is present, this is e-smith 4.0.
# Otherwise, it's e-smith 3.0.
#------------------------------------------------------------
my $allow;
my $pass;
my $satisfy;
if ($properties{'PublicAccess'})
{
if ($properties{'PublicAccess'} eq 'none')
{
next;
}
elsif ($properties{'PublicAccess'} eq 'local')
{
$allow = "ip $localAccess";
$pass = 0;
$satisfy = 'All';
}
elsif ($properties{'PublicAccess'} eq 'local-pw')
{
$allow = "ip $localAccess";
$pass = 1;
$satisfy = 'All';
}
elsif ($properties{'PublicAccess'} eq 'global')
{
$allow = 'all granted';
$pass = 0;
$satisfy = 'All';
}
elsif ($properties{'PublicAccess'} eq 'global-pw')
{
$allow = 'all granted';
$pass = 1;
$satisfy = 'All';
}
elsif ($properties{'PublicAccess'} eq 'global-pw-remote')
{
$allow = "ip $localAccess";
$pass = 1;
$satisfy = 'Any';
}
}
elsif ($properties {'ReadAccess'} eq 'global')
{
if ($properties {'UsePassword'} eq 'yes')
{
$allow = 'all granted';
$pass = 1;
$satisfy = 'All';
}
else
{
$allow = 'all granted';
$pass = 0;
$satisfy = 'All';
}
}
else
{
if ($properties {'UsePassword'} eq 'yes')
{
$allow = "ip $localAccess";
$pass = 1;
$satisfy = 'All';
}
else
{
$allow = "ip $localAccess";
$pass = 0;
$satisfy = 'All';
}
}
my $allowOverride = $properties{'AllowOverride'} || "None";
my $dynamicContent = $properties{'CgiBin'} || "disabled";
my $followSymLinks = $properties{'FollowSymLinks'} || "disabled";
my $indexes = $properties{'Indexes'} || "enabled";
my $sslRequireSSL = $properties{'SSLRequireSSL'} || "disabled";
# here we force SSL if either a password is asked or DAV is enabled
$sslRequireSSL = "enabled" if ($pass == 1);
$sslRequireSSL = "enabled" if ( ($properties{'ModDav'}||'disabled') eq 'enabled');
$OUT .= "\n";
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "# $key ibay directories ($properties{'Name'})\n";
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "\n";
$OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
if ($sslRequireSSL eq 'enabled')
{
$OUT .= " SSLRequireSSL\n";
}
$OUT .= " Options None\n";
$OUT .= " Options +Indexes\n" if ($indexes eq 'enabled');
$OUT .= " Options +FollowSymLinks\n" if ($followSymLinks eq 'enabled');
if ($dynamicContent eq 'enabled')
{
$OUT .= " Options +Includes\n";
}
else
{
$OUT .= " DirectoryIndex index.shtml index.htm index.html\n";
$OUT .= " Options +IncludesNOEXEC\n";
$OUT .= " <FilesMatch \"\\.(phar|php|phtml)\$\">\n";
$OUT .= " Require all denied\n";
$OUT .= " </FilesMatch>\n";
}
$OUT .= " AllowOverride $allowOverride\n";
if ($pass)
{
$OUT .= " AuthName \"$properties{'Name'}\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthBasicProvider external\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " <Require$satisfy>\n";
$OUT .= " Require user $key\n";
$OUT .= " Require $allow\n";
$OUT .= " </Require$satisfy>\n";
}
else
{
$OUT .= " Require $allow\n";
}
$OUT .= "</Directory>\n";
$OUT .= "\n";
$OUT .= "<Directory /home/e-smith/files/ibays/$key/cgi-bin>\n";
if ($sslRequireSSL eq 'enabled')
{
$OUT .= " SSLRequireSSL\n";
}
if ($dynamicContent eq 'enabled')
{
$OUT .= " Options ExecCGI\n";
}
$OUT .= " AllowOverride None\n";
if ($pass)
{
$OUT .= " AuthName \"$properties{'Name'}\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthBasicProvider external\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " <Require$satisfy>\n";
$OUT .= " Require user $key\n";
$OUT .= " Require $allow\n";
$OUT .= " </Require$satisfy>\n";
}
else
{
$OUT .= " Require $allow\n";
}
$OUT .= "</Directory>\n";
$OUT .= "\n";
$OUT .= "<Directory /home/e-smith/files/ibays/$key/files>\n";
if ($sslRequireSSL eq 'enabled')
{
$OUT .= " SSLRequireSSL\n";
}
$OUT .= " AllowOverride None\n";
if ($pass)
{
$OUT .= " AuthName \"$properties{'Name'}\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthBasicProvider external\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " <Require$satisfy>\n";
$OUT .= " Require user $key\n";
$OUT .= " Require $allow\n";
$OUT .= " </Require$satisfy>\n";
}
else
{
$OUT .= " Require $allow\n";
}
$OUT .= "</Directory>\n";
}
}

View File

@ -0,0 +1,92 @@
{
use esmith::AccountsDB;
my $accounts = esmith::AccountsDB->open_ro;
use esmith::DomainsDB;
my $domains = esmith::DomainsDB->open_ro;
$OUT = "";
my $ibay = $virtualHostContent;
my $basedir = "/home/e-smith/files/ibays/$ibay";
my $cgiBin = $accounts->get_prop($ibay, "CgiBin") || "";
my $ssl_domain = $accounts->get_prop($ibay, "SSLRequireSSL") || "disabled";
my $access = $accounts->get_prop($ibay,'PublicAccess') || 'none';
my $pass = $access =~ /-pw/;
$ssl_domain = "enabled" if $pass;
$ssl_domain = "enabled" if (($accounts->get_prop($ibay, 'ModDav')||'disabled') eq 'enabled');
$OUT .= " DocumentRoot $basedir/html\n";
if (( $port ne $httpsPort ) && ( $ssl_domain eq 'enabled'))
{
my $portspec = ($httpsPort eq 443) ? "" : ":$httpsPort";
$OUT .= " RewriteEngine on\n";
$OUT .= " RewriteRule ^/(.*|\$) https://%{HTTP_HOST}${portspec}/\$1 [R,L]\n";
}
if ($cgiBin)
{
$OUT .= " ScriptAlias /cgi-bin $basedir/cgi-bin\n";
}
else
{
$OUT .=
" # To add cgi-bin ScriptAlias for this i-bay, run:\n"
. " # /sbin/e-smith/db accounts setprop $ibay CgiBin "
. "enabled\n"
. " # /sbin/e-smith/signal-event console-save\n";
}
$OUT .= " Alias /files $basedir/files\n";
if (($domains->get_prop($virtualHost, 'SystemPrimaryDomain') || 'no')
eq 'yes')
{
my @ibays = $accounts->ibays;
foreach my $ibay (@ibays)
{
my $key = $ibay->key;
next if $key eq $virtualHostContent;
my $basedir = "/home/e-smith/files/ibays/$key";
my $cgiBin = $ibay->prop("CgiBin") || "";
my $name = $ibay->prop("Name") || "";
$OUT .= "\n";
$OUT .= " # $key ibay ($name)\n";
$OUT .= "\n";
my $ssl_bay = $ibay->prop('SSLRequireSSL') || 'disabled';
my $access_bay = $ibay->prop('PublicAccess') || 'none';
my $pass_bay = $access_bay =~ /-pw/;
$ssl_bay = "enabled" if $pass_bay ;
$ssl_bay = "enabled" if (($ibay->prop('ModDav')||'disabled') eq 'enabled');
if (( $port ne $httpsPort ) && ($ssl_bay eq 'enabled')){
my $portspec = ($httpsPort eq 443) ? "" : ":$httpsPort";
$OUT .= " RewriteEngine on\n";
$OUT .= " RewriteRule ^/$key(/.*|\$) https://%{HTTP_HOST}${portspec}/$key\$1 \[L,R\]\n";
}
if ($cgiBin)
{
$OUT .= " ScriptAlias /$key/cgi-bin $basedir/cgi-bin\n";
}
else
{
$OUT .=
" # To add cgi-bin ScriptAlias for this i-bay, run:\n"
. " # /sbin/e-smith/db accounts setprop $key CgiBin "
. "enabled\n"
. " # /sbin/e-smith/signal-event console-save\n";
}
$OUT .= " Alias /$key/files $basedir/files\n";
# Make sure this one is last since it's a prefix of the above
# aliases. If we put it first, it would get expanded before the
# other aliases, creating problems.
$OUT .= " Alias /$key $basedir/html\n";
}
$OUT .= " # No ibays in system\n" unless @ibays;
}
}

View File

@ -0,0 +1,7 @@
{
use esmith::AccountsDB;
$adb = esmith::AccountsDB->open_ro();
"";
}

View File

@ -0,0 +1,25 @@
{
my $desc = $adb->get_prop($IBAY_NAME, "Name") || "No description";
$OUT =<<HERE;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Information Bay: $desc</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>Information Bay</H1>
<P>This information bay has not yet been customized.</P>
</BODY>
</HTML>
HERE
}

View File

View File

@ -0,0 +1,145 @@
#!/usr/bin/perl -wT
# vim: ft=xml ts=4 sw=4 et:
#----------------------------------------------------------------------
# heading : Collaboration
# description : Information bays
# navigation : 2000 2500
#
# Copyright (c) 2001 Mitel Networks Corporation
#
# 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
#
# Technical support for this program is available from e-smith, inc.
# Please visit our web site www.e-smith.com for details.
#----------------------------------------------------------------------
use strict;
use esmith::FormMagick::Panel::ibays;
my $fm = esmith::FormMagick::Panel::ibays->new();
$fm->display();
=pod
=head1 NAME
ibays -- add/remove/manage ibays
=head2 DESCRIPTION
This screen allows the administrator to manage information bays.
=begin testing
use esmith::FormMagick::Tester;
use esmith::TestUtils;
use esmith::TestUtils;
use esmith::ConfigDB;
use esmith::AccountsDB;
my $panel = $Original_File;
my $ua = esmith::FormMagick::Tester->new();
my $c = esmith::ConfigDB->open();
my $a = esmith::AccountsDB->open();
is (mode($panel), '4750', "Check permissions on script");
ok ($ua->get_panel($panel), "ABOUT TO RUN L10N TESTS");
is ($ua->{status}, 200, "200 OK");
#like($ua->{content}, qr/FORM_TITLE/, "Saw untranslated form title");
ok ($ua->set_language("en"), "Set language to English");
ok ($ua->get_panel($panel), "Get panel");
is ($ua->{status}, 200, "200 OK");
like($ua->{content}, qr/Information bays/, "Saw translated form title");
ok ($ua->get_panel($panel), "ABOUT TO TEST CREATING IBAY");
ok ($ua->follow("Click here"), "Follow 'create ibay' link");
is ($ua->{status}, 200, "200 OK");
like($ua->{content}, qr/Create a new information bay/, "Saw page title");
like($ua->{content}, qr/Brief description/, "Saw description field");
like($ua->{content}, qr/Group/, "Saw group field");
like($ua->{content}, qr/User access via file/, "Saw user access field");
like($ua->{content}, qr/Public access via/, "Saw Public access field");
like($ua->{content}, qr/Add/, "Saw add button");
SKIP: {
skip 10, "Unsafe!" unless destruction_ok();
ok ($ua->follow("Click here"), "ACTUALLY ADDING A NETWORK");
$ua->field();
$ua->click("Add");
like($ua->{content}, qr/Successfully added ibay/, "Saw success message");
ok ($ua->follow("Remove"), "REMOVING NETWORK");
like($ua->{content}, qr/Are you sure/, "Saw confirmation message");
$ua->click("Remove");
like($ua->{content}, qr/Successfully deleted/, "Saw success message");
}
=cut
__DATA__
<form title="FORM_TITLE" header="/etc/e-smith/web/common/head.tmpl" footer="/etc/e-smith/web/common/foot.tmpl">
<page name="First" pre-event="print_status_message()">
<description>FIRSTPAGE_DESC</description>
<subroutine src="print_ibay_table()" />
</page>
<page name="CreateModify" pre-event="turn_off_buttons()" post-event="handle_ibays()">
<title>ADD_TITLE</title>
<subroutine src="print_ibay_name_field()" />
<field type="text" id="description" validation="validate_description">
<label>DESCRIPTION</label>
</field>
<field type="select" id="group" options="group_list()">
<label>GROUP</label>
</field>
<field type="select" id="userAccess" options="userAccess_list()">
<label>USER_ACCESS</label>
</field>
<field type="select" id="publicAccess" options="publicAccess_list()" value="none">
<label>PUBLIC_ACCESS</label>
</field>
<field type="select" id="CgiBin" options="'disabled' => 'DISABLED', 'enabled' => 'ENABLED'">
<label>ALLOW_DYNAMIC_CONTENT</label>
</field>
<field type="select" id="SSLRequireSSL" options="'disabled' => 'DISABLED', 'enabled' => 'ENABLED'">
<label>HTTPS_Only</label>
</field>
<subroutine src="print_save_or_add_button()" />
</page>
<page name="Remove" pre-event="turn_off_buttons()" post-event="remove_ibay()">
<title>REMOVE_TITLE</title>
<description>REMOVE_DESC</description>
<subroutine src="print_vhost_message()" />
<subroutine src="print_button('REMOVE')" />
</page>
<page name="Password" pre-event="turn_off_buttons()" post-event="reset_password()">
<title>PASSWORD_RESET</title>
<description>PASSWORD_DESC</description>
<field type="password" id="newPass" validation="nonblank, check_password">
<label>PASSWORD_NEW</label>
</field>
<field type="password" id="newPassVerify" validation="verifyPasswords">
<label>PASSWORD_VERIFY_NEW</label>
</field>
<subroutine src="print_button('SAVE')"/>
</page>
</form>

View File

View File

View File

View File

View File

@ -0,0 +1,730 @@
#!/usr/bin/perl -w
#
# $Id: ibays.pm,v 1.8 2005/09/06 05:49:52 apc Exp $
#
package esmith::FormMagick::Panel::ibays;
use strict;
use esmith::FormMagick;
use esmith::AccountsDB;
use esmith::ConfigDB;
use esmith::DomainsDB;
use esmith::cgi;
use esmith::util;
use File::Basename;
use Exporter;
use Carp;
our @ISA = qw(esmith::FormMagick Exporter);
our @EXPORT = qw(
print_ibay_table
print_ibay_name_field
print_vhost_message
group_list
userAccess_list
publicAccess_list
max_ibay_name_length
handle_ibays
remove_ibay
reset_password
getExtraParams
verifyPasswords
check_password
print_save_or_add_button
wherenext
);
our $VERSION = sprintf '%d.%03d', q$Revision: 1.8 $ =~ /: (\d+).(\d+)/;
our $accountdb = esmith::AccountsDB->open();
our $configdb = esmith::ConfigDB->open();
=pod
=head1 NAME
esmith::FormMagick::Panels::ibays - useful panel functions
=head1 SYNOPSIS
use esmith::FormMagick::Panels::ibays;
my $panel = esmith::FormMagick::Panel::ibays->new();
$panel->display();
=head1 DESCRIPTION
=head2 new();
Exactly as for esmith::FormMagick
=begin testing
$ENV{ESMITH_ACCOUNT_DB} = "10e-smith-base/accounts.conf";
$ENV{ESMITH_CONFIG_DB} = "10e-smith-base/configuration.conf";
$ENV{ESMITH_DOMAINS_DB} = "10e-smith-base/domains.conf";
use_ok('esmith::FormMagick::Panel::ibays');
use vars qw($panel);
ok($panel = esmith::FormMagick::Panel::ibays->new(),
"Create panel object");
isa_ok($panel, 'esmith::FormMagick::Panel::ibays');
{ package esmith::FormMagick::Panel::ibays;
our $accountdb;
::isa_ok($accountdb, 'esmith::AccountsDB');
}
=end testing
=cut
sub new
{
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = esmith::FormMagick::new($class);
$self->{calling_package} = (caller)[0];
return $self;
}
=head1 HTML GENERATION ROUTINES
Routines for generating chunks of HTML needed by the panel.
=head1 ROUTINES FOR FILLING IN FIELDS
=head2 print_ibay_table
Prints out the ibay table on the front page.
=for testing
my $self = esmith::FormMagick::Panel::ibays->new();
$self->{cgi} = CGI->new("");
can_ok('main', 'print_ibay_table');
$self->print_ibay_table();
like($_STDOUT_, qr/NAME/, "Found NAME header in table output");
#like($_STDOUT_, qr/testibay/, "Found test ibay in user table output");
#like($_STDOUT_, qr/ff0000/, "Found red 'reset password' output");
=cut
sub print_ibay_table {
my $self = shift;
my $q = $self->{cgi};
my $name = $self->localise('NAME');
my $description = $self->localise('DESCRIPTION');
my $modify = $self->localise('MODIFY');
my $remove = $self->localise('REMOVE');
my $resetpw = $self->localise('PASSWORD_RESET');
my $action_h = $self->localise('ACTION');
my @ibays = $accountdb->ibays();
unless ( scalar @ibays )
{
print $q->Tr($q->td($self->localise('NO_IBAYS')));
return "";
}
print $q->start_table({-CLASS => "sme-border"}),"\n";
print $q->Tr (
esmith::cgi::genSmallCell($q, $name,"header"),
esmith::cgi::genSmallCell($q, $description,"header"),
esmith::cgi::genSmallCell($q, $action_h,"header", 3)),"\n";
my $scriptname = basename($0);
foreach my $i (@ibays)
{
my $ibayname = $i->key();
my $ibaydesc = $i->prop('Name');
my $modifiable = $i->prop('Modifiable') || 'yes';
my $passwordable = $i->prop('Passwordable') || 'yes';
my $removable = $i->prop('Removable') || 'yes';
my $needPassword = grep { $_ eq $i->prop('PublicAccess') }
qw(local-pw global-pw global-pw-remote);
my $params = $self->build_ibay_cgi_params($ibayname, $i->props());
my $href = "$scriptname?$params&action=modify&wherenext=";
my $actionModify = '&nbsp;';
if ($modifiable eq 'yes')
{
$actionModify .= $q->a({href => "${href}CreateModify"},$modify)
. '&nbsp;';
}
my $actionResetPw = '&nbsp;';
if ($passwordable eq 'yes')
{
if ($i->prop('PasswordSet') ne 'yes' && $needPassword)
{
$actionResetPw .= $q->a({href => "${href}Password",
class => "error"}, $resetpw)
}
else
{
$actionResetPw .= $q->a({href => "${href}Password"}, $resetpw)
}
$actionResetPw .= '&nbsp';
}
my $actionRemove = '&nbsp;';
if ($removable eq 'yes')
{
$actionRemove .= $q->a({href => "${href}Remove"}, $remove)
. '&nbsp';
}
print $q->Tr (
esmith::cgi::genSmallCell($q, $ibayname,"normal"),
esmith::cgi::genSmallCell($q, $ibaydesc,"normal"),
esmith::cgi::genSmallCell($q, $actionModify,"normal"),
esmith::cgi::genSmallCell($q, $actionResetPw,"normal"),
esmith::cgi::genSmallCell($q, $actionRemove,"normal"));
}
print $q->end_table,"\n";
return "";
}
sub build_ibay_cgi_params {
my ($self, $ibayname, %oldprops) = @_;
#$oldprops{'description'} = $oldprops{Name};
#delete $oldprops{Name};
my %props = (
page => 0,
page_stack => "",
#".id" => $self->{cgi}->param('.id') || "",
name => $ibayname,
#%oldprops
);
return $self->props_to_query_string(\%props);
}
*wherenext = \&CGI::FormMagick::wherenext;
sub print_ibay_name_field {
my $self = shift;
my $in = $self->{cgi}->param('name') || '';
my $action = $self->{cgi}->param('action') || '';
my $maxLength = $configdb->get('maxIbayNameLength')->value;
print qq(<tr><td colspan="2">) . $self->localise('NAME_FIELD_DESC',
{maxLength => $maxLength}) . qq(</td></tr>);
print qq(<tr><td class="sme-noborders-label">) .
$self->localise('NAME_LABEL') . qq(</td>\n);
if ($action eq 'modify' and $in) {
print qq(
<td class="sme-noborders-content">$in
<input type="hidden" name="name" value="$in">
<input type="hidden" name="action" value="modify">
</td>
);
# Read the values for each field from the accounts db and store
# them in the cgi object so our form will have the correct
# info displayed.
my $q = $self->{cgi};
my $rec = $accountdb->get($in);
if ($rec)
{
$q->param(-name=>'description',-value=>
$rec->prop('Name'));
$q->param(-name=>'group',-value=>
$rec->prop('Group'));
$q->param(-name=>'userAccess',-value=>
$rec->prop('UserAccess'));
$q->param(-name=>'publicAccess',-value=>
$rec->prop('PublicAccess'));
$q->param(-name=>'CgiBin',-value=>
$rec->prop('CgiBin'));
$q->param(-name=>'SSLRequireSSL',-value=>
$rec->prop('SSLRequireSSL'));
}
} else {
print qq(
<td><input type="text" name="name" value="$in">
<input type="hidden" name="action" value="create">
</td>
);
}
print qq(</tr>\n);
return undef;
}
=pod
=head2 print_vhost_message()
Prints a warning message that vhosts whose content is this ibay will be
modified to point to primary site.
=for testing
$panel->{cgi} = CGI->new();
$panel->{cgi}->param(-name=>'name', -value=>'bar');
is($panel->print_vhost_message(), undef, 'print_vhost_message');
=cut
sub print_vhost_message {
my $self = shift;
my $q = $self->{cgi};
my $name = $q->param('name');
my $domaindb = esmith::DomainsDB->open();
my @domains = $domaindb->get_all_by_prop(Content => $name);
my $vhostListItems = join "\n",
(map ($q->li($_->key." ".$_->prop('Description')),
@domains));
if ($vhostListItems)
{
print $self->localise('VHOST_MESSAGE', {vhostList => $vhostListItems});
}
return undef;
}
=head2 group_list()
Returns a hash of groups for the Create/Modify screen's group field's
drop down list.
=for testing
can_ok('main', 'group_list');
my $g = group_list();
is(ref($g), 'HASH', "group_list returns a hashref");
is($g->{simpsons}, "Simpsons Family (simpsons)",
"Found names and descriptions");
=cut
sub group_list
{
my @groups = $accountdb->groups();
my %groups = ( admin => 'Admin', shared => 'Everyone' );
foreach my $g (@groups) {
$groups{$g->key()} = $g->prop('Description')." (".
$g->key.")";
}
return \%groups;
}
=head2 userAccess_list
Returns the hash of user access settings for showing in the user access
drop down list.
=for testing
can_ok('main', 'userAccess_list');
my $u = userAccess_list();
is(ref($u), 'HASH', "userAccess_list returns a hashref");
like($u->{'wr-group-rd-group'}, qr/WGRG/, "hashref contains the right stuff");
=cut
sub userAccess_list
{
return {
'wr-group-rd-group' => 'WGRG',
'wr-group-rd-everyone' => 'WGRE',
'wr-admin-rd-group' => 'WARG'
};
}
=head2 publicAccess_list
Returns the hash of public access settings for showing in the public
access drop down list.
=for testing
can_ok('main', 'publicAccess_list');
my $u = publicAccess_list();
is(ref($u), 'HASH', "publicAccess_list returns a hashref");
is($u->{none}, 'NONE', "hashref contains the right stuff");
=cut
sub publicAccess_list {
return {
'none' => 'NONE',
'local' => 'LOCAL_NETWORK_NO_PASSWORD',
'local-pw' => 'LOCAL_NETWORK_PASSWORD',
'global' => 'ENTIRE_INTERNET_NO_PASSWORD',
'global-pw' => 'ENTIRE_INTERNET_PASSWORD',
'global-pw-remote' => 'ENTIRE_INTERNET_PASSWORD_REMOTE'
};
}
=head1 VALIDATION ROUTINES
=head2 max_ibay_name_length()
Checks the length of a given i-bay name against the maximum set in the
maxIbayNameLength record of the configuration database. Defaults to a
maximum length of the maxIbayNameLength set in the config db.
=begin testing
my $conf = esmith::ConfigDB->open();
isa_ok($conf, 'esmith::ConfigDB');
my $max_record = $conf->get('maxIbayNameLength')
|| $conf->new_record('maxIbayNameLength');
$max_record->set_value(12);
$conf->reload;
is($conf->get('maxIbayNameLength')->value(), 12, "Max ibay length is 12");
can_ok('main', 'max_ibay_name_length');
is($panel->max_ibay_name_length('abc'), 'OK', "Short ibay name is OK");
isnt($panel->max_ibay_name_length('abcdefghiabcdefghi'), 'OK', "Long ibay name is not OK");
$max_record->set_value(2);
$conf->reload();
is($max_record->value(), 2, "Set max length to a very low number");
isnt($panel->max_ibay_name_length('abc'), 'OK', "Short ibay name is no longer OK");
=end testing
=cut
sub max_ibay_name_length {
my ($self, $data) = @_;
$configdb->reload();
my $max = $configdb->get('maxIbayNameLength')->value;
if (length($data) <= $max) {
return "OK";
} else {
return $self->localise("MAX_IBAY_NAME_LENGTH_ERROR",
{acctName => $data,
maxIbayNameLength => $max,
maxLength => $max});
}
}
=pod
=head2 conflict_check
Check the proposed name for clashes with existing pseudonyms or other
accounts of any type.
=cut
sub conflict_check
{
my ($self, $name) = @_;
my $rec = $accountdb->get($name);
my $type;
if (defined $rec)
{
my $type = $rec->prop('type');
if ($type eq "pseudonym")
{
my $acct = $rec->prop("Account");
my $acct_type = $accountdb->get($acct)->prop('type');
return $self->localise('ACCT_CLASHES_WITH_PSEUDONYM',
{acctName => $name, acctType => $acct_type, acct => $acct});
}
}
elsif (defined getpwnam($name) || defined getgrnam($name))
{
$type = 'system';
}
else
{
# No account record and no account
return 'OK';
}
return $self->localise('ACCOUNT_EXISTS',
{acctName => $name, acctType => $type});
}
=head1 THE ROUTINES THAT ACTUALLY DO THE WORK
=for testing
can_ok('main', 'handle_ibays');
=cut
sub handle_ibays {
my ($self) = @_;
if ($self->cgi->param("action") eq "create") {
$self->create_ibay();
} else {
$self->modify_ibay();
}
}
=head2 print_save_or_add_button()
=cut
sub print_save_or_add_button {
my ($self) = @_;
my $action = $self->cgi->param("action") || '';
if ($action eq "modify") {
$self->print_button("SAVE");
} else {
$self->print_button("ADD");
}
}
sub create_ibay {
my ($self) = @_;
my $name = $self->cgi->param('name');
my $msg = $self->validate_name($name);
unless ($msg eq "OK")
{
return $self->error($msg);
}
$msg = $self->max_ibay_name_length($name);
unless ($msg eq "OK")
{
return $self->error($msg);
}
$msg = $self->conflict_check($name);
unless ($msg eq "OK")
{
return $self->error($msg);
}
my $uid = $accountdb->get_next_uid();
if (my $acct = $accountdb->new_record($name, {
Name => $self->cgi->param('description'),
CgiBin => $self->cgi->param('CgiBin'),
Group => $self->cgi->param('group'),
PublicAccess => $self->cgi->param('publicAccess'),
SSLRequireSSL => $self->cgi->param('SSLRequireSSL'),
UserAccess => $self->cgi->param('userAccess'),
Uid => $uid,
Gid => $uid,
PasswordSet => 'no',
type => 'ibay',
}) )
{
# Untaint $name before use in system()
$name =~ /(.+)/; $name = $1;
if (system ("/sbin/e-smith/signal-event", "ibay-create", $name) == 0) {
$self->success("SUCCESSFULLY_CREATED_IBAY");
} else {
$self->error("ERROR_WHILE_CREATING_IBAY");
}
} else {
$self->error('CANT_CREATE_IBAY');
}
}
sub modify_ibay {
my ($self) = @_;
my $name = $self->cgi->param('name');
if (my $acct = $accountdb->get($name)) {
if ($acct->prop('type') eq 'ibay') {
$acct->merge_props(
Name => $self->cgi->param('description'),
CgiBin => $self->cgi->param('CgiBin'),
Group => $self->cgi->param('group'),
PublicAccess => $self->cgi->param('publicAccess'),
SSLRequireSSL => $self->cgi->param('SSLRequireSSL'),
UserAccess => $self->cgi->param('userAccess'),
);
# Untaint $name before use in system()
$name =~ /(.+)/; $name = $1;
if (system ("/sbin/e-smith/signal-event", "ibay-modify",
$name) == 0)
{
$self->success("SUCCESSFULLY_MODIFIED_IBAY");
} else {
$self->error("ERROR_WHILE_MODIFYING_IBAY");
}
} else {
$self->error('CANT_FIND_IBAY');
}
} else {
$self->error('CANT_FIND_IBAY');
}
}
=for testing
can_ok('main', 'remove_ibay');
=cut
sub remove_ibay {
my ($self) = @_;
my $name = $self->cgi->param('name');
if (my $acct = $accountdb->get($name)) {
if ($acct->prop('type') eq 'ibay') {
$acct->set_prop('type', 'ibay-deleted');
my $domains_db = esmith::DomainsDB->open();
my @domains = $domains_db->get_all_by_prop(Content=>$name);
foreach my $d (@domains) {
$d->set_prop(Content => 'Primary');
}
# Untaint $name before use in system()
$name =~ /(.+)/; $name = $1;
if (system ("/sbin/e-smith/signal-event", "ibay-delete",
$name) == 0)
{
$self->success("SUCCESSFULLY_DELETED_IBAY");
$acct->delete();
} else {
$self->error("ERROR_WHILE_DELETING_IBAY");
}
} else {
$self->error('CANT_FIND_IBAY');
}
} else {
$self->error('CANT_FIND_IBAY');
}
$self->wherenext('First');
}
=for testing
can_ok('main', 'reset_password');
=cut
sub reset_password {
my ($self) = @_;
my $name = $self->cgi->param('name');
my $newPass = $self->cgi->param('newPass');
my $acct;
if (($acct = $accountdb->get($name)) && ($acct->prop('type') eq 'ibay')) {
esmith::util::setIbayPassword ($acct->key, $newPass);
$acct->set_prop('PasswordSet', 'yes');
# Untaint $name before use in system()
$name =~ /(.+)/; $name = $1;
if (system ("/sbin/e-smith/signal-event", "password-modify",
$name) == 0)
{
$self->success("SUCCESSFULLY_RESET_PASSWORD");
} else {
$self->error("ERROR_WHILE_RESETTING_PASSWORD");
}
} else {
$self->error('CANT_FIND_IBAY');
}
$self->wherenext('First');
}
=pod
=head2 getExtraParams()
Sets variables used in the lexicon to their required values.
=for testing
$panel->{cgi}->param(-name=>'name', -value=>'foo');
my %ret = $panel->getExtraParams();
is($ret{name}, 'foo', ' .. name field is foo');
isnt($ret{description}, undef, ' .. description field isnt undef');
=cut
sub getExtraParams
{
my $self = shift;
my $q = $self->{cgi};
my $name = $q->param('name');
my $desc = '';
if ($name)
{
my $acct = $accountdb->get($name);
if ($acct)
{
$desc = $acct->prop('Name');
}
}
return (name => $name, description => $desc);
}
=head2 verifyPasswords()
Returns an error message if the two new passwords input don't match.
=cut
sub verifyPasswords {
my $self = shift;
my $pass2 = shift;
my $pass1 = $self->{cgi}->param('newPass');
unless ($pass1 eq $pass2) {
$self->{cgi}->param( -name => 'wherenext', -value => 'Password' );
return "PASSWORD_NO_MATCH";
}
return "OK";
}
=head2 validate_name
Checks that the name supplied does not contain any unacceptable chars.
Returns OK on success or a localised error message otherwise.
ting
is($panel->validate_name('foo'), 'OK', 'validate_name');
is($panel->validate_name('cust3.prj12'),'OK',' .. name with dots and nums');
is($panel->validate_name('cust_bay'),'OK',' .. name with underscore');
isnt($panel->validate_name('3amigos'), 'OK', ' .. cannot start with number');
isnt($panel->validate_name('betty ford'), 'OK', ' .. cannot contain space');
=cut
sub validate_name
{
my ($self, $acctName) = @_;
unless ($acctName =~ /^([a-z][\_\.\-a-z0-9]*)$/)
{
return $self->localise('ACCT_NAME_HAS_INVALID_CHARS',
{acctName => $acctName});
}
return "OK";
}
=head2 check_password
Validates the password using the desired strength
=cut
sub check_password {
my $self = shift;
my $pass1 = shift;
my $check_type;
my $rec = $configdb->get('passwordstrength');
$check_type = ($rec ? ($rec->prop('Ibays') || 'none') : 'none');
return $self->validate_password($check_type,$pass1);
}
1;

View File