Cleanup: Use UNIX line separators in all files
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 23 Jan 2009 18:38:26 +0000 (18:38 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 23 Jan 2009 18:38:26 +0000 (18:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/sr_freecap/trunk@16034 735d13b6-9817-0410-8766-e36946ffe9aa

23 files changed:
COPYING.txt
ChangeLog
ext_tables.php
ext_typoscript_constants.txt
ext_typoscript_setup.txt
mod1/class.tx_srfreecap_fontmaker.php
mod1/conf.php
mod1/fontmaker.php
mod1/index.php
mod1/locallang.xml
mod1/locallang_mod.xml
pi1/captcha.php
pi1/class.tx_srfreecap_pi1.php
pi1/freecap141.php
pi1/locallang.xml
pi2/class.tx_srfreecap_pi2.php
pi2/freeCap.js
pi2/locallang.xml
pi3/audioCaptcha.php
pi3/class.tx_srfreecap_pi3.php
res/words/.ht_de_freecap_words
res/words/.ht_default_freecap_words
res/words/.ht_fr_freecap_words

index 45645b4..5b6e7c6 100644 (file)
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\f\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\f\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\f\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\f\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\f\r
-           How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 2 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program; if not, write to the Free Software\r
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-If the program is interactive, make it output a short notice like this\r
-when it starts in an interactive mode:\r
-\r
-    Gnomovision version 69, Copyright (C) year name of author\r
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, the commands you use may\r
-be called something other than `show w' and `show c'; they could even be\r
-mouse-clicks or menu items--whatever suits your program.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the program, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1989\r
-  Ty Coon, President of Vice\r
-\r
-This General Public License does not permit incorporating your program into\r
-proprietary programs.  If your program is a subroutine library, you may\r
-consider it more useful to permit linking proprietary applications with the\r
-library.  If this is what you want to do, use the GNU Library General\r
-Public License instead of this License.\r
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <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 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
index 44ab62a..f002e14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
 2009-01-23  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Initial upload to TYPO3 Forge
+       * Cleanup: Use UNIX line separators in all files
index d38aba5..3a3ac46 100644 (file)
@@ -1,8 +1,8 @@
-<?php\r
-if (!defined ('TYPO3_MODE')) die ('Access denied.');\r
-\r
-if (TYPO3_MODE == 'BE' && $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_2']) {\r
-       t3lib_extMgm::addModule('tools', 'txsrfreecapM1', '', t3lib_extMgm::extPath($_EXTKEY).'mod1/');\r
-}\r
-\r
-?>\r
+<?php
+if (!defined ('TYPO3_MODE')) die ('Access denied.');
+
+if (TYPO3_MODE == 'BE' && $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_2']) {
+       t3lib_extMgm::addModule('tools', 'txsrfreecapM1', '', t3lib_extMgm::extPath($_EXTKEY).'mod1/');
+}
+
+?>
index 77dcc06..0583cc6 100644 (file)
@@ -1,59 +1,59 @@
-plugin.tx_srfreecap {\r
-\r
-    # cat=plugin.tx_srfreecap/dims/02; type=int+; label= CAPTCHA image height: Height of the generated image.\r
-       imageHeight = 90\r
-\r
-    # cat=plugin.tx_srfreecap/dims/01; type=int+; label= Maximun word length: Maximun length of the randomly generated CAPTCHA string.\r
-       maxWordLength = 5\r
-\r
-    # cat=plugin.tx_srfreecap/color; type=boolean; label= Color of the text: 0=one random colour for all letters, 1=different random colour for each letter.\r
-       textColor = 1\r
-\r
-    # cat=plugin.tx_srfreecap//03; type=options[png,gif,jpg]; label= CAPTCHA image format: Format of the generated image.\r
-       imageFormat = png\r
-\r
-    # cat=plugin.tx_srfreecap/enable/01; type=boolean; label= Use list of words: If enabled, the CAPTCHA string will be selected from a list of words. If not, it will be randomly generated.\r
-       useWordsList = 1\r
-       \r
-    # cat=plugin.tx_srfreecap/enable/02; type=boolean; label= Generate CAPTCHA with numbers only. This option is ignored if Use list of words is enabled.\r
-       generateNumbers = 0\r
-\r
-    # cat=plugin.tx_srfreecap//01; type=int+; label= Maximun attempts: Maximum times a user can refresh the image.\r
-       maxAttempts = 100\r
-\r
-    # cat=plugin.tx_srfreecap//04; type=options[,Transparent,White with grid,White with squiggles,Morphed image blocks]; label= Background type: If not set, will be random selection of possible types.\r
-       backgroundType =\r
-\r
-    # cat=plugin.tx_srfreecap/enable/04; type=boolean; label= Background blurring: If enabled, the background will be blurred. The string should be easier to read.\r
-       backgroundBlur = 1\r
-\r
-    # cat=plugin.tx_srfreecap/enable/05; type=boolean; label= Background morphing: If enabled, the background will be morphed (recommended).\r
-       backgroundMorph = 1\r
-\r
-    # cat=plugin.tx_srfreecap/enable/06; type=boolean; label= Merge string with background: 0=write CAPTCHA string over background, 1=merge CAPTCHA string with non-transparent background.\r
-       mergeWithBackground = 1\r
-\r
-    # cat=plugin.tx_srfreecap//05; type=string; label= Text morphing factor: Morphing factor applied to each character of the CAPTCHA string.\r
-       morphFactor = 1\r
-\r
-    # cat=plugin.tx_srfreecap/file/01; type=file[]; label= Default words list file: All words lists should be in the same directory.\r
-       defaultWordsList = EXT:sr_freecap/res/words/.ht_default_freecap_words\r
-\r
-    # cat=plugin.tx_srfreecap//02; type=options[,formal,informal]; label= Type of salutation to use: Possible values are 'formal' or 'informal'.\r
-       salutation =\r
-\r
-    # cat=plugin.tx_srfreecap/file/02; type=string; label= List of GD font files: Coma-separated list of GD font files located in directory uploads/tx_srfreecap/.\r
-       fontFiles =\r
-\r
-    # cat=plugin.tx_srfreecap/enable/03; type=boolean; label= Accessible output: If enabled, the CAPTCHA will include an audio version.\r
-       accessibleOutput = 0\r
-\r
-    # cat=plugin.tx_srfreecap/enable/07; type=boolean; label= Use site tag: If set, a site tag is added in the background of the CAPTCHA image.\r
-       siteTag = 0\r
-\r
-    # cat=plugin.tx_srfreecap//06; type=string; label= Site tag domain name: Domain name to use in the default site tag.\r
-       siteTagDomain = www.mydomain.org\r
-       \r
-    # cat=plugin.tx_srfreecap//07; type=int+; label= Position of the site tag: 0 = at the top of the CAPTCHA, 1 = at the bottom, 2 = both at the top and at the bottom\r
-       siteTagPosition = 1\r
+plugin.tx_srfreecap {
+
+    # cat=plugin.tx_srfreecap/dims/02; type=int+; label= CAPTCHA image height: Height of the generated image.
+       imageHeight = 90
+
+    # cat=plugin.tx_srfreecap/dims/01; type=int+; label= Maximun word length: Maximun length of the randomly generated CAPTCHA string.
+       maxWordLength = 5
+
+    # cat=plugin.tx_srfreecap/color; type=boolean; label= Color of the text: 0=one random colour for all letters, 1=different random colour for each letter.
+       textColor = 1
+
+    # cat=plugin.tx_srfreecap//03; type=options[png,gif,jpg]; label= CAPTCHA image format: Format of the generated image.
+       imageFormat = png
+
+    # cat=plugin.tx_srfreecap/enable/01; type=boolean; label= Use list of words: If enabled, the CAPTCHA string will be selected from a list of words. If not, it will be randomly generated.
+       useWordsList = 1
+       
+    # cat=plugin.tx_srfreecap/enable/02; type=boolean; label= Generate CAPTCHA with numbers only. This option is ignored if Use list of words is enabled.
+       generateNumbers = 0
+
+    # cat=plugin.tx_srfreecap//01; type=int+; label= Maximun attempts: Maximum times a user can refresh the image.
+       maxAttempts = 100
+
+    # cat=plugin.tx_srfreecap//04; type=options[,Transparent,White with grid,White with squiggles,Morphed image blocks]; label= Background type: If not set, will be random selection of possible types.
+       backgroundType =
+
+    # cat=plugin.tx_srfreecap/enable/04; type=boolean; label= Background blurring: If enabled, the background will be blurred. The string should be easier to read.
+       backgroundBlur = 1
+
+    # cat=plugin.tx_srfreecap/enable/05; type=boolean; label= Background morphing: If enabled, the background will be morphed (recommended).
+       backgroundMorph = 1
+
+    # cat=plugin.tx_srfreecap/enable/06; type=boolean; label= Merge string with background: 0=write CAPTCHA string over background, 1=merge CAPTCHA string with non-transparent background.
+       mergeWithBackground = 1
+
+    # cat=plugin.tx_srfreecap//05; type=string; label= Text morphing factor: Morphing factor applied to each character of the CAPTCHA string.
+       morphFactor = 1
+
+    # cat=plugin.tx_srfreecap/file/01; type=file[]; label= Default words list file: All words lists should be in the same directory.
+       defaultWordsList = EXT:sr_freecap/res/words/.ht_default_freecap_words
+
+    # cat=plugin.tx_srfreecap//02; type=options[,formal,informal]; label= Type of salutation to use: Possible values are 'formal' or 'informal'.
+       salutation =
+
+    # cat=plugin.tx_srfreecap/file/02; type=string; label= List of GD font files: Coma-separated list of GD font files located in directory uploads/tx_srfreecap/.
+       fontFiles =
+
+    # cat=plugin.tx_srfreecap/enable/03; type=boolean; label= Accessible output: If enabled, the CAPTCHA will include an audio version.
+       accessibleOutput = 0
+
+    # cat=plugin.tx_srfreecap/enable/07; type=boolean; label= Use site tag: If set, a site tag is added in the background of the CAPTCHA image.
+       siteTag = 0
+
+    # cat=plugin.tx_srfreecap//06; type=string; label= Site tag domain name: Domain name to use in the default site tag.
+       siteTagDomain = www.mydomain.org
+       
+    # cat=plugin.tx_srfreecap//07; type=int+; label= Position of the site tag: 0 = at the top of the CAPTCHA, 1 = at the bottom, 2 = both at the top and at the bottom
+       siteTagPosition = 1
 }
\ No newline at end of file
index 1414eb5..bbd770a 100644 (file)
@@ -1,40 +1,40 @@
-plugin.tx_srfreecap_pi1 {\r
-\r
-       imageHeight = {$plugin.tx_srfreecap.imageHeight}\r
-       imageFormat = {$plugin.tx_srfreecap.imageFormat}\r
-\r
-       backgroundType = {$plugin.tx_srfreecap.backgroundType}\r
-       backgroundBlur = {$plugin.tx_srfreecap.backgroundBlur}\r
-       backgroundMorph = {$plugin.tx_srfreecap.backgroundMorph}\r
-\r
-       maxWordLength = {$plugin.tx_srfreecap.maxWordLength}\r
-       useWordsList = {$plugin.tx_srfreecap.useWordsList}\r
-       generateNumbers = {$plugin.tx_srfreecap.generateNumbers}\r
-       \r
-       textColor = {$plugin.tx_srfreecap.textColor}\r
-       mergeWithBackground = {$plugin.tx_srfreecap.mergeWithBackground}\r
-       morphFactor = {$plugin.tx_srfreecap.morphFactor}\r
-       defaultWordsList = {$plugin.tx_srfreecap.defaultWordsList}\r
-       fontFiles = {$plugin.tx_srfreecap.fontFiles}\r
-\r
-       maxAttempts = {$plugin.tx_srfreecap.maxAttempts}\r
-       \r
-       accessibleOutput = {$plugin.tx_srfreecap.accessibleOutput}\r
-       \r
-       siteTag = {$plugin.tx_srfreecap.siteTag}\r
-       siteTagDomain = {$plugin.tx_srfreecap.siteTagDomain}\r
-       siteTagPosition = {$plugin.tx_srfreecap.siteTagPosition}\r
-}\r
-\r
-plugin.tx_srfreecap_pi2 {\r
-\r
-       salutation = {$plugin.tx_srfreecap.salutation}\r
-       accessibleOutput = {$plugin.tx_srfreecap.accessibleOutput}\r
-\r
-       _CSS_DEFAULT_STYLE (\r
-               .tx-srfreecap-pi2-image { margin-left: 1em; }\r
-               .tx-srfreecap-pi2-cant-read { font-size: .9em; color:#35006d; }\r
-               .tx-srfreecap-pi2-cant-read a:link { background-color:transparent; font-weight:bold; text-decoration:none; }\r
-       )\r
-}\r
-\r
+plugin.tx_srfreecap_pi1 {
+
+       imageHeight = {$plugin.tx_srfreecap.imageHeight}
+       imageFormat = {$plugin.tx_srfreecap.imageFormat}
+
+       backgroundType = {$plugin.tx_srfreecap.backgroundType}
+       backgroundBlur = {$plugin.tx_srfreecap.backgroundBlur}
+       backgroundMorph = {$plugin.tx_srfreecap.backgroundMorph}
+
+       maxWordLength = {$plugin.tx_srfreecap.maxWordLength}
+       useWordsList = {$plugin.tx_srfreecap.useWordsList}
+       generateNumbers = {$plugin.tx_srfreecap.generateNumbers}
+       
+       textColor = {$plugin.tx_srfreecap.textColor}
+       mergeWithBackground = {$plugin.tx_srfreecap.mergeWithBackground}
+       morphFactor = {$plugin.tx_srfreecap.morphFactor}
+       defaultWordsList = {$plugin.tx_srfreecap.defaultWordsList}
+       fontFiles = {$plugin.tx_srfreecap.fontFiles}
+
+       maxAttempts = {$plugin.tx_srfreecap.maxAttempts}
+       
+       accessibleOutput = {$plugin.tx_srfreecap.accessibleOutput}
+       
+       siteTag = {$plugin.tx_srfreecap.siteTag}
+       siteTagDomain = {$plugin.tx_srfreecap.siteTagDomain}
+       siteTagPosition = {$plugin.tx_srfreecap.siteTagPosition}
+}
+
+plugin.tx_srfreecap_pi2 {
+
+       salutation = {$plugin.tx_srfreecap.salutation}
+       accessibleOutput = {$plugin.tx_srfreecap.accessibleOutput}
+
+       _CSS_DEFAULT_STYLE (
+               .tx-srfreecap-pi2-image { margin-left: 1em; }
+               .tx-srfreecap-pi2-cant-read { font-size: .9em; color:#35006d; }
+               .tx-srfreecap-pi2-cant-read a:link { background-color:transparent; font-weight:bold; text-decoration:none; }
+       )
+}
+
index e12bdf2..ef302d6 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2007-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>\r
-*  All rights reserved\r
-*\r
-*  This script is part of the Typo3 project. The Typo3 project is\r
-*  free software; you can redistribute it and/or modify\r
-*  it under the terms of the GNU General Public License as published by\r
-*  the Free Software Foundation; either version 2 of the License, or\r
-*  (at your option) any later version.\r
-*\r
-*  The GNU General Public License can be found at\r
-*  http://www.gnu.org/copyleft/gpl.html.\r
-*\r
-*  This script is distributed in the hope that it will be useful,\r
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*  GNU General Public License for more details.\r
-*\r
-*  This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-/**\r
-* Module 'GD Font Makers' for the 'sr_freecap' extension.\r
-*\r
-* @author Stanislas Rolland <typo3(arobas)sjbr.ca>\r
-*/\r
-if (!defined('PATH_tslib')) {\r
-       if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {\r
-               define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');\r
-       } elseif (@is_dir(PATH_site.'tslib/')) {\r
-               define('PATH_tslib', PATH_site.'tslib/');\r
-       }\r
-}\r
-require_once(PATH_t3lib.'class.t3lib_scbase.php');\r
-require_once(PATH_t3lib.'class.t3lib_tstemplate.php');\r
-require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');\r
-require_once(PATH_t3lib.'class.t3lib_div.php');\r
-require_once(PATH_tslib.'class.tslib_gifbuilder.php');\r
-require_once(PATH_tslib.'class.tslib_content.php');\r
-\r
-class tx_srfreecap_fontmaker extends t3lib_SCbase {\r
-       var $extKey = 'sr_freecap';\r
-       var $extPrefix = 'tx_srfreecap';\r
-       var $pageinfo;\r
-       \r
-       /**\r
-        * Initialize module\r
-        *\r
-        * @return void\r
-        */\r
-       function init() {\r
-               parent::init();\r
-       }\r
-       \r
-       /**\r
-        * Adds items to the->MOD_MENU array. Used for the function menu selector.\r
-        *\r
-        * @return void\r
-        */\r
-       function menuConfig() {\r
-               global $LANG;\r
-               $this->MOD_MENU = Array (\r
-                       'function' => Array (\r
-                               '1' => $LANG->getLL('function1'),\r
-                               '2' => $LANG->getLL('function2'),\r
-                               '3' => $LANG->getLL('function3'),\r
-                               )\r
-                       );\r
-               parent::menuConfig();\r
-       }\r
-       \r
-       /**\r
-        * Main function of the module. Write the content to $this->content\r
-        *\r
-        * @return void\r
-        */\r
-       function main() {\r
-               global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS;\r
-               \r
-                       // Access check!\r
-                       // The page will show only if there is a valid page and if this page may be viewed by the user\r
-               $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);\r
-               $access = is_array($this->pageinfo) ? 1 : 0;\r
-               \r
-               if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {\r
-                       \r
-                               // Draw the header.\r
-                       $this->doc = t3lib_div::makeInstance('mediumDoc');\r
-                       $this->doc->backPath = $BACK_PATH;\r
-                       $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';\r
-                       \r
-                               // JavaScript\r
-                       $this->doc->JScode = '\r
-                               <script type="text/javascript">\r
-                                       /*<![CDATA[*/\r
-                                       <!--\r
-                                       script_ended = 0;\r
-                                       function jumpToUrl(URL) {\r
-                                       document.location = URL;\r
-                                       }\r
-                                       // -->\r
-                                       /*]]>*/\r
-                                       </script>\r
-                               ';\r
-                       \r
-                       //$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']).'<br>'.$LANG->php3Lang['labels']['path'].': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'], 50);\r
-                       \r
-                       $this->content .= $this->doc->startPage($LANG->getLL('title'));\r
-                       $this->content .= $this->doc->header($LANG->getLL('title'));\r
-                       $this->content .= $this->doc->spacer(5);\r
-                       //$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));\r
-                       $this->content .= $this->doc->divider(5);\r
-                       \r
-                               // Render content:\r
-                       $this->moduleContent();\r
-                       \r
-                               // ShortCut\r
-                       if ($BE_USER->mayMakeShortcut()) {\r
-                               $this->content .= $this->doc->spacer(20).$this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));\r
-                       }\r
-                       \r
-                       $this->content .= $this->doc->spacer(10);\r
-               } else {\r
-                               // If no access or if ID == zero\r
-                       $this->doc = t3lib_div::makeInstance('mediumDoc');\r
-                       $this->doc->backPath = $BACK_PATH;\r
-                                \r
-                       $this->content .= $this->doc->startPage($LANG->getLL('title'));\r
-                       $this->content .= $this->doc->header($LANG->getLL('title'));\r
-                       $this->content .= $this->doc->spacer(5);\r
-                       $this->content .= $this->doc->spacer(10);\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Prints out the module HTML\r
-        *\r
-        * @return void\r
-        */\r
-       function printContent() {\r
-               global $SOBE;\r
-               \r
-               $this->content .= $this->doc->middle();\r
-               $this->content .= $this->doc->endPage();\r
-               echo $this->content;\r
-       }\r
-       \r
-       /**\r
-        * Generates the module content\r
-        *\r
-        * @return void\r
-        */\r
-       function moduleContent() {\r
-               global $LANG, $TYPO3_DB, $BACK_PATH, $TYPO3_CONF_VARS;\r
-               \r
-                       // get user supplied data\r
-               $charactersToIncludeInFont = intval(t3lib_div::_GP('charactersToIncludeInFont'));\r
-               \r
-               $pixelwidth = intval(t3lib_div::_GP('pixelwidth'));\r
-               $pixelheight = intval(t3lib_div::_GP('pixelheight'));\r
-               if (!$pixelheight) $pixelheight = 50;\r
-               \r
-               $endianness = intval(t3lib_div::_GP('endianness'));\r
-               \r
-               $gdFontFileName = t3lib_div::_GP('gdfontfilename');\r
-               if (!trim($gdFontFileName)) {\r
-                       $gdFontFileName = 'font';\r
-               }\r
-               \r
-               $fontFileName = t3lib_div::_GP('fontfilename');\r
-               if (!trim($fontFileName)) {\r
-                       $fontFileName = 't3lib/fonts/nimbus.ttf';\r
-               }\r
-               $ttfFontFileName = t3lib_div::getFileAbsFileName($fontFileName);\r
-               \r
-               if (!is_file($ttfFontFileName)) {\r
-                       $this->content .= $LANG->getLL('ttfFontFileNotFound') . ' '. $fontFileName;\r
-               } elseif (!empty($pixelwidth)) {\r
-                       if ($charactersToIncludeInFont == 1) {\r
-                               $characters = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z';\r
-                               $numchars = 26;\r
-                               $startCharacter = 'a';\r
-                       } else if ($charactersToIncludeInFont == 2) {\r
-                               $characters = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o'\r
-                                       .',p,q,r,s,t,u,v,w,x,y,z,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'\r
-                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,ß'\r
-                                       .',à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï'\r
-                                       .',ð,ñ,ò,ó,ô,õ,ö,-,ø,ù,ú,û,ü,ý,þ,ÿ';\r
-                                       $numchars = 159;\r
-                                       $startCharacter = 'a';\r
-                       } else {\r
-                               $characters = '0,1,2,3,4,5,6,7,8,9';\r
-                               $numchars = 10;\r
-                               $startCharacter = '0';\r
-                       }\r
-                       \r
-                       $PNGImageFile = $this->makeFontImage($characters, $ttfFontFileName, $pixelwidth, $pixelheight);\r
-                       $this->content .= $LANG->getLL('usingFontFile') . ' ' . $fontFileName . $this->doc->spacer(5);\r
-                       $this->content .= $LANG->getLL('pngImageCreated') . ' ' . $PNGImageFile . $this->doc->spacer(5) . '<img src="' . $BACK_PATH . '../' . $PNGImageFile . '" />' . $this->doc->spacer(20);\r
-                       \r
-                       if ($TYPO3_CONF_VARS['GFX']['gdlib_png']) {\r
-                               $image = @ImageCreateFromPNG(PATH_site.$PNGImageFile);\r
-                       } else {\r
-                               $image = @ImageCreateFromGIF(PATH_site.$PNGImageFile);\r
-                       }\r
-                       $fontdata = $this->makeFont($image, $numchars, $startCharacter, $pixelwidth, $pixelheight, $endianness);\r
-                       $gdfFontFileName = $this->buildFontFile($gdFontFileName,$fontdata);\r
-                       ImageDestroy($image);\r
-                       \r
-                       if ($gdfFontFileName) {\r
-                               $this->content .= $LANG->getLL('gdFontFileCreated') . ' ' . $gdfFontFileName;\r
-                       } else {\r
-                               $this->content .= $LANG->getLL('gdFontFileNotCreated') . ' ' . $gdfFontFileName;\r
-                       }\r
-               }\r
-               $this->content .= $this->doc->spacer(20);\r
-               $this->content .= '\r
-                       <table cellspacing="5">\r
-                               <tr><td>' . $LANG->getLL('charactersToIncludeInFont') . '</td><td>\r
-                                       <input id="numbers-only" type="radio" name="charactersToIncludeInFont" value="0" checked="checked" style="margin-right: 3px;" /><label for="numbers-only">' . $LANG->getLL('numbers-only') . '</label>\r
-                                       <br /><input id="ASCII-lowercase-letters" type="radio" name="charactersToIncludeInFont" value="1" style="margin-right: 3px;" /><label for="ASCII-lowercase-letters">' . $LANG->getLL('ASCII-lowercase-letters') . '</label>\r
-                                       <br /><input id="ANSI-extended-ASCII-lowercase-letters" type="radio" name="charactersToIncludeInFont" value="2" style="margin-right: 3px;" /><label for="ANSI-extended-ASCII-lowercase-letters">' . $LANG->getLL('ANSI-extended-ASCII-lowercase-letters') . '</label>\r
-                               </td></tr>\r
-                               <tr><td><label for="pixelwidth">' . $LANG->getLL('characterWidth') . '</label></td><td><input id="pixelwidth" type="text" name="pixelwidth" size="5" /></td></tr>\r
-                               <tr><td><label for="pixelheight">' . $LANG->getLL('characterHeight') . '</label></td><td><input id="pixelheight" type="text" name="pixelheight" size="5" /></td></tr>\r
-                               <tr><td>' . $LANG->getLL('endianness') . '</td><td>\r
-                                       <input id="little-endian" type="radio" name="endianness" value="0" checked="checked" style="margin-right: 3px;" /><label for="little-endian">' . $LANG->getLL('littleEndian') . '</label>\r
-                                       <br /><input id="big-endian" type="radio" name="endianness" value="1" style="margin-right: 3px;" /><label for="big-endian">' . $LANG->getLL('bigEndian') . '</label>\r
-                               </td></tr>\r
-                               <tr><td><label for="fontfilename">' . $LANG->getLL('pathToTTFFile') . '</td><td><input id="fontfilename" type="text" name="fontfilename" size="50" /></td></tr>\r
-                               <tr><td><label for="gdfontfilename">' . $LANG->getLL('gdFontFilePrefix') . '</td><td><input id="gdfontfilename" type="text" name="gdfontfilename" size="25"></td></tr>\r
-                               <tr><td colspan="2"><input type="submit" value="' . htmlspecialchars($LANG->getLL('makeFont')) . '" /></td></tr>\r
-                               </table>\r
-                       ';\r
-               $this->content .= $this->doc->section('', $content, 0, 1);\r
-       }\r
-       \r
-       /**\r
-        * Return a file name built with the label and containing the specified contents\r
-        *\r
-        * @return string               filename\r
-        */\r
-        \r
-       function buildFontFile($label,$contents,$ext='gdf') {\r
-               $relFilename = 'uploads/' . $this->extPrefix . '/' . $label . '_' .  t3lib_div::shortMD5($contents) . '.' . $ext;\r
-               $absFilename = PATH_site . $relFilename;\r
-               if (t3lib_div::writeFile($absFilename,$contents))       {\r
-                       return $relFilename;\r
-               } else {\r
-                       return FALSE;\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Outputs an image of a specified background color displaying a list of characters with specified font size, file and color\r
-        *\r
-        * @param       string          $text: text to display on he image\r
-        * @param       integer         $size: specified font size\r
-        * @param       string          $font: specified font file name\r
-        * @param       string          $color: specified font color\r
-        * @param       string          $bgColor: specified background color\r
-        * @param       string          $align: left or right alignment of text\r
-        * @param       string          $width: width of each character\r
-        * @param       string          $height: height of the image\r
-        * @return      array           image file info array\r
-        */\r
-       function makeFontImage($characters, $font, $width = 35, $height = 50) {\r
-               \r
-               $size = intval($height*.8);\r
-               $vertOffset = intval($height*.7);\r
-               $color = '#000000';\r
-               $bgColor = 'white';\r
-               $align = 'left';\r
-               \r
-               $charactersArray = explode(',', $characters);\r
-               $charactersCount = count($charactersArray);\r
-               \r
-               $gifObjArray = array();\r
-               $gifObjArray['backColor'] = $bgColor;\r
-               $gifObjArray['transparentBackground'] = 0;\r
-               $gifObjArray['reduceColors'] = '';\r
-               $gifObjArray['maxWidth'] = ($charactersCount*$width)+1; \r
-               $gifObjArray['XY'] = ($charactersCount*$width) .','.$height;\r
-               \r
-               for ($ic = 1; $ic < $charactersCount+1; $ic++) {\r
-                       $gifObjArray[$ic.'0'] = 'TEXT';\r
-                       $gifObjArray[$ic.'0.']['text'] = $charactersArray[$ic-1];\r
-                       \r
-                       $bbox = imagettfbbox($size, 0, $font, $charactersArray[$ic-1]);\r
-                       $hOffset = intval(($width - ($bbox[4] - $bbox[6]))/2);\r
-                       $vOffset = intval(($width - ($bbox[7] - $bbox[1]))/2);\r
-                       \r
-                       $gifObjArray[$ic.'0.']['niceText'] = 0;\r
-                       $gifObjArray[$ic.'0.']['antiAlias'] = 1;\r
-                       $gifObjArray[$ic.'0.']['align'] = $align;\r
-                       $gifObjArray[$ic.'0.']['fontSize'] = $size;\r
-                       $gifObjArray[$ic.'0.']['fontFile'] = $font;\r
-                       $gifObjArray[$ic.'0.']['fontColor'] = $color;\r
-                       $gifObjArray[$ic.'0.']['maxWidth'] = $width;\r
-                       $gifObjArray[$ic.'0.']['offset'] = (($ic-1)*$width+$hOffset).','.$vertOffset;\r
-               }\r
-               \r
-               $gifCreator = t3lib_div::makeInstance('tx_srfreecap_gifbuilder');\r
-               $theImage='';\r
-               $gifCreator->init();\r
-               if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'])        {\r
-                       $gifCreator->start($gifObjArray,array());\r
-                       return $gifCreator->gifBuild();\r
-               } else {\r
-                       return FALSE;\r
-               }\r
-       }\r
-       \r
-/************************************************************\\r
-*\r
-*              GD Fontmaker Copyright 2005 Howard Yeend\r
-*              www.puremango.co.uk\r
-*\r
-*    This file is part of GD Fontmaker.\r
-*\r
-*    GD Fontmaker is free software; you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation; either version 2 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    GD Fontmaker is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-*\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with GD Fontmaker; if not, write to the Free Software\r
-*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*\r
-*\r
-\************************************************************/\r
-       \r
-       function makeFont($image,$numchars,$startchar,$pixelwidth,$pixelheight,$endianness=0) {\r
-               \r
-               $startchar = ord($startchar);\r
-               \r
-                       // encode this at start of font\r
-               if ($endianness) {\r
-                               // big-endian\r
-                       $fontdata = chr(0).chr(0).chr(0).chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight);\r
-               } else {\r
-                               // little-endian\r
-                       $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0);\r
-               }\r
-                       // loop through each pixel of each character of the PNG\r
-                       // (we know the dimensions of the characters because the user told us what they were)\r
-               $y = 0;\r
-               $x = 0;\r
-               $start_x = 0;\r
-               for ($c=0; $c<$numchars*$pixelwidth ; $c+=$pixelwidth)  {\r
-                       for ($y=0 ; $y<$pixelheight ; $y++)     {\r
-                               for($x=$c ; $x<$c+$pixelwidth ; $x++)   {\r
-                                               // get colour of this pixel\r
-                                       $rgb = ImageColorAt($image, $x, $y);\r
-\r
-                                       if ($rgb==0)    {\r
-                                                       // it's black; font data\r
-                                               $fontdata .= chr(255);\r
-                                       } else {\r
-                                                       // it's not black; background\r
-                                                       $fontdata .= chr(0);\r
-                                       }\r
-                                       $i++;\r
-                               }\r
-                       }\r
-               }\r
-                return $fontdata;\r
-       }\r
-}\r
-\r
-class tx_srfreecap_gifbuilder extends tslib_gifbuilder {\r
-       \r
-       /**\r
-        * Returns the reference to a "resource" in TypoScript.\r
-        *\r
-        * @param       string          The resource value.\r
-        * @return      string          Returns the relative filepath\r
-        * @access private\r
-        * @see t3lib_TStemplate::getFileName()\r
-        */\r
-       function checkFile($file)       {\r
-               return $file;\r
-       }\r
-       \r
-       /**\r
-        * Writes the input GDlib image pointer to file\r
-        *\r
-        * @param       pointer         The GDlib image resource pointer\r
-        * @param       string          The filename to write to\r
-        * @return      mixed           The output of either imageGif, imagePng or imageJpeg based on the filename to write\r
-        * @see maskImageOntoImage(), scale(), output()\r
-        */\r
-       function ImageWrite($destImg, $theImage)        {\r
-               return parent::ImageWrite($destImg, PATH_site.$theImage);\r
-       }\r
-}\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/mod1/class.tx_srfreecap_fontmaker.php']) {\r
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/mod1/class.tx_srfreecap_fontmaker.php']);\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2007-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  All rights reserved
+*
+*  This script is part of the Typo3 project. The Typo3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+* Module 'GD Font Makers' for the 'sr_freecap' extension.
+*
+* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+*/
+if (!defined('PATH_tslib')) {
+       if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
+               define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
+       } elseif (@is_dir(PATH_site.'tslib/')) {
+               define('PATH_tslib', PATH_site.'tslib/');
+       }
+}
+require_once(PATH_t3lib.'class.t3lib_scbase.php');
+require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
+require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
+require_once(PATH_t3lib.'class.t3lib_div.php');
+require_once(PATH_tslib.'class.tslib_gifbuilder.php');
+require_once(PATH_tslib.'class.tslib_content.php');
+
+class tx_srfreecap_fontmaker extends t3lib_SCbase {
+       var $extKey = 'sr_freecap';
+       var $extPrefix = 'tx_srfreecap';
+       var $pageinfo;
+       
+       /**
+        * Initialize module
+        *
+        * @return void
+        */
+       function init() {
+               parent::init();
+       }
+       
+       /**
+        * Adds items to the->MOD_MENU array. Used for the function menu selector.
+        *
+        * @return void
+        */
+       function menuConfig() {
+               global $LANG;
+               $this->MOD_MENU = Array (
+                       'function' => Array (
+                               '1' => $LANG->getLL('function1'),
+                               '2' => $LANG->getLL('function2'),
+                               '3' => $LANG->getLL('function3'),
+                               )
+                       );
+               parent::menuConfig();
+       }
+       
+       /**
+        * Main function of the module. Write the content to $this->content
+        *
+        * @return void
+        */
+       function main() {
+               global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS;
+               
+                       // Access check!
+                       // The page will show only if there is a valid page and if this page may be viewed by the user
+               $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
+               $access = is_array($this->pageinfo) ? 1 : 0;
+               
+               if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
+                       
+                               // Draw the header.
+                       $this->doc = t3lib_div::makeInstance('mediumDoc');
+                       $this->doc->backPath = $BACK_PATH;
+                       $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
+                       
+                               // JavaScript
+                       $this->doc->JScode = '
+                               <script type="text/javascript">
+                                       /*<![CDATA[*/
+                                       <!--
+                                       script_ended = 0;
+                                       function jumpToUrl(URL) {
+                                       document.location = URL;
+                                       }
+                                       // -->
+                                       /*]]>*/
+                                       </script>
+                               ';
+                       
+                       //$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']).'<br>'.$LANG->php3Lang['labels']['path'].': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'], 50);
+                       
+                       $this->content .= $this->doc->startPage($LANG->getLL('title'));
+                       $this->content .= $this->doc->header($LANG->getLL('title'));
+                       $this->content .= $this->doc->spacer(5);
+                       //$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
+                       $this->content .= $this->doc->divider(5);
+                       
+                               // Render content:
+                       $this->moduleContent();
+                       
+                               // ShortCut
+                       if ($BE_USER->mayMakeShortcut()) {
+                               $this->content .= $this->doc->spacer(20).$this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
+                       }
+                       
+                       $this->content .= $this->doc->spacer(10);
+               } else {
+                               // If no access or if ID == zero
+                       $this->doc = t3lib_div::makeInstance('mediumDoc');
+                       $this->doc->backPath = $BACK_PATH;
+                                
+                       $this->content .= $this->doc->startPage($LANG->getLL('title'));
+                       $this->content .= $this->doc->header($LANG->getLL('title'));
+                       $this->content .= $this->doc->spacer(5);
+                       $this->content .= $this->doc->spacer(10);
+               }
+       }
+       
+       /**
+        * Prints out the module HTML
+        *
+        * @return void
+        */
+       function printContent() {
+               global $SOBE;
+               
+               $this->content .= $this->doc->middle();
+               $this->content .= $this->doc->endPage();
+               echo $this->content;
+       }
+       
+       /**
+        * Generates the module content
+        *
+        * @return void
+        */
+       function moduleContent() {
+               global $LANG, $TYPO3_DB, $BACK_PATH, $TYPO3_CONF_VARS;
+               
+                       // get user supplied data
+               $charactersToIncludeInFont = intval(t3lib_div::_GP('charactersToIncludeInFont'));
+               
+               $pixelwidth = intval(t3lib_div::_GP('pixelwidth'));
+               $pixelheight = intval(t3lib_div::_GP('pixelheight'));
+               if (!$pixelheight) $pixelheight = 50;
+               
+               $endianness = intval(t3lib_div::_GP('endianness'));
+               
+               $gdFontFileName = t3lib_div::_GP('gdfontfilename');
+               if (!trim($gdFontFileName)) {
+                       $gdFontFileName = 'font';
+               }
+               
+               $fontFileName = t3lib_div::_GP('fontfilename');
+               if (!trim($fontFileName)) {
+                       $fontFileName = 't3lib/fonts/nimbus.ttf';
+               }
+               $ttfFontFileName = t3lib_div::getFileAbsFileName($fontFileName);
+               
+               if (!is_file($ttfFontFileName)) {
+                       $this->content .= $LANG->getLL('ttfFontFileNotFound') . ' '. $fontFileName;
+               } elseif (!empty($pixelwidth)) {
+                       if ($charactersToIncludeInFont == 1) {
+                               $characters = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z';
+                               $numchars = 26;
+                               $startCharacter = 'a';
+                       } else if ($charactersToIncludeInFont == 2) {
+                               $characters = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o'
+                                       .',p,q,r,s,t,u,v,w,x,y,z,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-'
+                                       .',-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,ß'
+                                       .',à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï'
+                                       .',ð,ñ,ò,ó,ô,õ,ö,-,ø,ù,ú,û,ü,ý,þ,ÿ';
+                                       $numchars = 159;
+                                       $startCharacter = 'a';
+                       } else {
+                               $characters = '0,1,2,3,4,5,6,7,8,9';
+                               $numchars = 10;
+                               $startCharacter = '0';
+                       }
+                       
+                       $PNGImageFile = $this->makeFontImage($characters, $ttfFontFileName, $pixelwidth, $pixelheight);
+                       $this->content .= $LANG->getLL('usingFontFile') . ' ' . $fontFileName . $this->doc->spacer(5);
+                       $this->content .= $LANG->getLL('pngImageCreated') . ' ' . $PNGImageFile . $this->doc->spacer(5) . '<img src="' . $BACK_PATH . '../' . $PNGImageFile . '" />' . $this->doc->spacer(20);
+                       
+                       if ($TYPO3_CONF_VARS['GFX']['gdlib_png']) {
+                               $image = @ImageCreateFromPNG(PATH_site.$PNGImageFile);
+                       } else {
+                               $image = @ImageCreateFromGIF(PATH_site.$PNGImageFile);
+                       }
+                       $fontdata = $this->makeFont($image, $numchars, $startCharacter, $pixelwidth, $pixelheight, $endianness);
+                       $gdfFontFileName = $this->buildFontFile($gdFontFileName,$fontdata);
+                       ImageDestroy($image);
+                       
+                       if ($gdfFontFileName) {
+                               $this->content .= $LANG->getLL('gdFontFileCreated') . ' ' . $gdfFontFileName;
+                       } else {
+                               $this->content .= $LANG->getLL('gdFontFileNotCreated') . ' ' . $gdfFontFileName;
+                       }
+               }
+               $this->content .= $this->doc->spacer(20);
+               $this->content .= '
+                       <table cellspacing="5">
+                               <tr><td>' . $LANG->getLL('charactersToIncludeInFont') . '</td><td>
+                                       <input id="numbers-only" type="radio" name="charactersToIncludeInFont" value="0" checked="checked" style="margin-right: 3px;" /><label for="numbers-only">' . $LANG->getLL('numbers-only') . '</label>
+                                       <br /><input id="ASCII-lowercase-letters" type="radio" name="charactersToIncludeInFont" value="1" style="margin-right: 3px;" /><label for="ASCII-lowercase-letters">' . $LANG->getLL('ASCII-lowercase-letters') . '</label>
+                                       <br /><input id="ANSI-extended-ASCII-lowercase-letters" type="radio" name="charactersToIncludeInFont" value="2" style="margin-right: 3px;" /><label for="ANSI-extended-ASCII-lowercase-letters">' . $LANG->getLL('ANSI-extended-ASCII-lowercase-letters') . '</label>
+                               </td></tr>
+                               <tr><td><label for="pixelwidth">' . $LANG->getLL('characterWidth') . '</label></td><td><input id="pixelwidth" type="text" name="pixelwidth" size="5" /></td></tr>
+                               <tr><td><label for="pixelheight">' . $LANG->getLL('characterHeight') . '</label></td><td><input id="pixelheight" type="text" name="pixelheight" size="5" /></td></tr>
+                               <tr><td>' . $LANG->getLL('endianness') . '</td><td>
+                                       <input id="little-endian" type="radio" name="endianness" value="0" checked="checked" style="margin-right: 3px;" /><label for="little-endian">' . $LANG->getLL('littleEndian') . '</label>
+                                       <br /><input id="big-endian" type="radio" name="endianness" value="1" style="margin-right: 3px;" /><label for="big-endian">' . $LANG->getLL('bigEndian') . '</label>
+                               </td></tr>
+                               <tr><td><label for="fontfilename">' . $LANG->getLL('pathToTTFFile') . '</td><td><input id="fontfilename" type="text" name="fontfilename" size="50" /></td></tr>
+                               <tr><td><label for="gdfontfilename">' . $LANG->getLL('gdFontFilePrefix') . '</td><td><input id="gdfontfilename" type="text" name="gdfontfilename" size="25"></td></tr>
+                               <tr><td colspan="2"><input type="submit" value="' . htmlspecialchars($LANG->getLL('makeFont')) . '" /></td></tr>
+                               </table>
+                       ';
+               $this->content .= $this->doc->section('', $content, 0, 1);
+       }
+       
+       /**
+        * Return a file name built with the label and containing the specified contents
+        *
+        * @return string               filename
+        */
+        
+       function buildFontFile($label,$contents,$ext='gdf') {
+               $relFilename = 'uploads/' . $this->extPrefix . '/' . $label . '_' .  t3lib_div::shortMD5($contents) . '.' . $ext;
+               $absFilename = PATH_site . $relFilename;
+               if (t3lib_div::writeFile($absFilename,$contents))       {
+                       return $relFilename;
+               } else {
+                       return FALSE;
+               }
+       }
+       
+       /**
+        * Outputs an image of a specified background color displaying a list of characters with specified font size, file and color
+        *
+        * @param       string          $text: text to display on he image
+        * @param       integer         $size: specified font size
+        * @param       string          $font: specified font file name
+        * @param       string          $color: specified font color
+        * @param       string          $bgColor: specified background color
+        * @param       string          $align: left or right alignment of text
+        * @param       string          $width: width of each character
+        * @param       string          $height: height of the image
+        * @return      array           image file info array
+        */
+       function makeFontImage($characters, $font, $width = 35, $height = 50) {
+               
+               $size = intval($height*.8);
+               $vertOffset = intval($height*.7);
+               $color = '#000000';
+               $bgColor = 'white';
+               $align = 'left';
+               
+               $charactersArray = explode(',', $characters);
+               $charactersCount = count($charactersArray);
+               
+               $gifObjArray = array();
+               $gifObjArray['backColor'] = $bgColor;
+               $gifObjArray['transparentBackground'] = 0;
+               $gifObjArray['reduceColors'] = '';
+               $gifObjArray['maxWidth'] = ($charactersCount*$width)+1; 
+               $gifObjArray['XY'] = ($charactersCount*$width) .','.$height;
+               
+               for ($ic = 1; $ic < $charactersCount+1; $ic++) {
+                       $gifObjArray[$ic.'0'] = 'TEXT';
+                       $gifObjArray[$ic.'0.']['text'] = $charactersArray[$ic-1];
+                       
+                       $bbox = imagettfbbox($size, 0, $font, $charactersArray[$ic-1]);
+                       $hOffset = intval(($width - ($bbox[4] - $bbox[6]))/2);
+                       $vOffset = intval(($width - ($bbox[7] - $bbox[1]))/2);
+                       
+                       $gifObjArray[$ic.'0.']['niceText'] = 0;
+                       $gifObjArray[$ic.'0.']['antiAlias'] = 1;
+                       $gifObjArray[$ic.'0.']['align'] = $align;
+                       $gifObjArray[$ic.'0.']['fontSize'] = $size;
+                       $gifObjArray[$ic.'0.']['fontFile'] = $font;
+                       $gifObjArray[$ic.'0.']['fontColor'] = $color;
+                       $gifObjArray[$ic.'0.']['maxWidth'] = $width;
+                       $gifObjArray[$ic.'0.']['offset'] = (($ic-1)*$width+$hOffset).','.$vertOffset;
+               }
+               
+               $gifCreator = t3lib_div::makeInstance('tx_srfreecap_gifbuilder');
+               $theImage='';
+               $gifCreator->init();
+               if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'])        {
+                       $gifCreator->start($gifObjArray,array());
+                       return $gifCreator->gifBuild();
+               } else {
+                       return FALSE;
+               }
+       }
+       
+/************************************************************\
+*
+*              GD Fontmaker Copyright 2005 Howard Yeend
+*              www.puremango.co.uk
+*
+*    This file is part of GD Fontmaker.
+*
+*    GD Fontmaker is free software; you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation; either version 2 of the License, or
+*    (at your option) any later version.
+*
+*    GD Fontmaker 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 GD Fontmaker; if not, write to the Free Software
+*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+*
+\************************************************************/
+       
+       function makeFont($image,$numchars,$startchar,$pixelwidth,$pixelheight,$endianness=0) {
+               
+               $startchar = ord($startchar);
+               
+                       // encode this at start of font
+               if ($endianness) {
+                               // big-endian
+                       $fontdata = chr(0).chr(0).chr(0).chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight);
+               } else {
+                               // little-endian
+                       $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0);
+               }
+                       // loop through each pixel of each character of the PNG
+                       // (we know the dimensions of the characters because the user told us what they were)
+               $y = 0;
+               $x = 0;
+               $start_x = 0;
+               for ($c=0; $c<$numchars*$pixelwidth ; $c+=$pixelwidth)  {
+                       for ($y=0 ; $y<$pixelheight ; $y++)     {
+                               for($x=$c ; $x<$c+$pixelwidth ; $x++)   {
+                                               // get colour of this pixel
+                                       $rgb = ImageColorAt($image, $x, $y);
+
+                                       if ($rgb==0)    {
+                                                       // it's black; font data
+                                               $fontdata .= chr(255);
+                                       } else {
+                                                       // it's not black; background
+                                                       $fontdata .= chr(0);
+                                       }
+                                       $i++;
+                               }
+                       }
+               }
+                return $fontdata;
+       }
+}
+
+class tx_srfreecap_gifbuilder extends tslib_gifbuilder {
+       
+       /**
+        * Returns the reference to a "resource" in TypoScript.
+        *
+        * @param       string          The resource value.
+        * @return      string          Returns the relative filepath
+        * @access private
+        * @see t3lib_TStemplate::getFileName()
+        */
+       function checkFile($file)       {
+               return $file;
+       }
+       
+       /**
+        * Writes the input GDlib image pointer to file
+        *
+        * @param       pointer         The GDlib image resource pointer
+        * @param       string          The filename to write to
+        * @return      mixed           The output of either imageGif, imagePng or imageJpeg based on the filename to write
+        * @see maskImageOntoImage(), scale(), output()
+        */
+       function ImageWrite($destImg, $theImage)        {
+               return parent::ImageWrite($destImg, PATH_site.$theImage);
+       }
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/mod1/class.tx_srfreecap_fontmaker.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/mod1/class.tx_srfreecap_fontmaker.php']);
+}
+
+?>
index 5122540..232a509 100644 (file)
@@ -1,14 +1,14 @@
-<?php\r
-       // DO NOT REMOVE OR CHANGE THESE 3 LINES:\r
-define('TYPO3_MOD_PATH', 'ext/sr_freecap/mod1/');\r
-$BACK_PATH='../../../';\r
-$MCONF['name'] = 'tools_txsrfreecapM1';\r
-\r
-//$MCONF['script']='frameset.php';\r
-\r
-$MCONF['access'] = 'admin';\r
-$MCONF['script'] = 'index.php';\r
-\r
-$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';\r
-$MLANG['default']['ll_ref'] = 'LLL:EXT:sr_freecap/mod1/locallang_mod.xml';\r
-?>\r
+<?php
+       // DO NOT REMOVE OR CHANGE THESE 3 LINES:
+define('TYPO3_MOD_PATH', 'ext/sr_freecap/mod1/');
+$BACK_PATH='../../../';
+$MCONF['name'] = 'tools_txsrfreecapM1';
+
+//$MCONF['script']='frameset.php';
+
+$MCONF['access'] = 'admin';
+$MCONF['script'] = 'index.php';
+
+$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';
+$MLANG['default']['ll_ref'] = 'LLL:EXT:sr_freecap/mod1/locallang_mod.xml';
+?>
index c91eb3c..e81cff8 100644 (file)
-<?\r
-if (!defined('freeCap')) die ('Access denied.');\r
-/************************************************************\\r
-*\r
-*              GD Fontmaker Copyright 2005 Howard Yeend\r
-*              www.puremango.co.uk\r
-*\r
-*    This file is part of GD Fontmaker.\r
-*\r
-*    GD Fontmaker is free software; you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation; either version 2 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    GD Fontmaker is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-*\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with GD Fontmaker; if not, write to the Free Software\r
-*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*\r
-*\r
-\************************************************************/\r
-\r
-if(!empty($_POST['numchars']))\r
-{\r
-       // create GD image from PNG\r
-       $im = @ImageCreateFromPNG($_FILES['pngfile']['tmp_name']);\r
-       if(!$im)\r
-       {\r
-               exit("Cannot create image!");\r
-       }\r
-\r
-       // get user supplied data\r
-       $numchars = $_POST['numchars'];\r
-       $startchar = ord($_POST['startchar']);\r
-       $pixelwidth = $_POST['pixelwidth'];\r
-       $pixelheight = $_POST['pixelheight'];\r
-\r
-       // encode this at start of font\r
-       $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0);\r
-\r
-       // loop through each pixel of each character of the PNG\r
-       // (we know the dimensions of the characters because the user told us what they were)\r
-       $y=0;\r
-       $x=0;\r
-       $start_x=0;\r
-       for($c=0; $c<$numchars*$pixelwidth ; $c+=$pixelwidth)\r
-       {\r
-               for($y=0 ; $y<$pixelheight ; $y++)\r
-               {\r
-                       for($x=$c ; $x<$c+$pixelwidth ; $x++)\r
-                       {\r
-                               // get colour of this pixel\r
-                               $rgb = ImageColorAt($im, $x, $y);\r
-\r
-                               if($rgb==0)\r
-                               {\r
-                                       // it's black; font data\r
-                                       $fontdata .= chr(255);\r
-                               } else {\r
-                                       // it's not black; background\r
-                                       $fontdata .= chr(0);\r
-                               }\r
-                               $i++;\r
-                       }\r
-               }\r
-       }\r
-\r
-       // remove image from memory\r
-       ImageDestroy($im);\r
-\r
-       // let user download font\r
-       header("Pragma: public");\r
-       header("Expires: 0");\r
-       header("Cache-Control: must-revalidate, post-check=0, pre-check=0");\r
-       header("Cache-Control: public");\r
-       header("Content-Description: File Transfer");\r
-       header("Content-Type: application/octet-stream");\r
-       header("Content-Disposition: attachment; filename=font.gdf");\r
-       header("Content-Transfer-Encoding: binary");\r
-       header("Content-Length: ".strlen($fontdata));\r
-       echo $fontdata;\r
-       exit();\r
-}\r
-?>\r
-<html>\r
-<head>\r
-<title>GD fontMaker v1 - www.puremango.co.uk</title>\r
-<style>\r
-body,td{\r
-       font-family: verdana;\r
-       font-size: 12px;\r
-       color: black\r
-       background: white;\r
-}\r
-input{\r
-               font-family: verdana;\r
-               font-size: 12px;\r
-}\r
-</style>\r
-</head>\r
-<body>\r
-<b>GD fontMaker v1 - <a href="http://www.puremango.co.uk" target="_blank">www.puremango.co.uk</a></b><br /><br />\r
-<form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data">\r
-<table>\r
-<tr><td>total number of characters</td><td><input type="text" name="numchars"></td></tr>\r
-<tr><td>starting character</td><td><input type="text" name="startchar"></td></tr>\r
-<tr><td>character width</td><td><input type="text" name="pixelwidth"></td></tr>\r
-<tr><td>character height</td><td><input type="text" name="pixelheight"></td></tr>\r
-<tr><td>PNG image</td><td><input type="file" name="pngfile"></td></tr>\r
-<tr><td colspan="2" align="center"><input type="submit" value="make font"></td></tr>\r
-</table>\r
-This script takes a PNG image as input and creates a GD compatible font from it.<br />\r
-<br />\r
-Usage is best described with an example;<br />\r
-<a href="font.png" target="_blank">This file</a> is a PNG of the Arial font.<br />\r
-Each character is 34 pixels wide by 50 pixels high.<br />\r
-The starting character is 'a', and there are 26 characters in total.<br />\r
-Anything other than pure black will be treated as the background of the PNG; this is useful as it allows you to draw guidelines as in the example PNG<br />\r
-<br />\r
-Characters must be in ASCII code order, which means that the ideal character set is:<br />\r
-(space)!"#$%&'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<br />\r
-<br />\r
-But if you're lazy like me, you'll be pleased to hear that GD will process any undefined character as a space;<br />\r
-In other words, my example can be used to spell "hi there", even though there is no space defined in the font.<br />\r
-But it can't spell "Hi There" because I didn't include capitals; what it would write is:<br />" i &nbsp;here"<br /><br />\r
-<b>Known Bugs</b><br />\r
-You can't create fonts with characters greater than 255 pixels in either dimension, or with more than 255 characters in total (if you need me to, I can solve this)\r
-\r
-</form>\r
-</body>\r
+<?
+if (!defined('freeCap')) die ('Access denied.');
+/************************************************************\
+*
+*              GD Fontmaker Copyright 2005 Howard Yeend
+*              www.puremango.co.uk
+*
+*    This file is part of GD Fontmaker.
+*
+*    GD Fontmaker is free software; you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation; either version 2 of the License, or
+*    (at your option) any later version.
+*
+*    GD Fontmaker 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 GD Fontmaker; if not, write to the Free Software
+*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+*
+\************************************************************/
+
+if(!empty($_POST['numchars']))
+{
+       // create GD image from PNG
+       $im = @ImageCreateFromPNG($_FILES['pngfile']['tmp_name']);
+       if(!$im)
+       {
+               exit("Cannot create image!");
+       }
+
+       // get user supplied data
+       $numchars = $_POST['numchars'];
+       $startchar = ord($_POST['startchar']);
+       $pixelwidth = $_POST['pixelwidth'];
+       $pixelheight = $_POST['pixelheight'];
+
+       // encode this at start of font
+       $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0);
+
+       // loop through each pixel of each character of the PNG
+       // (we know the dimensions of the characters because the user told us what they were)
+       $y=0;
+       $x=0;
+       $start_x=0;
+       for($c=0; $c<$numchars*$pixelwidth ; $c+=$pixelwidth)
+       {
+               for($y=0 ; $y<$pixelheight ; $y++)
+               {
+                       for($x=$c ; $x<$c+$pixelwidth ; $x++)
+                       {
+                               // get colour of this pixel
+                               $rgb = ImageColorAt($im, $x, $y);
+
+                               if($rgb==0)
+                               {
+                                       // it's black; font data
+                                       $fontdata .= chr(255);
+                               } else {
+                                       // it's not black; background
+                                       $fontdata .= chr(0);
+                               }
+                               $i++;
+                       }
+               }
+       }
+
+       // remove image from memory
+       ImageDestroy($im);
+
+       // let user download font
+       header("Pragma: public");
+       header("Expires: 0");
+       header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+       header("Cache-Control: public");
+       header("Content-Description: File Transfer");
+       header("Content-Type: application/octet-stream");
+       header("Content-Disposition: attachment; filename=font.gdf");
+       header("Content-Transfer-Encoding: binary");
+       header("Content-Length: ".strlen($fontdata));
+       echo $fontdata;
+       exit();
+}
+?>
+<html>
+<head>
+<title>GD fontMaker v1 - www.puremango.co.uk</title>
+<style>
+body,td{
+       font-family: verdana;
+       font-size: 12px;
+       color: black
+       background: white;
+}
+input{
+               font-family: verdana;
+               font-size: 12px;
+}
+</style>
+</head>
+<body>
+<b>GD fontMaker v1 - <a href="http://www.puremango.co.uk" target="_blank">www.puremango.co.uk</a></b><br /><br />
+<form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data">
+<table>
+<tr><td>total number of characters</td><td><input type="text" name="numchars"></td></tr>
+<tr><td>starting character</td><td><input type="text" name="startchar"></td></tr>
+<tr><td>character width</td><td><input type="text" name="pixelwidth"></td></tr>
+<tr><td>character height</td><td><input type="text" name="pixelheight"></td></tr>
+<tr><td>PNG image</td><td><input type="file" name="pngfile"></td></tr>
+<tr><td colspan="2" align="center"><input type="submit" value="make font"></td></tr>
+</table>
+This script takes a PNG image as input and creates a GD compatible font from it.<br />
+<br />
+Usage is best described with an example;<br />
+<a href="font.png" target="_blank">This file</a> is a PNG of the Arial font.<br />
+Each character is 34 pixels wide by 50 pixels high.<br />
+The starting character is 'a', and there are 26 characters in total.<br />
+Anything other than pure black will be treated as the background of the PNG; this is useful as it allows you to draw guidelines as in the example PNG<br />
+<br />
+Characters must be in ASCII code order, which means that the ideal character set is:<br />
+(space)!"#$%&'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<br />
+<br />
+But if you're lazy like me, you'll be pleased to hear that GD will process any undefined character as a space;<br />
+In other words, my example can be used to spell "hi there", even though there is no space defined in the font.<br />
+But it can't spell "Hi There" because I didn't include capitals; what it would write is:<br />" i &nbsp;here"<br /><br />
+<b>Known Bugs</b><br />
+You can't create fonts with characters greater than 255 pixels in either dimension, or with more than 255 characters in total (if you need me to, I can solve this)
+
+</form>
+</body>
 </html>
\ No newline at end of file
index 8ebc7a9..6570ab2 100644 (file)
@@ -1,52 +1,52 @@
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2006-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>\r
-*  All rights reserved\r
-*\r
-*  This script is part of the Typo3 project. The Typo3 project is\r
-*  free software; you can redistribute it and/or modify\r
-*  it under the terms of the GNU General Public License as published by\r
-*  the Free Software Foundation; either version 2 of the License, or\r
-*  (at your option) any later version.\r
-*\r
-*  The GNU General Public License can be found at\r
-*  http://www.gnu.org/copyleft/gpl.html.\r
-*\r
-*  This script is distributed in the hope that it will be useful,\r
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*  GNU General Public License for more details.\r
-*\r
-*  This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-/**\r
-* Module 'Font Maker' for the 'sr_freecap' extension.\r
-*\r
-* @author Stanislas Rolland <typo3(arobas)sjbr.ca>\r
-*/\r
-       // initialization of the module\r
-unset($MCONF);\r
-require('conf.php');\r
-require($BACK_PATH.'init.php');\r
-require($BACK_PATH.'template.php');\r
-$LANG->includeLLFile(t3lib_extMgm::extPath('sr_freecap').'mod1/locallang.xml');\r
-require_once(t3lib_extMgm::extPath('sr_freecap').'mod1/class.tx_srfreecap_fontmaker.php');\r
-\r
-$BE_USER->modAccess($MCONF, 1); // This checks permissions and exits if the users has no permission for entry.\r
-\r
-       // Make instance:\r
-$SOBE = t3lib_div::makeInstance('tx_srfreecap_fontmaker');\r
-$SOBE->init();\r
-\r
-       // Include files?\r
-reset($SOBE->include_once);\r
-while (list(, $INC_FILE) = each($SOBE->include_once)) {\r
-       include_once($INC_FILE);\r
-}\r
-\r
-$SOBE->main();\r
-$SOBE->printContent();\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2006-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  All rights reserved
+*
+*  This script is part of the Typo3 project. The Typo3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+* Module 'Font Maker' for the 'sr_freecap' extension.
+*
+* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+*/
+       // initialization of the module
+unset($MCONF);
+require('conf.php');
+require($BACK_PATH.'init.php');
+require($BACK_PATH.'template.php');
+$LANG->includeLLFile(t3lib_extMgm::extPath('sr_freecap').'mod1/locallang.xml');
+require_once(t3lib_extMgm::extPath('sr_freecap').'mod1/class.tx_srfreecap_fontmaker.php');
+
+$BE_USER->modAccess($MCONF, 1); // This checks permissions and exits if the users has no permission for entry.
+
+       // Make instance:
+$SOBE = t3lib_div::makeInstance('tx_srfreecap_fontmaker');
+$SOBE->init();
+
+       // Include files?
+reset($SOBE->include_once);
+while (list(, $INC_FILE) = each($SOBE->include_once)) {
+       include_once($INC_FILE);
+}
+
+$SOBE->main();
+$SOBE->printContent();
+
+?>
index d6d987d..b7d051e 100644 (file)
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
-<T3locallang>\r
-    <meta type="array">\r
-        <description>GD Font Maker for freeCap CAPTCHA</description>\r
-        <type>module</type>\r
-        <csh_table></csh_table>\r
-        <labelContext type="array">\r
-        </labelContext>\r
-    </meta>\r
-    <data type="array">\r
-        <languageKey index="default" type="array">\r
-            <label index="title">Make GD Font for freeCap CAPTCHA</label>\r
-            <label index="charactersToIncludeInFont">Characters included in font:</label>\r
-            <label index="numbers-only">Numbers only (0-9)</label>\r
-           <label index="ASCII-lowercase-letters">ASCII lowercase letters (a-z)</label>\r
-           <label index="ANSI-extended-ASCII-lowercase-letters">ANSI-extended ASCII lowercase letters (a-z,ß-ÿ)</label>\r
-            <label index="characterWidth">Character width:</label>\r
-            <label index="characterHeight">Character height:</label>\r
-            <label index="endianness">Byte order (Endianness):</label>\r
-            <label index="littleEndian">Little-endian</label>\r
-            <label index="bigEndian">Big-endian</label>\r
-            <label index="pathToTTFFile">Path to source TTF font file relative to TYPO3 site:</label>\r
-            <label index="gdFontFilePrefix">Prefix of GD font file name to create:</label>\r
-           <label index="makeFont">Make font</label>\r
-           <label index="usingFontFile">The following TTF font file is used as source:</label>\r
-           <label index="ttfFontFileNotFound">The source TTF font file could not be found:</label>\r
-           <label index="pngImageCreated">The following PNG image was created:</label>\r
-           <label index="gdFontFileCreated">The following GD font file was created from the above image:</label>\r
-           <label index="gdFontFileNotCreated">The following GD font file could not be created:</label>\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-            <label index="title">Fabrication d'une police de caractères GD pour freeCap CAPTCHA</label>\r
-           <label index="charactersToIncludeInFont">Caractères inclus dans la police:</label>\r
-           <label index="numbers-only">Chiffres seulement (0-9)</label>\r
-           <label index="ASCII-lowercase-letters">Lettres minuscules ASCII (a-z)</label>\r
-           <label index="ANSI-extended-ASCII-lowercase-letters">Lettres minuscules ASCII étendu par ANSI (a-z,ß-ÿ)</label>\r
-            <label index="characterWidth">Largeur des caractères:</label>\r
-            <label index="characterHeight">Hauteur des caractères:</label>\r
-            <label index="endianness">Ordre des octets (endianness):</label>\r
-            <label index="littleEndian">Petit-boutiste</label>\r
-            <label index="bigEndian">Gros-boutiste</label>\r
-            <label index="pathToTTFFile">Chemin jusqu'au fichier de police TTF d'entrée relativement au site TYPO3:</label>\r
-           <label index="gdFontFilePrefix">Préfixe du nom du fichier de police GD à créer:</label>\r
-           <label index="makeFont">Fabriquer la police</label>\r
-           <label index="usingFontFile">Le fichier de police TTF suivant est utilisé en entrée:</label>\r
-           <label index="ttfFontFileNotFound">Le fichier de police TTF d'entrée n'a pas été trouvé:</label>\r
-           <label index="pngImageCreated">L'image PNG suivante a été créée:</label>\r
-           <label index="gdFontFileCreated">Le fichier de police GD suivant a été créé à partir de l'image ci-haut:</label>\r
-           <label index="gdFontFileNotCreated">Le fichier de police GD suivant n'a pas pu être créé:</label>\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </data>\r
-    <orig_hash type="array">\r
-        <languageKey index="default" type="array">\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </orig_hash>\r
-    <orig_text type="array">\r
-        <languageKey index="default" type="array">\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </orig_text>\r
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+    <meta type="array">
+        <description>GD Font Maker for freeCap CAPTCHA</description>
+        <type>module</type>
+        <csh_table></csh_table>
+        <labelContext type="array">
+        </labelContext>
+    </meta>
+    <data type="array">
+        <languageKey index="default" type="array">
+            <label index="title">Make GD Font for freeCap CAPTCHA</label>
+            <label index="charactersToIncludeInFont">Characters included in font:</label>
+            <label index="numbers-only">Numbers only (0-9)</label>
+           <label index="ASCII-lowercase-letters">ASCII lowercase letters (a-z)</label>
+           <label index="ANSI-extended-ASCII-lowercase-letters">ANSI-extended ASCII lowercase letters (a-z,ß-ÿ)</label>
+            <label index="characterWidth">Character width:</label>
+            <label index="characterHeight">Character height:</label>
+            <label index="endianness">Byte order (Endianness):</label>
+            <label index="littleEndian">Little-endian</label>
+            <label index="bigEndian">Big-endian</label>
+            <label index="pathToTTFFile">Path to source TTF font file relative to TYPO3 site:</label>
+            <label index="gdFontFilePrefix">Prefix of GD font file name to create:</label>
+           <label index="makeFont">Make font</label>
+           <label index="usingFontFile">The following TTF font file is used as source:</label>
+           <label index="ttfFontFileNotFound">The source TTF font file could not be found:</label>
+           <label index="pngImageCreated">The following PNG image was created:</label>
+           <label index="gdFontFileCreated">The following GD font file was created from the above image:</label>
+           <label index="gdFontFileNotCreated">The following GD font file could not be created:</label>
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+            <label index="title">Fabrication d'une police de caractères GD pour freeCap CAPTCHA</label>
+           <label index="charactersToIncludeInFont">Caractères inclus dans la police:</label>
+           <label index="numbers-only">Chiffres seulement (0-9)</label>
+           <label index="ASCII-lowercase-letters">Lettres minuscules ASCII (a-z)</label>
+           <label index="ANSI-extended-ASCII-lowercase-letters">Lettres minuscules ASCII étendu par ANSI (a-z,ß-ÿ)</label>
+            <label index="characterWidth">Largeur des caractères:</label>
+            <label index="characterHeight">Hauteur des caractères:</label>
+            <label index="endianness">Ordre des octets (endianness):</label>
+            <label index="littleEndian">Petit-boutiste</label>
+            <label index="bigEndian">Gros-boutiste</label>
+            <label index="pathToTTFFile">Chemin jusqu'au fichier de police TTF d'entrée relativement au site TYPO3:</label>
+           <label index="gdFontFilePrefix">Préfixe du nom du fichier de police GD à créer:</label>
+           <label index="makeFont">Fabriquer la police</label>
+           <label index="usingFontFile">Le fichier de police TTF suivant est utilisé en entrée:</label>
+           <label index="ttfFontFileNotFound">Le fichier de police TTF d'entrée n'a pas été trouvé:</label>
+           <label index="pngImageCreated">L'image PNG suivante a été créée:</label>
+           <label index="gdFontFileCreated">Le fichier de police GD suivant a été créé à partir de l'image ci-haut:</label>
+           <label index="gdFontFileNotCreated">Le fichier de police GD suivant n'a pas pu être créé:</label>
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </data>
+    <orig_hash type="array">
+        <languageKey index="default" type="array">
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </orig_hash>
+    <orig_text type="array">
+        <languageKey index="default" type="array">
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </orig_text>
 </T3locallang>
\ No newline at end of file
index c37b3df..c242326 100644 (file)
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
-<T3locallang>\r
-    <meta type="array">\r
-        <description>sr_freecap font maker module</description>\r
-        <type>module</type>\r
-        <csh_table></csh_table>\r
-        <labelContext type="array">\r
-        </labelContext>\r
-    </meta>\r
-    <data type="array">\r
-        <languageKey index="default" type="array">\r
-            <label index="mlang_labels_tablabel">GD Font Maker for freeCap CAPTCHA</label>\r
-            <label index="mlang_labels_tabdescr">Makes GD font files for use by freeCap CAPTCHA.</label>\r
-            <label index="mlang_tabs_tab">GD Font Maker</label>\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-            <label index="mlang_labels_tablabel">Polices de caractères GD pour freeCap CAPTCHA</label>\r
-            <label index="mlang_labels_tabdescr">Ce module permet de fabriquer des polices de caratères GD pour utilisation par freeCap CAPTCHA.</label>\r
-            <label index="mlang_tabs_tab">Polices GD</label>\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </data>\r
-    <orig_hash type="array">\r
-        <languageKey index="default" type="array">\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </orig_hash>\r
-    <orig_text type="array">\r
-        <languageKey index="default" type="array">\r
-        </languageKey>\r
-        <languageKey index="dk" type="array">\r
-        </languageKey>\r
-        <languageKey index="de" type="array">\r
-        </languageKey>\r
-        <languageKey index="no" type="array">\r
-        </languageKey>\r
-        <languageKey index="it" type="array">\r
-        </languageKey>\r
-        <languageKey index="fr" type="array">\r
-        </languageKey>\r
-        <languageKey index="es" type="array">\r
-        </languageKey>\r
-        <languageKey index="nl" type="array">\r
-        </languageKey>\r
-        <languageKey index="cz" type="array">\r
-        </languageKey>\r
-        <languageKey index="pl" type="array">\r
-        </languageKey>\r
-        <languageKey index="si" type="array">\r
-        </languageKey>\r
-        <languageKey index="fi" type="array">\r
-        </languageKey>\r
-        <languageKey index="tr" type="array">\r
-        </languageKey>\r
-        <languageKey index="se" type="array">\r
-        </languageKey>\r
-        <languageKey index="pt" type="array">\r
-        </languageKey>\r
-        <languageKey index="ru" type="array">\r
-        </languageKey>\r
-        <languageKey index="ro" type="array">\r
-        </languageKey>\r
-        <languageKey index="ch" type="array">\r
-        </languageKey>\r
-        <languageKey index="sk" type="array">\r
-        </languageKey>\r
-        <languageKey index="lt" type="array">\r
-        </languageKey>\r
-        <languageKey index="is" type="array">\r
-        </languageKey>\r
-        <languageKey index="hr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hu" type="array">\r
-        </languageKey>\r
-        <languageKey index="gl" type="array">\r
-        </languageKey>\r
-        <languageKey index="th" type="array">\r
-        </languageKey>\r
-        <languageKey index="gr" type="array">\r
-        </languageKey>\r
-        <languageKey index="hk" type="array">\r
-        </languageKey>\r
-        <languageKey index="eu" type="array">\r
-        </languageKey>\r
-        <languageKey index="bg" type="array">\r
-        </languageKey>\r
-        <languageKey index="br" type="array">\r
-        </languageKey>\r
-        <languageKey index="et" type="array">\r
-        </languageKey>\r
-        <languageKey index="ar" type="array">\r
-        </languageKey>\r
-        <languageKey index="he" type="array">\r
-        </languageKey>\r
-        <languageKey index="ua" type="array">\r
-        </languageKey>\r
-        <languageKey index="lv" type="array">\r
-        </languageKey>\r
-        <languageKey index="jp" type="array">\r
-        </languageKey>\r
-        <languageKey index="vn" type="array">\r
-        </languageKey>\r
-        <languageKey index="ca" type="array">\r
-        </languageKey>\r
-        <languageKey index="ba" type="array">\r
-        </languageKey>\r
-        <languageKey index="kr" type="array">\r
-        </languageKey>\r
-        <languageKey index="eo" type="array">\r
-        </languageKey>\r
-        <languageKey index="my" type="array">\r
-        </languageKey>\r
-        <languageKey index="hi" type="array">\r
-        </languageKey>\r
-    </orig_text>\r
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+    <meta type="array">
+        <description>sr_freecap font maker module</description>
+        <type>module</type>
+        <csh_table></csh_table>
+        <labelContext type="array">
+        </labelContext>
+    </meta>
+    <data type="array">
+        <languageKey index="default" type="array">
+            <label index="mlang_labels_tablabel">GD Font Maker for freeCap CAPTCHA</label>
+            <label index="mlang_labels_tabdescr">Makes GD font files for use by freeCap CAPTCHA.</label>
+            <label index="mlang_tabs_tab">GD Font Maker</label>
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+            <label index="mlang_labels_tablabel">Polices de caractères GD pour freeCap CAPTCHA</label>
+            <label index="mlang_labels_tabdescr">Ce module permet de fabriquer des polices de caratères GD pour utilisation par freeCap CAPTCHA.</label>
+            <label index="mlang_tabs_tab">Polices GD</label>
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </data>
+    <orig_hash type="array">
+        <languageKey index="default" type="array">
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </orig_hash>
+    <orig_text type="array">
+        <languageKey index="default" type="array">
+        </languageKey>
+        <languageKey index="dk" type="array">
+        </languageKey>
+        <languageKey index="de" type="array">
+        </languageKey>
+        <languageKey index="no" type="array">
+        </languageKey>
+        <languageKey index="it" type="array">
+        </languageKey>
+        <languageKey index="fr" type="array">
+        </languageKey>
+        <languageKey index="es" type="array">
+        </languageKey>
+        <languageKey index="nl" type="array">
+        </languageKey>
+        <languageKey index="cz" type="array">
+        </languageKey>
+        <languageKey index="pl" type="array">
+        </languageKey>
+        <languageKey index="si" type="array">
+        </languageKey>
+        <languageKey index="fi" type="array">
+        </languageKey>
+        <languageKey index="tr" type="array">
+        </languageKey>
+        <languageKey index="se" type="array">
+        </languageKey>
+        <languageKey index="pt" type="array">
+        </languageKey>
+        <languageKey index="ru" type="array">
+        </languageKey>
+        <languageKey index="ro" type="array">
+        </languageKey>
+        <languageKey index="ch" type="array">
+        </languageKey>
+        <languageKey index="sk" type="array">
+        </languageKey>
+        <languageKey index="lt" type="array">
+        </languageKey>
+        <languageKey index="is" type="array">
+        </languageKey>
+        <languageKey index="hr" type="array">
+        </languageKey>
+        <languageKey index="hu" type="array">
+        </languageKey>
+        <languageKey index="gl" type="array">
+        </languageKey>
+        <languageKey index="th" type="array">
+        </languageKey>
+        <languageKey index="gr" type="array">
+        </languageKey>
+        <languageKey index="hk" type="array">
+        </languageKey>
+        <languageKey index="eu" type="array">
+        </languageKey>
+        <languageKey index="bg" type="array">
+        </languageKey>
+        <languageKey index="br" type="array">
+        </languageKey>
+        <languageKey index="et" type="array">
+        </languageKey>
+        <languageKey index="ar" type="array">
+        </languageKey>
+        <languageKey index="he" type="array">
+        </languageKey>
+        <languageKey index="ua" type="array">
+        </languageKey>
+        <languageKey index="lv" type="array">
+        </languageKey>
+        <languageKey index="jp" type="array">
+        </languageKey>
+        <languageKey index="vn" type="array">
+        </languageKey>
+        <languageKey index="ca" type="array">
+        </languageKey>
+        <languageKey index="ba" type="array">
+        </languageKey>
+        <languageKey index="kr" type="array">
+        </languageKey>
+        <languageKey index="eo" type="array">
+        </languageKey>
+        <languageKey index="my" type="array">
+        </languageKey>
+        <languageKey index="hi" type="array">
+        </languageKey>
+    </orig_text>
 </T3locallang>
\ No newline at end of file
index d76defb..643a519 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2005-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>\r
-*  All rights reserved\r
-*\r
-*  This script is part of the Typo3 project. The Typo3 project is\r
-*  free software; you can redistribute it and/or modify\r
-*  it under the terms of the GNU General Public License as published by\r
-*  the Free Software Foundation; either version 2 of the License, or\r
-*  (at your option) any later version.\r
-*\r
-*  The GNU General Public License can be found at\r
-*  http://www.gnu.org/copyleft/gpl.html.\r
-*\r
-*  This script is distributed in the hope that it will be useful,\r
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*  GNU General Public License for more details.\r
-*\r
-*  This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-/**\r
-* This script invokes the freecap CAPTCHA image generation\r
-*\r
-*/\r
-error_reporting (E_ALL ^ E_NOTICE);\r
-define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='xcgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):((!empty($_SERVER['ORIG_SCRIPT_FILENAME'])&&isset($_SERVER['ORIG_SCRIPT_FILENAME']))?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));\r
-if (!defined('PATH_site')) define('PATH_site', dirname(dirname(dirname(dirname(dirname(PATH_thisScript))))).'/');\r
-if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');\r
-define('PATH_typo3conf', PATH_site.'typo3conf/');\r
-define('TYPO3_mainDir', 'typo3/');\r
-if (!defined('PATH_typo3')) define('PATH_typo3', PATH_site.TYPO3_mainDir);\r
-if (!defined('PATH_tslib')) {\r
-       if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {\r
-               define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');\r
-       } elseif (@is_dir(PATH_site.'tslib/')) {\r
-               define('PATH_tslib', PATH_site.'tslib/');\r
-       }\r
-}\r
-define('TYPO3_MODE','FE');\r
-define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');\r
-\r
-require_once(PATH_t3lib.'class.t3lib_div.php');\r
-require_once(PATH_t3lib.'class.t3lib_extmgm.php');\r
-require_once(PATH_t3lib.'config_default.php');\r
-require_once(PATH_typo3conf.'localconf.php');\r
-require_once(PATH_tslib.'class.tslib_fe.php');\r
-require_once(PATH_t3lib.'class.t3lib_tstemplate.php');\r
-require_once(PATH_t3lib.'class.t3lib_page.php');\r
-require_once(PATH_tslib.'class.tslib_content.php');\r
-require_once(t3lib_extMgm::extPath('sr_freecap').'pi1/class.tx_srfreecap_pi1.php');\r
-require_once(PATH_t3lib.'class.t3lib_userauth.php');\r
-require_once(PATH_tslib.'class.tslib_feuserauth.php');\r
-require_once(PATH_t3lib.'class.t3lib_cs.php');\r
-\r
-if (!defined ('TYPO3_db'))  die ('The configuration file was not included.');\r
-if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_COOKIE['GLOBALS'])) die('You cannot set the GLOBALS-array from outside this script.');\r
-\r
-require_once(PATH_t3lib.'class.t3lib_db.php');\r
-$TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');\r
-\r
-require_once(PATH_t3lib.'class.t3lib_timetrack.php');\r
-$GLOBALS['TT'] = new t3lib_timeTrack;\r
-\r
-if (t3lib_div::int_from_ver( TYPO3_version ) >= 4003000) {\r
-       // ***********************************\r
-       // Initializing the Caching System\r
-       // ***********************************\r
-       $GLOBALS['TT']->push('Initializing the Caching System','');\r
-               require_once(PATH_t3lib . 'class.t3lib_cache.php');\r
-\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractbackend.php');\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractcache.php');\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_exception.php');\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_factory.php');\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_manager.php');\r
-               require_once(PATH_t3lib . 'cache/class.t3lib_cache_variablecache.php');\r
-\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_classalreadyloaded.php');\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_duplicateidentifier.php');\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidbackend.php');\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidcache.php');\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invaliddata.php');\r
-               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_nosuchcache.php');\r
-\r
-               $typo3CacheManager = t3lib_div::makeInstance('t3lib_cache_Manager');\r
-               $cacheFactoryClass = t3lib_div::makeInstanceClassName('t3lib_cache_Factory');\r
-               $typo3CacheFactory = new $cacheFactoryClass($typo3CacheManager);\r
-\r
-               unset($cacheFactoryClass);\r
-       $GLOBALS['TT']->pull();\r
-}\r
-\r
-// ***********************************\r
-// Creating a $TSFE object\r
-// ***********************************\r
-$TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');\r
-$id = t3lib_div::_GET('id');\r
-if (!isset($id)) $id = 0;\r
-$id = htmlspecialchars($id);\r
-$TSFE = new $TSFEclassName($TYPO3_CONF_VARS, $id, '0', 1, '', '','','');\r
-if (t3lib_div::int_from_ver( TYPO3_version ) >= 4003000) {\r
-       $TSFE->initCaches();\r
-}\r
-$TSFE->set_no_cache();\r
-$TSFE->connectToDB();\r
-$TSFE->initFEuser();\r
-$TSFE->determineId();\r
-$TSFE->initTemplate();\r
-$TSFE->tmpl->getFileName_backPath = PATH_site;\r
-\r
-// ******************************************************\r
-// Get config if not already gotten\r
-// After this, we should have a valid config-array ready\r
-// ******************************************************\r
-$TSFE->getConfigArray();\r
-\r
-// *******************************************\r
-// Setting language and locale\r
-// *******************************************\r
-$GLOBALS['TT']->push('Setting language and locale','');\r
-       $TSFE->settingLanguage();\r
-       $TSFE->settingLocale();\r
-$GLOBALS['TT']->pull();\r
-\r
-// *******************************************\r
-// Invoke the freecap plugin\r
-// *******************************************\r
-$freecap = t3lib_div::makeInstance('tx_srfreecap_pi1');\r
-$freecap->cObj = t3lib_div::makeInstance('tslib_cObj');\r
-$conf = $TSFE->tmpl->setup['plugin.'][$freecap->prefixId.'.'];\r
-$freecap->main($conf);\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2005-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  All rights reserved
+*
+*  This script is part of the Typo3 project. The Typo3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+* This script invokes the freecap CAPTCHA image generation
+*
+*/
+error_reporting (E_ALL ^ E_NOTICE);
+define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='xcgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):((!empty($_SERVER['ORIG_SCRIPT_FILENAME'])&&isset($_SERVER['ORIG_SCRIPT_FILENAME']))?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
+if (!defined('PATH_site')) define('PATH_site', dirname(dirname(dirname(dirname(dirname(PATH_thisScript))))).'/');
+if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
+define('PATH_typo3conf', PATH_site.'typo3conf/');
+define('TYPO3_mainDir', 'typo3/');
+if (!defined('PATH_typo3')) define('PATH_typo3', PATH_site.TYPO3_mainDir);
+if (!defined('PATH_tslib')) {
+       if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
+               define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
+       } elseif (@is_dir(PATH_site.'tslib/')) {
+               define('PATH_tslib', PATH_site.'tslib/');
+       }
+}
+define('TYPO3_MODE','FE');
+define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
+
+require_once(PATH_t3lib.'class.t3lib_div.php');
+require_once(PATH_t3lib.'class.t3lib_extmgm.php');
+require_once(PATH_t3lib.'config_default.php');
+require_once(PATH_typo3conf.'localconf.php');
+require_once(PATH_tslib.'class.tslib_fe.php');
+require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
+require_once(PATH_t3lib.'class.t3lib_page.php');
+require_once(PATH_tslib.'class.tslib_content.php');
+require_once(t3lib_extMgm::extPath('sr_freecap').'pi1/class.tx_srfreecap_pi1.php');
+require_once(PATH_t3lib.'class.t3lib_userauth.php');
+require_once(PATH_tslib.'class.tslib_feuserauth.php');
+require_once(PATH_t3lib.'class.t3lib_cs.php');
+
+if (!defined ('TYPO3_db'))  die ('The configuration file was not included.');
+if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_COOKIE['GLOBALS'])) die('You cannot set the GLOBALS-array from outside this script.');
+
+require_once(PATH_t3lib.'class.t3lib_db.php');
+$TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
+
+require_once(PATH_t3lib.'class.t3lib_timetrack.php');
+$GLOBALS['TT'] = new t3lib_timeTrack;
+
+if (t3lib_div::int_from_ver( TYPO3_version ) >= 4003000) {
+       // ***********************************
+       // Initializing the Caching System
+       // ***********************************
+       $GLOBALS['TT']->push('Initializing the Caching System','');
+               require_once(PATH_t3lib . 'class.t3lib_cache.php');
+
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractbackend.php');
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractcache.php');
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_exception.php');
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_factory.php');
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_manager.php');
+               require_once(PATH_t3lib . 'cache/class.t3lib_cache_variablecache.php');
+
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_classalreadyloaded.php');
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_duplicateidentifier.php');
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidbackend.php');
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidcache.php');
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invaliddata.php');
+               require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_nosuchcache.php');
+
+               $typo3CacheManager = t3lib_div::makeInstance('t3lib_cache_Manager');
+               $cacheFactoryClass = t3lib_div::makeInstanceClassName('t3lib_cache_Factory');
+               $typo3CacheFactory = new $cacheFactoryClass($typo3CacheManager);
+
+               unset($cacheFactoryClass);
+       $GLOBALS['TT']->pull();
+}
+
+// ***********************************
+// Creating a $TSFE object
+// ***********************************
+$TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
+$id = t3lib_div::_GET('id');
+if (!isset($id)) $id = 0;
+$id = htmlspecialchars($id);
+$TSFE = new $TSFEclassName($TYPO3_CONF_VARS, $id, '0', 1, '', '','','');
+if (t3lib_div::int_from_ver( TYPO3_version ) >= 4003000) {
+       $TSFE->initCaches();
+}
+$TSFE->set_no_cache();
+$TSFE->connectToDB();
+$TSFE->initFEuser();
+$TSFE->determineId();
+$TSFE->initTemplate();
+$TSFE->tmpl->getFileName_backPath = PATH_site;
+
+// ******************************************************
+// Get config if not already gotten
+// After this, we should have a valid config-array ready
+// ******************************************************
+$TSFE->getConfigArray();
+
+// *******************************************
+// Setting language and locale
+// *******************************************
+$GLOBALS['TT']->push('Setting language and locale','');
+       $TSFE->settingLanguage();
+       $TSFE->settingLocale();
+$GLOBALS['TT']->pull();
+
+// *******************************************
+// Invoke the freecap plugin
+// *******************************************
+$freecap = t3lib_div::makeInstance('tx_srfreecap_pi1');
+$freecap->cObj = t3lib_div::makeInstance('tslib_cObj');
+$conf = $TSFE->tmpl->setup['plugin.'][$freecap->prefixId.'.'];
+$freecap->main($conf);
 ?>
\ No newline at end of file
index 1d15cbd..3b6a7f6 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2005-2008 Stanislas Rolland (typo3(arobas)sjbr.ca)\r
-*  All rights reserved\r
-*\r
-*  This script is part of the TYPO3 project. The TYPO3 project is\r
-*  free software; you can redistribute it and/or modify\r
-*  it under the terms of the GNU General Public License as published by\r
-*  the Free Software Foundation; either version 2 of the License, or\r
-*  (at your option) any later version.\r
-*\r
-*  The GNU General Public License can be found at\r
-*  http://www.gnu.org/copyleft/gpl.html.\r
-*  A copy is found in the textfile GPL.txt and important notices to the license\r
-*  from the author is found in LICENSE.txt distributed with these scripts.\r
-*\r
-*\r
-*  This script is distributed in the hope that it will be useful,\r
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*  GNU General Public License for more details.\r
-*\r
-*  This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-/**\r
- * Integrates freeCap v1.4.1 into TYPO3 and generates the freeCap CAPTCHA image.\r
- *\r
- *\r
- * @author     Stanislas Rolland       <typo3(arobas)sjbr.ca>\r
- */\r
-/************************************************************\\r
-*\r
-*              freeCap v1.4.1 Copyright 2005 Howard Yeend\r
-*              www.puremango.co.uk\r
-*\r
-*    This file is part of freeCap.\r
-*\r
-*    freeCap is free software; you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation; either version 2 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    freeCap is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-*\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with freeCap; if not, write to the Free Software\r
-*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*\r
-*\r
-\************************************************************/\r
-\r
-require_once(PATH_tslib.'class.tslib_pibase.php');\r
-\r
-class tx_srfreecap_pi1 extends tslib_pibase {\r
-       var $cObj;                              // The backReference to the mother cObj object set at call time\r
-       var $prefixId = 'tx_srfreecap_pi1';     // Same as class name\r
-       var $scriptRelPath = 'pi1/class.tx_srfreecap_pi1.php';  // Path to this script relative to the extension dir.\r
-       var $extKey = 'sr_freecap';             // The extension key.\r
-       var $extPrefix = 'tx_srfreecap';\r
-       var $conf = array();\r
-\r
-       function main($conf) {\r
-               $this->conf = $conf;\r
-               $this->pi_loadLL();\r
-\r
-                       // Get session data\r
-               $this->sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses','tx_'.$this->extKey);\r
-\r
-               //////////////////////////////////////////////////////\r
-               ////// User Defined Vars:\r
-               //////////////////////////////////////////////////////\r
-\r
-               // try to avoid the 'free p*rn' method of CAPTCHA circumvention\r
-               // see www.wikipedia.com/captcha for more info\r
-               $this->site_tags[0] = "To avoid spam, please do NOT enter the text if";\r
-               $this->site_tags[1] = "this site is not puremango.co.uk";\r
-               // or more simply:\r
-               //$site_tags[0] = "for use only on puremango.co.uk";\r
-               // reword or add lines as you please\r
-               // or if you don't want any text:\r
-               $this->site_tags = $this->conf['siteTag'] ? explode('|', sprintf($this->pi_getLL('site_tag'), (isset($this->conf['siteTagDomain']) ? $this->conf['siteTagDomain'] : 'www.typo3.org'))) : null;\r
-               // where to write the above:\r
-               // 0=top\r
-               // 1=bottom\r
-               // 2=both\r
-               $this->tag_pos = isset($this->conf['siteTagPosition']) ? $this->conf['siteTagPosition'] : 1;\r
-\r
-               // which type of hash to use?\r
-               // possible values: "sha1", "md5", "crc32"\r
-               // sha1 supported by PHP4.3.0+\r
-               // md5 supported by PHP3+\r
-               // crc32 supported by PHP4.0.1+\r
-               // store in session so can validate in form processor\r
-               $this->sessionData[$this->extKey . '_hash_func'] = 'md5';\r
-\r
-               // image type:\r
-               // possible values: "jpg", "png", "gif"\r
-               // jpg doesn't support transparency (transparent bg option ends up white)\r
-               // png isn't supported by old browsers (see http://www.libpng.org/pub/png/pngstatus.html)\r
-               // gif may not be supported by your GD Lib.\r
-               $this->output = $this->conf['imageFormat'] ? $this->conf['imageFormat'] : 'png';\r
-               \r
-               // true = generate pseudo-random string, false = use dictionary\r
-               // dictionary is easier to recognise\r
-               // - both for humans and computers, so use random string if you're paranoid.\r
-               $this->use_dict = $this->conf['useWordsList'] ? true : false;\r
-               \r
-               // if your server is NOT set up to deny web access to files beginning ".ht"\r
-               // then you should ensure the dictionary file is kept outside the web directory\r
-               // eg: if www.foo.com/index.html points to c:\website\www\index.html\r
-               // then the dictionary should be placed in c:\website\dict.txt\r
-               // test your server's config by trying to access the dictionary through a web browser\r
-               // you should NOT be able to view the contents.\r
-               // can leave this blank if not using dictionary\r
-               if (!trim($this->conf['defaultWordsList'])) {\r
-                       $this->conf['defaultWordsList'] = 'EXT:sr_freecap/res/words/.ht_default_freecap_words';\r
-               }\r
-               if (is_file(dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_' . $this->LLkey . '_freecap_words')) {\r
-                       $this->dict_location = dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_' . $this->LLkey . '_freecap_words';\r
-               } elseif (is_file(dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_default_freecap_words')) {\r
-                       $this->dict_location = dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_default_freecap_words';\r
-               }\r
-               \r
-               // used to calculate image width, and for non-dictionary word generation\r
-               $this->max_word_length = $this->conf['maxWordLength'] ? $this->conf['maxWordLength'] : 6;\r
-               \r
-               // text colour\r
-               // 0=one random colour for all letters\r
-               // 1=different random colour for each letter\r
-               if ($this->conf['textColor'] == '0') {\r
-                       $this->col_type = 0;\r
-               } else {\r
-                       $this->col_type = 1;\r
-               }\r
-\r
-               // maximum times a user can refresh the image\r
-               // on a 6500 word dictionary, I think 15-50 is enough to not annoy users and make BF unfeasble.\r
-               // further notes re: BF attacks in "avoid brute force attacks" section, below\r
-               // on the other hand, those attempting OCR will find the ability to request new images\r
-               // very useful; if they can't crack one, just grab an easier target...\r
-               // for the ultra-paranoid, setting it to <5 will still work for most users\r
-               $this->max_attempts = $this->conf['maxAttempts'] ? $this->conf['maxAttempts'] : 50;\r
-               \r
-               // list of fonts to use\r
-               // font size should be around 35 pixels wide for each character.\r
-               // you can use my GD fontmaker script at www.puremango.co.uk to create your own fonts\r
-               // There are other programs to can create GD fonts, but my script allows a greater\r
-               // degree of control over exactly how wide each character is, and is therefore\r
-               // recommended for 'special' uses. For normal use of GD fonts,\r
-               // the GDFontGenerator @ http://www.philiplb.de is excellent for convering ttf to GD\r
-               // the fonts included with freeCap *only* include lowercase alphabetic characters\r
-               // so are not suitable for most other uses\r
-               // to increase security, you really should add other fonts\r
-               if ($this->conf['generateNumbers']) {\r
-                       $this->font_locations = Array('EXT:' . $this->extKey . '/res/fonts/.anonymous.gdf');\r
-               } else {\r
-                       $this->font_locations = Array(\r
-                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font1.gdf',\r
-                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font2.gdf',\r
-                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font3.gdf',\r
-                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font4.gdf',\r
-                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font5.gdf'\r
-                               );\r
-               }\r
-               if ($this->conf['fontFiles']) {\r
-                       $this->font_locations = t3lib_div::trimExplode(',', $this->conf['fontFiles'], 1);\r
-               }\r
-               for ($i = 0; $i < sizeof($this->font_locations); $i++) {\r
-                       if (substr($this->font_locations[$i],0,4)=='EXT:') {\r
-                               $this->font_locations[$i] = t3lib_div::getFileAbsFileName($this->font_locations[$i]);\r
-                       } else {\r
-                               $this->font_locations[$i] = PATH_site.'uploads/'.$this->extPrefix.'/'.$this->font_locations[$i];\r
-                       }\r
-               }\r
-               \r
-               // background:\r
-               // 0=transparent (if jpg, white)\r
-               // 1=white bg with grid\r
-               // 2=white bg with squiggles\r
-               // 3=morphed image blocks\r
-               // 'random' background from v1.3 didn't provide any extra security (according to 2 independent experts)\r
-               // many thanks to http://ocr-research.org.ua and http://sam.zoy.org/pwntcha/ for testing\r
-               // for jpgs, 'transparent' is white\r
-               switch ($this->conf['backgroundType']) {\r
-                       case 'Transparent':\r
-                               $this->bg_type = 0;\r
-                               break;\r
-                       case 'White with grid':\r
-                               $this->bg_type = 1;\r
-                               break;\r
-                       case 'White with squiggles':\r
-                               $this->bg_type = 2;\r
-                               break;\r
-                       case 'Morphed image blocks':\r
-                               $this->bg_type = 3;\r
-                               break;\r
-                       default:\r
-                               $this->bg_type = 2;\r
-                               break;\r
-               }\r
-               \r
-               // text morh factor\r
-               $this->morphFactor = $this->conf['morphFactor'] ? $this->conf['morphFactor'] : 1;\r
-               \r
-               // should we blur the background? (looks nicer, makes text easier to read, takes longer)\r
-               $this->blur_bg = $this->conf['backgroundBlur'] ? true : false;\r
-               \r
-               // for bg_type 3, which images should we use?\r
-               // if you add your own, make sure they're fairly 'busy' images (ie a lot of shapes in them)\r
-               $this->bg_images = Array("../res/images/.ht_freecap_im1.jpg","../res/images/.ht_freecap_im2.jpg","../res/images/.ht_freecap_im3.jpg","../res/images/.ht_freecap_im4.jpg","../res/images/.ht_freecap_im5.jpg");\r
-               \r
-               // for non-transparent backgrounds only:\r
-               // if 0, merges CAPTCHA with bg\r
-               // if 1, write CAPTCHA over bg\r
-               $this->merge_type = $this->conf['mergeWithBackground'] ? 0 : 1;\r
-               \r
-               // should we morph the bg? (recommend yes, but takes a little longer to compute)\r
-               $this->morph_bg = $this->conf['backgroundMorph'] ? true : false;\r
-               \r
-               // you shouldn't need to edit anything below this, but it's extensively commented if you do want to play\r
-               // have fun, and email me with ideas, or improvements to the code (very interested in speed improvements)\r
-               // hope this script saves some spam :-)\r
-               \r
-               // seed random number generator\r
-               // PHP 4.2.0+ doesn't need this, but lower versions will\r
-               $this->seed_func($this->make_seed());\r
-               \r
-                       // read each font and get font character widths\r
-               $this->font_widths = Array();\r
-               for ($i=0 ; $i < sizeof($this->font_locations); $i++)   {\r
-                       $handle = fopen($this->font_locations[$i],"r");\r
-                               // read header of GD font, up to char width\r
-                       $c_wid = fread($handle,12);\r
-                       $this->font_widths[$i] = ord($c_wid{8})+ord($c_wid{9})+ord($c_wid{10})+ord($c_wid{11});\r
-                       fclose($handle);\r
-               }\r
-                       // modify image width depending on maximum possible length of word\r
-                       // you shouldn't need to use words > 6 chars in length really.\r
-               $width = ($this->max_word_length*(array_sum($this->font_widths)/sizeof($this->font_widths))+75);\r
-               $height = $this->conf['imageHeight'] ? $this->conf['imageHeight'] : 90;\r
-               \r
-               $this->im = ImageCreate($width, $height);\r
-               $this->im2 = ImageCreate($width, $height);\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Avoid Brute Force Attacks:\r
-               //////////////////////////////////////////////////////\r
-               \r
-               if (empty($this->sessionData[$this->extKey . '_attempts'])) {\r
-                       $this->sessionData[$this->extKey . '_attempts'] = 1;\r
-               } else {\r
-                       $this->sessionData[$this->extKey . '_attempts']++;\r
-\r
-                       // if more than ($this->max_attempts) refreshes, block further refreshes\r
-                       // can be negated by connecting with new session id\r
-                       // could get round this by storing num attempts in database against IP\r
-                       // could get round that by connecting with different IP (eg, using proxy servers)\r
-                       // in short, there's little point trying to avoid brute forcing\r
-                       // the best way to protect against BF attacks is to ensure the dictionary is not\r
-                       // accessible via the web or use random string option\r
-                       if ($this->sessionData[$this->extKey . '_attempts'] > $this->max_attempts) {\r
-                               $this->sessionData[$this->extKey . '_word_hash'] = false;\r
-                               $string = $this->pi_getLL('max_attempts');\r
-                               $font = 5;\r
-                               $width  = imagefontwidth($font) * strlen($string);\r
-                               $height = imagefontheight($font);\r
-                               $this->im3 = ImageCreate($width+2, $height+20);\r
-                               $bg = ImageColorAllocate($this->im3,255,255,255);\r
-                               ImageColorTransparent($this->im3,$bg);\r
-                               $red = ImageColorAllocate($this->im3, 255, 0, 0);\r
-                               ImageString($this->im3,$font,1,10,$string,$red);\r
-                               $this->sendImage($this->im3);\r
-                               exit();\r
-                       }\r
-               }\r
-               \r
-                       // get word\r
-               $word = $this->getWord();\r
-               \r
-                       // save hash of word for comparison\r
-               // using hash so that if there's an insecurity elsewhere (eg on the form processor),\r
-               // an attacker could only get the hash\r
-               // also, shared servers usually give all users access to the session files\r
-               // echo `ls /tmp`; and echo `more /tmp/someone_elses_session_file`; usually work\r
-               // so even if your site is 100% secure, someone else's site on your server might not be\r
-               // hence, even if attackers can read the session file, they can't get the freeCap word\r
-               // (though most hashes are easy to brute force for simple strings)\r
-               $this->sessionData[$this->extKey . '_word_hash'] = $this->hash_func($word);\r
-               \r
-                       // We use a simple encrypt to prevent the session from being exposed\r
-               if ($this->conf['accessibleOutput'] && in_array('mcrypt', get_loaded_extensions())) {\r
-                       $code = 'accessiblemustbe007';\r
-                       $cyph = $this->easy_crypt($word, $code);\r
-                       $this->sessionData[$this->extKey . '_word_accessible'] = $cyph;\r
-               }\r
-               \r
-                       // Store the session data\r
-               $GLOBALS['TSFE']->fe_user->setKey('ses','tx_'.$this->extKey,$this->sessionData);\r
-               $GLOBALS['TSFE']->storeSessionData();\r
-               \r
-                       // Output image\r
-               $this->buildImage($word, $width, $height);\r
-               \r
-               $this->sendImage($this->im);\r
-               \r
-               // unset all sensetive vars\r
-               // in case someone include()s this file on a shared server\r
-               // you might think this unneccessary, as it exit()s\r
-               // but by using register_shutdown_function\r
-               // on a -very- insecure shared server, they -might- be able to get the word\r
-               unset($word);\r
-               \r
-               exit();\r
-       }\r
-       \r
-               // functions to call for random number generation\r
-               // mt_rand produces 'better' random numbers\r
-               // but if your server doesn't support it, it's fine to use rand instead\r
-               //$this->rand_func = "mt_rand";\r
-               //$this->seed_func = "mt_srand";\r
-       function rand_func($min,$max) {\r
-               return mt_rand($min,$max);\r
-       }\r
-       function seed_func($seed) {\r
-               return mt_srand($seed);\r
-       }\r
-\r
-       function make_seed() {\r
-               // from http://php.net/srand\r
-               list($usec, $sec) = explode(' ', microtime());\r
-               return (float) $sec + ((float) $usec * 100000);\r
-       }\r
-       \r
-       function rand_color() {\r
-               if($this->bg_type==3) {\r
-                       // needs darker colour..\r
-                       return $this->rand_func(10,100);\r
-               } else {\r
-                       return $this->rand_func(60,170);\r
-               }\r
-       }\r
-\r
-       function hash_func($string) {\r
-               return md5($string);\r
-       }\r
-       \r
-       function myImageBlur($im) {\r
-               // w00t. my very own blur function\r
-               // in GD2, there's a gaussian blur function. bunch of bloody show-offs... :-)\r
-\r
-               $width = imagesx($im);\r
-               $height = imagesy($im);\r
-\r
-               $temp_im = ImageCreateTrueColor($width,$height);\r
-               $bg = ImageColorAllocate($temp_im,150,150,150);\r
-\r
-               // preserves transparency if in orig image\r
-               ImageColorTransparent($temp_im,$bg);\r
-\r
-               // fill bg\r
-               ImageFill($temp_im,0,0,$bg);\r
-\r
-               // anything higher than 3 makes it totally unreadable\r
-               // might be useful in a 'real' blur function, though (ie blurring pictures not text)\r
-               $distance = 1;\r
-               // use $distance=30 to have multiple copies of the word. not sure if this is useful.\r
-\r
-               // blur by merging with itself at different x/y offsets:\r
-               ImageCopyMerge($temp_im, $im, 0, 0, 0, $distance, $width, $height-$distance, 70);\r
-               ImageCopyMerge($im, $temp_im, 0, 0, $distance, 0, $width-$distance, $height, 70);\r
-               ImageCopyMerge($temp_im, $im, 0, $distance, 0, 0, $width, $height, 70);\r
-               ImageCopyMerge($im, $temp_im, $distance, 0, 0, 0, $width, $height, 70);\r
-               // remove temp image\r
-               ImageDestroy($temp_im);\r
-\r
-               return $im;\r
-       }\r
-       \r
-       function sendImage($pic) {\r
-               // output image with appropriate headers\r
-               header(base64_decode("WC1DYXB0Y2hhOiBmcmVlQ2FwIDEuNCAtIHd3dy5wdXJlbWFuZ28uY28udWs="));\r
-               switch($this->output) {\r
-                       // add other cases as desired\r
-                       case "jpg":\r
-                               header("Content-Type: image/jpeg");\r
-                               ImageJPEG($pic);\r
-                               break;\r
-                       case "gif":\r
-                               header("Content-Type: image/gif");\r
-                               ImageGIF($pic);\r
-                               break;\r
-                       case "png":\r
-                       default:\r
-                               header("Content-Type: image/png");\r
-                               ImagePNG($pic);\r
-                               break;\r
-               }\r
-               // kill GD images (removes from memory)\r
-               ImageDestroy($this->im);\r
-               ImageDestroy($this->im2);\r
-               if(!empty($this->im3)) {\r
-                       ImageDestroy($this->im3);\r
-               }\r
-               // the below aren't really essential, but might aid an OCR attack if discovered.\r
-               // so we unset them\r
-               unset($this->use_dict);\r
-               unset($this->dict_location);\r
-               unset($this->max_word_length);\r
-               unset($this->bg_type);\r
-               unset($this->bg_images);\r
-               unset($this->merge_type);\r
-               unset($this->morph_bg);\r
-               unset($this->col_type);\r
-               unset($this->max_attempts);\r
-               unset($this->font_locations);\r
-       }\r
-       \r
-       function getWord() {\r
-               \r
-                       // get word\r
-               if($this->use_dict) {\r
-                               // load dictionary and choose random word\r
-                               // keep dictionary in non-web accessible folder, or htaccess it\r
-                               // or modify so word comes from a database; SELECT word FROM words ORDER BY rand() LIMIT 1\r
-                               // took 0.11 seconds when 'words' had 10,000 records\r
-                       \r
-                       $words = @file($this->dict_location);\r
-                       \r
-                       $word = strtolower($words[$this->rand_func(0,sizeof($words)-1)]);\r
-                               // cut off line breaks\r
-                       $word = preg_replace('/['.preg_quote(chr(10).chr(13)).']+/', '', $word);\r
-                               // might be large file so forget it now (frees memory)\r
-                       $words = "";\r
-                       unset($words);\r
-               } else {\r
-                               // based on code originally by breakzero at hotmail dot com\r
-                               // (http://uk.php.net/manual/en/function.rand.php)\r
-                               // generate pseudo-random string\r
-                               // doesn't use ijtf as are easily mistaken\r
-                               \r
-                               // I'm not using numbers because the custom fonts I've created don't support anything other than\r
-                               // lowercase or space (but you can download new fonts or create your own using my GD fontmaker script)\r
-\r
-                       if ($this->conf['generateNumbers']) {\r
-                               $consonants = '123456789';\r
-                               $vowels = '123456789';\r
-                       } else {\r
-                               $consonants = 'bcdghklmnpqrsvwxyz';\r
-                               $vowels = 'aeuo';\r
-                       }\r
-                       $word = "";\r
-\r
-                       $wordlen = $this->rand_func(5,$this->max_word_length);\r
-                       for($i=0 ; $i<$wordlen ; $i++) {\r
-                                       // don't allow to start with 'vowel'\r
-                               if($this->rand_func(0,4)>=2 && $i!=0) {\r
-                                       $word .= $vowels{$this->rand_func(0,strlen($vowels)-1)};\r
-                               } else {\r
-                                       $word .= $consonants{$this->rand_func(0,strlen($consonants)-1)};\r
-                               }\r
-                       }\r
-               }\r
-               return $word;\r
-       }\r
-       \r
-       function buildImage($word, $width, $height) {\r
-               \r
-               // how faded should the bg be? (100=totally gone, 0=bright as the day)\r
-               // to test how much protection the bg noise gives, take a screenshot of the freeCap image\r
-               // and take it into a photo editor. play with contrast and brightness.\r
-               // If you can remove most of the bg, then it's not a good enough percentage\r
-               switch($this->bg_type) {\r
-                       case 0:\r
-                               break;\r
-                       case 1:\r
-                       case 2:\r
-                               $bg_fade_pct = 65;\r
-                               break;\r
-                       case 3:\r
-                               $bg_fade_pct = 50;\r
-                               break;\r
-               }\r
-               // slightly randomise the bg fade\r
-               $bg_fade_pct += $this->rand_func(-2,2);\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Fill BGs and Allocate Colours:\r
-               //////////////////////////////////////////////////////\r
-\r
-               // set tag colour\r
-               // have to do this before any distortion\r
-               // (otherwise colour allocation fails when bg type is 1)\r
-               $tag_col = ImageColorAllocate($this->im,10,10,10);\r
-               $site_tag_col2 = ImageColorAllocate($this->im2,0,0,0);\r
-\r
-               // set debug colours (text colours are set later)\r
-               $debug = ImageColorAllocate($this->im, 255, 0, 0);\r
-               $debug2 = ImageColorAllocate($this->im2, 255, 0, 0);\r
-\r
-               // set background colour (can change to any colour not in possible $text_col range)\r
-               // it doesn't matter as it'll be transparent or coloured over.\r
-               // if you're using bg_type 3, you might want to try to ensure that the color chosen\r
-               // below doesn't appear too much in any of your background images.\r
-               $bg = ImageColorAllocate($this->im, 254, 254, 254);\r
-               $bg2 = ImageColorAllocate($this->im2, 254, 254, 254);\r
-\r
-               // set transparencies\r
-               ImageColorTransparent($this->im,$bg);\r
-               // im2 transparent to allow characters to overlap slightly while morphing\r
-               ImageColorTransparent($this->im2,$bg2);\r
-\r
-               // fill backgrounds\r
-               ImageFill($this->im,0,0,$bg);\r
-               ImageFill($this->im2,0,0,$bg2);\r
-\r
-               if($this->bg_type!=0) {\r
-                       // generate noisy background, to be merged with CAPTCHA later\r
-                       // any suggestions on how best to do this much appreciated\r
-                       // sample code would be even better!\r
-                       // I'm not an OCR expert (hell, I'm not even an image expert; puremango.co.uk was designed in MsPaint)\r
-                       // so the noise models are based around my -guesswork- as to what would make it hard for an OCR prog\r
-                       // ideally, the character obfuscation would be strong enough not to need additional background noise\r
-                       // in any case, I hope at least one of the options given here provide some extra security!\r
-\r
-                       $this->im3 = ImageCreateTrueColor($width,$height);\r
-                       $temp_bg = ImageCreateTrueColor($width*1.5,$height*1.5);\r
-                       $bg3 = ImageColorAllocate($this->im3,255,255,255);\r
-                       ImageFill($this->im3,0,0,$bg3);\r
-                       $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255);\r
-                       ImageFill($temp_bg,0,0,$temp_bg_col);\r
-                       \r
-                       // we draw all noise onto temp_bg\r
-                       // then if we're morphing, merge from temp_bg to im3\r
-                       // or if not, just copy a $widthx$height portion of $temp_bg to $im3\r
-                       // temp_bg is much larger so that when morphing, the edges retain the noise.\r
-                       \r
-                       if($this->bg_type==1) {\r
-                               // grid bg:\r
-                               \r
-                               // draw grid on x\r
-                               for($i=$this->rand_func(6,20) ; $i<$width*2 ; $i+=$this->rand_func(10,25)) {\r
-                                       ImageSetThickness($temp_bg,$this->rand_func(2,6));\r
-                                       $text_r = $this->rand_func(100,150);\r
-                                       $text_g = $this->rand_func(100,150);\r
-                                       $text_b = $this->rand_func(100,150);\r
-                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);\r
-                                       \r
-                                       ImageLine($temp_bg,$i,0,$i,$height*2,$text_colour3);\r
-                               }\r
-                               // draw grid on y\r
-                               for($i=$this->rand_func(6,20) ; $i<$height*2 ; $i+=$this->rand_func(10,25)) {\r
-                                       ImageSetThickness($temp_bg,$this->rand_func(2,6));\r
-                                       $text_r = $this->rand_func(100,150);\r
-                                       $text_g = $this->rand_func(100,150);\r
-                                       $text_b = $this->rand_func(100,150);\r
-                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);\r
-                                       \r
-                                       ImageLine($temp_bg,0,$i,$width*2, $i ,$text_colour3);\r
-                               }\r
-                       } else if($this->bg_type==2) {\r
-                               // draw squiggles!\r
-                               \r
-                               $bg3 = ImageColorAllocate($this->im3,255,255,255);\r
-                               ImageFill($this->im3,0,0,$bg3);\r
-                               ImageSetThickness($temp_bg,4);\r
-\r
-                               for($i=0 ; $i<strlen($word)+1 ; $i++) {\r
-                                       $text_r = $this->rand_func(100,150);\r
-                                       $text_g = $this->rand_func(100,150);\r
-                                       $text_b = $this->rand_func(100,150);\r
-                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);\r
-\r
-                                       $points = Array();\r
-                                       // draw random squiggle for each character\r
-                                       // the longer the loop, the more complex the squiggle\r
-                                       // keep random so OCR can't say "if found shape has 10 points, ignore it"\r
-                                       // each squiggle will, however, be a closed shape, so OCR could try to find\r
-                                       // line terminations and start from there. (I don't think they're that advanced yet..)\r
-                                       for($j=1 ; $j<$this->rand_func(5,10) ; $j++) {\r
-                                               $points[] = $this->rand_func(1*(20*($i+1)),1*(50*($i+1)));\r
-                                               $points[] = $this->rand_func(30,$height+30);\r
-                                       }\r
-\r
-                                       ImagePolygon($temp_bg,$points,intval(sizeof($points)/2),$text_colour3);\r
-                               }\r
-\r
-                       } else if($this->bg_type==3) {\r
-                               // take random chunks of $this->bg_images and paste them onto the background\r
-\r
-                               for($i=0 ; $i<sizeof($this->bg_images) ; $i++) {\r
-                                       // read each image and its size\r
-                                       $temp_im[$i] = ImageCreateFromJPEG($this->bg_images[$i]);\r
-                                       $temp_width[$i] = imagesx($temp_im[$i]);\r
-                                       $temp_height[$i] = imagesy($temp_im[$i]);\r
-                               }\r
-\r
-                               $blocksize = $this->rand_func(20,60);\r
-                               for($i=0 ; $i<$width*2 ; $i+=$blocksize) {\r
-                                       // could randomise blocksize here... hardly matters\r
-                                       for($j=0 ; $j<$height*2 ; $j+=$blocksize) {\r
-                                               $image_index = $this->rand_func(0,sizeof($temp_im)-1);\r
-                                               $cut_x = $this->rand_func(0,$temp_width[$image_index]-$blocksize);\r
-                                               $cut_y = $this->rand_func(0,$temp_height[$image_index]-$blocksize);\r
-                                               ImageCopy($temp_bg, $temp_im[$image_index], $i, $j, $cut_x, $cut_y, $blocksize, $blocksize);\r
-                                       }\r
-                               }\r
-                               for($i=0 ; $i<sizeof($temp_im) ; $i++) {\r
-                                       // remove bgs from memory\r
-                                       ImageDestroy($temp_im[$i]);\r
-                               }\r
-                               \r
-                               // for debug:\r
-                               //sendImage($temp_bg);\r
-                       }\r
-                       \r
-                       // for debug:\r
-                       //sendImage($this->im3);\r
-                       \r
-                       if($this->morph_bg) {\r
-                               // morph background\r
-                               // we do this separately to the main text morph because:\r
-                               // a) the main text morph is done char-by-char, this is done across whole image\r
-                               // b) if an attacker could un-morph the bg, it would un-morph the CAPTCHA\r
-                               // hence bg is morphed differently to text\r
-                               // why do we morph it at all? it might make it harder for an attacker to remove the background\r
-                               // morph_chunk 1 looks better but takes longer\r
-                               // this is a different and less perfect morph than the one we do on the CAPTCHA\r
-                               // occasonally you get some dark background showing through around the edges\r
-                               // it doesn't need to be perfect as it's only the bg.\r
-                               $morph_chunk = $this->rand_func(1,5);\r
-                               $morph_y = 0;\r
-                               for($x=0 ; $x<$width ; $x+=$morph_chunk) {\r
-                                       $morph_chunk = $this->rand_func(1,5);\r
-                                       $morph_y += $this->rand_func(-1,1);\r
-                                       ImageCopy($this->im3, $temp_bg, $x, 0, $x+30, 30+$morph_y, $morph_chunk, $height*2);\r
-                               }\r
-                               \r
-                               ImageCopy($temp_bg, $this->im3, 0, 0, 0, 0, $width, $height);\r
-                               \r
-                               $morph_x = 0;\r
-                               for($y=0 ; $y<=$height; $y+=$morph_chunk) {\r
-                                       $morph_chunk = $this->rand_func(1,5);\r
-                                       $morph_x += $this->rand_func(-1,1);\r
-                                       ImageCopy($this->im3, $temp_bg, $morph_x, $y, 0, $y, $width, $morph_chunk);\r
-                               \r
-                               }\r
-                       } else {\r
-                               // just copy temp_bg onto im3\r
-                               ImageCopy($this->im3,$temp_bg,0,0,30,30,$width,$height);\r
-                       }\r
-                       \r
-                       ImageDestroy($temp_bg);\r
-                       \r
-                       if($this->blur_bg) {\r
-                               $this->myImageBlur($this->im3);\r
-                       }\r
-               }\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Write Word\r
-               //////////////////////////////////////////////////////\r
-               \r
-               // write word in random starting X position\r
-               $word_start_x = $this->rand_func(5,32);\r
-               // y positions jiggled about later\r
-               $word_start_y = 15;\r
-               \r
-               if($this->col_type==0) {\r
-                       $text_r = $this->rand_color();\r
-                       $text_g = $this->rand_color();\r
-                       $text_b = $this->rand_color();\r
-                       $text_colour2 = ImageColorAllocate($this->im2, $text_r, $text_g, $text_b);\r
-               }\r
-               \r
-               // write each char in different font\r
-               for($i=0 ; $i<strlen($word) ; $i++) {\r
-                       if($this->col_type==1) {\r
-                               $text_r = $this->rand_color();\r
-                               $text_g = $this->rand_color();\r
-                               $text_b = $this->rand_color();\r
-                               $text_colour2 = ImageColorAllocate($this->im2, $text_r, $text_g, $text_b);\r
-                       }\r
-                       \r
-                       $j = $this->rand_func(0,sizeof($this->font_locations)-1);\r
-                       $font = ImageLoadFont($this->font_locations[$j]);\r
-                       ImageString($this->im2, $font, $word_start_x+($this->font_widths[$j]*$i), $word_start_y, $word{$i}, $text_colour2);\r
-               }\r
-               // use last pixelwidth\r
-               $font_pixelwidth = $this->font_widths[$j];\r
-\r
-               // for debug:\r
-               //sendImage($this->im2);\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Morph Image:\r
-               //////////////////////////////////////////////////////\r
-               \r
-               // calculate how big the text is in pixels\r
-               // (so we only morph what we need to)\r
-               $word_pix_size = $word_start_x+(strlen($word)*$font_pixelwidth);\r
-               \r
-               // firstly move each character up or down a bit:\r
-               for($i=$word_start_x ; $i<$word_pix_size ; $i+=$font_pixelwidth) {\r
-                       // move on Y axis\r
-                       // deviates at least 4 pixels between each letter\r
-                       $prev_y = $y_pos;\r
-                       do{\r
-                               $y_pos = $this->rand_func(-5,5);\r
-                       } while($y_pos<$prev_y+2 && $y_pos>$prev_y-2);\r
-                       ImageCopy($this->im, $this->im2, $i, $y_pos, $i, 0, $font_pixelwidth, $height);\r
-               \r
-                       // for debug:\r
-                       //ImageRectangle($this->im,$i,$y_pos+10,$i+$font_pixelwidth,$y_pos+70,$debug);\r
-               }\r
-               \r
-               // for debug:\r
-               //sendImage($this->im);\r
-               \r
-               ImageFilledRectangle($this->im2,0,0,$width,$height,$bg2);\r
-\r
-               // randomly morph each character individually on x-axis\r
-               // this is where the main distortion happens\r
-               // massively improved since v1.2\r
-               $y_chunk = 1;\r
-               $morph_factor = $this->morphFactor;\r
-               $morph_x = 0;\r
-               for($j=0 ; $j<strlen($word) ; $j++) {\r
-                       $y_pos = 0;\r
-                       for($i=0 ; $i<=$height; $i+=$y_chunk) {\r
-                               $orig_x = $word_start_x+($j*$font_pixelwidth);\r
-                               // morph x += so that instead of deviating from orig x each time, we deviate from where we last deviated to\r
-                               // get it? instead of a zig zag, we get more of a sine wave.\r
-                               // I wish we could deviate more but it looks crap if we do.\r
-                               $morph_x += $this->rand_func(-$morph_factor,$morph_factor);\r
-                               // had to change this to ImageCopyMerge when starting using ImageCreateTrueColor\r
-                               // according to the manual; "when (pct is) 100 this function behaves identically to imagecopy()"\r
-                               // but this is NOT true when dealing with transparencies...\r
-                               ImageCopyMerge($this->im2, $this->im, $orig_x+$morph_x, $i+$y_pos, $orig_x, $i, $font_pixelwidth, $y_chunk, 100);\r
-               \r
-                               // for debug:\r
-                               //ImageLine($this->im2, $orig_x+$morph_x, $i, $orig_x+$morph_x+1, $i+$y_chunk, $debug2);\r
-                               //ImageLine($this->im2, $orig_x+$morph_x+$font_pixelwidth, $i, $orig_x+$morph_x+$font_pixelwidth+1, $i+$y_chunk, $debug2);\r
-                       }\r
-               }\r
-               \r
-               // for debug:\r
-               //sendImage($this->im2);\r
-               \r
-               ImageFilledRectangle($this->im,0,0,$width,$height,$bg);\r
-               // now do the same on the y-axis\r
-               // (much easier because we can just do it across the whole image, don't have to do it char-by-char)\r
-               $y_pos = 0;\r
-               $x_chunk = 1;\r
-               for($i=0 ; $i<=$width ; $i+=$x_chunk) {\r
-                       // can result in image going too far off on Y-axis;\r
-                       // not much I can do about that, apart from make image bigger\r
-                       // again, I wish I could do 1.5 pixels\r
-                       $y_pos += $this->rand_func(-1,1);\r
-                       ImageCopy($this->im, $this->im2, $i, $y_pos, $i, 0, $x_chunk, $height);\r
-               \r
-                       // for debug:\r
-                       //ImageLine($this->im,$i+$x_chunk,0,$i+$x_chunk,100,$debug);\r
-                       //ImageLine($this->im,$i,$y_pos+25,$i+$x_chunk,$y_pos+25,$debug);\r
-               }\r
-               \r
-               // for debug:\r
-               //sendImage($this->im);\r
-               \r
-               // blur edges:\r
-               // doesn't really add any security, but looks a lot nicer, and renders text a little easier to read\r
-               // for humans (hopefully not for OCRs, but if you know better, feel free to disable this function)\r
-               // (and if you do, let me know why)\r
-               $this->myImageBlur($this->im);\r
-               \r
-               // for debug:\r
-               //sendImage($this->im);\r
-               \r
-               if($this->output!="jpg" && $this->bg_type==0) {\r
-                       // make background transparent\r
-                       ImageColorTransparent($this->im,$bg);\r
-               }\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Try to avoid 'free p*rn' style CAPTCHA re-use\r
-               //////////////////////////////////////////////////////\r
-               // ('*'ed to stop my site coming up for certain keyword searches on google)\r
-               // can obscure CAPTCHA word in some cases..\r
-               // write site tags 'shining through' the morphed image\r
-               ImageFilledRectangle($this->im2,0,0,$width,$height,$bg2);\r
-               if(is_array($this->site_tags)) {\r
-                       $font = 2;\r
-                       $siteTagFontWidth = 6;\r
-                       $siteTagFontHeight = 10;\r
-                       for($i=0 ; $i<sizeof($this->site_tags) ; $i++) {\r
-                               // ensure tags are centered\r
-                               $tag_width = strlen($this->site_tags[$i])*$siteTagFontWidth+8;\r
-                               // write tag is chosen position\r
-                               if($this->tag_pos==0 || $this->tag_pos==2) {\r
-                                       // write at top\r
-                                       ImageString($this->im2, $font, intval($width/2)-intval($tag_width/2)+5, $siteTagFontHeight*$i, $this->site_tags[$i], $site_tag_col2);\r
-                               }\r
-                               if($this->tag_pos==1 || $this->tag_pos==2) {\r
-                                       // write at bottom\r
-                                       ImageString($this->im2, $font, intval($width/2)-intval($tag_width/2)+5, ($height-((sizeof($this->site_tags)*$siteTagFontHeight+4))+($i*$siteTagFontHeight)), $this->site_tags[$i], $site_tag_col2);\r
-                               }\r
-                       }\r
-               }\r
-               ImageCopyMerge($this->im2,$this->im,0,0,0,0,$width,$height,80);\r
-               ImageCopy($this->im,$this->im2,0,0,0,0,$width,$height);\r
-               \r
-               //////////////////////////////////////////////////////\r
-               ////// Merge with obfuscated background\r
-               //////////////////////////////////////////////////////\r
-               \r
-               if($this->bg_type!=0) {\r
-                       // merge bg image with CAPTCHA image to create smooth background\r
-                       // fade bg:\r
-                       if ($this->bg_type!=3) {\r
-                               $temp_im = ImageCreateTrueColor($width,$height);\r
-                               $white = ImageColorAllocate($temp_im,255,255,255);\r
-                               ImageFill($temp_im,0,0,$white);\r
-                               ImageCopyMerge($this->im3,$temp_im,0,0,0,0,$width,$height,$bg_fade_pct);\r
-                               // for debug:\r
-                               //sendImage($this->im3);\r
-                               ImageDestroy($temp_im);\r
-                               $c_fade_pct = 50;\r
-                       } else {\r
-                               $c_fade_pct = $bg_fade_pct;\r
-                       }\r
-               \r
-                       // captcha over bg:\r
-                       // might want to not blur if using this method\r
-                       // otherwise leaves white-ish border around each letter\r
-                       if ($this->merge_type == 1) {\r
-                               ImageCopyMerge($this->im3,$this->im,0,0,0,0,$width,$height,100);\r
-                               ImageCopy($this->im,$this->im3,0,0,0,0,$width,$height);\r
-                       } else {\r
-                               // bg over captcha:\r
-                               ImageCopyMerge($this->im,$this->im3,0,0,0,0,$width,$height,$c_fade_pct);\r
-                       }\r
-               }\r
-               unset($bg_fade_pct);\r
-               // for debug:\r
-               //sendImage($this->im);\r
-       }\r
-       \r
-       /**\r
-        * Returns the localized label of the LOCAL_LANG key, $key, in utf-8 for gd (in fact gd is limited to Latin2)\r
-        * Notice that for debugging purposes prefixes for the output values can be set with the internal vars ->LLtestPrefixAlt and ->LLtestPrefix\r
-        *\r
-        * @param       string          The key from the LOCAL_LANG array for which to return the value.\r
-        * @param       string          Alternative string to return IF no value is found set for the key, neither for the local language nor the default.\r
-        * @param       boolean         If true, the output label is passed through htmlspecialchars()\r
-        * @return      string          The value from LOCAL_LANG.\r
-        */\r
-       function pi_getLL($key,$alt='',$hsc=FALSE) {\r
-               if (isset($this->LOCAL_LANG[$this->LLkey][$key])) {\r
-                       $word = $this->LOCAL_LANG[$this->LLkey][$key];\r
-                       if ($this->LOCAL_LANG_charset[$this->LLkey][$key]) {\r
-                               $word = $GLOBALS['TSFE']->csConv($word, $this->LOCAL_LANG_charset[$this->LLkey][$key], 'utf-8');\r
-                       }\r
-               } elseif ($this->altLLkey && isset($this->LOCAL_LANG[$this->altLLkey][$key]))   {\r
-                       $word = $this->LOCAL_LANG[$this->altLLkey][$key];\r
-                       if ($this->LOCAL_LANG_charset[$this->altLLkey][$key]) {\r
-                               $word = $GLOBALS['TSFE']->csConv($word, $this->LOCAL_LANG_charset[$this->altLLkey][$key], 'utf-8');\r
-                       }\r
-               } elseif (isset($this->LOCAL_LANG['default'][$key]))    {\r
-                       $word = $this->LOCAL_LANG['default'][$key];\r
-               } else {\r
-                       $word = $this->LLtestPrefixAlt.$alt;\r
-               }\r
-                       // Don't know why the label is twice encoded...\r
-               $word = utf8_decode($word);\r
-               $output = $this->LLtestPrefix.$word;\r
-               if ($hsc) $output = htmlspecialchars($output);\r
-               return $output;\r
-       }\r
-       \r
-       /**\r
-        * Encodes a string.\r
-        * Returns an array with the string as the first element and the initialization vector as the second element\r
-        */\r
-       function easy_crypt($string, $key)      {\r
-               $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC), MCRYPT_RAND);\r
-               $string = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $string, MCRYPT_MODE_CBC, $iv);\r
-               \r
-               return array(base64_encode($string), base64_encode($iv));\r
-       }\r
-       \r
-       /**\r
-        * Decodes a string\r
-        * The first argument is an array as returned by easy_encrypt()\r
-        */\r
-       function easy_decrypt($cyph_arr, $key){\r
-               return trim(mcrypt_decrypt(MCRYPT_BLOWFISH, $key, base64_decode($cyph_arr[0]), MCRYPT_MODE_CBC, base64_decode($cyph_arr[1])));\r
-       }\r
-       \r
-}\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/pi1/class.tx_srfreecap_pi1.php'])  {\r
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/pi1/class.tx_srfreecap_pi1.php']);\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2005-2008 Stanislas Rolland (typo3(arobas)sjbr.ca)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+ * Integrates freeCap v1.4.1 into TYPO3 and generates the freeCap CAPTCHA image.
+ *
+ *
+ * @author     Stanislas Rolland       <typo3(arobas)sjbr.ca>
+ */
+/************************************************************\
+*
+*              freeCap v1.4.1 Copyright 2005 Howard Yeend
+*              www.puremango.co.uk
+*
+*    This file is part of freeCap.
+*
+*    freeCap is free software; you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation; either version 2 of the License, or
+*    (at your option) any later version.
+*
+*    freeCap 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 freeCap; if not, write to the Free Software
+*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+*
+\************************************************************/
+
+require_once(PATH_tslib.'class.tslib_pibase.php');
+
+class tx_srfreecap_pi1 extends tslib_pibase {
+       var $cObj;                              // The backReference to the mother cObj object set at call time
+       var $prefixId = 'tx_srfreecap_pi1';     // Same as class name
+       var $scriptRelPath = 'pi1/class.tx_srfreecap_pi1.php';  // Path to this script relative to the extension dir.
+       var $extKey = 'sr_freecap';             // The extension key.
+       var $extPrefix = 'tx_srfreecap';
+       var $conf = array();
+
+       function main($conf) {
+               $this->conf = $conf;
+               $this->pi_loadLL();
+
+                       // Get session data
+               $this->sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses','tx_'.$this->extKey);
+
+               //////////////////////////////////////////////////////
+               ////// User Defined Vars:
+               //////////////////////////////////////////////////////
+
+               // try to avoid the 'free p*rn' method of CAPTCHA circumvention
+               // see www.wikipedia.com/captcha for more info
+               $this->site_tags[0] = "To avoid spam, please do NOT enter the text if";
+               $this->site_tags[1] = "this site is not puremango.co.uk";
+               // or more simply:
+               //$site_tags[0] = "for use only on puremango.co.uk";
+               // reword or add lines as you please
+               // or if you don't want any text:
+               $this->site_tags = $this->conf['siteTag'] ? explode('|', sprintf($this->pi_getLL('site_tag'), (isset($this->conf['siteTagDomain']) ? $this->conf['siteTagDomain'] : 'www.typo3.org'))) : null;
+               // where to write the above:
+               // 0=top
+               // 1=bottom
+               // 2=both
+               $this->tag_pos = isset($this->conf['siteTagPosition']) ? $this->conf['siteTagPosition'] : 1;
+
+               // which type of hash to use?
+               // possible values: "sha1", "md5", "crc32"
+               // sha1 supported by PHP4.3.0+
+               // md5 supported by PHP3+
+               // crc32 supported by PHP4.0.1+
+               // store in session so can validate in form processor
+               $this->sessionData[$this->extKey . '_hash_func'] = 'md5';
+
+               // image type:
+               // possible values: "jpg", "png", "gif"
+               // jpg doesn't support transparency (transparent bg option ends up white)
+               // png isn't supported by old browsers (see http://www.libpng.org/pub/png/pngstatus.html)
+               // gif may not be supported by your GD Lib.
+               $this->output = $this->conf['imageFormat'] ? $this->conf['imageFormat'] : 'png';
+               
+               // true = generate pseudo-random string, false = use dictionary
+               // dictionary is easier to recognise
+               // - both for humans and computers, so use random string if you're paranoid.
+               $this->use_dict = $this->conf['useWordsList'] ? true : false;
+               
+               // if your server is NOT set up to deny web access to files beginning ".ht"
+               // then you should ensure the dictionary file is kept outside the web directory
+               // eg: if www.foo.com/index.html points to c:\website\www\index.html
+               // then the dictionary should be placed in c:\website\dict.txt
+               // test your server's config by trying to access the dictionary through a web browser
+               // you should NOT be able to view the contents.
+               // can leave this blank if not using dictionary
+               if (!trim($this->conf['defaultWordsList'])) {
+                       $this->conf['defaultWordsList'] = 'EXT:sr_freecap/res/words/.ht_default_freecap_words';
+               }
+               if (is_file(dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_' . $this->LLkey . '_freecap_words')) {
+                       $this->dict_location = dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_' . $this->LLkey . '_freecap_words';
+               } elseif (is_file(dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_default_freecap_words')) {
+                       $this->dict_location = dirname(t3lib_div::getFileAbsFileName($this->conf['defaultWordsList'])) . '/.ht_default_freecap_words';
+               }
+               
+               // used to calculate image width, and for non-dictionary word generation
+               $this->max_word_length = $this->conf['maxWordLength'] ? $this->conf['maxWordLength'] : 6;
+               
+               // text colour
+               // 0=one random colour for all letters
+               // 1=different random colour for each letter
+               if ($this->conf['textColor'] == '0') {
+                       $this->col_type = 0;
+               } else {
+                       $this->col_type = 1;
+               }
+
+               // maximum times a user can refresh the image
+               // on a 6500 word dictionary, I think 15-50 is enough to not annoy users and make BF unfeasble.
+               // further notes re: BF attacks in "avoid brute force attacks" section, below
+               // on the other hand, those attempting OCR will find the ability to request new images
+               // very useful; if they can't crack one, just grab an easier target...
+               // for the ultra-paranoid, setting it to <5 will still work for most users
+               $this->max_attempts = $this->conf['maxAttempts'] ? $this->conf['maxAttempts'] : 50;
+               
+               // list of fonts to use
+               // font size should be around 35 pixels wide for each character.
+               // you can use my GD fontmaker script at www.puremango.co.uk to create your own fonts
+               // There are other programs to can create GD fonts, but my script allows a greater
+               // degree of control over exactly how wide each character is, and is therefore
+               // recommended for 'special' uses. For normal use of GD fonts,
+               // the GDFontGenerator @ http://www.philiplb.de is excellent for convering ttf to GD
+               // the fonts included with freeCap *only* include lowercase alphabetic characters
+               // so are not suitable for most other uses
+               // to increase security, you really should add other fonts
+               if ($this->conf['generateNumbers']) {
+                       $this->font_locations = Array('EXT:' . $this->extKey . '/res/fonts/.anonymous.gdf');
+               } else {
+                       $this->font_locations = Array(
+                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font1.gdf',
+                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font2.gdf',
+                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font3.gdf',
+                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font4.gdf',
+                               'EXT:' . $this->extKey . '/res/fonts/.ht_freecap_font5.gdf'
+                               );
+               }
+               if ($this->conf['fontFiles']) {
+                       $this->font_locations = t3lib_div::trimExplode(',', $this->conf['fontFiles'], 1);
+               }
+               for ($i = 0; $i < sizeof($this->font_locations); $i++) {
+                       if (substr($this->font_locations[$i],0,4)=='EXT:') {
+                               $this->font_locations[$i] = t3lib_div::getFileAbsFileName($this->font_locations[$i]);
+                       } else {
+                               $this->font_locations[$i] = PATH_site.'uploads/'.$this->extPrefix.'/'.$this->font_locations[$i];
+                       }
+               }
+               
+               // background:
+               // 0=transparent (if jpg, white)
+               // 1=white bg with grid
+               // 2=white bg with squiggles
+               // 3=morphed image blocks
+               // 'random' background from v1.3 didn't provide any extra security (according to 2 independent experts)
+               // many thanks to http://ocr-research.org.ua and http://sam.zoy.org/pwntcha/ for testing
+               // for jpgs, 'transparent' is white
+               switch ($this->conf['backgroundType']) {
+                       case 'Transparent':
+                               $this->bg_type = 0;
+                               break;
+                       case 'White with grid':
+                               $this->bg_type = 1;
+                               break;
+                       case 'White with squiggles':
+                               $this->bg_type = 2;
+                               break;
+                       case 'Morphed image blocks':
+                               $this->bg_type = 3;
+                               break;
+                       default:
+                               $this->bg_type = 2;
+                               break;
+               }
+               
+               // text morh factor
+               $this->morphFactor = $this->conf['morphFactor'] ? $this->conf['morphFactor'] : 1;
+               
+               // should we blur the background? (looks nicer, makes text easier to read, takes longer)
+               $this->blur_bg = $this->conf['backgroundBlur'] ? true : false;
+               
+               // for bg_type 3, which images should we use?
+               // if you add your own, make sure they're fairly 'busy' images (ie a lot of shapes in them)
+               $this->bg_images = Array("../res/images/.ht_freecap_im1.jpg","../res/images/.ht_freecap_im2.jpg","../res/images/.ht_freecap_im3.jpg","../res/images/.ht_freecap_im4.jpg","../res/images/.ht_freecap_im5.jpg");
+               
+               // for non-transparent backgrounds only:
+               // if 0, merges CAPTCHA with bg
+               // if 1, write CAPTCHA over bg
+               $this->merge_type = $this->conf['mergeWithBackground'] ? 0 : 1;
+               
+               // should we morph the bg? (recommend yes, but takes a little longer to compute)
+               $this->morph_bg = $this->conf['backgroundMorph'] ? true : false;
+               
+               // you shouldn't need to edit anything below this, but it's extensively commented if you do want to play
+               // have fun, and email me with ideas, or improvements to the code (very interested in speed improvements)
+               // hope this script saves some spam :-)
+               
+               // seed random number generator
+               // PHP 4.2.0+ doesn't need this, but lower versions will
+               $this->seed_func($this->make_seed());
+               
+                       // read each font and get font character widths
+               $this->font_widths = Array();
+               for ($i=0 ; $i < sizeof($this->font_locations); $i++)   {
+                       $handle = fopen($this->font_locations[$i],"r");
+                               // read header of GD font, up to char width
+                       $c_wid = fread($handle,12);
+                       $this->font_widths[$i] = ord($c_wid{8})+ord($c_wid{9})+ord($c_wid{10})+ord($c_wid{11});
+                       fclose($handle);
+               }
+                       // modify image width depending on maximum possible length of word
+                       // you shouldn't need to use words > 6 chars in length really.
+               $width = ($this->max_word_length*(array_sum($this->font_widths)/sizeof($this->font_widths))+75);
+               $height = $this->conf['imageHeight'] ? $this->conf['imageHeight'] : 90;
+               
+               $this->im = ImageCreate($width, $height);
+               $this->im2 = ImageCreate($width, $height);
+               
+               //////////////////////////////////////////////////////
+               ////// Avoid Brute Force Attacks:
+               //////////////////////////////////////////////////////
+               
+               if (empty($this->sessionData[$this->extKey . '_attempts'])) {
+                       $this->sessionData[$this->extKey . '_attempts'] = 1;
+               } else {
+                       $this->sessionData[$this->extKey . '_attempts']++;
+
+                       // if more than ($this->max_attempts) refreshes, block further refreshes
+                       // can be negated by connecting with new session id
+                       // could get round this by storing num attempts in database against IP
+                       // could get round that by connecting with different IP (eg, using proxy servers)
+                       // in short, there's little point trying to avoid brute forcing
+                       // the best way to protect against BF attacks is to ensure the dictionary is not
+                       // accessible via the web or use random string option
+                       if ($this->sessionData[$this->extKey . '_attempts'] > $this->max_attempts) {
+                               $this->sessionData[$this->extKey . '_word_hash'] = false;
+                               $string = $this->pi_getLL('max_attempts');
+                               $font = 5;
+                               $width  = imagefontwidth($font) * strlen($string);
+                               $height = imagefontheight($font);
+                               $this->im3 = ImageCreate($width+2, $height+20);
+                               $bg = ImageColorAllocate($this->im3,255,255,255);
+                               ImageColorTransparent($this->im3,$bg);
+                               $red = ImageColorAllocate($this->im3, 255, 0, 0);
+                               ImageString($this->im3,$font,1,10,$string,$red);
+                               $this->sendImage($this->im3);
+                               exit();
+                       }
+               }
+               
+                       // get word
+               $word = $this->getWord();
+               
+                       // save hash of word for comparison
+               // using hash so that if there's an insecurity elsewhere (eg on the form processor),
+               // an attacker could only get the hash
+               // also, shared servers usually give all users access to the session files
+               // echo `ls /tmp`; and echo `more /tmp/someone_elses_session_file`; usually work
+               // so even if your site is 100% secure, someone else's site on your server might not be
+               // hence, even if attackers can read the session file, they can't get the freeCap word
+               // (though most hashes are easy to brute force for simple strings)
+               $this->sessionData[$this->extKey . '_word_hash'] = $this->hash_func($word);
+               
+                       // We use a simple encrypt to prevent the session from being exposed
+               if ($this->conf['accessibleOutput'] && in_array('mcrypt', get_loaded_extensions())) {
+                       $code = 'accessiblemustbe007';
+                       $cyph = $this->easy_crypt($word, $code);
+                       $this->sessionData[$this->extKey . '_word_accessible'] = $cyph;
+               }
+               
+                       // Store the session data
+               $GLOBALS['TSFE']->fe_user->setKey('ses','tx_'.$this->extKey,$this->sessionData);
+               $GLOBALS['TSFE']->storeSessionData();
+               
+                       // Output image
+               $this->buildImage($word, $width, $height);
+               
+               $this->sendImage($this->im);
+               
+               // unset all sensetive vars
+               // in case someone include()s this file on a shared server
+               // you might think this unneccessary, as it exit()s
+               // but by using register_shutdown_function
+               // on a -very- insecure shared server, they -might- be able to get the word
+               unset($word);
+               
+               exit();
+       }
+       
+               // functions to call for random number generation
+               // mt_rand produces 'better' random numbers
+               // but if your server doesn't support it, it's fine to use rand instead
+               //$this->rand_func = "mt_rand";
+               //$this->seed_func = "mt_srand";
+       function rand_func($min,$max) {
+               return mt_rand($min,$max);
+       }
+       function seed_func($seed) {
+               return mt_srand($seed);
+       }
+
+       function make_seed() {
+               // from http://php.net/srand
+               list($usec, $sec) = explode(' ', microtime());
+               return (float) $sec + ((float) $usec * 100000);
+       }
+       
+       function rand_color() {
+               if($this->bg_type==3) {
+                       // needs darker colour..
+                       return $this->rand_func(10,100);
+               } else {
+                       return $this->rand_func(60,170);
+               }
+       }
+
+       function hash_func($string) {
+               return md5($string);
+       }
+       
+       function myImageBlur($im) {
+               // w00t. my very own blur function
+               // in GD2, there's a gaussian blur function. bunch of bloody show-offs... :-)
+
+               $width = imagesx($im);
+               $height = imagesy($im);
+
+               $temp_im = ImageCreateTrueColor($width,$height);
+               $bg = ImageColorAllocate($temp_im,150,150,150);
+
+               // preserves transparency if in orig image
+               ImageColorTransparent($temp_im,$bg);
+
+               // fill bg
+               ImageFill($temp_im,0,0,$bg);
+
+               // anything higher than 3 makes it totally unreadable
+               // might be useful in a 'real' blur function, though (ie blurring pictures not text)
+               $distance = 1;
+               // use $distance=30 to have multiple copies of the word. not sure if this is useful.
+
+               // blur by merging with itself at different x/y offsets:
+               ImageCopyMerge($temp_im, $im, 0, 0, 0, $distance, $width, $height-$distance, 70);
+               ImageCopyMerge($im, $temp_im, 0, 0, $distance, 0, $width-$distance, $height, 70);
+               ImageCopyMerge($temp_im, $im, 0, $distance, 0, 0, $width, $height, 70);
+               ImageCopyMerge($im, $temp_im, $distance, 0, 0, 0, $width, $height, 70);
+               // remove temp image
+               ImageDestroy($temp_im);
+
+               return $im;
+       }
+       
+       function sendImage($pic) {
+               // output image with appropriate headers
+               header(base64_decode("WC1DYXB0Y2hhOiBmcmVlQ2FwIDEuNCAtIHd3dy5wdXJlbWFuZ28uY28udWs="));
+               switch($this->output) {
+                       // add other cases as desired
+                       case "jpg":
+                               header("Content-Type: image/jpeg");
+                               ImageJPEG($pic);
+                               break;
+                       case "gif":
+                               header("Content-Type: image/gif");
+                               ImageGIF($pic);
+                               break;
+                       case "png":
+                       default:
+                               header("Content-Type: image/png");
+                               ImagePNG($pic);
+                               break;
+               }
+               // kill GD images (removes from memory)
+               ImageDestroy($this->im);
+               ImageDestroy($this->im2);
+               if(!empty($this->im3)) {
+                       ImageDestroy($this->im3);
+               }
+               // the below aren't really essential, but might aid an OCR attack if discovered.
+               // so we unset them
+               unset($this->use_dict);
+               unset($this->dict_location);
+               unset($this->max_word_length);
+               unset($this->bg_type);
+               unset($this->bg_images);
+               unset($this->merge_type);
+               unset($this->morph_bg);
+               unset($this->col_type);
+               unset($this->max_attempts);
+               unset($this->font_locations);
+       }
+       
+       function getWord() {
+               
+                       // get word
+               if($this->use_dict) {
+                               // load dictionary and choose random word
+                               // keep dictionary in non-web accessible folder, or htaccess it
+                               // or modify so word comes from a database; SELECT word FROM words ORDER BY rand() LIMIT 1
+                               // took 0.11 seconds when 'words' had 10,000 records
+                       
+                       $words = @file($this->dict_location);
+                       
+                       $word = strtolower($words[$this->rand_func(0,sizeof($words)-1)]);
+                               // cut off line breaks
+                       $word = preg_replace('/['.preg_quote(chr(10).chr(13)).']+/', '', $word);
+                               // might be large file so forget it now (frees memory)
+                       $words = "";
+                       unset($words);
+               } else {
+                               // based on code originally by breakzero at hotmail dot com
+                               // (http://uk.php.net/manual/en/function.rand.php)
+                               // generate pseudo-random string
+                               // doesn't use ijtf as are easily mistaken
+                               
+                               // I'm not using numbers because the custom fonts I've created don't support anything other than
+                               // lowercase or space (but you can download new fonts or create your own using my GD fontmaker script)
+
+                       if ($this->conf['generateNumbers']) {
+                               $consonants = '123456789';
+                               $vowels = '123456789';
+                       } else {
+                               $consonants = 'bcdghklmnpqrsvwxyz';
+                               $vowels = 'aeuo';
+                       }
+                       $word = "";
+
+                       $wordlen = $this->rand_func(5,$this->max_word_length);
+                       for($i=0 ; $i<$wordlen ; $i++) {
+                                       // don't allow to start with 'vowel'
+                               if($this->rand_func(0,4)>=2 && $i!=0) {
+                                       $word .= $vowels{$this->rand_func(0,strlen($vowels)-1)};
+                               } else {
+                                       $word .= $consonants{$this->rand_func(0,strlen($consonants)-1)};
+                               }
+                       }
+               }
+               return $word;
+       }
+       
+       function buildImage($word, $width, $height) {
+               
+               // how faded should the bg be? (100=totally gone, 0=bright as the day)
+               // to test how much protection the bg noise gives, take a screenshot of the freeCap image
+               // and take it into a photo editor. play with contrast and brightness.
+               // If you can remove most of the bg, then it's not a good enough percentage
+               switch($this->bg_type) {
+                       case 0:
+                               break;
+                       case 1:
+                       case 2:
+                               $bg_fade_pct = 65;
+                               break;
+                       case 3:
+                               $bg_fade_pct = 50;
+                               break;
+               }
+               // slightly randomise the bg fade
+               $bg_fade_pct += $this->rand_func(-2,2);
+               
+               //////////////////////////////////////////////////////
+               ////// Fill BGs and Allocate Colours:
+               //////////////////////////////////////////////////////
+
+               // set tag colour
+               // have to do this before any distortion
+               // (otherwise colour allocation fails when bg type is 1)
+               $tag_col = ImageColorAllocate($this->im,10,10,10);
+               $site_tag_col2 = ImageColorAllocate($this->im2,0,0,0);
+
+               // set debug colours (text colours are set later)
+               $debug = ImageColorAllocate($this->im, 255, 0, 0);
+               $debug2 = ImageColorAllocate($this->im2, 255, 0, 0);
+
+               // set background colour (can change to any colour not in possible $text_col range)
+               // it doesn't matter as it'll be transparent or coloured over.
+               // if you're using bg_type 3, you might want to try to ensure that the color chosen
+               // below doesn't appear too much in any of your background images.
+               $bg = ImageColorAllocate($this->im, 254, 254, 254);
+               $bg2 = ImageColorAllocate($this->im2, 254, 254, 254);
+
+               // set transparencies
+               ImageColorTransparent($this->im,$bg);
+               // im2 transparent to allow characters to overlap slightly while morphing
+               ImageColorTransparent($this->im2,$bg2);
+
+               // fill backgrounds
+               ImageFill($this->im,0,0,$bg);
+               ImageFill($this->im2,0,0,$bg2);
+
+               if($this->bg_type!=0) {
+                       // generate noisy background, to be merged with CAPTCHA later
+                       // any suggestions on how best to do this much appreciated
+                       // sample code would be even better!
+                       // I'm not an OCR expert (hell, I'm not even an image expert; puremango.co.uk was designed in MsPaint)
+                       // so the noise models are based around my -guesswork- as to what would make it hard for an OCR prog
+                       // ideally, the character obfuscation would be strong enough not to need additional background noise
+                       // in any case, I hope at least one of the options given here provide some extra security!
+
+                       $this->im3 = ImageCreateTrueColor($width,$height);
+                       $temp_bg = ImageCreateTrueColor($width*1.5,$height*1.5);
+                       $bg3 = ImageColorAllocate($this->im3,255,255,255);
+                       ImageFill($this->im3,0,0,$bg3);
+                       $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255);
+                       ImageFill($temp_bg,0,0,$temp_bg_col);
+                       
+                       // we draw all noise onto temp_bg
+                       // then if we're morphing, merge from temp_bg to im3
+                       // or if not, just copy a $widthx$height portion of $temp_bg to $im3
+                       // temp_bg is much larger so that when morphing, the edges retain the noise.
+                       
+                       if($this->bg_type==1) {
+                               // grid bg:
+                               
+                               // draw grid on x
+                               for($i=$this->rand_func(6,20) ; $i<$width*2 ; $i+=$this->rand_func(10,25)) {
+                                       ImageSetThickness($temp_bg,$this->rand_func(2,6));
+                                       $text_r = $this->rand_func(100,150);
+                                       $text_g = $this->rand_func(100,150);
+                                       $text_b = $this->rand_func(100,150);
+                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);
+                                       
+                                       ImageLine($temp_bg,$i,0,$i,$height*2,$text_colour3);
+                               }
+                               // draw grid on y
+                               for($i=$this->rand_func(6,20) ; $i<$height*2 ; $i+=$this->rand_func(10,25)) {
+                                       ImageSetThickness($temp_bg,$this->rand_func(2,6));
+                                       $text_r = $this->rand_func(100,150);
+                                       $text_g = $this->rand_func(100,150);
+                                       $text_b = $this->rand_func(100,150);
+                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);
+                                       
+                                       ImageLine($temp_bg,0,$i,$width*2, $i ,$text_colour3);
+                               }
+                       } else if($this->bg_type==2) {
+                               // draw squiggles!
+                               
+                               $bg3 = ImageColorAllocate($this->im3,255,255,255);
+                               ImageFill($this->im3,0,0,$bg3);
+                               ImageSetThickness($temp_bg,4);
+
+                               for($i=0 ; $i<strlen($word)+1 ; $i++) {
+                                       $text_r = $this->rand_func(100,150);
+                                       $text_g = $this->rand_func(100,150);
+                                       $text_b = $this->rand_func(100,150);
+                                       $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);
+
+                                       $points = Array();
+                                       // draw random squiggle for each character
+                                       // the longer the loop, the more complex the squiggle
+                                       // keep random so OCR can't say "if found shape has 10 points, ignore it"
+                                       // each squiggle will, however, be a closed shape, so OCR could try to find
+                                       // line terminations and start from there. (I don't think they're that advanced yet..)
+                                       for($j=1 ; $j<$this->rand_func(5,10) ; $j++) {
+                                               $points[] = $this->rand_func(1*(20*($i+1)),1*(50*($i+1)));
+                                               $points[] = $this->rand_func(30,$height+30);
+                                       }
+
+                                       ImagePolygon($temp_bg,$points,intval(sizeof($points)/2),$text_colour3);
+                               }
+
+                       } else if($this->bg_type==3) {
+                               // take random chunks of $this->bg_images and paste them onto the background
+
+                               for($i=0 ; $i<sizeof($this->bg_images) ; $i++) {
+                                       // read each image and its size
+                                       $temp_im[$i] = ImageCreateFromJPEG($this->bg_images[$i]);
+                                       $temp_width[$i] = imagesx($temp_im[$i]);
+                                       $temp_height[$i] = imagesy($temp_im[$i]);
+                               }
+
+                               $blocksize = $this->rand_func(20,60);
+                               for($i=0 ; $i<$width*2 ; $i+=$blocksize) {
+                                       // could randomise blocksize here... hardly matters
+                                       for($j=0 ; $j<$height*2 ; $j+=$blocksize) {
+                                               $image_index = $this->rand_func(0,sizeof($temp_im)-1);
+                                               $cut_x = $this->rand_func(0,$temp_width[$image_index]-$blocksize);
+                                               $cut_y = $this->rand_func(0,$temp_height[$image_index]-$blocksize);
+                                               ImageCopy($temp_bg, $temp_im[$image_index], $i, $j, $cut_x, $cut_y, $blocksize, $blocksize);
+                                       }
+                               }
+                               for($i=0 ; $i<sizeof($temp_im) ; $i++) {
+                                       // remove bgs from memory
+                                       ImageDestroy($temp_im[$i]);
+                               }
+                               
+                               // for debug:
+                               //sendImage($temp_bg);
+                       }
+                       
+                       // for debug:
+                       //sendImage($this->im3);
+                       
+                       if($this->morph_bg) {
+                               // morph background
+                               // we do this separately to the main text morph because:
+                               // a) the main text morph is done char-by-char, this is done across whole image
+                               // b) if an attacker could un-morph the bg, it would un-morph the CAPTCHA
+                               // hence bg is morphed differently to text
+                               // why do we morph it at all? it might make it harder for an attacker to remove the background
+                               // morph_chunk 1 looks better but takes longer
+                               // this is a different and less perfect morph than the one we do on the CAPTCHA
+                               // occasonally you get some dark background showing through around the edges
+                               // it doesn't need to be perfect as it's only the bg.
+                               $morph_chunk = $this->rand_func(1,5);
+                               $morph_y = 0;
+                               for($x=0 ; $x<$width ; $x+=$morph_chunk) {
+                                       $morph_chunk = $this->rand_func(1,5);
+                                       $morph_y += $this->rand_func(-1,1);
+                                       ImageCopy($this->im3, $temp_bg, $x, 0, $x+30, 30+$morph_y, $morph_chunk, $height*2);
+                               }
+                               
+                               ImageCopy($temp_bg, $this->im3, 0, 0, 0, 0, $width, $height);
+                               
+                               $morph_x = 0;
+                               for($y=0 ; $y<=$height; $y+=$morph_chunk) {
+                                       $morph_chunk = $this->rand_func(1,5);
+                                       $morph_x += $this->rand_func(-1,1);
+                                       ImageCopy($this->im3, $temp_bg, $morph_x, $y, 0, $y, $width, $morph_chunk);
+                               
+                               }
+                       } else {
+                               // just copy temp_bg onto im3
+                               ImageCopy($this->im3,$temp_bg,0,0,30,30,$width,$height);
+                       }
+                       
+                       ImageDestroy($temp_bg);
+                       
+                       if($this->blur_bg) {
+                               $this->myImageBlur($this->im3);
+                       }
+               }
+               
+               //////////////////////////////////////////////////////
+               ////// Write Word
+               //////////////////////////////////////////////////////
+               
+               // write word in random starting X position
+               $word_start_x = $this->rand_func(5,32);
+               // y positions jiggled about later
+               $word_start_y = 15;
+               
+               if($this->col_type==0) {
+                       $text_r = $this->rand_color();
+                       $text_g = $this->rand_color();
+                       $text_b = $this->rand_color();
+                       $text_colour2 = ImageColorAllocate($this->im2, $text_r, $text_g, $text_b);
+               }
+               
+               // write each char in different font
+               for($i=0 ; $i<strlen($word) ; $i++) {
+                       if($this->col_type==1) {
+                               $text_r = $this->rand_color();
+                               $text_g = $this->rand_color();
+                               $text_b = $this->rand_color();
+                               $text_colour2 = ImageColorAllocate($this->im2, $text_r, $text_g, $text_b);
+                       }
+                       
+                       $j = $this->rand_func(0,sizeof($this->font_locations)-1);
+                       $font = ImageLoadFont($this->font_locations[$j]);
+                       ImageString($this->im2, $font, $word_start_x+($this->font_widths[$j]*$i), $word_start_y, $word{$i}, $text_colour2);
+               }
+               // use last pixelwidth
+               $font_pixelwidth = $this->font_widths[$j];
+
+               // for debug:
+               //sendImage($this->im2);
+               
+               //////////////////////////////////////////////////////
+               ////// Morph Image:
+               //////////////////////////////////////////////////////
+               
+               // calculate how big the text is in pixels
+               // (so we only morph what we need to)
+               $word_pix_size = $word_start_x+(strlen($word)*$font_pixelwidth);
+               
+               // firstly move each character up or down a bit:
+               for($i=$word_start_x ; $i<$word_pix_size ; $i+=$font_pixelwidth) {
+                       // move on Y axis
+                       // deviates at least 4 pixels between each letter
+                       $prev_y = $y_pos;
+                       do{
+                               $y_pos = $this->rand_func(-5,5);
+                       } while($y_pos<$prev_y+2 && $y_pos>$prev_y-2);
+                       ImageCopy($this->im, $this->im2, $i, $y_pos, $i, 0, $font_pixelwidth, $height);
+               
+                       // for debug:
+                       //ImageRectangle($this->im,$i,$y_pos+10,$i+$font_pixelwidth,$y_pos+70,$debug);
+               }
+               
+               // for debug:
+               //sendImage($this->im);
+               
+               ImageFilledRectangle($this->im2,0,0,$width,$height,$bg2);
+
+               // randomly morph each character individually on x-axis
+               // this is where the main distortion happens
+               // massively improved since v1.2
+               $y_chunk = 1;
+               $morph_factor = $this->morphFactor;
+               $morph_x = 0;
+               for($j=0 ; $j<strlen($word) ; $j++) {
+                       $y_pos = 0;
+                       for($i=0 ; $i<=$height; $i+=$y_chunk) {
+                               $orig_x = $word_start_x+($j*$font_pixelwidth);
+                               // morph x += so that instead of deviating from orig x each time, we deviate from where we last deviated to
+                               // get it? instead of a zig zag, we get more of a sine wave.
+                               // I wish we could deviate more but it looks crap if we do.
+                               $morph_x += $this->rand_func(-$morph_factor,$morph_factor);
+                               // had to change this to ImageCopyMerge when starting using ImageCreateTrueColor
+                               // according to the manual; "when (pct is) 100 this function behaves identically to imagecopy()"
+                               // but this is NOT true when dealing with transparencies...
+                               ImageCopyMerge($this->im2, $this->im, $orig_x+$morph_x, $i+$y_pos, $orig_x, $i, $font_pixelwidth, $y_chunk, 100);
+               
+                               // for debug:
+                               //ImageLine($this->im2, $orig_x+$morph_x, $i, $orig_x+$morph_x+1, $i+$y_chunk, $debug2);
+                               //ImageLine($this->im2, $orig_x+$morph_x+$font_pixelwidth, $i, $orig_x+$morph_x+$font_pixelwidth+1, $i+$y_chunk, $debug2);
+                       }
+               }
+               
+               // for debug:
+               //sendImage($this->im2);
+               
+               ImageFilledRectangle($this->im,0,0,$width,$height,$bg);
+               // now do the same on the y-axis
+               // (much easier because we can just do it across the whole image, don't have to do it char-by-char)
+               $y_pos = 0;
+               $x_chunk = 1;
+               for($i=0 ; $i<=$width ; $i+=$x_chunk) {
+                       // can result in image going too far off on Y-axis;
+                       // not much I can do about that, apart from make image bigger
+                       // again, I wish I could do 1.5 pixels
+                       $y_pos += $this->rand_func(-1,1);
+                       ImageCopy($this->im, $this->im2, $i, $y_pos, $i, 0, $x_chunk, $height);
+               
+                       // for debug:
+                       //ImageLine($this->im,$i+$x_chunk,0,$i+$x_chunk,100,$debug);
+                       //ImageLine($this->im,$i,$y_pos+25,$i+$x_chunk,$y_pos+25,$debug);
+               }
+               
+               // for debug:
+               //sendImage($this->im);
+               
+               // blur edges:
+               // doesn't really add any security, but looks a lot nicer, and renders text a little easier to read
+               // for humans (hopefully not for OCRs, but if you know better, feel free to disable this function)
+               // (and if you do, let me know why)
+               $this->myImageBlur($this->im);
+               
+               // for debug:
+               //sendImage($this->im);
+               
+               if($this->output!="jpg" && $this->bg_type==0) {
+                       // make background transparent
+                       ImageColorTransparent($this->im,$bg);
+               }
+               
+               //////////////////////////////////////////////////////
+               ////// Try to avoid 'free p*rn' style CAPTCHA re-use
+               //////////////////////////////////////////////////////
+               // ('*'ed to stop my site coming up for certain keyword searches on google)
+               // can obscure CAPTCHA word in some cases..
+               // write site tags 'shining through' the morphed image
+               ImageFilledRectangle($this->im2,0,0,$width,$height,$bg2);
+               if(is_array($this->site_tags)) {
+                       $font = 2;
+                       $siteTagFontWidth = 6;
+                       $siteTagFontHeight = 10;
+                       for($i=0 ; $i<sizeof($this->site_tags) ; $i++) {
+                               // ensure tags are centered
+                               $tag_width = strlen($this->site_tags[$i])*$siteTagFontWidth+8;
+                               // write tag is chosen position
+                               if($this->tag_pos==0 || $this->tag_pos==2) {
+                                       // write at top
+                                       ImageString($this->im2, $font, intval($width/2)-intval($tag_width/2)+5, $siteTagFontHeight*$i, $this->site_tags[$i], $site_tag_col2);
+                               }
+                               if($this->tag_pos==1 || $this->tag_pos==2) {
+                                       // write at bottom
+                                       ImageString($this->im2, $font, intval($width/2)-intval($tag_width/2)+5, ($height-((sizeof($this->site_tags)*$siteTagFontHeight+4))+($i*$siteTagFontHeight)), $this->site_tags[$i], $site_tag_col2);
+                               }
+                       }
+               }
+               ImageCopyMerge($this->im2,$this->im,0,0,0,0,$width,$height,80);
+               ImageCopy($this->im,$this->im2,0,0,0,0,$width,$height);
+               
+               //////////////////////////////////////////////////////
+               ////// Merge with obfuscated background
+               //////////////////////////////////////////////////////
+               
+               if($this->bg_type!=0) {
+                       // merge bg image with CAPTCHA image to create smooth background
+                       // fade bg:
+                       if ($this->bg_type!=3) {
+                               $temp_im = ImageCreateTrueColor($width,$height);
+                               $white = ImageColorAllocate($temp_im,255,255,255);
+                               ImageFill($temp_im,0,0,$white);
+                               ImageCopyMerge($this->im3,$temp_im,0,0,0,0,$width,$height,$bg_fade_pct);
+                               // for debug:
+                               //sendImage($this->im3);
+                               ImageDestroy($temp_im);
+                               $c_fade_pct = 50;
+                       } else {
+                               $c_fade_pct = $bg_fade_pct;
+                       }
+               
+                       // captcha over bg:
+                       // might want to not blur if using this method
+                       // otherwise leaves white-ish border around each letter
+                       if ($this->merge_type == 1) {
+                               ImageCopyMerge($this->im3,$this->im,0,0,0,0,$width,$height,100);
+                               ImageCopy($this->im,$this->im3,0,0,0,0,$width,$height);
+                       } else {
+                               // bg over captcha:
+                               ImageCopyMerge($this->im,$this->im3,0,0,0,0,$width,$height,$c_fade_pct);
+                       }
+               }
+               unset($bg_fade_pct);
+               // for debug:
+               //sendImage($this->im);
+       }
+       
+       /**
+        * Returns the localized label of the LOCAL_LANG key, $key, in utf-8 for gd (in fact gd is limited to Latin2)
+        * Notice that for debugging purposes prefixes for the output values can be set with the internal vars ->LLtestPrefixAlt and ->LLtestPrefix
+        *
+        * @param       string          The key from the LOCAL_LANG array for which to return the value.
+        * @param       string          Alternative string to return IF no value is found set for the key, neither for the local language nor the default.
+        * @param       boolean         If true, the output label is passed through htmlspecialchars()
+        * @return      string          The value from LOCAL_LANG.
+        */
+       function pi_getLL($key,$alt='',$hsc=FALSE) {
+               if (isset($this->LOCAL_LANG[$this->LLkey][$key])) {
+                       $word = $this->LOCAL_LANG[$this->LLkey][$key];
+                       if ($this->LOCAL_LANG_charset[$this->LLkey][$key]) {
+                               $word = $GLOBALS['TSFE']->csConv($word, $this->LOCAL_LANG_charset[$this->LLkey][$key], 'utf-8');
+                       }
+               } elseif ($this->altLLkey && isset($this->LOCAL_LANG[$this->altLLkey][$key]))   {
+                       $word = $this->LOCAL_LANG[$this->altLLkey][$key];
+                       if ($this->LOCAL_LANG_charset[$this->altLLkey][$key]) {
+                               $word = $GLOBALS['TSFE']->csConv($word, $this->LOCAL_LANG_charset[$this->altLLkey][$key], 'utf-8');
+                       }
+               } elseif (isset($this->LOCAL_LANG['default'][$key]))    {
+                       $word = $this->LOCAL_LANG['default'][$key];
+               } else {
+                       $word = $this->LLtestPrefixAlt.$alt;
+               }
+                       // Don't know why the label is twice encoded...
+               $word = utf8_decode($word);
+               $output = $this->LLtestPrefix.$word;
+               if ($hsc) $output = htmlspecialchars($output);
+               return $output;
+       }
+       
+       /**
+        * Encodes a string.
+        * Returns an array with the string as the first element and the initialization vector as the second element
+        */
+       function easy_crypt($string, $key)      {
+               $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC), MCRYPT_RAND);
+               $string = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $string, MCRYPT_MODE_CBC, $iv);
+               
+               return array(base64_encode($string), base64_encode($iv));
+       }
+       
+       /**
+        * Decodes a string
+        * The first argument is an array as returned by easy_encrypt()
+        */
+       function easy_decrypt($cyph_arr, $key){
+               return trim(mcrypt_decrypt(MCRYPT_BLOWFISH, $key, base64_decode($cyph_arr[0]), MCRYPT_MODE_CBC, base64_decode($cyph_arr[1])));
+       }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/pi1/class.tx_srfreecap_pi1.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sr_freecap/pi1/class.tx_srfreecap_pi1.php']);
+}
+
+?>
index f67dab9..8d9a751 100644 (file)
-<?\r
-if (!defined('freeCap')) die ('Access denied.');\r
-/************************************************************\\r
-*\r
-*              freeCap v1.4.1 Copyright 2005 Howard Yeend\r
-*              www.puremango.co.uk\r
-*\r
-*    This file is part of freeCap.\r
-*\r
-*    freeCap is free software; you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation; either version 2 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    freeCap is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-*\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with freeCap; if not, write to the Free Software\r
-*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*\r
-*\r
-\************************************************************/\r
-\r
-session_start();\r
-\r
-//////////////////////////////////////////////////////\r
-////// User Defined Vars:\r
-//////////////////////////////////////////////////////\r
-\r
-// try to avoid the 'free p*rn' method of CAPTCHA circumvention\r
-// see www.wikipedia.com/captcha for more info\r
-$site_tags[0] = "To avoid spam, please do NOT enter the text if";\r
-$site_tags[1] = "this site is not puremango.co.uk";\r
-// or more simply:\r
-//$site_tags[0] = "for use only on puremango.co.uk";\r
-// reword or add lines as you please\r
-// or if you don't want any text:\r
-$site_tags = null;\r
-\r
-// where to write the above:\r
-// 0=top\r
-// 1=bottom\r
-// 2=both\r
-$tag_pos = 1;\r
-\r
-// functions to call for random number generation\r
-// mt_rand produces 'better' random numbers\r
-// but if your server doesn't support it, it's fine to use rand instead\r
-$rand_func = "mt_rand";\r
-$seed_func = "mt_srand";\r
-\r
-// which type of hash to use?\r
-// possible values: "sha1", "md5", "crc32"\r
-// sha1 supported by PHP4.3.0+\r
-// md5 supported by PHP3+\r
-// crc32 supported by PHP4.0.1+\r
-$hash_func = "sha1";\r
-// store in session so can validate in form processor\r
-$_SESSION['hash_func'] = $hash_func;\r
-\r
-// image type:\r
-// possible values: "jpg", "png", "gif"\r
-// jpg doesn't support transparency (transparent bg option ends up white)\r