initial commit of file from CVS for smeserver-userpanel on Sat Sep 7 21:12:39 AEST 2024
This commit is contained in:
parent
d369a6eb72
commit
537335bf32
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*.rpm
|
||||
*.log
|
||||
*spec-20*
|
||||
*.tar.xz
|
21
Makefile
Normal file
21
Makefile
Normal file
@ -0,0 +1,21 @@
|
||||
# Makefile for source rpm: smeserver-userpanel
|
||||
# $Id: Makefile,v 1.1 2020/11/04 16:01:55 michel Exp $
|
||||
NAME := smeserver-userpanel
|
||||
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)
|
16
README.md
16
README.md
@ -1,3 +1,15 @@
|
||||
# smeserver-userpanel
|
||||
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-userpanel
|
||||
|
||||
SMEServer Koozali developed git repo for smeserver-userpanel smecontribs
|
||||
SMEServer Koozali developed git repo for smeserver-userpanel smecontribs
|
||||
|
||||
## Wiki
|
||||
<br />https://wiki.koozali.org/
|
||||
|
||||
## Bugzilla
|
||||
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-userpanel&product=SME%20Contribs&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 />
|
||||
|
340
additional/COPYING
Normal file
340
additional/COPYING
Normal 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
additional/README.md
Normal file
1
additional/README.md
Normal file
@ -0,0 +1 @@
|
||||
smeserver-userpanel is a contrib for SME Server, a Linux distro oriented server. see http://wiki.contribs.org
|
1
contriborbase
Normal file
1
contriborbase
Normal file
@ -0,0 +1 @@
|
||||
contribs10
|
35
createlinks
Normal file
35
createlinks
Normal file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use esmith::Build::CreateLinks qw(:all);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
|
||||
##link to panel
|
||||
panel_link("userpanelaccess", "manager");
|
||||
|
||||
##actions conf-userpanelsymlinks
|
||||
for my $event (qw( conf-userpanel bootstrap-console-save console-save post-upgrade remoteaccess-update )){
|
||||
event_link("conf-userpanelsymlinks", $event, "03");}
|
||||
|
||||
##actions link to translations
|
||||
for my $event (qw( conf-userpanel bootstrap-console-save console-save post-upgrade remoteaccess-update )){
|
||||
event_link("conf-linktotranslations", $event, "03");}
|
||||
|
||||
##event conf-userpanel
|
||||
my $event = "conf-userpanel";
|
||||
safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/httpd-admin");
|
||||
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
|
||||
templates2events( "/etc/httpd/conf/httpd.conf",$event);
|
||||
templates2events( "/etc/httpd/admin-conf/httpd.conf",$event);
|
||||
templates2events( "/etc/e-smith/web/common/css/manager.css",$event);
|
||||
templates2events( "/etc/e-smith/web/common/css/manager.css","bootstrap-console-save");
|
||||
|
||||
$event = "smeserver-userpanel-update";
|
||||
safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/httpd-admin");
|
||||
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
|
||||
templates2events( "/etc/httpd/conf/httpd.conf",$event);
|
||||
templates2events( "/etc/httpd/admin-conf/httpd.conf",$event);
|
||||
templates2events( "/etc/e-smith/web/common/css/manager.css",$event);
|
||||
templates2events( "/etc/e-smith/web/common/css/manager.css","bootstrap-console-save");
|
||||
event_link("conf-linktotranslations", $event, "03");
|
||||
event_link("conf-userpanelsymlinks", $event, "03");
|
8
root/etc/e-smith/events/actions/conf-linktotranslations
Normal file
8
root/etc/e-smith/events/actions/conf-linktotranslations
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
trad=`/usr/bin/ls /etc/e-smith/locale/`
|
||||
for lang in $trad
|
||||
do
|
||||
/bin/mkdir -p /etc/e-smith/locale/$lang/etc/e-smith/web/panels/user
|
||||
/bin/ln -sf /etc/e-smith/locale/$lang/etc/e-smith/web/functions /etc/e-smith/locale/$lang/etc/e-smith/web/panels/user/cgi-bin
|
||||
done
|
||||
|
86
root/etc/e-smith/events/actions/conf-userpanelsymlinks
Normal file
86
root/etc/e-smith/events/actions/conf-userpanelsymlinks
Normal file
@ -0,0 +1,86 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) 2001 Daniel van Raay
|
||||
#
|
||||
# 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 esmith::config;
|
||||
use esmith::util;
|
||||
use esmith::db;
|
||||
|
||||
my %conf;
|
||||
tie %conf, 'esmith::config';
|
||||
|
||||
my %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# clear and re-create all the user panel symlinks
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
#clear
|
||||
opendir (DIR, "/etc/e-smith/web/panels/user/cgi-bin/") or
|
||||
die "Can't open directory /etc/e-smith/web/panels/user/cgi-bin/\n";
|
||||
my @symlinks = grep (!/^\./, readdir (DIR));
|
||||
closedir (DIR);
|
||||
|
||||
foreach my $link (@symlinks)
|
||||
{
|
||||
-e "/etc/e-smith/web/panels/user/cgi-bin/$link" && unlink("/etc/e-smith/web/panels/user/cgi-bin/$link");
|
||||
}
|
||||
|
||||
#always link userpanels
|
||||
my %newsymlinks;
|
||||
opendir (DIR, "/etc/e-smith/web/functions/") or
|
||||
die "Can't open directory /etc/e-smith/web/functions/\n";
|
||||
foreach my $userpanels ( grep (/^(userpanel-initial|userpanel-navigation|userpanel-noframes|pleasewait)$/, readdir (DIR)) )
|
||||
{
|
||||
$newsymlinks{$userpanels} = 'Yes';
|
||||
}
|
||||
closedir (DIR);
|
||||
|
||||
#also add needed panels
|
||||
foreach my $user (sort keys %accounts)
|
||||
{
|
||||
my $userAdminPanels = db_get_prop(\%accounts, $user, "AdminPanels");
|
||||
$userAdminPanels = '' if ! defined ($userAdminPanels);
|
||||
|
||||
foreach my $panels (split (/,/, $userAdminPanels))
|
||||
{
|
||||
$newsymlinks{$panels} = 'Yes';
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $link ( sort keys %newsymlinks )
|
||||
{
|
||||
if ( -e "/etc/e-smith/web/functions/$link" &&
|
||||
! -e "/etc/e-smith/web/panels/user/cgi-bin/$link" )
|
||||
{
|
||||
symlink("../../../functions/wrapper", "/etc/e-smith/web/panels/user/cgi-bin/$link") ||
|
||||
#link("/etc/e-smith/web/functions/$link", "/etc/e-smith/web/panels/user/cgi-bin/$link") ||
|
||||
warn "Couldn't link('functions/$link' to '/etc/e-smith/web/panels/user/cgi-bin/$link'): $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exit (0);
|
||||
|
@ -0,0 +1,315 @@
|
||||
{
|
||||
$OUT =<<'HERE';
|
||||
/*------------------------------------------------------------
|
||||
* Default properties
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
body
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
border-width: 0
|
||||
}
|
||||
|
||||
/* Netscape 4 needs these basic settings in order to render default font properly */
|
||||
p
|
||||
{
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
}
|
||||
|
||||
table td
|
||||
{
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
td {
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
table td div {
|
||||
background: transparent;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
p.notsmall {
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
/* End Netscape-isms (for the moment <sigh>) */
|
||||
|
||||
.centerit
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div
|
||||
{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.highlight
|
||||
{
|
||||
background: #ffc61e;
|
||||
}
|
||||
|
||||
.subheading
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #1e385b;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* Properties for headings
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
|
||||
h1
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for lists
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
ul
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
list-style-type: square;
|
||||
|
||||
}
|
||||
|
||||
ol {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 80%;
|
||||
color: #1e385b;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for list items
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
ol ul li
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 80%;
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for tables
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
/* Removed -- see default table font above... */
|
||||
/* td
|
||||
{
|
||||
font-family: Times
|
||||
}
|
||||
*/
|
||||
|
||||
table
|
||||
{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
/* left margin and center [sic] table classes */
|
||||
|
||||
.banner
|
||||
{
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.banner-right
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
background: #e17200;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.border
|
||||
{
|
||||
background: #000000;
|
||||
color: #000000;
|
||||
border-color: #000000;
|
||||
}
|
||||
.sidebar
|
||||
{
|
||||
width: 200px;
|
||||
background: #ffffff;
|
||||
font-size: smaller;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.sidebar-title
|
||||
{
|
||||
background: #1e385b;
|
||||
color: #ffffff;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.newsitem
|
||||
{
|
||||
background: #ffffff;
|
||||
font-color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.newsitem-title
|
||||
{
|
||||
background: #cccccc;
|
||||
font-color: #ffffff;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.newsitem-footer
|
||||
{
|
||||
background: #cccccc;
|
||||
color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: smaller;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.newsitem-detail
|
||||
{
|
||||
font-size: smaller;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.formlabel
|
||||
{
|
||||
background: #c0c0c0;
|
||||
color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: small;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for title tables
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
th
|
||||
{
|
||||
/* font-family: Helvetica,Arial; */
|
||||
background: #F7E0B5;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the copyright notice on the bottom
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
.copyright
|
||||
{
|
||||
font-family: Times;
|
||||
font-size: smaller
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the clickable links
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
/* Netscape 4 can't use these. Default ANCHOR setting follows... */
|
||||
a:link, A:visited, A:active
|
||||
{
|
||||
color: #00008b
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
color: #00008b;
|
||||
}
|
||||
|
||||
/* link styles for index.php3 (i.e. welcome page) */
|
||||
.welcome-link
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #1e385b;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the littlelinks
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
.littlelink
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Style for positioning text
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#textlayer
|
||||
{
|
||||
position: absolute;
|
||||
visibility: inherit;
|
||||
top: 160px;
|
||||
left: 50px;
|
||||
z-index: 2
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Style for bold paragraph text
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#para
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
font-weight: bold;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
*
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#title
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
font-weight: bold;
|
||||
padding: 7px 7px 7px 7px;
|
||||
color: #ffffff
|
||||
}
|
||||
|
||||
HERE
|
||||
}
|
@ -0,0 +1 @@
|
||||
/* DO NOT MODIFY THIS FILE! It is updated automatically */
|
@ -0,0 +1,10 @@
|
||||
|
||||
# Aliases for the e-smith-user panel:
|
||||
ScriptAlias /user-manager/cgi-bin /etc/e-smith/web/panels/user/cgi-bin
|
||||
Alias /user-manager /etc/e-smith/web/panels/user/html
|
||||
{
|
||||
my $UserAlias = ${UserPanelAlias} || 'user';
|
||||
$OUT .= " ScriptAlias /$UserAlias/cgi-bin /etc/e-smith/web/panels/user/cgi-bin\n";
|
||||
$OUT .= " Alias /$UserAlias /etc/e-smith/web/panels/user/html\n";
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
|
||||
#------------------------------------------------------------
|
||||
# e-smith-user panel
|
||||
#------------------------------------------------------------
|
||||
{
|
||||
use esmith::db;
|
||||
|
||||
my %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
my %panelshash;
|
||||
opendir (DIR, "/etc/e-smith/web/panels/user/cgi-bin")
|
||||
|| die "Can't open /etc/e-smith/web/panels/user/cgi-bin directory.\n";
|
||||
|
||||
my @files = sort (grep (!/(^\.\.?$)|(^pleasewait$)|(^userpanel-[a-z][\-\_a-z0-9]*)/, readdir(DIR)));
|
||||
|
||||
closedir (DIR);
|
||||
|
||||
my $globalpanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
|
||||
$globalpanels = '' if ( ! defined ($globalpanels) );
|
||||
my @globalpanels = split (/,/, $globalpanels, -1);
|
||||
|
||||
my $key;
|
||||
my $value;
|
||||
my $require = "require user ";
|
||||
while (($key,$value) = each %accounts)
|
||||
{
|
||||
my ($type, %properties) = split (/\|/, $value, -1);
|
||||
if ($type eq 'user')
|
||||
{
|
||||
# Build the all-users require line:
|
||||
$require .= " $key";
|
||||
|
||||
foreach $file (@files)
|
||||
{
|
||||
next if ($globalpanels && grep (/^$file$/, @globalpanels));
|
||||
|
||||
my $adminpanels = db_get_prop(\%accounts, $key, 'AdminPanels');
|
||||
if ( defined $adminpanels )
|
||||
{
|
||||
my @adminpanels = split (/,/, $adminpanels, -1);
|
||||
if (grep (/^$file$/, @adminpanels))
|
||||
{
|
||||
# Build a files require line for each panel
|
||||
$panelshash{$file} .= " $key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$OUT .= <<HERE;
|
||||
<Directory \"/etc/e-smith/web/panels/user/html\" >
|
||||
Options Includes Indexes FollowSymLinks
|
||||
AllowOverride None
|
||||
AuthName "SME User manager"
|
||||
AuthType Basic
|
||||
TKTAuthLoginURL /server-common/cgi-bin/login
|
||||
SetEnv IMGHDR_SRC \"/e-smith-common/server-manager.jpg\"
|
||||
<RequireAll>
|
||||
require valid-user
|
||||
Require ip $localAccess
|
||||
</RequireAll>
|
||||
</Directory>
|
||||
|
||||
<Directory \"/etc/e-smith/web/panels/user/cgi-bin\" >
|
||||
Options Includes Indexes FollowSymLinks
|
||||
AllowOverride None
|
||||
AuthName "SME User Manager"
|
||||
AuthType Basic
|
||||
TKTAuthLoginURL /server-common/cgi-bin/login
|
||||
SetEnv IMGHDR_SRC \"/e-smith-common/server-manager.jpg\"
|
||||
<RequireAll>
|
||||
require valid-user
|
||||
Require ip $localAccess
|
||||
</RequireAll>
|
||||
HERE
|
||||
|
||||
foreach $file (@files)
|
||||
{
|
||||
next unless ( defined ($panelshash{$file}) );
|
||||
$OUT .= "\n";
|
||||
$OUT .= " <Files $file>\n";
|
||||
$OUT .= " AuthName \"SME User manager\"\n";
|
||||
$OUT .= " AuthType Basic\n";
|
||||
$OUT .= " TKTAuthLoginURL /server-common/cgi-bin/login\n";
|
||||
$OUT .= " require user admin$panelshash{$file}\n";
|
||||
$OUT .= " </Files>\n";
|
||||
}
|
||||
|
||||
$OUT .= "</Directory>\n";
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
# vim: ft=perl:
|
||||
|
||||
$haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no';
|
||||
$plainTextAccess = ${'httpd-admin'}{PermitPlainTextAccess} || 'no';
|
||||
$UserAlias = ${UserPanelAlias} || 'user';
|
||||
|
||||
|
||||
$OUT = '';
|
||||
foreach $place ('user-manager',$UserAlias)
|
||||
{
|
||||
if (($port eq "80") && ($haveSSL eq 'yes') && ($plainTextAccess ne 'yes'))
|
||||
{
|
||||
$OUT .= " RewriteRule ^/$place(/.*|\$) https://%{HTTP_HOST}/$place\$1 [L,R]\n";
|
||||
} else {
|
||||
$OUT .= " ProxyPass /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
|
||||
$OUT .= " ProxyPassReverse /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
|
||||
}
|
||||
|
||||
$OUT .= " <Location /$place>\n";
|
||||
if (($haveSSL eq 'yes') && (($port eq "443") || ($plainTextAccess ne 'yes')))
|
||||
{
|
||||
$OUT .= " Require ip $localAccess $externalSSLAccess\n";
|
||||
} else {
|
||||
$OUT .= " Require ip $localAccess\n";
|
||||
}
|
||||
$OUT .= " </Location>\n";
|
||||
}
|
||||
}
|
128
root/etc/e-smith/web/common/cgi-bin/logout-user
Normal file
128
root/etc/e-smith/web/common/cgi-bin/logout-user
Normal file
@ -0,0 +1,128 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# mod_auth_tkt sample logout script
|
||||
#
|
||||
# Note that this needs script needs to be available locally on all domains
|
||||
# if using multiple domains (unlike login.cgi, which only needs to exist
|
||||
# on one domain).
|
||||
#
|
||||
|
||||
use File::Basename;
|
||||
use lib dirname($ENV{SCRIPT_FILENAME});
|
||||
use Apache::AuthTkt 0.03;
|
||||
use CGI qw(:standard);
|
||||
use URI::Escape;
|
||||
use URI;
|
||||
use strict;
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Configure this section to taste
|
||||
|
||||
# CSS stylesheet to use (optional)
|
||||
my $STYLESHEET = '/server-common/css/tkt.css';
|
||||
# Page title (optional)
|
||||
my $TITLE = '';
|
||||
# Boolean flag, whether to fallback to HTTP_REFERER for back link
|
||||
my $BACK_REFERER = 1;
|
||||
# Additional cookies to clear on logout e.g. PHPSESSID
|
||||
my @NUKE_COOKIES = qw();
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Main code begins
|
||||
my $debug = 0;
|
||||
my $at = Apache::AuthTkt->new(conf => "/etc/e-smith/web/common/cgi-bin/AuthTKT.cfg");
|
||||
my $q = CGI->new;
|
||||
my ($server_name, $server_port) = split /:/, $q->http('X-Forwarded-Host') || $ENV{HTTP_HOST};
|
||||
#warn "servername is $server_name; HOST is $ENV{HTTP_HOST}\n";
|
||||
$server_name ||= $ENV{SERVER_NAME};
|
||||
$server_port ||= $ENV{SERVER_PORT};
|
||||
$server_port = '443';
|
||||
my $AUTH_DOMAIN = $server_name;
|
||||
my $back = $q->cookie($at->back_cookie_name) if $at->back_cookie_name;
|
||||
$back ||= $q->param($at->back_arg_name) if $at->back_arg_name;
|
||||
$back ||= $ENV{HTTP_REFERER} if $BACK_REFERER;
|
||||
$back = "/user-manager/";
|
||||
if ($back && $back =~ m!^/!) {
|
||||
my $hostname = $server_name;
|
||||
my $port = $server_port;
|
||||
$hostname .= ':' . $port if $port && $port != 80 && $port != 443;
|
||||
$back = sprintf "http%s://%s%s", ($port == 443 ? 's' : ''), $hostname, $back;
|
||||
} elsif ($back && $back !~ m/^http/i) {
|
||||
$back = 'http://' . $back;
|
||||
}
|
||||
$back = uri_unescape($back) if $back =~ m/^https?%3A%2F%2F/;
|
||||
my $back_html = escapeHTML($back) if $back;
|
||||
|
||||
# Logout by resetting the auth cookie
|
||||
my @cookies = cookie(-name => $at->cookie_name, -value => '', -expires => '-1h',
|
||||
($AUTH_DOMAIN && $AUTH_DOMAIN =~ /\./ ? (-domain => $AUTH_DOMAIN) : ()));
|
||||
push @cookies, map { cookie(-name => $_, -value => '', -expires => '-1h') } @NUKE_COOKIES;
|
||||
|
||||
my $redirected = 0;
|
||||
if ($back) {
|
||||
my $b = URI->new($back);
|
||||
# If $back domain doesn't match $AUTH_DOMAIN, add ticket reset to back
|
||||
if ($b->host !~ m/\b$AUTH_DOMAIN$/i) {
|
||||
$back .= $b->query ? '&' : '?';
|
||||
$back .= $at->cookie_name . '=';
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
print $q->header(-cookie => \@cookies);
|
||||
}
|
||||
|
||||
else {
|
||||
# Set (local) cookie, and redirect to $back
|
||||
print $q->header(
|
||||
-cookie => \@cookies,
|
||||
# -location => $back,
|
||||
);
|
||||
# For some reason, a Location: redirect doesn't seem to then see the cookie,
|
||||
# but a meta refresh one does - weird
|
||||
print $q->start_html(
|
||||
-head => meta({
|
||||
-http_equiv => 'refresh', -content => "0;URL=$back"
|
||||
}));
|
||||
$redirected = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# If no $back, just set the auth cookie and hope for the best
|
||||
else {
|
||||
print $q->header(-cookie => \@cookies);
|
||||
}
|
||||
|
||||
my @style = $STYLESHEET ? ('-style' => { src => $STYLESHEET }) : ();
|
||||
$TITLE ||= 'Logout Page';
|
||||
unless ($redirected) {
|
||||
# If here, either some kind of error or no back ref found
|
||||
print $q->start_html(
|
||||
-title => $TITLE,
|
||||
@style,
|
||||
);
|
||||
print <<EOD;
|
||||
<div align="center">
|
||||
<h1>$TITLE</h1>
|
||||
EOD
|
||||
if ($debug) {
|
||||
print <<EOD;
|
||||
<pre>
|
||||
back: $back
|
||||
back_html: $back_html
|
||||
</pre>
|
||||
EOD
|
||||
}
|
||||
print <<EOD;
|
||||
<p>You are now logged out.</p>
|
||||
EOD
|
||||
print qq(<p><a href="$back_html">Return to server manager login</a></p>\n) if $back_html;
|
||||
print <<EOD;
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOD
|
||||
}
|
||||
|
||||
# arch-tag: 09c96fc6-5119-4c79-8086-6c6b24951f96
|
||||
# vim:sw=2:sm:cin
|
||||
|
310
root/etc/e-smith/web/common/css/manager.css
Normal file
310
root/etc/e-smith/web/common/css/manager.css
Normal file
@ -0,0 +1,310 @@
|
||||
/*------------------------------------------------------------
|
||||
* Default properties
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
body
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
border-width: 0
|
||||
}
|
||||
|
||||
/* Netscape 4 needs these basic settings in order to render default font properly */
|
||||
p
|
||||
{
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
}
|
||||
|
||||
table td
|
||||
{
|
||||
color: #000000;
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
td {
|
||||
font-family: verdana,arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
table td div {
|
||||
background: transparent;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
p.notsmall {
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
/* End Netscape-isms (for the moment <sigh>) */
|
||||
|
||||
.centerit
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div
|
||||
{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.highlight
|
||||
{
|
||||
background: #ffc61e;
|
||||
}
|
||||
|
||||
.subheading
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #1e385b;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* Properties for headings
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
|
||||
h1
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
color: #000099
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-family: verdana,helvetica,arial,sans-serif;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for lists
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
ul
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
list-style-type: square;
|
||||
|
||||
}
|
||||
|
||||
ol {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 80%;
|
||||
color: #1e385b;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for list items
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
ol ul li
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 80%;
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for tables
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
/* Removed -- see default table font above... */
|
||||
/* td
|
||||
{
|
||||
font-family: Times
|
||||
}
|
||||
*/
|
||||
|
||||
table
|
||||
{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
/* left margin and center [sic] table classes */
|
||||
|
||||
.banner
|
||||
{
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.banner-right
|
||||
{
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
background: #e17200;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.border
|
||||
{
|
||||
background: #000000;
|
||||
color: #000000;
|
||||
border-color: #000000;
|
||||
}
|
||||
.sidebar
|
||||
{
|
||||
width: 200px;
|
||||
background: #ffffff;
|
||||
font-size: smaller;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.sidebar-title
|
||||
{
|
||||
background: #1e385b;
|
||||
color: #ffffff;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.newsitem
|
||||
{
|
||||
background: #ffffff;
|
||||
font-color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.newsitem-title
|
||||
{
|
||||
background: #cccccc;
|
||||
font-color: #ffffff;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.newsitem-footer
|
||||
{
|
||||
background: #cccccc;
|
||||
color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: smaller;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.newsitem-detail
|
||||
{
|
||||
font-size: smaller;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.formlabel
|
||||
{
|
||||
background: #c0c0c0;
|
||||
color: #000000;
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: small;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for title tables
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
th
|
||||
{
|
||||
/* font-family: Helvetica,Arial; */
|
||||
background: #F7E0B5;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the copyright notice on the bottom
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
.copyright
|
||||
{
|
||||
font-family: Times;
|
||||
font-size: smaller
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the clickable links
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
/* Netscape 4 can't use these. Default ANCHOR setting follows... */
|
||||
a:link, A:visited, A:active
|
||||
{
|
||||
color: #00008b
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
color: #00008b;
|
||||
}
|
||||
|
||||
/* link styles for index.php3 (i.e. welcome page) */
|
||||
.welcome-link
|
||||
{
|
||||
background: #ffffff;
|
||||
color: #1e385b;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Properties for the littlelinks
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
.littlelink
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Style for positioning text
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#textlayer
|
||||
{
|
||||
position: absolute;
|
||||
visibility: inherit;
|
||||
top: 160px;
|
||||
left: 50px;
|
||||
z-index: 2
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Style for bold paragraph text
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#para
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
font-weight: bold;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
*
|
||||
*------------------------------------------------------------*/
|
||||
|
||||
#title
|
||||
{
|
||||
font-family: helvetica,arial,sans-serif;
|
||||
font-weight: bold;
|
||||
padding: 7px 7px 7px 7px;
|
||||
color: #ffffff
|
||||
}
|
135
root/etc/e-smith/web/functions/userpanel-initial
Normal file
135
root/etc/e-smith/web/functions/userpanel-initial
Normal file
@ -0,0 +1,135 @@
|
||||
#!/usr/bin/perl -wT
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# user manager functions: initial
|
||||
#
|
||||
# Copyright (c) 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
#
|
||||
# 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;
|
||||
|
||||
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 %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
my $q = new CGI;
|
||||
|
||||
esmith::cgi::genHeaderNonCacheable ($q, \%conf, 'Smeserver User Manager');
|
||||
|
||||
print <<EOF;
|
||||
|
||||
<P>To perform a user administration function, click one of the
|
||||
links in the menu on the left of your screen. If your admin allows it,
|
||||
you can:
|
||||
|
||||
<ul>
|
||||
EOF
|
||||
|
||||
my $user = $ENV{'REMOTE_USER'};
|
||||
|
||||
my $userAdminPanels = db_get_prop(\%accounts, $user, 'AdminPanels');
|
||||
$userAdminPanels = '' if ! defined ($userAdminPanels);
|
||||
|
||||
my $globalAdminPanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
|
||||
$globalAdminPanels = '' if ! defined ($globalAdminPanels);
|
||||
|
||||
my @adminpanels;
|
||||
if ( defined ($userAdminPanels) )
|
||||
{
|
||||
@adminpanels = grep (/^userpanel-/, ((split (/,/, $userAdminPanels, -1)),(split (/,/, $globalAdminPanels, -1))));
|
||||
}
|
||||
|
||||
my $panel;
|
||||
my %panelhash = ();
|
||||
my $desc;
|
||||
my $longdesc;
|
||||
foreach $panel (@adminpanels)
|
||||
{
|
||||
unless (open (RD, "/etc/e-smith/web/panels/user/cgi-bin/$panel"))
|
||||
{
|
||||
warn "Can't open file /etc/e-smith/web/panels/user/cgi-bin/$panel: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
$desc = "";
|
||||
$longdesc = "";
|
||||
while (<RD>)
|
||||
{
|
||||
if (/^\s*#\s*description\s*:\s*(.+?)\s*$/)
|
||||
{
|
||||
$desc = $1;
|
||||
}
|
||||
if (/^\s*#\s*longdesc\s*:\s*(.+?)\s*$/)
|
||||
{
|
||||
$longdesc = $1;
|
||||
}
|
||||
|
||||
last if ( $desc && $longdesc );
|
||||
}
|
||||
close RD;
|
||||
|
||||
if ($desc && $longdesc)
|
||||
{
|
||||
$panelhash{$desc} = $longdesc;
|
||||
}
|
||||
}
|
||||
|
||||
foreach $panel (sort keys %panelhash)
|
||||
{
|
||||
print "<li><b>$panel</b> - <i>$panelhash{$panel}</i></li>\n";
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
</ul>
|
||||
|
||||
<P>This software comes with ABSOLUTELY NO WARRANTY. As part of our
|
||||
commitment to open-source software, you are welcome to copy and
|
||||
redistribute this software.
|
||||
|
||||
EOF
|
||||
|
||||
print $q->endform;
|
||||
|
||||
esmith::cgi::genFooter ($q);
|
||||
|
371
root/etc/e-smith/web/functions/userpanel-navigation
Normal file
371
root/etc/e-smith/web/functions/userpanel-navigation
Normal file
@ -0,0 +1,371 @@
|
||||
#!/usr/bin/perl -wT
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# e-smith manager functions: navigation
|
||||
#
|
||||
# copyright (C) 2002 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.e-smith.com for details.
|
||||
#----------------------------------------------------------------------
|
||||
package esmith;
|
||||
|
||||
use strict;
|
||||
use CGI ':no_xhtml', ':all';
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
use esmith::cgi;
|
||||
use esmith::config;
|
||||
use esmith::ConfigDB;
|
||||
use esmith::util;
|
||||
use esmith::I18N;
|
||||
use esmith::db;
|
||||
|
||||
sub determineGroup;
|
||||
sub showNavigation;
|
||||
sub logmeout;
|
||||
sub byweight;
|
||||
|
||||
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
|
||||
|
||||
# Use the one script for navigation and noframes
|
||||
my $NO_FRAMES = ($0 =~ /noframes/);
|
||||
|
||||
my %conf;
|
||||
tie %conf, 'esmith::config';
|
||||
|
||||
my %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
my $q = new CGI;
|
||||
|
||||
showNavigation ($q);
|
||||
logmeout($q);
|
||||
|
||||
exit (0);
|
||||
|
||||
#------------------------------------------------------
|
||||
# subroutine to print logout
|
||||
#------------------------------------------------------
|
||||
sub logmeout
|
||||
{
|
||||
my $user = $ENV{'REMOTE_USER'};
|
||||
|
||||
print <<EOF;
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align=left nowrap class="infobar">
|
||||
<img src="/server-common/spacer.gif" height="14" width="1" align="left">
|
||||
</td>
|
||||
<td align=left nowrap class="infobar">
|
||||
$user
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left nowrap class="infobar">
|
||||
<img src="/server-common/spacer.gif" height="14" width="1" align="left">
|
||||
</td>
|
||||
<td align=left nowrap class="infobar">
|
||||
<a target="_parent" href="/server-common/cgi-bin/logout-user"><b>Logout</b></a></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
EOF
|
||||
|
||||
|
||||
}
|
||||
|
||||
#------------------------------------------------------
|
||||
# subroutine to determine which group a user belongs to
|
||||
#------------------------------------------------------
|
||||
|
||||
sub determineGroup
|
||||
{
|
||||
my ($user) = shift;
|
||||
|
||||
# Group file for authentication
|
||||
my $group_file = '/etc/group';
|
||||
open ( GF, $group_file )
|
||||
or die "Cannot open group file: $group_file: $!\n";
|
||||
|
||||
# list of groups this user belongs to
|
||||
my @groupList;
|
||||
while (<GF>)
|
||||
{
|
||||
if (/[:,]$user\b/)
|
||||
{
|
||||
my ($groupName, undef) = split(/:/);
|
||||
push @groupList, $groupName;
|
||||
}
|
||||
}
|
||||
close GF;
|
||||
return @groupList;
|
||||
}
|
||||
|
||||
#------------------------------------------------------------
|
||||
# subroutine to display navigation bar
|
||||
#------------------------------------------------------------
|
||||
|
||||
sub showNavigation
|
||||
{
|
||||
my $q = shift;
|
||||
|
||||
my $acctName = $ENV{'REMOTE_USER'};
|
||||
my @adminpanels;
|
||||
|
||||
my $UserAlias = $conf{UserPanelAlias} || 'user';
|
||||
|
||||
my $availablePanels = db_get_prop(\%accounts, $acctName, 'AdminPanels') || '';
|
||||
push (@adminpanels, split (/,/, $availablePanels, -1));
|
||||
|
||||
my $globalPanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels') || '';
|
||||
push (@adminpanels, split (/,/, $globalPanels, -1));
|
||||
|
||||
foreach (determineGroup($acctName), 'shared')
|
||||
{
|
||||
my $gpanel = db_get_prop(\%accounts, $_, 'AdminPanels') || '';
|
||||
push (@adminpanels, split (/,/, $gpanel, -1));
|
||||
}
|
||||
|
||||
# Use this variable throughout to keep track of files
|
||||
# list of just the files
|
||||
my $c = "1";
|
||||
my @files = ();
|
||||
my %files_hash = ();
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Determine the directory where the functions are kept
|
||||
#-----------------------------------------------------
|
||||
|
||||
my $navigation_ignore =
|
||||
"(\.\.?|navigation|noframes|online-manual|(internal|pleasewait)(-.*)?)";
|
||||
|
||||
my $cgidir = '/etc/e-smith/web/panels/user/cgi-bin/';
|
||||
|
||||
if (opendir (DIR, $cgidir))
|
||||
{
|
||||
@files = grep (!/^(\..*|userpanel-navigation|userpanel-noframes|userpanel-initial|pleasewait)$/,
|
||||
readdir (DIR));
|
||||
closedir (DIR);
|
||||
}
|
||||
else
|
||||
{
|
||||
warn "Can't open directory $cgidir\n";
|
||||
}
|
||||
|
||||
foreach my $file (@files)
|
||||
{
|
||||
foreach my $adminpanel (@adminpanels)
|
||||
{
|
||||
if ( $file eq $adminpanel )
|
||||
{
|
||||
$files_hash{$file} = $cgidir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# For each script, extract the description and category
|
||||
# information. Build up an associative array mapping headings
|
||||
# to heading structures. Each heading structure contains the
|
||||
# total weight for the heading, the number of times the heading
|
||||
# has been encountered, and another associative array mapping
|
||||
# descriptions to description structures. Each description
|
||||
# structure contains the filename of the particular cgi script
|
||||
# and a weight.
|
||||
#--------------------------------------------------
|
||||
my %nav = ();
|
||||
|
||||
use constant NAVIGATIONDIR => '/home/e-smith/db/navigation';
|
||||
use constant WEBFUNCTIONS => '/etc/e-smith/web/functions';
|
||||
|
||||
my $i18n = new esmith::I18N;
|
||||
|
||||
my $language = $i18n->preferredLanguage( $ENV{HTTP_ACCEPT_LANGUAGE} );
|
||||
|
||||
my $navinfo = NAVIGATIONDIR . "/navigation.$language";
|
||||
|
||||
my $navdb = esmith::ConfigDB->open_ro( $navinfo ) or
|
||||
die "Couldn't open $navinfo\n";
|
||||
|
||||
# Check the navdb for anything with a UrlPath, which means that it doesn't
|
||||
# have a cgi file to be picked up by the above code. Ideally, only pages
|
||||
# that exist should be in the db, but that's not the case. Anything
|
||||
# without a cgi file will have to remove themselves on uninstall from the
|
||||
# navigation dbs.
|
||||
foreach my $rec ($navdb->get_all)
|
||||
{
|
||||
if ($rec->prop('UrlPath'))
|
||||
{
|
||||
$files_hash{$rec->{key}} = $cgidir;
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $file (keys %files_hash)
|
||||
{
|
||||
my $heading = 'Unknown';
|
||||
my $description = $file;
|
||||
my $headingWeight = 99999;
|
||||
my $descriptionWeight = 99999;
|
||||
my $urlpath = '';
|
||||
|
||||
my $rec = $navdb->get($file);
|
||||
|
||||
if (defined $rec)
|
||||
{
|
||||
$heading = $rec->prop('Heading');
|
||||
$description = $rec->prop('Description');
|
||||
$headingWeight = $rec->prop('HeadingWeight');
|
||||
$descriptionWeight = $rec->prop('DescriptionWeight');
|
||||
$urlpath = $rec->prop('UrlPath') || '';
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# add heading, description and weight information to data structure
|
||||
#--------------------------------------------------
|
||||
|
||||
unless (exists $nav {$heading})
|
||||
{
|
||||
$nav {$heading} = { COUNT => 0, WEIGHT => 0, DESCRIPTIONS => [] };
|
||||
}
|
||||
|
||||
$nav {$heading} {'COUNT'} ++;
|
||||
$nav {$heading} {'WEIGHT'} += $headingWeight;
|
||||
|
||||
my @filename = split /\//, $files_hash{$file};
|
||||
my $path = "/$UserAlias/$filename[scalar @filename - 1]";
|
||||
|
||||
push @{ $nav {$heading} {'DESCRIPTIONS'} },
|
||||
{ DESCRIPTION => $description,
|
||||
WEIGHT => $descriptionWeight,
|
||||
FILENAME => $urlpath ? $urlpath : "$path/$file",
|
||||
CGIPATH => $path
|
||||
};
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# generate list of headings sorted by average weight
|
||||
#--------------------------------------------------
|
||||
|
||||
my @unsortedheadings = keys %nav;
|
||||
|
||||
my $h;
|
||||
local @esmith::weights = ();
|
||||
foreach $h (@unsortedheadings)
|
||||
{
|
||||
push (@esmith::weights, ($nav {$h} {'WEIGHT'} / $nav {$h} {'COUNT'}));
|
||||
}
|
||||
|
||||
my @sortedheadings = @unsortedheadings [sort byweight $[..$#unsortedheadings];
|
||||
|
||||
if ( $NO_FRAMES )
|
||||
{
|
||||
esmith::cgi::genNoframesHeader ($q);
|
||||
}
|
||||
else
|
||||
{
|
||||
esmith::cgi::genNavigationHeader ($q, $#sortedheadings);
|
||||
print "\n<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">\n";
|
||||
}
|
||||
|
||||
foreach $h (@sortedheadings)
|
||||
{
|
||||
if ( $NO_FRAMES )
|
||||
{
|
||||
print $q->h2 ($h);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\n", $q->Tr ($q->td({class => "section"},$q->span({class => "section"}, $h)));
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# generate list of descriptions sorted by weight
|
||||
#--------------------------------------------------
|
||||
|
||||
my @unsorteddescriptions = @{ $nav {$h} {'DESCRIPTIONS'} };
|
||||
|
||||
my $d;
|
||||
@esmith::weights = ();
|
||||
foreach $d (@unsorteddescriptions)
|
||||
{
|
||||
push (@esmith::weights, $d->{'WEIGHT'});
|
||||
}
|
||||
|
||||
my @indices = sort byweight $[..$#unsorteddescriptions;
|
||||
|
||||
print "<ul>\n" if ( $NO_FRAMES );
|
||||
|
||||
my $i;
|
||||
foreach $i (@indices)
|
||||
{
|
||||
if ( $NO_FRAMES )
|
||||
{
|
||||
my $href = "/$UserAlias" .
|
||||
$unsorteddescriptions [$i]->{'FILENAME'};
|
||||
print $q->li ($q->a ({href => "$href?noframes=1"}, $unsorteddescriptions [$i]->{'DESCRIPTION'}));
|
||||
}
|
||||
else
|
||||
{
|
||||
my $_class_root_base = "item";
|
||||
my $_class_root_warn = "warn";
|
||||
my $_class = "$_class_root_base";
|
||||
my $_class_selected = "$_class_root_base"."-current";
|
||||
my $_class2 = "$_class_root_warn";
|
||||
my $_class2_selected = "$_class_root_warn"."-current";
|
||||
|
||||
my $href =
|
||||
$unsorteddescriptions [$i]->{'FILENAME'};
|
||||
print "\n",$q->Tr($q->td ({-class => "menu-cell"},
|
||||
$q->a ({-id => "sme$c",
|
||||
-class => "$_class",
|
||||
-onClick => "swapClass(0,'none','$_class_selected','$_class','a');swapClass(0,'none','$_class2_selected','$_class2','a');swapClass(0,'sme$c','$_class_selected','$_class','a')",
|
||||
href => $href,
|
||||
target => 'main'},
|
||||
$unsorteddescriptions [$i]->{'DESCRIPTION'})));
|
||||
}
|
||||
$c++;
|
||||
|
||||
}
|
||||
print "</ul>\n" if ($NO_FRAMES);
|
||||
}
|
||||
|
||||
unless ( $NO_FRAMES )
|
||||
{
|
||||
print "\n</TABLE>\n";
|
||||
esmith::cgi::genNavigationFooter ($q);
|
||||
}
|
||||
}
|
||||
|
||||
sub byweight
|
||||
{
|
||||
$esmith::weights [$a] <=> $esmith::weights [$b];
|
||||
}
|
259
root/etc/e-smith/web/functions/userpanel-noframes
Normal file
259
root/etc/e-smith/web/functions/userpanel-noframes
Normal file
@ -0,0 +1,259 @@
|
||||
#!/usr/bin/perl -wT
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# user manager functions: noframes
|
||||
#
|
||||
# Copyright (c) 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
#
|
||||
# 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 showNavigation ($);
|
||||
sub byweight;
|
||||
|
||||
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 %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
my $q = new CGI;
|
||||
|
||||
showNavigation ($q);
|
||||
exit (0);
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
# subroutine to display navigation bar
|
||||
#------------------------------------------------------------
|
||||
|
||||
sub showNavigation ($)
|
||||
{
|
||||
my $q = shift;
|
||||
|
||||
esmith::cgi::genNoframesHeader ($q);
|
||||
|
||||
my $acctName = $ENV{'REMOTE_USER'};
|
||||
my $availablePanels = db_get_prop(\%accounts, $acctName, 'AdminPanels');
|
||||
my $globalPanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
|
||||
|
||||
my @adminpanels;
|
||||
if ( defined ($availablePanels) && defined ($globalPanels) )
|
||||
{
|
||||
@adminpanels = ((split (/,/, $availablePanels, -1)),(split (/,/, $globalPanels, -1)));
|
||||
}
|
||||
elsif ( defined ($globalPanels) )
|
||||
{
|
||||
@adminpanels = split (/,/, $globalPanels, -1);
|
||||
}
|
||||
elsif ( defined ($availablePanels) )
|
||||
{
|
||||
@adminpanels = split (/,/, $availablePanels, -1);
|
||||
}
|
||||
|
||||
# Use this variable throughout to keep track of files
|
||||
# list of just the files
|
||||
my @files = ();
|
||||
my %files_hash = ();
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Determine the directory where the functions are kept
|
||||
# match available panels with delegated panels to this user
|
||||
#-----------------------------------------------------
|
||||
|
||||
my $cgidir = '/etc/e-smith/web/panels/user/cgi-bin/';
|
||||
|
||||
if (opendir (DIR, $cgidir))
|
||||
{
|
||||
@files = grep (!/^(\..*|userpanel-navigation|userpanel-noframes|userpanel-initial|pleasewait)$/,
|
||||
readdir (DIR));
|
||||
closedir (DIR);
|
||||
}
|
||||
else
|
||||
{
|
||||
warn "Can't open directory $cgidir\n";
|
||||
}
|
||||
|
||||
foreach my $file (@files)
|
||||
{
|
||||
foreach my $adminpanel (@adminpanels)
|
||||
{
|
||||
if ( $file eq $adminpanel )
|
||||
{
|
||||
$files_hash{$file} = $cgidir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# For each script, extract the description and category
|
||||
# information. Build up an associative array mapping headings
|
||||
# to heading structures. Each heading structure contains the
|
||||
# total weight for the heading, the number of times the heading
|
||||
# has been encountered, and another associative array mapping
|
||||
# descriptions to description structures. Each description
|
||||
# structure contains the filename of the particular cgi script
|
||||
# and a weight.
|
||||
#--------------------------------------------------
|
||||
|
||||
my %nav = ();
|
||||
|
||||
foreach my $file (keys %files_hash)
|
||||
{
|
||||
#--------------------------------------------------
|
||||
# extract heading, description and weight information
|
||||
# from CGI script
|
||||
#--------------------------------------------------
|
||||
my $heading = "Unknown";
|
||||
my $headingWeight = 0;
|
||||
|
||||
my $description = "Unknown";
|
||||
my $descriptionWeight = 0;
|
||||
|
||||
unless (open (RD, "$files_hash{$file}/$file"))
|
||||
{
|
||||
warn "Can't open file $files_hash{$file}/$file: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
while (<RD>)
|
||||
{
|
||||
if (/^\s*#\s*heading\s*:\s*(.+?)\s*$/)
|
||||
{
|
||||
$heading = $1;
|
||||
}
|
||||
|
||||
if (/^\s*#\s*description\s*:\s*(.+?)\s*$/)
|
||||
{
|
||||
$description = $1;
|
||||
}
|
||||
|
||||
if (/^\s*#\s*navigation\s*:\s*(\d+?)\s+(\d+?)\s*$/)
|
||||
{
|
||||
$headingWeight = $1;
|
||||
$descriptionWeight = $2;
|
||||
}
|
||||
last if ($heading ne "Unknown" && $headingWeight && $description ne "Unknown" && $descriptionWeight);
|
||||
}
|
||||
close RD;
|
||||
|
||||
#--------------------------------------------------
|
||||
# add heading, description and weight information to data structure
|
||||
#--------------------------------------------------
|
||||
|
||||
unless (exists $nav {$heading})
|
||||
{
|
||||
$nav {$heading} = { COUNT => 0, WEIGHT => 0, DESCRIPTIONS => [] };
|
||||
}
|
||||
|
||||
$nav {$heading} {'COUNT'} ++;
|
||||
$nav {$heading} {'WEIGHT'} += $headingWeight;
|
||||
|
||||
# Check for manager panel, and assign the appropriate
|
||||
# cgi-bin prefix for the links.
|
||||
# Grab the last 2 directories by splitting for '/'s and
|
||||
# then concatenating the last 2
|
||||
# probably a better way, but I don't know it.
|
||||
my @filename = split /\//, $files_hash{$file};
|
||||
my $path = "/user-manager/$filename[scalar @filename - 1]";
|
||||
|
||||
push @{ $nav {$heading} {'DESCRIPTIONS'} },
|
||||
{ DESCRIPTION => $description,
|
||||
WEIGHT => $descriptionWeight,
|
||||
FILENAME => "$path/$file",
|
||||
CGIPATH => $path
|
||||
};
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# generate list of headings sorted by average weight
|
||||
#--------------------------------------------------
|
||||
|
||||
my @unsortedheadings = keys %nav;
|
||||
|
||||
my $h;
|
||||
local @esmith::weights = ();
|
||||
foreach $h (@unsortedheadings)
|
||||
{
|
||||
push (@esmith::weights, ($nav {$h} {'WEIGHT'} / $nav {$h} {'COUNT'}));
|
||||
}
|
||||
|
||||
my @sortedheadings = @unsortedheadings [sort byweight $[..$#unsortedheadings];
|
||||
|
||||
foreach $h (@sortedheadings)
|
||||
{
|
||||
print $q->h2 ($h);
|
||||
|
||||
#--------------------------------------------------
|
||||
# generate list of descriptions sorted by weight
|
||||
#--------------------------------------------------
|
||||
|
||||
my @unsorteddescriptions = @{ $nav {$h} {'DESCRIPTIONS'} };
|
||||
|
||||
my $d;
|
||||
@esmith::weights = ();
|
||||
foreach $d (@unsorteddescriptions)
|
||||
{
|
||||
push (@esmith::weights, $d->{'WEIGHT'});
|
||||
}
|
||||
|
||||
my @indices = sort byweight $[..$#unsorteddescriptions;
|
||||
|
||||
print "<ul>\n";
|
||||
|
||||
my $i;
|
||||
foreach $i (@indices)
|
||||
{
|
||||
my $href = $unsorteddescriptions [$i]->{'FILENAME'};
|
||||
print $q->li ($q->a ({href => $href}, $unsorteddescriptions [$i]->{'DESCRIPTION'}));
|
||||
|
||||
}
|
||||
print "</ul>\n";
|
||||
}
|
||||
|
||||
esmith::cgi::genNavigationFooter ($q);
|
||||
}
|
||||
|
||||
sub byweight
|
||||
{
|
||||
$esmith::weights [$a] <=> $esmith::weights [$b];
|
||||
}
|
411
root/etc/e-smith/web/functions/userpanelaccess
Normal file
411
root/etc/e-smith/web/functions/userpanelaccess
Normal file
@ -0,0 +1,411 @@
|
||||
#!/usr/bin/perl -wT
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# heading : Security
|
||||
# description : User Panel Access
|
||||
# navigation : 1000 1300
|
||||
#
|
||||
# Copyright (c) 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
# Modified (c) 2002 Stephen Noble <stephen@dungog.net>
|
||||
# Modified (c) 2002 Shad L. Lords <slords@mail.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;
|
||||
use esmith::event;
|
||||
|
||||
sub showInitial ($$);
|
||||
sub genPanels ($$);
|
||||
sub modifyAccess ($);
|
||||
sub performModifyAccess ($);
|
||||
|
||||
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 %accounts;
|
||||
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
|
||||
|
||||
#------------------------------------------------------------
|
||||
# examine state parameter and display the appropriate form
|
||||
#------------------------------------------------------------
|
||||
|
||||
my $q = new CGI;
|
||||
|
||||
if (! grep (/^state$/, $q->param))
|
||||
{
|
||||
showInitial ($q, '');
|
||||
}
|
||||
|
||||
elsif ($q->param ('state') eq "modifyAccess")
|
||||
{
|
||||
modifyAccess ($q);
|
||||
}
|
||||
|
||||
elsif ($q->param ('state') eq "performModifyAccess")
|
||||
{
|
||||
performModifyAccess ($q);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
esmith::cgi::genStateError ($q, \%conf);
|
||||
}
|
||||
|
||||
exit (0);
|
||||
|
||||
#------------------------------------------------------------
|
||||
# subroutine to display initial form
|
||||
#------------------------------------------------------------
|
||||
|
||||
sub showInitial ($$)
|
||||
{
|
||||
my ($q, $msg) = @_;
|
||||
|
||||
if ($msg eq '')
|
||||
{
|
||||
esmith::cgi::genHeaderNonCacheable
|
||||
($q, \%conf, 'Change access to server-manager panels for user accounts');
|
||||
}
|
||||
else
|
||||
{
|
||||
esmith::cgi::genHeaderNonCacheable
|
||||
($q, \%conf, 'Operation status report');
|
||||
|
||||
print $q->p ($msg);
|
||||
print $q->hr;
|
||||
}
|
||||
|
||||
my @userAccounts = ('admin');
|
||||
|
||||
foreach (sort keys %accounts)
|
||||
{
|
||||
push (@userAccounts, $_) if (db_get_type(\%accounts, $_) eq "user");
|
||||
}
|
||||
|
||||
foreach (sort keys %accounts)
|
||||
{
|
||||
push (@userAccounts, $_) if (db_get_type(\%accounts, $_) eq "group");
|
||||
}
|
||||
|
||||
unless (scalar @userAccounts)
|
||||
{
|
||||
print $q->p ($q->b ('There are no user accounts in the system.'));
|
||||
}
|
||||
else
|
||||
{
|
||||
my $description = <<END_TEXT;
|
||||
You can modify individual users access to the server-manager
|
||||
panels below by clicking on the link next the account. You can assign
|
||||
panels to the members of a group with their link. Users or Groups
|
||||
in red have some form of extra access. You can globally assign
|
||||
a panel by editing the global account
|
||||
END_TEXT
|
||||
|
||||
print $q->p ($description);
|
||||
|
||||
print $q->p ($q->b ('Current List of User Accounts'));
|
||||
|
||||
print "<table border=1 cellspacing=1 cellpadding=4>";
|
||||
|
||||
print $q->Tr (esmith::cgi::genSmallCell ($q, $q->b ('Account')),
|
||||
esmith::cgi::genSmallCell ($q, $q->b ('Name/Description')),
|
||||
$q->td (' '));
|
||||
|
||||
my $user;
|
||||
|
||||
foreach $user (@userAccounts)
|
||||
{
|
||||
my $name = '';
|
||||
if (db_get_type(\%accounts, $user) eq "group")
|
||||
{
|
||||
$name =db_get_prop(\%accounts, $user, "Description");
|
||||
}
|
||||
else
|
||||
{
|
||||
$name =db_get_prop(\%accounts, $user, "FirstName")." ". db_get_prop(\%accounts, $user, "LastName");
|
||||
}
|
||||
|
||||
my $AdminPanels = db_get_prop(\%accounts, $user, "AdminPanels");
|
||||
$AdminPanels = '' if ! defined ($AdminPanels);
|
||||
|
||||
if ( ! $AdminPanels )
|
||||
{
|
||||
print $q->Tr (esmith::cgi::genSmallCell ($q, $user),
|
||||
esmith::cgi::genSmallCell ($q, $name),
|
||||
esmith::cgi::genSmallCell ($q,
|
||||
$q->a ({href => $q->url (-absolute => 1)
|
||||
. "?state=modifyAccess&acct="
|
||||
. $user}, 'Change Access...')));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $q->Tr (esmith::cgi::genSmallRedCell ($q, $user),
|
||||
esmith::cgi::genSmallRedCell ($q, $name),
|
||||
esmith::cgi::genSmallCell ($q,
|
||||
$q->a ({href => $q->url (-absolute => 1)
|
||||
. "?state=modifyAccess&acct="
|
||||
. $user}, 'Change Access...')));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#global setting
|
||||
if ( ! db_get( \%accounts, 'globalUP') )
|
||||
{
|
||||
db_set(\%accounts, 'globalUP', 'userpanelglobal', { FirstName => 'global user', LastName => 'panel access' });
|
||||
}
|
||||
|
||||
my $AdminPanels = db_get_prop(\%accounts, 'globalUP', "AdminPanels");
|
||||
$AdminPanels = '' if ! defined ($AdminPanels);
|
||||
|
||||
if ( ! $AdminPanels )
|
||||
{
|
||||
print $q->Tr (esmith::cgi::genSmallCell ($q, 'Global'),
|
||||
esmith::cgi::genSmallCell ($q, 'every user'),
|
||||
esmith::cgi::genSmallCell ($q,
|
||||
$q->a ({href => $q->url (-absolute => 1)
|
||||
. "?state=modifyAccess&acct="
|
||||
. 'globalUP'}, 'Change Access...')));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $q->Tr (esmith::cgi::genSmallRedCell ($q, 'Global'),
|
||||
esmith::cgi::genSmallRedCell ($q, 'every user'),
|
||||
esmith::cgi::genSmallCell ($q,
|
||||
$q->a ({href => $q->url (-absolute => 1)
|
||||
. "?state=modifyAccess&acct="
|
||||
. 'globalUP'}, 'Change Access...')));
|
||||
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
esmith::cgi::genFooter ($q);
|
||||
}
|
||||
|
||||
sub genPanels ($$)
|
||||
{
|
||||
my ($q, $user) = @_;
|
||||
|
||||
my %panelshash = ();
|
||||
my @selected = ();
|
||||
my @globalselected = ();
|
||||
|
||||
my @panels;
|
||||
opendir (DIR, "/etc/e-smith/web/functions")
|
||||
|| die "Can't open /etc/e-smith/web/functions directory.\n";
|
||||
push (@panels, sort (grep (!/^(\.|userpanel-initial|userpanel-navigation|userpanel-noframes|pleasewait|index\.cgi|initial\.cgi|navigation|noframes|userpassword)/, readdir(DIR))));
|
||||
closedir (DIR);
|
||||
|
||||
my $panel;
|
||||
foreach $panel (@panels)
|
||||
{
|
||||
$panelshash{$panel} = "Unknown";
|
||||
|
||||
unless (open (RD, "/etc/e-smith/web/functions/$panel"))
|
||||
{
|
||||
warn "Can't open file /etc/e-smith/web/functions/$panel: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
while (<RD>)
|
||||
{
|
||||
if (/^\s*#\s*description\s*:\s*(.+?)\s*$/)
|
||||
{
|
||||
$panelshash{$panel} = $1;
|
||||
}
|
||||
|
||||
last if ( $panelshash{$panel} ne "Unknown" );
|
||||
}
|
||||
close RD;
|
||||
}
|
||||
|
||||
my $userAdminPanels = db_get_prop(\%accounts, $user, 'AdminPanels');
|
||||
$userAdminPanels = '' if ! defined ($userAdminPanels);
|
||||
@selected = split (/,/, $userAdminPanels);
|
||||
|
||||
my $globalAdminPanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
|
||||
$globalAdminPanels = '' if ! defined ($globalAdminPanels);
|
||||
@globalselected = split (/,/, $globalAdminPanels);
|
||||
|
||||
@panels = sort @panels;
|
||||
my $count = scalar @panels;
|
||||
|
||||
my $out = '';
|
||||
|
||||
if ($count > 0)
|
||||
{
|
||||
$out .= '<table border=1 cellspacing=1 cellpadding=4>';
|
||||
|
||||
$out .= $q->Tr ($q->td (' '),
|
||||
esmith::cgi::genSmallCell ($q, $q->b ('Panel')),
|
||||
esmith::cgi::genSmallCell ($q, $q->b ('Description')));
|
||||
|
||||
my $panel;
|
||||
foreach $panel (@panels)
|
||||
{
|
||||
my $checked = "";
|
||||
if (grep (/^$panel$/, @selected) || grep (/^$panel$/, @globalselected))
|
||||
{
|
||||
$checked = "checked";
|
||||
}
|
||||
|
||||
if (grep (/^$panel$/, @globalselected) && ($user ne 'globalUP'))
|
||||
{
|
||||
$out .=
|
||||
$q->Tr (
|
||||
$q->td (
|
||||
"<input type=\"checkbox\""
|
||||
. " name=\"panelAccess\""
|
||||
. " $checked value=\"$panel\">"
|
||||
),
|
||||
esmith::cgi::genSmallRedCell ($q, $panel),
|
||||
esmith::cgi::genSmallRedCell (
|
||||
$q, $panelshash{$panel} . ' (Global)'));
|
||||
} else {
|
||||
$out .=
|
||||
$q->Tr (
|
||||
$q->td (
|
||||
"<input type=\"checkbox\""
|
||||
. " name=\"panelAccess\""
|
||||
. " $checked value=\"$panel\">"
|
||||
),
|
||||
esmith::cgi::genSmallCell ($q, $panel),
|
||||
esmith::cgi::genSmallCell (
|
||||
$q, $panelshash{$panel}));
|
||||
}
|
||||
}
|
||||
|
||||
$out .= '</table>';
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
sub modifyAccess ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
esmith::cgi::genHeaderNonCacheable ($q, \%conf, 'Modify user-manager access');
|
||||
|
||||
print
|
||||
$q->startform (-method => 'POST', -action => $q->url (-absolute => 1));
|
||||
|
||||
my $acct = $q->param ('acct');
|
||||
|
||||
my $username = '';
|
||||
if (db_get_type(\%accounts, $acct) eq "group")
|
||||
{
|
||||
$username =db_get_prop(\%accounts, $acct, "Description");
|
||||
}
|
||||
else
|
||||
{
|
||||
$username =db_get_prop(\%accounts, $acct, "FirstName")." ". db_get_prop(\%accounts, $acct, "LastName");
|
||||
}
|
||||
|
||||
if (db_get(\%accounts, $acct))
|
||||
{
|
||||
|
||||
print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
|
||||
|
||||
$q->Tr (esmith::cgi::genCell ($q, "Account name:"),
|
||||
esmith::cgi::genCell ($q, $acct)),
|
||||
|
||||
$q->Tr (esmith::cgi::genCell ($q, "Name/Description:"),
|
||||
esmith::cgi::genCell ($q, "$username")),
|
||||
|
||||
$q->Tr (esmith::cgi::genCell ($q, "Accessible Panels:"),
|
||||
esmith::cgi::genCell ($q, genPanels ($q, $acct))),
|
||||
|
||||
esmith::cgi::genButtonRow ($q,
|
||||
$q->submit (-name => 'action',
|
||||
-value => 'Modify')));
|
||||
|
||||
print $q->hidden (-name => 'acct',
|
||||
-override => 1,
|
||||
-default => $acct);
|
||||
|
||||
print $q->hidden (-name => 'state',
|
||||
-override => 1,
|
||||
-default => 'performModifyAccess');
|
||||
|
||||
}
|
||||
|
||||
print $q->endform;
|
||||
esmith::cgi::genFooter ($q);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sub performModifyAccess ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
my $acct = $q->param ('acct');
|
||||
|
||||
my @adminPanels = $q->param ('panelAccess');
|
||||
my @userPanels = ();
|
||||
|
||||
my $globalAdminPanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
|
||||
$globalAdminPanels = '' if ! defined ($globalAdminPanels);
|
||||
my @globalselected = split (/,/, $globalAdminPanels);
|
||||
|
||||
foreach my $panel (@adminPanels)
|
||||
{
|
||||
if ( ! grep (/^$panel$/, @globalselected) || ($acct eq 'globalUP'))
|
||||
{
|
||||
push(@userPanels, $panel);
|
||||
}
|
||||
}
|
||||
|
||||
my $adminPanels = join (',', @userPanels);
|
||||
|
||||
db_set_prop(\%accounts, $acct, 'AdminPanels', $adminPanels);
|
||||
|
||||
system ("/sbin/e-smith/signal-event", "conf-userpanel") == 0
|
||||
or die ("Error occurred while updating userpanel configuration.\n");
|
||||
|
||||
showInitial ($q, "Successfully modified user account $acct.");
|
||||
}
|
3
root/etc/e-smith/web/panels/user/access.incl
Normal file
3
root/etc/e-smith/web/panels/user/access.incl
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
}
|
||||
|
35
root/etc/e-smith/web/panels/user/html/index.html
Normal file
35
root/etc/e-smith/web/panels/user/html/index.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>SME Server / user </TITLE>
|
||||
</HEAD>
|
||||
|
||||
<FRAMESET FRAMESPACING="0" COLS="170,*" FRAMEBORDER="0" BORDER="0">
|
||||
|
||||
<FRAME NAME="navigation" RESIZE="auto" MARGINHEIGHT="0" SRC="/user-manager/cgi-bin/userpanel-navigation"
|
||||
FRAMEBORDER="no" SCROLLING="auto" MARGINWIDTH="0" BORDER="0">
|
||||
|
||||
<FRAME NAME="main" RESIZE="auto" MARGINHEIGHT="0" SRC="/user-manager/cgi-bin/userpanel-initial"
|
||||
FRAMEBORDER="no" SCROLLING="auto" MARGINWIDTH="0" BORDER="0">
|
||||
|
||||
</FRAMESET>
|
||||
|
||||
<NOFRAMES>
|
||||
<BODY>
|
||||
|
||||
<H1>Welcome to the user manager panel</H1>
|
||||
|
||||
<P><A HREF="/user-manager/cgi-bin/userpanel-noframes">Click here</A> for a
|
||||
list of available functions.
|
||||
|
||||
<P>As part of our commitment to open-source software, you are welcome
|
||||
to copy and redistribute this software.
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</NOFRAMES>
|
||||
|
||||
</HTML>
|
564
root/usr/share/perl5/vendor_perl/esmith/cgi5.pm
Normal file
564
root/usr/share/perl5/vendor_perl/esmith/cgi5.pm
Normal file
@ -0,0 +1,564 @@
|
||||
#!/usr/bin/perl -wT
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# copyright (C) 2002 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::cgi5;
|
||||
|
||||
use strict;
|
||||
use esmith::config;
|
||||
use esmith::db;
|
||||
use esmith::util;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
esmith::cgi - Useful CGI routines for e-smith server and gateway
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
This file documents C<esmith::cgi> version B<1.4.0>
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use esmith::cgi;
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module contains a collection of useful routines for working with
|
||||
the e-smith manager's CGI interface.
|
||||
|
||||
=head1 WEB PAGE HEADER GENERATION ROUTINES
|
||||
|
||||
=head2 genHeaderNonCacheable($q, $confref, $title)
|
||||
|
||||
=cut
|
||||
|
||||
sub genHeaderNonCacheable ($$$)
|
||||
{
|
||||
my ($q, $confref, $title) = @_;
|
||||
genHeader ($q, $confref, $title, '-20y', 1);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genHeaderCacheableNoPasswordCheck($q, $confref, $title)
|
||||
|
||||
=cut
|
||||
|
||||
sub genHeaderCacheableNoPasswordCheck ($$$)
|
||||
{
|
||||
my ($q, $confref, $title) = @_;
|
||||
genHeader ($q, $confref, $title, '+1d', 0);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genHeaderCacheableNoPasswordCheck($q, $confref, $title)
|
||||
|
||||
=cut
|
||||
|
||||
sub genHeaderNonCacheableNoPasswordCheck ($$$)
|
||||
{
|
||||
my ($q, $confref, $title) = @_;
|
||||
genHeader ($q, $confref, $title, '-20y', 0);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genHeader($q, $confref, $title, $expiry, $checkpassword)
|
||||
|
||||
=cut
|
||||
|
||||
sub genHeader ($$$$$)
|
||||
{
|
||||
my ($q, $confref, $title, $expiry, $checkpassword) = @_;
|
||||
|
||||
print $q->header (-EXPIRES => $expiry);
|
||||
|
||||
genHeaderStartHTML ($q);
|
||||
|
||||
print $q->table ({-BORDER => "0",
|
||||
-CELLSPACING => "0",
|
||||
-CELLPADDING => "1",
|
||||
-WIDTH => "100%",
|
||||
-ALIGN => "LEFT"},
|
||||
$q->Tr ({-VALIGN => "BOTTOM"},
|
||||
$q->td ({-BACKGROUND
|
||||
=> "/server-common/banner-shim.gif",},
|
||||
)));
|
||||
print $q->br ({-CLEAR => 'ALL'});
|
||||
print $q->div ({-STYLE =>
|
||||
'position: absolute; visibility: inherit; top: 10px; left:' .
|
||||
' 16px; width: 85%; z-index: 2'});
|
||||
|
||||
|
||||
print '<FONT FACE="Helvetica,Arial">';
|
||||
|
||||
if ($checkpassword)
|
||||
{
|
||||
if (defined db_get($confref ,'PasswordSet') &&
|
||||
db_get($confref ,'PasswordSet') ne 'yes')
|
||||
{
|
||||
print $q->div ({-STYLE => 'color: #FF3E00'},
|
||||
$q->h5 ('Warning: you have not yet changed the default system password.'));
|
||||
}
|
||||
|
||||
my $TelnetAccess = db_get_prop($confref, 'telnet', 'access') ||'';
|
||||
my $TelnetMode = db_get_prop($confref, 'telnet', 'status') || '';
|
||||
if ($TelnetAccess eq 'public' && $TelnetMode eq 'enabled')
|
||||
{
|
||||
print $q->div ({-STYLE => 'color: #FF3E00'},
|
||||
$q->h5 ('Warning: the current security settings permit public telnet access.'));
|
||||
}
|
||||
}
|
||||
|
||||
print $q->h2 ($title);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNavigationHeader($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genNavigationHeader ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print $q->header (-EXPIRES => '-20y');
|
||||
|
||||
genHeaderStartHTML ($q);
|
||||
|
||||
print $q->a ({-HREF => 'http://www.mitel.com/', -TARGET => '_top'},
|
||||
$q->img ({-BORDER => '0',
|
||||
-ALT => 'Mitel Networks Logo',
|
||||
-ALIGN => 'top',
|
||||
-SRC => '/server-common/mitel_logo.jpg'}));
|
||||
print $q->div ({-STYLE => 'position: absolute; visibility: inherit; top: 100px; left: 10px; z-index: 2'});
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNoframesHeader($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genNoframesHeader ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print $q->header (-EXPIRES => '-20y');
|
||||
genHeaderStartHTML ($q);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genHeaderStartHTML($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genHeaderStartHTML ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print $q->start_html (-TITLE => 'SME Server manager',
|
||||
-AUTHOR => 'bugs@e-smith.com',
|
||||
-META => {'copyright' => 'Copyright 2002 Mitel Networks Corporation'},
|
||||
-STYLE =>
|
||||
{-src => '/server-common/css/manager.css'},
|
||||
-BGCOLOR => '#FFFFFF',
|
||||
-LINK => '#707070',
|
||||
-VLINK => '#707070',
|
||||
-ALINK => '#707070',
|
||||
-TEXT => '#000000',
|
||||
-MARGINWIDTH => '0',
|
||||
-MARGINHEIGHT => '0',
|
||||
-LEFTMARGIN => '0',
|
||||
-TOPMARGIN => '0');
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head1 WEB PAGE FOOTER GENERATION ROUTINES
|
||||
|
||||
=head2 genFooter($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genFooter ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
my $release = esmith::util::determineRelease();
|
||||
|
||||
print $q->p ($q->hr, $q->font ({size => "-1"},
|
||||
"SME Server V${release}<BR>" .
|
||||
"All rights reserved by their respective owners. ")
|
||||
);
|
||||
|
||||
print '</FONT>';
|
||||
print '</DIV>';
|
||||
print $q->end_html;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genFooterNoCopyright($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genFooterNoCopyright ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print $q->p ($q->hr);
|
||||
|
||||
print '</FONT>';
|
||||
print '</DIV>';
|
||||
print $q->end_html;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNavigationFooter($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genNavigationFooter ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print '</DIV>';
|
||||
print $q->end_html;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNoframesFooter($q)
|
||||
|
||||
=cut
|
||||
|
||||
sub genNoframesFooter ($)
|
||||
{
|
||||
my ($q) = @_;
|
||||
|
||||
print $q->end_html;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head1 FONT ROUTINES
|
||||
|
||||
=head2 curFont()
|
||||
|
||||
Returns the preferred font faces eg. "Helvetica,Arial".
|
||||
|
||||
=cut
|
||||
|
||||
sub curFont ()
|
||||
{
|
||||
return "Helvetica,Arial";
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head1 TABLE GENERATION ROUTINES
|
||||
|
||||
=head2 genCell($q, $text)
|
||||
|
||||
=cut
|
||||
|
||||
sub genCell ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td ($q->font ({face => "Helvetica,Arial"}, $text));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genDoubleCell($q, $text);
|
||||
|
||||
Generates a cell which spans two columns, containing the text specified.
|
||||
|
||||
=cut
|
||||
|
||||
sub genDoubleCell ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td ({colspan => 2}, $q->font ({face => "Helvetica,Arial"}, $text));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genSmallCell($q, $text)
|
||||
|
||||
Generates a cell with "small" text (font size -1).
|
||||
|
||||
=cut
|
||||
|
||||
sub genSmallCell ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td ($q->font ({size => -1, face => "Helvetica,Arial"}, $text));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genSmallCellCentered($q, $text)
|
||||
|
||||
Generates a cell with "small" text (font size -1).
|
||||
Center the contents.
|
||||
|
||||
=cut
|
||||
|
||||
sub genSmallCellCentered ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td ({ align => 'center' },
|
||||
$q->font ({size => -1, face => "Helvetica,Arial"}, $text));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genSmallCellRightJustified($q, $text)
|
||||
|
||||
Generates a cell with "small" text (font size -1).
|
||||
Right justify the contents.
|
||||
|
||||
=cut
|
||||
|
||||
sub genSmallCellRightJustified ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td ({ align => 'right' },
|
||||
$q->font ({size => -1, face => "Helvetica,Arial"}, $text));
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genSmallRedCell($q, $text)
|
||||
|
||||
Generates a cell with "small" (font size -1) red text.
|
||||
|
||||
=cut
|
||||
|
||||
sub genSmallRedCell ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->td
|
||||
($q->font ({size => -1, face => "Helvetica,Arial", color => "Red"},
|
||||
$q->i ($text)));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genTextRow($q, $text)
|
||||
|
||||
Returns a table row containing a two-column cell containing $text.
|
||||
|
||||
=cut
|
||||
|
||||
sub genTextRow ($$)
|
||||
{
|
||||
my ($q, $text) = @_;
|
||||
|
||||
if ($text =~ /^\s*$/)
|
||||
{
|
||||
$text = " "
|
||||
}
|
||||
|
||||
return $q->Tr ($q->td ({colspan => 2}, $q->font ({face => "Helvetica,Arial"}, $text)));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genButtonRow($q, $button)
|
||||
|
||||
Returns a table row containing an empty first cell and a second cell
|
||||
containing a button with the value $button.
|
||||
|
||||
=cut
|
||||
|
||||
sub genButtonRow ($$)
|
||||
{
|
||||
my ($q, $button) = @_;
|
||||
|
||||
return $q->Tr ($q->td (' '),
|
||||
$q->td ($q->font ({face => "Helvetica,Arial"}, $q->b ($button))));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNameValueRow($q, $fieldlabel, $fieldname, $fieldvalue)
|
||||
|
||||
Returns a table row with two cells. The first has the text
|
||||
"$fieldlabel:" in it, and the second has a text field with the default
|
||||
value $fieldvalue and the name $fieldname.
|
||||
|
||||
=cut
|
||||
|
||||
sub genNameValueRow ($$$$)
|
||||
{
|
||||
my ($q, $fieldlabel, $fieldname, $fieldvalue) = @_;
|
||||
|
||||
return $q->Tr ($q->td ($q->font ({face => "Helvetica,Arial"}, "$fieldlabel:")),
|
||||
$q->td ($q->font ({face => "Helvetica,Arial"}, $q->textfield (-name => $fieldname,
|
||||
-override => 1,
|
||||
-default => $fieldvalue,
|
||||
-size => 32))));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genNamePasswordRow($q, $fieldlabel, $fieldname, $fieldvalue)
|
||||
|
||||
As for C<genNameValueRow()> above, but instead of a text field it
|
||||
generates a password field so that user input is obscured.
|
||||
|
||||
Possible buglet: if $fieldvalue is given, the password field defaults to
|
||||
this value, so the number of stars may indicate to the end-user what the
|
||||
previous value was.
|
||||
|
||||
=cut
|
||||
|
||||
sub genNamePasswdRow ($$$$)
|
||||
{
|
||||
my ($q, $fieldlabel, $fieldname, $fieldvalue) = @_;
|
||||
|
||||
return $q->Tr ($q->td ($q->font ({face => "Helvetica,Arial"}, "$fieldlabel:")),
|
||||
$q->td ($q->font ({face => "Helvetica,Arial"}, $q->password_field (-name => $fieldname,
|
||||
-override => 1,
|
||||
-default => $fieldvalue,
|
||||
-size => 32))));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
sub genWidgetRow($q, $fieldlabel, $popup)
|
||||
|
||||
=cut
|
||||
|
||||
sub genWidgetRow ($$$)
|
||||
{
|
||||
my ($q, $fieldlabel, $popup) = @_;
|
||||
|
||||
return $q->Tr ($q->td ($q->font ({face => "Helvetica,Arial"}, "$fieldlabel:")),
|
||||
$q->td ($q->font ({face => "Helvetica,Arial"}, $popup)));
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head1 STATUS AND ERROR REPORT GENERATION ROUTINES
|
||||
|
||||
=head2 genResult($q, $msg)
|
||||
|
||||
Generates a "status report" page, including the footer
|
||||
|
||||
=cut
|
||||
|
||||
sub genResult ($$)
|
||||
{
|
||||
my ($q, $msg) = @_;
|
||||
|
||||
print $q->p ($msg);
|
||||
genFooter ($q);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 genStateError($q, $confref)
|
||||
|
||||
Subroutine to generate "unknown state" error message.
|
||||
|
||||
=cut
|
||||
|
||||
sub genStateError ($$)
|
||||
{
|
||||
my ($q, $confref) = @_;
|
||||
|
||||
genHeaderNonCacheable ($q, $confref, "Internal error");
|
||||
genResult ($q, "Internal error! Unknown state: " . $q->param ("state") . ".");
|
||||
}
|
||||
|
||||
END
|
||||
{
|
||||
}
|
||||
|
||||
#------------------------------------------------------------
|
||||
# return "1" to make the import process return success
|
||||
#------------------------------------------------------------
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Mitel Networks Corporation
|
||||
|
||||
For more information, see http://e-smith.org/
|
||||
|
||||
=cut
|
||||
|
443
smeserver-userpanel.spec
Normal file
443
smeserver-userpanel.spec
Normal file
@ -0,0 +1,443 @@
|
||||
# $Id: smeserver-userpanel.spec,v 1.9 2022/12/01 06:43:51 jpp Exp $
|
||||
# Authority: dungog
|
||||
# Name: Stephen Noble
|
||||
|
||||
Summary: Provide a user panel to let users to change delegated server settings.
|
||||
%define name smeserver-userpanel
|
||||
Name: %{name}
|
||||
%define version 1.4
|
||||
%define release 7
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
License: GPL
|
||||
URL: http://wiki.contribs.org
|
||||
Group: SMEserver/addon
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
|
||||
BuildArchitectures: noarch
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Requires: smeserver-release >= 10
|
||||
Requires: e-smith-apache >= 2.6.0-19
|
||||
BuildRequires: e-smith-devtools
|
||||
Obsoletes: e-smith-userpanel
|
||||
AutoReqProv: no
|
||||
|
||||
%description
|
||||
SME Server enhancement to create a user manager panel where users can
|
||||
authenticate with their own username/password and change selected
|
||||
server settings as allowed by admin.
|
||||
Selected User settings can be altered after installing additional
|
||||
userpanels available in seperate rpms.
|
||||
Panels can be delegated at user, group or global levels
|
||||
|
||||
%changelog
|
||||
* Sat Sep 07 2024 cvs2git.sh aka Brian Read <brianr@koozali.org> 1.4-7.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.
|
||||
|
||||
* Thu Dec 01 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.4-6.sme
|
||||
- fix translation not expanded [SME: 10261]
|
||||
- fix httpd admin stopped [SME: 12249]
|
||||
moved actions before template and service actions
|
||||
removed inline expand and restart
|
||||
|
||||
* Tue Nov 22 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.4-5.sme
|
||||
- prevent manager locking on reconfiguration [SME: 12235]
|
||||
|
||||
* Mon Aug 01 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.4-4.sme
|
||||
- update to httpd 2.4 access syntax [SME: 12064]
|
||||
thanks to Vasarhelyi Zsolt
|
||||
- fix call to svc in place of systemctl [SME: 11390]
|
||||
- remove reference to info.txt [SME: 10964]
|
||||
|
||||
* Tue Feb 23 2021 Jean-Philippe Pialasse <tests@pialasse.com> 1.4-3.sme
|
||||
- add -update event to avoid reboot [SME: 11079]
|
||||
also fix detection of userpassword file
|
||||
|
||||
* Mon Nov 02 2020 Michel Begue <mab974@gmail.com> 1.4-2.sme
|
||||
- Initial release for sme10 [SME: 11079]
|
||||
|
||||
* Wed May 31 2017 Jean-Philippe Pialasse <tests@pialasse.com> 1.2-3.sme
|
||||
- rebuild archive to fix [SME: 8026]
|
||||
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
||||
by assuming the date is correct and changing the weekday.
|
||||
|
||||
* Tue May 30 2017 Jean-Philippe Pialasse <tests@pialasse.com> 1.1-8.sme
|
||||
- fix bad redirection on logout or timeout [SME: 8026]
|
||||
|
||||
* Tue Jul 19 2016 Jean-Philippe Pialasse <tests@pialasse.com> 1.1-6.sme
|
||||
- adapt to the new color of manager for Koozali [SME: 9678]
|
||||
- thanks to John Crisp for this great work.
|
||||
|
||||
* Thu Oct 15 2015 Michel Begue <mab974@gmail.com> 1.1-5.sme
|
||||
- Add an alias in db key for userpanel [SME:9093]
|
||||
|
||||
* Sat Aug 22 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 1.1-3.sme
|
||||
- Initial release to contribs9
|
||||
|
||||
* Tue Aug 19 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 1.1-2.sme
|
||||
- corrected a prototype called too early [SME:8534]
|
||||
- removed all prototypes of file userpanel-navigation
|
||||
|
||||
* Mon Jun 23 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 1.1-1.sme
|
||||
- Initial release to sme9
|
||||
|
||||
* Sun Dec 15 2013 JP Pialasse <tests@pialasse.com> 0.9-16.sme
|
||||
- move post to an action event [SME: 8032]
|
||||
|
||||
* Mon Dec 2 2013 JP Pialasse <tests@pialasse.com> 0.9-13.sme
|
||||
- reverting language links creation in post as temp fix. see Bugs 8032 and 8022
|
||||
- final fix will depends on 8032 int he future
|
||||
|
||||
* Thu Nov 28 2013 JP Pialasse <tests@pialasse.com> 0.9-12.sme
|
||||
- NFR: logout button [SME: 8022]
|
||||
- NFR: show username [SME: 8025]
|
||||
- should fix 500 error by adding action in most events [SME: 7667]
|
||||
- spec file tidying
|
||||
|
||||
* Sun Feb 17 2008 Stephen Noble <support@dungog.net> 0.9-11
|
||||
- remove pleasewait hack [SME: 126]
|
||||
|
||||
* Mon Feb 5 2007 Stephen Noble <support@dungog.net> 0.9-10
|
||||
- redirect to https [sme 1879]
|
||||
- Adjust to work on sme 7.1.1 [sme 2419]
|
||||
- thanks John Bennett
|
||||
|
||||
* Mon Oct 30 2006 Stephen Noble <support@dungog.net> 0.9-9
|
||||
- shorten /user-manager to /user
|
||||
- delegate rights with a group [sme 1748]
|
||||
|
||||
* Sun Oct 29 2006 Stephen Noble <support@dungog.net> 0.9-8
|
||||
- bugfix for navigation frame
|
||||
|
||||
* Sat Oct 28 2006 Stephen Noble <support@dungog.net>
|
||||
- i18n support for navigation frame [sme 2009]
|
||||
- [0.9-7]
|
||||
|
||||
* Thu Oct 26 2006 Stephen Noble <support@dungog.net>
|
||||
- german and italian language support [sme 2008]
|
||||
- [0.9-6]
|
||||
|
||||
* Mon Feb 13 2006 Stephen Noble <support@dungog.net>
|
||||
- remove Provides e-smith-userpanel, for sme7 pre release 2
|
||||
- [0.9-5]
|
||||
|
||||
* Wed Sep 21 2005 Stephen Noble <support@dungog.net>
|
||||
- for sme7 beta
|
||||
- [0.9-4]
|
||||
|
||||
* Sun Aug 21 2005 Stephen Noble <support@dungog.net>
|
||||
- perl-Unicode-String dependancy removed
|
||||
- [0.9-3]
|
||||
|
||||
* Wed Aug 10 2005 Stephen Noble <support@dungog.net>
|
||||
- removed all userpanels, these are in smeserver-userpanel-*
|
||||
- /home/e-smith/db/accounts relocated
|
||||
- for sme7 alpha
|
||||
- [0.9-2]
|
||||
|
||||
* Sat Jun 18 2005 Stephen Noble <support@dungog.net>
|
||||
- renamed rpm smeserver-userpanel
|
||||
- user admin can be delegated hidden panels in userpanelaccess
|
||||
- option to use maildrop instead of procmail
|
||||
- new setting to enable procmail and/or mailfilter
|
||||
- db set accounts USER procmail|mailfilter enabled [individually]
|
||||
- db set configuration MailFilter service procmail|mailfilter enabled [global[if above unset]]
|
||||
- [0.9-1]
|
||||
|
||||
* Sat Jun 18 2005 Stephen Noble <support@dungog.net>
|
||||
- Allows for: e-smith-release >= 7.0
|
||||
- sme7 RequireSSL -> SSLRequireSSL [Gordon Rowell]
|
||||
- passwords can be stricter [Lorenzo Fascì]
|
||||
- sme6 /sbin/e-smith/db configuration setprop passwordstrength User none|normal|strong
|
||||
- sme7 /sbin/e-smith/db configuration setprop passwordstrength Users none|normal|strong
|
||||
- merged dungog-useraccounts, new function userpanel-useraccounts
|
||||
- http://www.dungog.net/sme/changelog/useraccounts.txt
|
||||
- delegated user account creation with limits
|
||||
- sme5 manager.css added
|
||||
- 26autoreply altered to leave autoreplied email in the inbox
|
||||
- sme7 IMAP changed from /;junkmail to /.junkmail, check all your procmail rules !!
|
||||
- perl-Unicode-IMAPUtf7 dependancy/support removed
|
||||
- [1.6.5-3]
|
||||
|
||||
* Thu May 26 2005 Stephen Noble <support@dungog.net>
|
||||
- vacation if enabled is run first
|
||||
- test for invalid forwarding addresses
|
||||
- [1.6.5-2]
|
||||
|
||||
* Fri Feb 11 2005 Stephen Noble <support@dungog.net>
|
||||
- change rpm scripts from httpd-* graceful to restart
|
||||
- to allow rpm to install on both SME 6.0 + 6.5
|
||||
- added alias, /user is same as /user-manager
|
||||
- allow remote access to /user, with alt IP range from /server-manager access
|
||||
- /sbin/e-smith/db configuration set httpd-user 188.122.45.122
|
||||
- /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
|
||||
- /etc/rc.d/init.d/httpd-e-smith restart
|
||||
- see also /sbin/e-smith/db configuration show httpd-admin for format
|
||||
- bad things happen if you enter an invalid ip ie>256
|
||||
- remove displayed mitel references and old images
|
||||
- [1.6.5-1]
|
||||
|
||||
* Thu Dec 23 2004 Stephen Noble <support@dungog.net>
|
||||
- cosmetic vacation msg fix re. Dos/Unix new line
|
||||
- [1.6.0-4]
|
||||
|
||||
* Sat Mar 6 2004 Stephen Noble <support@dungog.net>
|
||||
- procmail forward to user fixed
|
||||
- procmail says folder not in correct format fixed
|
||||
- procmail can use 2nd value for closer matching
|
||||
- geek mode hidden, you can set manually with
|
||||
- /sbin/e-smith/db processmail setprop stephen mode geek
|
||||
- [1.6.0-3]
|
||||
|
||||
* Fri Dec 5 2003 Stephen Noble <support@dungog.net>
|
||||
- procmail, supports folders starting with new, cur, tmp
|
||||
thanks Shad Lords
|
||||
- displays sme6 panels correctly
|
||||
thanks Robert Mc Donald
|
||||
- [1.6.0-2]
|
||||
|
||||
* Fri Aug 15 2003 Stephen Noble <support@dungog.net>
|
||||
- SME 6.0 support, this version requires it
|
||||
- supports servermanager navigation & shows tables correctly
|
||||
- procmail writes to dovecoat imap store eg. ~/Maildir/;junkmail
|
||||
- many other changes
|
||||
- [1.6.0-1]
|
||||
|
||||
* Wed May 21 2003 Stephen Noble <support@dungog.net>
|
||||
Thu May 21 2003 --> Thu May 15 2003 or Wed May 21 2003 or Thu May 22 2003 or ....
|
||||
- Fix 90e-smithAccess30user, httpd failed with 500?+ users
|
||||
- [1.0-11]
|
||||
|
||||
* Thu Mar 6 2003 Stephen Noble <support@dungog.net>
|
||||
- Fix 23autoreply, wasn't stopping looping to self
|
||||
- [1.0-10]
|
||||
|
||||
* Mon Dec 16 2002 Stephen Noble <support@dungog.net>
|
||||
- Fix /usr.../vacation, saved in dos not unix
|
||||
- [1.0-9]
|
||||
|
||||
* Thu Dec 12 2002 Stephen Noble <support@dungog.net>
|
||||
- mkdir -p user/cgi-bin in spec for new installs
|
||||
- [1.0-8]
|
||||
|
||||
* Tue Dec 10 2002 Stephen Noble <support@dungog.net>
|
||||
- Fix actions, saved in dos not unix
|
||||
- userpanel-backup changed default file save as name to username
|
||||
- [1.0-7]
|
||||
|
||||
* Fri Nov 29 2002 Stephen Noble <support@dungog.net>
|
||||
- userpanel-forwarding modified to allow empty fwd address
|
||||
- [1.0-6]
|
||||
|
||||
* Thu Nov 28 2002 Shad Lords <slords@mail.com>
|
||||
- changed directive for externalSSLAccess to strip /255.255.255.255
|
||||
- [1.0-5]
|
||||
|
||||
* Thu Oct 03 2002 Shad Lords <slords@mail.com>
|
||||
- fixed ordering of panels a little more to make them alphabetical
|
||||
- [1.0-4]
|
||||
|
||||
* Thu Oct 03 2002 Shad Lords <slords@mail.com>
|
||||
- Cleaned up .procmailrc header
|
||||
- [1.0-3]
|
||||
|
||||
* Wed Oct 02 2002 Shad Lords <slords@mail.com>
|
||||
- Updated requires to include the Unicode packages for imap folders
|
||||
- [1.0-2]
|
||||
|
||||
* Tue Oct 01 2002 Shad Lords <slords@mail.com>
|
||||
- Combined all user-manager panels into 1 package
|
||||
- Fixed user-manager.jpg to show on all panels (except pleasewait)
|
||||
- updated userpanel-forward to check for procmail enabled
|
||||
- updated userpanel-autoreply to check for procmail enabled
|
||||
- [1.0-1]
|
||||
|
||||
* Mon Sep 30 2002 Shad Lords <slords@mail.com>
|
||||
- Fixed another bug with global panels (needed AdminPanels)
|
||||
- added externalSSLAccess to allow from for external access
|
||||
- added RequireSSL on to the user-manager directive
|
||||
- fixed user-manager.jpg to correct version
|
||||
- [0.3-6]
|
||||
|
||||
* Mon Sep 23 2002 Stephen Noble <support@dungog.net>
|
||||
- userpanel-forwarding tests if procmail fragments are installed
|
||||
- renumbered navigation in userpanels to display alphabetically and match initial
|
||||
- [0.3-5]
|
||||
|
||||
* Sun Sep 22 2002 Shad Lords <slords@mail.com>
|
||||
- added userpanel- panels into list to choose from
|
||||
- added default globalUP panels to all userpanel- panels
|
||||
- added indication in user panels to which global panels are active
|
||||
- added routine to display desc and longdesc to userpanel-initial
|
||||
- [0.3-4]
|
||||
|
||||
* Sat Sep 21 2002 Shad Lords <slords@mail.com>
|
||||
- helps if you actually include your changes (userpanelaccess) ;)
|
||||
- excluded a few more web functions per Darrell May.
|
||||
- [0.3-3]
|
||||
|
||||
* Sat Sep 21 2002 Shad Lords <slords@mail.com>
|
||||
- fixed permission for global user panels
|
||||
- added userpanel-* back into navigation
|
||||
- fixed userpanel-noframes to use globals
|
||||
- fixed userpanelaccess to look in functions for panels
|
||||
- fixed conf-userpanelsymlinks to only create needed panels
|
||||
- cleaned up some of the userpanel- titles for consistency
|
||||
- fixed userpanel-initial to look for userpanel-procmail instead of dungog-procmail
|
||||
- removed ^M from admin-conf templates
|
||||
- added devinfo-mitel-userpanel-autoreply to obsoletes
|
||||
- [0.3-2]
|
||||
|
||||
* Sat Sep 21 2002 Stephen Noble <support@dungog.net>
|
||||
- only gives users access after admin assigns panel
|
||||
- admin can assign a panel to all users via userpanelaccess
|
||||
- merged updated userpanels for userpanelaccess, e-smith-userpanel-vacation,
|
||||
e-smith-userpanel-config, dungog-autoreply and dungog-userbackup
|
||||
- updated userpanel-password,forward,navigation,inital)
|
||||
- added usermanager.jpg
|
||||
- [0.3-1]
|
||||
|
||||
* Mon Jan 07 2002 Daniel van Raay <danielvr@caa.org.au>
|
||||
- fixed bug in 90e-smithAccess30user while maintaining '<Files>' directives
|
||||
for security purposes
|
||||
- [0.2-5]
|
||||
|
||||
* Sun Jan 06 2002 Darrell May <dmay@netsourced.com>
|
||||
- fixed bug in 90e-smithAccess30user
|
||||
- [0.2-4]
|
||||
|
||||
* Sun Jan 06 2002 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.2-3]
|
||||
- added all the panels to the default AvailablePanels setting
|
||||
- modified the default navigation heading weights
|
||||
|
||||
* Sun Jan 06 2002 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.2-2]
|
||||
- fixed bug in conf-userpanel event
|
||||
|
||||
* Sat Jan 05 2002 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.2-1]
|
||||
- tidy up /etc/e-smith/templates/etc/httpd/admin-conf/httpd.conf/90e-smithAccess30user
|
||||
- added initial support for additional 'AdminPanels' for users that need access to
|
||||
one or a few of the server-manager panels only
|
||||
- changed 'Email' and 'Password' to 'Your Email' and 'Your Password'
|
||||
|
||||
* Wed Jan 02 2002 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-12]
|
||||
- added manual redirect httpd.conf fragment for user-manager under e-smith 4.1.2
|
||||
- stopped templates from adding ProxyPass directives under e-smith 4.1.2
|
||||
so that the redirects will work properly
|
||||
|
||||
* Tue Jan 01 2002 Darrell May <dmay@netsourced.com>
|
||||
- [0.1-11]
|
||||
- edit initial.html to support name change of userpanel-procmail to userpanel-processmail
|
||||
|
||||
* Sun Dec 30 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-10]
|
||||
- improved (cosmetic) compatibility with e-smith 4.1.2, SME 5.0, SME 5.1
|
||||
- rolled in Darrell's cosmetic changes to initial page with checks to
|
||||
see if e-smith-procmail and/or e-smith-vacation are installed
|
||||
|
||||
* Tue Dec 25 2001 Darrell May <dmay@netsourced.com>
|
||||
- [0.1-9]
|
||||
- updated initial.html
|
||||
|
||||
* Mon Dec 24 2001 Darrell May <dmay@netsourced.com>
|
||||
- [0.1-8]
|
||||
- minor cosmetic changes to the password panel for SME5.1B3
|
||||
|
||||
* Sat Oct 20 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-7]
|
||||
- minor cosmetic changes to the password panel
|
||||
|
||||
* Fri Oct 19 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-6]
|
||||
- actually build the RPM properly to include [0.1-6] changes ;)
|
||||
|
||||
* Thu Oct 11 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-5]
|
||||
- added alias for access via http://servername/user-manager/
|
||||
- cosmetic changes to refer to the panels as 'User Manager' instead of 'e-smith user'
|
||||
|
||||
* Sat Sep 22 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-4]
|
||||
- fixed minor cosmetic problem with front page when accessed through ProxyPass
|
||||
|
||||
* Fri Sep 21 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-3]
|
||||
- updated for compatibility with SME Sever V5
|
||||
|
||||
* Wed Sep 19 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-2]
|
||||
- added post (un)install scripts to expand/reload the relevant templates/services
|
||||
|
||||
* Tue Sep 04 2001 Daniel van Raay <danielvr@caa.org.au>
|
||||
- [0.1-1]
|
||||
- initial release
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
perl createlinks
|
||||
|
||||
mkdir -p root/etc/e-smith/web/panels/user/cgi-bin
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
|
||||
rm -f %{name}-%{version}-filelist
|
||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||||
|grep -v 'logout-user'> %{name}-%{version}-filelist
|
||||
echo "%doc COPYING" >> %{name}-%{version}-filelist
|
||||
echo '%attr(0755,root,admin) /etc/e-smith/web/common/cgi-bin/logout-user'>> %{name}-%{version}-filelist
|
||||
|
||||
%clean
|
||||
#cd ..
|
||||
#rm -rf %{name}-%{version}
|
||||
|
||||
%pre
|
||||
%preun
|
||||
|
||||
%post
|
||||
# dirty workaround to fix the index and multiple login windows
|
||||
/bin/touch /etc/e-smith/web/panels/user/html/index.html
|
||||
|
||||
#/sbin/e-smith/expand-template /etc/httpd/admin-conf/httpd.conf
|
||||
#/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
|
||||
#/usr/local/bin/svc -h /service/httpd-admin
|
||||
#/usr/local/bin/svc -h /service/httpd-e-smith
|
||||
|
||||
#needs script to find existing languages
|
||||
#upgrades (and new installs) should be in new but existing users may miss some lexicons
|
||||
#should have in build not post
|
||||
# or better move as action in events, this way we could update any languages.
|
||||
#for lang in en-us fr es it de sv pt sl nl #el id
|
||||
#do
|
||||
#/bin/mkdir -p /etc/e-smith/locale/$lang/etc/e-smith/web/panels/user
|
||||
#/bin/ln -sf /etc/e-smith/locale/$lang/etc/e-smith/web/functions /etc/e-smith/locale/$lang/etc/e-smith/web/panels/user/cgi-bin
|
||||
#done
|
||||
|
||||
#/sbin/e-smith/signal-event conf-userpanel
|
||||
|
||||
%postun
|
||||
#uninstall
|
||||
#if [ $1 = 0 ] ; then
|
||||
# /sbin/e-smith/expand-template /etc/httpd/admin-conf/httpd.conf
|
||||
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
|
||||
# /usr/local/bin/svc -h /service/httpd-admin
|
||||
# /usr/local/bin/svc -h /service/httpd-e-smith
|
||||
|
||||
# #this has moved ?fixme?
|
||||
# DBS=`find /home/e-smith/db/navigation -type f -name "navigation.*"`
|
||||
# for db in $DBS ; do
|
||||
# /sbin/e-smith/db $db delete userpanelaccess
|
||||
# done
|
||||
#fi
|
||||
|
||||
%files -f %{name}-%{version}-filelist
|
||||
%defattr(-,root,root)
|
Loading…
Reference in New Issue
Block a user