Compare commits

..

1 Commits

Author SHA1 Message Date
Florian Aders (EleRas)
973d45ca06 Tagging release 0.9.3 2010-03-15 07:59:17 +00:00
376 changed files with 4192 additions and 14289 deletions

562
COPYING
View File

@@ -1,281 +1,281 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA 675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free 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 software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to the GNU Library General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for 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 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 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. in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid 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. anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it. distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether 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 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 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 source code. And you must show them these terms so they know their
rights. rights.
We protect your rights with two steps: (1) copyright the software, and We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy, (2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software. distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we 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 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 that any problems introduced by others will not reflect on the original
authors' reputations. authors' reputations.
Finally, any free program is threatened constantly by software Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any 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. patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below, 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" 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: 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, that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you". the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program). Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does. Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's 1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty; 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 and give any other recipients of the Program a copy of this License
along with the Program. along with the Program.
You may charge a fee for the physical act of transferring a copy, and 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. 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 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 of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions: above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change. 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 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 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 part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License. parties under the terms of this License.
c) If the modified program normally reads commands interactively c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on does not normally print such an announcement, your work based on
the Program is not required to print an announcement.) the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program, identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you 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 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 on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it. 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 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 your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or exercise the right to control the distribution of derivative or
collective works based on the Program. collective works based on the Program.
In addition, mere aggregation of another work not 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 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 a storage or distribution medium does not bring the other work under
the scope of this License. the scope of this License.
3. You may copy and distribute the Program (or a work based on it, 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 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: Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or, 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 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 years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or, customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such received the program in object code or executable form with such
an offer, in accord with Subsection b above.) an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component operating system on which the executable runs, unless that component
itself accompanies the executable. itself accompanies the executable.
If distribution of executable or object code is made by offering If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not distribution of the source code, even though third parties are not
compelled to copy the source along with the object code. compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License. void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such this License will not have their licenses terminated so long as such
parties remain in full compliance. parties remain in full compliance.
5. You are not required to accept this License, since you have not 5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying all its terms and conditions for copying, distributing or modifying
the Program or works based on it. the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the 6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to You are not responsible for enforcing compliance by third parties to
this License. this License.
7. If, as a consequence of a court judgment or allegation of patent 7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then 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 the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program. refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other apply and the section as a whole is intended to apply in other
circumstances. circumstances.
It is not the purpose of this section to induce you to infringe any 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 patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is integrity of the free software distribution system, which is
implemented by public license practices. Many people have made implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that 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 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 to distribute software through any other system and a licensee cannot
impose that choice. impose that choice.
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License. be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License. the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions 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 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 be similar in spirit to the present version, but may differ in detail to
address new problems or concerns. address new problems or concerns.
Each version is given a distinguishing version number. If the Program Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any 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 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 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 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 this License, you may choose any version ever published by the Free Software
Foundation. Foundation.
10. If you wish to incorporate parts of the Program into other free 10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals 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 preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS 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 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION. REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 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 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, REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 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 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 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 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS

View File

@@ -77,24 +77,6 @@ return array(
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'panel_adminmail_defname' => array(
'label' => $lng['serversettings']['adminmail_defname'],
'settinggroup' => 'panel',
'varname' => 'adminmail_defname',
'type' => 'string',
'default' => 'Froxlor Administrator',
'save_method' => 'storeSettingField',
),
'panel_adminmail_return' => array(
'label' => $lng['serversettings']['adminmail_return'],
'settinggroup' => 'panel',
'varname' => 'adminmail_return',
'type' => 'string',
'string_type' => 'mail',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'panel_decimal_places' => array( 'panel_decimal_places' => array(
'label' => $lng['serversettings']['decimal_places'], 'label' => $lng['serversettings']['decimal_places'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',

View File

@@ -54,23 +54,6 @@ return array(
'default' => 900, 'default' => 900,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'panel_password_min_length' => array(
'label' => $lng['serversettings']['panel_password_min_length'],
'settinggroup' => 'panel',
'varname' => 'password_min_length',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
),
'panel_password_regex' => array(
'label' => $lng['serversettings']['panel_password_regex'],
'settinggroup' => 'panel',
'varname' => 'password_regex',
'type' => 'string',
'default' => '',
/* 'plausibility_check_method' => 'checkValidRegEx', */
'save_method' => 'storeSettingField',
),
'customer_accountprefix' => array( 'customer_accountprefix' => array(
'label' => $lng['serversettings']['accountprefix'], 'label' => $lng['serversettings']['accountprefix'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',

View File

@@ -58,22 +58,6 @@ return array(
'default' => '', 'default' => '',
'save_method' => 'storeSettingHostname', 'save_method' => 'storeSettingHostname',
), ),
'system_froxlordirectlyviahostname' => array(
'label' => $lng['serversettings']['froxlordirectlyviahostname'],
'settinggroup' => 'system',
'varname' => 'froxlordirectlyviahostname',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_stdsubdomain' => array(
'label' => $lng['serversettings']['stdsubdomainhost'],
'settinggroup' => 'system',
'varname' => 'stdsubdomain',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingHostname',
),
'system_mysql_access_host' => array( 'system_mysql_access_host' => array(
'label' => $lng['serversettings']['mysql_access_host'], 'label' => $lng['serversettings']['mysql_access_host'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -101,13 +85,17 @@ return array(
'default' => 'html', 'default' => 'html',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_store_index_file_subs' => array( 'system_httpuser' => array(
'label' => $lng['serversettings']['system_store_index_file_subs'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'store_index_file_subs', 'varname' => 'httpuser',
'type' => 'bool', 'type' => 'hidden',
'default' => true, 'default' => 'www-data',
'save_method' => 'storeSettingField', ),
'system_httpgroup' => array(
'settinggroup' => 'system',
'varname' => 'httpgroup',
'type' => 'hidden',
'default' => 'www-data',
), ),
'system_debug_cron' => array( 'system_debug_cron' => array(
'label' => $lng['serversettings']['cron']['debug'], 'label' => $lng['serversettings']['cron']['debug'],

View File

@@ -31,23 +31,6 @@ return array(
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'), 'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'),
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true
),
'system_httpuser' => array(
'label' => $lng['admin']['webserver_user'],
'settinggroup' => 'system',
'varname' => 'httpuser',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
),
'system_httpgroup' => array(
'label' => $lng['admin']['webserver_group'],
'settinggroup' => 'system',
'varname' => 'httpgroup',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
), ),
'system_apacheconf_vhost' => array( 'system_apacheconf_vhost' => array(
'label' => $lng['serversettings']['apacheconf_vhost'], 'label' => $lng['serversettings']['apacheconf_vhost'],
@@ -128,64 +111,6 @@ return array(
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'defaultwebsrverrhandler_enabled' => array(
'label' => $lng['serversettings']['defaultwebsrverrhandler_enabled'],
'settinggroup' => 'defaultwebsrverrhandler',
'varname' => 'enabled',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'defaultwebsrverrhandler_err401' => array(
'label' => $lng['serversettings']['defaultwebsrverrhandler_err401'],
'settinggroup' => 'defaultwebsrverrhandler',
'varname' => 'err401',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'defaultwebsrverrhandler_err403' => array(
'label' => $lng['serversettings']['defaultwebsrverrhandler_err403'],
'settinggroup' => 'defaultwebsrverrhandler',
'varname' => 'err403',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'defaultwebsrverrhandler_err404' => array(
'label' => $lng['serversettings']['defaultwebsrverrhandler_err404'],
'settinggroup' => 'defaultwebsrverrhandler',
'varname' => 'err404',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'defaultwebsrverrhandler_err500' => array(
'label' => $lng['serversettings']['defaultwebsrverrhandler_err500'],
'settinggroup' => 'defaultwebsrverrhandler',
'varname' => 'err500',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'customredirect_enabled' => array(
'label' => $lng['serversettings']['customredirect_enabled'],
'settinggroup' => 'customredirect',
'varname' => 'enabled',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'customredirect_default' => array(
'label' => $lng['serversettings']['customredirect_default'],
'settinggroup' => 'customredirect',
'varname' => 'default',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options_method' => 'getRedirectCodes',
'save_method' => 'storeSettingField',
),
), ),
), ),
'ssl' => array( 'ssl' => array(

View File

@@ -1,125 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id$
*/
return array(
'groups' => array(
'fcgid' => array(
'title' => $lng['admin']['fcgid_settings'],
'fields' => array(
'system_mod_fcgid_enabled' => array(
'label' => $lng['serversettings']['mod_fcgid'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true
),
'system_mod_fcgid_enabled_ownvhost' => array(
'label' => $lng['serversettings']['mod_fcgid_ownvhost'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_ownvhost',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_httpuser' => array(
'label' => $lng['admin']['mod_fcgid_user'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_httpuser',
'type' => 'string',
'default' => 'froxlorlocal',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_httpgroup' => array(
'label' => $lng['admin']['mod_fcgid_group'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_httpgroup',
'type' => 'string',
'default' => 'froxlorlocal',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_configdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_configdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/www/php-fcgi-scripts/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_tmpdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_tmpdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/customers/tmp/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_peardir' => array(
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_peardir',
'type' => 'string',
'string_type' => 'dir',
'string_delimiter' => ':',
'string_emptyallowed' => true,
'default' => '/usr/share/php/:/usr/share/php5/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_wrapper' => array(
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_wrapper',
'type' => 'option',
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
'default' => 1,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_starter' => array(
'label' => $lng['serversettings']['mod_fcgid']['starter'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_starter',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_maxrequests' => array(
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_maxrequests',
'type' => 'int',
'default' => 250,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_defaultini' => array(
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_defaultini',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options_method' => 'getPhpConfigs',
'save_method' => 'storeSettingField',
),
),
),
),
);
?>

View File

@@ -1,52 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id$
*/
return array(
'groups' => array(
'perl' => array(
'title' => $lng['admin']['perl_settings'],
'fields' => array(
'perl_path' => array(
'label' => $lng['serversettings']['perl_path'],
'settinggroup' => 'system',
'varname' => 'perl_path',
'type' => 'string',
'default' => '/usr/bin/perl',
'save_method' => 'storeSettingField',
),
'system_perl_suexecworkaround' => array(
'label' => $lng['serversettings']['perl']['suexecworkaround'],
'settinggroup' => 'perl',
'varname' => 'suexecworkaround',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_perl_suexeccgipath' => array(
'label' => $lng['serversettings']['perl']['suexeccgipath'],
'settinggroup' => 'perl',
'varname' => 'suexecpath',
'type' => 'string',
'default' => '/var/www/cgi-bin/',
'save_method' => 'storeSettingField',
),
),
),
),
);
?>

View File

@@ -40,36 +40,45 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_awstats_domain_file' => array(
'label' => $lng['serversettings']['awstats_domain_file'],
'settinggroup' => 'system',
'varname' => 'awstats_domain_file',
'type' => 'string',
'string_type' => 'dir',
'default' => '/etc/awstats/',
'save_method' => 'storeSettingField',
),
'system_awstats_model_file' => array(
'label' => $lng['serversettings']['awstats_model_file'],
'settinggroup' => 'system',
'varname' => 'awstats_model_file',
'type' => 'string',
'string_type' => 'file',
'default' => '/etc/awstats/awstats.model.conf.syscp',
'save_method' => 'storeSettingField',
),
'system_awstats_path' => array( 'system_awstats_path' => array(
'label' => $lng['serversettings']['awstats_path'], 'label' => $lng['serversettings']['awstats_path'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'awstats_path', 'varname' => 'awstats_path',
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/bin/', 'default' => '/usr/share/awstats/VERSION/webroot/cgi-bin/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_awstats_awstatspath' => array( 'system_awstats_updateall_command' => array(
'label' => $lng['serversettings']['awstats_awstatspath'], 'label' => $lng['serversettings']['awstats_updateall_command'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'awstats_awstatspath', 'varname' => 'awstats_updateall_command',
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'file',
'default' => '/usr/bin/', 'default' => '/usr/bin/awstats_updateall.pl',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_awstats_conf' => array( ),
'label' => $lng['serversettings']['awstats_conf'], ),
'settinggroup' => 'system', ),
'varname' => 'awstats_conf',
'type' => 'string',
'string_type' => 'dir',
'default' => '/etc/awstats/',
'save_method' => 'storeSettingField',
)
)
)
)
); );
?> ?>

View File

@@ -75,7 +75,7 @@ return array(
'default' => 100, 'default' => 100,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_autoresponder_enabled' => array( 'systen_autoresponder_enabled' => array(
'label' => $lng['serversettings']['autoresponder_active'], 'label' => $lng['serversettings']['autoresponder_active'],
'settinggroup' => 'autoresponder', 'settinggroup' => 'autoresponder',
'varname' => 'autoresponder_active', 'varname' => 'autoresponder_active',
@@ -84,7 +84,7 @@ return array(
'cronmodule' => 'froxlor/autoresponder', 'cronmodule' => 'froxlor/autoresponder',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_last_autoresponder_run' => array( 'systen_last_autoresponder_run' => array(
'settinggroup' => 'autoresponder', 'settinggroup' => 'autoresponder',
'varname' => 'last_autoresponder_run', 'varname' => 'last_autoresponder_run',
'type' => 'hidden', 'type' => 'hidden',

View File

@@ -1,40 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id: 220.ftpserver.php 1 2010-04-07 10:00:00Z monotek $
*/
return array(
'groups' => array(
'ftpserver' => array(
'title' => $lng['admin']['ftpserversettings'],
'fields' => array(
'ftpserver' => array(
'label' => $lng['admin']['ftpserver'],
'settinggroup' => 'system',
'varname' => 'ftpserver',
'type' => 'option',
'default' => 'proftpd',
'option_mode' => 'one',
'option_options' => array('proftpd' => 'Proftpd', 'pureftpd' => 'Pureftpd'),
'save_method' => 'storeSettingField',
),
),
),
)
);
?>

View File

@@ -59,24 +59,6 @@ return array(
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_dns_createmailentry' => array(
'label' => $lng['serversettings']['mail_also_with_mxservers'],
'settinggroup' => 'system',
'varname' => 'dns_createmailentry',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField'
),
'system_defaultttl' => array(
'label' => $lng['serversettings']['defaultttl'],
'settinggroup' => 'system',
'varname' => 'defaultttl',
'type' => 'int',
'default' => 604800, /* 1 week */
'int_min' => 3600, /* 1 hour */
'int_max' => 2147483647, /* integer max */
'save_method' => 'storeSettingField',
),
), ),
), ),
), ),

View File

@@ -29,7 +29,6 @@ return array(
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true
), ),
'logger_severity' => array( 'logger_severity' => array(
'label' => $lng['serversettings']['logger']['severity'], 'label' => $lng['serversettings']['logger']['severity'],

View File

@@ -28,8 +28,7 @@ return array(
'varname' => 'use_dkim', 'varname' => 'use_dkim',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingFieldInsertBindTask', 'save_method' => 'storeSettingField',
'overview_option' => true
), ),
'dkim_prefix' => array( 'dkim_prefix' => array(
'label' => $lng['dkim']['dkim_prefix'], 'label' => $lng['dkim']['dkim_prefix'],
@@ -57,63 +56,6 @@ return array(
'default' => 'dkim-keys.conf', 'default' => 'dkim-keys.conf',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'dkim_algorithm' => array(
'label' => $lng['dkim']['dkim_algorithm'],
'settinggroup' => 'dkim',
'varname' => 'dkim_algorithm',
'type' => 'option',
'default' => 'all',
'option_mode' => 'multiple',
'option_options' => array('all' => 'All', 'sha1' => 'SHA1', 'sha256' => 'SHA256'),
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkim_servicetype' => array(
'label' => $lng['dkim']['dkim_servicetype'],
'settinggroup' => 'dkim',
'varname' => 'dkim_servicetype',
'type' => 'option',
'default' => '0',
'option_mode' => 'one',
'option_options' => array('0' => 'All', '1' => 'E-Mail'),
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkim_keylength' => array(
'label' => $lng['dkim']['dkim_keylength'],
'settinggroup' => 'dkim',
'varname' => 'dkim_keylength',
'type' => 'option',
'default' => '1024',
'option_mode' => 'one',
'option_options' => array('1024' => '1024 Bit', '2048' => '2048 Bit'),
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkim_notes' => array(
'label' => $lng['dkim']['dkim_notes'],
'settinggroup' => 'dkim',
'varname' => 'dkim_notes',
'type' => 'string',
'string_regexp' => '/^[a-z0-9\._]+$/i',
'default' => '',
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkim_add_adsp' => array(
'label' => $lng['dkim']['dkim_add_adsp'],
'settinggroup' => 'dkim',
'varname' => 'dkim_add_adsp',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkim_add_adsppolicy' => array(
'label' => $lng['dkim']['dkim_add_adsppolicy'],
'settinggroup' => 'dkim',
'varname' => 'dkim_add_adsppolicy',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options' => array('0' => 'Unknown', '1' => 'All', '2' => 'Discardable'),
'save_method' => 'storeSettingFieldInsertBindTask',
),
'dkimrestart_command' => array( 'dkimrestart_command' => array(
'label' => $lng['dkim']['dkimrestart_command'], 'label' => $lng['dkim']['dkimrestart_command'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',

View File

@@ -26,8 +26,7 @@ return array(
'varname' => 'use_spf', 'varname' => 'use_spf',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
'overview_option' => true
), ),
'spf_entry' => array( 'spf_entry' => array(
'label' => $lng['spf']['spf_entry'], 'label' => $lng['spf']['spf_entry'],

View File

@@ -30,7 +30,6 @@ return array(
'default' => false, 'default' => false,
'cronmodule' => 'froxlor/ticket', 'cronmodule' => 'froxlor/ticket',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true
), ),
'ticket_noreply_email' => array( 'ticket_noreply_email' => array(
'label' => $lng['serversettings']['ticket']['noreply_email'], 'label' => $lng['serversettings']['ticket']['noreply_email'],
@@ -125,16 +124,6 @@ return array(
'type' => 'hidden', 'type' => 'hidden',
'default' => '', 'default' => '',
), ),
'ticket_default_priority' => array(
'label' => $lng['serversettings']['ticket']['default_priority'],
'settinggroup' => 'ticket',
'varname' => 'default_priority',
'type' => 'option',
'default' => 2,
'option_mode' => 'one',
'option_options' => array(1 => $lng['ticket']['unf_high'], 2 => $lng['ticket']['unf_normal'], 3 => $lng['ticket']['unf_low']),
'save_method' => 'storeSettingField',
),
), ),
), ),
) )

View File

@@ -30,7 +30,6 @@ return array(
'default' => false, 'default' => false,
'cronmodule' => 'froxlor/aps', 'cronmodule' => 'froxlor/aps',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true
), ),
'aps_items_per_page' => array( 'aps_items_per_page' => array(
'label' => $lng['aps']['packages_per_page'], 'label' => $lng['aps']['packages_per_page'],
@@ -59,7 +58,7 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => '', 'default' => '',
'option_mode' => 'multiple', 'option_mode' => 'multiple',
'option_options' => array('gd' => 'GD Library', 'pcre' => 'PCRE', 'ioncube' => 'ionCube', 'ioncube loader' => 'ionCube Loader', 'curl' => 'curl', 'mcrypt' => 'mcrypt', 'imap' => 'imap', 'json' => 'json', 'ldap' => 'LDAP', 'hash' => 'hash', 'mbstring' => 'mbstring'), 'option_options' => array('gd' => 'GD Library', 'pcre' => 'PCRE', 'ioncube' => 'ionCube', 'ioncube loader' => 'ionCube Loader', 'curl' => 'curl', 'mcrypt' => 'mcrypt', 'imap' => 'imap'),
'save_method' => 'storeSettingApsPhpExtensions', 'save_method' => 'storeSettingApsPhpExtensions',
), ),
'aps_php-function' => array( 'aps_php-function' => array(

View File

@@ -38,6 +38,68 @@ return array(
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_mod_fcgid_enabled' => array(
'label' => $lng['serversettings']['mod_fcgid'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_configdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_configdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/www/php-fcgi-scripts/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_tmpdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_tmpdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/customers/tmp/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_peardir' => array(
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_peardir',
'type' => 'string',
'string_type' => 'dir',
'string_delimiter' => ':',
'string_emptyallowed' => true,
'default' => '/usr/share/php/:/usr/share/php5/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_wrapper' => array(
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_wrapper',
'type' => 'option',
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_starter' => array(
'label' => $lng['serversettings']['mod_fcgid']['starter'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_starter',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_maxrequests' => array(
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_maxrequests',
'type' => 'int',
'default' => 250,
'save_method' => 'storeSettingField',
),
), ),
), ),
), ),

View File

@@ -93,7 +93,6 @@ if($page == 'admins'
$i++; $i++;
} }
$admincount = $db->num_rows($result);
eval("echo \"" . getTemplate("admins/admins") . "\";"); eval("echo \"" . getTemplate("admins/admins") . "\";");
} }
elseif($action == 'su') elseif($action == 'su')
@@ -155,7 +154,6 @@ if($page == 'admins'
$loginname = validate($_POST['loginname'], 'loginname'); $loginname = validate($_POST['loginname'], 'loginname');
$password = validate($_POST['admin_password'], 'password'); $password = validate($_POST['admin_password'], 'password');
$password = validatePassword($password);
$def_language = validate($_POST['def_language'], 'default language'); $def_language = validate($_POST['def_language'], 'default language');
$customers = intval_ressource($_POST['customers']); $customers = intval_ressource($_POST['customers']);
@@ -220,19 +218,12 @@ if($page == 'admins'
$ftps = - 1; $ftps = - 1;
} }
if($settings['ticket']['enabled'] == 1) $tickets = intval_ressource($_POST['tickets']);
{
$tickets = intval_ressource($_POST['tickets']);
if(isset($_POST['tickets_ul']) if(isset($_POST['tickets_ul'])
&& $settings['ticket']['enabled'] == '1') && $settings['ticket']['enabled'] == '1')
{
$tickets = - 1;
}
}
else
{ {
$tickets = 0; $tickets = - 1;
} }
$mysqls = intval_ressource($_POST['mysqls']); $mysqls = intval_ressource($_POST['mysqls']);
@@ -506,19 +497,12 @@ if($page == 'admins'
{ {
$ftps = - 1; $ftps = - 1;
} }
if($settings['ticket']['enabled'] == 1)
{
$tickets = intval_ressource($_POST['tickets']);
if(isset($_POST['tickets_ul'])) $tickets = intval_ressource($_POST['tickets']);
{
$tickets = - 1; if(isset($_POST['tickets_ul']))
}
}
else
{ {
$tickets = 0; $tickets = - 1;
} }
$mysqls = intval_ressource($_POST['mysqls']); $mysqls = intval_ressource($_POST['mysqls']);
@@ -576,7 +560,6 @@ if($page == 'admins'
{ {
if($password != '') if($password != '')
{ {
$password = validatePassword($password);
$password = md5($password); $password = md5($password);
} }
else else

View File

@@ -95,9 +95,10 @@ if($userinfo['change_serversettings'] == '1')
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'], '<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'], '<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'], '<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
'<AWSTATS_PATH>' => $settings['system']['awstats_path'],
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '', '<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
'<REALTIME_PORT>' => $settings['system']['realtime_port'], '<REALTIME_PORT>' => $settings['system']['realtime_port'],
'<CUSTOMER_TMP>' => ($settings['system']['mod_fcgid_tmpdir'] != '') ? makeCorrectDir($settings['system']['mod_fcgid_tmpdir']) : '/tmp/' '<CUSTOMER_TMP>' => ($settings['system']['mod_fcgid_tmpdir'] != '') ? $settings['system']['mod_fcgid_tmpdir'] : '/tmp/'
); );
$files = ''; $files = '';
$configpage = ''; $configpage = '';
@@ -110,7 +111,6 @@ if($userinfo['change_serversettings'] == '1')
if(is_array($value)) if(is_array($value))
{ {
$commands = implode("\n", $value); $commands = implode("\n", $value);
$commands = str_replace("\n\n", "\n", $commands);
if($commands != '') if($commands != '')
{ {

View File

@@ -75,6 +75,12 @@ if($page == 'cronjobs'
$description = $lng['crondesc'][$row['desc_lng_key']]; $description = $lng['crondesc'][$row['desc_lng_key']];
/*
* don't allow deletion of 'froxlor' cronjobs
*/
$vendor_a = explode('/', $row['module']);
$vendor = $vendor_a[0];
eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";"); eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";");
$count++; $count++;
} }
@@ -88,68 +94,21 @@ if($page == 'cronjobs'
elseif($action == 'new') elseif($action == 'new')
{ {
/* /*
* @TODO later * @TODO Finish me
*/ */
} }
elseif($action == 'edit' elseif($action == 'edit'
&& $id != 0) && $id != 0)
{ {
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`='" . (int)$id . "'"); /*
* @TODO Finish me
if ($result['cronfile'] != '') */
{
if(isset($_POST['send'])
&& $_POST['send'] == 'send')
{
$isactive = intval($_POST['isactive']);
$interval_value = validate($_POST['interval_value'], 'interval_value', '/^([0-9]+)$/Di', 'stringisempty');
$interval_interval = validate($_POST['interval_interval'], 'interval_interval');
if($isactive != 1)
{
$isactive = 0;
}
$interval = $interval_value.' '.strtoupper($interval_interval);
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "`
SET `isactive` = '".(int)$isactive."',
`interval` = '".$interval."'
WHERE `id` = '" . (int)$id . "'");
redirectTo($filename, Array('page' => $page, 's' => $s));
}
else
{
$isactive = makeyesno('isactive', '1', '0', $result['isactive']);
// interval
$interval_nfo = explode(' ', $result['interval']);
$interval_value = $interval_nfo[0];
$interval_interval = '';
$interval_interval.= makeoption($lng['cronmgmt']['seconds'], 'SECOND', $interval_nfo[1]);
$interval_interval.= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]);
$interval_interval.= makeoption($lng['cronmgmt']['hours'], 'HOUR', $interval_nfo[1]);
$interval_interval.= makeoption($lng['cronmgmt']['days'], 'DAY', $interval_nfo[1]);
$interval_interval.= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]);
$interval_interval.= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]);
// end of interval
$change_cronfile = false;
if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor')
{
$change_cronfile = true;
}
eval("echo \"" . getTemplate("cronjobs/cronjob_edit") . "\";");
}
}
} }
elseif($action == 'delete' elseif($action == 'delete'
&& $id != 0) && $id != 0)
{ {
/* /*
* @TODO later * @TODO Finish me
*/ */
} }
} }

View File

@@ -66,9 +66,7 @@ if($page == 'customers'
'c.email_quota' => $lng['customer']['email_quota'], 'c.email_quota' => $lng['customer']['email_quota'],
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')', 'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
'c.deactivated' => $lng['admin']['deactivated'], 'c.deactivated' => $lng['admin']['deactivated'],
'c.lastlogin_succ' => $lng['admin']['lastlogin_succ'], 'c.phpenabled' => $lng['admin']['phpenabled']
'c.phpenabled' => $lng['admin']['phpenabled'],
'c.perlenabled' => $lng['admin']['perlenabled']
); );
if($settings['ticket']['enabled'] == 1) if($settings['ticket']['enabled'] == 1)
@@ -98,15 +96,6 @@ if($page == 'customers'
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']); $row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']); $row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
$row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']); $row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']);
$last_login = ((int)$row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
$column_style = '';
if($row['loginfail_count'] >= $settings['login']['maxloginattempts']
&& $row['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
) {
$column_style = ' style="background-color: #f99122;"';
}
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains'); $row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
$row = htmlentities_array($row); $row = htmlentities_array($row);
eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";"); eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
@@ -116,7 +105,6 @@ if($page == 'customers'
$i++; $i++;
} }
$customercount = $db->num_rows($result);
eval("echo \"" . getTemplate("customers/customers") . "\";"); eval("echo \"" . getTemplate("customers/customers") . "\";");
} }
elseif($action == 'su' elseif($action == 'su'
@@ -186,34 +174,9 @@ if($page == 'customers'
$db->query("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$id . "'");
$result2 = $db->query("SELECT `username` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
while($row = $db->fetch_array($result2))
{
$db->query("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name`='" . $row['username'] . "'");
}
$db->query("DELETE FROM `" . TABLE_FTP_GROUPS . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_FTP_GROUPS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid`='" . (int)$id . "'");
// Delete all waiting "create user" -tasks for this user, #276
// Note: the WHERE selects part of a serialized array, but it should be safe this way
$db->query("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '2' AND `data` LIKE '%:\"" . $db->escape($result['loginname']) . "\";%';");
// remove everything APS-related, #216
$apsresult = $db->query("SELECT `ID` FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID`='".(int)$id."'");
while($apsrow = $db->fetch_array($apsresult))
{
// remove all package related settings
$db->query("DELETE FROM `".TABLE_APS_SETTINGS."` WHERE `InstanceID` = '".(int)$apsrow['ID']."'");
// maybe some leftovers in the tasks
$db->query("DELETE FROM `".TABLE_APS_TASKS."` WHERE `InstanceID` = '".(int)$apsrow['ID']."'");
}
// now remove all user instances
$db->query("DELETE FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID`='".(int)$id."'");
// eventually some temp-setting-leftovers
$db->query("DELETE FROM `".TABLE_APS_TEMP_SETTINGS."` WHERE `CustomerID`='".(int)$id."'");
// eof APS-related removings, #216
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` - 1 "; $admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` - 1 ";
$admin_update_query.= ", `domains_used` = `domains_used` - 0" . (int)($domains_deleted - $result['subdomains_used']); $admin_update_query.= ", `domains_used` = `domains_used` - 0" . (int)($domains_deleted - $result['subdomains_used']);
@@ -257,11 +220,6 @@ if($page == 'customers'
$admin_update_query.= ", `tickets_used` = `tickets_used` - 0" . (int)$result['tickets']; $admin_update_query.= ", `tickets_used` = `tickets_used` - 0" . (int)$result['tickets'];
} }
if($result['aps_packages'] != '-1')
{
$admin_update_query.= ", `aps_packages` = `aps_packages` - 0" . (int)$result['aps_packages'];
}
if(($result['diskspace'] / 1024) != '-1') if(($result['diskspace'] / 1024) != '-1')
{ {
$admin_update_query.= ", `diskspace_used` = `diskspace_used` - 0" . (int)$result['diskspace']; $admin_update_query.= ", `diskspace_used` = `diskspace_used` - 0" . (int)$result['diskspace'];
@@ -420,11 +378,9 @@ if($page == 'customers'
} }
$createstdsubdomain = intval($_POST['createstdsubdomain']); $createstdsubdomain = intval($_POST['createstdsubdomain']);
$password = validate($_POST['new_customer_password'], 'password'); $password = validate($_POST['customer_password'], 'password');
$password = validatePassword($password);
$sendpassword = intval($_POST['sendpassword']); $sendpassword = intval($_POST['sendpassword']);
$phpenabled = intval($_POST['phpenabled']); $phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024; $diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024; $traffic = $traffic * 1024 * 1024;
@@ -475,11 +431,11 @@ if($page == 'customers'
} }
else else
{ {
if(isset($_POST['new_loginname']) if(isset($_POST['loginname'])
&& $_POST['new_loginname'] != '') && $_POST['loginname'] != '')
{ {
$accountnumber = intval($settings['system']['lastaccountnumber']); $accountnumber = intval($settings['system']['lastaccountnumber']);
$loginname = validate($_POST['new_loginname'], 'loginname', '/^[a-z0-9\-_]+$/i'); $loginname = validate($_POST['loginname'], 'loginname', '/^[a-z0-9\-_]+$/i');
// Accounts which match systemaccounts are not allowed, filtering them // Accounts which match systemaccounts are not allowed, filtering them
@@ -527,17 +483,12 @@ if($page == 'customers'
$phpenabled = '1'; $phpenabled = '1';
} }
if($perlenabled != '0')
{
$perlenabled = '1';
}
if($password == '') if($password == '')
{ {
$password = substr(md5(uniqid(microtime(), 1)), 12, 6); $password = substr(md5(uniqid(microtime(), 1)), 12, 6);
} }
$result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`, `perlenabled`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "', '" . $db->escape($perlenabled) . "')"); $result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "')");
$customerid = $db->insert_id(); $customerid = $db->insert_id();
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` + 1"; $admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` + 1";
@@ -616,37 +567,24 @@ if($page == 'customers'
$htpasswdPassword = crypt($password); $htpasswdPassword = crypt($password);
} }
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')");
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'");
if($settings['system']['awstats_enabled'] == '1') if($settings['system']['awstats_enabled'] == '1')
{ {
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/awstats/')) . "')"); $db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/awstats/')) . "')");
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added awstats htpasswd for user '" . $loginname . "'"); $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added awstats htpasswd for user '" . $loginname . "'");
} }
else
{
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')");
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'");
}
inserttask('1'); inserttask('1');
$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')"); $result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
$result = $db->query("INSERT INTO `" . TABLE_FTP_GROUPS . "` " . "(`customerid`, `groupname`, `gid`, `members`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($guid) . "', '" . $db->escape($loginname) . "')"); $result = $db->query("INSERT INTO `" . TABLE_FTP_GROUPS . "` " . "(`customerid`, `groupname`, `gid`, `members`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($guid) . "', '" . $db->escape($loginname) . "')");
$result = $db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($loginname) . "', 'user', '0', '0', '0', '0', '0', '0')");
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added ftp-account for user '" . $loginname . "'"); $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added ftp-account for user '" . $loginname . "'");
if($createstdsubdomain == '1') if($createstdsubdomain == '1')
{ {
if (isset($settings['system']['stdsubdomain'])
&& $settings['system']['stdsubdomain'] != ''
) {
$_stdsubdomain = $loginname . '.' . $settings['system']['stdsubdomain'];
}
else
{
$_stdsubdomain = $loginname . '.' . $settings['system']['hostname'];
}
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET " . $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET " .
"`domain` = '". $db->escape($_stdsubdomain) . "', " . "`domain` = '". $db->escape($loginname . '.' . $settings['system']['hostname']) . "', " .
"`customerid` = '" . (int)$customerid . "', " . "`customerid` = '" . (int)$customerid . "', " .
"`adminid` = '" . (int)$userinfo['adminid'] . "', " . "`adminid` = '" . (int)$userinfo['adminid'] . "', " .
"`parentdomainid` = '-1', " . "`parentdomainid` = '-1', " .
@@ -658,8 +596,7 @@ if($page == 'customers'
"`openbasedir` = '1', " . "`openbasedir` = '1', " .
"`safemode` = '1', " . "`safemode` = '1', " .
"`speciallogfile` = '0', " . "`speciallogfile` = '0', " .
"`specialsettings` = '', " . "`specialsettings` = ''");
"`add_date` = '".date('Y-m-d')."'");
$domainid = $db->insert_id(); $domainid = $db->insert_id();
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$customerid . '\''); $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$customerid . '\'');
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $loginname . "'"); $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $loginname . "'");
@@ -671,6 +608,7 @@ if($page == 'customers'
$replace_arr = array( $replace_arr = array(
'FIRSTNAME' => $firstname, 'FIRSTNAME' => $firstname,
'NAME' => $name, 'NAME' => $name,
'TITLE' => $title,
'COMPANY' => $company, 'COMPANY' => $company,
'SALUTATION' => getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)), 'SALUTATION' => getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)),
'USERNAME' => $loginname, 'USERNAME' => $loginname,
@@ -736,7 +674,6 @@ if($page == 'customers'
$email_pop3 = makeyesno('email_pop3', '1', '0', '1'); $email_pop3 = makeyesno('email_pop3', '1', '0', '1');
$sendpassword = makeyesno('sendpassword', '1', '0', '1'); $sendpassword = makeyesno('sendpassword', '1', '0', '1');
$phpenabled = makeyesno('phpenabled', '1', '0', '1'); $phpenabled = makeyesno('phpenabled', '1', '0', '1');
$perlenabled = makeyesno('perlenabled', '1', '0', '0');
eval("echo \"" . getTemplate("customers/customers_add") . "\";"); eval("echo \"" . getTemplate("customers/customers_add") . "\";");
} }
} }
@@ -762,7 +699,7 @@ if($page == 'customers'
$email = $idna_convert->encode(validate($_POST['email'], 'email')); $email = $idna_convert->encode(validate($_POST['email'], 'email'));
$customernumber = validate($_POST['customernumber'], 'customer number', '/^[A-Za-z0-9 \-]*$/Di'); $customernumber = validate($_POST['customernumber'], 'customer number', '/^[A-Za-z0-9 \-]*$/Di');
$def_language = validate($_POST['def_language'], 'default language'); $def_language = validate($_POST['def_language'], 'default language');
$password = validate($_POST['new_customer_password'], 'new password'); $password = validate($_POST['customer_password'], 'new password');
$diskspace = intval_ressource($_POST['diskspace']); $diskspace = intval_ressource($_POST['diskspace']);
if(isset($_POST['diskspace_ul'])) if(isset($_POST['diskspace_ul']))
@@ -860,7 +797,6 @@ if($page == 'customers'
$createstdsubdomain = intval($_POST['createstdsubdomain']); $createstdsubdomain = intval($_POST['createstdsubdomain']);
$deactivated = intval($_POST['deactivated']); $deactivated = intval($_POST['deactivated']);
$phpenabled = intval($_POST['phpenabled']); $phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024; $diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024; $traffic = $traffic * 1024 * 1024;
@@ -913,7 +849,6 @@ if($page == 'customers'
{ {
if($password != '') if($password != '')
{ {
$password = validatePassword($password);
$password = md5($password); $password = md5($password);
} }
else else
@@ -929,17 +864,7 @@ if($page == 'customers'
if($createstdsubdomain == '1' if($createstdsubdomain == '1'
&& $result['standardsubdomain'] == '0') && $result['standardsubdomain'] == '0')
{ {
if (isset($settings['system']['stdsubdomain']) $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`) " . "VALUES ('" . $db->escape($result['loginname'] . '.' . $settings['system']['hostname']) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '')");
&& $settings['system']['stdsubdomain'] != ''
) {
$_stdsubdomain = $result['loginname'] . '.' . $settings['system']['stdsubdomain'];
}
else
{
$_stdsubdomain = $result['loginname'] . '.' . $settings['system']['hostname'];
}
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`, `add_date`) " . "VALUES ('" . $db->escape($_stdsubdomain) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '', '".date('Y-m-d')."'");
$domainid = $db->insert_id(); $domainid = $db->insert_id();
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$result['customerid'] . '\''); $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$result['customerid'] . '\'');
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $result['loginname'] . "'"); $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $result['loginname'] . "'");
@@ -965,13 +890,7 @@ if($page == 'customers'
$phpenabled = '1'; $phpenabled = '1';
} }
if($perlenabled != '0') if($phpenabled != $result['phpenabled'])
{
$perlenabled = '1';
}
if($phpenabled != $result['phpenabled']
|| $perlenabled != $result['perlenabled'])
{ {
inserttask('1'); inserttask('1');
} }
@@ -999,7 +918,7 @@ if($page == 'customers'
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `imap`='" . (int)$email_imap . "' WHERE `customerid`='" . (int)$id . "'"); $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `imap`='" . (int)$email_imap . "' WHERE `customerid`='" . (int)$id . "'");
} }
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "', `perlenabled`='" . $db->escape($perlenabled) . "' WHERE `customerid`='" . (int)$id . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "' WHERE `customerid`='" . (int)$id . "'");
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` "; $admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` ";
if($mysqls != '-1' if($mysqls != '-1'
@@ -1264,7 +1183,6 @@ if($page == 'customers'
$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0')); $createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0'));
$phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']); $phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']);
$perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']);
$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']); $deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
$email_imap = makeyesno('email_imap', '1', '0', $result['imap']); $email_imap = makeyesno('email_imap', '1', '0', $result['imap']);
$email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']); $email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']);

View File

@@ -130,8 +130,6 @@ if($page == 'domains'
$i++; $i++;
} }
$domainscount = $db->num_rows($result);
// Display the list // Display the list
eval("echo \"" . getTemplate("domains/domains") . "\";"); eval("echo \"" . getTemplate("domains/domains") . "\";");
@@ -149,23 +147,7 @@ if($page == 'domains'
if(isset($_POST['send']) if(isset($_POST['send'])
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
/* $query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '") AND `isemaildomain`="1"';
* check for APS packages used with this domain, #110
*/
if(domainHasApsInstances($id))
{
standard_error('domains_cantdeletedomainwithapsinstances');
}
// check for deletion of main-domains which are logically subdomains, #329
$rsd_sql = '';
$remove_subbutmain_domains = isset($_POST['delete_userfiles']) ? 1 : 0;
if($remove_subbutmain_domains == 1)
{
$rsd_sql .= ' OR `ismainbutsubto` = "'.(int)$id.'"';
}
$query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '"'.$rsd_sql.') AND `isemaildomain`="1"';
$subResult = $db->query($query); $subResult = $db->query($query);
$idString = array(); $idString = array();
@@ -185,12 +167,11 @@ if($page == 'domains'
$log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain/s from mail-tables"); $log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain/s from mail-tables");
} }
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `id`='" . (int)$id . "' OR `parentdomainid`='" . (int)$result['id'] . "'".$rsd_sql); $db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `id`='" . (int)$id . "' OR `parentdomainid`='" . (int)$result['id'] . "'");
$deleted_domains = (int)$db->affected_rows(); $deleted_domains = (int)$db->affected_rows();
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used` = `subdomains_used` - " . (int)($deleted_domains - 1) . " WHERE `customerid` = '" . (int)$result['customerid'] . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used` = `subdomains_used` - " . (int)($deleted_domains - 1) . " WHERE `customerid` = '" . (int)$result['customerid'] . "'");
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$userinfo['adminid'] . "'"); $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$userinfo['adminid'] . "'");
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'0\' WHERE `standardsubdomain`=\'' . (int)$result['id'] . '\' AND `customerid`=\'' . (int)$result['customerid'] . '\''); $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'0\' WHERE `standardsubdomain`=\'' . (int)$result['id'] . '\' AND `customerid`=\'' . (int)$result['customerid'] . '\'');
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINREDIRECTS . "` WHERE `did` = '".(int)$id."'");
$log->logAction(ADM_ACTION, LOG_INFO, "deleted domain/subdomains (#" . $result['id'] . ")"); $log->logAction(ADM_ACTION, LOG_INFO, "deleted domain/subdomains (#" . $result['id'] . ")");
updateCounters(); updateCounters();
inserttask('1'); inserttask('1');
@@ -199,12 +180,7 @@ if($page == 'domains'
} }
else else
{ {
$showcheck = false; ask_yesno('admin_domain_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain']));
if(domainHasMainSubDomains($id))
{
$showcheck = true;
}
ask_yesno_withcheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain']), $showcheck);
} }
} }
} }
@@ -229,7 +205,6 @@ if($page == 'domains'
$wwwserveralias = intval($_POST['wwwserveralias']); $wwwserveralias = intval($_POST['wwwserveralias']);
$speciallogfile = intval($_POST['speciallogfile']); $speciallogfile = intval($_POST['speciallogfile']);
$aliasdomain = intval($_POST['alias']); $aliasdomain = intval($_POST['alias']);
$issubof = intval($_POST['issubof']);
$customerid = intval($_POST['customerid']); $customerid = intval($_POST['customerid']);
$customer = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$customerid . "' " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " "); $customer = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$customerid . "' " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ");
@@ -323,7 +298,7 @@ if($page == 'domains'
} }
else else
{ {
$phpsettingid = $settings['system']['mod_fcgid_defaultini']; $phpsettingid = '1';
$mod_fcgid_starter = '-1'; $mod_fcgid_starter = '-1';
$mod_fcgid_maxrequests = '-1'; $mod_fcgid_maxrequests = '-1';
} }
@@ -332,7 +307,7 @@ if($page == 'domains'
{ {
$openbasedir = '1'; $openbasedir = '1';
$safemode = '1'; $safemode = '1';
$phpsettingid = $settings['system']['mod_fcgid_defaultini']; $phpsettingid = '1';
$mod_fcgid_starter = '-1'; $mod_fcgid_starter = '-1';
$mod_fcgid_maxrequests = '-1'; $mod_fcgid_maxrequests = '-1';
} }
@@ -384,14 +359,7 @@ if($page == 'domains'
if(!preg_match('/^https?\:\/\//', $documentroot)) if(!preg_match('/^https?\:\/\//', $documentroot))
{ {
if(strstr($documentroot, ":") !== FALSE) $documentroot = makeCorrectDir($documentroot);
{
standard_error('pathmaynotcontaincolon');
}
else
{
$documentroot = makeCorrectDir($documentroot);
}
} }
$domain_check = $db->query_first("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '" . $db->escape(strtolower($domain)) . "'"); $domain_check = $db->query_first("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '" . $db->escape(strtolower($domain)) . "'");
@@ -401,8 +369,7 @@ if($page == 'domains'
if($aliasdomain != 0) if($aliasdomain != 0)
{ {
// also check ip/port combination to be the same, #176 $aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\'');
$aliasdomain_check = $db->query_first('SELECT `d`.`id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$ipandport.'\'');
} }
if($openbasedir != '1') if($openbasedir != '1')
@@ -460,11 +427,6 @@ if($page == 'domains'
{ {
$caneditdomain = '0'; $caneditdomain = '0';
} }
if($issubof <= '0')
{
$issubof = '0';
}
if($domain == '') if($domain == '')
{ {
@@ -519,8 +481,7 @@ if($page == 'domains'
'mod_fcgid_starter' => $mod_fcgid_starter, 'mod_fcgid_starter' => $mod_fcgid_starter,
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests, 'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings, 'specialsettings' => $specialsettings,
'registration_date' => $registration_date, 'registration_date' => $registration_date
'issubof' => $issubof
); );
$security_questions = array( $security_questions = array(
@@ -542,7 +503,7 @@ if($page == 'domains'
} }
} }
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `safemode`,`speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `ismainbutsubto`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($safemode) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "', '".(int)$issubof."')"); $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `safemode`,`speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($safemode) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "')");
$domainid = $db->insert_id(); $domainid = $db->insert_id();
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` + 1 WHERE `adminid` = '" . (int)$adminid . "'"); $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` + 1 WHERE `adminid` = '" . (int)$adminid . "'");
$log->logAction(ADM_ACTION, LOG_INFO, "added domain '" . $domain . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "added domain '" . $domain . "'");
@@ -594,7 +555,7 @@ if($page == 'domains'
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']'; $row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
} }
$ipsandports.= makeoption($row_ipandport['ip'] . ':' . $row_ipandport['port'], $row_ipandport['id'], $settings['system']['defaultip']); $ipsandports.= makeoption($row_ipandport['ip'] . ':' . $row_ipandport['port'], $row_ipandport['id']);
} }
$ssl_ipsandports = ''; $ssl_ipsandports = '';
@@ -633,21 +594,13 @@ if($page == 'domains'
{ {
$domains.= makeoption($idna_convert->decode($row_domain['domain']) . ' (' . $row_domain['loginname'] . ')', $row_domain['id']); $domains.= makeoption($idna_convert->decode($row_domain['domain']) . ' (' . $row_domain['loginname'] . ')', $row_domain['id']);
} }
$subtodomains = makeoption($lng['domains']['nosubtomaindomain'], 0, NULL, true);
$result_domains = $db->query("SELECT `d`.`id`, `d`.`domain`, `c`.`loginname` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid`=0 AND `d`.`ismainbutsubto`=0 " . $standardsubdomains . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "'") . " AND `d`.`customerid`=`c`.`customerid` ORDER BY `loginname`, `domain` ASC");
while($row_domain = $db->fetch_array($result_domains))
{
$subtodomains.= makeoption($idna_convert->decode($row_domain['domain']) . ' (' . $row_domain['loginname'] . ')', $row_domain['id']);
}
$phpconfigs = ''; $phpconfigs = '';
$configs = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`"); $configs = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
while($row = $db->fetch_array($configs)) while($row = $db->fetch_array($configs))
{ {
$phpconfigs.= makeoption($row['description'], $row['id'], $settings['system']['mod_fcgid_defaultini'], true, true); $phpconfigs.= makeoption($row['description'], $row['id'], '1', true, true);
} }
$isbinddomain = makeyesno('isbinddomain', '1', '0', '1'); $isbinddomain = makeyesno('isbinddomain', '1', '0', '1');
@@ -752,7 +705,6 @@ if($page == 'domains'
} }
$aliasdomain = intval($_POST['alias']); $aliasdomain = intval($_POST['alias']);
$issubof = intval($_POST['issubof']);
$isemaildomain = intval($_POST['isemaildomain']); $isemaildomain = intval($_POST['isemaildomain']);
$email_only = intval($_POST['email_only']); $email_only = intval($_POST['email_only']);
$subcanemaildomain = intval($_POST['subcanemaildomain']); $subcanemaildomain = intval($_POST['subcanemaildomain']);
@@ -781,12 +733,6 @@ if($page == 'domains'
{ {
$documentroot = $customer['documentroot']; $documentroot = $customer['documentroot'];
} }
if(!preg_match('/^https?\:\/\//', $documentroot)
&& strstr($documentroot, ":") !== FALSE
) {
standard_error('pathmaynotcontaincolon');
}
} }
else else
{ {
@@ -936,19 +882,13 @@ if($page == 'domains'
if($aliasdomain != 0) if($aliasdomain != 0)
{ {
// also check ip/port combination to be the same, #176 $aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\'');
$aliasdomain_check = $db->query_first('SELECT `d`.`id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$ipandport.'\'');
} }
if($aliasdomain_check['id'] != $aliasdomain) if($aliasdomain_check['id'] != $aliasdomain)
{ {
standard_error('domainisaliasorothercustomer'); standard_error('domainisaliasorothercustomer');
} }
if($issubof <= '0')
{
$issubof = '0';
}
$params = array( $params = array(
'id' => $id, 'id' => $id,
@@ -976,8 +916,7 @@ if($page == 'domains'
'mod_fcgid_starter' => $mod_fcgid_starter, 'mod_fcgid_starter' => $mod_fcgid_starter,
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests, 'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings, 'specialsettings' => $specialsettings,
'registration_date' => $registration_date, 'registration_date' => $registration_date
'issubof' => $issubof
); );
$security_questions = array( $security_questions = array(
@@ -1011,8 +950,7 @@ if($page == 'domains'
|| $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_starter != $result['mod_fcgid_starter']
|| $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests']
|| $specialsettings != $result['specialsettings'] || $specialsettings != $result['specialsettings']
|| $aliasdomain != $result['aliasdomain'] || $aliasdomain != $result['aliasdomain'])
|| $issubof != $result['ismainbutsubto'])
{ {
inserttask('1'); inserttask('1');
} }
@@ -1074,7 +1012,7 @@ if($page == 'domains'
$log->logAction(ADM_ACTION, LOG_INFO, "removed specialsettings on all subdomains of domain #" . $id); $log->logAction(ADM_ACTION, LOG_INFO, "removed specialsettings on all subdomains of domain #" . $id);
} }
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "', `ismainbutsubto`='" . (int)$issubof . "' WHERE `id`='" . (int)$id . "'"); $result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "' WHERE `id`='" . (int)$id . "'");
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `ipandport`='" . $db->escape($ipandport) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "'" . $upd_specialsettings . $updatechildren . " WHERE `parentdomainid`='" . (int)$id . "'"); $result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `ipandport`='" . $db->escape($ipandport) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "'" . $upd_specialsettings . $updatechildren . " WHERE `parentdomainid`='" . (int)$id . "'");
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id); $log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
$redirect_props = Array( $redirect_props = Array(
@@ -1129,14 +1067,6 @@ if($page == 'domains'
{ {
$domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']); $domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']);
} }
$subtodomains = makeoption($lng['domains']['nosubtomaindomain'], 0, NULL, true);
$result_domains = $db->query("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid`=0 AND `d`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$result['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` ORDER BY `d`.`domain` ASC");
while($row_domain = $db->fetch_array($result_domains))
{
$subtodomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['ismainbutsubto']);
}
if($userinfo['ip'] == "-1") if($userinfo['ip'] == "-1")
{ {

View File

@@ -100,7 +100,7 @@ if($page == 'overview')
&& count($latestversion) >= 1) && count($latestversion) >= 1)
{ {
$_version = $latestversion[0]; $_version = $latestversion[0];
$_message = isset($latestversion[1]) ? $latestversion[1] : ''; $_message = $latestversion[1];
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes'); $_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
$lookfornewversion_lable = $_version; $lookfornewversion_lable = $_version;
@@ -281,14 +281,9 @@ elseif($page == 'change_language')
{ {
$language_options = ''; $language_options = '';
$default_lang = $settings['panel']['standardlanguage'];
if($userinfo['def_language'] != '') {
$default_lang = $userinfo['def_language'];
}
while(list($language_file, $language_name) = each($languages)) while(list($language_file, $language_name) = each($languages))
{ {
$language_options.= makeoption($language_name, $language_file, $default_lang, true); $language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
} }
eval("echo \"" . getTemplate("index/change_language") . "\";"); eval("echo \"" . getTemplate("index/change_language") . "\";");

View File

@@ -97,7 +97,7 @@ if($page == 'overview')
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'"); $db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
inserttask('1'); inserttask('1');
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $value . "' has been created by '" . $userinfo['loginname'] . "'");
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
else else

View File

@@ -31,78 +31,20 @@ if(($page == 'settings' || $page == 'overview')
&& $userinfo['change_serversettings'] == '1') && $userinfo['change_serversettings'] == '1')
{ {
$settings_data = loadConfigArrayDir('./actions/admin/settings/'); $settings_data = loadConfigArrayDir('./actions/admin/settings/');
$settings = loadSettings($settings_data, $db); $settings = loadSettings(&$settings_data, &$db);
if(isset($_POST['send']) if(isset($_POST['send'])
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$_part = isset($_GET['part']) ? $_GET['part'] : ''; if(processForm(&$settings_data, &$_POST, array('filename' => $filename, 'action' => $action, 'page' => $page)))
if($_part == '')
{ {
$_part = isset($_POST['part']) ? $_POST['part'] : '';
}
if($_part != '')
{
if($_part == 'all')
{
$settings_all = true;
$settings_part = false;
}
else
{
$settings_all = false;
$settings_part = true;
}
$only_enabledisable = false;
}
else
{
$settings_all = false;
$settings_part = false;
$only_enabledisable = true;
}
if(processFormEx(
$settings_data,
$_POST,
array('filename' => $filename, 'action' => $action, 'page' => $page),
$_part,
$settings_all,
$settings_part,
$only_enabledisable
)
) {
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page)); standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
} }
} }
else else
{ {
$_part = isset($_GET['part']) ? $_GET['part'] : ''; $fields = buildForm(&$settings_data);
eval("echo \"" . getTemplate("settings/settings") . "\";");
if($_part == '')
{
$_part = isset($_POST['part']) ? $_POST['part'] : '';
}
$fields = buildFormEx($settings_data, $_part);
$settings_page = '';
if($_part == '')
{
eval("\$settings_page .= \"" . getTemplate("settings/settings_overview") . "\";");
}
else
{
eval("\$settings_page .= \"" . getTemplate("settings/settings") . "\";");
}
eval("echo \"" . getTemplate("settings/settings_form_begin") . "\";");
eval("echo \$settings_page;");
eval("echo \"" . getTemplate("settings/settings_form_end") . "\";");
} }
} }
elseif($page == 'rebuildconfigs' elseif($page == 'rebuildconfigs'
@@ -214,4 +156,6 @@ elseif($page == 'enforcequotas'
{ {
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page)); ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
} }
} }
?>

View File

@@ -53,10 +53,7 @@ $available_templates = array(
'new_ticket_for_customer', 'new_ticket_for_customer',
'new_ticket_by_staff', 'new_ticket_by_staff',
'new_reply_ticket_by_customer', 'new_reply_ticket_by_customer',
'new_reply_ticket_by_staff', 'new_reply_ticket_by_staff'
'new_database_by_customer',
'new_ftpaccount_by_customer',
'password_reset'
); );
$file_templates = array( $file_templates = array(
'index_html' 'index_html'

View File

@@ -102,12 +102,11 @@ if($page == 'tickets'
if($_cid != $row['customerid']) if($_cid != $row['customerid'])
{ {
$cid = $row['customerid']; $cid = $row['customerid'];
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '` $usr = $db->query_first('SELECT `firstname`, `name`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$cid . '"'); WHERE `customerid` = "' . (int)$cid . '"');
if(isset($usr['loginname'])) { if(isset($usr['loginname'])) {
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')'; $customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
//$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
} else { } else {
$customer = $lng['ticket']['nonexistingcustomer']; $customer = $lng['ticket']['nonexistingcustomer'];
} }
@@ -198,12 +197,12 @@ if($page == 'tickets'
else else
{ {
$categories = ''; $categories = '';
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC'); $result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `name` ASC');
if(isset($result['name']) if(isset($result['name'])
&& $result['name'] != '') && $result['name'] != '')
{ {
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC'); $result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `name` ASC');
while($row = $db->fetch_array($result2)) while($row = $db->fetch_array($result2))
{ {
@@ -220,12 +219,27 @@ if($page == 'tickets'
while($row_customer = $db->fetch_array($result_customers)) while($row_customer = $db->fetch_array($result_customers))
{ {
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']); if($row_customer['company'] == '')
{
$customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
}
else
{
if($row_customer['name'] != ''
&& $row_customer['firstname'] != '')
{
$customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' | ' . $row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
}
else
{
$customers.= makeoption($row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
}
}
} }
$priorities = makeoption($lng['ticket']['unf_high'], '1', $settings['ticket']['default_priority']); $priorities = makeoption($lng['ticket']['unf_high'], '1');
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', $settings['ticket']['default_priority']); $priorities.= makeoption($lng['ticket']['unf_normal'], '2');
$priorities.= makeoption($lng['ticket']['unf_low'], '3', $settings['ticket']['default_priority']); $priorities.= makeoption($lng['ticket']['unf_low'], '3');
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";"); eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
} }
} }
@@ -421,11 +435,10 @@ elseif($page == 'categories'
{ {
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::categories"); $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::categories");
$fields = array( $fields = array(
'name' => $lng['ticket']['category'], 'name' => $lng['ticket']['category']
'logicalorder' => $lng['ticket']['logicalorder']
); );
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKET_CATS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']); $paging = new paging($userinfo, $db, TABLE_PANEL_TICKET_CATS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `main`.`id`, `main`.`name`, `main`.`logicalorder`, ( $result = $db->query("SELECT `main`.`id`, `main`.`name`, (
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub` SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
WHERE `sub`.`category` = `main`.`id` WHERE `sub`.`category` = `main`.`id`
AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "') AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "')
@@ -468,12 +481,6 @@ elseif($page == 'categories'
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$category = validate($_POST['category'], 'category'); $category = validate($_POST['category'], 'category');
$order = validate($_POST['logicalorder'], 'logicalorder');
if($order < 1 || $order >= 1000)
{
$order = 1;
}
if($category == '') if($category == '')
{ {
@@ -481,7 +488,7 @@ elseif($page == 'categories'
} }
else else
{ {
ticket::addCategory($db, $category, $userinfo['adminid'], $order); ticket::addCategory($db, $category, $userinfo['adminid']);
$log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'");
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
@@ -498,12 +505,6 @@ elseif($page == 'categories'
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$category = validate($_POST['category'], 'category'); $category = validate($_POST['category'], 'category');
$order = validate($_POST['logicalorder'], 'logicalorder');
if($order < 1 || $order >= 1000)
{
$order = 1;
}
if($category == '') if($category == '')
{ {
@@ -511,7 +512,7 @@ elseif($page == 'categories'
} }
else else
{ {
ticket::editCategory($db, $category, $id, $order); ticket::editCategory($db, $category, $id);
$log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'");
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
@@ -633,15 +634,14 @@ elseif($page == 'archive'
if($_cid != $ticket['customerid']) if($_cid != $ticket['customerid'])
{ {
$cid = $ticket['customerid']; $cid = $ticket['customerid'];
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '` $usr = $db->query_first('SELECT `firstname`, `name`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$cid . '"'); WHERE `customerid` = "' . (int)$cid . '"');
if(isset($usr['loginname'])) { if(isset($usr['loginname'])) {
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')'; $customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
} else { } else {
$customer = $lng['ticket']['nonexistingcustomer']; $customer = $lng['ticket']['nonexistingcustomer'];
} }
eval("\$tickets.=\"" . getTemplate("ticket/tickets_customer") . "\";"); eval("\$tickets.=\"" . getTemplate("ticket/tickets_customer") . "\";");
} }
@@ -718,11 +718,18 @@ elseif($page == 'archive'
} }
$customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1'); $customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1');
$result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ORDER BY `name` ASC"); $result = $db->query_first('SELECT `customerid` FROM `' . TABLE_PANEL_CUSTOMERS . '` ' . ($userinfo['customers_see_all'] ? '' : ' WHERE `adminid` = "' . (int)$userinfo['adminid'] . '" ') . 'ORDER BY `name` ASC');
while($row_customer = $db->fetch_array($result_customers)) if(isset($result['customerid'])
&& $result['customerid'] != '')
{ {
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']); $result2 = $db->query('SELECT `customerid`, `loginname`, `firstname`, `name`
FROM `' . TABLE_PANEL_CUSTOMERS . '` ' . ($userinfo['customers_see_all'] ? '' : ' WHERE `adminid` = "' . (int)$userinfo['adminid'] . '" ') . ' ORDER BY `name` ASC');
while($row = $db->fetch_array($result2))
{
$customers.= makeoption($row['name'] . ', ' . $row['firstname'] . ' (' . $row['loginname'] . ')', $row['customerid']);
}
} }
eval("echo \"" . getTemplate("ticket/archive") . "\";"); eval("echo \"" . getTemplate("ticket/archive") . "\";");

View File

@@ -57,54 +57,30 @@ if($page == 'overview')
if(hasUpdates($version)) if(hasUpdates($version))
{ {
$successful_update = false;
$message = '';
if(isset($_POST['send']) if(isset($_POST['send'])
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
if((isset($_POST['update_preconfig'])
&& isset($_POST['update_changesagreed'])
&& intval($_POST['update_changesagreed']) != 0)
|| !isset($_POST['update_preconfig'])
) {
eval("echo \"" . getTemplate("update/update_start") . "\";");
include_once './install/updatesql.php';
$redirect_url = 'admin_index.php?s=' . $s;
eval("echo \"" . getTemplate("update/update_end") . "\";");
updateCounters();
inserttask('1');
@chmod('./lib/userdata.inc.php', 0440);
$successful_update = true;
}
else
{
$message = '<br /><strong style="color:#ff0000;">You have to agree that you have read the update notifications.</strong>';
}
}
if(!$successful_update) eval("echo \"" . getTemplate("update/update_start") . "\";");
include_once('./install/updatesql.php');
$redirect_url = 'admin_index.php';
eval("echo \"" . getTemplate("update/update_end") . "\";");
updateCounters();
inserttask('1');
@chmod('./lib/userdata.inc.php', 0440);
}
else
{ {
$current_version = $settings['panel']['version']; $current_version = $settings['panel']['version'];
$new_version = $version; $new_version = $version;
$ui_text = $lng['update']['update_information']['part_a']; $ui_text = $lng['update']['update_information'];
$ui_text = str_replace('%curversion', $current_version, $ui_text); $ui_text = str_replace('%curversion', $current_version, $ui_text);
$ui_text = str_replace('%newversion', $new_version, $ui_text); $ui_text = str_replace('%newversion', $new_version, $ui_text);
$update_information = $ui_text; $update_information = $ui_text;
include_once './install/updates/preconfig.php';
$preconfig = getPreConfig($current_version);
if($preconfig != '')
{
$update_information .= '<br />'.$preconfig.$message;
}
$update_information .= $lng['update']['update_information']['part_b'];
eval("echo \"" . getTemplate("update/index") . "\";"); eval("echo \"" . getTemplate("update/index") . "\";");
} }
@@ -116,7 +92,7 @@ if($page == 'overview')
*/ */
$success_message = $lng['update']['noupdatesavail']; $success_message = $lng['update']['noupdatesavail'];
$redirect_url = 'admin_index.php?s=' . $s; $redirect_url = 'admin_index.php';
eval("echo \"" . getTemplate("update/noupdatesavail") . "\";"); eval("echo \"" . getTemplate("update/noupdatesavail") . "\";");
} }
} }

View File

@@ -107,7 +107,7 @@ if($action == "add")
} }
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true); $date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true); $date_until_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
eval("echo \"" . getTemplate("email/autoresponder_add") . "\";"); eval("echo \"" . getTemplate("email/autoresponder_add") . "\";");
} }
@@ -229,7 +229,7 @@ if($action == "edit")
$deactivated = '0'; $deactivated = '0';
$date_until = date('d-m-Y', $date_until); $date_until = date('d-m-Y', $date_until);
} }
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); $date_from_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
$checked = ''; $checked = '';

View File

@@ -68,13 +68,13 @@ elseif($page == 'domains')
$row['domainalias'] = $idna_convert->decode($row['domainalias']); $row['domainalias'] = $idna_convert->decode($row['domainalias']);
if($row['parentdomainid'] == '0' if($row['parentdomainid'] == '0'
&& $row['iswildcarddomain'] != '1'
&& $row['caneditdomain'] == '1') && $row['caneditdomain'] == '1')
{ {
$parentdomains_count++; $parentdomains_count++;
} }
$domains_count++; $domains_count++;
/*
$domainparts = explode('.', $row['domain']); $domainparts = explode('.', $row['domain']);
$domainparts = array_reverse($domainparts); $domainparts = array_reverse($domainparts);
$sortkey = ''; $sortkey = '';
@@ -82,9 +82,8 @@ elseif($page == 'domains')
{ {
$sortkey.= $part . '.'; $sortkey.= $part . '.';
} }
$domain_array[$sortkey] = $row; $domain_array[$sortkey] = $row;
*/
$domain_array[$row['domain']] = $row;
} }
ksort($domain_array); ksort($domain_array);
@@ -126,11 +125,6 @@ elseif($page == 'domains')
if($paging->checkDisplay($i)) if($paging->checkDisplay($i))
{ {
$row = htmlentities_array($domain_array[$sortkey]); $row = htmlentities_array($domain_array[$sortkey]);
if($settings['system']['awstats_enabled'] == '1') {
$statsapp = 'awstats';
} else {
$statsapp = 'webalizer';
}
eval("\$domains.=\"" . getTemplate("domains/domains_delimiter") . "\";"); eval("\$domains.=\"" . getTemplate("domains/domains_delimiter") . "\";");
if($paging->sortfield == 'd.domain' if($paging->sortfield == 'd.domain'
@@ -184,14 +178,6 @@ elseif($page == 'domains')
} }
} }
/*
* check for APS packages used with this domain, #110
*/
if(domainHasApsInstances($id))
{
standard_error('domains_cantdeletedomainwithapsinstances');
}
$log->logAction(USR_ACTION, LOG_INFO, "deleted subdomain '" . $idna_convert->decode($result['domain']) . "'"); $log->logAction(USR_ACTION, LOG_INFO, "deleted subdomain '" . $idna_convert->decode($result['domain']) . "'");
$result = $db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $result = $db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`-1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`-1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
@@ -219,19 +205,17 @@ elseif($page == 'domains')
{ {
$subdomain = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong'))); $subdomain = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong')));
$domain = $idna_convert->encode($_POST['domain']); $domain = $idna_convert->encode($_POST['domain']);
$domain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($domain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `caneditdomain`='1' "); $domain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($domain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `iswildcarddomain`='0' AND `caneditdomain`='1' ");
$completedomain = $subdomain . '.' . $domain; $completedomain = $subdomain . '.' . $domain;
$completedomain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($completedomain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `email_only`='0' AND `caneditdomain` = '1'"); $completedomain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($completedomain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `email_only`='0' AND `caneditdomain` = '1'");
$aliasdomain = intval($_POST['alias']); $aliasdomain = intval($_POST['alias']);
$aliasdomain_check = array( $aliasdomain_check = array(
'id' => 0 'id' => 0
); );
$_doredirect = false;
if($aliasdomain != 0) if($aliasdomain != 0)
{ {
// also check ip/port combination to be the same, #176 $aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\'');
$aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$domain_check['ipandport'].'\'');
} }
if(isset($_POST['url']) if(isset($_POST['url'])
@@ -239,7 +223,6 @@ elseif($page == 'domains')
&& validateUrl($idna_convert->encode($_POST['url']))) && validateUrl($idna_convert->encode($_POST['url'])))
{ {
$path = $_POST['url']; $path = $_POST['url'];
$_doredirect = true;
} }
else else
{ {
@@ -251,14 +234,6 @@ elseif($page == 'domains')
{ {
$path = $userinfo['documentroot'] . '/' . $path; $path = $userinfo['documentroot'] . '/' . $path;
$path = makeCorrectDir($path); $path = makeCorrectDir($path);
if (strstr($path, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
}
else
{
$_doredirect = true;
} }
if(isset($_POST['openbasedir_path']) if(isset($_POST['openbasedir_path'])
@@ -311,38 +286,7 @@ elseif($page == 'domains')
} }
else else
{ {
// get the phpsettingid from parentdomain, #107 $result = $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`customerid`, `domain`, `documentroot`, `ipandport`, `aliasdomain`, `parentdomainid`, `isemaildomain`, `openbasedir`, `openbasedir_path`, `safemode`, `speciallogfile`, `specialsettings`, `ssl_redirect`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($completedomain) . "', '" . $db->escape($path) . "', '" . $db->escape($domain_check['ipandport']) . "', " . (($aliasdomain != 0) ? "'" . $db->escape($aliasdomain) . "'" : "NULL") . ", '" . (int)$domain_check['id'] . "', '" . ($domain_check['subcanemaildomain'] == '3' ? '1' : '0') . "', '" . $db->escape($domain_check['openbasedir']) . "', '" . $db->escape($openbasedir_path) . "', '" . $db->escape($domain_check['safemode']) . "', '" . $db->escape($domain_check['speciallogfile']) . "', '" . $db->escape($domain_check['specialsettings']) . "', '" . $ssl_redirect . "')");
$phpsid_result = $db->query_first("SELECT `phpsettingid` FROM `".TABLE_PANEL_DOMAINS."` WHERE `id` = '".(int)$domain_check['id']."'");
if(!isset($phpsid_result['phpsettingid'])
|| (int)$phpsid_result['phpsettingid'] <= 0
) {
// assign default config
$phpsid_result['phpsettingid'] = 1;
}
$result = $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
`customerid` = '" . (int)$userinfo['customerid'] . "',
`domain` = '" . $db->escape($completedomain) . "',
`documentroot` = '" . $db->escape($path) . "',
`ipandport` = '" . $db->escape($domain_check['ipandport']) . "',
`aliasdomain` = ".(($aliasdomain != 0) ? "'" . $db->escape($aliasdomain) . "'" : "NULL") .",
`parentdomainid` = '" . (int)$domain_check['id'] . "',
`isemaildomain` = '" . ($domain_check['subcanemaildomain'] == '3' ? '1' : '0') . "',
`openbasedir` = '" . $db->escape($domain_check['openbasedir']) . "',
`openbasedir_path` = '" . $db->escape($openbasedir_path) . "',
`safemode` = '" . $db->escape($domain_check['safemode']) . "',
`speciallogfile` = '" . $db->escape($domain_check['speciallogfile']) . "',
`specialsettings` = '" . $db->escape($domain_check['specialsettings']) . "',
`ssl_redirect` = '" . $ssl_redirect . "',
`phpsettingid` = '" . $phpsid_result['phpsettingid'] . "'");
if($_doredirect)
{
$did = $db->insert_id();
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : $settings['customredirect']['default'];
addRedirectToDomain($did, $redirect);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'"); $log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'");
inserttask('1'); inserttask('1');
@@ -352,7 +296,7 @@ elseif($page == 'domains')
} }
else else
{ {
$result = $db->query("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `caneditdomain`='1' ORDER BY `domain` ASC"); $result = $db->query("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `iswildcarddomain`='0' AND `caneditdomain`='1' ORDER BY `domain` ASC");
$domains = ''; $domains = '';
while($row = $db->fetch_array($result)) while($row = $db->fetch_array($result))
@@ -368,16 +312,6 @@ elseif($page == 'domains')
$aliasdomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']); $aliasdomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']);
} }
if($settings['customredirect']['enabled'] == '1')
{
$redirectcode = '';
$codes = getRedirectCodesArray();
foreach($codes as $rc)
{
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $settings['customredirect']['default']);
}
}
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); $ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true); $openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
@@ -388,10 +322,9 @@ elseif($page == 'domains')
elseif($action == 'edit' elseif($action == 'edit'
&& $id != 0) && $id != 0)
{ {
$result = $db->query_first("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_redirect`, `d`.`aliasdomain`, `d`.`openbasedir_path`, `d`.`ipandport`, `pd`.`subcanemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_DOMAINS . "` `pd` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`id`='" . (int)$id . "' AND ((`d`.`parentdomainid`!='0' AND `pd`.`id`=`d`.`parentdomainid`) OR (`d`.`parentdomainid`='0' AND `pd`.`id`=`d`.`id`)) AND `d`.`caneditdomain`='1'"); $result = $db->query_first("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_redirect`, `d`.`aliasdomain`, `d`.`openbasedir_path` ,`pd`.`subcanemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_DOMAINS . "` `pd` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`id`='" . (int)$id . "' AND ((`d`.`parentdomainid`!='0' AND `pd`.`id`=`d`.`parentdomainid`) OR (`d`.`parentdomainid`='0' AND `pd`.`id`=`d`.`id`)) AND `d`.`caneditdomain`='1'");
$alias_check = $db->query_first('SELECT COUNT(`id`) AS count FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . (int)$result['id'] . '\''); $alias_check = $db->query_first('SELECT COUNT(`id`) AS count FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . (int)$result['id'] . '\'');
$alias_check = $alias_check['count']; $alias_check = $alias_check['count'];
$_doredirect = false;
if(isset($result['customerid']) if(isset($result['customerid'])
&& $result['customerid'] == $userinfo['customerid']) && $result['customerid'] == $userinfo['customerid'])
@@ -404,7 +337,6 @@ elseif($page == 'domains')
&& validateUrl($idna_convert->encode($_POST['url']))) && validateUrl($idna_convert->encode($_POST['url'])))
{ {
$path = $_POST['url']; $path = $_POST['url'];
$_doredirect = true;
} }
else else
{ {
@@ -416,14 +348,6 @@ elseif($page == 'domains')
{ {
$path = $userinfo['documentroot'] . '/' . $path; $path = $userinfo['documentroot'] . '/' . $path;
$path = makeCorrectDir($path); $path = makeCorrectDir($path);
if (strstr($path, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
}
else
{
$_doredirect = true;
} }
$aliasdomain = intval($_POST['alias']); $aliasdomain = intval($_POST['alias']);
@@ -431,7 +355,16 @@ elseif($page == 'domains')
if(isset($_POST['iswildcarddomain']) if(isset($_POST['iswildcarddomain'])
&& $_POST['iswildcarddomain'] == '1' && $_POST['iswildcarddomain'] == '1'
&& $result['parentdomainid'] == '0' && $result['parentdomainid'] == '0'
){ && $userinfo['subdomains'] != '0')
{
$wildcarddomaincheck = $db->query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid` = '" . (int)$result['id'] . "'");
if($db->num_rows($wildcarddomaincheck) != '0')
{
standard_error('firstdeleteallsubdomains');
exit;
}
$iswildcarddomain = '1'; $iswildcarddomain = '1';
} }
else else
@@ -498,12 +431,6 @@ elseif($page == 'domains')
$log->logAction(USR_ACTION, LOG_NOTICE, "automatically deleted mail-table entries for '" . $idna_convert->decode($result['domain']) . "'"); $log->logAction(USR_ACTION, LOG_NOTICE, "automatically deleted mail-table entries for '" . $idna_convert->decode($result['domain']) . "'");
} }
if($_doredirect)
{
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : false;
updateRedirectOfDomain($id, $redirect);
}
if($path != $result['documentroot'] if($path != $result['documentroot']
|| $isemaildomain != $result['isemaildomain'] || $isemaildomain != $result['isemaildomain']
|| $iswildcarddomain != $result['iswildcarddomain'] || $iswildcarddomain != $result['iswildcarddomain']
@@ -524,8 +451,7 @@ elseif($page == 'domains')
{ {
$result['domain'] = $idna_convert->decode($result['domain']); $result['domain'] = $idna_convert->decode($result['domain']);
$domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], true); $domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], true);
// also check ip/port combination to be the same, #176 $result_domains = $db->query("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` ORDER BY `d`.`domain` ASC");
$result_domains = $db->query("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` AND `d`.`ipandport` = '".(int)$result['ipandport']."' ORDER BY `d`.`domain` ASC");
while($row_domain = $db->fetch_array($result_domains)) while($row_domain = $db->fetch_array($result_domains))
{ {
@@ -545,30 +471,16 @@ elseif($page == 'domains')
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']);
} }
if($settings['customredirect']['enabled'] == '1')
{
$def_code = getDomainRedirectId($id);
$redirectcode = '';
$codes = getRedirectCodesArray();
foreach($codes as $rc)
{
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $def_code);
}
}
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); $ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']); $iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); $isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true); $openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
$result_ipandport = $db->query_first("SELECT `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id`='".(int)$result['ipandport']."'");
if(filter_var($result_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
{
$result_ipandport['ip'] = '[' . $result_ipandport['ip'] . ']';
}
$domainip = $result_ipandport['ip'];
$result = htmlentities_array($result); $result = htmlentities_array($result);
if($settings['system']['use_ssl'] == "1")
{
}
eval("echo \"" . getTemplate("domains/domains_edit") . "\";"); eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
} }
} }

View File

@@ -139,10 +139,8 @@ elseif($page == 'emails')
} }
} }
$emaildomains_count = $db->query_first("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `isemaildomain`='1' ORDER BY `domain` ASC"); $emaildomains_count = $db->query_first("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . $userinfo['customerid'] . "' AND `isemaildomain`='1' ORDER BY `domain` ASC");
$emaildomains_count = $emaildomains_count['count']; $emaildomains_count = $emaildomains_count['count'];
$emailscount = $db->num_rows($result);
eval("echo \"" . getTemplate("email/emails") . "\";"); eval("echo \"" . getTemplate("email/emails") . "\";");
} }
elseif($action == 'delete' elseif($action == 'delete'
@@ -184,12 +182,6 @@ elseif($page == 'emails')
$number_forwarders = 0; $number_forwarders = 0;
} }
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `emails_used`=`emails_used` - 1 , `email_forwarders_used` = `email_forwarders_used` - " . (int)$number_forwarders . " $update_users_query_addon WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `emails_used`=`emails_used` - 1 , `email_forwarders_used` = `email_forwarders_used` - " . (int)$number_forwarders . " $update_users_query_addon WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'"); $log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'");
@@ -197,12 +189,7 @@ elseif($page == 'emails')
} }
else else
{ {
if(maildirExists($result)) { ask_yesno('email_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
$show_checkbox = true;
} else {
$show_checkbox = false;
}
ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']), $show_checkbox);
} }
} }
} }
@@ -385,7 +372,6 @@ elseif($page == 'accounts')
$email_full = $result['email_full']; $email_full = $result['email_full'];
$username = $idna_convert->decode($email_full); $username = $idna_convert->decode($email_full);
$password = validate($_POST['email_password'], 'password'); $password = validate($_POST['email_password'], 'password');
$password = validatePassword($password);
if($settings['panel']['sendalternativemail'] == 1) if($settings['panel']['sendalternativemail'] == 1)
{ {
@@ -460,7 +446,7 @@ elseif($page == 'accounts')
if ($_mailerror) { if ($_mailerror) {
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg); $log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $email_full); standard_error('errorsendingmail', $email);
} }
$mail->ClearAddresses(); $mail->ClearAddresses();
@@ -532,12 +518,12 @@ elseif($page == 'accounts')
standard_error(array('stringisempty', 'mypassword')); standard_error(array('stringisempty', 'mypassword'));
exit; exit;
} }
else
$password = validatePassword($password); {
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'"); $result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'");
$result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'"); redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); }
} }
else else
{ {
@@ -613,19 +599,13 @@ elseif($page == 'accounts')
$quota = 0; $quota = 0;
} }
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_accounts_used` = `email_accounts_used` - 1, `email_quota_used` = `email_quota_used` - " . (int)$quota . " WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_accounts_used` = `email_accounts_used` - 1, `email_quota_used` = `email_quota_used` - " . (int)$quota . " WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email account for '" . $result['email_full'] . "'"); $log->logAction(USR_ACTION, LOG_INFO, "deleted email account for '" . $result['email_full'] . "'");
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
} }
else else
{ {
ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full'])); ask_yesno('email_reallydelete_account', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
} }
} }
} }

View File

@@ -49,7 +49,7 @@ elseif($page == 'htpasswds')
'path' => $lng['panel']['path'] 'path' => $lng['panel']['path']
); );
$paging = new paging($userinfo, $db, TABLE_PANEL_HTPASSWDS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']); $paging = new paging($userinfo, $db, TABLE_PANEL_HTPASSWDS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); $result = $db->query("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result)); $paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -81,7 +81,7 @@ elseif($page == 'htpasswds')
elseif($action == 'delete' elseif($action == 'delete'
&& $id != 0) && $id != 0)
{ {
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $result = $db->query_first("SELECT `id`, `customerid`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
if(isset($result['username']) if(isset($result['username'])
&& $result['username'] != '') && $result['username'] != '')
@@ -114,7 +114,6 @@ elseif($page == 'htpasswds')
$userpath = $path; $userpath = $path;
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path); $path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
$username = validate($_POST['username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/'); $username = validate($_POST['username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
validate($_POST['directory_password'], 'password'); validate($_POST['directory_password'], 'password');
$username_path_check = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `username`='" . $db->escape($username) . "' AND `path`='" . $db->escape($path) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'"); $username_path_check = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `username`='" . $db->escape($username) . "' AND `path`='" . $db->escape($path) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
@@ -152,7 +151,7 @@ elseif($page == 'htpasswds')
} }
else else
{ {
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` (`customerid`, `username`, `password`, `path`, `authname`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($password) . "', '" . $db->escape($path) . "', '" . $db->escape($authname) . "')"); $db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` (`customerid`, `username`, `password`, `path`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($password) . "', '" . $db->escape($path) . "')");
$log->logAction(USR_ACTION, LOG_INFO, "added htpasswd for '" . $username . " (" . $path . ")'"); $log->logAction(USR_ACTION, LOG_INFO, "added htpasswd for '" . $username . " (" . $path . ")'");
inserttask('1'); inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -167,7 +166,7 @@ elseif($page == 'htpasswds')
elseif($action == 'edit' elseif($action == 'edit'
&& $id != 0) && $id != 0)
{ {
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $result = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
if(isset($result['username']) if(isset($result['username'])
&& $result['username'] != '') && $result['username'] != '')
@@ -176,7 +175,6 @@ elseif($page == 'htpasswds')
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
validate($_POST['directory_password'], 'password'); validate($_POST['directory_password'], 'password');
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
if(CRYPT_STD_DES == 1) if(CRYPT_STD_DES == 1)
{ {
@@ -188,25 +186,13 @@ elseif($page == 'htpasswds')
$password = crypt($_POST['directory_password']); $password = crypt($_POST['directory_password']);
} }
$pwd_sql = ''; if($_POST['directory_password'] == '')
if($_POST['directory_password'] != '')
{ {
$pwd_sql = "`password`='" . $db->escape($password) . "' "; standard_error(array('stringisempty', 'mypassword'));
} }
else
$auth_sql = '';
if($authname != $result['authname'])
{ {
$auth_sql = "`authname`='" . $db->escape($authname) . "' "; $db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
}
if($pwd_sql != '' || $auth_sql != '')
{
if($pwd_sql !='' && $auth_sql != '') {
$pwd_sql.= ', ';
}
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET ".$pwd_sql.$auth_sql." WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$log->logAction(USR_ACTION, LOG_INFO, "edited htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'"); $log->logAction(USR_ACTION, LOG_INFO, "edited htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
inserttask('1'); inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -235,11 +221,10 @@ elseif($page == 'htaccess')
'options_indexes' => $lng['extras']['view_directory'], 'options_indexes' => $lng['extras']['view_directory'],
'error404path' => $lng['extras']['error404path'], 'error404path' => $lng['extras']['error404path'],
'error403path' => $lng['extras']['error403path'], 'error403path' => $lng['extras']['error403path'],
'error500path' => $lng['extras']['error500path'], 'error500path' => $lng['extras']['error500path']
'options_cgi' => $lng['extras']['execute_perl']
); );
$paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']); $paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); $result = $db->query("SELECT `id`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result)); $paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -249,8 +234,6 @@ elseif($page == 'htaccess')
$count = 0; $count = 0;
$htaccess = ''; $htaccess = '';
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
while($row = $db->fetch_array($result)) while($row = $db->fetch_array($result))
{ {
if($paging->checkDisplay($i)) if($paging->checkDisplay($i))
@@ -258,14 +241,10 @@ elseif($page == 'htaccess')
if(strpos($row['path'], $userinfo['documentroot']) === 0) if(strpos($row['path'], $userinfo['documentroot']) === 0)
{ {
$row['path'] = substr($row['path'], strlen($userinfo['documentroot'])); $row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($row['path'] == '') { $row['path'] = '/'; }
} }
$row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']); $row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']); $row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
$row = htmlentities_array($row); $row = htmlentities_array($row);
eval("\$htaccess.=\"" . getTemplate("extras/htaccess_htaccess") . "\";"); eval("\$htaccess.=\"" . getTemplate("extras/htaccess_htaccess") . "\";");
$count++; $count++;
@@ -314,18 +293,35 @@ elseif($page == 'htaccess')
standard_error('invalidpath'); standard_error('invalidpath');
} }
if(isset($_POST['options_cgi'])) if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
{ {
$options_cgi = intval($_POST['options_cgi']); $error404path = $_POST['error404path'];
} }
else else
{ {
$options_cgi = '0'; standard_error('mustbeurl');
} }
$error404path = correctErrorDocument($_POST['error404path']); if(($_POST['error403path'] === '')
$error403path = correctErrorDocument($_POST['error403path']); || (validateUrl($idna_convert->encode($_POST['error403path']))))
$error500path = correctErrorDocument($_POST['error500path']); {
$error403path = $_POST['error403path'];
}
else
{
standard_error('mustbeurl');
}
if(($_POST['error500path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error500path']))))
{
$error500path = $_POST['error500path'];
}
else
{
standard_error('mustbeurl');
}
if($path_dupe_check['path'] == $path) if($path_dupe_check['path'] == $path)
{ {
@@ -337,15 +333,7 @@ elseif($page == 'htaccess')
} }
else else
{ {
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` SET $db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` (`customerid`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` ) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($path) . '", "' . $db->escape($_POST['options_indexes'] == '1' ? '1' : '0') . '", "' . $db->escape($error404path) . '", "' . $db->escape($error403path) . '", "' . $db->escape($error500path) . '" )');
`customerid` = "'.(int)$userinfo['customerid'].'",
`path` = "'.$db->escape($path).'",
`options_indexes` = "'.$db->escape($_POST['options_indexes'] == '1' ? '1' : '0').'",
`error404path` = "'.$db->escape($error404path).'",
`error403path` = "'.$db->escape($error403path).'",
`error500path` = "'.$db->escape($error500path).'",
`options_cgi` = "'.$db->escape($options_cgi).'"');
$log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'"); $log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'");
inserttask('1'); inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -354,9 +342,7 @@ elseif($page == 'htaccess')
else else
{ {
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
$options_indexes = makeyesno('options_indexes', '1', '0', '0'); $options_indexes = makeyesno('options_indexes', '1', '0', '1');
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', '0');
eval("echo \"" . getTemplate("extras/htaccess_add") . "\";"); eval("echo \"" . getTemplate("extras/htaccess_add") . "\";");
} }
} }
@@ -373,30 +359,49 @@ elseif($page == 'htaccess')
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$option_indexes = intval($_POST['options_indexes']); $option_indexes = intval($_POST['options_indexes']);
$options_cgi = isset($_POST['options_cgi']) ? intval($_POST['options_cgi']) : 0;
if($option_indexes != '1') if($option_indexes != '1')
{ {
$option_indexes = '0'; $option_indexes = '0';
} }
if($options_cgi != '1') if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
{ {
$options_cgi = '0'; $error404path = $_POST['error404path'];
}
else
{
standard_error('mustbeurl');
} }
$error404path = correctErrorDocument($_POST['error404path']); if(($_POST['error403path'] === '')
$error403path = correctErrorDocument($_POST['error403path']); || (validateUrl($idna_convert->encode($_POST['error403path']))))
$error500path = correctErrorDocument($_POST['error500path']); {
$error403path = $_POST['error403path'];
}
else
{
standard_error('mustbeurl');
}
if(($_POST['error500path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error500path']))))
{
$error500path = $_POST['error500path'];
}
else
{
standard_error('mustbeurl');
}
if(($option_indexes != $result['options_indexes']) if(($option_indexes != $result['options_indexes'])
|| ($error404path != $result['error404path']) || ($error404path != $result['error404path'])
|| ($error403path != $result['error403path']) || ($error403path != $result['error403path'])
|| ($error500path != $result['error500path']) || ($error500path != $result['error500path']))
|| ($options_cgi != $result['options_cgi']))
{ {
inserttask('1'); inserttask('1');
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '", `options_cgi` = "' . $db->escape($options_cgi) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"'); $db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'"); $log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
} }
@@ -407,16 +412,12 @@ elseif($page == 'htaccess')
if(strpos($result['path'], $userinfo['documentroot']) === 0) if(strpos($result['path'], $userinfo['documentroot']) === 0)
{ {
$result['path'] = substr($result['path'], strlen($userinfo['documentroot'])); $result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($result['path'] == '') { $result['path'] = '/'; }
} }
$result['error404path'] = $result['error404path']; $result['error404path'] = $result['error404path'];
$result['error403path'] = $result['error403path']; $result['error403path'] = $result['error403path'];
$result['error500path'] = $result['error500path']; $result['error500path'] = $result['error500path'];
$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']); $options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
$result = htmlentities_array($result); $result = htmlentities_array($result);
eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";"); eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";");
} }

View File

@@ -97,15 +97,12 @@ elseif($page == 'accounts')
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `up_count`=`up_count`+'" . (int)$result['up_count'] . "', `up_bytes`=`up_bytes`+'" . (int)$result['up_bytes'] . "', `down_count`=`down_count`+'" . (int)$result['down_count'] . "', `down_bytes`=`down_bytes`+'" . (int)$result['down_bytes'] . "' WHERE `username`='" . $db->escape($userinfo['loginname']) . "'"); $db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `up_count`=`up_count`+'" . (int)$result['up_count'] . "', `up_bytes`=`up_bytes`+'" . (int)$result['up_bytes'] . "', `down_count`=`down_count`+'" . (int)$result['down_count'] . "', `down_bytes`=`down_bytes`+'" . (int)$result['down_bytes'] . "' WHERE `username`='" . $db->escape($userinfo['loginname']) . "'");
$result = $db->query("SELECT `username` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
while($row = $db->fetch_array($result))
{
$db->query("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $db->escape($row['username']) . "'");
}
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'"); $log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
// $db->query("DELETE FROM `".TABLE_FTP_GROUPS."` WHERE `customerid`='".$userinfo['customerid']."' AND `id`='$id'");
if($userinfo['ftps_used'] == '1') if($userinfo['ftps_used'] == '1')
{ {
$resetaccnumber = " , `ftp_lastaccountnumber`='0'"; $resetaccnumber = " , `ftp_lastaccountnumber`='0'";
@@ -115,19 +112,12 @@ elseif($page == 'accounts')
$resetaccnumber = ''; $resetaccnumber = '';
} }
// refs #293
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('8', $userinfo['loginname'], $result['homedir']);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
else else
{ {
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']); ask_yesno('ftp_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
} }
} }
else else
@@ -145,13 +135,6 @@ elseif($page == 'accounts')
{ {
$path = validate($_POST['path'], 'path'); $path = validate($_POST['path'], 'path');
$password = validate($_POST['ftp_password'], 'password'); $password = validate($_POST['ftp_password'], 'password');
$password = validatePassword($password);
$sendinfomail = intval($_POST['sendinfomail']);
if($sendinfomail != 1)
{
$sendinfomail = 0;
}
if($settings['customer']['ftpatdomain'] == '1') if($settings['customer']['ftpatdomain'] == '1')
{ {
@@ -189,64 +172,26 @@ elseif($page == 'accounts')
} }
else else
{ {
$userpath = makeCorrectDir($path);
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path); $path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
$db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')"); $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')");
$result = $db->query("SELECT `bytes_in_used` FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $userinfo['loginname'] . "'");
while($row = $db->fetch_array($result))
{
$db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($username) . "', 'user', '" . $db->escape($row[bytes_in_used]) . "', '0', '0', '0', '0', '0')");
}
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'"); $db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
// $db->query("INSERT INTO `".TABLE_FTP_GROUPS."` (`customerid`, `groupname`, `gid`, `members`) VALUES ('".$userinfo['customerid']."', '$username', '$uid', '$username')");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
// $db->query("UPDATE `".TABLE_PANEL_SETTINGS."` SET `value`='$uid' WHERE settinggroup='ftp' AND varname='lastguid'");
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'"); $log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
inserttask(5); inserttask(5);
if($sendinfomail == 1)
{
$replace_arr = array(
'CUST_NAME' => getCorrectUserSalutation($userinfo),
'USR_NAME' => $username,
'USR_PASS' => $password,
'USR_PATH' => makeCorrectDir(substr($path, strlen($userinfo['documentroot'])))
);
$def_language = $userinfo['def_language'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_body']['main']), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
$mail->Send();
} catch(phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $userinfo['email']);
}
$mail->ClearAddresses();
}
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
} }
else else
{ {
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], '/'); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
if($settings['customer']['ftpatdomain'] == '1') if($settings['customer']['ftpatdomain'] == '1')
{ {
@@ -260,8 +205,6 @@ elseif($page == 'accounts')
} }
} }
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";"); eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
} }
} }
@@ -269,7 +212,7 @@ elseif($page == 'accounts')
elseif($action == 'edit' elseif($action == 'edit'
&& $id != 0) && $id != 0)
{ {
$result = $db->query_first("SELECT `id`, `username`, `homedir`, `uid`, `gid` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); $result = $db->query_first("SELECT `id`, `username`, `homedir` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
if(isset($result['username']) if(isset($result['username'])
&& $result['username'] != '') && $result['username'] != '')
@@ -277,78 +220,26 @@ elseif($page == 'accounts')
if(isset($_POST['send']) if(isset($_POST['send'])
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$path = validate($_POST['path'], 'path'); $password = validate($_POST['ftp_password'], 'password');
$_setnewpass = false;
if(isset($_POST['ftp_password']) && $_POST['ftp_password'] != '')
{
$password = validate($_POST['ftp_password'], 'password');
$password = validatePassword($password);
$_setnewpass = true;
}
if($_setnewpass) if($password == '')
{ {
if($password == '') standard_error(array('stringisempty', 'mypassword'));
{ exit;
standard_error(array('stringisempty', 'mypassword'));
exit;
}
else
{
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
}
}
if($path != '')
{
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
if($path != $result['homedir'])
{
if(!file_exists($path))
{
mkDirWithCorrectOwnership($userinfo['documentroot'], $path, $result['uid'], $result['gid']);
}
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account homdir for '" . $result['username'] . "'");
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `homedir`= '" . $db->escape($path) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
}
}
redirectTo($filename, Array('page' => $page, 's' => $s));
}
else
{
if(strpos($result['homedir'], $userinfo['documentroot']) === 0)
{
$homedir = substr($result['homedir'], strlen($userinfo['documentroot']));
} }
else else
{ {
$homedir = $result['homedir']; $db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'");
redirectTo($filename, Array('page' => $page, 's' => $s));
} }
$homedir = makeCorrectDir($homedir); }
else
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $homedir); {
if($settings['customer']['ftpatdomain'] == '1')
{
$domains = '';
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
while($row_domain = $db->fetch_array($result_domains))
{
$domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
}
}
eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";"); eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";");
} }
} }
} }
} }
?> ?>

View File

@@ -172,14 +172,9 @@ elseif($page == 'change_language')
{ {
$language_options = ''; $language_options = '';
$default_lang = $settings['panel']['standardlanguage'];
if($userinfo['def_language'] != '') {
$default_lang = $userinfo['def_language'];
}
while(list($language_file, $language_name) = each($languages)) while(list($language_file, $language_name) = each($languages))
{ {
$language_options.= makeoption($language_name, $language_file, $default_lang, true); $language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
} }
eval("echo \"" . getTemplate("index/change_language") . "\";"); eval("echo \"" . getTemplate("index/change_language") . "\";");

View File

@@ -52,7 +52,7 @@ elseif($page == 'mysqls')
'description' => $lng['mysql']['databasedescription'] 'description' => $lng['mysql']['databasedescription']
); );
$paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']); $paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); $result = $db->query("SELECT `id`, `databasename`, `description`, `dbserver` FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result)); $paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -139,13 +139,6 @@ elseif($page == 'mysqls')
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$password = validate($_POST['mysql_password'], 'password'); $password = validate($_POST['mysql_password'], 'password');
$password = validatePassword($password);
$sendinfomail = intval($_POST['sendinfomail']);
if($sendinfomail != 1)
{
$sendinfomail = 0;
}
if($password == '') if($password == '')
{ {
@@ -191,53 +184,6 @@ elseif($page == 'mysqls')
$databasedescription = validate($_POST['description'], 'description'); $databasedescription = validate($_POST['description'], 'description');
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($username) . '", "' . $db->escape($databasedescription) . '", "' . $db->escape($dbserver) . '")'); $result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($username) . '", "' . $db->escape($databasedescription) . '", "' . $db->escape($dbserver) . '")');
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1, `mysql_lastaccountnumber`=`mysql_lastaccountnumber`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"'); $result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1, `mysql_lastaccountnumber`=`mysql_lastaccountnumber`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
if($sendinfomail == 1)
{
$pma = $lng['admin']['notgiven'];
if($settings['panel']['phpmyadmin_url'] != '')
{
$pma = $settings['panel']['phpmyadmin_url'];
}
$replace_arr = array(
'CUST_NAME' => getCorrectUserSalutation($userinfo),
'DB_NAME' => $username,
'DB_PASS' => $password,
'DB_DESC' => $databasedescription,
'DB_SRV' => $sql_root[$dbserver]['host'],
'PMA_URI' => $pma
);
$def_language = $userinfo['def_language'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_body']['main']), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
$mail->Send();
} catch(phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $userinfo['email']);
}
$mail->ClearAddresses();
}
redirectTo($filename, Array('page' => $page, 's' => $s)); redirectTo($filename, Array('page' => $page, 's' => $s));
} }
} }
@@ -250,8 +196,6 @@ elseif($page == 'mysqls')
$mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server); $mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
} }
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";"); eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
} }
} }
@@ -273,14 +217,13 @@ elseif($page == 'mysqls')
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
// Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29 // Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29
$password = validate($_POST['mysql_password'], 'password'); $password = validate($_POST['mysql_password'], 'password');
if($password != '') if($password != '')
{ {
// validate password
$password = validatePassword($password);
// Begin root-session // Begin root-session
$db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], ''); $db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], '');
unset($db_root->password); unset($db_root->password);
foreach(array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) foreach(array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host)

View File

@@ -209,12 +209,12 @@ elseif($page == 'tickets')
else else
{ {
$categories = ''; $categories = '';
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC'); $result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
if(isset($result['name']) if(isset($result['name'])
&& $result['name'] != '') && $result['name'] != '')
{ {
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC'); $result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
while($row = $db->fetch_array($result2)) while($row = $db->fetch_array($result2))
{ {
@@ -226,9 +226,9 @@ elseif($page == 'tickets')
$categories = makeoption($lng['ticket']['no_cat'], '0'); $categories = makeoption($lng['ticket']['no_cat'], '0');
} }
$priorities = makeoption($lng['ticket']['unf_high'], '1', $settings['ticket']['default_priority']); $priorities = makeoption($lng['ticket']['unf_high'], '1');
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', $settings['ticket']['default_priority']); $priorities.= makeoption($lng['ticket']['unf_normal'], '2');
$priorities.= makeoption($lng['ticket']['unf_low'], '3', $settings['ticket']['default_priority']); $priorities.= makeoption($lng['ticket']['unf_low'], '3');
$ticketsopen = 0; $ticketsopen = 0;
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '` $opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
WHERE `customerid` = "' . $userinfo['customerid'] . '" WHERE `customerid` = "' . $userinfo['customerid'] . '"

View File

@@ -178,18 +178,9 @@ else
FROM `" . TABLE_PANEL_TRAFFIC . "` FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE `customerid`='" . $userinfo['customerid'] . "' WHERE `customerid`='" . $userinfo['customerid'] . "'
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12"); GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
$row = mysql_fetch_row($result);
$nums = mysql_num_rows($result); rsort($row);
if($nums > 0) $traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));
{
$row = mysql_fetch_row($result);
rsort($row);
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));
} else {
// no records yet
$traf['max'] = 0;
}
$result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail $result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "' FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "'
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12"); GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");

156
index.php
View File

@@ -213,126 +213,96 @@ if($action == 'login')
if($action == 'forgotpwd') if($action == 'forgotpwd')
{ {
$adminchecked = false;
$message = '';
if(isset($_POST['send']) if(isset($_POST['send'])
&& $_POST['send'] == 'send') && $_POST['send'] == 'send')
{ {
$adminchecked = false;
$loginname = validate($_POST['loginname'], 'loginname'); $loginname = validate($_POST['loginname'], 'loginname');
$email = validateEmail($_POST['loginemail'], 'email'); $email = validateEmail($_POST['loginemail'], 'email');
$sql = "SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language` FROM `" . TABLE_PANEL_CUSTOMERS . "` $sql = "SELECT `customerid`, `firstname`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `loginname`='" . $db->escape($loginname) . "' WHERE `loginname`='" . $db->escape($loginname) . "'
AND `email`='" . $db->escape($email) . "'"; AND `email`='" . $db->escape($email) . "'";
$result = $db->query($sql); $result = $db->query($sql);
if($db->num_rows() == 0) if($db->num_rows() == 0)
{ {
$sql = "SELECT `adminid`, `name`, `email`, `loginname`, `def_language` FROM `" . TABLE_PANEL_ADMINS . "` $sql = "SELECT `adminid`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
WHERE `loginname`='" . $db->escape($loginname) . "' WHERE `loginname`='" . $db->escape($loginname) . "'
AND `email`='" . $db->escape($email) . "'"; AND `email`='" . $db->escape($email) . "'";
$result = $db->query($sql); $result = $db->query($sql);
$adminchecked = true;
if($db->num_rows() > 0)
{
$adminchecked = true;
}
else
{
$result = null;
}
} }
if($result !== null) $user = $db->fetch_array($result);
if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|| $adminchecked == false)
{ {
$user = $db->fetch_array($result); if($user !== false)
if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|| $adminchecked == false)
{ {
if($user !== false) $password = substr(md5(uniqid(microtime(), 1)), 12, 6);
if($adminchecked)
{ {
if ($settings['panel']['password_min_length'] <= 6) { $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($password) . "'
$password = substr(md5(uniqid(microtime(), 1)), 12, 6); WHERE `loginname`='" . $user['loginname'] . "'
} else { AND `email`='" . $user['email'] . "'");
// make it two times larger than password_min_length
$rnd = '';
$minlength = $settings['panel']['password_min_length'];
while (strlen($rnd) < ($minlength * 2))
{
$rnd .= md5(uniqid(microtime(), 1));
}
$password = substr($rnd, (int)($minlength / 2), $minlength);
}
if($adminchecked)
{
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($password) . "'
WHERE `loginname`='" . $user['loginname'] . "'
AND `email`='" . $user['email'] . "'");
}
else
{
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($password) . "'
WHERE `loginname`='" . $user['loginname'] . "'
AND `email`='" . $user['email'] . "'");
}
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
$replace_arr = array(
'SALUTATION' => getCorrectUserSalutation($user),
'USERNAME' => $user['loginname'],
'PASSWORD' => $password
);
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
$def_language = ($user['def_language'] != '') ? $user['def_language'] : $settings['panel']['standardlanguage'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['pwdreminder']['subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $body), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\\n", "<br />", $mail_body));
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
$mail->Send();
} catch(phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
redirectTo('index.php', Array('showmessage' => '4'), true);
exit;
}
$mail->ClearAddresses();
redirectTo('index.php', Array('showmessage' => '1'), true);
exit;
} }
else else
{ {
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($password) . "'
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to reset pwd but wasn't found in database!"); WHERE `loginname`='" . $user['loginname'] . "'
$message = $lng['login']['usernotfound']; AND `email`='" . $user['email'] . "'");
} }
unset($user); $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
$_mailerror = false;
try {
$mail->Subject = $lng['pwdreminder']['subject'];
$mail->AltBody = $body;
$mail->MsgHTML(str_replace("\\n", "<br />", $body));
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
$mail->Send();
} catch(phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
redirectTo('index.php', Array('showmessage' => '4'), true);
exit;
}
$mail->ClearAddresses();
redirectTo('index.php', Array('showmessage' => '1'), true);
exit;
} }
else
{
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to reset pwd but wasn't found in database!");
$message = $lng['login']['usernotfound'];
}
unset($user);
}
else
{
$message = '';
} }
} }
else
{
$message = '';
}
if($adminchecked) if($adminchecked)
{ {

View File

@@ -227,7 +227,6 @@ CREATE TABLE `panel_customers` (
`imap` tinyint(1) NOT NULL default '1', `imap` tinyint(1) NOT NULL default '1',
`aps_packages` int(5) NOT NULL default '0', `aps_packages` int(5) NOT NULL default '0',
`aps_packages_used` int(5) NOT NULL default '0', `aps_packages_used` int(5) NOT NULL default '0',
`perlenabled` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`customerid`), PRIMARY KEY (`customerid`),
UNIQUE KEY `loginname` (`loginname`) UNIQUE KEY `loginname` (`loginname`)
) TYPE=MyISAM ; ) TYPE=MyISAM ;
@@ -249,7 +248,6 @@ CREATE TABLE `panel_databases` (
`databasename` varchar(255) NOT NULL default '', `databasename` varchar(255) NOT NULL default '',
`description` varchar(255) NOT NULL default '', `description` varchar(255) NOT NULL default '',
`dbserver` int(11) unsigned NOT NULL default '0', `dbserver` int(11) unsigned NOT NULL default '0',
`apsdb` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `customerid` (`customerid`) KEY `customerid` (`customerid`)
) TYPE=MyISAM ; ) TYPE=MyISAM ;
@@ -276,7 +274,7 @@ CREATE TABLE `panel_domains` (
`isbinddomain` tinyint(1) NOT NULL default '0', `isbinddomain` tinyint(1) NOT NULL default '0',
`isemaildomain` tinyint(1) NOT NULL default '0', `isemaildomain` tinyint(1) NOT NULL default '0',
`email_only` tinyint(1) NOT NULL default '0', `email_only` tinyint(1) NOT NULL default '0',
`iswildcarddomain` tinyint(1) NOT NULL default '1', `iswildcarddomain` tinyint(1) NOT NULL default '0',
`subcanemaildomain` tinyint(1) NOT NULL default '0', `subcanemaildomain` tinyint(1) NOT NULL default '0',
`caneditdomain` tinyint(1) NOT NULL default '1', `caneditdomain` tinyint(1) NOT NULL default '1',
`zonefile` varchar(255) NOT NULL default '', `zonefile` varchar(255) NOT NULL default '',
@@ -301,7 +299,6 @@ CREATE TABLE `panel_domains` (
`phpsettingid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1', `phpsettingid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
`mod_fcgid_starter` int(4) default '-1', `mod_fcgid_starter` int(4) default '-1',
`mod_fcgid_maxrequests` int(4) default '-1', `mod_fcgid_maxrequests` int(4) default '-1',
`ismainbutsubto` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `customerid` (`customerid`), KEY `customerid` (`customerid`),
KEY `parentdomain` (`parentdomainid`), KEY `parentdomain` (`parentdomainid`),
@@ -358,7 +355,6 @@ CREATE TABLE `panel_htaccess` (
`error403path` varchar(255) NOT NULL default '', `error403path` varchar(255) NOT NULL default '',
`error500path` varchar(255) NOT NULL default '', `error500path` varchar(255) NOT NULL default '',
`error401path` varchar(255) NOT NULL default '', `error401path` varchar(255) NOT NULL default '',
`options_cgi` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) TYPE=MyISAM ; ) TYPE=MyISAM ;
@@ -380,7 +376,6 @@ CREATE TABLE `panel_htpasswds` (
`path` varchar(255) NOT NULL default '', `path` varchar(255) NOT NULL default '',
`username` varchar(255) NOT NULL default '', `username` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '',
`authname` varchar(255) NOT NULL default 'Restricted Area',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `customerid` (`customerid`) KEY `customerid` (`customerid`)
) TYPE=MyISAM ; ) TYPE=MyISAM ;
@@ -456,7 +451,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.12'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.3');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
@@ -513,78 +508,48 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (77, 'dkim', 'use_dkim', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (77, 'dkim', 'use_dkim', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (78, 'system', 'webalizer_enabled', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (78, 'system', 'webalizer_enabled', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (79, 'system', 'awstats_enabled', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (79, 'system', 'awstats_enabled', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'system', 'awstats_domain_file', '/etc/awstats/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'dkim', 'dkim_domains', 'domains'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'system', 'awstats_model_file', '/etc/awstats/awstats.model.conf.froxlor');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkim_domains', 'domains');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'panel', 'unix_names', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'panel', 'allow_preset', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'allow_preset_admin', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'unix_names', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'system', 'httpuser', 'www-data'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'panel', 'allow_preset', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'httpgroup', 'www-data'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'awstats_path', '/usr/share/awstats/VERSION/webroot/cgi-bin/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'webserver', 'apache2'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'awstats_updateall_command', '/usr/bin/awstats_updateall.pl');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'autoresponder', 'autoresponder_active', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'panel', 'allow_preset_admin', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'autoresponder', 'last_autoresponder_run', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'system', 'httpuser', 'www-data');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'admin', 'show_version_login', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'system', 'httpgroup', 'www-data');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (93, 'admin', 'show_version_footer', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (93, 'system', 'webserver', 'apache2');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (94, 'admin', 'froxlor_graphic', 'images/header.gif'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (94, 'autoresponder', 'autoresponder_active', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'system', 'mod_fcgid_wrapper', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'autoresponder', 'last_autoresponder_run', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'system', 'mod_fcgid_starter', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'admin', 'show_version_login', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (97, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (97, 'admin', 'show_version_footer', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'system', 'index_file_extension', 'html'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'admin', 'froxlor_graphic', 'images/header.gif');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'aps', 'items_per_page', '20'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'system', 'mod_fcgid_wrapper', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'aps', 'upload_fields', '5'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'system', 'mod_fcgid_starter', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'aps', 'aps_active', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'aps', 'php-extension', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'system', 'index_file_extension', 'html');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'php-configuration', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'items_per_page', '20');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'webserver-htaccess', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'upload_fields', '5');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'php-function', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'aps_active', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (106, 'aps', 'webserver-module', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (1069, 'aps', 'php-extension', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'system', 'realtime_port', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'aps', 'php-configuration', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'session', 'allow_multiple_login', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'aps', 'webserver-htaccess', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'panel', 'allow_domain_change_admin', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'aps', 'php-function', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'panel', 'allow_domain_change_customer', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'aps', 'webserver-module', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'mod_fcgid_maxrequests', '250'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'realtime_port', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'system','ssl_key_file','/etc/apache2/apache2.key'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'session', 'allow_multiple_login', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'system','ssl_ca_file',''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'panel', 'allow_domain_change_admin', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'frontend', 'froxlor'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'allow_domain_change_customer', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'spf', 'use_spf', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'system', 'mod_fcgid_maxrequests', '250');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'system','ssl_key_file','/etc/apache2/apache2.key');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system', 'debug_cron', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system','ssl_ca_file','');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'password_min_length', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'frontend', 'froxlor');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'system', 'store_index_file_subs', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'spf', 'use_spf', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'panel', 'adminmail_defname', 'Froxlor Administrator'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'panel', 'adminmail_return', ''); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'system', 'debug_cron', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (122, 'dkim', 'dkim_algorithm', 'all');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (123, 'dkim', 'dkim_add_adsp', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (124, 'dkim', 'dkim_keylength', '1024');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (125, 'dkim', 'dkim_servicetype', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (126, 'dkim', 'dkim_add_adsppolicy', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (127, 'dkim', 'dkim_notes', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (128, 'system', 'stdsubdomain', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (129, 'system', 'awstats_path', '/usr/bin/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (130, 'system', 'awstats_conf', '/etc/awstats/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (131, 'system', 'defaultttl', '604800');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (132, 'defaultwebsrverrhandler', 'enabled', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (133, 'defaultwebsrverrhandler', 'err401', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (134, 'defaultwebsrverrhandler', 'err403', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (135, 'defaultwebsrverrhandler', 'err404', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (136, 'defaultwebsrverrhandler', 'err500', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (137, 'ticket', 'default_priority', '2');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (138, 'system', 'mod_fcgid_defaultini', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (139, 'system', 'ftpserver', 'proftpd');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (140, 'customredirect', 'enabled', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (141, 'customredirect', 'default', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (142, 'system', 'dns_createmailentry', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (143, 'system', 'froxlordirectlyviahostname', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (144, 'panel', 'password_regex', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (145, 'system', 'perl_path', '/usr/bin/perl');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (146, 'system', 'mod_fcgid_ownvhost', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (147, 'system', 'mod_fcgid_httpuser', 'froxlorlocal');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (148, 'system', 'mod_fcgid_httpgroup', 'froxlorlocal');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (149, 'perl', 'suexecworkaround', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (150, 'perl', 'suexecpath', '/var/www/cgi-bin/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (151, 'system', 'awstats_awstatspath', '/usr/bin/');
# -------------------------------------------------------- # --------------------------------------------------------
@@ -766,7 +731,6 @@ INSERT INTO `panel_languages` VALUES (13, 'Dutch', 'lng/dutch.lng.php');
INSERT INTO `panel_languages` VALUES (14, 'Hungarian', 'lng/hungarian.lng.php'); INSERT INTO `panel_languages` VALUES (14, 'Hungarian', 'lng/hungarian.lng.php');
INSERT INTO `panel_languages` VALUES (15, 'Swedish', 'lng/swedish.lng.php'); INSERT INTO `panel_languages` VALUES (15, 'Swedish', 'lng/swedish.lng.php');
INSERT INTO `panel_languages` VALUES (16, 'Czech', 'lng/czech.lng.php'); INSERT INTO `panel_languages` VALUES (16, 'Czech', 'lng/czech.lng.php');
INSERT INTO `panel_languages` VALUES (17, 'Polski', 'lng/polish.lng.php');
# -------------------------------------------------------- # --------------------------------------------------------
@@ -807,7 +771,6 @@ CREATE TABLE `panel_ticket_categories` (
`id` smallint(5) unsigned NOT NULL auto_increment, `id` smallint(5) unsigned NOT NULL auto_increment,
`name` varchar(60) NOT NULL, `name` varchar(60) NOT NULL,
`adminid` int(11) NOT NULL, `adminid` int(11) NOT NULL,
`logicalorder` int(3) NOT NULL default '1',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
@@ -844,7 +807,6 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
# Table structure for table `mail_autoresponder` # Table structure for table `mail_autoresponder`
# #
DROP TABLE IF EXISTS `mail_autoresponder`;
CREATE TABLE `mail_autoresponder` ( CREATE TABLE `mail_autoresponder` (
`email` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '',
`message` text NOT NULL, `message` text NOT NULL,
@@ -869,7 +831,6 @@ CREATE TABLE `mail_autoresponder` (
# Table structure for table `panel_phpconfigs` # Table structure for table `panel_phpconfigs`
# #
DROP TABLE IF EXISTS `panel_phpconfigs`;
CREATE TABLE `panel_phpconfigs` ( CREATE TABLE `panel_phpconfigs` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`description` varchar(50) NOT NULL, `description` varchar(50) NOT NULL,
@@ -893,7 +854,6 @@ INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`
# Tabellenstruktur fuer Tabelle `aps_instances` # Tabellenstruktur fuer Tabelle `aps_instances`
# #
DROP TABLE IF EXISTS `aps_instances`;
CREATE TABLE IF NOT EXISTS `aps_instances` ( CREATE TABLE IF NOT EXISTS `aps_instances` (
`ID` int(4) NOT NULL auto_increment, `ID` int(4) NOT NULL auto_increment,
`CustomerID` int(4) NOT NULL, `CustomerID` int(4) NOT NULL,
@@ -908,7 +868,6 @@ CREATE TABLE IF NOT EXISTS `aps_instances` (
# Tabellenstruktur fuer Tabelle `aps_packages` # Tabellenstruktur fuer Tabelle `aps_packages`
# #
DROP TABLE IF EXISTS `aps_packages`;
CREATE TABLE IF NOT EXISTS `aps_packages` ( CREATE TABLE IF NOT EXISTS `aps_packages` (
`ID` int(4) NOT NULL auto_increment, `ID` int(4) NOT NULL auto_increment,
`Path` varchar(500) NOT NULL, `Path` varchar(500) NOT NULL,
@@ -925,7 +884,6 @@ CREATE TABLE IF NOT EXISTS `aps_packages` (
# Tabellenstruktur fuer Tabelle `aps_settings` # Tabellenstruktur fuer Tabelle `aps_settings`
# #
DROP TABLE IF EXISTS `aps_settings`;
CREATE TABLE IF NOT EXISTS `aps_settings` ( CREATE TABLE IF NOT EXISTS `aps_settings` (
`ID` int(4) NOT NULL auto_increment, `ID` int(4) NOT NULL auto_increment,
`InstanceID` int(4) NOT NULL, `InstanceID` int(4) NOT NULL,
@@ -940,7 +898,6 @@ CREATE TABLE IF NOT EXISTS `aps_settings` (
# Tabellenstruktur fuer Tabelle `aps_tasks` # Tabellenstruktur fuer Tabelle `aps_tasks`
# #
DROP TABLE IF EXISTS `aps_tasks`;
CREATE TABLE IF NOT EXISTS `aps_tasks` ( CREATE TABLE IF NOT EXISTS `aps_tasks` (
`ID` int(4) NOT NULL auto_increment, `ID` int(4) NOT NULL auto_increment,
`InstanceID` int(4) NOT NULL, `InstanceID` int(4) NOT NULL,
@@ -954,7 +911,6 @@ CREATE TABLE IF NOT EXISTS `aps_tasks` (
# Tabellenstruktur fuer Tabelle `aps_temp_settings` # Tabellenstruktur fuer Tabelle `aps_temp_settings`
# #
DROP TABLE IF EXISTS `aps_temp_settings`;
CREATE TABLE IF NOT EXISTS `aps_temp_settings` ( CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
`ID` int(4) NOT NULL auto_increment, `ID` int(4) NOT NULL auto_increment,
`PackageID` int(4) NOT NULL, `PackageID` int(4) NOT NULL,
@@ -970,7 +926,6 @@ CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
# Tabellenstruktur fuer Tabelle `cronjobs_run` # Tabellenstruktur fuer Tabelle `cronjobs_run`
# #
DROP TABLE IF EXISTS `cronjobs_run`;
CREATE TABLE IF NOT EXISTS `cronjobs_run` ( CREATE TABLE IF NOT EXISTS `cronjobs_run` (
`id` bigint(20) NOT NULL auto_increment, `id` bigint(20) NOT NULL auto_increment,
`module` varchar(250) NOT NULL, `module` varchar(250) NOT NULL,
@@ -992,87 +947,5 @@ INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`,
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (4, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder'); INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (4, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (5, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater'); INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (5, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (6, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic'); INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (6, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 DAY', '1', 'cron_ticketsreset'); INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 MONTH', '1', 'cron_ticketsreset');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (8, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive'); INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (8, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive');
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `ftp_quotalimits`
#
DROP TABLE IF EXISTS `ftp_quotalimits`;
CREATE TABLE IF NOT EXISTS `ftp_quotalimits` (
`name` varchar(30) default NULL,
`quota_type` enum('user','group','class','all') NOT NULL default 'user',
`per_session` enum('false','true') NOT NULL default 'false',
`limit_type` enum('soft','hard') NOT NULL default 'hard',
`bytes_in_avail` float NOT NULL,
`bytes_out_avail` float NOT NULL,
`bytes_xfer_avail` float NOT NULL,
`files_in_avail` int(10) unsigned NOT NULL,
`files_out_avail` int(10) unsigned NOT NULL,
`files_xfer_avail` int(10) unsigned NOT NULL
) ENGINE=MyISAM;
#
# Dumping data for table `ftp_quotalimits`
#
INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('froxlor', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0);
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `ftp_quotatallies`
#
DROP TABLE IF EXISTS `ftp_quotatallies`;
CREATE TABLE IF NOT EXISTS `ftp_quotatallies` (
`name` varchar(30) NOT NULL,
`quota_type` enum('user','group','class','all') NOT NULL,
`bytes_in_used` float NOT NULL,
`bytes_out_used` float NOT NULL,
`bytes_xfer_used` float NOT NULL,
`files_in_used` int(10) unsigned NOT NULL,
`files_out_used` int(10) unsigned NOT NULL,
`files_xfer_used` int(10) unsigned NOT NULL
) ENGINE=MyISAM;
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `redirect_codes`
#
DROP TABLE IF EXISTS `redirect_codes`;
CREATE TABLE IF NOT EXISTS `redirect_codes` (
`id` int(5) NOT NULL auto_increment,
`code` varchar(3) NOT NULL,
`desc` varchar(200) NOT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
#
# Dumping data for table `redirect_codes`
#
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (1, '---', 'rc_default', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (2, '301', 'rc_movedperm', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (3, '302', 'rc_found', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (4, '303', 'rc_seeother', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (5, '307', 'rc_tempred', 1);
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `domain_redirect_codes`
#
DROP TABLE IF EXISTS `domain_redirect_codes`;
CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
`rid` int(5) NOT NULL,
`did` int(11) unsigned NOT NULL,
UNIQUE KEY `rc` (`rid`, `did`)
) ENGINE=MyISAM;

View File

@@ -156,121 +156,6 @@ function status_message($case, $text)
} }
} }
function requirement_checks()
{
global $lng;
page_header();
?>
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable">
<tr>
<td class="maintitle"><b><img src="../images/title.gif" alt="" />&nbsp;Froxlor Installation</b></td>
</tr>
<?php
$_die = false;
// check for correct php version
status_message('begin', $lng['install']['phpversion']);
if(version_compare("5.2.0", PHP_VERSION, ">="))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpmysql']);
if(!extension_loaded('mysql'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpfilter']);
if(!extension_loaded('filter'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpposix']);
if(!extension_loaded('posix'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpbcmath']);
if(!extension_loaded('bcmath'))
{
status_message('orange', $lng['install']['notinstalled'] . '<br />' . $lng['install']['bcmathdescription']);
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['openbasedir']);
$php_ob = @ini_get("open_basedir");
if(!empty($php_ob)
&& $php_ob != '')
{
status_message('orange', $lng['install']['openbasedirenabled']);
}
else
{
status_message('green', 'OK');
}
if($_die)
{
?>
<tr>
<td class="main_field_display" align="center">
<?php echo $lng['install']['diedbecauseofrequirements']; ?><br />
<a href="install.php"><?php echo $lng['install']['click_here_to_refresh']; ?></a>
</td>
</tr>
<?php
} else {
?>
<tr>
<td class="main_field_display" align="center">
<?php echo $lng['install']['froxlor_succ_checks']; ?><br />
<a href="install.php?check=1"><?php echo $lng['install']['click_here_to_continue']; ?></a>
</td>
</tr>
<?php
}
?>
</table>
<br />
<br />
<?php
page_footer();
}
/** /**
* END FUNCTIONS --------------------------------------------------- * END FUNCTIONS ---------------------------------------------------
*/ */
@@ -289,7 +174,7 @@ else
{ {
if(!empty($_SERVER['SERVER_NAME'])) if(!empty($_SERVER['SERVER_NAME']))
{ {
if(preg_match('/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$/', $_SERVER['SERVER_NAME']) == false) if(validate_ip($_SERVER['SERVER_NAME'], true) == false)
{ {
$servername = $_SERVER['SERVER_NAME']; $servername = $_SERVER['SERVER_NAME'];
} }
@@ -422,12 +307,12 @@ if(!empty($_POST['webserver']))
else else
{ {
if(strtoupper(@php_sapi_name()) == "APACHE2HANDLER" if(strtoupper(@php_sapi_name()) == "APACHE2HANDLER"
|| stristr($_SERVER['SERVER_SOFTWARE'], "apache/2")) || stristr($_SERVER[SERVER_SOFTWARE], "apache/2"))
{ {
$webserver = 'apache2'; $webserver = 'apache2';
} }
elseif(substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD" elseif(substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD"
|| stristr($_SERVER['SERVER_SOFTWARE'], "lighttpd")) || stristr($_SERVER[SERVER_SOFTWARE], "lighttpd"))
{ {
$webserver = 'lighttpd'; $webserver = 'lighttpd';
} }
@@ -486,6 +371,87 @@ if(isset($_POST['installstep'])
<td class="maintitle"><b><img src="../images/title.gif" alt="" />&nbsp;Froxlor Installation</b></td> <td class="maintitle"><b><img src="../images/title.gif" alt="" />&nbsp;Froxlor Installation</b></td>
</tr> </tr>
<?php <?php
$_die = false;
// check for correct php version
status_message('begin', $lng['install']['phpversion']);
if(version_compare("5.2.0", PHP_VERSION, ">="))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpmysql']);
if(!extension_loaded('mysql'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpfilter']);
if(!extension_loaded('filter'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpposix']);
if(!extension_loaded('posix'))
{
status_message('red', $lng['install']['notinstalled']);
$_die = true;
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['phpbcmath']);
if(!extension_loaded('bcmath'))
{
status_message('orange', $lng['install']['notinstalled'] . '<br />' . $lng['install']['bcmathdescription']);
}
else
{
status_message('green', 'OK');
}
status_message('begin', $lng['install']['openbasedir']);
$php_ob = @ini_get("open_basedir");
if(!empty($php_ob)
&& $php_ob != '')
{
status_message('orange', $lng['install']['openbasedirenabled']);
}
else
{
status_message('green', 'OK');
}
if($_die)
{
status_message('begin', $lng['install']['diedbecauseofrequirements']);
die();
}
//first test if we can access the database server with the given root user and password //first test if we can access the database server with the given root user and password
@@ -499,41 +465,15 @@ if(isset($_POST['installstep'])
//first we make a backup of the old DB if it exists //first we make a backup of the old DB if it exists
status_message('begin', $lng['install']['backup_old_db']); status_message('begin', $lng['install']['backup_old_db']);
$result = mysql_list_tables($mysql_database);
$sql = "SHOW TABLES FROM $mysql_database"; if($result)
$result = mysql_query($sql);
// check the first row
$row = mysql_fetch_row($result);
$tables_exist = false;
if(isset($row[0]) && $row[0] != '')
{ {
$tables_exist = true; $filename = "/tmp/froxlor_backup_" . date(YmdHi) . ".sql";
}
if($tables_exist)
{
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
if(is_file("/usr/bin/mysqldump")) if(is_file("/usr/bin/mysqldump"))
{ {
$do_backup = true; $command = "/usr/bin/mysqldump " . $mysql_database . " -u " . $mysql_root_user . " --password='" . $mysql_root_pass . "' --result-file=" . $filename;
$mysql_dump = '/usr/bin/mysqldump';
}
elseif(is_file("/usr/local/bin/mysqldump"))
{
$do_backup = true;
$mysql_dump = '/usr/local/bin/mysqldump';
}
else
{
$do_backup = false;
status_message('red', $lng['install']['backing_up_binary_missing']);
}
if($do_backup) {
$command = $mysql_dump . " " . $mysql_database . " -u " . $mysql_root_user . " --password='" . $mysql_root_pass . "' --result-file=" . $filename;
$output = exec($command); $output = exec($command);
if(stristr($output, "error")) if(stristr($output, "error"))
@@ -544,7 +484,10 @@ if(isset($_POST['installstep'])
{ {
status_message('green', 'OK'); status_message('green', 'OK');
} }
}
else
{
status_message('red', $lng['install']['backing_up_binary_missing']);
} }
} }
@@ -630,6 +573,8 @@ if(isset($_POST['installstep'])
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
//FIXME
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpuser) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpuser) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpgroup) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpgroup) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
@@ -647,7 +592,6 @@ if(isset($_POST['installstep'])
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'");
$ssettings = '';
} }
// insert the lastcronrun to be the installation date // insert the lastcronrun to be the installation date
@@ -655,22 +599,11 @@ if(isset($_POST['installstep'])
$query = 'UPDATE `%s` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'lastcronrun\''; $query = 'UPDATE `%s` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'lastcronrun\'';
$query = sprintf($query, TABLE_PANEL_SETTINGS); $query = sprintf($query, TABLE_PANEL_SETTINGS);
$db->query($query); $db->query($query);
// set specific times for some crons (traffic only at night, etc.)
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");
$ts = mktime(1, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
// and lets insert the default ip and port // and lets insert the default ip and port
$query = "INSERT INTO `".TABLE_PANEL_IPSANDPORTS."` $query = 'INSERT INTO `%s` SET `ip` = \'%s\', `port` = \'80\' ';
SET `ip`= '".$db->escape($serverip)."', $query = sprintf($query, TABLE_PANEL_IPSANDPORTS, $db->escape($serverip));
`port` = '80',
`namevirtualhost_statement` = '1',
`vhostcontainer` = '1',
`vhostcontainer_servername_statement` = '1'";
$db->query($query); $db->query($query);
$defaultip = $db->insert_id(); $defaultip = $db->insert_id();
@@ -773,17 +706,10 @@ if(isset($_POST['installstep'])
} }
else else
{ {
if((isset($_GET['check'])
&& $_GET['check'] == '1')
|| (isset($_POST['installstep'])
&& $_POST['installstep'] == '1')
) {
page_header(); page_header();
?> ?>
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="get"> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="get">
<input type="hidden" name="check" value="1" />
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40"> <table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
<tr> <tr>
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" />&nbsp;<?php echo $lng['install']['welcome']; ?></b></td> <td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" />&nbsp;<?php echo $lng['install']['welcome']; ?></b></td>
@@ -818,7 +744,6 @@ else
</form> </form>
<br /> <br />
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post"> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
<input type="hidden" name="check" value="1" />
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40"> <table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
<tr> <tr>
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" />&nbsp;<?php echo $lng['install']['database']; ?></b></td> <td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" />&nbsp;<?php echo $lng['install']['database']; ?></b></td>
@@ -894,11 +819,6 @@ else
<br /> <br />
<?php <?php
page_footer(); page_footer();
}
else
{
requirement_checks();
}
} }
/** /**

View File

@@ -84,11 +84,4 @@ $lng['install']['webserver'] = 'Webserver';
$lng['install']['phpversion'] = 'Checking for PHP version >= 5.2'; $lng['install']['phpversion'] = 'Checking for PHP version >= 5.2';
$lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...'; $lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...';
/*
* Added in Froxlor 0.9.4
*/
$lng['install']['click_here_to_refresh'] = 'Re-check';
$lng['install']['click_here_to_continue'] = 'Continue installation';
$lng['install']['froxlor_succ_checks'] = 'All requirements are satisfied';
?> ?>

View File

@@ -84,11 +84,4 @@ $lng['install']['webserver'] = 'Webserver';
$lng['install']['phpversion'] = 'Pr&uuml;fe PHP Version >= 5.2'; $lng['install']['phpversion'] = 'Pr&uuml;fe PHP Version >= 5.2';
$lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...'; $lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...';
/*
* Added in Froxlor 0.9.4
*/
$lng['install']['click_here_to_refresh'] = 'Erneut pr&uuml;fen';
$lng['install']['click_here_to_continue'] = 'Installation fortf&uuml;hren';
$lng['install']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erf&uuml;llt';
?> ?>

View File

@@ -21,7 +21,9 @@ $baseLanguage = 'english.lng.php';
// Check if we're in the CLI // Check if we're in the CLI
if(@php_sapi_name() != 'cli') if(@php_sapi_name() != 'cli'
&& @php_sapi_name() != 'cgi'
&& @php_sapi_name() != 'cgi-fcgi')
{ {
die('This script will only work in the shell.'); die('This script will only work in the shell.');
} }
@@ -181,4 +183,4 @@ function compare($array1, $array2)
return $result; return $result;
} }
?> ?>

View File

@@ -29,8 +29,8 @@ if(isFroxlorVersion('0.9-r0'))
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2) if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2)
{ {
$db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL, $db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL, ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL, ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL,
ADD `default_vhostconf_domain` TEXT NOT NULL;"); ADD `default_vhostconf_domain` TEXT NOT NULL;");
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ssl_key_file', `value` = '';"); $db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ssl_key_file', `value` = '';");
@@ -177,9 +177,9 @@ if(isFroxlorVersion('0.9-r0'))
$db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` $db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "`
MODIFY `traffic` BIGINT(30), MODIFY `traffic` BIGINT(30),
MODIFY `traffic_used` BIGINT(30)"); MODIFY `traffic_used` BIGINT(30)");
lastStepStatus(0); lastStepStatus(0);
updateToVersion('0.9-r1'); updateToVersion('0.9-r1');
} }
@@ -187,20 +187,12 @@ if(isFroxlorVersion('0.9-r1'))
{ {
showUpdateStep("Updating from 0.9-r1 to 0.9-r2", false); showUpdateStep("Updating from 0.9-r1 to 0.9-r2", false);
showUpdateStep("Updating settings table"); showUpdateStep("Updating settings table");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');"); $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');"); $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
if(isset($settings['admin']['syscp_graphic']) $settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
&& $settings['admin']['syscp_graphic'] != ''
){
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
}
else
{
$settings['admin']['froxlor_graphic'] = 'images/header.gif';
}
lastStepStatus(0); lastStepStatus(0);
updateToVersion('0.9-r2'); updateToVersion('0.9-r2');
@@ -209,7 +201,7 @@ if(isFroxlorVersion('0.9-r1'))
if(isFroxlorVersion('0.9-r2')) if(isFroxlorVersion('0.9-r2'))
{ {
showUpdateStep("Updating from 0.9-r2 to 0.9-r3", false); showUpdateStep("Updating from 0.9-r2 to 0.9-r3", false);
showUpdateStep("Updating tables"); showUpdateStep("Updating tables");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'debug_cron', '0');"); $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'debug_cron', '0');");
$db->query("ALTER TABLE `" . TABLE_MAIL_AUTORESPONDER . "` ADD `date_from` int(15) NOT NULL default '-1' AFTER `enabled`"); $db->query("ALTER TABLE `" . TABLE_MAIL_AUTORESPONDER . "` ADD `date_from` int(15) NOT NULL default '-1' AFTER `enabled`");
@@ -223,11 +215,11 @@ if(isFroxlorVersion('0.9-r2'))
if(isFroxlorVersion('0.9-r3')) if(isFroxlorVersion('0.9-r3'))
{ {
showUpdateStep("Updating from 0.9-r3 to 0.9-r4", false); showUpdateStep("Updating from 0.9-r3 to 0.9-r4", false);
showUpdateStep("Creating new table 'cronjobs_run'"); showUpdateStep("Creating new table 'cronjobs_run'");
$db->query("CREATE TABLE IF NOT EXISTS `cronjobs_run` ( $db->query("CREATE TABLE IF NOT EXISTS `cronjobs_run` (
`id` bigint(20) NOT NULL auto_increment, `id` bigint(20) NOT NULL auto_increment,
`module` varchar(250) NOT NULL, `module` varchar(250) NOT NULL,
`cronfile` varchar(250) NOT NULL, `cronfile` varchar(250) NOT NULL,
`lastrun` int(15) NOT NULL DEFAULT '0', `lastrun` int(15) NOT NULL DEFAULT '0',
`interval` varchar(100) NOT NULL DEFAULT '5 MINUTE', `interval` varchar(100) NOT NULL DEFAULT '5 MINUTE',
@@ -238,28 +230,28 @@ if(isFroxlorVersion('0.9-r3'))
lastStepStatus(0); lastStepStatus(0);
showUpdateStep("Inserting new values into table"); showUpdateStep("Inserting new values into table");
// checking for active ticket-module // checking for active ticket-module
$ticket_active = 0; $ticket_active = 0;
if((int)$settings['ticket']['enabled'] == 1) if((int)$settings['ticket']['enabled'] == 1)
{ {
$ticket_active = 1; $ticket_active = 1;
} }
// checking for active aps-module // checking for active aps-module
$aps_active = 0; $aps_active = 0;
if((int)$settings['aps']['aps_active'] == 1) if((int)$settings['aps']['aps_active'] == 1)
{ {
$aps_active = 1; $aps_active = 1;
} }
// checking for active autoresponder-module // checking for active autoresponder-module
$ar_active = 0; $ar_active = 0;
if((int)$settings['autoresponder']['autoresponder_active'] == 1) if((int)$settings['autoresponder']['autoresponder_active'] == 1)
{ {
$ar_active = 1; $ar_active = 1;
} }
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_tasks.php', '5 MINUTE', '1', 'cron_tasks');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_tasks.php', '5 MINUTE', '1', 'cron_tasks');");
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_legacy.php', '5 MINUTE', '1', 'cron_legacy');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_legacy.php', '5 MINUTE', '1', 'cron_legacy');");
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/aps', 'cron_apsinstaller.php', '5 MINUTE', ".$aps_active.", 'cron_apsinstaller');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/aps', 'cron_apsinstaller.php', '5 MINUTE', ".$aps_active.", 'cron_apsinstaller');");
@@ -268,30 +260,29 @@ if(isFroxlorVersion('0.9-r3'))
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic');");
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/ticket', 'cron_used_tickets_reset.php', '1 MONTH', '".$ticket_active."', 'cron_ticketsreset');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/ticket', 'cron_used_tickets_reset.php', '1 MONTH', '".$ticket_active."', 'cron_ticketsreset');");
$db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '".$ticket_active."', 'cron_ticketarchive');"); $db->query("INSERT INTO `cronjobs_run` (`module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES ('froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '".$ticket_active."', 'cron_ticketarchive');");
lastStepStatus(0); lastStepStatus(0);
showUpdateStep("Updating old settings values"); showUpdateStep("Updating old settings values");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'Froxlor Support' WHERE `settinggroup`='ticket' AND `varname`='noreply_name' AND `value`='SysCP Support'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'Froxlor Support' WHERE `settinggroup`='ticket' AND `varname`='noreply_name' AND `value`='SysCP Support'");
lastStepStatus(0); lastStepStatus(0);
updateToVersion('0.9-r4'); updateToVersion('0.9-r4');
} }
if(isFroxlorVersion('0.9-r4')) if(isFroxlorVersion('0.9-r4'))
{ {
showUpdateStep("Updating from 0.9-r4 to 0.9 final"); showUpdateStep("Updating from 0.9-r4 to 0.9 final", false);
lastStepStatus(0);
updateToVersion('0.9'); updateToVersion('0.9');
} }
if(isFroxlorVersion('0.9')) if(isFroxlorVersion('0.9'))
{ {
showUpdateStep("Updating from 0.9 to 0.9.1", false); showUpdateStep("Updating from 0.9 to 0.9.1", false);
showUpdateStep("Updating settings values"); showUpdateStep("Updating settings values");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'images/header.gif' WHERE `varname` = 'froxlor_graphic' AND `value` = 'images/header.png'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'images/header.gif' WHERE `varname` = 'froxlor_graphic' AND `value` = 'images/header.png'");
lastStepStatus(0); lastStepStatus(0);
updateToVersion('0.9.1'); updateToVersion('0.9.1');
} }
@@ -299,13 +290,13 @@ if(isFroxlorVersion('0.9'))
if(isFroxlorVersion('0.9.1')) if(isFroxlorVersion('0.9.1'))
{ {
showUpdateStep("Updating from 0.9.1 to 0.9.2", false); showUpdateStep("Updating from 0.9.1 to 0.9.2", false);
showUpdateStep("Checking whether last-system-guid is sane"); showUpdateStep("Checking whether last-system-guid is sane");
$result = $db->query_first("SELECT MAX(`guid`) as `latestguid` FROM `".TABLE_PANEL_CUSTOMERS."`"); $result = $db->query_first("SELECT MAX(`guid`) as `latestguid` FROM `".TABLE_PANEL_CUSTOMERS."`");
if (isset($result['latestguid']) if (isset($result['latestguid'])
&& (int)$result['latestguid'] > 0 && (int)$result['latestguid'] > 0
&& $result['latestguid'] != $settings['system']['lastguid'] && $result['latestguid'] != $settings['system']['lastguid']
) { ) {
checkLastGuid(); checkLastGuid();
@@ -323,707 +314,4 @@ if(isFroxlorVersion('0.9.2'))
updateToVersion('0.9.3'); updateToVersion('0.9.3');
} }
if(isFroxlorVersion('0.9.3')) ?>
{
showUpdateStep("Updating from 0.9.3 to 0.9.3-svn1", false);
showUpdateStep("Updating tables");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_min_length', '0');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'store_index_file_subs', '1');");
lastStepStatus(0);
updateToVersion('0.9.3-svn1');
}
if(isFroxlorVersion('0.9.3-svn1'))
{
showUpdateStep("Updating from 0.9.3-svn1 to 0.9.3-svn2", false);
showUpdateStep("Updating tables");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'adminmail_defname', 'Froxlor Administrator');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'adminmail_return', '');");
lastStepStatus(0);
updateToVersion('0.9.3-svn2');
}
if(isFroxlorVersion('0.9.3-svn2'))
{
showUpdateStep("Updating from 0.9.3-svn2 to 0.9.3-svn3", false);
showUpdateStep("Correcting cron start-times");
// set specific times for some crons (traffic only at night, etc.)
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");
$ts = mktime(1, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
lastStepStatus(0);
showUpdateStep("Adding new language: Polish");
$db->query("INSERT INTO `".TABLE_PANEL_LANGUAGE."` SET `language` = 'Polski', `file` = 'lng/polish.lng.php'");
lastStepStatus(0);
updateToVersion('0.9.3-svn3');
}
if(isFroxlorVersion('0.9.3-svn3'))
{
showUpdateStep("Updating from 0.9.3-svn3 to 0.9.3-svn4", false);
showUpdateStep("Adding new DKIM settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_algorithm', 'all');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_add_adsp', '1');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_keylength', '1024');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_servicetype', '0');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_add_adsppolicy', '1');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_notes', '');");
lastStepStatus(0);
updateToVersion('0.9.3-svn4');
}
if(isFroxlorVersion('0.9.3-svn4'))
{
showUpdateStep("Updating from 0.9.3-svn4 to 0.9.3-svn5", false);
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'stdsubdomain', '');");
lastStepStatus(0);
updateToVersion('0.9.3-svn5');
}
if(isFroxlorVersion('0.9.3-svn5'))
{
showUpdateStep("Updating from 0.9.3-svn5 to 0.9.4 final");
lastStepStatus(0);
updateToVersion('0.9.4');
}
if(isFroxlorVersion('0.9.4'))
{
showUpdateStep("Updating from 0.9.4 to 0.9.4-svn1", false);
/**
* some users might still have the setting in their database
* because we already had this back in older versions.
* To not confuse Froxlor, we just update old settings.
*/
if(isset($settings['system']['awstats_path'])
&& $settings['system']['awstats_path'] != ''
) {
showUpdateStep("Updating awstats path setting");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
lastStepStatus(0);
}
elseif(!isset($settings['system']['awstats_path']))
{
showUpdateStep("Adding new awstats path setting");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');");
lastStepStatus(0);
}
if(isset($settings['system']['awstats_domain_file'])
&& $settings['system']['awstats_domain_file'] != ''
) {
showUpdateStep("Updating awstats configuration path setting");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'awstats_conf' WHERE `varname` = 'awstats_domain_file';");
}
else
{
showUpdateStep("Adding awstats configuration path settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_conf', '/etc/awstats/');");
}
lastStepStatus(0);
updateToVersion('0.9.4-svn1');
}
if(isFroxlorVersion('0.9.4-svn1'))
{
showUpdateStep("Updating from 0.9.4-svn1 to 0.9.4-svn2", false);
$update_domains = isset($_POST['update_domainwildcardentry']) ? intval($_POST['update_domainwildcardentry']) : 0;
if($update_domains != 1)
{
$update_domains = 0;
}
if($update_domains == 1)
{
showUpdateStep("Updating domains with iswildcarddomain=yes");
$query = "SELECT `d`.`id` FROM `".TABLE_PANEL_DOMAINS."` `d`, `".TABLE_PANEL_CUSTOMERS."` `c` ";
$query.= "WHERE `parentdomainid`='0' AND `email_only` = '0' AND `d`.`customerid` = `c`.`customerid` AND `d`.`id` <> `c`.`standardsubdomain`";
$result = $db->query($query);
$updated_domains = 0;
while($domain = $db->fetch_array($result))
{
$db->query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `iswildcarddomain` = '1' WHERE `id` ='".(int)$domain['id']."'");
$updated_domains++;
}
lastStepStatus(0, 'Updated '.$updated_domains.' domain(s)');
} else {
showUpdateStep("Won't update domains with iswildcarddomain=yes as requested");
lastStepStatus(1);
}
showUpdateStep("Updating database table definition for panel_domains");
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` MODIFY `iswildcarddomain` tinyint(1) NOT NULL default '1';");
lastStepStatus(0);
updateToVersion('0.9.4-svn2');
}
if(isFroxlorVersion('0.9.4-svn2'))
{
showUpdateStep("Updating from 0.9.4-svn2 to 0.9.5 final");
lastStepStatus(0);
updateToVersion('0.9.5');
}
if(isFroxlorVersion('0.9.5'))
{
showUpdateStep("Updating from 0.9.5 to 0.9.6-svn1", false);
showUpdateStep("Adding time-to-live configuration setting");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'defaultttl', '604800');");
lastStepStatus(0);
showUpdateStep("Updating database table structure for panel_ticket_categories");
$db->query("ALTER TABLE `" . TABLE_PANEL_TICKET_CATS . "` ADD `logicalorder` int(3) NOT NULL default '1' AFTER `adminid`;");
lastStepStatus(0);
updateToVersion('0.9.6-svn1');
}
if(isFroxlorVersion('0.9.6-svn1'))
{
showUpdateStep("Updating from 0.9.6-svn1 to 0.9.6-svn2", false);
$update_adminmail = isset($_POST['update_adminmail']) ? validate($_POST['update_adminmail'], 'update_adminmail') : false;
$do_update = true;
if($update_adminmail !== false)
{
showUpdateStep("Checking newly entered admin-mail");
if(!PHPMailer::ValidateAddress($update_adminmail))
{
$do_update = false;
lastStepStatus(2, 'E-Mail still not valid, go back and try again');
}
else
{
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '".$db->escape($update_adminmail)."' WHERE `settinggroup` = 'panel' AND `varname` = 'adminmail';");
lastStepStatus(0);
}
}
if($do_update)
{
updateToVersion('0.9.6-svn2');
}
}
if(isFroxlorVersion('0.9.6-svn2'))
{
showUpdateStep("Updating from 0.9.6-svn2 to 0.9.6-svn3", false);
$update_deferr_enable = isset($_POST['update_deferr_enable']) ? true : false;
$err500 = false;
$err401 = false;
$err403 = false;
$err404 = false;
showUpdateStep("Adding new webserver configurations to database");
if($update_deferr_enable == true)
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'enabled', '1');");
if(isset($_POST['update_deferr_500'])
&& trim($_POST['update_deferr_500']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_500'])."');");
$err500 = true;
}
if(isset($_POST['update_deferr_401'])
&& trim($_POST['update_deferr_401']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '".$db->escape($_POST['update_deferr_401'])."');");
$err401 = true;
}
if(isset($_POST['update_deferr_403'])
&& trim($_POST['update_deferr_403']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '".$db->escape($_POST['update_deferr_403'])."');");
$err403 = true;
}
if(isset($_POST['update_deferr_404'])
&& trim($_POST['update_deferr_404']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '".$db->escape($_POST['update_deferr_404'])."');");
$err404 = true;
}
}
if(!$update_deferr_enable) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'enabled', '0');");
}
if(!$err401) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
}
if(!$err403) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
}
if(!$err404) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
}
if(!$err500) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '');");
}
lastStepStatus(0);
updateToVersion('0.9.6-svn3');
}
if(isFroxlorVersion('0.9.6-svn3'))
{
showUpdateStep("Updating from 0.9.6-svn3 to 0.9.6-svn4", false);
$update_deftic_priority = isset($_POST['update_deftic_priority']) ? intval($_POST['update_deftic_priority']) : 2;
showUpdateStep("Setting default support-ticket priority");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('ticket', 'default_priority', '".(int)$update_deftic_priority."');");
lastStepStatus(0);
updateToVersion('0.9.6-svn4');
}
if(isFroxlorVersion('0.9.6-svn4'))
{
showUpdateStep("Updating from 0.9.6-svn4 to 0.9.6-svn5", false);
$update_defsys_phpconfig = isset($_POST['update_defsys_phpconfig']) ? intval($_POST['update_defsys_phpconfig']) : 1;
if($update_defsys_phpconfig != 1) {
showUpdateStep("Setting default php-configuration to user defined config #".$update_defsys_phpconfig);
} else {
showUpdateStep("Adding default php-configuration setting to the database");
}
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_defaultini', '".(int)$update_defsys_phpconfig."');");
lastStepStatus(0);
updateToVersion('0.9.6-svn5');
}
if(isFroxlorVersion('0.9.6-svn5'))
{
showUpdateStep("Updating from 0.9.6-svn5 to 0.9.6-svn6", false);
showUpdateStep("Adding new FTP-quota settings");
$update_defsys_ftpserver = isset($_POST['update_defsys_ftpserver']) ? intval($_POST['update_defsys_ftpserver']) : 'proftpd';
// add ftp server setting
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ftpserver', `value` = '".$db->escape($update_defsys_ftpserver)."';");
// add proftpd quota
$db->query("CREATE TABLE `ftp_quotalimits` (`name` varchar(30) default NULL, `quota_type` enum('user','group','class','all') NOT NULL default 'user', `per_session` enum('false','true') NOT NULL default 'false', `limit_type` enum('soft','hard') NOT NULL default 'hard', `bytes_in_avail` float NOT NULL, `bytes_out_avail` float NOT NULL, `bytes_xfer_avail` float NOT NULL, `files_in_avail` int(10) unsigned NOT NULL, `files_out_avail` int(10) unsigned NOT NULL, `files_xfer_avail` int(10) unsigned NOT NULL) ENGINE=MyISAM;");
$db->query("INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('froxlor', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0);");
$db->query("CREATE TABLE `ftp_quotatallies` (`name` varchar(30) NOT NULL, `quota_type` enum('user','group','class','all') NOT NULL, `bytes_in_used` float NOT NULL, `bytes_out_used` float NOT NULL, `bytes_xfer_used` float NOT NULL, `files_in_used` int(10) unsigned NOT NULL, `files_out_used` int(10) unsigned NOT NULL, `files_xfer_used` int(10) unsigned NOT NULL ) ENGINE=MyISAM;");
// fill quota tallies
$result_ftp_users = $db->query("SELECT username FROM `" . TABLE_FTP_USERS . "` WHERE 1;");
while($row_ftp_users = $db->fetch_array($result_ftp_users))
{
$result_ftp_quota = $db->query("SELECT diskspace_used FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE loginname = SUBSTRING_INDEX('" . $row_ftp_users['username'] . "', '" . $settings['customer']['ftpprefix'] . "', 1);");
$row_ftp_quota = mysql_fetch_row($result_ftp_quota);
$db->query("INSERT INTO `ftp_quotatallies` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $row_ftp_users['username'] . "', 'user', '" . $row_ftp_quota[0] . "'*1024, '0', '0', '0', '0', '0');");
}
lastStepStatus(0);
updateToVersion('0.9.6-svn6');
}
if(isFroxlorVersion('0.9.6-svn6'))
{
showUpdateStep("Updating from 0.9.6-svn6 to 0.9.6 final");
lastStepStatus(0);
updateToVersion('0.9.6');
}
if(isFroxlorVersion('0.9.6'))
{
showUpdateStep("Updating from 0.9.6 to 0.9.7-svn1", false);
$update_customredirect_enable = isset($_POST['update_customredirect_enable']) ? 1 : 0;
$update_customredirect_default = isset($_POST['update_customredirect_default']) ? (int)$_POST['update_customredirect_default'] : 1;
showUpdateStep("Adding new tables to database");
$db->query("CREATE TABLE IF NOT EXISTS `redirect_codes` (
`id` int(5) NOT NULL auto_increment,
`code` varchar(3) NOT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;");
$db->query("CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
`rid` int(5) NOT NULL,
`did` int(11) unsigned NOT NULL,
UNIQUE KEY `rc` (`rid`, `did`)
) ENGINE=MyISAM;");
lastStepStatus(0);
showUpdateStep("Filling new tables with default data");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (1, '---', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (2, '301', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (3, '302', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (4, '303', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (5, '307', 1);");
lastStepStatus(0);
showUpdateStep("Updating domains");
$res = $db->query("SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` ORDER BY `id` ASC");
$updated_domains = 0;
while($d = $db->fetch_array($res))
{
$db->query("INSERT INTO `domain_redirect_codes` (`rid`, `did`) VALUES ('".(int)$update_customredirect_default."', '".(int)$d['id']."');");
$updated_domains++;
}
lastStepStatus(0, 'Updated '.$updated_domains.' domain(s)');
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('customredirect', 'enabled', '".(int)$update_customredirect_enable."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('customredirect', 'default', '".(int)$update_customredirect_default."');");
lastStepStatus(0);
// need to fix default-error-copy-and-paste-shizzle
showUpdateStep("Checking if anything is ok with the default-error-handler");
if(!isset($settings['defaultwebsrverrhandler']['err404']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
}
if(!isset($settings['defaultwebsrverrhandler']['err403']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
}
if(!isset($settings['defaultwebsrverrhandler']['err401']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
}
lastStepStatus(0);
updateToVersion('0.9.7-svn1');
}
if(isFroxlorVersion('0.9.7-svn1'))
{
showUpdateStep("Updating from 0.9.7-svn1 to 0.9.7-svn2", false);
showUpdateStep("Updating open_basedir due to security - issue");
$result = $db->query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
while($row = $db->fetch_array($result))
{
$db->query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `openbasedir_path` = '1' WHERE `id` = " . $row['id']);
}
lastStepStatus(0);
updateToVersion('0.9.7-svn2');
}
if(isFroxlorVersion('0.9.7-svn2'))
{
showUpdateStep("Updating from 0.9.7-svn2 to 0.9.7-svn3", false);
showUpdateStep("Updating database tables");
$db->query("ALTER TABLE `redirect_codes` ADD `desc` varchar(200) NOT NULL AFTER `code`;");
lastStepStatus(0);
showUpdateStep("Updating field-values");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_default' WHERE `code` = '---';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_movedperm' WHERE `code` = '301';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_found' WHERE `code` = '302';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_seeother' WHERE `code` = '303';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_tempred' WHERE `code` = '307';");
lastStepStatus(0);
updateToVersion('0.9.7-svn3');
}
if(isFroxlorVersion('0.9.7-svn3'))
{
showUpdateStep("Updating from 0.9.7-svn3 to 0.9.7 final");
lastStepStatus(0);
updateToVersion('0.9.7');
}
if(isFroxlorVersion('0.9.7'))
{
showUpdateStep("Updating from 0.9.7 to 0.9.8 final");
lastStepStatus(0);
updateToVersion('0.9.8');
}
if(isFroxlorVersion('0.9.8'))
{
showUpdateStep("Updating from 0.9.8 to 0.9.9-svn1", false);
$update_defdns_mailentry = isset($_POST['update_defdns_mailentry']) ? '1' : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'dns_createmailentry', '".(int)$update_defdns_mailentry."');");
lastStepStatus(0);
updateToVersion('0.9.9-svn1');
}
if(isFroxlorVersion('0.9.9-svn1'))
{
showUpdateStep("Updating from 0.9.9-svn1 to 0.9.9 final");
lastStepStatus(0);
updateToVersion('0.9.9');
}
if(isFroxlorVersion('0.9.9'))
{
showUpdateStep("Updating from 0.9.9 to 0.9.10-svn1", false);
showUpdateStep("Checking whether you are missing any settings", false);
$nonefound = true;
$update_httpuser = isset($_POST['update_httpuser']) ? $_POST['update_httpuser'] : false;
$update_httpgroup = isset($_POST['update_httpgroup']) ? $_POST['update_httpgroup'] : false;
if($update_httpuser !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpuser'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpuser', '".$update_httpuser."');");
lastStepStatus(0);
}
if($update_httpgroup !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpgroup'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpgroup', '".$update_httpgroup."');");
lastStepStatus(0);
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'debug_cron'");
if(!isset($result) || !isset($result['value']))
{
$nonefound = false;
showUpdateStep("Adding missing setting 'debug_cron'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'debug_cron', '0');");
lastStepStatus(0);
}
if($nonefound) {
showUpdateStep("No missing settings found");
lastStepStatus(0);
}
updateToVersion('0.9.10-svn1');
}
if(isFroxlorVersion('0.9.10-svn1'))
{
showUpdateStep("Updating from 0.9.10-svn1 to 0.9.10-svn2", false);
showUpdateStep("Updating database table definition for panel_databases");
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` ADD `apsdb` tinyint(1) NOT NULL default '0' AFTER `dbserver`;");
lastStepStatus(0);
showUpdateStep("Adding APS databases to customers overview");
$count_dbupdates = 0;
$db_root = null;
openRootDB();
$result = $db_root->query("SHOW DATABASES;");
while($row = $db_root->fetch_array($result))
{
if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database'], $matches))
{
$cid = $matches[1];
$databasedescription = 'APS DB';
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$cid . '", "' . $db->escape($row['Database']) . '", "' . $db->escape($databasedescription) . '", "0", "1")');
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$cid . '"');
$count_dbupdates++;
}
}
closeRootDB();
if($count_dbupdates > 0) {
lastStepStatus(0, "Found ".$count_dbupdates." customer APS databases");
} else {
lastStepStatus(0, "None found");
}
updateToVersion('0.9.10-svn2');
}
if(isFroxlorVersion('0.9.10-svn2'))
{
showUpdateStep("Updating from 0.9.10-svn2 to 0.9.10", false);
$update_directlyviahostname = isset($_POST['update_directlyviahostname']) ? (int)$_POST['update_directlyviahostname'] : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'froxlordirectlyviahostname', '".(int)$update_directlyviahostname."');");
lastStepStatus(0);
updateToVersion('0.9.10');
}
if(isFroxlorVersion('0.9.10'))
{
showUpdateStep("Updating from 0.9.10 to 0.9.11-svn1", false);
$update_pwdregex = isset($_POST['update_pwdregex']) ? $_POST['update_pwdregex'] : '';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_regex', '".$db->escape($update_pwdregex)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn1');
}
if(isFroxlorVersion('0.9.11-svn1'))
{
showUpdateStep("Updating from 0.9.11-svn1 to 0.9.11-svn2", false);
showUpdateStep("Adding perl/CGI directory fields");
$db->query("ALTER TABLE `".TABLE_PANEL_HTACCESS."` ADD `options_cgi` tinyint(1) NOT NULL default '0' AFTER `error401path`;");
$db->query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `perlenabled` tinyint(1) NOT NULL default '0' AFTER `aps_packages_used`;");
lastStepStatus(0);
updateToVersion('0.9.11-svn2');
}
if(isFroxlorVersion('0.9.11-svn2'))
{
showUpdateStep("Updating from 0.9.11-svn2 to 0.9.11-svn3", false);
$update_perlpath = isset($_POST['update_perlpath']) ? $_POST['update_perlpath'] : '/usr/bin/perl';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'perl_path', '".$db->escape($update_perlpath)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn3');
}
if(isFroxlorVersion('0.9.11-svn3'))
{
showUpdateStep("Updating from 0.9.11-svn3 to 0.9.11 final");
lastStepStatus(0);
updateToVersion('0.9.11');
}
if(isFroxlorVersion('0.9.11'))
{
showUpdateStep("Updating from 0.9.11 to 0.9.12-svn1", false);
$update_fcgid_ownvhost = isset($_POST['update_fcgid_ownvhost']) ? (int)$_POST['update_fcgid_ownvhost'] : '0';
$update_fcgid_httpuser = isset($_POST['update_fcgid_httpuser']) ? $_POST['update_fcgid_httpuser'] : 'froxlorlocal';
$update_fcgid_httpgroup = isset($_POST['update_fcgid_ownvhost']) ? $_POST['update_fcgid_ownvhost'] : 'froxlorlocal';
if($update_fcgid_httpuser == '') {
$update_fcgid_httpuser = 'froxlorlocal';
}
if($update_fcgid_httpgroup == '') {
$update_fcgid_httpgroup = 'froxlorlocal';
}
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_ownvhost', '".$db->escape($update_fcgid_ownvhost)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_httpuser', '".$db->escape($update_fcgid_httpuser)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_httpgroup', '".$db->escape($update_fcgid_httpgroup)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn1');
}
if(isFroxlorVersion('0.9.12-svn1'))
{
showUpdateStep("Updating from 0.9.12-svn1 to 0.9.12-svn2", false);
$update_perl_suexecworkaround = isset($_POST['update_perl_suexecworkaround']) ? (int)$_POST['update_perl_suexecworkaround'] : '0';
$update_perl_suexecpath = isset($_POST['update_perl_suexecpath']) ? makeCorrectDir($_POST['update_perl_suexecpath']) : '/var/www/cgi-bin/';
if($update_perl_suexecpath == '') {
$update_perl_suexecpath = '/var/www/cgi-bin/';
}
showUpdateStep("Adding new settings for perl/CGI");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('perl', 'suexecworkaround', '".$db->escape($update_perl_suexecworkaround)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('perl', 'suexecpath', '".$db->escape($update_perl_suexecpath)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn2');
}
if(isFroxlorVersion('0.9.12-svn2'))
{
showUpdateStep("Updating from 0.9.12-svn2 to 0.9.12-svn3", false);
showUpdateStep("Adding new field to domain table");
$db->query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` ADD `ismainbutsubto` int(11) unsigned NOT NULL default '0' AFTER `mod_fcgid_maxrequests`;");
lastStepStatus(0);
updateToVersion('0.9.12-svn3');
}
if(isFroxlorVersion('0.9.12-svn3'))
{
showUpdateStep("Updating from 0.9.12-svn3 to 0.9.12-svn4", false);
$update_awstats_awstatspath = isset($_POST['update_awstats_awstatspath']) ? makeCorrectDir($_POST['update_awstats_awstatspath']) : $settings['system']['awstats_path'];
showUpdateStep("Adding new settings for awstats");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_awstatspath', '".$db->escape($update_awstats_awstatspath)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn4');
}
if(isFroxlorVersion('0.9.12-svn4'))
{
showUpdateStep("Updating from 0.9.12-svn4 to 0.9.12-svn5", false);
showUpdateStep("Setting ticket-usage-reset cronjob interval to 1 day");
$db->query("UPDATE `cronjobs_run` SET `interval`='1 DAY' WHERE `cronfile`='cron_used_tickets_reset.php';");
lastStepStatus(0);
updateToVersion('0.9.12-svn5');
}
if(isFroxlorVersion('0.9.12-svn5'))
{
showUpdateStep("Updating from 0.9.12-svn5 to 0.9.12-svn6", false);
showUpdateStep("Adding new field to table 'panel_htpasswds'");
$db->query("ALTER TABLE `".TABLE_PANEL_HTPASSWDS."` ADD `authname` varchar(255) NOT NULL default 'Restricted Area' AFTER `password`;");
lastStepStatus(0);
updateToVersion('0.9.12-svn6');
}
if(isFroxlorVersion('0.9.12-svn6'))
{
showUpdateStep("Updating from 0.9.12-svn6 to 0.9.12 final");
lastStepStatus(0);
updateToVersion('0.9.12');
}

View File

@@ -1,62 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Language
* @version $Id$
*/
/**
* Function getPreConfig
*
* outputs various content before the update process
* can be continued (askes for agreement whatever is being asked)
*
* @param string version
*
* @return string
*/
function getPreConfig($current_version)
{
$has_preconfig = false;
$return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>';
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '</div>';
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
if($has_preconfig) {
return $return;
} else {
return '';
}
}
function versionInUpdate($current_version, $version_to_check)
{
if (!isFroxlor()) {
return true;
}
$pos_a = strpos($current_version, '-svn');
$pos_b = strpos($version_to_check, '-svn');
// if we compare svn-versions, we have to add -svn0 to the version
// to compare it correctly
if($pos_a === false && $pos_b !== false)
{
$current_version.= '-svn9999';
}
return version_compare($current_version, $version_to_check, '<');
}

View File

@@ -1,282 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Language
* @version $Id$
*/
/**
* checks if the new-version has some updating to do
*
* @param boolean $has_preconfig pointer to check if any preconfig has to be output
* @param string $return pointer to output string
* @param string $current_version current froxlor version
*
* @return null
*/
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
{
global $settings, $lng, $db;
if(versionInUpdate($current_version, '0.9.4-svn2'))
{
$has_preconfig = true;
$description = 'Froxlor now enables the usage of a domain-wildcard entry and subdomains for this domain at the same time (subdomains are parsed before the main-domain vhost container).';
$description.= 'This makes it possible to catch all non-existing subdomains with the main vhost but also have the ability to use subdomains for that domain.<br />';
$description.= 'If you would like Froxlor to do so with your domains, the update script can set the correct values for existing domains for you. Note: future domains will have wildcard-entries enabled by default no matter how you decide here.';
$question = '<strong>Do you want to use wildcard-entries for existing domains?:</strong>&nbsp;';
$question.= makeyesno('update_domainwildcardentry', '1', '0', '1');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.6-svn2'))
{
if(!PHPMailer::ValidateAddress($settings['panel']['adminmail']))
{
$has_preconfig = true;
$description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
$question = '<strong>Please specify a new admin-email address:</strong>&nbsp;<input type="text" class="text" name="update_adminmail" value="'.$settings['panel']['adminmail'].'" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.6-svn3'))
{
$has_preconfig = true;
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
$question = '<strong>Do you want to enable default error-documents?:</strong>&nbsp;';
$question .= makeyesno('update_deferr_enable', '1', '0', '0').'<br /><br />';
if($settings['system']['webserver'] == 'apache2')
{
$question .= 'Path/URL for error 500:&nbsp;<input type="text" class="text" name="update_deferr_500" /><br /><br />';
$question .= 'Path/URL for error 401:&nbsp;<input type="text" class="text" name="update_deferr_401" /><br /><br />';
$question .= 'Path/URL for error 403:&nbsp;<input type="text" class="text" name="update_deferr_403" /><br /><br />';
}
$question .= 'Path/URL for error 404:&nbsp;<input type="text" class="text" name="update_deferr_404" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.6-svn4'))
{
$has_preconfig = true;
$description = 'You can define a default support-ticket priority level which is pre-selected for new support-tickets.';
$question = '<strong>Which should be the default ticket-priority?:</strong>&nbsp;';
$question .= '<select name="update_deftic_priority">';
$priorities = makeoption($lng['ticket']['unf_high'], '1', '2');
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', '2');
$priorities.= makeoption($lng['ticket']['unf_low'], '3', '2');
$question .= $priorities.'</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.6-svn5'))
{
$has_preconfig = true;
$description = 'If you have more than one PHP configurations defined in Froxlor you can now set a default one which will be used for every domain.';
$question = '<strong>Select default PHP configuration:</strong>&nbsp;';
$question .= '<select name="update_defsys_phpconfig">';
$configs_array = getPhpConfigs();
$configs = '';
foreach($configs_array as $idx => $desc)
{
$configs .= makeoption($desc, $idx, '1');
}
$question .= $configs.'</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.6-svn6'))
{
$has_preconfig = true;
$description = 'For the new FTP-quota feature, you can now chose the currently used ftpd-software.';
$question = '<strong>Used FTPd-software:</strong>&nbsp;';
$question .= '<select name="update_defsys_ftpserver">';
$question .= makeoption('ProFTPd', 'proftpd', 'proftpd');
$question .= makeoption('PureFTPd', 'pureftpd', 'proftpd');
$question .= '</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.7-svn1'))
{
$has_preconfig = true;
$description = 'You can now choose whether customers can select the http-redirect code and which of them acts as default.';
$question = '<strong>Allow customer chosen redirects?:</strong>&nbsp;';
$question.= makeyesno('update_customredirect_enable', '1', '0', '1').'<br /><br />';
$question.= '<strong>Select default redirect code (default: empty):</strong>&nbsp;';
$question.= '<select name="update_customredirect_default">';
$redirects = makeoption('--- ('.$lng['redirect_desc']['rc_default'].')', 1, '1');
$redirects.= makeoption('301 ('.$lng['redirect_desc']['rc_movedperm'].')', 2, '1');
$redirects.= makeoption('302 ('.$lng['redirect_desc']['rc_found'].')', 3, '1');
$redirects.= makeoption('303 ('.$lng['redirect_desc']['rc_seeother'].')', 4, '1');
$redirects.= makeoption('307 ('.$lng['redirect_desc']['rc_tempred'].')', 5, '1');
$question .= $redirects.'</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.7-svn2'))
{
$result = $db->query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
$wrongOpenBasedirDomain = array();
while($row = $db->fetch_array($result))
{
$wrongOpenBasedirDomain[] = $row['domain'];
}
if(count($wrongOpenBasedirDomain) > 0)
{
$has_preconfig = true;
$description = 'Resetting the open_basedir to customer - root';
$question = '<strong>Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot:</strong><br />&nbsp;';
$question.= '<ul>';
$idna_convert = new idna_convert_wrapper();
foreach($wrongOpenBasedirDomain as $domain)
{
$question.= '<li>' . $idna_convert->decode($domain) . '</li>';
}
$question.= '</ul>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.9-svn1'))
{
$has_preconfig = true;
$description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
$question = '<strong>Do you want these A-records to be created even with MX servers given?:</strong>&nbsp;';
$question.= makeyesno('update_defdns_mailentry', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.10-svn1'))
{
$has_nouser = false;
$has_nogroup = false;
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nouser = true;
$guessed_user = 'www-data';
if(function_exists('posix_getuid')
&& function_exists('posix_getpwuid')
) {
$_httpuser = posix_getpwuid(posix_getuid());
$guessed_user = $_httpuser['name'];
}
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nogroup = true;
$guessed_group = 'www-data';
if(function_exists('posix_getgid')
&& function_exists('posix_getgrgid')
) {
$_httpgroup = posix_getgrgid(posix_getgid());
$guessed_group = $_httpgroup['name'];
}
}
if($has_nouser || $has_nogroup)
{
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
if($has_nouser)
{
$question = '<strong>Please enter the webservers username:</strong>&nbsp;<input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
}
elseif($has_nogroup)
{
$question2 = '<strong>Please enter the webservers groupname:</strong>&nbsp;<input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
if($has_nouser) {
$question .= '<br /><br />'.$question2;
} else {
$question = $question2;
}
}
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.10'))
{
$has_preconfig = true;
$description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
$question = '<strong>Do you want Froxlor to be reached directly via the hostname?:</strong>&nbsp;';
$question.= makeyesno('update_directlyviahostname', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn1'))
{
$has_preconfig = true;
$description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
$question = '<strong>Enter a regular expression to force a higher password complexity (leave empty for none):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_pwdregex" value="" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn3'))
{
$has_preconfig = true;
$description = 'As Froxlor can now handle perl, you have to specify where the perl executable is (only if you\'re running lighttpd, else just leave empty).';
$question = '<strong>Path to perl (default \'/usr/bin/perl\'):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_perlpath" value="/usr/bin/perl" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.12-svn1'))
{
if($settings['system']['mod_fcgid'] == 1)
{
$has_preconfig = true;
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
$question = '<strong>Use FCGID for the Froxlor Panel?:</strong>&nbsp;';
$question.= makeyesno('update_fcgid_ownvhost', '1', '0', '0').'<br /><br />';
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
$question.= 'Local user:&nbsp;';
$question.= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />';
$question.= 'Local group:&nbsp;';
$question.= '<input type="text" class="text" name="update_fcgid_ownvhost" value="froxlorlocal" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.12-svn2'))
{
$has_preconfig = true;
$description = 'Many apache user will have problems using perl/CGI as the customer docroots are not within the suexec path. Froxlor provides a simple workaround for that.';
$question = '<strong>Enable Apache/SuExec/Perl workaround?:</strong>&nbsp;';
$question.= makeyesno('update_perl_suexecworkaround', '1', '0', '0').'<br /><br />';
$question.= '<strong>If \'yes\', please specify a path within the suexec path where Froxlor will create symlinks to customer perl-enabled paths:</strong><br /><br />';
$question.= 'Path for symlinks (must be within suexec path):&nbsp;';
$question.= '<input type="text" class="text" name="update_perl_suexecpath" value="/var/www/cgi-bin/" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.12-svn4'))
{
if((int)$settings['system']['awstats_enabled'] == 1)
{
$has_preconfig = true;
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
$question = '<strong>Path to \'awstats.pl\'?:</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.$settings['system']['awstats_path'].'" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
}

View File

@@ -19,18 +19,6 @@
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings); $updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
$filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'), $settings);
$filelog->setLogFile($updatelogfile);
// if first writing does not work we'll stop, tell the user to fix it
// and then let him try again.
try {
$filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------');
} catch(Exception $e) {
standard_error('exception', $e->getMessage());
}
/* /*
* since froxlor, we have to check if there's still someone * since froxlor, we have to check if there's still someone
* out there using syscp and needs to upgrade * out there using syscp and needs to upgrade
@@ -102,8 +90,6 @@ if(!isFroxlor())
if(isFroxlor()) if(isFroxlor())
{ {
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php')); include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
$filelog->logAction(ADM_ACTION, LOG_WARNING, '--------------- END LOG ---------------');
unset($filelog);
} }
?> ?>

View File

@@ -32,7 +32,6 @@ class ApsInstaller extends ApsParser
private $RealPath = ''; private $RealPath = '';
private $RootDir = ''; private $RootDir = '';
private $Hosts = ''; private $Hosts = '';
private $aps_version = '1.0';
/** /**
* constructor of class. setup some basic variables * constructor of class. setup some basic variables
@@ -73,8 +72,6 @@ class ApsInstaller extends ApsParser
$XmlContent = file_get_contents($this->RootDir . 'packages/' . $Row['Path'] . '/APP-META.xml'); $XmlContent = file_get_contents($this->RootDir . 'packages/' . $Row['Path'] . '/APP-META.xml');
$Xml = new SimpleXMLElement($XmlContent); $Xml = new SimpleXMLElement($XmlContent);
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check for unparseable xml data //check for unparseable xml data
@@ -149,16 +146,9 @@ class ApsInstaller extends ApsParser
$ReturnStatus = 0; $ReturnStatus = 0;
// make configure-script executable // make configure-script executable
if($this->aps_version != '1.0') chmod($this->RealPath . $this->DomainPath . '/install_scripts/configure', 0755);
{
$scriptname = (string)$Xml->service->provision->{'configuration-script'}['name'];
} else {
$scriptname = 'configure';
}
chmod($this->RealPath . $this->DomainPath . '/install_scripts/'.$scriptname, 0755); $Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/configure') . ' install', $ReturnStatus);
$Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/'.$scriptname) . ' install', $ReturnStatus);
if($ReturnStatus != 0) if($ReturnStatus != 0)
{ {
@@ -219,24 +209,16 @@ class ApsInstaller extends ApsParser
} }
elseif($Task == TASK_REMOVE) elseif($Task == TASK_REMOVE)
{ {
// check for database //FIXME cleanup installation
if ($this->aps_version == '1.0') //remove files from: $this->RealPath . $this->DomainPath . '/'
{ //remove permissions
// the good ole way //drop database
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
} $XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id) if($XmlDb->db->id)
{ {
//drop database permissions //database management
$Database = 'web' . $Row['CustomerID'] . 'aps' . $Row['InstanceID']; $Database = 'web' . $Row['CustomerID'] . 'aps' . $Row['InstanceID'];
foreach(array_map('trim', explode(',', $this->Hosts)) as $DatabaseHost) foreach(array_map('trim', explode(',', $this->Hosts)) as $DatabaseHost)
@@ -246,15 +228,8 @@ class ApsInstaller extends ApsParser
$this->db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $this->db->escape($Database) . '" AND `Host` = "' . $this->db->escape($DatabaseHost) . '"'); $this->db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $this->db->escape($Database) . '" AND `Host` = "' . $this->db->escape($DatabaseHost) . '"');
} }
//drop database
$this->db_root->query('DROP DATABASE IF EXISTS `' . $this->db->escape($Database) . '`'); $this->db_root->query('DROP DATABASE IF EXISTS `' . $this->db->escape($Database) . '`');
$this->db_root->query('FLUSH PRIVILEGES'); $this->db_root->query('FLUSH PRIVILEGES');
/*
* remove database from customer-mysql overview, #272
*/
$this->db->query('DELETE FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int)$Row['CustomerID'] . '" AND `databasename`="' . $this->db->escape($Database) . '" AND `apsdb`="1"');
$result = $this->db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`-1 WHERE `customerid`="' . (int)$Row['CustomerID'] . '"');
} }
//remove task & delete package instance + settings //remove task & delete package instance + settings
@@ -262,20 +237,6 @@ class ApsInstaller extends ApsParser
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_REMOVE . ' AND `InstanceID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_REMOVE . ' AND `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
$this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
$this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
//remove data, #273
if($this->DomainPath != '' && $this->DomainPath != '/') {
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
} else {
// save awstats/webalizer folder if it's the docroot
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/', true);
// place standard-index file
$loginname = getLoginNameByUid($Row['CustomerID']);
if($loginname !== false)
{
storeDefaultIndex($loginname, $this->RealPath . $this->DomainPath . '/');
}
}
} }
} }
@@ -317,19 +278,6 @@ class ApsInstaller extends ApsParser
private function PrepareFiles($Xml, $Row, $Task) private function PrepareFiles($Xml, $Row, $Task)
{ {
if($this->aps_version != '1.0')
{
$mapping = $Xml->service->provision->{'url-mapping'}->mapping;
$mapping_path = $Xml->service->provision->{'url-mapping'}->mapping['path'];
$mapping_url = $Xml->service->provision->{'url-mapping'}->mapping['url'];
}
else
{
$mapping = $Xml->mapping;
$mapping_path = $Xml->mapping['path'];
$mapping_url = $Xml->mapping['url'];
}
if($Task == TASK_INSTALL) if($Task == TASK_INSTALL)
{ {
//FIXME truncate customer directory //FIXME truncate customer directory
@@ -339,7 +287,7 @@ class ApsInstaller extends ApsParser
//extract all files and chown them to the customer guid //extract all files and chown them to the customer guid
if(self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], $mapping_path, $this->RealPath . $this->DomainPath . '/') == false if(self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], $Xml->mapping['path'], $this->RealPath . $this->DomainPath . '/') == false
|| self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], 'scripts', $this->RealPath . $this->DomainPath . '/install_scripts/') == false) || self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], 'scripts', $this->RealPath . $this->DomainPath . '/install_scripts/') == false)
{ {
$this->db->query('UPDATE `' . TABLE_APS_INSTANCES . '` SET `Status` = ' . INSTANCE_ERROR . ' WHERE `ID` = ' . $this->db->escape($Row['InstanceID'])); $this->db->query('UPDATE `' . TABLE_APS_INSTANCES . '` SET `Status` = ' . INSTANCE_ERROR . ' WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
@@ -371,7 +319,7 @@ class ApsInstaller extends ApsParser
//recursive mappings //recursive mappings
self::PrepareMappings($mapping, $mapping_url, $this->RealPath . $this->DomainPath . '/'); self::PrepareMappings($Xml->mapping, $Xml->mapping['url'], $this->RealPath . $this->DomainPath . '/');
return true; return true;
} }
@@ -388,37 +336,34 @@ class ApsInstaller extends ApsParser
//check for special PHP permissions //check for special PHP permissions
//must be done with xpath otherwise check not possible (XML parser problem with attributes) //must be done with xpath otherwise check not possible (XML parser problem with attributes)
if($ParentMapping && $ParentMapping !== null) $ParentMapping->registerXPathNamespace('p', 'http://apstandard.com/ns/1/php');
$Result = $ParentMapping->xpath('p:permissions');
if($Result[0]['writable'] == 'true')
{ {
$ParentMapping->registerXPathNamespace('p', 'http://apstandard.com/ns/1/php'); //fixing file permissions to writeable
$Result = $ParentMapping->xpath('p:permissions');
if(is_dir($Path))
if($Result[0]['writable'] == 'true')
{ {
//fixing file permissions to writeable chmod($Path, 0775);
if(is_dir($Path))
{
chmod($Path, 0775);
}
else
{
chmod($Path, 0664);
}
} }
else
if($Result[0]['readable'] == 'false')
{ {
//fixing file permissions to non readable chmod($Path, 0664);
}
if(is_dir($Path)) }
{
chmod($Path, 0333); if($Result[0]['readable'] == 'false')
} {
else //fixing file permissions to non readable
{
chmod($Path, 0222); if(is_dir($Path))
} {
chmod($Path, 0333);
}
else
{
chmod($Path, 0222);
} }
} }
@@ -428,20 +373,18 @@ class ApsInstaller extends ApsParser
putenv('WEB_' . $EnvVariable . '_DIR=' . $Path); putenv('WEB_' . $EnvVariable . '_DIR=' . $Path);
//resolve deeper mappings //resolve deeper mappings
if($ParentMapping && $ParentMapping !== null)
foreach($ParentMapping->mapping as $Mapping)
{ {
foreach($ParentMapping->mapping as $Mapping) //recursive check of other mappings
if($Url == '/')
{ {
//recursive check of other mappings self::PrepareMappings($Mapping, $Url . $Mapping['url'], $Path . $Mapping['url']);
}
if($Url == '/') else
{ {
self::PrepareMappings($Mapping, $Url . $Mapping['url'], $Path . $Mapping['url']); self::PrepareMappings($Mapping, $Url . '/' . $Mapping['url'], $Path . '/' . $Mapping['url']);
}
else
{
self::PrepareMappings($Mapping, $Url . '/' . $Mapping['url'], $Path . '/' . $Mapping['url']);
}
} }
} }
} }
@@ -490,22 +433,9 @@ class ApsInstaller extends ApsParser
private function PrepareDatabase($Xml, $Row, $Task) private function PrepareDatabase($Xml, $Row, $Task)
{ {
global $db_root;
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db'); $XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id) if($XmlDb->db->id)
{ {
//database management //database management
@@ -526,13 +456,6 @@ class ApsInstaller extends ApsParser
} }
$this->db_root->query('FLUSH PRIVILEGES'); $this->db_root->query('FLUSH PRIVILEGES');
/*
* add database to customers databases, #272
*/
$databasedescription = $Xml->name.' '.$Xml->version.' (Release ' . $Xml->release . ')';
$result = $this->db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$Row['CustomerID'] . '", "' . $this->db->escape($NewDatabase) . '", "' . $this->db->escape($databasedescription) . '", "0", "1")');
$result = $this->db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$Row['CustomerID'] . '"');
} }
//get first mysql access host //get first mysql access host
@@ -653,3 +576,5 @@ class ApsInstaller extends ApsParser
return false; return false;
} }
} }
?>

View File

@@ -38,7 +38,6 @@ class ApsParser
private $settings = array(); private $settings = array();
private $db = false; private $db = false;
private $RootDir = ''; private $RootDir = '';
private $aps_version = '1.0';
/** /**
* Constructor of class, setup basic variables needed by the class * Constructor of class, setup basic variables needed by the class
@@ -400,9 +399,9 @@ class ApsParser
* unlink files recursively * unlink files recursively
* *
* @param dir directory to delete recursive * @param dir directory to delete recursive
* @param boolean whether the base-directory should be kept or not
*/ */
protected function UnlinkRecursive($Dir, $save_base = false)
protected function UnlinkRecursive($Dir)
{ {
if(!$DirHandle = @opendir($Dir))return; if(!$DirHandle = @opendir($Dir))return;
@@ -411,12 +410,6 @@ class ApsParser
if($Object == '.' if($Object == '.'
|| $Object == '..')continue; || $Object == '..')continue;
if($save_base
&& (strtoupper($Object) == 'AWSTATS' || strtoupper($Object) == 'WEBALIZER')
) {
continue;
}
if(!@unlink($Dir . '/' . $Object)) if(!@unlink($Dir . '/' . $Object))
{ {
self::UnlinkRecursive($Dir . '/' . $Object); self::UnlinkRecursive($Dir . '/' . $Object);
@@ -424,10 +417,7 @@ class ApsParser
} }
closedir($DirHandle); closedir($DirHandle);
if(!$save_base) @rmdir($Dir);
{
@rmdir($Dir);
}
} }
/** /**
@@ -998,26 +988,14 @@ class ApsParser
if($Xml == false)continue; if($Xml == false)continue;
$Icon = './images/default.png'; $Icon = './images/default.png';
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//show data and status of package //show data and status of package
if($this->aps_version != '1.0') if($Xml->icon['path'])
{ {
$iconpath = $Xml->presentation->icon['path']; $Icon = './packages/' . $Row2['Path'] . '/' . basename($Xml->icon['path']);
$Summary = htmlspecialchars($Xml->presentation->summary);
}
else
{
$iconpath = $Xml->icon['path'];
$Summary = htmlspecialchars($Xml->summary);
}
if($iconpath)
{
$Icon = './packages/' . $Row2['Path'] . '/' . basename($iconpath);
} }
$Summary = $Xml->summary;
$Fieldname = $lng['aps']['version']; $Fieldname = $lng['aps']['version'];
$Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')'; $Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";"); eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
@@ -1360,43 +1338,23 @@ class ApsParser
private function InstallNewPackage($Filename) private function InstallNewPackage($Filename)
{ {
global $lng, $userinfo; global $lng;
if(file_exists($Filename) if(file_exists($Filename)
&& $Xml = self::GetXmlFromZip($Filename)) && $Xml = self::GetXmlFromZip($Filename))
{ {
$Error = array(); $Error = array();
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check alot of stuff if package is supported //check alot of stuff if package is supported
//php modules //php modules
if ($this->aps_version == '1.0') $XmlPhp = $Xml->requirements->children('http://apstandard.com/ns/1/php');
{
// the good ole way
$XmlPhp = $Xml->requirements->children('http://apstandard.com/ns/1/php');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('php', 'http://apstandard.com/ns/1/php');
$XmlPhp = new DynamicProperties;
$XmlPhp->extension = getXPathValue($Xml, '//php:extension', false);
$XmlPhp->function = getXPathValue($Xml, '//php:function', false);
}
if($XmlPhp->extension) if($XmlPhp->extension)
{ {
$ExtensionsLoaded = get_loaded_extensions(); $ExtensionsLoaded = get_loaded_extensions();
foreach($XmlPhp->extension as $Extension) foreach($XmlPhp->extension as $Extension)
{ {
if(strtolower($Extension) == 'php')
{
continue;
}
if(!in_array($Extension, $ExtensionsLoaded) if(!in_array($Extension, $ExtensionsLoaded)
&& !self::CheckException('php', 'extension', $Extension)) && !self::CheckException('php', 'extension', $Extension))
{ {
@@ -1431,11 +1389,6 @@ class ApsParser
); );
foreach($PhpValues as $Value) foreach($PhpValues as $Value)
{ {
if ($this->aps_version != '1.0')
{
$XmlPhp->{$Value} = getXPathValue($Xml, '//php:'.$Value);
}
if($XmlPhp->{$Value}) if($XmlPhp->{$Value})
{ {
if(self::TrueFalseIniGet($Value) != $XmlPhp->{$Value} if(self::TrueFalseIniGet($Value) != $XmlPhp->{$Value}
@@ -1446,11 +1399,6 @@ class ApsParser
} }
} }
if ($this->aps_version != '1.0')
{
$XmlPhp->{'post-max-size'} = getXPathValue($Xml, '//php:post-max-size');
}
if($XmlPhp->{'post-max-size'}) if($XmlPhp->{'post-max-size'})
{ {
if(self::PhpMemorySizeToBytes(ini_get('post_max_size')) < intval($XmlPhp->{'post-max-size'}) if(self::PhpMemorySizeToBytes(ini_get('post_max_size')) < intval($XmlPhp->{'post-max-size'})
@@ -1460,11 +1408,6 @@ class ApsParser
} }
} }
if ($this->aps_version != '1.0')
{
$XmlPhp->{'memory-limit'} = getXPathValue($Xml, '//php:memory-limit');
}
if($XmlPhp->{'memory-limit'}) if($XmlPhp->{'memory-limit'})
{ {
if(self::PhpMemorySizeToBytes(ini_get('memory_limit')) < intval($XmlPhp->{'memory-limit'}) if(self::PhpMemorySizeToBytes(ini_get('memory_limit')) < intval($XmlPhp->{'memory-limit'})
@@ -1474,11 +1417,6 @@ class ApsParser
} }
} }
if ($this->aps_version != '1.0')
{
$XmlPhp->{'max-execution-time'} = getXPathValue($Xml, '//php:max-execution-time');
}
if($XmlPhp->{'max-execution-time'}) if($XmlPhp->{'max-execution-time'})
{ {
if(ini_get('max_execution_time') < intval($XmlPhp->{'max-execution-time'}) if(ini_get('max_execution_time') < intval($XmlPhp->{'max-execution-time'})
@@ -1512,21 +1450,7 @@ class ApsParser
//database //database
if ($this->aps_version == '1.0') $XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
$XmlDb->db->{'server-type'} = getXPathValue($Xml, '//db:server-type');
$XmlDb->db->{'server-min-version'} = getXPathValue($Xml, '//db:server-min-version');
}
if($XmlDb->db->id) if($XmlDb->db->id)
{ {
@@ -1543,21 +1467,7 @@ class ApsParser
//ASP.NET //ASP.NET
if ($this->aps_version == '1.0') $XmlAsp = $Xml->requirements->children('http://apstandard.com/ns/1/aspnet');
{
// the good ole way
$XmlAsp = $Xml->requirements->children('http://apstandard.com/ns/1/aspnet');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('aspnet', 'http://apstandard.com/ns/1/aspnet');
$XmlAsp = new DynamicProperties;
$XmlAsp->handler = getXPathValue($Xml, '//aspnet:handler');
$XmlAsp->permissions = getXPathValue($Xml, '//aspnet:permissions');
$XmlAsp->version = getXPathValue($Xml, '//aspnet:version');
}
if($XmlAsp->handler if($XmlAsp->handler
|| $XmlAsp->permissions || $XmlAsp->permissions
@@ -1568,19 +1478,7 @@ class ApsParser
//CGI //CGI
if ($this->aps_version == '1.0') $XmlCgi = $Xml->requirements->children('http://apstandard.com/ns/1/cgi');
{
// the good ole way
$XmlCgi = $Xml->requirements->children('http://apstandard.com/ns/1/cgi');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('cgi', 'http://apstandard.com/ns/1/cgi');
$XmlCgi = new DynamicProperties;
$XmlCgi->handler = getXPathValue($Xml, '//cgi:handler');
}
if($XmlCgi->handler) if($XmlCgi->handler)
{ {
@@ -1589,20 +1487,7 @@ class ApsParser
//webserver modules //webserver modules
if ($this->aps_version == '1.0') $XmlWebserver = $Xml->requirements->children('http://apstandard.com/ns/1/apache');
{
// the good ole way
$XmlWebserver = $Xml->requirements->children('http://apstandard.com/ns/1/apache');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('apache', 'http://apstandard.com/ns/1/apache');
$XmlWebserver = new DynamicProperties;
$XmlWebserver->{'required-module'} = getXPathValue($Xml, '//apache:required-module');
$XmlWebserver->htaccess = getXPathValue($Xml, '//apache:htaccess');
}
if($XmlWebserver->{'required-module'}) if($XmlWebserver->{'required-module'})
{ {
@@ -1642,21 +1527,7 @@ class ApsParser
//validation against a charset not possible in current version //validation against a charset not possible in current version
if ($this->aps_version == '1.0') foreach($Xml->settings->group as $Group)
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
foreach($aps_settings_array as $Group)
{ {
foreach($Group->setting as $Setting) foreach($Group->setting as $Setting)
{ {
@@ -1673,16 +1544,13 @@ class ApsParser
//check different errors/features in submappings //check different errors/features in submappings
if ($this->aps_version == '1.0') $Return = self::CheckSubmappings($Xml->mapping, $Xml->mapping['url']);
{
$Return = self::CheckSubmappings($Xml->mapping, $Xml->mapping['url']);
if(count($Return) != 0) if(count($Return) != 0)
{
foreach($Return as $Value)
{ {
foreach($Return as $Value) if(!in_array($Value, $Error))$Error[] = $Value;
{
if(!in_array($Value, $Error))$Error[] = $Value;
}
} }
} }
@@ -1748,57 +1616,28 @@ class ApsParser
self::GetContentFromZip($Filename, 'APP-META.xml', $Destination . 'APP-META.xml'); self::GetContentFromZip($Filename, 'APP-META.xml', $Destination . 'APP-META.xml');
//copy screenshots //copy screenshots
if ($this->aps_version != '1.0')
{
$xml_screenshots = $Xml->presentation->screenshot;;
}
else
{
$xml_screenshots = $Xml->screenshot;
}
if($xml_screenshots) if($Xml->screenshot)
{ {
foreach($xml_screenshots as $Screenshot) foreach($Xml->screenshot as $Screenshot)
{ {
self::GetContentFromZip($Filename, $Screenshot['path'], $Destination . basename($Screenshot['path'])); self::GetContentFromZip($Filename, $Screenshot['path'], $Destination . basename($Screenshot['path']));
} }
} }
//copy icon //copy icon
if ($this->aps_version != '1.0')
{
$xml_iconpath = $Xml->presentation->icon['path'];
}
else
{
$xml_iconpath = $Xml->icon['path'];
}
if($xml_iconpath) if($Xml->icon['path'])
{ {
self::GetContentFromZip($Filename, $xml_iconpath, $Destination . basename($xml_iconpath)); self::GetContentFromZip($Filename, $Xml->icon['path'], $Destination . basename($Xml->icon['path']));
} }
//copy license //copy license
if ($this->aps_version != '1.0')
{
$xml_license = $Xml->service->license;
}
else
{
$xml_license = $Xml->license;
}
if($xml_license if($Xml->license
&& $xml_license->text->file) && $Xml->license->text->file)
{ {
self::GetContentFromZip($Filename, $xml_license->text->file, $Destination . 'license.txt'); self::GetContentFromZip($Filename, $Xml->license->text->file, $Destination . 'license.txt');
} }
//insert package to database //insert package to database
@@ -1840,7 +1679,7 @@ class ApsParser
public function MainHandler($Action) public function MainHandler($Action)
{ {
global $lng, $filename, $s, $page, $action, $Id, $userinfo; global $lng, $filename, $s, $page, $action, $Id;
//check for basic functions, classes and permissions //check for basic functions, classes and permissions
@@ -2191,13 +2030,6 @@ class ApsParser
return; return;
} }
// no more contingent, #278
if($userinfo['aps_packages'] == $userinfo['aps_packages_used']
&& $userinfo['aps_packages'] != '-1'
){
self::InfoBox($lng['aps']['nocontingent']);
}
//show packages //show packages
while($Row3 = $this->db->fetch_array($result2)) while($Row3 = $this->db->fetch_array($result2))
@@ -2531,26 +2363,10 @@ class ApsParser
if($Xml == false)return false; if($Xml == false)return false;
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check all data fields of xml file against inut of customer //check all data fields of xml file against inut of customer
if ($this->aps_version == '1.0')
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
$Error = array(); $Error = array();
foreach($aps_settings_array as $Group) foreach($Xml->settings->group as $Group)
{ {
foreach($Group->setting as $Setting) foreach($Group->setting as $Setting)
{ {
@@ -2599,8 +2415,7 @@ class ApsParser
{ {
if(isset($_POST[$FieldId])) if(isset($_POST[$FieldId]))
{ {
$email = strtolower($_POST[$FieldId]); if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $_POST[$FieldId]))
if(filter_var($email, FILTER_VALIDATE_EMAIL) === false)
{ {
if(!in_array($FieldId, $Error))$Error[] = $FieldId; if(!in_array($FieldId, $Error))$Error[] = $FieldId;
} }
@@ -2726,19 +2541,7 @@ class ApsParser
//database required? //database required?
if ($this->aps_version == '1.0') $XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id) if($XmlDb->db->id)
{ {
@@ -2860,19 +2663,10 @@ class ApsParser
self::SetInstallationValue($PackageId, $CustomerId, 'main_location', ''); self::SetInstallationValue($PackageId, $CustomerId, 'main_location', '');
} }
if ($this->aps_version != '1.0') if($Xml->license)
{ {
$xml_license = $Xml->service->license; if($Xml->license['must-accept']
} && $Xml->license['must-accept'] == 'true')
else
{
$xml_license = $Xml->license;
}
if($xml_license)
{
if($xml_license['must-accept']
&& $xml_license['must-accept'] == 'true')
{ {
if(isset($_POST['license']) if(isset($_POST['license'])
&& $_POST['license'] == 'true') && $_POST['license'] == 'true')
@@ -2917,8 +2711,6 @@ class ApsParser
if($Xml == false)return false; if($Xml == false)return false;
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//show notifcation if customer has reached his installation limit //show notifcation if customer has reached his installation limit
if($this->userinfo['aps_packages'] != '-1' if($this->userinfo['aps_packages'] != '-1'
@@ -2931,19 +2723,10 @@ class ApsParser
//icon for package //icon for package
$Icon = './images/default.png'; $Icon = './images/default.png';
if($this->aps_version != '1.0')
{
$iconpath = $Xml->presentation->icon['path'];
}
else
{
$iconpath = $Xml->icon['path'];
}
if($iconpath) if($Xml->icon['path'])
{ {
$Icon = './packages/' . $Row['Path'] . '/' . basename($iconpath); $Icon = './packages/' . $Row['Path'] . '/' . basename($Xml->icon['path']);
} }
//show error message if some input was wrong //show error message if some input was wrong
@@ -2977,7 +2760,7 @@ class ApsParser
{ {
if($Value) if($Value)
{ {
if($Row3['id'] == $Value) if($Row3['ID'] == $Value)
{ {
$Temp.= '<option selected="selected" value="' . $Row3['id'] . '">' . $Row3['domain'] . '</option>'; $Temp.= '<option selected="selected" value="' . $Row3['id'] . '">' . $Row3['domain'] . '</option>';
} }
@@ -3029,19 +2812,7 @@ class ApsParser
//database required? //database required?
if ($this->aps_version == '1.0') $XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id) if($XmlDb->db->id)
{ {
@@ -3059,22 +2830,8 @@ class ApsParser
$Fieldvalue = $Temp; $Fieldvalue = $Temp;
eval("\$Data.=\"" . getTemplate("aps/data") . "\";"); eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
} }
if ($this->aps_version == '1.0')
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
foreach($aps_settings_array as $Group) foreach($Xml->settings->group as $Group)
{ {
$GroupPrinted = false; $GroupPrinted = false;
foreach($Group->setting as $Setting) foreach($Group->setting as $Setting)
@@ -3257,25 +3014,16 @@ class ApsParser
} }
} }
if ($this->aps_version != '1.0') if($Xml->license)
{
$xml_license = $Xml->service->license;
}
else
{
$xml_license = $Xml->license;
}
if($xml_license)
{ {
$Temp = ''; $Temp = '';
if($xml_license['must-accept'] if($Xml->license['must-accept']
&& $xml_license['must-accept'] == 'true') && $Xml->license['must-accept'] == 'true')
{ {
if($xml_license->text->name)$Temp.= $xml_license->text->name . '<br/>'; if($Xml->license->text->name)$Temp.= $Xml->license->text->name . '<br/>';
if($xml_license->text->file) if($Xml->license->text->file)
{ {
$Temp.= '<textarea name="text" rows="10" cols="55">'; $Temp.= '<textarea name="text" rows="10" cols="55">';
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt'); $FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
@@ -3288,7 +3036,7 @@ class ApsParser
} }
else else
{ {
$Temp.= '<a target="_blank" href="' . htmlspecialchars($xml_license->text->url) . '">' . $lng['aps']['error_license'] . '</a>'; $Temp.= '<a target="_blank" href="' . htmlspecialchars($Xml->license->text->url) . '">' . $lng['aps']['error_license'] . '</a>';
$Groupname = $lng['aps']['license']; $Groupname = $lng['aps']['license'];
$Fieldname = $lng['aps']['license']; $Fieldname = $lng['aps']['license'];
$Fieldvalue = $Temp; $Fieldvalue = $Temp;
@@ -3339,37 +3087,14 @@ class ApsParser
if($Xml == false)return false; if($Xml == false)return false;
$Icon = './images/default.png'; $Icon = './images/default.png';
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//show icon and basic data //show icon and basic data
if($this->aps_version != '1.0')
if($Xml->icon['path'])
{ {
$iconpath = $Xml->presentation->icon['path']; $Icon = './packages/' . $Row['Path'] . '/' . basename($Xml->icon['path']);
$Summary = htmlspecialchars($Xml->presentation->summary);
$categories = $Xml->presentation->categories;
$languages = $Xml->presentation->languages;
$description = $Xml->presentation->description;
$changelogs = $Xml->presentation->changelog;
$license = $Xml->service->license;
$screenshots = $Xml->presentation->screenshot;
}
else
{
$iconpath = $Xml->icon['path'];
$Summary = htmlspecialchars($Xml->summary);
$categories = $Xml->categories;
$languages = $Xml->languages;
$description = $Xml->description;
$changelogs = $Xml->changelog;
$license = $Xml->license;
$screenshots = $Xml->screenshot;
}
if($iconpath)
{
$Icon = './packages/' . $Row['Path'] . '/' . basename($iconpath);
} }
$Summary = htmlspecialchars($Xml->summary);
$Fieldname = $lng['aps']['version']; $Fieldname = $lng['aps']['version'];
$Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')'; $Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";"); eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
@@ -3394,12 +3119,12 @@ class ApsParser
//show categories //show categories
if($categories) if($Xml->categories)
{ {
$Temp = ''; $Temp = '';
foreach($categories->category as $_categories) foreach($Xml->categories->category as $Categories)
{ {
$Temp.= htmlspecialchars($_categories[0]) . '<br/>'; $Temp.= htmlspecialchars($Categories[0]) . '<br/>';
} }
$Fieldname = $lng['aps']['categories']; $Fieldname = $lng['aps']['categories'];
@@ -3409,12 +3134,12 @@ class ApsParser
//show available languages //show available languages
if($languages) if($Xml->languages)
{ {
$Temp = ''; $Temp = '';
foreach($languages->language as $_languages) foreach($Xml->languages->language as $Languages)
{ {
$Temp.= $_languages[0] . ' '; $Temp.= $Languages[0] . ' ';
} }
$Fieldname = $lng['aps']['languages']; $Fieldname = $lng['aps']['languages'];
@@ -3427,7 +3152,7 @@ class ApsParser
if($All == true) if($All == true)
{ {
$Fieldname = $lng['aps']['long_description']; $Fieldname = $lng['aps']['long_description'];
$Fieldvalue = htmlspecialchars($description); $Fieldvalue = htmlspecialchars($Xml->description);
eval("\$Data.=\"" . getTemplate("aps/data") . "\";"); eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
//show config script language //show config script language
@@ -3442,7 +3167,7 @@ class ApsParser
//show changelog //show changelog
$Temp = '<ul>'; $Temp = '<ul>';
foreach($changelogs->version as $Versions) foreach($Xml->changelog->version as $Versions)
{ {
$Temp.= '<li><strong>' . $Versions['version'] . ' (Release ' . $Versions['release'] . ')</strong>'; $Temp.= '<li><strong>' . $Versions['version'] . ' (Release ' . $Versions['release'] . ')</strong>';
$Temp.= '<ul>'; $Temp.= '<ul>';
@@ -3461,13 +3186,13 @@ class ApsParser
//show license //show license
if($license) if($Xml->license)
{ {
if($license->text->file) if($Xml->license->text->file)
{ {
$Temp = ''; $Temp = '';
if($license->text->name)$Temp = $license->text->name . '<br/>'; if($Xml->license->text->name)$Temp = $Xml->license->text->name . '<br/>';
$Temp.= '<form name="license" action="#"><textarea name="text" rows="10" cols="70">'; $Temp.= '<form name="license" action="#"><textarea name="text" rows="10" cols="70">';
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt'); $FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'ISO-8859-1'); $Temp.= htmlentities($FileContent, ENT_QUOTES, 'ISO-8859-1');
@@ -3479,23 +3204,23 @@ class ApsParser
else else
{ {
$Fieldname = $lng['aps']['license']; $Fieldname = $lng['aps']['license'];
$Fieldvalue = '<a target="_blank" href="' . htmlspecialchars($license->text->url) . '">' . $lng['aps']['linktolicense'] . '</a>'; $Fieldvalue = '<a target="_blank" href="' . htmlspecialchars($Xml->license->text->url) . '">' . $lng['aps']['linktolicense'] . '</a>';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";"); eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
} }
} }
//show screenshots //show screenshots
if($screenshots) if($Xml->screenshot)
{ {
$Count = 0; $Count = 0;
$Temp = ''; $Temp = '';
foreach($screenshots as $Screenshot) foreach($Xml->screenshot as $Screenshot)
{ {
$Count+= 1; $Count+= 1;
$Temp.= '<img src="./packages/' . $Row['Path'] . '/' . basename($Screenshot['path']) . '" alt="' . $Screenshot->description . '"/><br/><em>' . $Screenshot->description . '</em><br/>'; $Temp.= '<img src="./packages/' . $Row['Path'] . '/' . basename($Screenshot['path']) . '" alt="' . $Screenshot->description . '"/><br/><em>' . $Screenshot->description . '</em><br/>';
if(count($screenshots) != $Count)$Temp.= '<br/>'; if(count($Xml->screenshot) != $Count)$Temp.= '<br/>';
} }
$Fieldname = $lng['aps']['screenshots']; $Fieldname = $lng['aps']['screenshots'];
@@ -3504,41 +3229,6 @@ class ApsParser
} }
} }
/*
* check if packages needs a database
* and if the customer has contingent for that, #272
*/
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
if($userinfo['mysqls_used'] < $userinfo['mysqls']
|| $userinfo['mysqls'] == '-1'
){
$can_use_db = true;
} else {
$can_use_db = false;
}
} else { $can_use_db = true; }
$db_info = '';
if(!$can_use_db)
{
$db_info = $lng['aps']['packageneedsdb'];
}
eval("echo \"" . getTemplate("aps/package") . "\";"); eval("echo \"" . getTemplate("aps/package") . "\";");
unset($Xml); unset($Xml);
} }

View File

@@ -1,18 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package APS
* @version $Id$
*/
class DynamicProperties { /* empty class for some magic */ }

View File

@@ -169,7 +169,7 @@ class FileLogger extends AbstractLogger
} }
} }
public function setLogFile($filename = null) private function setLogFile($filename = null)
{ {
if($filename != null if($filename != null
&& $filename != '' && $filename != ''

View File

@@ -255,14 +255,12 @@ class ticket
{ {
// Get e-mail message for customer // Get e-mail message for customer
$usr = $this->db->query_first('SELECT `name`, `firstname`, `company`, `email` $usr = $this->db->query_first('SELECT `name`, `firstname`, `email`
FROM `' . TABLE_PANEL_CUSTOMERS . '` FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$customerid . '"'); WHERE `customerid` = "' . (int)$customerid . '"');
$replace_arr = array( $replace_arr = array(
'FIRSTNAME' => $usr['firstname'], 'FIRSTNAME' => $usr['firstname'],
'NAME' => $usr['name'], 'NAME' => $usr['name'],
'COMPANY' => $usr['company'],
'SALUTATION' => getCorrectUserSalutation($usr),
'SUBJECT' => $this->Get('subject', true) 'SUBJECT' => $this->Get('subject', true)
); );
} }
@@ -346,19 +344,12 @@ class ticket
* Add a support-categories * Add a support-categories
*/ */
static public function addCategory($_db, $_category = null, $_admin = 1, $_order = 1) static public function addCategory($_db, $_category = null, $_admin = 1)
{ {
if($_category != null if($_category != null
&& $_category != '') && $_category != '')
{ {
if($_order < 1) { $_db->query('INSERT INTO `' . TABLE_PANEL_TICKET_CATS . '` (`name`, `adminid`) VALUES ("' . $_db->escape($_category) . '", "' . (int)$_admin . '")');
$_order = 1;
}
$_db->query('INSERT INTO `' . TABLE_PANEL_TICKET_CATS . '` SET
`name` = "' . $_db->escape($_category) . '",
`adminid` = "' . (int)$_admin . '",
`logicalorder` = "' . (int)$_order . '"');
return true; return true;
} }
@@ -369,19 +360,13 @@ class ticket
* Edit a support-categories * Edit a support-categories
*/ */
static public function editCategory($_db, $_category = null, $_id = 0, $_order = 1) static public function editCategory($_db, $_category = null, $_id = 0)
{ {
if($_category != null if($_category != null
&& $_category != '' && $_category != ''
&& $_id != 0) && $_id != 0)
{ {
if($_order < 1) { $_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET `name` = "' . $_db->escape($_category) . '"
$_order = 1;
}
$_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET
`name` = "' . $_db->escape($_category) . '",
`logicalorder` = "' . (int)$_order . '"
WHERE `id` = "' . (int)$_id . '"'); WHERE `id` = "' . (int)$_id . '"');
return true; return true;
} }
@@ -708,10 +693,6 @@ class ticket
{ {
return str_replace('script>', 'pre>', htmlspecialchars_decode(nl2br($this->t_data[$_var]))); return str_replace('script>', 'pre>', htmlspecialchars_decode(nl2br($this->t_data[$_var])));
} }
elseif(strtolower($_var) == 'subject')
{
return str_replace('script>', 'pre>', htmlspecialchars_decode(nl2br($this->t_data[$_var])));
}
else else
{ {
return $this->t_data[$_var]; return $this->t_data[$_var];

View File

@@ -29,7 +29,7 @@ return Array(
'commands' => Array( 'commands' => Array(
'mkdir -p ' . $settings['system']['documentroot_prefix'], 'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'], 'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '', 'mkdir -p ' . $settings['system']['deactivateddocroot'],
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'], 'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'], 'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
'a2dismod userdir', 'a2dismod userdir',
@@ -51,8 +51,6 @@ return Array(
$configcommand['diroptions'], $configcommand['diroptions'],
$configcommand['v_inclighty'], $configcommand['v_inclighty'],
$configcommand['d_inclighty'], $configcommand['d_inclighty'],
'lighty-disable-mod cgi',
'lighty-disable-mod fastcgi',
'mkdir -p ' . $settings['system']['documentroot_prefix'], 'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'], 'mkdir -p ' . $settings['system']['logfiles_directory'],
'mkdir -p ' . $settings['system']['deactivateddocroot'], 'mkdir -p ' . $settings['system']['deactivateddocroot'],
@@ -73,9 +71,7 @@ return Array(
'commands' => Array( 'commands' => Array(
'apt-get install bind9', 'apt-get install bind9',
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', 'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/bind9 restart' '/etc/init.d/bind9 restart'
@@ -137,19 +133,6 @@ return Array(
'newaliases' 'newaliases'
) )
), ),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'exim4' => Array( 'exim4' => Array(
'label' => 'Exim4', 'label' => 'Exim4',
'commands_1' => Array( 'commands_1' => Array(
@@ -262,7 +245,7 @@ return Array(
'apt-get install xinetd' 'apt-get install xinetd'
), ),
'files' => Array( 'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor' 'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/xinetd restart' '/etc/init.d/xinetd restart'
@@ -270,12 +253,18 @@ return Array(
), ),
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array( 'commands' => Array(
'apt-get install awstats', 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']), ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
), ),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
)
), ),
'libnss' => Array( 'libnss' => Array(
'label' => 'libnss (system login with mysql)', 'label' => 'libnss (system login with mysql)',

View File

@@ -58,7 +58,7 @@ return Array(
'cd /usr/ports/dns/powerdns', 'cd /usr/ports/dns/powerdns',
'make config', 'make config',
'make install', 'make install',
'echo "pdns_enable=\"YES\"" >> /etc/rc.conf', 'echo "add pdns_enable=\"YES\"" >> /etc/rc.conf',
), ),
'files' => Array( 'files' => Array(
'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf' 'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf'
@@ -111,34 +111,6 @@ return Array(
'restart' => Array( 'restart' => Array(
'sh /usr/local/etc/rc.d/postfix restart' 'sh /usr/local/etc/rc.d/postfix restart'
) )
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/usr/local/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/usr/local/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'dkim' => Array(
'label' => 'DomainKey filter',
'commands' => Array(
'cd /usr/ports/mail/dkim-milter/',
'make install clean',
'touch /usr/local/etc/mail/dkim-filter.conf'
),
'files' => Array(
'dkim-filter.conf' => '/usr/local/etc/mail/dkim-filter.conf',
'postfix_dkim_addition.cf' => '/usr/local/etc/postfix/main.cf'
),
'restart' => Array(
'/usr/local/etc/rc.d/milter-dkim restart '
)
) )
) )
), ),
@@ -155,7 +127,7 @@ return Array(
'set ManageSieve support (optional)', 'set ManageSieve support (optional)',
'set MySQL support ', 'set MySQL support ',
'make install', 'make install',
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf' 'echo "add dovecot_enable=\"YES\"" >> /etc/rc.conf'
), ),
'files' => Array( 'files' => Array(
'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf', 'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf',
@@ -163,8 +135,7 @@ return Array(
), ),
'commands_2' => Array( 'commands_2' => Array(
'echo "dovecot unix - n n - - pipe 'echo "dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf', flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf'
'chmod 0640 /usr/local/etc/dovecot-sql.conf'
), ),
'restart' => Array( 'restart' => Array(
'sh /usr/local/etc/rc.d/dovecot restart' 'sh /usr/local/etc/rc.d/dovecot restart'
@@ -178,53 +149,15 @@ return Array(
'proftpd' => Array( 'proftpd' => Array(
'label' => 'ProFTPd', 'label' => 'ProFTPd',
'files' => Array( 'files' => Array(
'etc_proftpd_proftpd.conf' => '/usr/local/etc/proftpd.conf' 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
), ),
'commands' => Array( 'commands' => Array(
'touch /usr/local/etc/proftpd.conf', 'touch /etc/proftpd/proftpd.conf',
'chown root:0 /usr/local/etc/proftpd.conf', 'chown root:0 /etc/proftpd/proftpd.conf',
'chmod 0600 /usr/local/etc/proftpd.conf' 'chmod 0600 /etc/proftpd/proftpd.conf'
), ),
'restart' => Array( 'restart' => Array(
'/usr/local/etc/rc.d/proftpd restart' '/etc/init.d/proftpd restart'
)
)
)
),
'etc' => Array(
'label' => $lng['admin']['configfiles']['etc'],
'daemons' => Array(
'awstats' => Array(
'label' => 'Awstats',
'commands' => Array(
'cd /usr/ports/www/awstats/',
'make install clean',
'cp /usr/local/www/awstats/cgi-bin/awstats.model.conf '.makeCorrectDir($settings['system']['awstats_conf']),
'sed -i.bak \'s/^LogFile/# LogFile/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogType/# LogType/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogFormat/# LogFormat/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogSeparator/# LogSeparator/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^SiteDomain/# SiteDomain/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf')
)
),
'libnss' => Array(
'label' => 'libnss (system login with mysql)',
'commands_1' => Array(
'cd /usr/ports/net/libnss-mysql',
'make install clean',
'echo "nscd_enable=\"YES\"" >> /etc/rc.conf'
),
'files' => Array(
'usr_local_etc_libnss-mysql.cfg' => '/usr/local/etc/libnss-mysql.cfg',
'usr_local_etc_libnss-mysql-root.cfg' => '/usr/local/etc/libnss-mysql-root.cfg',
'etc_nsswitch.conf' => '/etc/nsswitch.conf'
),
'commands_2' => Array(
'chmod 600 /usr/local/etc/libnss-mysql.cfg /usr/local/etc/libnss-mysql-root.cfg'
),
'restart' => Array(
'sh /etc/rc.d/nscd restart'
) )
) )
) )

View File

@@ -27,10 +27,10 @@ return Array(
'apache2' => Array( 'apache2' => Array(
'label' => 'Apache2 Webserver', 'label' => 'Apache2 Webserver',
'commands' => Array( 'commands' => Array(
$configcommand['vhost'], 'touch ' . $settings['system']['apacheconf_vhost'],
'chown root:0 ' . $settings['system']['apacheconf_vhost'], 'chown root:0 ' . $settings['system']['apacheconf_vhost'],
'chmod 0600 ' . $settings['system']['apacheconf_vhost'], 'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
$configcommand['diroptions'], 'touch ' . $settings['system']['apacheconf_diroptions'],
'chown root:0 ' . $settings['system']['apacheconf_diroptions'], 'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'], 'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
'mkdir -p ' . $settings['system']['documentroot_prefix'], 'mkdir -p ' . $settings['system']['documentroot_prefix'],
@@ -76,7 +76,7 @@ return Array(
'commands' => Array( 'commands' => Array(
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', 'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chown named:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'chown root:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf' 'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
), ),
'restart' => Array( 'restart' => Array(
@@ -89,26 +89,27 @@ return Array(
'smtp' => Array( 'smtp' => Array(
'label' => $lng['admin']['configfiles']['smtp'], 'label' => $lng['admin']['configfiles']['smtp'],
'daemons' => Array( 'daemons' => Array(
'postfix_courier' => Array( 'postfix' => Array(
'label' => 'Postfix/Courier', 'label' => 'Postfix',
'commands_1' => Array( 'commands_1' => Array(
'echo "mail-mta/postfix -dovecot-sasl sasl" >> /etc/portage/package.use',
'emerge -av postfix',
'mkdir -p ' . $settings['system']['vmail_homedir'], 'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'], 'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'chmod 0750 ' . $settings['system']['vmail_homedir'], 'chmod 0750 ' . $settings['system']['vmail_homedir'],
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo', 'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
'touch /etc/postfix/main.cf', 'touch /etc/postfix/main.cf',
'touch /etc/postfix/master.cf',
'touch /etc/postfix/mysql-virtual_alias_maps.cf', 'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'touch /etc/sasl2/smtpd.conf', 'touch /etc/sasl2/smtpd.conf',
'chown root:root /etc/postfix/main.cf', 'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/sasl2/smtpd.conf', 'chown root:root /etc/sasl2/smtpd.conf',
'chmod 0644 /etc/postfix/main.cf', 'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -116,6 +117,7 @@ return Array(
), ),
'files' => Array( 'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf', 'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -126,74 +128,22 @@ return Array(
'/etc/init.d/postfix restart' '/etc/init.d/postfix restart'
) )
), ),
'postfix_dovecot' => Array(
'label' => 'Postfix/Dovecot',
'commands_1' => Array(
'echo "mail-mta/postfix dovecot-sasl -sasl" >> /etc/portage/package.use',
'emerge -av postfix',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'chmod 0750 ' . $settings['system']['vmail_homedir'],
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
'touch /etc/postfix/main.cf',
'touch /etc/postfix/master.cf',
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
),
'restart' => Array(
'rc-update add postfix default',
'/etc/init.d/postfix restart'
)
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'dkim' => Array( 'dkim' => Array(
'label' => 'DomainKey filter', 'label' => 'DomainKey filter',
'commands_1' => Array( 'commands_1' => Array(
'emerge dkim-milter',
'emerge --config mail-filter/dkim-milter',
'mkdir -p /etc/postfix/dkim' 'mkdir -p /etc/postfix/dkim'
), ),
'files' => Array( 'files' => Array(
'dkim-filter.conf' => '/etc/mail/dkim-filter/dkim-filter.conf' 'dkim-filter.conf' => '/etc/postfix/dkim/dkim-filter.conf'
), ),
'commands_2' => Array( 'commands_2' => Array(
'echo "smtpd_milters = inet:localhost:8891 'chgrp postfix /etc/postfix/dkim/dkim-filter.conf',
milter_macro_daemon_name = SIGNING 'echo "smtpd_milters = inet:localhost:8891\n
milter_default_action = accept" >> /etc/postfix/main.cf' milter_macro_daemon_name = SIGNING\n
milter_default_action = accept\n" >> /etc/postfix/main.cf'
), ),
'restart' => Array( 'restart' => Array(
'rc-update add dkim-filter default', '/etc/init.d/dkim-filter restart'
'/etc/init.d/postfix restart'
) )
) )
) )
@@ -251,7 +201,6 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'dovecot' => Array( 'dovecot' => Array(
'label' => 'Dovecot', 'label' => 'Dovecot',
'commands_1' => Array( 'commands_1' => Array(
'emerge -av dovecot',
'mv dovecot.conf dovecot.conf.gentoo', 'mv dovecot.conf dovecot.conf.gentoo',
'mv dovecot-sql.conf dovecot-sql.conf.gentoo', 'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
'touch dovecot.conf', 'touch dovecot.conf',
@@ -261,9 +210,6 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf' 'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
), ),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array( 'restart' => Array(
'/etc/init.d/dovecot restart' '/etc/init.d/dovecot restart'
) )
@@ -288,26 +234,6 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'/etc/init.d/proftpd restart' '/etc/init.d/proftpd restart'
) )
), ),
'pureftpd' => Array(
'label' => 'PureFTPD',
'commands_1' => Array(
'emerge pure-ftpd'
),
'files' => Array(
'etc_conf.d_pure-ftpd' => '/etc/conf.d/pure-ftpd',
'etc_pureftpd-mysql.conf' => '/etc/pureftpd-mysql.conf'
),
'commands_2' => Array(
'chown root:0 /etc/conf.d/pure-ftpd',
'chmod 0644 /etc/conf.d/pure-ftpd',
'chown root:0 /etc/pureftpd-mysql.conf',
'chmod 0600 /etc/pureftpd-mysql.conf'
),
'restart' => Array(
'rc-update add pure-ftpd default',
'/etc/init.d/pure-ftpd restart'
)
)
) )
), ),
'etc' => Array( 'etc' => Array(
@@ -334,7 +260,7 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'emerge -av xinetd' 'emerge -av xinetd'
), ),
'files' => Array( 'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor' 'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/xinetd restart' '/etc/init.d/xinetd restart'
@@ -342,23 +268,27 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
), ),
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'commands' => Array( 'files' => Array(
'emerge awstats', ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
'awstats_configure.pl', ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf') ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
), ),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
)
), ),
'libnss' => Array( 'libnss' => Array(
'label' => 'libnss (system login with mysql)', 'label' => 'libnss (system login with mysql)',
'commands_1' => Array(
'emerge -av libnss-mysql'
),
'files' => Array( 'files' => Array(
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg', 'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg', 'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
'etc_nsswitch.conf' => '/etc/nsswitch.conf', 'etc_nsswitch.conf' => '/etc/nsswitch.conf',
), ),
'commands_2' => Array( 'commands' => Array(
'emerge -av libnss-mysql',
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg' 'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
), ),
'restart' => Array( 'restart' => Array(

View File

@@ -51,8 +51,6 @@ return Array(
$configcommand['diroptions'], $configcommand['diroptions'],
$configcommand['v_inclighty'], $configcommand['v_inclighty'],
$configcommand['d_inclighty'], $configcommand['d_inclighty'],
'lighty-disable-mod cgi',
'lighty-disable-mod fastcgi',
'mkdir -p ' . $settings['system']['documentroot_prefix'], 'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'], 'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '', ($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
@@ -72,9 +70,7 @@ return Array(
'label' => 'Bind9', 'label' => 'Bind9',
'commands' => Array( 'commands' => Array(
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', 'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/bind9 restart' '/etc/init.d/bind9 restart'
@@ -95,26 +91,30 @@ return Array(
'smtp' => Array( 'smtp' => Array(
'label' => $lng['admin']['configfiles']['smtp'], 'label' => $lng['admin']['configfiles']['smtp'],
'daemons' => Array( 'daemons' => Array(
'postfix_courier' => Array( 'postfix' => Array(
'label' => 'Postfix/Courier', 'label' => 'Postfix',
'commands' => Array( 'commands_1' => Array(
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql', 'mkdir -p /etc/postfix/sasl',
'mkdir -p /var/spool/postfix/etc/pam.d', 'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld', 'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail', 'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail', 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'], 'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'], 'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'mv /etc/postfix/main.cf /etc/postfix/main.cf.ubuntu',
'touch /etc/postfix/main.cf',
'touch /etc/postfix/mysql-virtual_alias_maps.cf', 'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'touch /etc/postfix/sasl/smtpd.conf', 'touch /etc/postfix/sasl/smtpd.conf',
'chown root:root /etc/postfix/main.cf', 'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/sasl/smtpd.conf', 'chown root:root /etc/postfix/sasl/smtpd.conf',
'chmod 0644 /etc/postfix/main.cf', 'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -122,6 +122,7 @@ return Array(
), ),
'files' => Array( 'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf', 'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -132,55 +133,6 @@ return Array(
'newaliases' 'newaliases'
) )
), ),
'postfix_dovecot' => Array(
'label' => 'Postfix/Dovecot',
'commands' => Array(
'apt-get install postfix postfix-mysql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'exim4' => Array( 'exim4' => Array(
'label' => 'Exim4', 'label' => 'Exim4',
'commands_1' => Array( 'commands_1' => Array(
@@ -220,16 +172,13 @@ return Array(
), ),
'dovecot' => Array( 'dovecot' => Array(
'label' => 'Dovecot', 'label' => 'Dovecot',
'commands_1' => Array( 'commands' => Array(
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix', '/etc/init.d/dovecot stop',
), ),
'files' => Array( 'files' => Array(
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf' 'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
), ),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array( 'restart' => Array(
'/etc/init.d/dovecot restart' '/etc/init.d/dovecot restart'
) )
@@ -254,9 +203,6 @@ return Array(
), ),
'pure-ftpd' => Array( 'pure-ftpd' => Array(
'label' => 'Pure FTPd', 'label' => 'Pure FTPd',
'commands_1' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql'
),
'files' => Array( 'files' => Array(
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID', 'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile', 'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
@@ -269,9 +215,6 @@ return Array(
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind', 'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common' 'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
), ),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array( 'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart' '/etc/init.d/pure-ftpd-mysql restart'
) )
@@ -296,7 +239,7 @@ return Array(
'apt-get install xinetd' 'apt-get install xinetd'
), ),
'files' => Array( 'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor' 'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/xinetd restart' '/etc/init.d/xinetd restart'
@@ -304,12 +247,18 @@ return Array(
), ),
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array( 'commands' => Array(
'apt-get install awstats', 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']), ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
), ),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
)
), ),
'libnss' => Array( 'libnss' => Array(
'label' => 'libnss (system login with mysql)', 'label' => 'libnss (system login with mysql)',

View File

@@ -51,8 +51,6 @@ return Array(
$configcommand['diroptions'], $configcommand['diroptions'],
$configcommand['v_inclighty'], $configcommand['v_inclighty'],
$configcommand['d_inclighty'], $configcommand['d_inclighty'],
'lighty-disable-mod cgi',
'lighty-disable-mod fastcgi',
'mkdir -p ' . $settings['system']['documentroot_prefix'], 'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'], 'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '', ($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
@@ -73,9 +71,7 @@ return Array(
'commands' => Array( 'commands' => Array(
'apt-get install bind9', 'apt-get install bind9',
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', 'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/bind9 restart' '/etc/init.d/bind9 restart'
@@ -96,10 +92,11 @@ return Array(
'smtp' => Array( 'smtp' => Array(
'label' => $lng['admin']['configfiles']['smtp'], 'label' => $lng['admin']['configfiles']['smtp'],
'daemons' => Array( 'daemons' => Array(
'postfix_courier' => Array( 'postfix' => Array(
'label' => 'Postfix/Courier', 'label' => 'Postfix',
'commands' => Array( 'commands' => Array(
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql', 'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
'mkdir -p /etc/postfix/sasl',
'mkdir -p /var/spool/postfix/etc/pam.d', 'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld', 'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail', 'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
@@ -111,11 +108,13 @@ return Array(
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'touch /etc/postfix/sasl/smtpd.conf', 'touch /etc/postfix/sasl/smtpd.conf',
'chown root:root /etc/postfix/main.cf', 'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/sasl/smtpd.conf', 'chown root:root /etc/postfix/sasl/smtpd.conf',
'chmod 0644 /etc/postfix/main.cf', 'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -123,6 +122,7 @@ return Array(
), ),
'files' => Array( 'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf', 'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
@@ -133,55 +133,6 @@ return Array(
'newaliases' 'newaliases'
) )
), ),
'postfix_dovecot' => Array(
'label' => 'Postfix/Dovecot',
'commands' => Array(
'apt-get install postfix postfix-mysql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'exim4' => Array( 'exim4' => Array(
'label' => 'Exim4', 'label' => 'Exim4',
'commands_1' => Array( 'commands_1' => Array(
@@ -224,16 +175,13 @@ return Array(
), ),
'dovecot' => Array( 'dovecot' => Array(
'label' => 'Dovecot', 'label' => 'Dovecot',
'commands_1' => Array( 'commands' => Array(
'apt-get install dovecot-imapd dovecot-pop3d' 'apt-get install dovecot-imapd dovecot-pop3d'
), ),
'files' => Array( 'files' => Array(
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf' 'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
), ),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array( 'restart' => Array(
'/etc/init.d/dovecot restart' '/etc/init.d/dovecot restart'
) )
@@ -259,7 +207,7 @@ return Array(
), ),
'pure-ftpd' => Array( 'pure-ftpd' => Array(
'label' => 'Pure FTPd', 'label' => 'Pure FTPd',
'commands_1' => Array( 'commands' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql' 'apt-get install pure-ftpd-common pure-ftpd-mysql'
), ),
'files' => Array( 'files' => Array(
@@ -274,9 +222,6 @@ return Array(
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind', 'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common' 'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
), ),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array( 'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart' '/etc/init.d/pure-ftpd-mysql restart'
) )
@@ -301,7 +246,7 @@ return Array(
'apt-get install xinetd' 'apt-get install xinetd'
), ),
'files' => Array( 'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor' 'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/xinetd restart' '/etc/init.d/xinetd restart'
@@ -309,12 +254,18 @@ return Array(
), ),
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array( 'commands' => Array(
'apt-get install awstats', 'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']), ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
), ),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
)
), ),
'libnss' => Array( 'libnss' => Array(
'label' => 'libnss (system login with mysql)', 'label' => 'libnss (system login with mysql)',

View File

@@ -1,341 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Configfiles
* @version $Id: lenny.inc.php 860 2010-04-30 16:38:02Z Dessa $
*/
return Array(
'ubuntu_lucid' => Array(
'label' => 'Ubuntu 10.04 (Lucid)',
'services' => Array(
'http' => Array(
'label' => $lng['admin']['configfiles']['http'],
'daemons' => Array(
'apache2' => Array(
'label' => 'Apache 2',
'commands' => Array(
'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
'a2dismod userdir'
),
'restart' => Array(
'/etc/init.d/apache2 restart'
),
),
'lighttpd' => Array(
'label' => 'Lighttpd Webserver',
'commands_1' => Array(
'apt-get install lighttpd',
),
'files' => Array(
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
),
'commands_2' => Array(
$configcommand['vhost'],
$configcommand['diroptions'],
$configcommand['v_inclighty'],
$configcommand['d_inclighty'],
'lighty-disable-mod cgi',
'lighty-disable-mod fastcgi',
'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
),
'restart' => Array(
'/etc/init.d/lighttpd restart'
)
)
)
),
'dns' => Array(
'label' => $lng['admin']['configfiles']['dns'],
'daemons' => Array(
'bind' => Array(
'label' => 'Bind9',
'commands' => Array(
'apt-get install bind9',
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
),
'restart' => Array(
'/etc/init.d/bind9 restart'
)
),
'powerdns' => Array(
'label' => 'PowerDNS',
'files' => Array(
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
),
'restart' => Array(
'/etc/init.d/pdns restart'
)
),
)
),
'smtp' => Array(
'label' => $lng['admin']['configfiles']['smtp'],
'daemons' => Array(
'postfix_courier' => Array(
'label' => 'Postfix/Courier',
'commands' => Array(
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'touch /etc/postfix/sasl/smtpd.conf',
'chown root:root /etc/postfix/main.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/sasl/smtpd.conf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_dovecot' => Array(
'label' => 'Postfix/Dovecot',
'commands' => Array(
'apt-get install postfix postfix-mysql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'exim4' => Array(
'label' => 'Exim4',
'commands_1' => Array(
'dpkg-reconfigure exim4-config',
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
),
'files' => Array(
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
),
'commands_2' => Array(
'chmod o-rx /var/lib/exim4',
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
),
'restart' => Array(
'/etc/init.d/exim4 restart'
)
)
)
),
'mail' => Array(
'label' => $lng['admin']['configfiles']['mail'],
'daemons' => Array(
'courier' => Array(
'label' => 'Courier',
'commands' => Array(
'apt-get install courier-pop courier-imap courier-authlib-mysql'
),
'files' => Array(
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
),
'restart' => Array(
'/etc/init.d/courier-authdaemon restart',
'/etc/init.d/courier-pop restart'
)
),
'dovecot' => Array(
'label' => 'Dovecot',
'commands_1' => Array(
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix'
),
'files' => Array(
'etc_dovecot_auth.d_01-dovecot-postfix.auth' => '/etc/dovecot/auth.d/01-dovecot-postfix.auth',
'etc_dovecot_conf.d_01-dovecot-postfix.conf' => '/etc/dovecot/conf.d/01-dovecot-postfix.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array(
'/etc/init.d/dovecot restart'
)
)
)
),
'ftp' => Array(
'label' => $lng['admin']['configfiles']['ftp'],
'daemons' => Array(
'proftpd' => Array(
'label' => 'ProFTPd',
'commands' => Array(
'apt-get install proftpd-basic proftpd-mod-mysql'
),
'files' => Array(
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
),
'restart' => Array(
'/etc/init.d/proftpd restart'
)
),
'pure-ftpd' => Array(
'label' => 'Pure FTPd',
'commands_1' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql'
),
'files' => Array(
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart'
)
),
)
),
'etc' => Array(
'label' => $lng['admin']['configfiles']['etc'],
'daemons' => Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
)
),
'xinetd' => Array(
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'apt-get install xinetd'
),
'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
)
),
'awstats' => Array(
'label' => 'Awstats',
'commands' => Array(
'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(
'label' => 'libnss (system login with mysql)',
'commands' => Array(
'apt-get install libnss-mysql nscd',
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
),
'files' => Array(
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
),
'restart' => Array(
'/etc/init.d/nscd restart'
)
)
)
)
)
)
);
?>

View File

@@ -47,9 +47,7 @@ return Array(
'label' => 'Bind9', 'label' => 'Bind9',
'commands' => Array( 'commands' => Array(
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/named.conf', 'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf', 'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
'chown named:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
), ),
'restart' => Array( 'restart' => Array(
'/etc/init.d/named restart' '/etc/init.d/named restart'
@@ -91,19 +89,6 @@ return Array(
'restart' => Array( 'restart' => Array(
'/etc/init.d/postfix restart' '/etc/init.d/postfix restart'
) )
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
) )
) )
), ),
@@ -152,10 +137,16 @@ return Array(
), ),
'awstats' => Array( 'awstats' => Array(
'label' => 'Awstats', 'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array( 'commands' => Array(
'awstats_configure.pl', ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'), ),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf') 'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
) )
) )
) )

View File

@@ -45,6 +45,6 @@ else
$cfgPath = 'lib/configfiles/'; $cfgPath = 'lib/configfiles/';
$configfiles = Array(); $configfiles = Array();
$configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'lucid.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php', include $cfgPath . 'freebsd.inc.php'); $configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php');
?> ?>

View File

@@ -24,12 +24,6 @@ if(@php_sapi_name() != 'cli'
die('This script will only work in the shell.'); die('This script will only work in the shell.');
} }
// ensure that default timezone is set
if(function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
{
@date_default_timezone_set(@date_default_timezone_get());
}
$lockdir = '/var/run/'; $lockdir = '/var/run/';
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-'; $lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
$lockfName = $lockFilename . getmypid(); $lockfName = $lockFilename . getmypid();
@@ -75,7 +69,7 @@ while($fName = readdir($lockDirHandle))
// Check if cron is running or has died. // Check if cron is running or has died.
$check_pid = substr(strstr($fName, "-"), 1); $check_pid = substr(strstr($fName, "-"), 1);
system("kill -CHLD " . (int)$check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return); system("kill -CHLD " . $check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return);
if($check_pid_return == 1) if($check_pid_return == 1)
{ {

View File

@@ -1,45 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Language
* @version $Id$
*/
/**
* Function domainHasApsInstances
*
* Checks if a given domain id
* is used for APS instances
* (if APS enabled, else always false)
*
* @param int domain-id
*
* @return boolean
*/
function domainHasApsInstances($domainid = 0)
{
global $db, $settings;
if($settings['aps']['aps_active'] == '1')
{
if($domainid > 0)
{
$instances = $db->query_first("SELECT COUNT(`ID`) AS `count` FROM `" . TABLE_APS_SETTINGS . "` WHERE `Name`='main_domain' AND `Value`='" . (int)$domainid . "'");
if((int)$instances['count'] != 0)
{
return true;
}
}
}
return false;
}

View File

@@ -1,30 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package APS
* @version $Id$
*/
function getXPathValue($xmlobj = null, $path = null, $single = true)
{
$result = null;
$tmpxml = new DynamicProperties;
$tmpxml = ($xmlobj->xpath($path)) ? $xmlobj->xpath($path) : false;
if($result !== false)
{
$result = ($single == true) ? (string)$tmpxml[0] : $tmpxml;
}
return $result;
}

View File

@@ -1,66 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* set the immutable flag for a file
*
* @param string $filename the file to set the flag for
*
* @return boolean
*/
function setImmutable($filename = null)
{
safe_exec(_getImmutableFunction(false).escapeshellarg($filename));
}
/**
* removes the immutable flag for a file
*
* @param string $filename the file to set the flag for
*
* @return boolean
*/
function removeImmutable($filename = null)
{
safe_exec(_getImmutableFunction(true).escapeshellarg($filename));
}
/**
* internal function to check whether
* to use chattr (Linux) or chflags (FreeBSD)
*
* @param boolean $remove whether to use +i|schg (false) or -i|noschg (true)
*
* @return string functionname + parameter (not the file)
*/
function _getImmutableFunction($remove = false)
{
$output = array();
$return_var = 0;
exec('which chattr 2>&1', $output, $return_var);
if((int)$return_var != 0)
{
// FreeBSD style
return 'chflags '.(($remove === true) ? 'noschg ' : 'schg ');
}
else
{
// Linux style
return 'chattr '.(($remove === true) ? '-i ' : '+i ');
}
}

View File

@@ -27,7 +27,7 @@
* @author Florian Lippert <flo@syscp.org> * @author Florian Lippert <flo@syscp.org>
*/ */
function isConfigDir($dir, $ifexists = false) function isConfigDir($dir)
{ {
if(file_exists($dir)) if(file_exists($dir))
{ {
@@ -42,16 +42,9 @@ function isConfigDir($dir, $ifexists = false)
} }
else else
{ {
if(!$ifexists) if(substr($dir, -1) == '/')
{ {
if(substr($dir, -1) == '/') $returnval = true;
{
$returnval = true;
}
else
{
$returnval = false;
}
} }
else else
{ {

View File

@@ -1,40 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* check whether a maildir exists on the filesystem
*
* @param array $result all mail-info of customer
*
* @return boolean
*/
function maildirExists($result = null)
{
global $settings;
if(is_array($result))
{
$loginname = getCustomerDetail($result['customerid'], 'loginname');
if($loginname !== false) {
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $loginname .'/'. $result['email_full']);
if(@file_exists($maildir)) {
return true;
}
}
}
return false;
}

View File

@@ -29,15 +29,6 @@
function makeCorrectFile($filename) function makeCorrectFile($filename)
{ {
if (!isset($filename)
|| trim($filename) == ''
) {
$error = 'Given filename for function '.__FUNCTION__.' is empty.'."\n";
$error.= 'This is very dangerous and should not happen.'."\n";
$error.= 'Please inform the Froxlor team about this issue so they can fix it.';
die($error);
}
if(substr($filename, 0, 1) != '/') if(substr($filename, 0, 1) != '/')
{ {
$filename = '/' . $filename; $filename = '/' . $filename;

View File

@@ -20,12 +20,10 @@
/** /**
* Returns a valid html tag for the choosen $fieldType for pathes * Returns a valid html tag for the choosen $fieldType for pathes
* *
* @param string path The path to start searching in * @param string path The path to start searching in
* @param integer uid The uid which must match the found directories * @param integer uid The uid which must match the found directories
* @param integer gid The gid which must match the found direcotries * @param integer gid The gid which must match the found direcotries
* @param string fieldType Either "Manual" or "Dropdown" * @param string fieldType Either "Manual" or "Dropdown"
* @param string value the value for the input-field
*
* @return string The html tag for the choosen $fieldType * @return string The html tag for the choosen $fieldType
* *
* @author Martin Burchert <martin.burchert@syscp.de> * @author Martin Burchert <martin.burchert@syscp.de>
@@ -40,16 +38,10 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
if($fieldType == 'Manual') if($fieldType == 'Manual')
{ {
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" />'; $field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
} }
elseif($fieldType == 'Dropdown') elseif($fieldType == 'Dropdown')
{ {
// path is given without starting slash
// but dirList holds the paths with starting slash
// so we just add one here to get the correct
// default path selected, #225
$value = '/'.$value;
$dirList = findDirs($path, $uid, $gid); $dirList = findDirs($path, $uid, $gid);
natcasesort($dirList); natcasesort($dirList);
@@ -72,11 +64,8 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
} }
else else
{ {
// remove starting slash we added
// for the Dropdown, #225
$value = substr($value, 1);
$field = $lng['panel']['toomanydirs']; $field = $lng['panel']['toomanydirs'];
$field.= '<br /><input type="text" name="path" value="' . htmlspecialchars($value) . '" />'; $field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
} }
} }
else else

View File

@@ -26,16 +26,13 @@
* @param string The dir which should be created * @param string The dir which should be created
* @param int The uid of the user * @param int The uid of the user
* @param int The gid of the user * @param int The gid of the user
* @param bool Place standard-index.html into the new folder
* @param bool Allow creating a directory out of the customers docroot
*
* @return bool true if everything went okay, false if something went wrong * @return bool true if everything went okay, false if something went wrong
* *
* @author Florian Lippert <flo@syscp.org> * @author Florian Lippert <flo@syscp.org>
* @author Martin Burchert <martin.burchert@syscp.org> * @author Martin Burchert <martin.burchert@syscp.org>
*/ */
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeindex = false, $allow_notwithinhomedir = false) function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid)
{ {
$returncode = true; $returncode = true;
@@ -48,33 +45,24 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeind
if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir) if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir)
{ {
$subdir = substr($dirToCreate, strlen($homeDir)); $subdir = substr($dirToCreate, strlen($homeDir));
$within_homedir = true;
} }
else else
{ {
$subdir = $dirToCreate; $subdir = $dirToCreate;
$within_homedir = false;
} }
$subdir = makeCorrectDir($subdir); $subdir = makeCorrectDir($subdir);
$subdirs = array(); $subdirlen = strlen($subdir);
$subdirs = array();
array_push($subdirs, $dirToCreate);
$offset = 0;
if($within_homedir || !$allow_notwithinhomedir) while($offset < $subdirlen)
{ {
$subdirlen = strlen($subdir); $offset = strpos($subdir, '/', $offset);
$offset = 0; $subdirelem = substr($subdir, 0, $offset);
$offset++;
while($offset < $subdirlen) array_push($subdirs, makeCorrectDir($homeDir . $subdirelem));
{
$offset = strpos($subdir, '/', $offset);
$subdirelem = substr($subdir, 0, $offset);
$offset++;
array_push($subdirs, makeCorrectDir($homeDir . $subdirelem));
}
}
else
{
array_push($subdirs, $dirToCreate);
} }
$subdirs = array_unique($subdirs); $subdirs = array_unique($subdirs);
@@ -85,17 +73,6 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeind
{ {
$sdir = makeCorrectDir($sdir); $sdir = makeCorrectDir($sdir);
safe_exec('mkdir -p ' . escapeshellarg($sdir)); safe_exec('mkdir -p ' . escapeshellarg($sdir));
/**
* #68
*/
if ($placeindex) {
$loginname = getLoginNameByUid($uid);
if ($loginname !== false) {
storeDefaultIndex($loginname, $sdir, null);
}
}
safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir)); safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir));
} }
} }

View File

@@ -48,16 +48,14 @@ function safe_exec($exec_string, &$return_value = false)
'du', 'du',
'chmod', 'chmod',
'chattr', 'chattr',
'chflags', /* freebsd equivalent to linux' chattr */
$settings['system']['apachereload_command'], $settings['system']['apachereload_command'],
$settings['system']['bindreload_command'], $settings['system']['bindreload_command'],
$settings['dkim']['dkimrestart_command'], $settings['dkim']['dkimrestart_command'],
$settings['system']['awstats_updateall_command'],
'openssl', 'openssl',
'unzip', 'unzip',
'php', 'php',
'rm', 'rm'
'awstats_buildstaticpages.pl',
'ln'
); );
// //
@@ -77,8 +75,6 @@ function safe_exec($exec_string, &$return_value = false)
die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n"); die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
} }
/*
* This is not needed anymore, we allow all commands and just check for pipes and stuff
// //
// check if command is allowed here // check if command is allowed here
// //
@@ -97,7 +93,6 @@ function safe_exec($exec_string, &$return_value = false)
{ {
die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n"); die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
} }
*/
// //
// execute the command and return output // execute the command and return output

View File

@@ -1,65 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* store the default index-file in a given destination folder
*
* @param string $loginname customers loginname
* @param string $destination path where to create the file
* @param object $logger FroxlorLogger object
* @param boolean $force force creation whatever the settings say (needed for task #2, create new user)
*
* @return null
*/
function storeDefaultIndex($loginname = null, $destination = null, $logger = null, $force = false)
{
global $db, $settings, $pathtophpfiles;
if ($force
|| (int)$settings['system']['store_index_file_subs'] == 1
) {
$result = $db->query("SELECT `t`.`value`, `c`.`email` AS `customer_email`, `a`.`email` AS `admin_email`, `c`.`loginname` AS `customer_login`, `a`.`loginname` AS `admin_login` FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c` INNER JOIN `" . TABLE_PANEL_ADMINS . "` AS `a` ON `c`.`adminid` = `a`.`adminid` INNER JOIN `" . TABLE_PANEL_TEMPLATES . "` AS `t` ON `a`.`adminid` = `t`.`adminid` WHERE `varname` = 'index_html' AND `c`.`loginname` = '" . $db->escape($loginname) . "'");
if($db->num_rows($result) > 0)
{
$template = $db->fetch_array($result);
$replace_arr = array(
'SERVERNAME' => $settings['system']['hostname'],
'CUSTOMER' => $template['customer_login'],
'ADMIN' => $template['admin_login'],
'CUSTOMER_EMAIL' => $template['customer_email'],
'ADMIN_EMAIL' => $template['admin_email']
);
$htmlcontent = replace_variables($template['value'], $replace_arr);
$indexhtmlpath = makeCorrectFile($destination . '/index.' . $settings['system']['index_file_extension']);
$index_html_handler = fopen($indexhtmlpath, 'w');
fwrite($index_html_handler, $htmlcontent);
fclose($index_html_handler);
if ($logger !== null) {
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Creating \'index.' . $settings['system']['index_file_extension'] . '\' for Customer \'' . $template['customer_login'] . '\' based on template in directory ' . escapeshellarg($indexhtmlpath));
}
}
else
{
if ($logger !== null) {
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Running: cp -a ' . $pathtophpfiles . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
}
safe_exec('cp -a ' . $pathtophpfiles . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
}
}
return;
}

View File

@@ -17,7 +17,7 @@
* @version $Id$ * @version $Id$
*/ */
function getFormFieldDataBool($fieldname, $fielddata, &$input) function getFormFieldDataBool($fieldname, $fielddata, $input)
{ {
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja')) if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
{ {

View File

@@ -1,62 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id $
*/
function buildFormEx($form, $part = '')
{
$fields = '';
if(validateFormDefinition($form))
{
foreach($form['groups'] as $groupname => $groupdetails)
{
// show overview
if($part == '')
{
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
{
$fields .= getFormOverviewGroupOutput($groupname, $groupdetails);
}
}
// only show one section
elseif($part != '' && ($groupname == $part || $part == 'all'))
{
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
{
$fields .= getFormGroupOutput($groupname, $groupdetails);
}
if(validateFieldDefinition($groupdetails))
{
// Prefetch form fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
// Collect form field output
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
$fields .= getFormFieldOutput($fieldname, $fielddetails);
}
}
}
}
}
return $fields;
}

View File

@@ -17,11 +17,11 @@
* @version $Id$ * @version $Id$
*/ */
function getFormFieldData($fieldname, $fielddata, &$input) function getFormFieldData($fieldname, $fielddata, $input)
{ {
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type']))) if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
{ {
$newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $input); $newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, &$input);
} }
else else
{ {

View File

@@ -23,54 +23,3 @@ function getFormGroupOutput($groupname, $groupdetails)
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";"); eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
return $group; return $group;
} }
function getFormOverviewGroupOutput($groupname, $groupdetails)
{
global $lng, $settings, $filename, $s;
$group = '';
$title = $groupdetails['title'];
$part = $groupname;
$activated = true;
$option = '';
if(isset($groupdetails['fields']))
{
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(isset($fielddetails['overview_option'])
&& $fielddetails['overview_option'] == true
) {
if($fielddetails['type'] != 'option'
&& $fielddetails['type'] != 'bool')
{
standard_error('overviewsettingoptionisnotavalidfield');
}
if($fielddetails['type'] == 'option')
{
$options_array = $fielddetails['option_options'];
$options = '';
foreach($options_array as $value => $vtitle)
{
$options .= makeoption($vtitle, $value, $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
}
$option.= $fielddetails['label'].':&nbsp;';
$option.= '<select class="dropdown_noborder" name="'.$fieldname.'">';
$option.= $options;
$option.= '</select>';
$activated = true;
}
else
{
$option.= $lng['admin']['activated'].':&nbsp;';
$option.= makeyesno($fieldname, '1', '0', $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
$activated = (int)$settings[$fielddetails['settinggroup']][$fielddetails['varname']];
}
}
}
}
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
return $group;
}

View File

@@ -17,7 +17,7 @@
* @version $Id$ * @version $Id$
*/ */
function processForm(&$form, &$input, $url_params = array()) function processForm($form, $input, $url_params = array())
{ {
if(validateFormDefinition($form)) if(validateFormDefinition($form))
{ {
@@ -45,7 +45,7 @@ function processForm(&$form, &$input, $url_params = array())
// Validate fields // Validate fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails) foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{ {
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input); $newfieldvalue = getFormFieldData($fieldname, $fielddetails, &$input);
if($newfieldvalue != $fielddetails['value']) if($newfieldvalue != $fielddetails['value'])
{ {
@@ -143,166 +143,3 @@ function processForm(&$form, &$input, $url_params = array())
return saveForm($form, $saved_fields); return saveForm($form, $saved_fields);
} }
} }
function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_all, $settings_part, $only_enabledisable)
{
if(validateFormDefinition($form))
{
$submitted_fields = array();
$changed_fields = array();
$saved_fields = array();
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
// Prefetch form fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
}
}
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
// Validate fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
if($newfieldvalue != $fielddetails['value'])
{
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
{
standard_error($error, $fieldname);
}
else
{
$changed_fields[$fieldname] = $newfieldvalue;
}
}
$submitted_fields[$fieldname] = $newfieldvalue;
}
}
}
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
// Check fields for plausibility
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
{
if(is_array($plausibility_check) && isset($plausibility_check[0]))
{
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
{
// Nothing to do here, everything's okay
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
{
unset($plausibility_check[0]);
$error = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
standard_error($error, $targetname);
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
{
unset($plausibility_check[0]);
$question = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
if(!isset($input[$question]))
{
if(is_array($url_params) && isset($url_params['filename']))
{
$filename = $url_params['filename'];
unset($url_params['filename']);
}
else
{
$filename = '';
}
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
}
}
else
{
standard_error('plausibilitychecknotunderstood');
}
}
}
}
}
}
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
// Save fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
if(isset($changed_fields[$fieldname]))
{
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
{
$saved_fields = array_merge($saved_fields, $saved_field);
}
else
{
standard_error('errorwhensaving', $fieldname);
}
}
}
}
}
}
}
// Save form
return saveForm($form, $saved_fields);
}
}

View File

@@ -17,7 +17,7 @@
* @version $Id$ * @version $Id$
*/ */
function getFormFieldDataInt($fieldname, $fielddata, &$input) function getFormFieldDataInt($fieldname, $fielddata, $input)
{ {
if(isset($input[$fieldname])) if(isset($input[$fieldname]))
{ {

View File

@@ -17,7 +17,7 @@
* @version $Id$ * @version $Id$
*/ */
function getFormFieldDataOption($fieldname, $fielddata, &$input) function getFormFieldDataOption($fieldname, $fielddata, $input)
{ {
if(isset($input[$fieldname])) if(isset($input[$fieldname]))
{ {

View File

@@ -27,10 +27,6 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
$returnvalue = true; $returnvalue = true;
foreach($newfieldvalues as $single_newfieldvalue) foreach($newfieldvalues as $single_newfieldvalue)
{ {
/**
* don't use tabs in value-fields, #81
*/
$single_newfieldvalue = str_replace("\t", " ", $single_newfieldvalue);
$single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue); $single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue);
if($single_returnvalue !== true) if($single_returnvalue !== true)
{ {
@@ -43,11 +39,6 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
{ {
$returnvalue = false; $returnvalue = false;
/**
* don't use tabs in value-fields, #81
*/
$newfieldvalue = str_replace("\t", " ", $newfieldvalue);
if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail') if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail')
{ {
$returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue); $returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue);
@@ -58,11 +49,6 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
} }
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir')
{ {
// add trailing slash to validate path if needed
// refs #331
if(substr($newfieldvalue, -1) != '/') {
$newfieldvalue.= '/';
}
$returnvalue = ($newfieldvalue == makeCorrectDir($newfieldvalue)); $returnvalue = ($newfieldvalue == makeCorrectDir($newfieldvalue));
} }
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'file') elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'file')

View File

@@ -1,70 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/*
* this functions validates a given value as ErrorDocument
* refs #267
*
* @param string error-document-string
*
* @return string error-document-string
*
*/
function correctErrorDocument($errdoc = null)
{
global $settings, $idna_convert;
if($errdoc !== null && $errdoc != '')
{
// not a URL
if((strtoupper(substr($errdoc, 0, 5)) != 'HTTP:'
&& strtoupper(substr($errdoc, 0, 6)) != 'HTTPS:')
|| !validateUrl($idna_convert->encode($errdoc)))
{
// a file
if(substr($errdoc, 0, 1) != '"')
{
$errdoc = makeCorrectFile($errdoc);
// apache needs a starting-slash (starting at the domains-docroot)
if(!substr($errdoc, 0, 1) == '/') {
$errdoc = '/'.$errdoc;
}
}
// a string (check for ending ")
else
{
// string won't work for lighty
if($settings['system']['webserver'] == 'lighttpd')
{
standard_error('stringerrordocumentnotvalidforlighty');
}
elseif(substr($errdoc, -1) != '"')
{
$errdoc .= '"';
}
}
}
else
{
if($settings['system']['webserver'] == 'lighttpd')
{
standard_error('urlerrordocumentnotvalidforlighty');
}
}
}
return $errdoc;
}

View File

@@ -229,59 +229,6 @@ function getOutstandingTasks()
} }
} }
$query2 = "SELECT DISTINCT `Task` FROM `".TABLE_APS_TASKS."` ORDER BY `Task` ASC";
$result2 = $db->query($query2);
while($row2 = $db->fetch_array($result2))
{
/*
* install
*/
if($row2['Task'] == '1')
{
$task_desc = $lng['tasks']['aps_task_install'];
}
/*
* remove
*/
elseif($row2['Task'] == '2')
{
$task_desc = $lng['tasks']['aps_task_remove'];
}
/*
* reconfigure
*/
elseif($row2['Task'] == '3')
{
$task_desc = $lng['tasks']['aps_task_reconfigure'];
}
/*
* upgrade
*/
elseif($row2['Task'] == '4')
{
$task_desc = $lng['tasks']['aps_task_upgrade'];
}
/*
* system update
*/
elseif($row2['Task'] == '5')
{
$task_desc = $lng['tasks']['aps_task_sysupdate'];
}
/*
* system download
*/
elseif($row2['Task'] == '6')
{
$task_desc = $lng['tasks']['aps_task_sysdownload'];
}
if($task_desc != '') {
$tasks .= '<li>'.$task_desc.'</li>';
}
}
if(trim($tasks) == '') { if(trim($tasks) == '') {
$outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>'; $outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
} else { } else {
@@ -291,4 +238,4 @@ function getOutstandingTasks()
$outstanding_tasks .= '</ul></td></tr>'; $outstanding_tasks .= '</ul></td></tr>';
return $outstanding_tasks; return $outstanding_tasks;
} }

View File

@@ -24,62 +24,38 @@
* @param logFile * @param logFile
* @param siteDomain * @param siteDomain
* @param hostAliases * @param hostAliases
* @return null * @return
* @author Michael Duergner
* @author Berend Dekens
*/ */
function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot) function createAWStatsConf($logFile, $siteDomain, $hostAliases)
{ {
global $pathtophpfiles, $settings; global $pathtophpfiles;
// Generation header // Generation header
$header = "## GENERATED BY FROXLOR\n"; $header = "## GENERATED BY SYSCP\n";
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n"; $header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
$awstats_dir = makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
if(!is_dir($awstats_dir))
{
safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
}
// weird but could happen...
if(!is_dir($settings['system']['awstats_conf']))
{
safe_exec('mkdir -p '.escapeshellarg($settings['system']['awstats_conf']));
}
// These are the variables we will replace // These are the variables we will replace
$regex = array( $regex = array(
'/\{LOG_FILE\}/', '/\{LOG_FILE\}/',
'/\{SITE_DOMAIN\}/', '/\{SITE_DOMAIN\}/',
'/\{HOST_ALIASES\}/', '/\{HOST_ALIASES\}/'
'/\{CUSTOMER_DOCROOT\}/',
'/\{AWSTATS_CONF\}/'
); );
$replace = array( $replace = array(
makeCorrectFile($logFile), $logFile,
$siteDomain, $siteDomain,
$hostAliases, $hostAliases
$awstats_dir,
makeCorrectDir($settings['system']['awstats_conf'])
); );
// File names // File names
$domain_file = makeCorrectFile($settings['system']['awstats_conf'].'/awstats.' . $siteDomain . '.conf'); $domain_file = '/etc/awstats/awstats.' . $siteDomain . '.conf';
$model_file = dirname(dirname(dirname(dirname(__FILE__)))); $model_file = '/etc/awstats/awstats.model.conf.froxlor';
$model_file.= '/templates/misc/awstatsmodel/';
if($settings['system']['mod_log_sql'] == '1')
{
$model_file.= 'awstats.froxlor.model_log_sql.conf';
} else {
$model_file.= 'awstats.froxlor.model.conf';
}
$model_file = makeCorrectFile($model_file);
// Test if the file exists // Test if the file exists
if(file_exists($domain_file)) if(file_exists($domain_file))

View File

@@ -1,42 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/*
* Function customerHasPerlEnabled
*
* returns true or false whether perl is
* enabled for the given customer
*
* @param int customer-id
*
* @return boolean
*/
function customerHasPerlEnabled($cid = 0)
{
global $db;
if($cid > 0)
{
$result = $db->query_first("SELECT `perlenabled` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `customerid` = '".(int)$cid."'");
if(is_array($result)
&& isset($result['perlenabled'])
) {
return ($result['perlenabled'] == '1') ? true : false;
}
}
return false;
}

View File

@@ -1,60 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* check whether a domain has subdomains added as full-domains
* #329
*
* @param int $id domain-id
*
* @return boolean
*/
function domainHasMainSubDomains($id = 0)
{
global $db;
$sql = "SELECT COUNT(`id`) as `mainsubs` FROM `".TABLE_PANEL_DOMAINS."` WHERE `ismainbutsubto` = '".(int)$id."'";
$result = $db->query_first($sql);
if(isset($result['mainsubs'])
&& $result['mainsubs'] > 0
) {
return true;
}
return false;
}
/**
* check whether a subof-domain exists
* #329
*
* @param int $id subof-domain-id
*
* @return boolean
*/
function domainMainToSubExists($id = 0)
{
global $db;
$sql = "SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` WHERE `id` = '".(int)$id."'";
$result = $db->query_first($sql);
if(isset($result['id'])
&& $result['id'] > 0
) {
return true;
}
return false;
}

View File

@@ -1,21 +0,0 @@
<?php
/**
* returns the customer-id of a customer by given domain
*
* @param string $domain users domain
*
* @return int customers id
*/
function getCustomerIdByDomain($domain = null)
{
global $db;
$result = $db->query_first("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '".$domain."'");
if(is_array($result)
&& isset($result['customerid'])
) {
return $result['customerid'];
}
return false;
}

View File

@@ -1,21 +0,0 @@
<?php
/**
* returns the loginname of a customer by given uid
*
* @param int $uid uid of customer
*
* @return string customers loginname
*/
function getLoginNameByUid($uid = null)
{
global $db;
$result = $db->query_first("SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = '".(int)$uid."'");
if(is_array($result)
&& isset($result['loginname'])
) {
return $result['loginname'];
}
return false;
}

View File

@@ -1,41 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* returns an array for the settings-array
*
* @return array
*/
function getPhpConfigs()
{
global $db;
$query = 'SELECT * FROM `' . TABLE_PANEL_PHPCONFIGS . '` ';
$result = $db->query($query);
$configs_array = array();
while($row = $db->fetch_array($result))
{
if(!isset($configs_array[$row['id']])
&& !in_array($row['id'], $configs_array))
{
$configs_array[$row['id']] = html_entity_decode($row['description']);
}
}
return $configs_array;
}

View File

@@ -62,28 +62,6 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("6", "' . $db->escape($data) . '")'); $db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("6", "' . $db->escape($data) . '")');
$doupdate = true; $doupdate = true;
} }
elseif($type == '7'
&& $param1 != ''
&& $param2 != '')
{
$data = Array();
$data['loginname'] = $param1;
$data['email'] = $param2;
$data = serialize($data);
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("7", "' . $db->escape($data) . '")');
$doupdate = true;
}
elseif($type == '8'
&& $param1 != ''
&& $param2 != '')
{
$data = Array();
$data['loginname'] = $param1;
$data['homedir'] = $param2;
$data = serialize($data);
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("8", "' . $db->escape($data) . '")');
$doupdate = true;
}
if($doupdate === true if($doupdate === true
&& (int)$settings['system']['realtime_port'] !== 0 && (int)$settings['system']['realtime_port'] !== 0

View File

@@ -26,7 +26,7 @@
* *
* @return null * @return null
*/ */
function openRootDB($debugHandler = false, $lockfile = false) function openRootDB($debugHandler, $lockfile)
{ {
global $db_root; global $db_root;
@@ -47,22 +47,14 @@ function openRootDB($debugHandler = false, $lockfile = false)
/** /**
* Do not proceed further if no database connection could be established * Do not proceed further if no database connection could be established
*/ */
if(isset($debugHandler) && $debugHandler !== false)
{ fclose($debugHandler);
fclose($debugHandler); unlink($lockfile);
}
if(isset($lockfile) && $lockfile !== false)
{
unlink($lockfile);
}
die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...'); die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
} }
unset($db_root->password); unset($db_root->password);
if(isset($debugHandler) && $debugHandler !== false) fwrite($debugHandler, 'Database-rootconnection established' . "\n");
{
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
}
unset($sql); unset($sql);
} }

View File

@@ -115,7 +115,7 @@ function hasUpdates($to_check = null)
*/ */
function showUpdateStep($task = null, $needs_status = true) function showUpdateStep($task = null, $needs_status = true)
{ {
global $updatelog, $filelog; global $updatelog;
// output // output
echo $task; echo $task;
@@ -126,7 +126,6 @@ function showUpdateStep($task = null, $needs_status = true)
} }
$updatelog->logAction(ADM_ACTION, LOG_WARNING, $task); $updatelog->logAction(ADM_ACTION, LOG_WARNING, $task);
$filelog->logAction(ADM_ACTION, LOG_WARNING, $task);
} }
/* /*
@@ -141,7 +140,7 @@ function showUpdateStep($task = null, $needs_status = true)
*/ */
function lastStepStatus($status = -1, $message = '') function lastStepStatus($status = -1, $message = '')
{ {
global $updatelog, $filelog; global $updatelog;
switch($status) switch($status)
{ {
@@ -165,35 +164,8 @@ function lastStepStatus($status = -1, $message = '')
// output // output
echo "<span style=\"margin-left: 5em; font-weight: bold; color: #".$status_color."\">".$status_sign."</span><br />"; echo "<span style=\"margin-left: 5em; font-weight: bold; color: #".$status_color."\">".$status_sign."</span><br />";
if($status == -1 || $status == 2) if($status == -1)
{ {
$updatelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!'); $updatelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
$filelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
}
elseif($status == 0 || $status == 1)
{
$filelog->logAction(ADM_ACTION, LOG_WARNING, 'Success');
} }
} }
/**
* validate if full path to update.log is sane
* if not, the update.log is created in /tmp/
*
* @param string $filename the file name to validate
*
* @return string the full path with filename (can differ if not writeable => /tmp)
*/
function validateUpdateLogFile($filename)
{
if(!is_dir($filename))
{
$fh = @fopen($filename, 'a');
if($fh)
{
fclose($fh);
return $filename;
}
}
return '/tmp/froxlor_update.log';
}

View File

@@ -1,164 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $$
*/
/**
* return an array of all enabled redirect-codes
*
* @return array array of enabled redirect-codes
*/
function getRedirectCodesArray()
{
global $db;
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
$result = $db->query($sql);
$codes = array();
while($rc = $db->fetch_array($result))
{
$codes[] = $rc;
}
return $codes;
}
/**
* return an array of all enabled redirect-codes
* for the settings form
*
* @return array array of enabled redirect-codes
*/
function getRedirectCodes()
{
global $db, $lng;
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
$result = $db->query($sql);
$codes = array();
while($rc = $db->fetch_array($result))
{
$codes[$rc['id']] = $rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')';
}
return $codes;
}
/**
* returns the redirect-code for a given
* domain-id
*
* @param integer $domainid id of the domain
*
* @return string redirect-code
*/
function getDomainRedirectCode($domainid = 0)
{
global $db;
$code = '';
if($domainid > 0)
{
$sql = "SELECT `r`.`code` as `redirect`
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
$result = $db->query_first($sql);
if(is_array($result)
&& isset($result['redirect'])
) {
$code = ($result['redirect'] == '---') ? '' : $result['redirect'];
}
}
return $code;
}
/**
* returns the redirect-id for a given
* domain-id
*
* @param integer $domainid id of the domain
*
* @return integer redirect-code-id
*/
function getDomainRedirectId($domainid = 0)
{
global $db;
$code = 1;
if($domainid > 0)
{
$sql = "SELECT `r`.`id` as `redirect`
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
$result = $db->query_first($sql);
if(is_array($result)
&& isset($result['redirect'])
) {
$code = (int)$result['redirect'];
}
}
return $code;
}
/**
* adds a redirectcode for a domain
*
* @param integer $domainid id of the domain to add the code for
* @param integer $redirect selected redirect-id
*
* @return null
*/
function addRedirectToDomain($domainid = 0, $redirect = 1)
{
global $db;
if($domainid > 0)
{
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
}
}
/**
* updates the redirectcode of a domain
* if redirect-code is false, nothing happens
*
* @param integer $domainid id of the domain to update
* @param integer $redirect selected redirect-id or false
*
* @return null
*/
function updateRedirectOfDomain($domainid = 0, $redirect = false)
{
global $db;
if($redirect == false)
{
return;
}
if($domainid > 0)
{
$db->query("DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."`
WHERE `did` = '".(int)$domainid."'");
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
}
}

View File

@@ -66,7 +66,7 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '')
exit; exit;
} }
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '')
{ {
global $userinfo, $db, $s, $header, $footer, $lng; global $userinfo, $db, $s, $header, $footer, $lng;
@@ -89,12 +89,8 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $
{ {
$chk_text = $lng['question'][$chk_text]; $chk_text = $lng['question'][$chk_text];
} }
if ($show_checkbox) { $checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
} else {
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";;
}
$text = strtr($text, array('%s' => $targetname)); $text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";"); eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");

View File

@@ -17,7 +17,7 @@
* @version $Id$ * @version $Id$
*/ */
function loadSettings(&$settings_data, $db) function loadSettings($settings_data, $db)
{ {
$settings = array(); $settings = array();

View File

@@ -11,7 +11,7 @@
* @copyright (c) the authors * @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions * @package Language
* @version $Id$ * @version $Id$
*/ */

View File

@@ -1,45 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* checks give path for security issues
* and returns a string that can be appended
* to a line for a open_basedir directive
*
* @param string $path the path to check and append
* @param boolean $first if true, no ':' will be prefixed to the path
*
* @return string
*/
function appendOpenBasedirPath($path = '', $first = false)
{
$path = makeCorrectDir($path);
if($path != ''
&& $path != '/'
&& !preg_match("#^/dev#i", $path)
&& !preg_match("#^/proc#i", $path)
&& !preg_match("#^/etc#i", $path)
&& !preg_match("#^/sys#i", $path)
&& !preg_match("#:#", $path)
) {
if($first)
return $path;
return ':' . $path;
}
return '';
}

View File

@@ -25,7 +25,6 @@ function checkMysqlAccessHost($fieldname, $fielddata, $newfieldvalue, $allnewfie
{ {
if(validate_ip($host_entry, true) == false if(validate_ip($host_entry, true) == false
&& validateDomain($host_entry) == false && validateDomain($host_entry) == false
&& validateLocalHostname($host_entry) == false
&& $host_entry != '%') && $host_entry != '%')
{ {
return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidmysqlhost', $host_entry); return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidmysqlhost', $host_entry);

View File

@@ -1,32 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* validates a given regex
*
* @param string $regex regex to validate
*
* @return boolean
*/
function checkValidRegEx($regex = null)
{
if($regex == null || $regex == '') {
return true;
}
}

View File

@@ -37,25 +37,12 @@ function validateDomain($domainname)
// If FILTER_VALIDATE_URL is good, but FILTER_VALIDATE_URL with FILTER_FLAG_PATH_REQUIRED or FILTER_FLAG_QUERY_REQUIRED is also good, it isn't just a domain. // If FILTER_VALIDATE_URL is good, but FILTER_VALIDATE_URL with FILTER_FLAG_PATH_REQUIRED or FILTER_FLAG_QUERY_REQUIRED is also good, it isn't just a domain.
// This is a ugly hack, maybe a good regex would be better? // This is a ugly hack, maybe a good regex would be better?
// there is a bug in php 5.2.13 - 5.3.2 which if(filter_var($domainname_tmp, FILTER_VALIDATE_URL) !== false && filter_var($domainname_tmp, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED) === false && filter_var($domainname_tmp, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false)
// lets filter_var fail if the domain has {
// a dash (-) in it. As the PHP_VERSION constant
// gives also patch-brandings, e.g. '5.3.2-pl0-gentoo'
// we just always use our regex
$pattern = '/^http:\/\/([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6}$/i';
if(preg_match($pattern, $domainname_tmp))
{
return $domainname; return $domainname;
} }
return false; else
} {
return false;
function validateLocalHostname($hostname)
{
$pattern = '/^([a-zA-Z0-9\-])+$/i';
if(preg_match($pattern, $hostname))
{
return $hostname;
} }
return false;
} }

View File

@@ -1,52 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Function validatePassword
*
* if password-min-length is set in settings
* we check against the length, if not matched
* an error message will be output and 'exit' is called
*
* @param string $password the password to validate
*
* @return string either the password or an errormessage+exit
*/
function validatePassword($password = null)
{
global $settings;
if ($settings['panel']['password_min_length'] > 0) {
$password = validate(
$password,
$settings['panel']['password_min_length'], /* replacer needs to be password length, not the fieldname */
'/^.{'.(int)$settings['panel']['password_min_length'].',}$/D',
'notrequiredpasswordlength'
);
}
if ($settings['panel']['password_regex'] != '') {
$password = validate(
$password,
$settings['panel']['password_regex'],
$settings['panel']['password_regex'],
'notrequiredpasswordcomplexity'
);
}
return $password;
}

View File

@@ -28,51 +28,45 @@
function validateUrl($url) function validateUrl($url)
{ {
global $idna_convert;
if(strtolower(substr($url, 0, 7)) != "http://" if(strtolower(substr($url, 0, 7)) != "http://"
&& strtolower(substr($url, 0, 8)) != "https://") && strtolower(substr($url, 0, 8)) != "https://")
{ {
$url = 'http://' . $url; $url = 'http://' . $url;
} }
// needs converting
$url = $idna_convert->encode($url);
$pattern = "/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?$/i"; if(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== false)
if(preg_match($pattern, $url))
{ {
return true; return true;
} }
else
// not an fqdn
if(strtolower(substr($url, 0, 7)) == "http://"
|| strtolower(substr($url, 0, 8)) == "https://")
{ {
if(strtolower(substr($url, 0, 7)) == "http://") if(strtolower(substr($url, 0, 7)) == "http://"
|| strtolower(substr($url, 0, 8)) == "https://")
{ {
$ip = strtolower(substr($url, 7)); if(strtolower(substr($url, 0, 7)) == "http://")
} {
$ip = strtolower(substr($url, 7));
}
if(strtolower(substr($url, 0, 8)) == "https://") if(strtolower(substr($url, 0, 8)) == "https://")
{ {
$ip = strtolower(substr($url, 8)); $ip = strtolower(substr($url, 8));
} }
$ip = substr($ip, 0, strpos($ip, '/')); $ip = substr($ip, 0, strpos($ip, '/'));
if(validate_ip($ip, true) !== false) if(validate_ip($ip, true) !== false)
{ {
return true; return true;
}
else
{
return false;
}
} }
else else
{ {
return false; return false;
} }
} }
else
{
return false;
}
} }

Some files were not shown because too many files have changed in this diff Show More