Compare commits

...

23 commits

Author SHA1 Message Date
42e484cd0c Add warning about project abandon 2022-12-17 00:56:19 +01:00
c81544b4ee Align with default 022 umask #noissue 2022-09-05 20:37:01 +02:00
ce72918943 Fix style of CHANGELOG 2022-07-05 22:18:22 +02:00
74fc734d60 Update external git reference #noissue 2022-07-05 22:10:15 +02:00
70e48783b8 Use 4 spaces as tab and reformat 2021-05-21 01:21:43 +02:00
b541d33671 Add license which is valid for also all previous releases 2019-09-25 15:33:26 +02:00
5411405022 v0.3.0.1 2018-05-24 13:49:28 +02:00
6e1320e93c Change changelog 2018-05-24 02:00:43 +02:00
3e34d22cae Use inline for cookieconsent again (needs to be parsed by twig) 2018-05-24 01:59:49 +02:00
b32adde2bd Use files for custom JS/CSS 2018-05-23 18:45:25 +02:00
ee1d4d4786 Design fixes, agreement in md file 2018-05-18 15:01:16 +02:00
2423fd6e23 Update README 2018-05-17 13:38:51 +02:00
7c761a0fe4 Replace theme with a bootstrap4 basic theme 2018-05-17 13:24:24 +02:00
f6c06c4470 Dont send password via mail, rename nickname to username again 2018-05-15 21:51:24 +02:00
fdb67c8d15 Add legal information 2018-05-15 21:31:17 +02:00
a52ae4cc2b readme 2018-04-03 13:50:36 +02:00
c9013842f8 readme 2018-04-03 13:49:57 +02:00
dbdd27aa55 rewrite base for apache 2018-04-03 13:47:59 +02:00
475b536cc3 remove cdn 2017-09-04 11:47:46 +02:00
585faa0f8e force to lower on login and sign up 2017-05-04 13:44:51 +02:00
121f4c4449 force to lower on login and sign up 2017-05-04 13:38:36 +02:00
8b9cde8f73 update to latest yaml 2016-11-23 01:05:06 +01:00
74a2bae39f - Refactor
- Bugfixes
- Add possibility to determine LogLevel and logger name in environment
2016-07-11 22:29:44 +02:00
86 changed files with 44649 additions and 2042 deletions

6
.editorconfig Normal file
View file

@ -0,0 +1,6 @@
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

1
.gitignore vendored Executable file → Normal file
View file

@ -11,6 +11,7 @@ composer.phar
# do not commit environment vars
config/env
config/legal.md
# only keep folder
cache/*

51
CHANGELOG.md Normal file
View file

@ -0,0 +1,51 @@
## Changelog
## 0.3.0.1
- Remove cookie consent as session cookies should be allowed because they provide core functionality
- Adjust `legal.example.md` and add `PHPSESSID`
- Fix styles
## 0.3.0.0
- Fixes
- Cookie consent
## 0.2.0.1
- Design fixes
- GDPR adjustments (specify agreement in a `.md` file)
## 0.1.3.3 to 0.2.0.0
- update to latest yaml
- Force to lower on email and username
- Update README and htaccess for Apache
- Change to bootstrap4 theme
- Add legal information hint on sign up page
## 0.1.3.2:
- Refactor
- Bugfixes
- Add possibility to determine LogLevel and logger name in environment
## 0.1.3.1:
- Bugfixes
## 0.1.3:
- add authentication after sign up
- only logged in users can delete their account (with the help of the token)
- only logged in users can change their account password
## 0.1.2:
- Bugfixes
## 0.1.1:
- updated readme and `env.example`
- fix some language validator inconsistencies
- added admin notifications
- added possibility for users to delete their account
- added back index page
- works with mod_admin_rest
version [afc42d7](https://github.com/snowblindroan/mod_admin_rest/commit/afc42d70f0aceb2351a1bc786d61e3f4dbdfb948)
## 0.1:
- initial release
- works with mod_admin_rest
version [afc42d7](https://github.com/snowblindroan/mod_admin_rest/commit/afc42d70f0aceb2351a1bc786d61e3f4dbdfb948)

675
LICENSE.txt Normal file
View file

@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

87
README.md Executable file → Normal file
View file

@ -1,6 +1,9 @@
# README #
# README
A simple webinterface for users. This app uses [`admin_rest`](https://github.com/snowblindroan/mod_admin_rest) module of prosody. So [prosody.im](http://prosody.im) is a hard dependency. The interface allows users
**This project is not actively maintained anymore.**.
A simple webinterface for users. This app uses [`admin_rest`](https://github.com/snowblindroan/mod_admin_rest) module of
prosody. So [prosody.im](http://prosody.im) and this module are hard dependencies. The interface allows users
* to have two step verification (as an alternative to the integrated `register_web` module),
* to delete of their accounts and
@ -21,75 +24,71 @@ This app uses
as dependencies.
## Requirements ##
The main git repository is hosted at _[https://git.myservermanager.com/varakh/prosody_web_admin_rest](https://git.myservermanager.com/varakh/prosody_web_admin_rest)_.
Other repositories are mirrors and pull requests, issues, and planning are managed there.
Contributions are very welcome!
## Requirements
* admin_rest module of prosody
* composer
* sqlite pdo, mb_string
## Install ##
## Install
* Install composer
* Change directory to project home
* Copy `config/env.example` to `config/env` and adjust to your needs
* Copy `config/legal.example.md` to `config/legal.md` and adjust to your needs
* `composer install`
* `php bin/phpmig migrate`
* start server with `php -S localhost:8080 -t public public/index.php`
* point browser to [localhost:8080](http://localhost:8080) to have a preview
## Deployment ##
## Deployment
* Set up a cron job using `php projectRootDir/bin/UsersAwaitingVerificationCleanUpCronJob.php` to clean up users who signed up but did not verify their account periodically.
* Set up a cron job using `php projectRootDir/bin/UsersAwaitingVerificationCleanUpCronJob.php` to clean up users who
signed up but did not verify their account periodically.
* Point your document root to `public/`.
* Example nginx conf:
root .../public;
index index.php;
```
root .../public;
index index.php;
rewrite_log on;
rewrite_log on;
location / {
try_files $uri $uri/ @ee;
}
location / {
try_files $uri $uri/ @ee;
}
location @ee {
rewrite ^(.*) /index.php?$1 last;
}
location @ee {
rewrite ^(.*) /index.php?$1 last;
}
# php fpm
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include fastcgi_params;
}
# php fpm
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include fastcgi_params;
}
```
## Upgrade ##
You should be able to set a very strict Content-Security-Policy.
## Upgrade
* Change directory to project home
* `git pull`
* `composer update`
* look for changes
* `php bin/phpmig migrate`
* look into Changelog for major changes
## Translations ##
This app uses Symfony Translator. It's bootstraped in `Util\TranslationHelper` and locales are placed under `data/locale/`. Adjust to your needs or help translating.
## Developers
## Changelog ##
- 0.1.3:
- add authentication after sign up
- only logged in users can delete their account (with the help of the token)
- only logged in users can change their account password
* start server with `php -S localhost:8080 -t public public/index.php`
* point browser to [localhost:8080](http://localhost:8080) to have a preview
- 0.1.2:
- Bugfixes
## Translations
- 0.1.1:
- updated readme and `env.example`
- fix some language validator inconsistencies
- added admin notifications
- added possiblity for users to delete their account
- added back index page
- works with mod_admin_rest version [afc42d7](https://github.com/snowblindroan/mod_admin_rest/commit/afc42d70f0aceb2351a1bc786d61e3f4dbdfb948)
- 0.1:
- initial release
- works with mod_admin_rest version [afc42d7](https://github.com/snowblindroan/mod_admin_rest/commit/afc42d70f0aceb2351a1bc786d61e3f4dbdfb948)
This app uses Symfony Translator. It's bootstraped in `Util\BootstrapHelper` and locales are placed under `data/locale/`
. Adjust to your needs or help translating.

View file

@ -7,11 +7,11 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php';
/*
* Bootstrap environment, configs and database
*/
$env = EnvironmentHelper::getAppEnvironment();
$env = BootstrapHelper::bootEnvironment();
$config = Config::$CONFIG;
$db = DatabaseHelper::getAppDatabase();
$translator = TranslationHelper::getAppTranslator();
$logger = LoggerHelper::getAppLogger();
$db = BootstrapHelper::bootDatabase();
$translator = BootstrapHelper::bootTranslator();
$logger = BootstrapHelper::bootLogger();
// handle all users awaiting verification and notify them
$users = UserAwaitingVerification::all();

View file

@ -1,27 +1,29 @@
{
"require": {
"slim/slim": "^3.0",
"monolog/monolog": "^1.18",
"slim/twig-view": "^2.1",
"slim/flash": "^0.1.0",
"wixel/gump": "^1.3",
"curl/curl": "^1.4",
"phpmailer/phpmailer": "^5.2",
"illuminate/database": "~5.2",
"davedevelopment/phpmig": "^1.2",
"symfony/translation": "^3.1",
"symfony/twig-bridge": "^3.1",
"vlucas/phpdotenv": "^2.3",
"fabiang/xmpp": "^0.6.1",
"jeremykendall/slim-auth": "dev-slim-3.x"
},
"config": {
"bin-dir": "bin/"
},
"autoload": {
"classmap": [
"src/",
"config/"
]
}
"require": {
"slim/slim": "^3.0",
"monolog/monolog": "^1.18",
"slim/twig-view": "^2.1",
"jralph/twig-markdown": "^2.0",
"slim/flash": "^0.1.0",
"wixel/gump": "^1.3",
"curl/curl": "^1.4",
"phpmailer/phpmailer": "^5.2",
"illuminate/database": "~5.2",
"davedevelopment/phpmig": "^1.2",
"symfony/translation": "^3.1",
"symfony/twig-bridge": "^3.1",
"vlucas/phpdotenv": "^2.3",
"fabiang/xmpp": "^0.6.1",
"jeremykendall/slim-auth": "dev-slim-3.x",
"symfony/yaml": "*"
},
"config": {
"bin-dir": "bin/"
},
"autoload": {
"classmap": [
"src/",
"config/"
]
}
}

View file

@ -27,7 +27,7 @@ class ACL extends \Zend\Permissions\Acl\Acl
'/password',
'/logout',
],
'guest' => [
'guest' => [
'/login',
'/signup',
'/verification/{verificationCode}',
@ -39,9 +39,9 @@ class ACL extends \Zend\Permissions\Acl\Acl
],
];
public static $ACL_DENIES = [
'admin' => ['/login', '/signup', '/verification/{verificationCode}'],
'member' => ['/login', '/signup', '/verification/{verificationCode}'],
'guest' => []
'admin' => ['/login', '/signup', '/verification/{verificationCode}'],
'member' => ['/login', '/signup', '/verification/{verificationCode}'],
'guest' => []
];
public function __construct()

View file

@ -9,7 +9,7 @@ class Config
// no need to change anything here
'db_settings' => [
'driver' => 'sqlite',
'database' => __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'data'. DIRECTORY_SEPARATOR .'db.sqlite',
'database' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'db.sqlite',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
@ -21,15 +21,13 @@ class Config
],
'twig_settings' => [
'twig_dir' => __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'src'. DIRECTORY_SEPARATOR .'View',
'twig_dir' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'View',
'twig_cache_dir' => false,
//'twig_cache_dir' => __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'src'. DIRECTORY_SEPARATOR .'cache',
],
'logger_settings' => [
'level' => Logger::DEBUG,
'name' => 'application',
'path' => __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'log'. DIRECTORY_SEPARATOR .'application.log',
'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'application.log',
],
];
}

View file

@ -9,13 +9,13 @@ site_navbar_logout_displayname="Logout"
site_navbar_backlink_enabled="false" # enables a link in the navbar to go back to e.g. main server site
site_navbar_backlink_uri=""
site_navbar_backlink_displayname=""
site_xmpp_server_displayname="jabber.server.org"
site_xmpp_server_displayname="jabber.server.org" # displayed after the @
# verification_timeout and non-verified users will be deleted
verification_cleanup_time="7 day"
# xmpp Settings
xmpp_host="hoth.one" # hostname to connect
xmpp_host="" # hostname to connect
xmpp_port="5222" # port to connect, defaults to 5222
xmpp_connection_type="tcp" # defaults to tcp
@ -25,7 +25,6 @@ xmpp_curl_auth_admin_username="" # configured in prosody lua file
xmpp_curl_auth_admin_password="" # configured in prosody lua file
# Mail Settings
# main
mail_host=""
mail_port="587"
mail_secure="tls"
@ -33,7 +32,13 @@ mail_auth=true
mail_username=""
mail_password=""
mail_from="webmaster@jabber.server.org"
mail_from_name="jabber.server.org"
mail_from_name="Server Name"
# log
log_name="application"
# possible log levels from low to high, lower values produce more details:
# DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY
log_level="INFO"
# notification
mail_notify="true" # sends an email to mail_notify_to if a new user successfully verified their account

42
config/legal.example.md Normal file
View file

@ -0,0 +1,42 @@
# Responsible
```
Contact data
```
# Preliminary
- I agree that accepting the policies mentioned below are required in order to use the service.
- I agree to not sue the operator of this (free) service for any misconfiguration concering any data protection laws.
# Website
## Cookies
This website uses small files called cookies to help the operator customise your experience. Cookies are small text
files that are stored by the browser on your device. They allow websites to store things like user preferences.
Functionality might be affected if you disable cookies for this website.
These cookies are essential to the proper functioning of our website and enable you to use its features, such as
accessing secure areas of the site. Without these cookies, you will not be able to perform core site functions such as
logging in.
| Cookiename | Provider | Purpose |
|:------------------:|:-----------:|:---------|
| `PHPSESSID` | Provider | Creates a unique session for your device, allowing a platform for login. No personal or device information is collected or stored. If you login, you will be given access to parts of the site for registered members. If you close your browser or end your browser session, this cookie will be deleted automatically. |
## Registration
Registration: An email is stored (maximal: 7 days, typical: deleted after verification process is completed) and
credentials (minimal: stored as long as the account exists, typical: check user JID against well-known spammer patterns)
are stored.
## Log
Access logs are not stored except for fixing bugs in case of an error or an attack on this service. Logs will be removed
once the [log rotates](https://en.wikipedia.org/wiki/Log_rotation) within 7 days.
# Service
- [What data is processed?](https://wiki.xmpp.org/web/GDPR#Q1.1b_List_what_data_is_processed)
- [How is data processing done?](https://wiki.xmpp.org/web/GDPR#Q1.1c_List_what_processing_is_done)

View file

@ -1,15 +1,15 @@
<?php
use \Phpmig\Adapter;
use Phpmig\Adapter;
$container = new ArrayObject();
$container['env'] = EnvironmentHelper::getAppEnvironment();
$container['db'] = DatabaseHelper::getAppDatabase();
$container['env'] = BootstrapHelper::bootEnvironment();
$container['db'] = BootstrapHelper::bootDatabase();
$container['phpmig.adapter'] = new Phpmig\Adapter\PDO\Sql($container['db']->getConnection()->getPdo(), 'migrations');
$container['phpmig.migrations_template_path'] = __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'data'. DIRECTORY_SEPARATOR .'phpmig_template.php';
$container['phpmig.migrations_path'] = __DIR__ . DIRECTORY_SEPARATOR . '..'. DIRECTORY_SEPARATOR .'data'. DIRECTORY_SEPARATOR .'migrations';
$container['phpmig.migrations_template_path'] = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'phpmig_template.php';
$container['phpmig.migrations_path'] = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'migrations';
$container['schema'] = $container['db']->schema();

View file

@ -1,49 +1,56 @@
# Home
home.title: Home
home.text: |
Hi,
welcome to the free jabber service %server%. Sign up now by clicking the "Sign up" button in the navigation bar.
Welcome to the free jabber service %server%.
<br />
<br />
Create an account by pressing the <i>"Sign up"</i> button in the navigation bar.
# Sign up
sign.up.title: Sign Up
sign.up.flash.success: Signed up successfully. Check your inbox.
sign.up.flash.already_in_use_email_and_username: %username%/%email% is already in use.
sign.up.flash.already_in_use_email: %email% is already in use.
sign.up.flash.already_in_use_username: %username% is already in use.
sign.up.flash.already_in_use_email_and_username: "%username%/%email% is already in use."
sign.up.flash.already_in_use_email: "%email% is already in use."
sign.up.flash.already_in_use_username: "%username% is already in use."
sign.up.form.button: Sign up
sign.up.form.username: Username:
sign.up.form.username: Username
sign.up.form.username.placeholder: username
sign.up.form.email: Email (only used for one time email verification, not persisted further):
sign.up.form.email: Email
sign.up.form.email.help: Only used for one time email verification, not persisted further.
sign.up.form.email.placeholder: xyz@domain.tld
sign.up.form.password: Password:
sign.up.form.password.placeholder: Password:
sign.up.form.password: Password
sign.up.form.password.placeholder: password
# Legal modal
legalmodal.open: I agree to all policies which apply for this service.
legalmodal.title: Policy
# Verification
verification.mail.subject: %server%: jabber account verification
verification.mail.subject: "%server%: jabber account verification"
verification.mail.body: |
Hello %username%,
you've signed up for a jabber account on %server%.
In order to complete your registration, verify your email within 7 days by clicking on %verificationLink%.
Hello %username%,
you've signed up for a jabber account on %server%.
In order to complete your registration, verify your email within 7 days by clicking on %verificationLink%.
verification.code.invalid: Verification code %verificationCode% is not valid.
verification.flash.already_in_use_username: %username% is already in use.
verification.flash.success: Verification successful. You can now sign in to your newly created jabber account %username%@hoth.one.
verification.flash.already_in_use_username: "%username% is already in use."
verification.flash.success: Verification successful. You can now sign in to your newly created jabber account %username%@%server%.
verification.flash.unknown_error: Could not process sign up of %username%. Please contact administrator.
verification.mail.success.subject: %server%: jabber account information
verification.mail.success.subject: "%server%: jabber account information"
verification.mail.success.body: |
Hello %username%,
you've verified your email address successfully and your jabber account on %server% has been created.
Your password is "%password%".
If you wish to delete your account, use %deleteCode% on the website.
Keep this mail safe!
verification.mail.success.notify.subject: %server%: user verified their account
Hello %username%,
you've verified your email address successfully and your jabber account on %server% has been created.
If you wish to delete your account, use %deleteCode% on the website.
Keep this mail safe!
verification.mail.success.notify.subject: "%server%: user verified their account"
verification.mail.success.notify.body: A user (%email%) verified their account %username%@%server% successfully.
# Delete
delete.title: Delete Account
delete.form.username: Username:
delete.form.username: Username
delete.form.username.placeholder: username
delete.form.delete_code: Deletion Code:
delete.form.delete_code.placeholder: received via mail on sign up, 32 in length
delete.form.delete_code: Deletion Code
delete.form.delete_code.placeholder: delete code
delete.form.delete_code.help: You should have received the code after your registration process. It is 32 in length. If you haven't, please contact the operator.
delete.form.button: Delete
delete.flash.combination_not_found: Could not find a combination match for username and delete code.
delete.flash.success: Successfully deleted your account %username%@%server%.
@ -52,48 +59,48 @@ delete.flash.unknown_error: Could not process deletion of %username%. Please con
# Password
password.title: Change password
password.form.button: Change password
password.form.password: Password:
password.form.password: Password
password.form.password.placeholder: password
password.form.password_confirmation: Password confirmation:
password.form.password_confirmation: Password confirmation
password.form.password_confirmation.placeholder: password confirmation
password.flash.not_the_same: Passwords do not match.
password.flash.success: Successfully changed your password.
password.flash.unknown_error: Could not process password change of %username%. Please contact administrator.
# Login
logged.in.site: Logged in as %username%@%server%
logged.in.site: (%username%@%server%)
login.title: Login
login.flash.success: Logged in as %username%@%server% successfully.
login.flash.wrong_credentials: Cannot login. Wrong credentials.
login.form.button: Login
login.form.username: Username:
login.form.username: Username
login.form.username.placeholder: username
login.form.password: Password:
login.form.password.placeholder: Password:
login.form.password: Password
login.form.password.placeholder: password
# Logout
logout.title: Logout
logout.flash.success: Logged out successfully.
# Cleanup
cleanup.mail.subject: %server%: jabber account verification expired
cleanup.mail.subject: "%server%: jabber account verification expired"
cleanup.mail.body: |
Hello %username%,
you've recently signed up for a jabber account on %server% but you did not verify your account within 7 days.
Your verification code is invalid now.
Hello %username%,
you've recently signed up for a jabber account on %server% but you did not verify your account within 7 days.
Your verification code is invalid now.
# Log
log.internal.application.error: Internal application error.
log.signed.up: %username% signed up.
log.signed.up: "%username% signed up."
log.verification.invalid: Tried to use code %verificationCode% but it is invalid.
log.verification.sucess: %username% verified.
log.verification.sucess: "%username% verified."
log.verification.unknown_error: Unknown error in XMPP Rest API.
log.verification.cleanup: %username% did not verify. Deleted.
log.delete.success: %username% deleted their account.
log.verification.cleanup: "%username% did not verify. Deleted."
log.delete.success: "%username% deleted their account."
log.delete.unknown_error: Unknown error in XMPP Rest API.
log.login: %username% logged in.
log.logout: %username% logged out.
log.password.success: %username% changed their password.
log.login: "%username% logged in."
log.logout: "%username% logged out."
log.password.success: "%username% changed their password."
log.password.unknown_error: Unknown error in XMPP Rest API.
# Error
@ -107,30 +114,30 @@ error.500.title: 500
error.500.content: Internal application error.
# Validation
mismatch: There is no validation rule for %field%.
validate_required: The %field% field is required: The %field% field is required.
validate_valid_json_string: Field %field% has to be valid JSON.
validate_valid_email: The %field% field is required to be a valid email address.
validate_max_len: The %field% field needs to be shorter than %param% characters.
validate_min_len: The %field% field needs to be longer than %param% characters.
validate_exact_len: The %field% field needs to be exactly %param% characters in length.
validate_alpha: The %field% field may only contain alpha characters(a-z).
validate_alpha_numeric: The %field% field may only contain alpha-numeric characters.
validate_alpha_dash: The %field% field may only contain alpha characters and dashes.
validate_numeric: The %field% field may only contain numeric characters.
validate_integer: The %field% field may only contain a numeric value.
validate_boolean: The %field% field may only contain a true or false value.
validate_float: The %field% field may only contain a float value.
validate_valid_url: The %field% field is required to be a valid URL.
validate_url_exists: The %field% URL does not exist.
validate_valid_ip: The %field% field needs to contain a valid IP address.
validate_valid_cc: The %field% field needs to contain a valid credit card number.
validate_valid_name: The %field% field needs to contain a valid human name.
validate_contains: The %field% field needs to contain one of these values: %param%.
validate_street_address: The %field% field needs to be a valid street address.
validate_date: The %field% field needs to be a valid date.
validate_min_numeric: The %field% field needs to be a numeric value, equal to, or higher than %param%.
validate_max_numeric: The %field% field needs to be a numeric value, equal to, or lower than %param%.
validate_equals: %field% not equal to %param%.
validate_set_min_len: %field% needs to have at least %param% item(s).
validate_default: Field (%field%) is invalid due to an unknown reason (message missing).
mismatch: "There is no validation rule for %field%."
validate_required: "The %field% field is required: The %field% field is required."
validate_valid_json_string: "Field %field% has to be valid JSON."
validate_valid_email: "The %field% field is required to be a valid email address."
validate_max_len: "The %field% field needs to be shorter than %param% characters."
validate_min_len: "The %field% field needs to be longer than %param% characters."
validate_exact_len: "The %field% field needs to be exactly %param% characters in length."
validate_alpha: "The %field% field may only contain alpha characters(a-z)."
validate_alpha_numeric: "The %field% field may only contain alpha-numeric characters."
validate_alpha_dash: "The %field% field may only contain alpha characters and dashes."
validate_numeric: "The %field% field may only contain numeric characters."
validate_integer: "The %field% field may only contain a numeric value."
validate_boolean: "The %field% field may only contain a true or false value."
validate_float: "The %field% field may only contain a float value."
validate_valid_url: "The %field% field is required to be a valid URL."
validate_url_exists: "The %field% URL does not exist."
validate_valid_ip: "The %field% field needs to contain a valid IP address."
validate_valid_cc: "The %field% field needs to contain a valid credit card number."
validate_valid_name: "The %field% field needs to contain a valid human name."
validate_contains: "The %field% field needs to contain one of these values: %param%."
validate_street_address: "The %field% field needs to be a valid street address."
validate_date: "The %field% field needs to be a valid date."
validate_min_numeric: "The %field% field needs to be a numeric value, equal to, or higher than %param%."
validate_max_numeric: "The %field% field needs to be a numeric value, equal to, or lower than %param%."
validate_equals: "%field% not equal to %param%."
validate_set_min_len: "%field% needs to have at least %param% item(s)."
validate_default: "Field (%field%) is invalid due to an unknown reason (message missing)."

View file

@ -1,4 +1,5 @@
<?php
use Phpmig\Migration\Migration;
class UsersAwaitingVerificationTable extends Migration
@ -7,11 +8,11 @@ class UsersAwaitingVerificationTable extends Migration
public $db;
/**
* Do the migration
*/
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$this->db->create($this->tableName, function ($table) {
$table->increments('id');
$table->string('username');
$table->string('email')->unique();
@ -22,16 +23,16 @@ class UsersAwaitingVerificationTable extends Migration
}
/**
* Undo the migration
*/
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
* Init the migration
*/
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];

View file

@ -1,4 +1,5 @@
<?php
use Phpmig\Migration\Migration;
class UsersRegisteredTable extends Migration
@ -7,27 +8,27 @@ class UsersRegisteredTable extends Migration
public $db;
/**
* Do the migration
*/
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$this->db->create($this->tableName, function ($table) {
$table->string('username')->unique()->primary();
$table->string('delete_code', 64);
});
}
/**
* Undo the migration
*/
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
* Init the migration
*/
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];

View file

@ -1,35 +1,35 @@
<?= "<?php ";?>
<?= "<?php "; ?>
use Phpmig\Migration\Migration;
class <?= $className ?> extends Migration
{
public $tableName = ''; // Table name
public $db;
public $tableName = ''; // Table name
public $db;
/**
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$table->timestamps();
});
}
/**
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];
}
/**
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$table->timestamps();
});
}
/**
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];
}
}

View file

@ -1,12 +1,12 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

View file

@ -1,46 +0,0 @@
/*
* Emerald is a simple blog theme built for Jekyll.
*/
/*- Base reset -*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, img {
margin: 0;
padding: 0;
border: 0;
}
/*- Base color -*/
$main-color: #008A3C;
$background-color: #FDFDFD;
$text-color: #222222;
/*- Base settings -*/
html {
background-color: $background-color;
font-size: 16px;
@media (min-width: 940px) {
font-size: 18px;
}
line-height: 1.5;
color: $text-color;
}
/*- Link -*/
a {
color: $main-color;
text-decoration: none;
font-weight: 700;
&:hover,
&:focus {
color: darken($main-color, 5%);
}
}

8981
public/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

7
public/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

13
public/css/custom.css Normal file
View file

@ -0,0 +1,13 @@
body {
padding-top: 54px;
}
@media (min-width: 992px) {
body {
padding-top: 56px;
}
}
#container {
margin-top: 56px;
overflow-x: hidden;
}

View file

@ -1,3 +0,0 @@
/*- Custom style -*/
// -- Put custom style under this point -- //

2337
public/css/font-awesome.css vendored Normal file

File diff suppressed because it is too large Load diff

4
public/css/font-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
public/css/jquery.modal.min.css vendored Normal file
View file

@ -0,0 +1 @@
.blocker{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;overflow:auto;z-index:1;padding:20px;box-sizing:border-box;background-color:#000;background-color:rgba(0,0,0,0.75);text-align:center}.blocker:before{content:"";display:inline-block;height:100%;vertical-align:middle;margin-right:-0.05em}.blocker.behind{background-color:transparent}.modal{display:none;vertical-align:middle;position:relative;z-index:2;max-width:500px;box-sizing:border-box;width:90%;background:#fff;padding:15px 30px;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 0 10px #000;-moz-box-shadow:0 0 10px #000;-o-box-shadow:0 0 10px #000;-ms-box-shadow:0 0 10px #000;box-shadow:0 0 10px #000;text-align:left}.modal a.close-modal{position:absolute;top:-12.5px;right:-12.5px;display:block;width:30px;height:30px;text-indent:-9999px;background-size:contain;background-repeat:no-repeat;background-position:center center;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAA3hJREFUaAXlm8+K00Acx7MiCIJH/yw+gA9g25O49SL4AO3Bp1jw5NvktC+wF88qevK4BU97EmzxUBCEolK/n5gp3W6TTJPfpNPNF37MNsl85/vN/DaTmU6PknC4K+pniqeKJ3k8UnkvDxXJzzy+q/yaxxeVHxW/FNHjgRSeKt4rFoplzaAuHHDBGR2eS9G54reirsmienDCTRt7xwsp+KAoEmt9nLaGitZxrBbPFNaGfPloGw2t4JVamSt8xYW6Dg1oCYo3Yv+rCGViV160oMkcd8SYKnYV1Nb1aEOjCe6L5ZOiLfF120EjWhuBu3YIZt1NQmujnk5F4MgOpURzLfAwOBSTmzp3fpDxuI/pabxpqOoz2r2HLAb0GMbZKlNV5/Hg9XJypguryA7lPF5KMdTZQzHjqxNPhWhzIuAruOl1eNqKEx1tSh5rfbxdw7mOxCq4qS68ZTjKS1YVvilu559vWvFHhh4rZrdyZ69Vmpgdj8fJbDZLJpNJ0uv1cnr/gjrUhQMuI+ANjyuwftQ0bbL6Erp0mM/ny8Fg4M3LtdRxgMtKl3jwmIHVxYXChFy94/Rmpa/pTbNUhstKV+4Rr8lLQ9KlUvJKLyG8yvQ2s9SBy1Jb7jV5a0yapfF6apaZLjLLcWtd4sNrmJUMHyM+1xibTjH82Zh01TNlhsrOhdKTe00uAzZQmN6+KW+sDa/JD2PSVQ873m29yf+1Q9VDzfEYlHi1G5LKBBWZbtEsHbFwb1oYDwr1ZiF/2bnCSg1OBE/pfr9/bWx26UxJL3ONPISOLKUvQza0LZUxSKyjpdTGa/vDEr25rddbMM0Q3O6Lx3rqFvU+x6UrRKQY7tyrZecmD9FODy8uLizTmilwNj0kraNcAJhOp5aGVwsAGD5VmJBrWWbJSgWT9zrzWepQF47RaGSiKfeGx6Szi3gzmX/HHbihwBser4B9UJYpFBNX4R6vTn3VQnez0SymnrHQMsRYGTr1dSk34ljRqS/EMd2pLQ8YBp3a1PLfcqCpo8gtHkZFHKkTX6fs3MY0blKnth66rKCnU0VRGu37ONrQaA4eZDFtWAu2fXj9zjFkxTBOo8F7t926gTp/83Kyzzcy2kZD6xiqxTYnHLRFm3vHiRSwNSjkz3hoIzo8lCKWUlg/YtGs7tObunDAZfpDLbfEI15zsEIY3U/x/gHHc/G1zltnAgAAAABJRU5ErkJggg==')}.modal-spinner{display:none;position:fixed;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);padding:12px 16px;border-radius:5px;background-color:#111;height:20px}.modal-spinner>div{border-radius:100px;background-color:#fff;height:20px;width:2px;margin:0 1px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.modal-spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.modal-spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.modal-spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}@-webkit-keyframes sk-stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.5)}20%{-webkit-transform:scaleY(1.0)}}@keyframes sk-stretchdelay{0%,40%,100%{transform:scaleY(0.5);-webkit-transform:scaleY(0.5)}20%{transform:scaleY(1.0);-webkit-transform:scaleY(1.0)}}

View file

@ -1,255 +0,0 @@
/* -- General Layout -- */
/* Navigation */
#nav, #nav-left {
a {
display: block;
color: $background-color;
padding: 0.33334em 0;
font-size: 1.5em;
font-weight: 400;
@media (min-width: 940px) {
font-size: 1em;
}
&:hover {
background-color: lighten($main-color, 5%);
}
}
span {
font-weight: 200;
}
}
#nav {
@include nav-position(right);
}
#nav-left {
@include nav-position(left);
}
/* Toggle class to open menu */
#nav.menu-open {
@include open(-14rem);
}
#nav-left.menu-open-left {
@include open(14rem);
}
/* Separator after menu */
#nav-list:after {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: $background-color;
}
/* Icon menu */
#nav-menu {
@include icon-position(right);
}
#nav-menu-left {
@include icon-position(left);
}
#menu {
height: 4px;
width: 1.5em;
background-color: lighten($text-color, 35%);
margin-top: 8px;
&:after, &:before {
content: "";
display: block;
position: relative;
height: 4px;
width: 1.5em;
background-color: lighten($text-color, 35%);
transition: all 0.3s ease-in;
}
&:before {
top: -8px;
}
&:after {
top: 4px;
}
&.btn-close {
background: none;
}
&.btn-close:before {
top: 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
background-color: $background-color;
}
&.btn-close:after {
top: -4px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
background-color: $background-color;
}
}
/* Main content */
.fixed {
position: fixed;
@media (min-width: 940px) {
position: static;
}
}
#container {
margin: 0 auto;
max-width: 730px;
padding: 0 1.5rem;
}
#header {
text-align: center;
padding: 24px 0;
position: relative;
a {
text-decoration: none;
color: $text-color;
display: inline-block;
}
img {
max-height: 72px;
margin: 0 auto;
display: block;
}
h1 {
font-family: 'Signika', sans-serif; //Emerald logo font
font-weight: 600;
}
&:after {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: lighten($text-color, 70%);
}
}
/* Posts */
#posts {
li {
list-style-type: none;
}
}
#post-page {
margin-bottom: 1.5em;
@media (min-width: 940px) {
margin-bottom: 1.3334em;
}
}
.post + .post:before {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: lighten($text-color, 70%);
}
.by-line {
display: block;
color: lighten($text-color, 25%);
line-height: 1.5em; /* 24px/16px */
margin-bottom: 1.5em; /* 24px/16px */
font-weight: 200;
@media (min-width: 940px) {
display: block;
color: lighten($text-color, 25%);
line-height: 1.3334em; /* 24px/18px */
margin-bottom: 1.3334em; /* 24px/18px */
font-weight: 200;
}
}
img {
max-width: 100%;
display: block;
margin: 0 auto;
margin-bottom: 24px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
}
img[title="Emerald"] {
box-shadow: 0 2px 6px #ddd;
}
code {
color: lighten($text-color, 35%);
background-color: lighten($background-color, 35%);
}
/* Set the vertical rhythm (and padding-left) for lists inside post content */
.content ul, .content ol {
line-height: 1.5em; /* 24px/16px */
padding-left: 1.5em;
@media (min-width: 940px) {
line-height: 1.33334em; /* 24px/18px */
}
}
/* Pages */
#page ul, #page ol {
padding-left: 1.5em;
}
/* Paginator */
.pagination {
text-align: center;
margin: 2.666668em;
span {
background-color: darken($background-color, 5%);
color: $text-color;
}
a:hover {
background-color: lighten($main-color, 5%);
}
}
.page-item {
background-color: $main-color;
color: $background-color;
padding: 4px 8px;
font-weight: 400;
padding: 0.5em 1em;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
}
/* Footer */
footer {
background-color: $main-color;
color: $background-color;
text-align: center;
padding: 0.6667em 0;
}

View file

@ -1,728 +0,0 @@
/*
* Emerald is a simple blog theme built for Jekyll.
*/
/*- Base reset -*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, img {
margin: 0;
padding: 0;
border: 0; }
/*- Base color -*/
/*- Base settings -*/
html {
background-color: #FDFDFD;
font-size: 16px;
line-height: 1.5;
color: #222222; }
@media (min-width: 940px) {
html {
font-size: 18px; } }
/*- Link -*/
a {
color: #008A3C;
text-decoration: none;
font-weight: 700; }
a:hover, a:focus {
color: #007131; }
/*- Typography -*/
body {
font-family: 'Source Sans Pro', sans-serif;
letter-spacing: 0.01em; }
/*- Typography for medium and small screen, based on 16px font-size -*/
p, ul, ol {
font-size: 1em;
/* 16px */
line-height: 1.5em;
/* 24px/16px */
margin-bottom: 1.5em;
/* 24px/16px */ }
h1 {
font-size: 2.25em;
/* 36px/16px */
line-height: 1.3333em;
/* 48px/36px */
padding: 0.33335em 0;
/* 12px/36px * 2 (Use padding instead of margin to maintain proximity with paragraph) */ }
h2 {
font-size: 1.5em;
/* 24px/16px */
line-height: 1em;
/* 24px/24px */
padding: 1em 0 0 0;
/* 12px/24px * 2, only top (Use padding instead of margin to maintain proximity with paragwithph) */ }
h3, h4, h5, h6 {
font-size: 1.125em;
/* 18px/16px */
line-height: 1.3334em;
/* 24px/18px */
padding: 0.66667em 0;
/* 12px/18px * 2 (Use padding instead of margin to maintain proximity with paragraph) */ }
blockquote {
font-style: italic;
margin: 1.5em;
/* 24px/18px */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
background-color: #f0f0f0;
padding: 0 1.5em;
/* 24px/18px */ }
blockquote p, blockquote ul, blockquote ol {
padding: 1.5em 0;
/* 24px/18px */ }
/*- Typography for big screen, based on 18px font-size -*/
@media (min-width: 940px) {
p, ul, ol {
font-size: 1em;
/* 18px */
line-height: 1.3334em;
/* 24px/18px */
margin-bottom: 1.3334em;
/* 24px/18px */ }
h1 {
font-size: 2.6667em;
/* 48px/18px */
line-height: 1em;
/* 48px/48px */
padding: 0.25em 0;
/* 12px/48px * 2 (Use padding instead of margin to maintain proximity with paragraph) */ }
h2 {
font-size: 2em;
/* 36px/18px */
line-height: 1.3334em;
/* 48px/36px */
padding: 0.66667em 0 0 0;
/* 12px/36px * 2, pnly top (Use padding instead of margin to maintain proximity with paragraph) */ }
h3, h4, h5, h6 {
font-size: 1.3334em;
/* 24px/18px */
line-height: 1em;
/* 24px/24px */
padding: 0.5em 0;
/* 12px/24px * 2 (Use padding instead of margin to maintain proximity with paragraph) */ }
blockquote {
font-style: italic;
margin: 1.3334em;
/* 24px/18px */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
background-color: #f0f0f0;
padding: 0 1.33334em;
/* 24px/18px */ }
blockquote p, blockquote ul, blockquote ol {
padding: 1.33334em 0;
/* 24px/18px */ } }
/* -- General Layout -- */
/* Navigation */
#nav a, #nav-left a {
display: block;
color: #FDFDFD;
padding: 0.33334em 0;
font-size: 1.5em;
font-weight: 400; }
@media (min-width: 940px) {
#nav a, #nav-left a {
font-size: 1em; } }
#nav a:hover, #nav-left a:hover {
background-color: #00a447; }
#nav span, #nav-left span {
font-weight: 200; }
#nav {
width: 14rem;
position: fixed;
background-color: #008A3C;
top: 0;
bottom: 0;
right: -14rem;
color: #FDFDFD;
opacity: 0.95;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
z-index: 1;
padding: 72px 0;
text-align: center; }
#nav-left {
width: 14rem;
position: fixed;
background-color: #008A3C;
top: 0;
bottom: 0;
left: -14rem;
color: #FDFDFD;
opacity: 0.95;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
z-index: 1;
padding: 72px 0;
text-align: center; }
/* Toggle class to open menu */
#nav.menu-open {
-webkit-transform: translateX(-14rem);
-moz-transform: translateX(-14rem);
-ms-transform: translateX(-14rem);
transform: translateX(-14rem);
width: 100%; }
@media (min-width: 940px) {
#nav.menu-open {
width: 30%; } }
#nav-left.menu-open-left {
-webkit-transform: translateX(14rem);
-moz-transform: translateX(14rem);
-ms-transform: translateX(14rem);
transform: translateX(14rem);
width: 100%; }
@media (min-width: 940px) {
#nav-left.menu-open-left {
width: 30%; } }
/* Separator after menu */
#nav-list:after {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: #FDFDFD; }
/* Icon menu */
#nav-menu {
display: block;
position: fixed;
top: 35px;
right: 25px;
z-index: 10;
height: 24px; }
#nav-menu-left {
display: block;
position: fixed;
top: 35px;
left: 25px;
z-index: 10;
height: 24px; }
#menu {
height: 4px;
width: 1.5em;
background-color: #7b7b7b;
margin-top: 8px; }
#menu:after, #menu:before {
content: "";
display: block;
position: relative;
height: 4px;
width: 1.5em;
background-color: #7b7b7b;
transition: all 0.3s ease-in; }
#menu:before {
top: -8px; }
#menu:after {
top: 4px; }
#menu.btn-close {
background: none; }
#menu.btn-close:before {
top: 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
background-color: #FDFDFD; }
#menu.btn-close:after {
top: -4px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
background-color: #FDFDFD; }
/* Main content */
.fixed {
position: fixed; }
@media (min-width: 940px) {
.fixed {
position: static; } }
#container {
margin: 0 auto;
max-width: 730px;
padding: 0 1.5rem; }
#header {
text-align: center;
padding: 24px 0;
position: relative; }
#header a {
text-decoration: none;
color: #222222;
display: inline-block; }
#header img {
max-height: 72px;
margin: 0 auto;
display: block; }
#header h1 {
font-family: 'Signika', sans-serif;
font-weight: 600; }
#header:after {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: #d5d5d5; }
/* Posts */
#posts li {
list-style-type: none; }
#post-page {
margin-bottom: 1.5em; }
@media (min-width: 940px) {
#post-page {
margin-bottom: 1.3334em; } }
.post + .post:before {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: #d5d5d5; }
.by-line {
display: block;
color: #626262;
line-height: 1.5em;
/* 24px/16px */
margin-bottom: 1.5em;
/* 24px/16px */
font-weight: 200; }
@media (min-width: 940px) {
.by-line {
display: block;
color: #626262;
line-height: 1.3334em;
/* 24px/18px */
margin-bottom: 1.3334em;
/* 24px/18px */
font-weight: 200; } }
img {
max-width: 100%;
display: block;
margin: 0 auto;
margin-bottom: 24px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px; }
img[title="Emerald"] {
box-shadow: 0 2px 6px #ddd; }
code {
color: #7b7b7b;
background-color: white; }
/* Set the vertical rhythm (and padding-left) for lists inside post content */
.content ul, .content ol {
line-height: 1.5em;
/* 24px/16px */
padding-left: 1.5em; }
@media (min-width: 940px) {
.content ul, .content ol {
line-height: 1.33334em;
/* 24px/18px */ } }
/* Pages */
#page ul, #page ol {
padding-left: 1.5em; }
/* Paginator */
.pagination {
text-align: center;
margin: 2.666668em; }
.pagination span {
background-color: #f0f0f0;
color: #222222; }
.pagination a:hover {
background-color: #00a447; }
.page-item {
background-color: #008A3C;
color: #FDFDFD;
padding: 4px 8px;
font-weight: 400;
padding: 0.5em 1em;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px; }
/* Footer */
footer {
background-color: #008A3C;
color: #FDFDFD;
text-align: center;
padding: 0.6667em 0; }
/*
* A Github stylesheet to highlight code snippet
* https://github.com/mojombo/tpw/blob/master/css/syntax.css
*/
.lineno {
color: #bdbdbd;
margin-right: 1em; }
.highlight .c {
color: #999988;
font-style: italic; }
/* Comment */
.highlight .err {
color: #a61717;
background-color: #e3d2d2; }
/* Error */
.highlight .k {
font-weight: bold; }
/* Keyword */
.highlight .o {
font-weight: bold; }
/* Operator */
.highlight .cm {
color: #999988;
font-style: italic; }
/* Comment.Multiline */
.highlight .cp {
color: #999999;
font-weight: bold; }
/* Comment.Preproc */
.highlight .c1 {
color: #999988;
font-style: italic; }
/* Comment.Single */
.highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic; }
/* Comment.Special */
.highlight .gd {
color: #000000;
background-color: #ffdddd; }
/* Generic.Deleted */
.highlight .gd .x {
color: #000000;
background-color: #ffaaaa; }
/* Generic.Deleted.Specific */
.highlight .ge {
font-style: italic; }
/* Generic.Emph */
.highlight .gr {
color: #aa0000; }
/* Generic.Error */
.highlight .gh {
color: #999999; }
/* Generic.Heading */
.highlight .gi {
color: #000000;
background-color: #ddffdd; }
/* Generic.Inserted */
.highlight .gi .x {
color: #000000;
background-color: #aaffaa; }
/* Generic.Inserted.Specific */
.highlight .go {
color: #888888; }
/* Generic.Output */
.highlight .gp {
color: #555555; }
/* Generic.Prompt */
.highlight .gs {
font-weight: bold; }
/* Generic.Strong */
.highlight .gu {
color: #aaaaaa; }
/* Generic.Subheading */
.highlight .gt {
color: #aa0000; }
/* Generic.Traceback */
.highlight .kc {
font-weight: bold; }
/* Keyword.Constant */
.highlight .kd {
font-weight: bold; }
/* Keyword.Declaration */
.highlight .kp {
font-weight: bold; }
/* Keyword.Pseudo */
.highlight .kr {
font-weight: bold; }
/* Keyword.Reserved */
.highlight .kt {
color: #445588;
font-weight: bold; }
/* Keyword.Type */
.highlight .m {
color: #009999; }
/* Literal.Number */
.highlight .s {
color: #d14; }
/* Literal.String */
.highlight .na {
color: #008080; }
/* Name.Attribute */
.highlight .nb {
color: #0086B3; }
/* Name.Builtin */
.highlight .nc {
color: #445588;
font-weight: bold; }
/* Name.Class */
.highlight .no {
color: #008080; }
/* Name.Constant */
.highlight .ni {
color: #800080; }
/* Name.Entity */
.highlight .ne {
color: #990000;
font-weight: bold; }
/* Name.Exception */
.highlight .nf {
color: #990000;
font-weight: bold; }
/* Name.Function */
.highlight .nn {
color: #555555; }
/* Name.Namespace */
.highlight .nt {
color: #000080; }
/* Name.Tag */
.highlight .nv {
color: #008080; }
/* Name.Variable */
.highlight .ow {
font-weight: bold; }
/* Operator.Word */
.highlight .w {
color: #bbbbbb; }
/* Text.Whitespace */
.highlight .mf {
color: #009999; }
/* Literal.Number.Float */
.highlight .mh {
color: #009999; }
/* Literal.Number.Hex */
.highlight .mi {
color: #009999; }
/* Literal.Number.Integer */
.highlight .mo {
color: #009999; }
/* Literal.Number.Oct */
.highlight .sb {
color: #d14; }
/* Literal.String.Backtick */
.highlight .sc {
color: #d14; }
/* Literal.String.Char */
.highlight .sd {
color: #d14; }
/* Literal.String.Doc */
.highlight .s2 {
color: #d14; }
/* Literal.String.Double */
.highlight .se {
color: #d14; }
/* Literal.String.Escape */
.highlight .sh {
color: #d14; }
/* Literal.String.Heredoc */
.highlight .si {
color: #d14; }
/* Literal.String.Interpol */
.highlight .sx {
color: #d14; }
/* Literal.String.Other */
.highlight .sr {
color: #009926; }
/* Literal.String.Regex */
.highlight .s1 {
color: #d14; }
/* Literal.String.Single */
.highlight .ss {
color: #990073; }
/* Literal.String.Symbol */
.highlight .bp {
color: #999999; }
/* Name.Builtin.Pseudo */
.highlight .vc {
color: #008080; }
/* Name.Variable.Class */
.highlight .vg {
color: #008080; }
/* Name.Variable.Global */
.highlight .vi {
color: #008080; }
/* Name.Variable.Instance */
.highlight .il {
color: #009999; }
/* Literal.Number.Integer.Long */
/*- Custom style -*/
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px; }
.alert h4 {
margin-top: 0;
color: inherit; }
.alert .alert-link {
font-weight: 700; }
.alert > p, .alert > ul {
margin-bottom: 0; }
.alert > p + p {
margin-top: 5px; }
.alert-dismissable, .alert-dismissible {
padding-right: 35px; }
.alert-dismissable .close, .alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit; }
.alert-success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6; }
.alert-success hr {
border-top-color: #c9e2b3; }
.alert-success .alert-link {
color: #2b542c; }
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1; }
.alert-info hr {
border-top-color: #a6e1ec; }
.alert-info .alert-link {
color: #245269; }
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc; }
.alert-warning hr {
border-top-color: #f7e1b5; }
.alert-warning .alert-link {
color: #66512c; }
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1; }
.alert-danger hr {
border-top-color: #e4b9c0; }
.alert-danger .alert-link {
color: #843534; }
/*# sourceMappingURL=main.css.map */

File diff suppressed because one or more lines are too long

View file

@ -1,93 +0,0 @@
//Import
@import "base", "mixin", "typography", "layout", "syntax.scss", "custom.scss";
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: 700
}
.alert > p, .alert > ul {
margin-bottom: 0
}
.alert > p + p {
margin-top: 5px
}
.alert-dismissable, .alert-dismissible {
padding-right: 35px
}
.alert-dismissable .close, .alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit
}
.alert-success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6
}
.alert-success hr {
border-top-color: #c9e2b3
}
.alert-success .alert-link {
color: #2b542c
}
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1
}
.alert-info hr {
border-top-color: #a6e1ec
}
.alert-info .alert-link {
color: #245269
}
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc
}
.alert-warning hr {
border-top-color: #f7e1b5
}
.alert-warning .alert-link {
color: #66512c
}
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1
}
.alert-danger hr {
border-top-color: #e4b9c0
}
.alert-danger .alert-link {
color: #843534
}

View file

@ -1,41 +0,0 @@
// -- Mixins -- //
// Nav menu
@mixin icon-position($position) {
display: block;
position: fixed;
top: 35px;
#{$position}: 25px;
z-index: 10;
height: 24px;
}
@mixin open($x) {
-webkit-transform: translateX($x);
-moz-transform: translateX($x);
-ms-transform: translateX($x);
transform: translateX($x);
width: 100%;
@media (min-width: 940px) {
width: 30%;
}
}
@mixin nav-position($position) {
width: 14rem;
position: fixed;
background-color: $main-color;
top: 0;
bottom: 0;
#{$position}: -14rem;
color: $background-color;
opacity: 0.95;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
z-index: 1;
padding: 72px 0;
text-align: center;
}

View file

@ -1,66 +0,0 @@
/*
* A Github stylesheet to highlight code snippet
* https://github.com/mojombo/tpw/blob/master/css/syntax.css
*/
// .highlight { background-color: #FFF; }
.lineno { color: darken($background-color, 25%); margin-right: 1em; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */

View file

@ -1,93 +0,0 @@
/*- Typography -*/
//
// Based on the typographic scale: 12, 14, 16, 18, 21, 24, 36, 48, 60, 72.
//
body {
font-family: 'Source Sans Pro', sans-serif;
letter-spacing: 0.01em;
}
/*- Typography for medium and small screen, based on 16px font-size -*/
p, ul, ol {
font-size: 1em; /* 16px */
line-height: 1.5em; /* 24px/16px */
margin-bottom: 1.5em; /* 24px/16px */
}
h1 {
font-size: 2.25em; /* 36px/16px */
line-height: 1.3333em; /* 48px/36px */
padding: 0.33335em 0; /* 12px/36px * 2 (Use padding instead of margin to maintain proximity with paragraph) */
}
h2 {
font-size: 1.5em; /* 24px/16px */
line-height: 1em; /* 24px/24px */
padding: 1em 0 0 0; /* 12px/24px * 2, only top (Use padding instead of margin to maintain proximity with paragwithph) */
}
h3, h4, h5, h6 {
font-size: 1.125em; /* 18px/16px */
line-height: 1.3334em; /* 24px/18px */
padding: 0.66667em 0; /* 12px/18px * 2 (Use padding instead of margin to maintain proximity with paragraph) */
}
blockquote {
font-style: italic;
margin: 1.5em; /* 24px/18px */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
background-color: darken($background-color, 5%);
padding: 0 1.5em; /* 24px/18px */
p, ul, ol {
padding: 1.5em 0; /* 24px/18px */
}
}
/*- Typography for big screen, based on 18px font-size -*/
@media (min-width: 940px) { //Breakpoint set to 940px
p, ul, ol {
font-size: 1em; /* 18px */
line-height: 1.3334em; /* 24px/18px */
margin-bottom: 1.3334em; /* 24px/18px */
}
h1 {
font-size: 2.6667em; /* 48px/18px */
line-height: 1em; /* 48px/48px */
padding: 0.25em 0; /* 12px/48px * 2 (Use padding instead of margin to maintain proximity with paragraph) */
}
h2 {
font-size: 2em; /* 36px/18px */
line-height: 1.3334em; /* 48px/36px */
padding: 0.66667em 0 0 0; /* 12px/36px * 2, pnly top (Use padding instead of margin to maintain proximity with paragraph) */
}
h3, h4, h5, h6 {
font-size: 1.3334em; /* 24px/18px */
line-height: 1em; /* 24px/24px */
padding: 0.5em 0; /* 12px/24px * 2 (Use padding instead of margin to maintain proximity with paragraph) */
}
blockquote {
font-style: italic;
margin: 1.3334em; /* 24px/18px */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
background-color: darken($background-color, 5%);
padding: 0 1.33334em; /* 24px/18px */
p, ul, ol {
padding: 1.33334em 0; /* 24px/18px */
}
}
}

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -2,6 +2,8 @@
use Auth\XmppAdapter;
use Auth\XmppValidator;
use Jralph\Twig\Markdown\Extension;
use Jralph\Twig\Markdown\Parsedown\ParsedownExtraMarkdown;
use Slim\Http\Request;
use Slim\Http\Response;
@ -22,7 +24,7 @@ $app = new Slim\App(['settings' => Config::$CONFIG['slim_settings']]);
$container = $app->getContainer();
// Environment
$env = EnvironmentHelper::getAppEnvironment();
$env = BootstrapHelper::bootEnvironment();
$container['env'] = function() use ($env) {
return $env;
};
@ -33,20 +35,20 @@ $container['config'] = function() {
};
// Database
$capsule = DatabaseHelper::getAppDatabase();
$capsule = BootstrapHelper::bootDatabase();
$container['db'] = function () use ($capsule) {
return $capsule;
};
// Translation
$translator = TranslationHelper::getAppTranslator();
$translator = BootstrapHelper::bootTranslator();
$container['translator'] = function () use ($translator) {
return $translator;
};
// Logger
$container['logger'] = function () {
$logger = LoggerHelper::getAppLogger();
$logger = BootstrapHelper::bootLogger();
return $logger;
};
@ -83,6 +85,9 @@ $container['view'] = function ($container) use ($translator) {
$view['flash'] = $container['flash'];
$view['config'] = $container['config'];
$view['currentUser'] = ($container['authenticator']->hasIdentity() ? $container['authenticator']->getIdentity() : NULL); // currentUser in Twig
$view->addExtension(new Extension( // markdown
new ParsedownExtraMarkdown
));
return $view;
};

6444
public/js/bootstrap.bundle.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

7
public/js/bootstrap.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3927
public/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

7
public/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
public/js/custom.js Normal file
View file

@ -0,0 +1,3 @@
$(".alert-danger").delay(30000).fadeOut(300);
$(".alert-success").delay(10000).fadeOut(300);
$(".alert-info").delay(10000).fadeOut(300);

File diff suppressed because one or more lines are too long

10364
public/js/jquery.js vendored Normal file

File diff suppressed because it is too large Load diff

2
public/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/jquery.min.map Normal file

File diff suppressed because one or more lines are too long

5
public/js/jquery.modal.min.js vendored Normal file
View file

@ -0,0 +1,5 @@
/*
A simple jQuery modal (http://github.com/kylefox/jquery-modal)
Version 0.9.1
*/
!function(o){"object"==typeof module&&"object"==typeof module.exports?o(require("jquery"),window,document):o(jQuery,window,document)}(function(o,t,i,e){var s=[],l=function(){return s.length?s[s.length-1]:null},n=function(){var o,t=!1;for(o=s.length-1;o>=0;o--)s[o].$blocker&&(s[o].$blocker.toggleClass("current",!t).toggleClass("behind",t),t=!0)};o.modal=function(t,i){var e,n;if(this.$body=o("body"),this.options=o.extend({},o.modal.defaults,i),this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10)),this.$blocker=null,this.options.closeExisting)for(;o.modal.isActive();)o.modal.close();if(s.push(this),t.is("a"))if(n=t.attr("href"),this.anchor=t,/^#/.test(n)){if(this.$elm=o(n),1!==this.$elm.length)return null;this.$body.append(this.$elm),this.open()}else this.$elm=o("<div>"),this.$body.append(this.$elm),e=function(o,t){t.elm.remove()},this.showSpinner(),t.trigger(o.modal.AJAX_SEND),o.get(n).done(function(i){if(o.modal.isActive()){t.trigger(o.modal.AJAX_SUCCESS);var s=l();s.$elm.empty().append(i).on(o.modal.CLOSE,e),s.hideSpinner(),s.open(),t.trigger(o.modal.AJAX_COMPLETE)}}).fail(function(){t.trigger(o.modal.AJAX_FAIL);var i=l();i.hideSpinner(),s.pop(),t.trigger(o.modal.AJAX_COMPLETE)});else this.$elm=t,this.anchor=t,this.$body.append(this.$elm),this.open()},o.modal.prototype={constructor:o.modal,open:function(){var t=this;this.block(),this.anchor.blur(),this.options.doFade?setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay):this.show(),o(i).off("keydown.modal").on("keydown.modal",function(o){var t=l();27===o.which&&t.options.escapeClose&&t.close()}),this.options.clickClose&&this.$blocker.click(function(t){t.target===this&&o.modal.close()})},close:function(){s.pop(),this.unblock(),this.hide(),o.modal.isActive()||o(i).off("keydown.modal")},block:function(){this.$elm.trigger(o.modal.BEFORE_BLOCK,[this._ctx()]),this.$body.css("overflow","hidden"),this.$blocker=o('<div class="'+this.options.blockerClass+' blocker current"></div>').appendTo(this.$body),n(),this.options.doFade&&this.$blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(o.modal.BLOCK,[this._ctx()])},unblock:function(t){!t&&this.options.doFade?this.$blocker.fadeOut(this.options.fadeDuration,this.unblock.bind(this,!0)):(this.$blocker.children().appendTo(this.$body),this.$blocker.remove(),this.$blocker=null,n(),o.modal.isActive()||this.$body.css("overflow",""))},show:function(){this.$elm.trigger(o.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=o('<a href="#close-modal" rel="modal:close" class="close-modal '+this.options.closeClass+'">'+this.options.closeText+"</a>"),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker),this.options.doFade?this.$elm.css({opacity:0,display:"inline-block"}).animate({opacity:1},this.options.fadeDuration):this.$elm.css("display","inline-block"),this.$elm.trigger(o.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(o.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove();var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(o.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||o('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,$elm:this.$elm,$blocker:this.$blocker,options:this.options}}},o.modal.close=function(t){if(o.modal.isActive()){t&&t.preventDefault();var i=l();return i.close(),i.$elm}},o.modal.isActive=function(){return s.length>0},o.modal.getCurrent=l,o.modal.defaults={closeExisting:!0,escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",blockerClass:"jquery-modal",spinnerHtml:'<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>',showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},o.modal.BEFORE_BLOCK="modal:before-block",o.modal.BLOCK="modal:block",o.modal.BEFORE_OPEN="modal:before-open",o.modal.OPEN="modal:open",o.modal.BEFORE_CLOSE="modal:before-close",o.modal.CLOSE="modal:close",o.modal.AFTER_CLOSE="modal:after-close",o.modal.AJAX_SEND="modal:ajax:send",o.modal.AJAX_SUCCESS="modal:ajax:success",o.modal.AJAX_FAIL="modal:ajax:fail",o.modal.AJAX_COMPLETE="modal:ajax:complete",o.fn.modal=function(t){return 1===this.length&&new o.modal(this,t),this},o(i).on("click.modal",'a[rel~="modal:close"]',o.modal.close),o(i).on("click.modal",'a[rel~="modal:open"]',function(t){t.preventDefault(),o(this).modal()})});

8269
public/js/jquery.slim.js Normal file

File diff suppressed because it is too large Load diff

2
public/js/jquery.slim.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,41 +0,0 @@
var normal = document.getElementById("nav-menu");
var reverse = document.getElementById("nav-menu-left");
var icon = normal !== null ? normal : reverse;
// Toggle the "menu-open" % "menu-opn-left" classes
function toggle() {
var navRight = document.getElementById("nav");
var navLeft = document.getElementById("nav-left");
var nav = navRight !== null ? navRight : navLeft;
var button = document.getElementById("menu");
var site = document.getElementById("wrap");
if (nav.className == "menu-open" || nav.className == "menu-open-left") {
nav.className = "";
button.className = "";
site.className = "";
} else if (reverse !== null) {
nav.className += "menu-open-left";
button.className += "btn-close";
site.className += "fixed";
} else {
nav.className += "menu-open";
button.className += "btn-close";
site.className += "fixed";
}
}
// Ensures backward compatibility with IE old versions
function menuClick() {
if (document.addEventListener && icon !== null) {
icon.addEventListener('click', toggle);
} else if (document.attachEvent && icon !== null) {
icon.attachEvent('onclick', toggle);
} else {
return;
}
}
menuClick();

View file

@ -30,14 +30,14 @@ final class DeleteAction
if ($request->isPost()) {
// Form validation
$validator = new Validator();
$validator = new ValidationHelper();
$validator->filter_rules([
'username' => 'trim|sanitize_string',
'delete_code' => 'trim|sanitize_string',
'username' => 'trim|sanitize_string',
'delete_code' => 'trim|sanitize_string',
]);
$validator->validation_rules([
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'delete_code' => 'required|exact_len,64',
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'delete_code' => 'required|exact_len,64',
]);
if (!$validator->run($body)) {
$validator->addErrorsToFlashMessage($this->flash);
@ -77,7 +77,7 @@ final class DeleteAction
// render GET
$this->view->render($response, 'delete.twig', [
'title' => $this->translator->trans('delete.title'),
'title' => $this->translator->trans('delete.title'),
]);
return $response;

View file

@ -1,10 +1,10 @@
<?php
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class ForbiddenAction
@ -25,8 +25,8 @@ final class ForbiddenAction
public function __invoke(Request $request, Response $response, $args)
{
return $this->view->render($response, 'error.twig', [
'title' => $this->translator->trans('error.403.title'),
'content' => $this->translator->trans('error.403.content')
'title' => $this->translator->trans('error.403.title'),
'content' => $this->translator->trans('error.403.content')
]);
}
}

View file

@ -1,10 +1,10 @@
<?php
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class HomeAction
@ -25,8 +25,8 @@ final class HomeAction
public function __invoke(Request $request, Response $response, $args)
{
return $this->view->render($response, 'home.twig', [
'title' => $this->translator->trans('home.title'),
'content' => $this->translator->trans('home.text', ['%server%' => getenv('site_xmpp_server_displayname')])
'title' => $this->translator->trans('home.title'),
'content' => $this->translator->trans('home.text', ['%server%' => getenv('site_xmpp_server_displayname')])
]);
}
}

View file

@ -1,10 +1,10 @@
<?php
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class InternalApplicationError
@ -25,8 +25,8 @@ final class InternalApplicationError
public function __invoke(Request $request, Response $response, $args)
{
return $this->view->render($response, 'error.twig', [
'title' => $this->translator->trans('error.500.title'),
'content' => $this->translator->trans('error.500.content')
'title' => $this->translator->trans('error.500.title'),
'content' => $this->translator->trans('error.500.content')
]);
}
}

View file

@ -1,11 +1,11 @@
<?php
use JeremyKendall\Slim\Auth\Authenticator;
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class LoginAction
@ -32,20 +32,20 @@ final class LoginAction
if ($request->isPost()) {
// Form validation
$validator = new Validator();
$validator = new ValidationHelper();
$validator->filter_rules([
'username' => 'trim|sanitize_string',
'username' => 'trim|sanitize_string',
]);
$validator->validation_rules([
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'password' => 'required|max_len,255|min_len,8',
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'password' => 'required|max_len,255|min_len,8',
]);
if (!$validator->run($body)) {
$validator->addErrorsToFlashMessage($this->flash);
return $response->withRedirect('/login');
}
$username = $body['username'];
$username = trim(strtolower($body['username']));
$password = $body['password'];
$result = $this->auth->authenticate($username, $password);
@ -70,7 +70,7 @@ final class LoginAction
// render GET
$this->view->render($response, 'login.twig', [
'title' => $this->translator->trans('login.title'),
'title' => $this->translator->trans('login.title'),
]);
}
}

View file

@ -1,11 +1,11 @@
<?php
use JeremyKendall\Slim\Auth\Authenticator;
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class LogoutAction

View file

@ -1,10 +1,10 @@
<?php
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class NotAuthorizedAction
@ -25,8 +25,8 @@ final class NotAuthorizedAction
public function __invoke(Request $request, Response $response, $args)
{
return $this->view->render($response, 'error.twig', [
'title' => $this->translator->trans('error.401.title'),
'content' => $this->translator->trans('error.401.content')
'title' => $this->translator->trans('error.401.title'),
'content' => $this->translator->trans('error.401.content')
]);
}
}

View file

@ -1,10 +1,10 @@
<?php
use Slim\Flash\Messages;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class NotFoundAction
@ -25,8 +25,8 @@ final class NotFoundAction
public function __invoke(Request $request, Response $response, $args)
{
return $this->view->render($response, 'error.twig', [
'title' => $this->translator->trans('error.404.title'),
'content' => $this->translator->trans('error.404.content')
'title' => $this->translator->trans('error.404.title'),
'content' => $this->translator->trans('error.404.content')
]);
}
}

View file

@ -33,9 +33,9 @@ final class PasswordAction
if ($request->isPost()) {
// Form validation
$validator = new Validator();
$validator = new ValidationHelper();
$validator->validation_rules([
'password' => 'required|max_len,255|min_len,8',
'password' => 'required|max_len,255|min_len,8',
'password_confirmation' => 'required|max_len,255|min_len,8',
]);
if (!$validator->run($body)) {
@ -75,7 +75,7 @@ final class PasswordAction
// render GET
$this->view->render($response, 'password.twig', [
'title' => $this->translator->trans('password.title'),
'title' => $this->translator->trans('password.title'),
]);
return $response;

View file

@ -1,12 +1,12 @@
<?php
use Curl\Curl;
use Slim\Flash\Messages;
use Slim\Interfaces\RouterInterface;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Slim\Flash\Messages;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Interfaces\RouterInterface;
use Slim\Views\Twig;
use Symfony\Component\Translation\Translator;
final class SignUpAction
@ -33,23 +33,24 @@ final class SignUpAction
if ($request->isPost()) {
// Form validation
$validator = new Validator();
$validator = new ValidationHelper();
$validator->filter_rules([
'username' => 'trim|sanitize_string',
'email' => 'trim|sanitize_email',
'username' => 'trim|sanitize_string',
'email' => 'trim|sanitize_email',
]);
$validator->validation_rules([
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'email' => 'required|valid_email|max_len,64|min_len,5',
'password' => 'required|max_len,255|min_len,8',
'username' => 'required|alpha_numeric|max_len,64|min_len,3',
'email' => 'required|valid_email|max_len,64|min_len,5',
'password' => 'required|max_len,255|min_len,8',
'legal' => 'required|boolean'
]);
if (!$validator->run($body)) {
$validator->addErrorsToFlashMessage($this->flash);
return $response->withRedirect('signup');
}
$username = $body['username'];
$email = $body['email'];
$username = trim(strtolower($body['username']));
$email = trim(strtolower($body['email']));
$password = $body['password'];
// waiting queue
@ -108,7 +109,7 @@ final class SignUpAction
$verificationLink = $request->getUri()->getScheme();
$verificationLink .= '://';
$verificationLink .= $request->getUri()->getHost();
$verificationLink .= (!empty($p = $request->getUri()->getPort()) ? ':' .$p : '');
$verificationLink .= (!empty($p = $request->getUri()->getPort()) ? ':' . $p : '');
$verificationLink .= $this->router->pathFor('verification', ['verificationCode' => $userAwaiting->verification_code]);
$mailer->Subject = $this->translator->trans('verification.mail.subject', ['%server%' => getenv('site_xmpp_server_displayname')]);
@ -120,9 +121,19 @@ final class SignUpAction
return $response->withRedirect('signup');
}
// legal information
$legalFilePath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR;
if ($legalFile = file_exists($legalFilePath . 'legal.md')) {
$legalFileContent = file_get_contents($legalFilePath . 'legal.md');
} else {
$legalFileContent = file_get_contents($legalFilePath . 'legal.example.md');
}
// render GET
$this->view->render($response, 'signup.twig', [
'title' => $this->translator->trans('sign.up.title'),
'title' => $this->translator->trans('sign.up.title'),
'legal' => $legalFileContent
]);
return $response;

View file

@ -49,7 +49,7 @@ final class VerificationAction
$userAwaiting->delete();
return $response->withRedirect('signup');
} else if ($curl->http_status_code == 201) {
$this->flash->addMessage('success', $this->translator->trans('verification.flash.success', ['%username%' => $userAwaiting->username]));
$this->flash->addMessage('success', $this->translator->trans('verification.flash.success', ['%username%' => $userAwaiting->username, '%server%' => getenv('site_xmpp_server_displayname')]));
$this->logger->info($this->translator->trans('log.verification.sucess', ['%username%' => $userAwaiting->username]));
if (getenv('mail_notify') == true) {
@ -90,7 +90,7 @@ final class VerificationAction
$mailer->FromName = getenv('mail_from_name');
$mailer->addAddress($userAwaiting->email);
$mailer->Subject = $this->translator->trans('verification.mail.success.subject', ['%server%' => getenv('site_xmpp_server_displayname')]);
$mailer->Body = $this->translator->trans('verification.mail.success.body', ['%username%' => $userAwaiting->username, '%server%' => getenv('site_xmpp_server_displayname'), '%password%' => $userAwaiting->password, '%deleteCode%' => $userRegistered->delete_code]);
$mailer->Body = $this->translator->trans('verification.mail.success.body', ['%username%' => $userAwaiting->username, '%server%' => getenv('site_xmpp_server_displayname'), '%deleteCode%' => $userRegistered->delete_code]);
$mailer->send();
$userAwaiting->delete();

View file

@ -1,4 +1,5 @@
<?php
use Illuminate\Database\Eloquent\Model;
class UserAwaitingVerification extends Model

View file

@ -1,4 +1,5 @@
<?php
use Illuminate\Database\Eloquent\Model;
class UserRegistered extends Model

View file

@ -7,7 +7,6 @@ use Fabiang\Xmpp\Client;
use Fabiang\Xmpp\Exception\Stream\AuthenticationErrorException;
use Fabiang\Xmpp\Options;
use Psr\Log\LoggerInterface;
use UserRegistered;
use Zend\Authentication\Adapter\AbstractAdapter;
use Zend\Authentication\Result;
@ -64,12 +63,6 @@ class XmppAdapter extends AbstractAdapter
$client = new Client($options);
try {
/*$userRegistered = UserRegistered::with([])->find($this->getIdentity());
if (empty($userRegistered)) {
throw new AuthenticationErrorException;
}*/
$client->connect();
} catch (AuthenticationErrorException $e) {

View file

@ -0,0 +1,128 @@
<?php
use Dotenv\Dotenv;
use Illuminate\Database\Capsule\Manager;
use Monolog\Logger;
use Symfony\Component\Translation\Loader\YamlFileLoader;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Translator;
class BootstrapHelper
{
/**
* Bootstraps eloquent database
*
* @return \Illuminate\Database\Capsule\Manager
*/
public static function bootDatabase()
{
$config = Config::$CONFIG['db_settings'];
$path = $config['database'];
// create database file of non-existent
if (!file_exists($path)) {
fopen($path, 'w') or die('Unable to write database file.');
}
$capsule = new Manager();
$capsule->addConnection([
'driver' => $config['driver'],
'database' => $path,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
], 'default');
$capsule->setAsGlobal();
$capsule->bootEloquent();
return $capsule;
}
/**
* Bootstrap env variables
*
* @return array
* @throws Exception
*/
public static function bootEnvironment()
{
$envPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config';
$envFile = 'env';
$exists = is_file($envPath . DIRECTORY_SEPARATOR . $envFile);
if (!$exists) {
die('Configure your environment in ' . $envPath . '.');
} else {
$env = new Dotenv($envPath, $envFile);
$res = $env->load();
return $res;
}
}
/**
* Bootstrap translator
*
* @return Translator
*/
public static function bootTranslator()
{
$translator = new Translator('en_EN', new MessageSelector());
$translator->addLoader('yaml', new YamlFileLoader());
$translator->addResource('yaml', __DIR__ . DIRECTORY_SEPARATOR . '../../data/locale/messages.en.yml', 'en_EN');
$translator->setFallbackLocales(['en']);
return $translator;
}
/**
* Bootstrap logger
*
* @return \Monolog\Logger
*/
public static function bootLogger()
{
$logName = getenv('log_name');
$logLevel = getenv('log_level');
switch ($logLevel) {
case 'DEBUG':
$logLevelTranslated = Logger::DEBUG;
break;
case 'INFO':
$logLevelTranslated = Logger::INFO;
break;
case 'NOTICE':
$logLevelTranslated = Logger::NOTICE;
break;
case 'WARNING':
$logLevelTranslated = Logger::WARNING;
break;
case 'ERROR';
$logLevelTranslated = Logger::ERROR;
break;
case 'CRITICAL':
$logLevelTranslated = Logger::CRITICAL;
break;
case 'ALERT':
$logLevelTranslated = Logger::ALERT;
break;
case 'EMERGENCY':
$logLevelTranslated = Logger::EMERGENCY;
break;
default:
$logLevelTranslated = Logger::DEBUG;
}
$logPath = Config::$CONFIG['logger_settings']['path'];
$logger = new Monolog\Logger($logName);
$logger->pushProcessor(new \Monolog\Processor\UidProcessor());
$logger->pushHandler(new \Monolog\Handler\StreamHandler($logPath, $logLevelTranslated));
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler(NULL, $logLevelTranslated));
return $logger;
}
}

View file

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Capsule\Manager;
class DatabaseHelper
{
public static function getAppDatabase()
{
$config = Config::$CONFIG['db_settings'];
$path = $config['database'];
// create database file of non-existent
if (!file_exists($path)) {
fopen($path, 'w') or die('Unable to write database file.');
}
$capsule = new Manager();
$capsule->addConnection([
'driver' => $config['driver'],
'database' => $path,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
], 'default');
$capsule->setAsGlobal();
$capsule->bootEloquent();
return $capsule;
}
}

View file

@ -6,6 +6,7 @@ class DateHelper
{
/**
* Returns param if already carbon, else formats with Y-m-d H:i:s
*
* @param $date
* @return Carbon|false
*/

View file

@ -1,25 +0,0 @@
<?php
use Dotenv\Dotenv;
class EnvironmentHelper
{
/**
* @return array
* @throws Exception
*/
public static function getAppEnvironment()
{
$envPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config';
$envFile = 'env';
$exists = is_file($envPath . DIRECTORY_SEPARATOR . $envFile);
if (!$exists) {
die('Configure your environment in ' . $envPath . '.');
} else {
$env = new Dotenv($envPath, $envFile);
$res = $env->load();
return $res;
}
}
}

View file

@ -1,14 +0,0 @@
<?php
class LoggerHelper
{
public static function getAppLogger()
{
$config = Config::$CONFIG['logger_settings'];
$logger = new Monolog\Logger($config['name']);
$logger->pushProcessor(new Monolog\Processor\UidProcessor());
$logger->pushHandler(new Monolog\Handler\StreamHandler($config['path'], Config::$CONFIG['logger_settings']['level']));
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler(NULL, Config::$CONFIG['logger_settings']['level']));
return $logger;
}
}

View file

@ -1,21 +0,0 @@
<?php
use Symfony\Component\Translation\Loader\YamlFileLoader;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Translator;
class TranslationHelper
{
/**
* @return Translator
*/
public static function getAppTranslator()
{
$translator = new Translator('en_EN', new MessageSelector());
$translator->addLoader('yaml', new YamlFileLoader());
$translator->addResource('yaml', __DIR__ . DIRECTORY_SEPARATOR . '../../data/locale/messages.en.yml', 'en_EN');
$translator->setFallbackLocales(['en']);
return $translator;
}
}

View file

@ -4,68 +4,119 @@
* Class Validator
* @see Gump for use
*/
class Validator extends GUMP
class ValidationHelper extends GUMP
{
private $translator;
public function __construct()
{
$this->translator = TranslationHelper::getAppTranslator();
}
/** Validates if $field content is equal to $param
* @param $field
* @param $input
* @param $param
* @return bool
*/
protected function validate_equals($field, $input, $param)
{
$err = [
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
];
if (!isset($input[$field]) || empty($input[$field]) || empty($param) || !isset($param)) {
return $err;
}
if ($input[$field] != $param || $input[$field] !== $param) {
return $err;
}
return true;
$this->translator = BootstrapHelper::bootTranslator();
}
/**
* Validates if array has min size, defaults to size = 1
* @param $field
* @param $input
* @param null $param
* @return array|bool
* Perform data validation against the provided ruleset
*
* Arrays as FIELDS are added here as a custom feature
*
* @access public
* @param mixed $input
* @param array $ruleset
* @return mixed
* @throws \Exception
*/
protected function validate_set_min_len($field, $input, $param = NULL)
public function validate(array $input, array $ruleset)
{
$this->errors = [];
$err = [
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
];
foreach ($ruleset as $field => $rules) {
#if(!array_key_exists($field, $input))
#{
# continue;
#}
if (!is_array($input[$field])) {
return $err;
$rules = explode('|', $rules);
if (in_array("required", $rules) || (isset($input[$field]) && (is_array($input[$field]) || trim($input[$field]) != ''))) {
foreach ($rules as $rule) {
$method = NULL;
$param = NULL;
if (strstr($rule, ',') !== false) // has params
{
$rule = explode(',', $rule);
$method = 'validate_' . $rule[0];
$param = $rule[1];
$rule = $rule[0];
} else {
$method = 'validate_' . $rule;
}
// array required
if ($rule === "required" && !isset($input[$field])) {
$result = $this->$method($field, $input, $param);
$this->errors[] = $result;
return;
}
if (is_callable([$this, $method])) {
$result = $this->$method($field, $input, $param);
if (is_array($result)) // Validation Failed
{
$this->errors[] = $result;
return $this->errors;
}
} else {
if (isset(self::$validation_methods[$rule])) {
if (isset($input[$field])) {
$result = call_user_func(self::$validation_methods[$rule], $field, $input, $param);
$result = $this->$method($field, $input, $param);
if (is_array($result)) // Validation Failed
{
$this->errors[] = $result;
return $this->errors;
}
}
} else {
throw new \Exception("Validator method '$method' does not exist.");
}
}
}
}
}
// default value
if (empty($param)) $param = 1;
return (count($this->errors) > 0) ? $this->errors : true;
}
if (count($input[$field]) < $param) return $err;
public function filter_upper($value, $param = NULL)
{
return strtoupper($value);
}
return true;
public function filter_lower($value, $param = NULL)
{
return strtolower($value);
}
/**
* Converts all error array into a single string
* @return void
*/
public function addErrorsToFlashMessage($flash)
{
$errors = $this->get_errors_array(true);
if (!empty($errors)) {
foreach ($errors as $error) {
$flash->addMessage('error', $error);
}
}
}
/**
@ -179,109 +230,58 @@ class Validator extends GUMP
return $resp;
}
/**
* Perform data validation against the provided ruleset
*
* Arrays as FIELDS are added here as a custom feature
*
* @access public
* @param mixed $input
* @param array $ruleset
* @return mixed
* @throws \Exception
/** Validates if $field content is equal to $param
* @param $field
* @param $input
* @param $param
* @return bool
*/
public function validate(array $input, array $ruleset)
protected function validate_equals($field, $input, $param)
{
$this->errors = [];
$err = [
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
];
foreach ($ruleset as $field => $rules) {
#if(!array_key_exists($field, $input))
#{
# continue;
#}
$rules = explode('|', $rules);
if (in_array("required", $rules) || (isset($input[$field]) && (is_array($input[$field]) || trim($input[$field]) != ''))) {
foreach ($rules as $rule) {
$method = NULL;
$param = NULL;
if (strstr($rule, ',') !== false) // has params
{
$rule = explode(',', $rule);
$method = 'validate_' . $rule[0];
$param = $rule[1];
$rule = $rule[0];
} else {
$method = 'validate_' . $rule;
}
// array required
if ($rule === "required" && !isset($input[$field])) {
$result = $this->$method($field, $input, $param);
$this->errors[] = $result;
return;
}
if (is_callable([$this, $method])) {
$result = $this->$method($field, $input, $param);
if (is_array($result)) // Validation Failed
{
$this->errors[] = $result;
return $this->errors;
}
} else {
if (isset(self::$validation_methods[$rule])) {
if (isset($input[$field])) {
$result = call_user_func(self::$validation_methods[$rule], $field, $input, $param);
$result = $this->$method($field, $input, $param);
if (is_array($result)) // Validation Failed
{
$this->errors[] = $result;
return $this->errors;
}
}
} else {
throw new \Exception("Validator method '$method' does not exist.");
}
}
}
}
if (!isset($input[$field]) || empty($input[$field]) || empty($param) || !isset($param)) {
return $err;
}
return (count($this->errors) > 0) ? $this->errors : true;
}
if ($input[$field] != $param || $input[$field] !== $param) {
return $err;
}
public function filter_upper($value, $param = NULL)
{
return strtoupper($value);
}
public function filter_lower($value, $param = NULL)
{
return strtolower($value);
return true;
}
/**
* Converts all error array into a single string
* @return void
* Validates if array has min size, defaults to size = 1
* @param $field
* @param $input
* @param null $param
* @return array|bool
*/
public function addErrorsToFlashMessage($flash)
protected function validate_set_min_len($field, $input, $param = NULL)
{
$errors = $this->get_errors_array(true);
if (!empty($errors)) {
foreach ($errors as $error) {
$flash->addMessage('error', $error);
}
$err = [
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
];
if (!is_array($input[$field])) {
return $err;
}
// default value
if (empty($param)) $param = 1;
if (count($input[$field]) < $param) return $err;
return true;
}
}

View file

@ -1,123 +1,114 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<!-- Meta -->
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<head>
<title>{{ title }}</title>
<!-- Meta -->
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<!-- CSS & fonts -->
<link rel="stylesheet" href="{{ base_url() }}/css/main.css">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,900,400italic%7CSignika:700,300,400,600' rel='stylesheet' type='text/css'>
<!-- CSS & fonts -->
<link rel="stylesheet" href="{{ base_url() }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ base_url() }}/css/font-awesome.css">
<script src="https://use.fontawesome.com/82b8dead7b.js"></script>
<!-- Custom styles for this template -->
<link rel="stylesheet" href="{{ base_url() }}/css/custom.css"/>
</head>
<body>
<!-- jQuery -->
<script src="{{ base_url() }}/js/jquery-1.10.2.min.js"></script>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_title') }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
</head>
<body>
<div id="wrap">
<!-- Navigation -->
<nav id="nav-left">
<div id="nav-list">
<a href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a>
</li>
<!-- current user -->
{% if currentUser is not empty %}
<a href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a>
<a href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a>
</li>
{% else %}
<a href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a>
<a href="{{ base_url() }}{{ path_for('login') }}">{{ getenv('site_navbar_login_displayname') }}</a>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('login') }}">{{ getenv('site_navbar_login_displayname') }}</a>
</li>
{% endif %}
{% if getenv('site_navbar_backlink_enabled') == 'true' %}
<br />
<br />
<a href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a>
<li class="nav-item">
<a class="nav-link"
href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a>
</li>
{% endif %}
</div>
{% if currentUser is not empty %}
<!-- Nav footer -->
<!-- current user show -->
{% if currentUser is not empty %}
<footer>
{% trans with {'%username%': currentUser.identity, '%server%': getenv('site_xmpp_server_displayname') } %}logged.in.site{% endtrans %}
<a href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a>
</footer>
<li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a>
</li>
<li class="nav-item disabled">
<a class="nav-link">{% trans with {'%username%': currentUser.identity, '%server%': getenv('site_xmpp_server_displayname') } %}logged.in.site{% endtrans %}</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
<!-- Main content -->
<div class="container">
{% if flash is not empty %}
<div id="flashMessage">
{% if flash.getMessage('info').0 %}
<div class="alert alert-info">
{{ flash.getMessage('info').0 }}
</div>
{% endif %}
{% if flash.getMessage('success').0 %}
<div class="alert alert-success">
{{ flash.getMessage('success').0 }}
</div>
{% endif %}
</nav>
<!-- Icon menu -->
<a id="nav-menu-left">
<div id="menu"></div>
</a>
<!-- Header -->
<header id="header">
<a href="/">
<h1>{{ getenv('site_title') }}</h1>
</a>
</header>
<!-- Main content -->
<div id="container">
<main>
<!-- flash messages -->
{% if flash is not empty %}
<div id="flashMessage">
{% if flash.getMessage('info').0 %}
<div class="alert alert-info">
{{ flash.getMessage('info').0 }}
</div>
{% endif %}
{% if flash.getMessage('success').0 %}
<div class="alert alert-success">
{{ flash.getMessage('success').0 }}
</div>
{% endif %}
{% if flash.getMessage('error') %}
{% for error in flash.getMessage('error') %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endfor %}
{% endif %}
{% if flash.getMessage('error') %}
{% for error in flash.getMessage('error') %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endif %}
<!-- content -->
{% block content %}
{% endblock %}
</main>
{% endfor %}
{% endif %}
</div>
{% endif %}
<!-- Footer -->
<!--<footer><span></span></footer>-->
{% block content %}
{% endblock %}
</div>
<!-- Script -->
<script src="{{ base_url() }}/js/main.js"></script>
<!-- Script -->
<script src="{{ base_url() }}/js/jquery.min.js"></script>
<script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script>
<script src="{{ base_url() }}/js/custom.js"></script>
<script>
$(".alert-danger" ).delay(30000).fadeOut(300);
$(".alert-success" ).delay(10000).fadeOut(300);
$(".alert-info" ).delay(10000).fadeOut(300);
</script>
</div>
</body>
</body>
</html>

View file

@ -1,15 +1,36 @@
{% extends 'base.twig' %}
{% block content %}
<form class="" role="form" name="delete" id="delete" method="post">
<h1>{{ title }}</h1>
<form role="form" name="delete" id="delete" method="post">
<div class="control-group form-group">
<h1>{{ title }}</h1>
<label for="username">{% trans %}delete.form.username{% endtrans %}</label><br/>
<input type="text" id="username" name="username" class="" placeholder="{% trans %}delete.form.username.placeholder{% endtrans %}" value="" autofocus required> @{{ getenv('site_xmpp_server_displayname') }}
<br/><br/>
<label for="deletion_code">{% trans %}delete.form.delete_code{% endtrans %}</label><br/>
<input type="text" id="delete_code" name="delete_code" class="" placeholder="{% trans %}delete.form.delete_code.placeholder{% endtrans %}" value="" autofocus required>
<br/><br/>
<input class="" type="submit" name="delete" value="{% trans %}delete.form.button{% endtrans %}"/>
<div class="form-group row">
<label class="col-2 col-form-label" for="username">{% trans %}delete.form.username{% endtrans %}</label>
<div class="col-7">
<input type="text" id="username" name="username" class="form-control"
placeholder="{% trans %}delete.form.username.placeholder{% endtrans %}" value="" autofocus
required>
</div>
<div class="col-3">
@{{ getenv('site_xmpp_server_displayname') }}
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label"
for="delete_code">{% trans %}delete.form.delete_code{% endtrans %}</label>
<div class="col-10">
<input aria-describedby="help" type="text" id="delete_code" name="delete_code" class="form-control"
placeholder="{% trans %}delete.form.delete_code.placeholder{% endtrans %}" value="" autofocus
required>
<small id="help"
class="form-text text-muted">{% trans %}delete.form.delete_code.help{% endtrans %}</small>
</div>
</div>
<br/>
<input class="btn btn-primary" type="submit" name="delete_button"
value="{% trans %}delete.form.button{% endtrans %}"/>
</div>
</form>
{% endblock %}

View file

@ -3,6 +3,6 @@
{% block content %}
<h1 class="header">{{ title }}</h1>
{{ content|nl2br }}
{{ content|raw }}
{% endblock %}

View file

@ -1,15 +1,32 @@
{% extends 'base.twig' %}
{% block content %}
<form class="" role="form" name="register" id="register" method="post">
<h1>{{ title }}</h1>
<form role="form" name="register" id="register" method="post">
<div class="control-group form-group">
<h1>{{ title }}</h1>
<label for="username">{% trans %}login.form.username{% endtrans %}</label><br/>
<input type="text" id="username" name="username" class="" placeholder="{% trans %}login.form.username.placeholder{% endtrans %}" value="" autofocus required> @{{ getenv('site_xmpp_server_displayname') }}
<br/><br/>
<label for="username">{% trans %}login.form.password{% endtrans %}</label><br/>
<input type="password" id="password" name="password" class="form-control" placeholder="{% trans %}login.form.password.placeholder{% endtrans %}" required>
<br/><br/>
<input class="" type="submit" name="login" value="{% trans %}login.form.button{% endtrans %}"/>
<div class="form-group row">
<label class="col-2 col-form-label" for="username">{% trans %}login.form.username{% endtrans %}</label>
<div class="col-7">
<input class="form-control" type="text" id="username" name="username"
placeholder="{% trans %}login.form.username.placeholder{% endtrans %}" value="" autofocus
required>
</div>
<div class="col-3">
@{{ getenv('site_xmpp_server_displayname') }}
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label" for="username">{% trans %}login.form.password{% endtrans %}</label>
<div class="col-10">
<input type="password" id="password" name="password" class="form-control"
placeholder="{% trans %}login.form.password.placeholder{% endtrans %}" required>
</div>
</div>
<br/>
<input class="btn btn-primary" type="submit" name="login"
value="{% trans %}login.form.button{% endtrans %}"/>
</div>
</form>
{% endblock %}

View file

@ -1,15 +1,30 @@
{% extends 'base.twig' %}
{% block content %}
<form class="" role="form" name="password" id="password" method="post">
<h1>{{ title }}</h1>
<form role="form" name="password" id="password" method="post">
<div class="control-group form-group">
<h1>{{ title }}</h1>
<label for="password">{% trans %}password.form.password{% endtrans %}</label><br/>
<input type="password" id="password" name="password" class="form-control" placeholder="{% trans %}password.form.password.placeholder{% endtrans %}" required>
<br/><br/>
<label for="password_confirmation">{% trans %}password.form.password_confirmation{% endtrans %}</label><br/>
<input type="password" id="password_confirmation" name="password_confirmation" class="form-control" placeholder="{% trans %}password.form.password_confirmation.placeholder{% endtrans %}" required>
<br/><br/>
<input class="" type="submit" name="password_change" value="{% trans %}password.form.button{% endtrans %}"/>
<div class="form-group row">
<label class="col-2 col-form-label"
for="password">{% trans %}password.form.password{% endtrans %}</label>
<div class="col-10">
<input type="password" id="password" name="password" class="form-control"
placeholder="{% trans %}password.form.password.placeholder{% endtrans %}" required>
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label"
for="password_confirmation">{% trans %}password.form.password_confirmation{% endtrans %}</label>
<div class="col-10">
<input type="password" id="password_confirmation" name="password_confirmation" class="form-control"
placeholder="{% trans %}password.form.password_confirmation.placeholder{% endtrans %}"
required>
</div>
</div>
<br/>
<input class="btn btn-primary" type="submit" name="password_change"
value="{% trans %}password.form.button{% endtrans %}"/>
</div>
</form>
{% endblock %}

View file

@ -1,18 +1,72 @@
{% extends 'base.twig' %}
{% block content %}
<form class="" role="form" name="register" id="register" method="post">
<h1>{{ title }}</h1>
<form role="form" name="signup" id="signup" method="post">
<div class="control-group form-group">
<h1>{{ title }}</h1>
<label for="username">{% trans %}sign.up.form.username{% endtrans %}</label><br/>
<input type="text" id="username" name="username" class="" placeholder="{% trans %}sign.up.form.username.placeholder{% endtrans %}" value="" autofocus required> @{{ getenv('site_xmpp_server_displayname') }}
<br/><br/>
<label for="email">{% trans %}sign.up.form.email{% endtrans %}</label><br/>
<input type="text" id="email" name="email" class="" placeholder="{% trans %}sign.up.form.email.placeholder{% endtrans %}" value="" autofocus required>
<br/><br/>
<label for="password">{% trans %}sign.up.form.password{% endtrans %}</label><br/>
<input type="password" id="password" name="password" class="form-control" placeholder="{% trans %}sign.up.form.password.placeholder{% endtrans %}" required>
<br/><br/>
<input class="" type="submit" name="signup" value="{% trans %}sign.up.form.button{% endtrans %}"/>
<div class="form-group row">
<label class="col-2 col-form-label"
for="username">{% trans %}sign.up.form.username{% endtrans %}</label>
<div class="col-7">
<input type="text" id="username" name="username" class="form-control"
placeholder="{% trans %}sign.up.form.username.placeholder{% endtrans %}" value="" autofocus
required>
</div>
<div class="col-3">
@{{ getenv('site_xmpp_server_displayname') }}
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label" for="email">{% trans %}sign.up.form.email{% endtrans %}</label>
<div class="col-10">
<input aria-describedby="help" type="text" id="email" name="email" class="form-control"
placeholder="{% trans %}sign.up.form.email.placeholder{% endtrans %}" value="" autofocus
required>
<small id="help"
class="form-text text-muted">{% trans %}sign.up.form.email.help{% endtrans %}</small>
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label"
for="password">{% trans %}sign.up.form.password{% endtrans %}</label>
<div class="col-10">
<input type="password" id="password" name="password" class="form-control"
placeholder="{% trans %}sign.up.form.password.placeholder{% endtrans %}" required>
</div>
</div>
<div class="form-check">
<input type="checkbox" id="legal" name="legal" class="form-check-input"/>
<label class="form-check-label" for="legal"><a href="#" data-target="#legalModal"
data-toggle="modal">{% trans %}legalmodal.open{% endtrans %}</a></label>
</div>
<br/>
<input class="btn btn-primary" type="submit" name="signup_button"
value="{% trans %}sign.up.form.button{% endtrans %}"/>
</div>
</form>
<!-- legal modal -->
<div class="modal fade" id="legalModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-lg modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans %}legalmodal.title{% endtrans %}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>{{ legal|markdown }}</p>
</div>
</div>
</div>
</div>
{% endblock %}