diff --git a/branches/old-perl/trunk/AUTHORS b/branches/old-perl/trunk/AUTHORS new file mode 100644 index 0000000..83b7995 --- /dev/null +++ b/branches/old-perl/trunk/AUTHORS @@ -0,0 +1,2 @@ +Nils Dagsson Moskopp (erlehmann) +Johannes Schauer (josch) diff --git a/branches/old-perl/trunk/LICENSE b/branches/old-perl/trunk/LICENSE new file mode 100644 index 0000000..c7b5725 --- /dev/null +++ b/branches/old-perl/trunk/LICENSE @@ -0,0 +1,677 @@ + Yolanda - A free software video CMS + Copyright (C) 2007 Nils Dagsson Moskopp, Johannes Schauer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + +================================================================================ + + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license +for software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are +designed to take away your freedom to share and change the works. By +contrast, our General Public Licenses are intended to guarantee your +freedom to share and change all versions of a program--to make sure it +remains free software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public +License. + + "Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further restriction, +you may remove that term. If a license document contains a further +restriction but permits relicensing or conveying under this License, you +may add to a covered work material governed by the terms of that license +document, provided that the further restriction does not survive such +relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have permission +to link or combine any covered work with a work licensed under version 3 +of the GNU General Public License into a single combined work, and to +convey the resulting work. The terms of this License will continue to +apply to the part which is the covered work, but the work with which it is +combined will remain governed by version 3 of the GNU General Public +License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may differ +in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero +General Public License "or any later version" applies to it, you have +the option of following the terms and conditions either of that +numbered version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number +of the GNU Affero General Public License, you may choose any version +ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that +proxy's public statement of acceptance of a version permanently +authorizes you to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/branches/old-perl/trunk/README b/branches/old-perl/trunk/README new file mode 100755 index 0000000..3514cb1 --- /dev/null +++ b/branches/old-perl/trunk/README @@ -0,0 +1,44 @@ +Yolanda - http://yolanda.mister-muffin.de/trac +======================================================= + +A video content management system using Perl for the backend and XML and XSLT for the frontend. Video playback is provided by Fluendo's Cortado Java applet. + +Installation +============ + +You will need to install following packages prior to using Yolanda: +apache2 +apache2-mpm-prefork +libapache2-mod-perl2 +libcgi-session-perl +libdbi-perl +libxml-simple-perl +libproc-daemon-perl +libdigest-sha-perl +libnet-openid-consumer-perl +libio-socket-ssl-perl +liblwpx-paranoidagent-perl +mysql-server +ffmpeg +ffmpeg2theora + +You will also need one of the following java packages for playback purposes: +sun-java6-plugin +sun-java5-plugin +j2re1.4-mozilla-plugin + +Important: The GNU java implementation does not seem to work with Cortado yet. + +Usage +===== + +Launch the worker script (daemon.pl). + +Help +==== + +If you have any questions/bug reports/ideas, you can find help in the following +locations: + +http://yolanda.mister-muffin.de/proj - Main project page and wiki +yolanda@conference.mister-muffin.de - jabber multi user chat diff --git a/branches/old-perl/trunk/TODO b/branches/old-perl/trunk/TODO new file mode 100644 index 0000000..bbf11ca --- /dev/null +++ b/branches/old-perl/trunk/TODO @@ -0,0 +1 @@ +See http://mister-muffin.de/proj for blueprints and bugs. diff --git a/branches/old-perl/trunk/apache.conf b/branches/old-perl/trunk/apache.conf new file mode 100644 index 0000000..91f1582 --- /dev/null +++ b/branches/old-perl/trunk/apache.conf @@ -0,0 +1,29 @@ +NameVirtualHost * + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www/yolanda/ + + Options FollowSymLinks + AllowOverride None + + + + ForceType image/jpeg + + + AllowEncodedSlashes On + + RewriteEngine On + RewriteRule ^/video/(.*)/([0-9]+)/(.*)$ /video.pl?title=$1&id=$2&$3 + RewriteRule ^/embedded/(.*)/([0-9]+)/(.*)$ /video.pl?title=$1&id=$2&embed=true&$3 + RewriteRule ^/download/([0-9]+)/(.*)$ /download.pl?id=$1&$2 + + ErrorLog /var/log/apache2/error.log + + LogLevel warn + + CustomLog /var/log/apache2/access.log combined + ServerSignature On + + diff --git a/branches/old-perl/trunk/config/backend.xml b/branches/old-perl/trunk/config/backend.xml new file mode 100644 index 0000000..eb3c236 --- /dev/null +++ b/branches/old-perl/trunk/config/backend.xml @@ -0,0 +1,56 @@ + + + + + + mysql + localhost + yolanda + root + + + http://localhost + + + * order:timestamp sort:descending + * order:viewcount sort:descending + * order:downloadcount sort:descending + 3 + 10 + 500 + relevance + desc + + + en-us + xhtml.xsl + 3 + 20 + true + + sid + + + 720 + 240 + 1080 + 320 + 86388736 + 512 + 6000 + 64 + 120 + + + + http://www.w3.org/1999/XSL/Transform + http://purl.org/dc/elements/1.1/ + http://purl.org/dc/terms/ + http://web.resource.org/cc/ + http://www.w3.org/1999/02/22-rdf-syntax-ns# + http://www.w3.org/2002/xforms + http://www.w3.org/2001/XMLSchema + http://www.w3.org/2001/XMLSchema-instance + "http://www.w3.org/1999/xhtml" + + diff --git a/branches/old-perl/trunk/config/frontend.xml b/branches/old-perl/trunk/config/frontend.xml new file mode 100755 index 0000000..64c859b --- /dev/null +++ b/branches/old-perl/trunk/config/frontend.xml @@ -0,0 +1,31 @@ + + + + + + + Yolanda + WebTV free as in Speech + + + /settings.pl + /login.pl + /login.pl?action=openid + /login.pl?action=logout + http://yolanda.mister-muffin.de/trac + /LICENSE + http://yolanda.mister-muffin.de/trac/browser/trunk + /register.pl + http://yolanda.mister-muffin.de/trac/newticket + /search.pl + /search.pl?query= + http://localhost/ + /upload.pl + /uploader.pl + /search.pl?query=*%20order:timestamp%20sort:descending + /search.pl?query=*%20order:downloadcount%20sort:descending + /search.pl?query=*%20order:viewcount%20sort:descending + + + + diff --git a/branches/old-perl/trunk/download.pl b/branches/old-perl/trunk/download.pl new file mode 100644 index 0000000..cd2b796 --- /dev/null +++ b/branches/old-perl/trunk/download.pl @@ -0,0 +1,102 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +#do we have an id? +if($query->param('id')) +{ + #check if video with requested id is in the database + my $sth = $dbh->prepare(qq{select title from videos where id = ? }); + $sth->execute($query->param('id')); + + if(($title) = $sth->fetchrow_array()) + { + #are we only watching this video or downloading it? + if($query->param('view')) + { + #seems we only want to watch it - update viewcount + $dbh->do(qq{update videos set viewcount=viewcount+1 where id = ? }, undef, $query->param('id')) or die $dbh->errstr; + } + else + { + #video is being downloaded - update downloadcount + $dbh->do(qq{update videos set downloadcount=downloadcount+1 where id = ? }, undef, $query->param('id')) or die $dbh->errstr; + } + + #open video file + $file = open(FILE, "<$root/videos/".$query->param('id')); + + if($file) + { + #TODO: replace all of this with fastcgi x-sendfile + #get video filesize + $filesize = -s "$root/videos/".$query->param('id'); + + #get http query range + #TODO: also allow range end + $range = $query->http('range'); + $range =~ s/bytes=([0-9]+)-/$1/; + + #if a specific range is requested send http partial content headers and seek in the inputfile + if($range) + { + #if $range is equal or more than filesize throw http 416 header + if($range >= $filesize) + { + print $query->header(-status=>'416 Requested Range Not Satisfiable'); + } + else + { + #print correct http partial header + print $query->header(-type=>'application/ogg', + -content_length=> $filesize-$range, + -status=>'206 Partial Content', + -attachment=>$title.".ogv", + -accept_ranges=> "bytes", + -content_range=> "bytes $range-".($filesize-1)."/$filesize" + ); + + #seek file to the requested position + seek FILE, $range, 0; + } + } + else + { + #print normal header + print $query->header(-type=>'application/ogg', + -content_length=> $filesize, + -attachment=>$title.".ogv" + ); + } + + #in both cases - do some slurp-eaze to the browser + while (my $BytesRead = read (FILE, $buff, 8192)) + { + print $buff; + } + close(FILE); + } + else + { + #the requested file should be there but is not - throw server error + print $session->header( + -status=>'500 Internal Server Error' + ) + } + } + else + { + #no such video exists - 404 + print $session->header( + -status=>'404 Not found' + ) + } +} +else +{ + #no if was supplied + print $query->redirect("index.pl?error=error_202c"); +} diff --git a/branches/old-perl/trunk/functions.pl b/branches/old-perl/trunk/functions.pl new file mode 100644 index 0000000..4e45e90 --- /dev/null +++ b/branches/old-perl/trunk/functions.pl @@ -0,0 +1,361 @@ +require "include.pl"; + +sub get_userinfo_from_sid +{ + #get parameters + my ($sid) = @_; + + #prepare query + my $sth = $dbh->prepare(qq{select id, username, pagesize from users where sid = ?}) or die $dbh->errstr; + + #execute it + $sth->execute($sid) or die $dbh->errstr; + + #save the resulting username + ($userinfo->{'id'}, $userinfo->{'username'}, $userinfo->{'pagesize'}) = $sth->fetchrow_array(); + + #finish query + $sth->finish() or die $dbh->errstr; + + #return + return @userinfo; +} + +sub get_page_array +{ + #get parameters + my (@userinfo) = @_; + + my $page = XML::LibXML::Element->new( "page" ); + + #get user language from browser http_accept string + my ($lang) = $query->http('HTTP_ACCEPT_LANGUAGE') =~ /^[^,]+,([^;]*);/; + $page->setAttribute( "lang", $lang ? $lang : "en" ); + + #TODO: set namespace for each site on its own + $page->setAttribute( "username", $userinfo->{'username'} ); + + return $page; +} + +# index.pl (display custom search) +# search.pl (display search results) +# and upload.pl (display similar videos) +sub fill_results +{ + my ($dbquery, @args) = @_; + + my $results = XML::LibXML::Element->new( "results" ); + + #prepare query + my $sth = $dbh->prepare($dbquery) or die $dbh->errstr; + + #execute it + $resultcount = $sth->execute(@args) or die $dbh->errstr; + + #set pagesize by query or usersettings or default + $pagesize = $query->param('pagesize') or $pagesize = $userinfo->{'pagesize'} or $pagesize = $config->{"search_results_default"}; + + #if pagesize is more than maxpagesize reduce to maxpagesize + $pagesize = $pagesize > $config->{"search_results_max"} ? $config->{"search_results_max"} : $pagesize; + + #rediculous but funny round up, will fail with 100000000000000 results per page + #on 0.0000000000001% of all queries - this is a risk we can handle + $lastpage = int($resultcount/$pagesize+0.99999999999999); + + $currentpage = int($query->param('page')) or $currentpage = 1; + + $dbquery .= " limit ".($currentpage-1)*$pagesize.", ".$pagesize; + + #prepare query + $sth = $dbh->prepare($dbquery) or die $dbh->errstr; + + #execute it + $sth->execute(@args) or die $dbh->errstr; + + $results->setAttribute('lastpage', $lastpage); + $results->setAttribute('currentpage', $currentpage); + $results->setAttribute('resultcount', $resultcount eq '0E0' ? 0 : $resultcount); + $results->setAttribute('pagesize', $pagesize); + + #get every returned value + while (my ($id, $title, $description, $publisher, $timestamp, $creator, + $subject, $source, $language, $coverage, $rights, + $license, $filesize, $duration, $width, $height, $fps, $viewcount, + $downloadcount) = $sth->fetchrow_array()) + { + #build xml node structure + my $result = XML::LibXML::Element->new( "result" ); + $result->setAttribute( "thumbnail", $config->{"url_root"}."/video-stills/thumbnails/$id" ); + $result->setAttribute( "preview", $config->{"url_root"}."/video-stills/previews/$id" ); + $result->setAttribute( "duration", $duration ); + $result->setAttribute( "viewcount", $viewcount ); + + my $rdf = XML::LibXML::Element->new( "RDF" ); + $rdf->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf"); + + my $work = XML::LibXML::Element->new( "Work" ); + $work->setNamespace( "http://web.resource.org/cc/", "cc"); + $work->setNamespace( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $work->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", $config->{"url_root"}."/download/$id/" ); + + $node = XML::LibXML::Element->new( "coverage" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($coverage); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "creator" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($creator); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "date" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($date); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "description" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($description); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "identifier" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($config->{"url_root"}."/video/".urlencode($title)."/$id/"); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "language" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($language); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "publisher" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($publisher); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "rights" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($rights); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "source" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($source); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "subject" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($subjcet); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "title" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($title); + $work->appendChild($node); + + my $license = XML::LibXML::Element->new( "License" ); + $license->setNamespace("http://web.resource.org/cc/", "cc"); + $license->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $license->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", "http://creativecommons.org/licenses/GPL/2.0/" ); + + $rdf->appendChild($work); + $rdf->appendChild($license); + + $result->appendChild($rdf); + + $results->appendChild($result); + } + + #finish query + $sth->finish() or die $dbh->errstr; + + return $results; +} + +sub get_sqlquery +{ + my $strquery = @_[0]; + $strquery =~ s/%([0-9A-F]{2})/chr(hex($1))/eg; + (@tags) = $strquery =~ / tag:(\w+)/gi; + ($order) = $strquery =~ / order:(\w+)/i; + ($sort) = $strquery =~ / sort:(\w+)/i; + #TODO: add those options + #($title) = $strquery =~ /title:(\w+)/i; + #($description) = $strquery =~ /description:(\w+)/i; + #($creator) = $strquery =~ /creator:(\w+)/i; + #($language) = $strquery =~ /language:(\w+)/i; + #($coverage) = $strquery =~ /coverage:(\w+)/i; + #($rights) = $strquery =~ /rights:(\w+)/i; + #($license) = $strquery =~ /license:(\w+)/i; + #($filesize) = $strquery =~ /filesize:([<>]?\w+)/i; + #($duration) = $strquery =~ /duration:([<>]?\w+)/i; + #($timestamp) = $strquery =~ /timestamp:([<>]?\w+)/i; + $strquery =~ s/ (tag|order|sort):\w+//gi; + $strquery =~ s/^\s*(.*?)\s*$/$1/; + + #build mysql query + my $dbquery = "select v.id, v.title, v.description, u.username, + from_unixtime( v.timestamp ), v.creator, v.subject, + v.source, v.language, v.coverage, v.rights, v.license, filesize, + duration, width, height, fps, viewcount, downloadcount"; + + #only continue with a valid query string + if($strquery) + { + #select all videos + if($strquery eq "*") + { + $dbquery .= " from videos as v, users as u where u.id = v.userid"; + } + #search + else + { + $dbquery .= ", match(v.title, v.description, v.subject) against( ? in boolean mode) as relevance"; + $dbquery .= " from videos as v, users as u where u.id = v.userid"; + $dbquery .= " and match(v.title, v.description, v.subject) against( ? in boolean mode)"; + push @args, $strquery, $strquery; + } + + #match tags if present + if(@tags) + { + $dbquery .= " and match(v.subject) against (? in boolean mode)"; + push @args, "@tags"; + } + + #match publisher + if($publisher) + { + $dbquery .= " and match(u.username) against (? in boolean mode)"; + push @args, "$publisher"; + } + + #give results the right order + if($order) + { + if($order eq 'filesize') + { + $dbquery .= " order by v.filesize"; + } + elsif($order eq 'duration') + { + $dbquery .= " order by v.duration"; + } + elsif($order eq 'viewcount') + { + $dbquery .= " order by v.viewcount"; + } + elsif($order eq 'downloadcount') + { + $dbquery .= " order by v.downloadcount"; + } + elsif($order eq 'timestamp') + { + $dbquery .= " order by v.timestamp"; + } + elsif($order eq 'relevance') + { + $dbquery .= " order by relevance"; + } + elsif($order eq 'random') + { + $dbquery .= " order by rand()"; + } + else + { + $dbquery .= " order by $config->{'search_order_default'}"; + } + + if($sort eq "ascending") + { + $dbquery .= " asc"; + } + elsif($sort eq "descending") + { + $dbquery .= " desc"; + } + else + { + $dbquery .= " $config->{'search_sort_default'}"; + } + } + + return $dbquery, @args; + } +} + +#replace chars in url according to RFC 1738 +sub urlencode +{ + my ($url) = @_[0]; + $url =~ s/([^A-Za-z0-9_\$\-.+!*'()])/sprintf("%%%02X", ord($1))/eg; + return $url; +} + +sub output_page +{ + my $doc = shift; + my $parser = XML::LibXML->new(); + my $xslt = XML::LibXSLT->new(); + + # let the XSLT param choose other stylesheets or default to xhtml.xsl + my $param_xslt = $query->param('xslt'); + $param_xslt =~ s/[^a-z0-9\[\]\$\-_.+!*'(),]//gi; + + if( -f "$root/xsl/$param_xslt.xsl") + { + $xsltpath = "$root/xsl/$param_xslt.xsl" + } + else + { + $xsltpath = "$root/xsl/xhtml.xsl"; + } + + #TODO: preload xslt stylesheet + my $stylesheet = $xslt->parse_stylesheet($parser->parse_file($xsltpath)); + + $output = $stylesheet->transform($doc); + + if($param_xslt eq "xspf") + { + return $session->header( + -type=>$stylesheet->media_type, + -charset=>$stylesheet->output_encoding, + -attachment=>$query->param('query').".xspf", + ), + $output->toString; + #$stylesheet->output_as_bytes($output); <= for future use with XML::LibXSLT (>= 1.62) + } + elsif($param_xslt eq "pr0n") + { + return $session->header( + -status=>'402 Payment required', + -cost=>'$9001.00', # OVER NEIN THOUSAND + ) + } + else + { + return $session->header( + -type=>$stylesheet->media_type, + -charset=>$stylesheet->output_encoding, + "x-pingback"=>$config->{"url_root"}."/pingback.pl" + ), + print $output->toString; + #$stylesheet->output_as_bytes($output); <= for future use with XML::LibXSLT (>= 1.62) + } +} + +#output info message +sub message +{ + my ($type, $text, $value) = @_; + my $message = XML::LibXML::Element->new( "message" ); + $message->setAttribute("type", $type); + $message->setAttribute("text", $text); + if ($value) + { + $message->setAttribute("value", $value); + } + return $message; +} diff --git a/branches/old-perl/trunk/images/badges/COPYING b/branches/old-perl/trunk/images/badges/COPYING new file mode 100644 index 0000000..08192f7 --- /dev/null +++ b/branches/old-perl/trunk/images/badges/COPYING @@ -0,0 +1,4 @@ +Web badges + +License: GPL +Source: from http://www.zwahlendesign.ch/en/node/19 diff --git a/branches/old-perl/trunk/images/badges/css.png b/branches/old-perl/trunk/images/badges/css.png new file mode 100644 index 0000000..854a240 Binary files /dev/null and b/branches/old-perl/trunk/images/badges/css.png differ diff --git a/branches/old-perl/trunk/images/badges/ogg theora.png b/branches/old-perl/trunk/images/badges/ogg theora.png new file mode 100644 index 0000000..be875f1 Binary files /dev/null and b/branches/old-perl/trunk/images/badges/ogg theora.png differ diff --git a/branches/old-perl/trunk/images/badges/open source.png b/branches/old-perl/trunk/images/badges/open source.png new file mode 100644 index 0000000..9f49da3 Binary files /dev/null and b/branches/old-perl/trunk/images/badges/open source.png differ diff --git a/branches/old-perl/trunk/images/badges/xhtml 1.1.png b/branches/old-perl/trunk/images/badges/xhtml 1.1.png new file mode 100644 index 0000000..52c38a3 Binary files /dev/null and b/branches/old-perl/trunk/images/badges/xhtml 1.1.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-by.png b/branches/old-perl/trunk/images/cc/32x32/cc-by.png new file mode 100644 index 0000000..9b7e464 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-by.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-noderivatives.png b/branches/old-perl/trunk/images/cc/32x32/cc-noderivatives.png new file mode 100644 index 0000000..76a2354 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-noderivatives.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-noncommercial.png b/branches/old-perl/trunk/images/cc/32x32/cc-noncommercial.png new file mode 100644 index 0000000..1ac192a Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-noncommercial.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-remix.png b/branches/old-perl/trunk/images/cc/32x32/cc-remix.png new file mode 100644 index 0000000..bce992e Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-remix.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-share.png b/branches/old-perl/trunk/images/cc/32x32/cc-share.png new file mode 100644 index 0000000..6381c60 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-share.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-sharealike.png b/branches/old-perl/trunk/images/cc/32x32/cc-sharealike.png new file mode 100644 index 0000000..0110c43 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-sharealike.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/cc-unknown.png b/branches/old-perl/trunk/images/cc/32x32/cc-unknown.png new file mode 100644 index 0000000..09a4bbb Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/cc-unknown.png differ diff --git a/branches/old-perl/trunk/images/cc/32x32/no-endorse.png b/branches/old-perl/trunk/images/cc/32x32/no-endorse.png new file mode 100644 index 0000000..0a91fd3 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/32x32/no-endorse.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-dollar.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-dollar.png new file mode 100644 index 0000000..5f98214 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-dollar.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-euro.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-euro.png new file mode 100644 index 0000000..dc251ed Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-euro.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-dollar.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-dollar.png new file mode 100644 index 0000000..49f272f Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-dollar.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-euro.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-euro.png new file mode 100644 index 0000000..22fc1f6 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-nd-euro.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-dollar.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-dollar.png new file mode 100644 index 0000000..0f2a0f1 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-dollar.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-euro.png b/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-euro.png new file mode 100644 index 0000000..6bd21d9 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nc-sa-euro.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-nd.png b/branches/old-perl/trunk/images/cc/buttons/by-nd.png new file mode 100644 index 0000000..8f31703 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-nd.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by-sa.png b/branches/old-perl/trunk/images/cc/buttons/by-sa.png new file mode 100644 index 0000000..f0a944e Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by-sa.png differ diff --git a/branches/old-perl/trunk/images/cc/buttons/by.png b/branches/old-perl/trunk/images/cc/buttons/by.png new file mode 100644 index 0000000..822491e Binary files /dev/null and b/branches/old-perl/trunk/images/cc/buttons/by.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-by.png b/branches/old-perl/trunk/images/cc/cc-by.png new file mode 100644 index 0000000..0893d55 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-by.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-noderivatives.png b/branches/old-perl/trunk/images/cc/cc-noderivatives.png new file mode 100644 index 0000000..fd64867 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-noderivatives.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-noncommercial.png b/branches/old-perl/trunk/images/cc/cc-noncommercial.png new file mode 100644 index 0000000..efb3da9 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-noncommercial.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-remix.png b/branches/old-perl/trunk/images/cc/cc-remix.png new file mode 100644 index 0000000..cf9879c Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-remix.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-share.png b/branches/old-perl/trunk/images/cc/cc-share.png new file mode 100644 index 0000000..70a3540 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-share.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-sharealike.png b/branches/old-perl/trunk/images/cc/cc-sharealike.png new file mode 100644 index 0000000..d078641 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-sharealike.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-unknown.png b/branches/old-perl/trunk/images/cc/cc-unknown.png new file mode 100644 index 0000000..c203de5 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-unknown.png differ diff --git a/branches/old-perl/trunk/images/cc/cc-unknown.xcf b/branches/old-perl/trunk/images/cc/cc-unknown.xcf new file mode 100644 index 0000000..02c9c78 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/cc-unknown.xcf differ diff --git a/branches/old-perl/trunk/images/cc/no-endorse.png b/branches/old-perl/trunk/images/cc/no-endorse.png new file mode 100644 index 0000000..746dc85 Binary files /dev/null and b/branches/old-perl/trunk/images/cc/no-endorse.png differ diff --git a/branches/old-perl/trunk/images/favicon.ico b/branches/old-perl/trunk/images/favicon.ico new file mode 100644 index 0000000..dc5db63 Binary files /dev/null and b/branches/old-perl/trunk/images/favicon.ico differ diff --git a/branches/old-perl/trunk/images/logo.png b/branches/old-perl/trunk/images/logo.png new file mode 100644 index 0000000..8f3266e Binary files /dev/null and b/branches/old-perl/trunk/images/logo.png differ diff --git a/branches/old-perl/trunk/images/logo.svg b/branches/old-perl/trunk/images/logo.svg new file mode 100644 index 0000000..38ec722 --- /dev/null +++ b/branches/old-perl/trunk/images/logo.svg @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + Yo + Yo + + + landa + landa + + + diff --git a/branches/old-perl/trunk/images/mplayer.png b/branches/old-perl/trunk/images/mplayer.png new file mode 100644 index 0000000..cf5dae5 Binary files /dev/null and b/branches/old-perl/trunk/images/mplayer.png differ diff --git a/branches/old-perl/trunk/images/openid.png b/branches/old-perl/trunk/images/openid.png new file mode 100755 index 0000000..cf89d5d Binary files /dev/null and b/branches/old-perl/trunk/images/openid.png differ diff --git a/branches/old-perl/trunk/images/tango/128x128/actions/document-save.png b/branches/old-perl/trunk/images/tango/128x128/actions/document-save.png new file mode 100644 index 0000000..0c5a242 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/128x128/actions/document-save.png differ diff --git a/branches/old-perl/trunk/images/tango/128x128/actions/document-send.png b/branches/old-perl/trunk/images/tango/128x128/actions/document-send.png new file mode 100644 index 0000000..f16c04f Binary files /dev/null and b/branches/old-perl/trunk/images/tango/128x128/actions/document-send.png differ diff --git a/branches/old-perl/trunk/images/tango/128x128/actions/player_play.png b/branches/old-perl/trunk/images/tango/128x128/actions/player_play.png new file mode 100644 index 0000000..0aefd5d Binary files /dev/null and b/branches/old-perl/trunk/images/tango/128x128/actions/player_play.png differ diff --git a/branches/old-perl/trunk/images/tango/128x128/apps/bittorrent.png b/branches/old-perl/trunk/images/tango/128x128/apps/bittorrent.png new file mode 100644 index 0000000..a439bfe Binary files /dev/null and b/branches/old-perl/trunk/images/tango/128x128/apps/bittorrent.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/document-new.png b/branches/old-perl/trunk/images/tango/16x16/actions/document-new.png new file mode 100644 index 0000000..4c3efdd Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/document-new.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/document-properties.png b/branches/old-perl/trunk/images/tango/16x16/actions/document-properties.png new file mode 100644 index 0000000..ab0e8ea Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/document-properties.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/document-save.png b/branches/old-perl/trunk/images/tango/16x16/actions/document-save.png new file mode 100644 index 0000000..22ff495 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/document-save.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/go-up.png b/branches/old-perl/trunk/images/tango/16x16/actions/go-up.png new file mode 100644 index 0000000..fa9a7d7 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/go-up.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/system-log-out.png b/branches/old-perl/trunk/images/tango/16x16/actions/system-log-out.png new file mode 100644 index 0000000..0010931 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/system-log-out.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/actions/system-search.png b/branches/old-perl/trunk/images/tango/16x16/actions/system-search.png new file mode 100644 index 0000000..fd7f0b0 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/actions/system-search.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/categories/preferences-system.png b/branches/old-perl/trunk/images/tango/16x16/categories/preferences-system.png new file mode 100644 index 0000000..9460dfc Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/categories/preferences-system.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/emblems/emblem-favorite.png b/branches/old-perl/trunk/images/tango/16x16/emblems/emblem-favorite.png new file mode 100644 index 0000000..3acb57d Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/emblems/emblem-favorite.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/mimetypes/text-x-generic.png b/branches/old-perl/trunk/images/tango/16x16/mimetypes/text-x-generic.png new file mode 100644 index 0000000..2d7f2d6 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/mimetypes/text-x-generic.png differ diff --git a/branches/old-perl/trunk/images/tango/16x16/mimetypes/video-x-generic.png b/branches/old-perl/trunk/images/tango/16x16/mimetypes/video-x-generic.png new file mode 100644 index 0000000..64e7a30 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/16x16/mimetypes/video-x-generic.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/actions/document-send.png b/branches/old-perl/trunk/images/tango/32x32/actions/document-send.png new file mode 100644 index 0000000..28a33bc Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/actions/document-send.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/actions/go-first.png b/branches/old-perl/trunk/images/tango/32x32/actions/go-first.png new file mode 100644 index 0000000..5e2a6b1 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/actions/go-first.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/actions/go-last.png b/branches/old-perl/trunk/images/tango/32x32/actions/go-last.png new file mode 100644 index 0000000..48fe95b Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/actions/go-last.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/actions/go-next.png b/branches/old-perl/trunk/images/tango/32x32/actions/go-next.png new file mode 100644 index 0000000..a68e2db Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/actions/go-next.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/actions/go-previous.png b/branches/old-perl/trunk/images/tango/32x32/actions/go-previous.png new file mode 100644 index 0000000..c37bc04 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/actions/go-previous.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/status/dialog-error.png b/branches/old-perl/trunk/images/tango/32x32/status/dialog-error.png new file mode 100644 index 0000000..5e2fe8c Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/status/dialog-error.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/status/dialog-information.png b/branches/old-perl/trunk/images/tango/32x32/status/dialog-information.png new file mode 100644 index 0000000..2ac5747 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/status/dialog-information.png differ diff --git a/branches/old-perl/trunk/images/tango/32x32/status/dialog-warning.png b/branches/old-perl/trunk/images/tango/32x32/status/dialog-warning.png new file mode 100644 index 0000000..7233d45 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/32x32/status/dialog-warning.png differ diff --git a/branches/old-perl/trunk/images/tango/48x48/actions/document-send.png b/branches/old-perl/trunk/images/tango/48x48/actions/document-send.png new file mode 100644 index 0000000..1892116 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/48x48/actions/document-send.png differ diff --git a/branches/old-perl/trunk/images/tango/48x48/actions/go-first.png b/branches/old-perl/trunk/images/tango/48x48/actions/go-first.png new file mode 100644 index 0000000..e640782 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/48x48/actions/go-first.png differ diff --git a/branches/old-perl/trunk/images/tango/48x48/actions/go-last.png b/branches/old-perl/trunk/images/tango/48x48/actions/go-last.png new file mode 100644 index 0000000..85c08d7 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/48x48/actions/go-last.png differ diff --git a/branches/old-perl/trunk/images/tango/48x48/actions/go-next.png b/branches/old-perl/trunk/images/tango/48x48/actions/go-next.png new file mode 100644 index 0000000..47d26b4 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/48x48/actions/go-next.png differ diff --git a/branches/old-perl/trunk/images/tango/48x48/actions/go-previous.png b/branches/old-perl/trunk/images/tango/48x48/actions/go-previous.png new file mode 100644 index 0000000..e29ed76 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/48x48/actions/go-previous.png differ diff --git a/branches/old-perl/trunk/images/tango/AUTHORS b/branches/old-perl/trunk/images/tango/AUTHORS new file mode 100644 index 0000000..c54ec5b --- /dev/null +++ b/branches/old-perl/trunk/images/tango/AUTHORS @@ -0,0 +1,9 @@ +Ulisse Perusin +Steven Garrity +Lapo Calamandrei +Ryan Collier +Rodney Dawes +Andreas Nilsson +Tuomas Kuosmanen +Garrett LeSage +Jakub Steiner diff --git a/branches/old-perl/trunk/images/tango/COPYING b/branches/old-perl/trunk/images/tango/COPYING new file mode 100644 index 0000000..e709d0c --- /dev/null +++ b/branches/old-perl/trunk/images/tango/COPYING @@ -0,0 +1,67 @@ +Creative Commons Attribution-ShareAlike 2.5 License Agreement + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. + 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License. + 3. "Licensor" means the individual or entity that offers the Work under the terms of this License. + 4. "Original Author" means the individual or entity who created the Work. + 5. "Work" means the copyrightable work of authorship offered under the terms of this License. + 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. + +2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; + 2. to create and reproduce Derivative Works; + 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; + 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works. + 5. + + For the avoidance of doubt, where the work is a musical composition: + 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work. + 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions). + 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested. + 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License. + 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + +Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. + +Creative Commons may be contacted at http://creativecommons.org/. diff --git a/branches/old-perl/trunk/images/tango/accessories-text-editor.png b/branches/old-perl/trunk/images/tango/accessories-text-editor.png new file mode 100644 index 0000000..f84c37c Binary files /dev/null and b/branches/old-perl/trunk/images/tango/accessories-text-editor.png differ diff --git a/branches/old-perl/trunk/images/tango/search.png b/branches/old-perl/trunk/images/tango/search.png new file mode 100644 index 0000000..a0155e7 Binary files /dev/null and b/branches/old-perl/trunk/images/tango/search.png differ diff --git a/branches/old-perl/trunk/images/tango/video.png b/branches/old-perl/trunk/images/tango/video.png new file mode 100644 index 0000000..89757fa Binary files /dev/null and b/branches/old-perl/trunk/images/tango/video.png differ diff --git a/branches/old-perl/trunk/images/totem.png b/branches/old-perl/trunk/images/totem.png new file mode 100644 index 0000000..7774f4e Binary files /dev/null and b/branches/old-perl/trunk/images/totem.png differ diff --git a/branches/old-perl/trunk/images/vlc.png b/branches/old-perl/trunk/images/vlc.png new file mode 100644 index 0000000..122bf72 Binary files /dev/null and b/branches/old-perl/trunk/images/vlc.png differ diff --git a/branches/old-perl/trunk/images/xiphfish.png b/branches/old-perl/trunk/images/xiphfish.png new file mode 100755 index 0000000..64e8f91 Binary files /dev/null and b/branches/old-perl/trunk/images/xiphfish.png differ diff --git a/branches/old-perl/trunk/include.pl b/branches/old-perl/trunk/include.pl new file mode 100644 index 0000000..014f1e4 --- /dev/null +++ b/branches/old-perl/trunk/include.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +#TODO: make this script specific when we use fastcgi +use CGI qw(:standard); +use CGI::Session; +use DBI; +use XML::Simple qw(:strict); +use Digest::SHA qw(sha256_hex); +use LWPx::ParanoidAgent; +use Net::OpenID::Consumer; +use File::Copy; +use XML::LibXSLT; +use XML::LibXML; +use LWP::UserAgent; +use HTTP::Request; +use CGI::Carp qw(fatalsToBrowser set_message); + +#send error message to user +set_message("It's not a bug, it's a feature!!(include this error message in your bugreport here: Yolanda bugtracker)"); + +# change this as you install it somewhere else +$root = '/var/www/yolanda'; + +use lib qw(/var/www/yolanda); + +#set global config variable +$config = XMLin("$root/config/backend.xml", KeyAttr => {string => 'id'}, ForceArray => [ 'string' ], ContentKey => '-content'); +$config = $config->{"strings"}->{"string"}; + +#set database connection string +$dbh = DBI->connect("DBI:mysql:".$config->{"database_name"}.":".$config->{"database_host"}, $config->{"database_username"}, $config->{"database_password"}) or die $DBI::errstr; +1; diff --git a/branches/old-perl/trunk/index.pl b/branches/old-perl/trunk/index.pl new file mode 100644 index 0000000..546ccbb --- /dev/null +++ b/branches/old-perl/trunk/index.pl @@ -0,0 +1,169 @@ +require "functions.pl"; + +#create or resume session +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +$page->setNamespace( $config->{"xml_namespace_cc"}, "cc", 0); +$page->setNamespace( $config->{"xml_namespace_dc"}, "dc", 0); +$page->setNamespace( $config->{"xml_namespace_rdf"}, "rdf", 0); + +#TODO: make the element unneccesary +$page->appendChild(XML::LibXML::Element->new( "frontpage" )); + +#if a message box is to be shown +if($query->param('information')) +{ + $page->appendChild(message("information", $query->param('information'), $query->param('value'))); +} +elsif($query->param('error')) +{ + $page->appendChild(message("error", $query->param('error'), $query->param('value'))); +} +elsif($query->param('warning')) +{ + $page->appendChild(message("warning", $query->param('warning'), $query->param('value'))); +} + +#new tagcloud xml element +my $tagcloud = XML::LibXML::Element->new( "tagcloud" ); + +#prepare query +my $sth = $dbh->prepare(qq{select text, count from tagcloud }) or die $dbh->errstr; + +#execute it +$sth->execute() or die $dbh->errstr; + +#get every returned value and append it to tagcloud +while (my ($text, $count) = $sth->fetchrow_array()) +{ + #TODO: why not use text + my $tag = XML::LibXML::Element->new( "tag" ); + $tag->appendTextChild("text", $text); + $tag->appendTextChild("count", $count); + $tagcloud->appendChild($tag); +} + +#finish query +$sth->finish() or die $dbh->errstr; + +$page->appendChild($tagcloud); + +#now get the frontpage video queries from config and process them +foreach $strquery ($config->{"search_frontpage_one_query"}, $config->{"search_frontpage_two_query"}, $config->{"search_frontpage_three_query"}) +{ + #new results block + my $results = XML::LibXML::Element->new( "results" ); + $results->setAttribute( "query", $strquery ); + + #get query string and args + my ($dbquery, @args) = get_sqlquery($strquery); + $dbquery .= " limit 0, $config->{'search_frontpage_size'}"; + + #prepare query + $sth = $dbh->prepare($dbquery) or die $dbh->errstr; + + #execute it + $sth->execute(@args) or die @args; + + #foreach result, fill appropriate results hash + while (my ($id, $title, $description, $publisher, $timestamp, $creator, + $subject, $source, $language, $coverage, $rights, + $license, $filesize, $duration, $width, $height, $fps, $viewcount, + $downloadcount) = $sth->fetchrow_array()) + { + #construct xml + my $result = XML::LibXML::Element->new( "result" ); + $result->setAttribute( "thumbnail", $config->{"url_root"}."/video-stills/thumbnails/$id" ); + $result->setAttribute( "preview", $config->{"url_root"}."/video-stills/previews/$id" ); + $result->setAttribute( "duration", $duration ); + $result->setAttribute( "viewcount", $viewcount ); + + my $rdf = XML::LibXML::Element->new( "RDF" ); + $rdf->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf"); + + my $work = XML::LibXML::Element->new( "Work" ); + $work->setNamespace( "http://web.resource.org/cc/", "cc"); + $work->setNamespace( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $work->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", $config->{"url_root"}."/download/$id/" ); + + $node = XML::LibXML::Element->new( "coverage" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($coverage); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "creator" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($creator); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "date" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($date); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "description" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($description); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "identifier" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($config->{"url_root"}."/video/".urlencode($title)."/$id/"); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "language" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($language); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "publisher" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($publisher); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "rights" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($rights); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "source" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($source); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "subject" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($subjcet); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "title" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($title); + $work->appendChild($node); + + my $license = XML::LibXML::Element->new( "License" ); + $license->setNamespace("http://web.resource.org/cc/", "cc"); + $license->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $license->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", "http://creativecommons.org/licenses/GPL/2.0/" ); + + $rdf->appendChild($work); + $rdf->appendChild($license); + + $result->appendChild($rdf); + + $results->appendChild($result); + } + $page->appendChild($results); +} + +$doc->setDocumentElement($page); + +output_page($doc); diff --git a/branches/old-perl/trunk/init_sql.pl b/branches/old-perl/trunk/init_sql.pl new file mode 100644 index 0000000..dc97444 --- /dev/null +++ b/branches/old-perl/trunk/init_sql.pl @@ -0,0 +1,138 @@ +require "include.pl"; + +#create or resume session +CGI::Session->name($config->{"page_cookie_name"}); +my $session = new CGI::Session; + +$dbh->do(qq{drop table config}); + +$dbh->do(qq{drop table users}); + +$dbh->do(qq{drop table videos}); + +$dbh->do(qq{drop table uploaded}); + +$dbh->do(qq{drop table tagcloud}); + +$dbh->do(qq{drop table comments}); + +$dbh->do(qq{create table + tagcloud + ( + text varchar(255) not null, + count int not null + ) +}) or die $dbh->errstr; + +$dbh->do(qq{insert into + tagcloud values + ( + 'web tv', 68 + ) +}) or die $dbh->errstr; + +$dbh->do(qq{create table + users + ( + id int auto_increment not null, + username varchar(255) not null, + password char(41) not null, + sid char(32) not null, + timestamp bigint not null, + pagesize tinyint unsigned default 5, + primary key (id) + ) +}) or die $dbh->errstr; + +$dbh->do(qq{insert into + users + ( + username, + password + ) + values + ( + 'test', + password( 'test' ) + ) +}) or die $dbh->errstr; + +$dbh->do(qq{create table + uploaded + ( + id int auto_increment not null, + title varchar(255) not null, + description text not null, + userid int not null, + timestamp bigint not null, + creator varchar(255) not null, + subject varchar(255) not null, + source varchar(255) not null, + language varchar(255) not null, + coverage varchar(255) not null, + rights varchar(255) not null, + license varchar(255) not null, + filesize int default -1, + duration int default -1, + width smallint default -1, + height smallint default -1, + fps float not null, + hash char(64) not null, + primary key (id) + ) +}) or die $dbh->errstr; + +$dbh->do(qq{create table + videos + ( + id int auto_increment not null, + title varchar(255) not null, + description text not null, + userid int not null, + timestamp bigint not null, + creator varchar(255) not null, + subject varchar(255) not null, + source varchar(255) not null, + language varchar(255) not null, + coverage varchar(255) not null, + rights varchar(255) not null, + license varchar(255) not null, + filesize int not null, + duration int not null, + width smallint not null, + height smallint not null, + fps float not null, + hash char(64) not null, + viewcount int default 0, + downloadcount int default 0, + primary key (id), + fulltext (title, description, subject) + ) +}) or die $dbh->errstr; + +$dbh->do(qq{create table + comments + ( + id int auto_increment not null, + userid int not null, + videoid int not null, + text text not null, + timestamp bigint not null, + primary key (id) + ) +}) or die $dbh->errstr; + +$dbh->do(qq{create table + pingbacks + ( + id int auto_increment not null, + source varchar(255) not null, + videoid int not null, + text text not null, + timestamp bigint not null, + primary key (id) + ) +}) or die $dbh->errstr; + +print $session->header(); +print "initiated database"; diff --git a/branches/old-perl/trunk/java/LICENSE.cortado b/branches/old-perl/trunk/java/LICENSE.cortado new file mode 100644 index 0000000..f056537 --- /dev/null +++ b/branches/old-perl/trunk/java/LICENSE.cortado @@ -0,0 +1,17 @@ +/* Cortado - a video player java applet + * Copyright (C) 2004 Fluendo S.L. + * + * 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 Street #330, Boston, MA 02111-1307, USA. + */ diff --git a/branches/old-perl/trunk/java/LICENSE.jheora b/branches/old-perl/trunk/java/LICENSE.jheora new file mode 100644 index 0000000..b40af56 --- /dev/null +++ b/branches/old-perl/trunk/java/LICENSE.jheora @@ -0,0 +1,23 @@ +/* Jheora + * Copyright (C) 2004 Fluendo S.L. + * + * Written by: 2004 Wim Taymans + * + * Many thanks to + * The Xiph.Org Foundation http://www.xiph.org/ + * Jheora was based on their Theora reference decoder. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ diff --git a/branches/old-perl/trunk/java/cortado-ovt-stripped-0.2.2.jar b/branches/old-perl/trunk/java/cortado-ovt-stripped-0.2.2.jar new file mode 100644 index 0000000..61ce3f2 Binary files /dev/null and b/branches/old-perl/trunk/java/cortado-ovt-stripped-0.2.2.jar differ diff --git a/branches/old-perl/trunk/lang/en.xml b/branches/old-perl/trunk/lang/en.xml new file mode 100755 index 0000000..6b8f547 --- /dev/null +++ b/branches/old-perl/trunk/lang/en.xml @@ -0,0 +1,273 @@ + + + + + + | + + + to upload videos, log in first. + + Register + Login + + Upload video + Settings + + logged in as + Logout + + + © 2007 - 2008 Yolanda Team + + This software comes WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for details. + + view license + get source code + report bug + + + Comments + Description + Embedding + License + Login + Metadata + Plugin Help + Preview + Results + Search + Tagcloud + Upload form + Video + + + Find + Instant Access + Advanced Search + + new videos + most downloaded + popular videos + new videos + most downloaded + popular videos + + + Error 202c - Access forbidden by government. + You did not supply a file. + You did not supply a title. + You did not supply a creator. + You did not supply any keywords. + You did not supply a description. + You did not supply a publisher. + You did not supply a title. + You did not supply a source. + You did not supply a language. + You did not supply a coverage. + You did not supply a rights holder. + You seem to be already registered. Please log out to create a new account. + You seem to be already logged in. Please log out to log in again. + Username and / or password do not match. + Passwords do not match. + Your desired Username was already registered + Please insert a username. + Please insert a password. + Please repeat your password. + You passed no query string. + Your browser does not support Ogg Theora video playback. + There is no video matching your request + The provided URL doesn't declare its OpenID identity server + No URL entered + Invalid URL + URL provided doesn't seem to have a head tag + Error fetching the provided URL + Invalid audio and/or video stream + Cannot read video file + File is not a video + Video has already been uploaded + The filesize of the video you uploaded is too small + The filesize of the video you uploaded is too big + The width of the video you uploaded is too small + The height of the video you uploaded is too small + + + + You are now logged in. + You are now logged out. + To put the video into context, additional metainformation is needed. + + Your comment has been submitted. + Your account has been created. + Your file has been uploaded. It will be available at + Your settings have been updated. + The video being requested is not yet available. The Server has to convert + + + There are no results satisfying your query. + + + results + to + out of + + ordered by + ascending + descending + oldest first + most recent first + least downloaded first + most downloaded first + least viewed first + most viewed first + shortest first + lenghtest first + smallest first + biggest first + results on + pages + relevance + duration + filesize + views + downloads + timestamp + + + Search + + + Username + Username or OpenID + Password + repeat password + No password required. + Register + Login + + + file + Continue + Upload + Basic Information + Similar Videos + Additional Metainformation + Licensing + Summary / Upload + Describe the video you want to upload. + Similar videos have already been uploaded. If none of these videos matches yours, continue. + Providing these infos helps us to put the video into context. + Describe the video's license. + Double-check the data and correct mistakes, if necessary. + Specify the file you want to upload. + State the title of the video. + Specify the creator of the video. + State some keywords, separated by spaces. + Describe the video in natural language. + Specify the source, preferably by URL. + State the language of the video. + choose a language + Specify the time and location covered. + Specify the copyright owner of the video. + Specify the license, preferably by URL. + Optionally, choose Creative Commons licensing. + + Is modification of the video allowed ? + + + Modification is allowed. + + + Modification is allowed, as long as others share alike. + + + Modification is not allowed. + + + Is commercial use of the video allowed ? + + + Commercial use is allowed. + + + Commercial use is not allowed. + + + + English + German + + + Download + Plackback + use browser plugin + use java applet + license conditions + To embed the video on another web page, use the following HTML code: + Login to comment + Post + + + + To view this video, install + VLC, + mplayer or + another player capable of playing + Ogg Theora + videos. + + + For installation instructions, see the Wikipedia Media Help. + + + + + backlink + + + title + author + keywords + description + uploader + contributor + upload date + source + language + coverage + rights holder + license + + duration + viewcount + + + account settings for + choose pagesize + + + - + this page + all results + This is an RSS Feed for the query " + ". + + + day + month + year + + + h + MB + min + sec + + + + diff --git a/branches/old-perl/trunk/lang/languages.xml b/branches/old-perl/trunk/lang/languages.xml new file mode 100644 index 0000000..d650333 --- /dev/null +++ b/branches/old-perl/trunk/lang/languages.xml @@ -0,0 +1,935 @@ + + + + + aa + Afar + Afaraf + + + ab + Abkhazian + Аҧсуа + + + ae + Avestan + avesta + + + af + Afrikaans + Afrikaans + + + ak + Akan + Akan + + + am + Amharic + አማርኛ + + + an + Aragonese + Aragonés + + + ar + Arabic + العربية + + + as + Assamese + অসমীয়া + + + av + Avaric + авар мацӀ; магӀарул мацӀ + + + ay + Aymara + aymar aru + + + az + Azerbaijani + azərbaycan dili + + + ba + Bashkir + башҡорт теле + + + be + Belarusian + Беларуская + + + bg + Bulgarian + български език + + + bh + Bihari + भोजपुरी + + + bi + Bislama + Bislama + + + bm + Bambara + bamanankan + + + bn + Bengali + বাংলা + + + bo + Tibetan + བོད་ཡིག + + + br + Breton + brezhoneg + + + bs + Bosnian + bosanski jezik + + + ca + Catalan + Català + + + ce + Chechen + нохчийн мотт + + + ch + Chamorro + Chamoru + + + co + Corsican + corsu; lingua corsa + + + cr + Cree + ᓀᐦᐃᔭᐍᐏᐣ + + + cs + Czech + česky; čeština + + + cu + Church Slavic + + + + cv + Chuvash + чӑваш чӗлхи + + + cy + Welsh + Cymraeg + + + da + Danish + dansk + + + de + German + Deutsch + + + dv + Divehi + ދިވެހި + + + dz + Dzongkha + རྫོང་ཁ + + + ee + Ewe + Ɛʋɛgbɛ + + + el + Greek + Ελληνικά + + + en + English + English + + + eo + Esperanto + Esperanto + + + es + Spanish + español; castellano + + + et + Estonian + Eesti keel + + + eu + Basque + euskara + + + fa + Persian + فارسی + + + ff + Fulah + Fulfulde + + + fi + Finnish + suomen kieli + + + fj + Fijian + vosa Vakaviti + + + fo + Faroese + Føroyskt + + + fr + French + français; langue française + + + fy + Western Frisian + Frysk + + + ga + Irish + Gaeilge + + + gd + Scottish Gaelic + Gàidhlig + + + gl + Galician + Galego + + + gn + Guaraní + Avañe'ẽ + + + gu + Gujarati + ગુજરાતી + + + gv + Manx + Ghaelg + + + ha + Hausa + هَوُسَ + + + he + Hebrew + עברית + + + hi + Hindi + हिन्दी; हिंदी + + + ho + Hiri Motu + Hiri Motu + + + hr + Croatian + Hrvatski + + + ht + Haitian + Kreyòl ayisyen + + + hu + Hungarian + Magyar + + + hy + Armenian + Հայերեն + + + hz + Herero + Otjiherero + + + ia + Interlingua + interlingua + + + id + Indonesian + Bahasa Indonesia + + + ie + Interlingue + Interlingue + + + ig + Igbo + Igbo + + + ii + Sichuan Yi + ꆇꉙ + + + ik + Inupiaq + Iñupiaq; Iñupiatun + + + io + Ido + Ido + + + is + Icelandic + Íslenska + + + it + Italian + Italiano + + + iu + Inuktitut + ᐃᓄᒃᑎᑐᑦ + + + ja + Japanese + 日本語 (にほんご/にっぽんご) + + + jv + Javanese + basa Jawa + + + ka + Georgian + ქართული + + + kg + Kongo + KiKongo + + + ki + Kikuyu + Gĩkũyũ + + + kj + Kwanyama + Kuanyama + + + kk + Kazakh + Қазақ тілі + + + kl + Kalaallisut + kalaallisut; kalaallit oqaasii + + + km + Khmer + ភាសាខ្មែរ + + + kn + Kannada + ಕನ್ನಡ + + + ko + Korean + 한국어 (韓國語); 조선말 (朝鮮語) + + + kr + Kanuri + Kanuri + + + ks + Kashmiri + कश्मीरी; كشميري + + + ku + Kurdish + Kurdî; كوردی + + + kv + Komi + коми кыв + + + kw + Cornish + Kernewek + + + ky + Kirghiz + кыргыз тили + + + la + Latin + latine; lingua latina + + + lb + Luxembourgish + Lëtzebuergesch + + + lg + Ganda + Luganda + + + li + Limburgish + Limburgs + + + ln + Lingala + Lingála + + + lo + Lao + ພາສາລາວ + + + lt + Lithuanian + lietuvių kalba + + + lu + Luba-Katanga + + + + lv + Latvian + latviešu valoda + + + mg + Malagasy + Malagasy fiteny + + + mh + Marshallese + Kajin M̧ajeļ + + + mi + Māori + te reo Māori + + + mk + Macedonian + македонски јазик + + + ml + Malayalam + മലയാളം + + + mn + Mongolian + Монгол + + + mo + Moldavian + лимба молдовеняскэ + + + mr + Marathi + मराठी + + + ms + Malay + bahasa Melayu; بهاس ملايو + + + mt + Maltese + Malti + + + my + Burmese + ဗမာစာ + + + na + Nauru + Ekakairũ Naoero + + + nb + Norwegian Bokmål + Norsk bokmål + + + nd + North Ndebele + isiNdebele + + + ne + Nepali + नेपाली + + + ng + Ndonga + Owambo + + + nl + Dutch + Nederlands + + + nn + Norwegian Nynorsk + Norsk nynorsk + + + no + Norwegian + Norsk + + + nr + South Ndebele + Ndébélé + + + nv + Navajo + Diné bizaad; Dinékʼehǰí + + + ny + Chichewa + chiCheŵa; chinyanja + + + oc + Occitan + Occitan + + + oj + Ojibwa + ᐊᓂᔑᓈᐯᒧᐎᓐ + + + om + Oromo + Afaan Oromoo + + + or + Oriya + ଓଡ଼ିଆ + + + os + Ossetian + Ирон æвзаг + + + pa + Panjabi + ਪੰਜਾਬੀ; پنجابی + + + pi + Pāli + पाऴि + + + pl + Polish + polski + + + ps + Pashto + پښتو + + + pt + Portuguese + Português + + + qu + Quechua + Runa Simi; Kichwa + + + rm + Raeto-Romance + rumantsch grischun + + + rn + Kirundi + kiRundi + + + ro + Romanian + română + + + ru + Russian + русский язык + + + rw + Kinyarwanda + Kinyarwanda + + + sa + Sanskrit + संस्कृतम् + + + sc + Sardinian + sardu + + + sd + Sindhi + सिन्धी; سنڌي، سندھی + + + se + Northern Sami + Davvisámegiella + + + sg + Sango + yângâ tî sängö + + + sh + Serbo-Croatian + Srpskohrvatski; Српскохрватски + + + si + Sinhalese + සිංහල + + + sk + Slovak + slovenčina + + + sl + Slovenian + slovenščina + + + sm + Samoan + gagana fa'a Samoa + + + sn + Shona + chiShona + + + so + Somali + Soomaaliga; af Soomaali + + + sq + Albanian + Shqip + + + sr + Serbian + српски језик + + + ss + Swati + SiSwati + + + st + Sotho + seSotho + + + su + Sundanese + Basa Sunda + + + sv + Swedish + Svenska + + + sw + Swahili + Kiswahili + + + ta + Tamil + தமிழ் + + + te + Telugu + తెలుగు + + + tg + Tajik + тоҷикӣ; toğikī; تاجیکی + + + th + Thai + ไทย + + + ti + Tigrinya + ትግርኛ + + + tk + Turkmen + Türkmen; Түркмен + + + tl + Tagalog + Tagalog + + + tn + Tswana + seTswana + + + to + Tonga + faka Tonga + + + tr + Turkish + Türkçe + + + ts + Tsonga + xiTsonga + + + tt + Tatar + татарча; tatarça; تاتارچا + + + tw + Twi + Twi + + + ty + Tahitian + Reo Mā`ohi + + + ug + Uighur + Uyƣurqə; ئۇيغۇرچ + + + uk + Ukrainian + Українська + + + ur + Urdu + اردو + + + uz + Uzbek + O'zbek; Ўзбек; أۇزبېك + + + ve + Venda + tshiVenḓa + + + vi + Vietnamese + Tiếng Việt + + + vo + Volapük + Volapük + + + wa + Walloon + Walon + + + wo + Wolof + Wollof + + + xh + Xhosa + isiXhosa + + + yi + Yiddish + ייִדיש + + + yo + Yoruba + Yorùbá + + + za + Zhuang + Saɯ cueŋƅ; Saw cuengh + + + zh + Chinese + 中文, 汉语, 漢語 + + + zu + Zulu + isiZulu + + + diff --git a/branches/old-perl/trunk/login.pl b/branches/old-perl/trunk/login.pl new file mode 100644 index 0000000..8221ea8 --- /dev/null +++ b/branches/old-perl/trunk/login.pl @@ -0,0 +1,137 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +#TODO: use $query->http("HTTP_REFERER"); to redirect to the site last visited + +if($query->param('action') eq "logout") +{ + #if logout is requested + #remove sid from database + $dbh->do(qq{update users set sid = '' where id = ?}, undef, $userinfo->{'id'}) or die $dbh->errstr; + $session->delete(); + + print $query->redirect("index.pl?information=information_logged_out"); +} +#check if user is logged in +elsif($userinfo->{'username'}) +{ + print $query->redirect("/index.pl?error=error_already_logged_in"); +} +#if password is empty and username begins with http:// then it's an openid login +elsif($query->param('pass') eq '' and $query->param('user')=~m/^http:\/\//) +{ + #create our openid consumer object + $con = Net::OpenID::Consumer->new( + ua => LWPx::ParanoidAgent->new, + cache => undef, # or File::Cache->new, + args => $query, + consumer_secret => $session->id, #is this save? don't know... + required_root => $config->{"url_root"} + ); + + #claim identity + $claimed = $con->claimed_identity($query->param('user')); + + #if claim failed, redirect + if(!defined($claimed)) + { + print $query->redirect("/index.pl?error=error_openid_".$con->errcode); + } + else + { + #try to set the check_url + $check_url = $claimed->check_url( + return_to => $config->{"url_root"}."login.pl?action=openid", #on success return to this address + trust_root => $config->{"url_root"}); #this is the string the user will be asked to trust + + #redirect to openid server to check claim + print $query->redirect($check_url); + } +} +#we return from an identity check +elsif($query->param('action') eq 'openid') +{ + #create our openid consumer object + $con = Net::OpenID::Consumer->new( + ua => LWPx::ParanoidAgent->new, + cache => undef, # or File::Cache->new, + args => $query, + consumer_secret => $session->id, #is this save? don't know... + required_root => $config->{"url_root"} + ); + + #redirect to setup url + if($setup_url = $con->user_setup_url) + { + #redirect to setup url - user will give confirmation there + print $query->redirect($setup_url); + } + #or cancel process + elsif ($con->user_cancel) + { + #cancelled - redirect to login form + print $query->redirect("index.pl"); + } + #or verify identity + elsif ($vident = $con->verified_identity) + { + #we are verified!! + my $verified_url = $vident->url; + + #check if this openid user already is in database + my $sth = $dbh->prepare(qq{select 1 from users where username = ? limit 1 }); + $sth->execute($verified_url); + + if($sth->fetchrow_array()) + { + #store session id in database + $dbh->do(qq{update users set sid = ? where username = ? }, undef, $session->id, $verified_url) or die $dbh->errstr; + } + else + { + #add openid user to dabase + $dbh->do(qq{insert into users (username, sid) values ( ?, ? ) }, undef, $verified_url, $session->id) or die $dbh->errstr; + } + + print $query->redirect("index.pl?information=information_logged_in"); + } + else + { + #an error occured + print $session->header(); + print "error validating identity: ", $con->errcode; + } +} +#else it's a normal login +#check if password is not empty and username is neither beginning with http nor empty +elsif($query->param('pass') ne '' and $query->param('user')!~m/^http:\/\// and $query->param('user') ne '') +{ + #prepare query + my $sth = $dbh->prepare(qq{select id from users + where password = password( ? ) and username = ? limit 1 }); + + #execute query + $sth->execute($query->param('pass'), $query->param('user')); + + #if something was returned username and password match + if($sth->fetchrow_array()) + { + #store session id in database + $dbh->do(qq{update users set sid = ? where username = ? }, undef, $session->id, $query->param('user')) or die $dbh->errstr; + print $query->redirect("index.pl?information=information_logged_in"); + } + else + { + print $query->redirect("index.pl?error=error_username_password_do_not_match"); + } +} +else +{ + print $query->redirect("index.pl"); +} diff --git a/branches/old-perl/trunk/makefile b/branches/old-perl/trunk/makefile new file mode 100644 index 0000000..0b96e98 --- /dev/null +++ b/branches/old-perl/trunk/makefile @@ -0,0 +1,34 @@ +INSTDIR=/usr/local +PROGNAME=yolanda + +build: frontend backend + echo "building" + +backend: database + # TODO: copy apache configuration + +database: + # TODO: database setup - use dialog to answer the questions + # which database ? (suggested: mysql) + # root pasword ? (for setup) + # yolanda username ? (suggested: yolanda) + # yolanda password ? (will generate random username if none is chosen) + dialog --yesno "database stuff" 10 40 + +frontend: svg2png + # TODO: figure out what should go in here + +install: build + -mkdir "${INSTDIR}/share/${PROGNAME}" + -mkdir "${INSTDIR}/share/${PROGNAME}/www" + # only stuff that is necessary should be copied - how to determine what is necessary ? + cp * ${INSTDIR}/share/${PROGNAME}/www -R + +remove: + rm -rf "${INSTDIR}/share/yolanda" + # TODO: kill off database + +svg2png: + # TODO: figure out how imagemagick works and convert every +single SVG + diff --git a/branches/old-perl/trunk/man/yolanda b/branches/old-perl/trunk/man/yolanda new file mode 100644 index 0000000..191d7fa --- /dev/null +++ b/branches/old-perl/trunk/man/yolanda @@ -0,0 +1,47 @@ +.TH YOLANDA 7 2008-01-02 "" "Yolanda Video CMS Manual" + +.SH NAME +Yolanda Video CMS + +.SH SYNOPSIS +.B daemon.pl + +.B tagcloud.pl + +.B yolanda-upload.pl + +.SH DESCRIPTION +Yolanda is a WWW video content management system using a Perl backend and XML frontend. Video playback in Browser is provided by Fluendo's Cortado Java applet or media player plugins like those of +.B vlc(1) +or +.B mplayer(1). + +.SH OPTIONS +MOAR CONTENT. +.B CONTRIBUTE ! + +.SH FILES +AS I SAID: +.B CONTRIBUTE ! + +.SH CONFORMING TO +XHTML 1.0 Strict <-- we hope so +[[insert +.IB MOAR +standards here]] + +.SH NOTES +this man page is useless, as it was thrown together just to see if it would be easy to make a man page without +.B prior knowledge \*(Tm +. + +.SH BUGS +many. see http://yolanda.mister-muffin.de/trac + +Yolanda is full of bad programming, severely unsafe and not fit for general use. Use on hacker conferences like the Chaos Communication Congress is encouraged - but please, for the love of the invisible pink unicorn, submit tickets in our bug tracking system afterwards. + +.SH EXAMPLE +this will change often ( so i will just omit it ) + +.SH SEE ALSO +.B yolanda-upload (1) diff --git a/branches/old-perl/trunk/man/yolanda-upload b/branches/old-perl/trunk/man/yolanda-upload new file mode 100644 index 0000000..dd86d97 --- /dev/null +++ b/branches/old-perl/trunk/man/yolanda-upload @@ -0,0 +1,79 @@ +.TH YOLANDA-UPLOAD 1 2008-01-03 "" "Yolanda Video CMS Manual" + +.SH NAME +Yolanda Uploader \- command-line tool to upload videos to WWW sites running Yolanda Video CMS. + +.SH SYNOPSIS +.B yolanda-upload.pl +.RI [ options ] + +.SH DESRIPTION +This manual page documents briefly the \fByolanda-upload\fP command. +.PP +\fByolanda-upload\fP is a program that uploads a video file to a WWW site running Yolanda Video CMS. + +.SH OPTIONS +This program follows the usual GNU command line synthax, with long options starting with two dashes (`-'). A summary of options is included below. + +As of now, all options are mandatory. + +.SS General options: +.TP +.B \-u, \-\-username +Specify the username. This value will also be used for the publisher. +.TP +.B \-p, \-\-password +Specify the password. Lol insecure !!1 +.TP +.B \-f, \-\-file +Upload given video file. + +.SS Metadata options: +.B \-t, \-\-title +State the title of the video. +.TP +.B \-d, \-\-description +State a description of the video in natural language. +.TP +.B \-x, \-\-tags +Specify multiple tags, separated by spaces. +.TP +.B \-c, \-\-creator +Specify the creator of the video. +.TP +.B \-s, \-\-source +Specify the source of the video, preferably by URL. +.TP +.B \-l, \-\-language +Specify the language of the video, preferably conforming to ISO ???. +.TP +.B -\v, \-\-coverage +Specify the coverage of the video, e.g. "Berlin, December 2007" +.PP +( coverage should be -o, because -v usually is used for "verbose". ) + +.SH CONFORMING TO +[[insert +.IB MOAR +standards here]] + +.SH NOTES +this man page is useless, as it was thrown together just to see if it would be easy to make a man page without +.B prior knowledge \*(Tm +. + +.SH BUGS +many. see http://yolanda.mister-muffin.de/trac + +Yolanda-upload is full of bad programming, severely unsafe and not fit for general use. Use on hacker conferences like the Chaos Communication Congress is encouraged - but please, for the love of the invisible pink unicorn, submit tickets in our bug tracking system afterwards. + +.SH EXAMPLE +this will change often ( so i will just omit it ) + +.SH SEE ALSO +\fByolanda\fP(7) + +.SH AUTHOR +yolanda-upload was written by Johannes Schauer. +.PP +This manual page was written by Nils Moskopp for his own amusement (but may be used by others). diff --git a/branches/old-perl/trunk/pingback.pl b/branches/old-perl/trunk/pingback.pl new file mode 100644 index 0000000..314edd5 --- /dev/null +++ b/branches/old-perl/trunk/pingback.pl @@ -0,0 +1,155 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +#we receive a POST request (this MUST contain a content/type definiton to be recognized) +if ($query->param("POSTDATA")) +{ + #use xml::simple to process rpc request + eval { my $xmlpost = XMLin($query->param("POSTDATA"), ForceArray => 0, KeyAttr => 0) }; + + #if everything worked + if (!$@) + { + #set internal variables + my $method = $xmlpost->{"methodName"}; + my $source = $xmlpost->{"params"}->{"param"}[0]->{"value"}->{"string"}; + my $target = $xmlpost->{"params"}->{"param"}[1]->{"value"}->{"string"}; + + #if this is really a pingback rpc request + if ($method eq "pingback.ping") + { + #if there are valid target and source nodes + if ($source =~ /^http:\/\// and $target =~ /^http:\/\//) + { + #fetch the source URI to verify that the source does indeed link to the target. + my $request = HTTP::Request->new(GET => $source); + my $ua = LWP::UserAgent->new; + my $response = $ua->request($request); + + #if the url indeed exists + if ($response->is_success) + { + #TODO: sanitize regex to grep site content + if (my ($text) = $response->content =~ m/(\S*.{0,17}$target.{0,17}\S*)/) + { + #check data to ensure that the target exists and is a valid entry. + my ($vid) = $target =~ /^$config->{'url_root'}\/video\/.*\/(\d+)\/.*/; + + #query database if we have such a video + my $sth = $dbh->prepare("select id from videos where id = ? limit 1"); + my $rowcount = $sth->execute($vid) or die $dbh->errstr; + + $sth->finish() or die $dbh->errstr; + + #if we have what the client wants to ping + if ($rowcount) + { + #check that the pingback has not already been registered. + $sth = $dbh->prepare("select id from pingbacks where videoid = ? limit 1"); + $rowcount = $sth->execute($vid) or die $dbh->errstr; + $sth->finish() or die $dbh->errstr; + + #if this is a new request + if ($rowcount eq "0E0") + { + #record the pingback. + $dbh->do(qq{insert into pingbacks (source, videoid, text, timestamp) values (?, ?, ?, unix_timestamp())}, undef, + $source, $vid, $text) or die $dbh->errstr; + + #construct xml::simple hash + my $xml = (); + $xml->{'params'}->{'param'}->{'value'}->{'string'} = ["Pingback from $source to $target registered. Keep the web talking! :-)"]; + + print $session->header( + -type=>'application/xml', + -charset=>'UTF-8', + ); + + print XMLout( + $xml, + XMLDecl => 1, + KeyAttr => {}, + RootName => 'methodResponse' + ); + } + else + { + send_error(48, "The pingback has already been registered."); + } + } + else + { + send_error(33, "The specified target URI cannot be used as a target."); + } + } + else + { + send_error(17, "The source URI does not contain a link to the target URI, and so cannot be used as a source."); + } + } + else + { + send_error(16, "The source URI does not exist."); + } + } + else + { + send_error(-32602, "server error. invalid method parameters"); + } + } + else + { + send_error(-32601, "server error. requested method not found"); + } + } + else + { + send_error(-32700,"parse error. not well formed"); + } +} +else +{ + print $session->header; + print "XML-RPC server only accepts POST requests with http content-type defined."; +} + +sub send_error +{ + my ($faultCode, $faultString) = @_; + + #construct xml::simple hash + my $xml = (); + push @{$xml->{'fault'}->{'value'}->{'struct'}->{'member'}}, + { + "name" => ["faultCode"], + "value" => + { + "int" => [$faultCode] + } + }; + push @{$xml->{'fault'}->{'value'}->{'struct'}->{'member'}}, + { + "name" => ["faultString"], + "value" => + { + "string" => [$faultString] + } + }; + + print $session->header( + -type=>'application/xml', + -charset=>'UTF-8', + ); + + print XMLout( + $xml, + XMLDecl => 1, + KeyAttr => {}, + RootName => 'methodResponse' + ); +} + diff --git a/branches/old-perl/trunk/register.pl b/branches/old-perl/trunk/register.pl new file mode 100644 index 0000000..0be997b --- /dev/null +++ b/branches/old-perl/trunk/register.pl @@ -0,0 +1,101 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +#check if user is logged in +if($username) +{ + $page->appendChild(message("error", "error_already_registered")); + + $doc->setDocumentElement($page); + + output_page($doc); +} +#if username and password are passed put them into the database +elsif($query->param('user') and $query->param('pass') and $query->param('pass_repeat')) +{ + if($query->param('pass') eq $query->param('pass_repeat')) + { + my $sth = $dbh->prepare(qq{select id from users where username = ? limit 1 }); + + #execute query + $sth->execute($query->param('user')); + + #if something was returned the selected username already exists + if($sth->fetchrow_array()) + { + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $page->appendChild(message("error", "error_username_already_registered")); + + $doc->setDocumentElement($page); + + output_page($doc); + } + else + { + #insert new user + $dbh->do(qq{insert into users (username, password, timestamp) values ( ?, password( ? ), unix_timestamp())}, undef, + $query->param("user"), $query->param("pass")) or die $dbh->errstr; + + print $query->redirect("index.pl?information=information_registered"); + } + } + else + { + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $page->appendChild(message("error", "error_passwords_do_not_match")); + + $doc->setDocumentElement($page); + + output_page($doc); + } +} +elsif(not $query->param('user') and ($query->param('pass') or $query->param('pass_repeat'))) +{ + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $page->appendChild(message("error", "error_insert_username")); + + $doc->setDocumentElement($page); + + output_page($doc); +} +elsif(not $query->param('pass') and ($query->param('user') or $query->param('pass_repeat'))) +{ + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $page->appendChild(message("error", "error_insert_password")); + + $doc->setDocumentElement($page); + + output_page($doc); +} +elsif(not $query->param('pass_repeat') and ($query->param('user') or $query->param('pass'))) +{ + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $page->appendChild(message("error", "error_repeat_password")); + + $doc->setDocumentElement($page); + + output_page($doc); +} +else +{ + $page->appendChild(XML::LibXML::Element->new( "registerform" )); + + $doc->setDocumentElement($page); + + output_page($doc); +} diff --git a/branches/old-perl/trunk/search.pl b/branches/old-perl/trunk/search.pl new file mode 100644 index 0000000..acea370 --- /dev/null +++ b/branches/old-perl/trunk/search.pl @@ -0,0 +1,56 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +$page->setNamespace( $config->{"xml_namespace_cc"}, "cc", 0); +$page->setNamespace( $config->{"xml_namespace_dc"}, "dc", 0); +$page->setNamespace( $config->{"xml_namespace_rdf"}, "rdf", 0); + +#check if query is set +if($query->param('query')) +{ + #construct querystring and arguments from user query + my ($dbquery, @args) = get_sqlquery($query->param('query')); + + #if successful + if($dbquery) + { + #fill xml with search results + $page->appendChild(fill_results($dbquery, @args)); + + $doc->setDocumentElement($page); + + #get all found results + my @results = $doc->findnodes( "//results/result" ); + + #set result query in result's parent + $results[0]->parentNode->setAttribute('query', $query->param('query')); + + #if result count is zero + if($#results == -1) + { + print $query->redirect("index.pl?warning=warning_no_results"); + } + else + { + output_page($doc); + } + } + else + { + print $query->redirect("index.pl?error=error_no_query"); + } +} +else +{ + print $query->redirect("index.pl?error=error_no_query"); +} diff --git a/branches/old-perl/trunk/settings.pl b/branches/old-perl/trunk/settings.pl new file mode 100644 index 0000000..3d7d6d9 --- /dev/null +++ b/branches/old-perl/trunk/settings.pl @@ -0,0 +1,44 @@ +require "functions.pl"; + +#TODO: are settings obsolete? + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +my @userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +if($userinfo->{'username'}) +{ + if($query->param('submit')) + { + $dbh->do(qq{update users set pagesize = ? where id = ?}, undef, $query->param('pagesize'), $userinfo->{'id'} ) or die $dbh->errstr; + + @userinfo = get_userinfo_from_sid($session->id); + + $page = get_page_array(@userinfo); + + $page->appendChild(message("information", "information_settings_changed")); + } +} + + +if($userinfo->{'username'}) +{ + my $settings = XML::LibXML::Element->new( "settings" ); + $settings->setAttribute("pagesize", $userinfo->{'pagesize'}); + $page->appendChild($settings); +} +else +{ + $page->appendChild(message("error", "error_202c")); +} + +$doc->setDocumentElement($page); + +output_page($doc); diff --git a/branches/old-perl/trunk/site/comment.dtd b/branches/old-perl/trunk/site/comment.dtd new file mode 100644 index 0000000..e27ff11 --- /dev/null +++ b/branches/old-perl/trunk/site/comment.dtd @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/site/licenses.xml b/branches/old-perl/trunk/site/licenses.xml new file mode 100644 index 0000000..350c115 --- /dev/null +++ b/branches/old-perl/trunk/site/licenses.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/style/colors/tango.css b/branches/old-perl/trunk/style/colors/tango.css new file mode 100644 index 0000000..36b637c --- /dev/null +++ b/branches/old-perl/trunk/style/colors/tango.css @@ -0,0 +1,108 @@ +/* +Yolanda default stylesheet colors (using tango color palette) +(c) 2007-2008 Nils Dagsson Moskopp + +This file is licensed under the WTF Public License +(License terms: Do what the fuck you want.) + +Purpose of this file is to provide graphics according to the Tango! palette. +Protip: Graphics are colors, background and pseudo-content images ! + +Please replace the colors in this file with suitable Tango! equivalents. +↑↑ Remove this notice as soon as this file holds only Tango! colors. ↑↑ +*/ + +/* +links "Sky Blue 2" #3465a4 +borders "Aluminium 5" #555753; + +*/ + +a +{ + /* what color is this ? */ + color: #3465a4; +} + +a +{ +} + + a:focus + { + color: #cc0000; + } + + a.footer, + a.header, + div.footer, + div.header + { + background-color: #f0f0f0; + border-color: #f0f0f0; + } + + a.footer:hover, + a.header:hover + { + background-color: #ffffff; + border-color: #c0c0c0; + } + + .messagebox#error + { + /* "Scarlet Red 1" + 30 luminosity */ + background-color: #f46060; + } + + .messagebox#information + { + /* "Chameleon 1" + 30 luminosity */ + background-color: #a9ec68; + } + + .messagebox#warning + { + /* "Orange 1" */ + background-color: #fcaf3e; + } + +div, +div.result img, +fieldset, +#footer, +#header +{ + border-color: #555753; +} + + ul#queries + { + margin-bottom: 0.5em; + margin-left: 2em; + margin-top: 1em; + } + + /* TODO: make images configurable (maybe via symlinks?) */ + li#search_custom_one + { + list-style-image: url(../../images/tango/16x16/actions/document-new.png) !important; + } + + li#search_custom_two + { + list-style-image: url(../../images/tango/16x16/actions/document-save.png) !important; + } + + li#search_custom_three + { + list-style-image: url(../../images/tango/16x16/emblems/emblem-favorite.png) !important; + } + + + span.instruction, + span.protip + { + /* "Aluminium 5" */ + color: #555753; + } diff --git a/branches/old-perl/trunk/style/default.css b/branches/old-perl/trunk/style/default.css new file mode 100755 index 0000000..815ae78 --- /dev/null +++ b/branches/old-perl/trunk/style/default.css @@ -0,0 +1,14 @@ +/* +Yolanda default stylesheet colors (using tango color palette) +(c) 2007-2008 Nils Dagsson Moskopp + +This file is licensed under the WTF Public License +(License terms: Do what the fuck you want.) + +Purpose of this file is to import color, decoration and structure stylesheets. +*/ + +@import "reset.css"; +@import "colors/tango.css"; +@import "structure/fake6.css"; + diff --git a/branches/old-perl/trunk/style/embedded.css b/branches/old-perl/trunk/style/embedded.css new file mode 100644 index 0000000..5054834 --- /dev/null +++ b/branches/old-perl/trunk/style/embedded.css @@ -0,0 +1,42 @@ +@import "reset.css"; +@import "colors/tango.css"; + +body +{ + font-family: sans-serif; + font-size: 10pt; + margin: 0px; + padding: 0px; + text-align: center; +} + +fieldset +{ + border-style: solid; + border-width: 1px; + margin: 0px; + padding: 1em; +} + +form +{ +height: 100%; +width: 100%; +} + +button +{ + /* crude center hack */ + position: absolute; + top: 50%; + left: 50%; + width: 164px; + height: 164px; +} + + button[name="playback"] + { + /* crude center hack */ + margin-left: -82px; + margin-top: -82px; + } diff --git a/branches/old-perl/trunk/style/reset.css b/branches/old-perl/trunk/style/reset.css new file mode 100644 index 0000000..7a75a47 --- /dev/null +++ b/branches/old-perl/trunk/style/reset.css @@ -0,0 +1,73 @@ +/* +Eric Meyers reset stylesheet, stolen from + +*/ + +html, body, div, span, applet, object, iframe, +/*h1, h2, h3, h4, h5, h6,*/ +p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td +{ + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* remember to define focus styles! */ +:focus +{ + outline: 0; +} + +body +{ + line-height: 1; + color: black; + background: white; +} + +ol, +ul +{ + list-style: none; +} + +/* tables still need 'cellspacing="0"' in the markup */ +table +{ + border-collapse: separate; + border-spacing: 0; +} + +caption, +th, +td +{ + text-align: left; + font-weight: normal; +} + +blockquote, +q +{ + quotes: "" ""; +} + + blockquote:before, + blockquote:after, + q:before, + q:after + { + content: ""; + } diff --git a/branches/old-perl/trunk/style/structure/fake6.css b/branches/old-perl/trunk/style/structure/fake6.css new file mode 100644 index 0000000..478ba27 --- /dev/null +++ b/branches/old-perl/trunk/style/structure/fake6.css @@ -0,0 +1,277 @@ +/* +Yolanda default stylesheet colors (using tango color palette) +(c) 2007-2008 Nils Dagsson Moskopp + +This file is licensed under the WTF Public License +(License terms: Do what the fuck you want.) + +Purpose of this file is to provide the structure of the layout, such as: + - display style (block, inline, inline-block etc.) + - size of (width, height) + - spacing (margin, padding) + +Please clear this file of any CSS properties that do not define structure. +↑↑ Remove this notice as soon as this file holds only structural CSS. ↑↑ +*/ + +a +{ + text-decoration: underline; +} + +blockquote +{ + width: 15em; +} + + blockquote:before + { + content: open-quote; + font-size: 2em; + margin-left: 7.5em; + } + + blockquote:after + { + content: close-quote; + font-size: 2em; + margin-right: 7.5em; + } + +body +{ + font-family: sans-serif; + font-size: 10pt; + margin: 1.5em; + min-height: 100%; + min-width: 40em; + text-align: center; +} + +code +{ + font-family: monospace; +} + +fieldset +{ + border-style: solid; + border-width: 1px; + margin: 0.5em; + padding: 1em; +} + + q:before + { + content: open-quote; + } + + q:after + { + content: close-quote; + } + +/* ids */ + +#license, +#description, +#loginbox, +#metadata, +#tagcloud, +#searchbar +{ + clear: right; + float: right; + width: 15em; + text-align: left; +} + +#searchbar +{ + margin-top: 0em; +} + +/* classes */ + +.result +{ + display: inline-block; +} + + +/* forms */ + + form.pagination + { + /* + works with Firefox 2 (for demonstration purposes only) + === REMOVE THIS IN FINAL BUILD === + */ + display: -moz-inline-box; + display: inline-block; + } + + form.pagination fieldset + { + border-width: 0px !important; + margin: 0px !important; + padding: 0px !important; + } + + input[type="text"], + input[type="password"], + textarea + { + width: 15em; + } + + textarea + { + height: 10em; + } + +/* +we use "prettier accessible forms", an idea by Nick Rigby +http://www.alistapart.com/articles/prettyaccessibleforms +*/ + +form ol +{ + display: inline-block; + text-align: left; +} + + form li + { + list-style: none; + } + + form label + { + display: inline-block; + margin-bottom: 0.5em; + margin-top: 0.5em; + padding: 0px; + vertical-align: top; + width: 15em; + } + + form fieldset fieldset + { + border: none; + margin-bottom: 0.5em; + margin-right: 0px; + margin-left: 0px; + margin-top: 0.5em; + padding: 0px; + } + + form fieldset fieldset label + { + display: block; + margin: 0px; + /* padding of outer fieldset needs to be substracted */ + margin-left: 14.5em; + padding: 0px; + width: auto; + } + +#preview +{ + position: relative; +} + + #preview form + { + height: 100%; + width: 100%; + } + + #preview form button + { + /* crude center hack */ + position: absolute; + top: 50%; + left: 50%; + width: 164px; + height: 164px; + } + + #preview form button[name="playback"] + { + /* crude center hack */ + margin-left: -246px; + margin-top: -82px; + } + + #preview form button[name="download"] + { + /* crude center hack */ + margin-left: -82px; + margin-top: -82px; + } + + #preview form button[name="bittorrent"] + { + /* crude center hack */ + margin-left: 82px; + margin-top: -82px; + } + +/* images */ + + img#logo + { + float: left; + border-width: 0px; + } + + img.antipixel + { + padding: 1em; + border-width: 0px; + } + + img.icon-mediaplayer + { + float: left; + } + +/* header and footer */ + +#footer, +#header +{ + border-style: solid; + border-width: 1px; + clear: right; + display: block; + height: 3em; + font-weight: bold; + list-style-type: none; + margin: 0.5em; +} + +#header +{ + margin-left: 180px; +} + + #footer > *, + #header > * + { + float: left; + margin-left: 0.5em; + margin-right: 0.5em; + } + + #footer > * a, + #header > * a + { + display: block; + line-height: 3em; + padding-left: 0.5em; + padding-right: 0.5em; + } + + diff --git a/branches/old-perl/trunk/tools/buzzword bingo.gnumeric b/branches/old-perl/trunk/tools/buzzword bingo.gnumeric new file mode 100644 index 0000000..f807227 Binary files /dev/null and b/branches/old-perl/trunk/tools/buzzword bingo.gnumeric differ diff --git a/branches/old-perl/trunk/tools/daemon.pl b/branches/old-perl/trunk/tools/daemon.pl new file mode 100755 index 0000000..beb8024 --- /dev/null +++ b/branches/old-perl/trunk/tools/daemon.pl @@ -0,0 +1,98 @@ +#!/usr/bin/perl -w + +use Proc::Daemon; +use DBI; +use Digest::SHA; +use File::Copy; +use XML::Simple qw(:strict); + +$root = '/var/www/yolanda'; + +#set global config variable +$config = XMLin("$root/config/backend.xml", KeyAttr => {string => 'id'}, ForceArray => [ 'string' ], ContentKey => '-content'); +$config = $config->{"strings"}->{"string"}; + +#TODO: deamonize by uncommenting this line +#Proc::Daemon::Init; + +$LOG = "/dev/null"; + + +#TODO: maybe keep file open the whole time ? +sub appendlog +{ + if (open(FILE, ">>$LOG")) + { + print FILE scalar(localtime)." ".$$."\n"; + #print "------------------------------------\n"; + #print join("\n",@_)."\n"; + #print "------------------------------------\n\n"; + close FILE; + } +} + +sub interrupt +{ + appendlog(@_); + die; +} + +$dbh = DBI->connect("DBI:mysql:".$config->{"database_name"}.":".$config->{"database_host"}, $config->{"database_username"}, $config->{"database_password"}) or die $DBI::errstr; + +while(1) +{ + #get fresh video id from db + my $sth = $dbh->prepare(qq{select id, filesize, duration, width, height, fps, hash + from uploaded where filesize != -1 and duration != -1 and width != -1 and height != -1 limit 1}) or interrupt $dbh->errstr; + + $sth->execute() or interrupt $dbh->errstr; + my ($id,$filesize, $duration, $width, $height, $fps, $sha) = $sth->fetchrow_array(); + $sth->finish() or interrupt $dbh->errstr; + + if($id) + { + #video height is either the maximum video height + #or (when the original is smaller than that) the original height + #check for multiple of 8 + $vheight = $height <= $config->{"video_height_max"} ? int($height/8 + .5)*8 : $config->{"video_height_max"}; + $vwidth = int($vheight*($width/$height)/8 + .5)*8; + + #if calculated width is greater than max_width, recalculate height + if($vwidth > $config->{"video_width_max"}) + { + $vwidth = $config->{"video_width_max"}; + $vheight = int($vwidth*($height/$width)/8 + .5)*8; + } + + #calculate video bitrate - try to keep the original filesize + $vbitrate = int((int(($filesize*8) / $duration + .5) - $config->{"video_audio_bitrate"})/1000); + #check if the bitrate is lower than $config->{"video_bitrate_max"} and adjust if necessary + $vbitrate = $vbitrate <= $config->{"video_bitrate_max"} ? $vbitrate : $config->{"video_bitrate_max"}; + + #TODO: add metadata information + $ffmpeg = system "ffmpeg2theora --optimize --videobitrate $vbitrate --audiobitrate ".$config->{"video_audio_bitrate"}." --sharpness 0 --width $vwidth --height $vheight --output $root/videos/$id /tmp/$id"; + + appendlog $id, $vbitrate, $filesize, $vwidth, $vheight, $fps, $duration, $sha, $ffmpeg; + + #only insert into videos table when everything went right + if($ffmpeg == 0) + { + $filesize = -s "$root/videos/$id"; + + #add video to videos table + $dbh->do(qq{insert into videos select id, title, description, userid, timestamp, creator, + subject, source, language, coverage, rights, license, ?, duration, ?, ?, fps, hash, 0, 0 + from uploaded where id = ?}, undef, $filesize, $vwidth, + $vheight, $id) or interrupt $dbh->errstr; + } + + #delete from uploaded table and from /tmp + unlink "/tmp/$id"; + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or interrupt $dbh->errstr; + } + else + { + #TODO: maybe make this event-driven by using the kernels has-this-file-changed-interface ? + sleep 10; + } +} diff --git a/branches/old-perl/trunk/tools/tagcloud.pl b/branches/old-perl/trunk/tools/tagcloud.pl new file mode 100755 index 0000000..d3479e4 --- /dev/null +++ b/branches/old-perl/trunk/tools/tagcloud.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +use DBI; +use XML::Simple qw(:strict); + +$root = '/var/www/yolanda'; + +#set global config variable +$config = XMLin("$root/config/backend.xml", KeyAttr => {string => 'id'}, ForceArray => [ 'string' ], ContentKey => '-content'); +$config = $config->{"strings"}->{"string"}; + +$dbh = DBI->connect("DBI:mysql:".$config->{"database_name"}.":".$config->{"database_host"}, $config->{"database_username"}, $config->{"database_password"}) or die $DBI::errstr; + +#get all subjects +$sth = $dbh->prepare("select subject from videos"); +$sth->execute(); + +#cycle through all video subjects +while(($subject) = $sth->fetchrow_array()) +{ + #TODO: make split char configureable + @subject = split(' ', $subject); + #cycle through all tags of video + foreach my $val (@subject) + { + #add/increment correct hash value + %hash->{$val}++; + } +} +$sth->finish(); + +#sort by count +@sorted = sort {$hash{$b} cmp $hash{$a}} keys %hash; + +#clean tagcloud +$dbh->do("delete from tagcloud"); + +$sth = $dbh->prepare("insert into tagcloud (text, count) values (?, ?)"); +#insert "page_tag_count" tags into tagcloud table +for($i=0;$i<$config->{"page_tag_count"} and $i<=$#sorted;$i++) +{ + $sth->execute( $sorted[$i], %hash->{$sorted[$i]} ); +} diff --git a/branches/old-perl/trunk/tools/yolanda-upload.pl b/branches/old-perl/trunk/tools/yolanda-upload.pl new file mode 100755 index 0000000..bbafb07 --- /dev/null +++ b/branches/old-perl/trunk/tools/yolanda-upload.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl + +use LWP::UserAgent; +use HTTP::Request::Common; +use Getopt::Std; + +sub preamble { + print "yolanda-upload by Johannes Schauer (josch)\n"; + print "http://yolanda.mister-muffin.de/trac\n"; + print "\n" +} + +# set these values for default -l (login) and -p (pass) values +# TODO: lol configfile !!! +use constant USER => ""; +use constant PASS => ""; + +# various urls +my $url = 'http://localhost'; + +unless (@ARGV) { + preamble(); + print "Usage: $0 ", + "-u [username] ", + "-p [password] ", + "-f ", + "-t ", + "-d ", + "-x ", + "-c ", + "-s ", + "-l ", + "-v \n\n"; + exit 1; +} + +my %opts; +getopts('u:p:f:t:d:x:c:s:l:v:', \%opts); + +unless (defined $opts{u}) { + unless (length USER) { + preamble(); + print "Username was neither defined nor passed as an argument\n"; + print "Use -u switch to specify the username\n"; + print "Example: -u joe_random\n"; + exit 1; + } + else { + $opts{l} = USER; + } +} + +unless (defined $opts{p}) { + unless (length PASS) { + preamble(); + print "Password was neither defined nor passed as an argument\n"; + print "Use -p switch to specify the password\n"; + print "Example: -p secretPass\n"; + exit 1; + } + else { + $opts{p} = PASS; + } +} + +unless (defined $opts{f} && length $opts{f}) { + preamble(); + print "No video file was specified\n"; + print "Use -f switch to specify the video file\n"; + print 'Example: -f "C:\Program Files\movie.avi"', "\n"; + print 'Example: -f "/home/pkrumins/super.cool.video.wmv"', "\n"; + exit 1; +} + +unless (-r $opts{f}) { + preamble(); + print "Video file is not readable or does not exist\n"; + print "Check the permissions and the path to the file\n"; + exit 1; +} + +unless (defined $opts{t} && length $opts{t}) { + preamble(); + print "No video title was specified\n"; + print "Use -t switch to set the title of the video\n"; + print 'Example: -t "Super Cool Video Title"', "\n"; + exit 1; +} + + +$ua = LWP::UserAgent->new(cookie_jar => {}); + +push @{$ua->requests_redirectable}, 'POST'; + +print "Getting sid cookie...\n"; +# DONT PRINT THIS - UNIX PHILOSPHY IS: IF IT WORKS DONT DISPLAY SHIT ! ( maybe add a -v switch ) +$response = $ua->request(GET $url); +unless($response->is_success) +{ + die "Failed opening $url: ", + $response->status_line; +} + +print "Logging in to $url/login.pl...\n"; +# DONT PRINT THIS - UNIX PHILOSPHY IS: IF IT WORKS DONT DISPLAY SHIT ! ( maybe add a -v switch ) +$response = $ua->request(POST "$url/login.pl", "Content_Type" => "form-data", "Content" => [action => login, user => test, pass => test]); +unless($response->is_success) +{ + die "Failed logging in: ", + $response->status_line; +} +unless($response->content =~ /action=logout/) +{ + die "Failed logging in: username/password do not match"; +} + +print "Uploading $opts{f} to $url/uploader.pl...\n"; +# DONT PRINT THIS - UNIX PHILOSPHY IS: IF IT WORKS DONT DISPLAY SHIT ! ( maybe add a -v switch ) +$response = $ua->request(POST "$url/uploader.pl", + "Content_Type" => "multipart/form-data", + "Content" => [ + file => [$opts{f}], + "DC.Title" => $opts{t}, + "DC.Description" => $opts{d}, + "DC.Subject" => $opts{x}, + "DC.Creator" => $opts{c} ? $opts{c} : "", + "DC.Source" => $opts{s} ? $opts{s} : "", + "DC.Language" => $opts{l} ? $opts{l} : "", + "DC.Coverage" => $opts{v} ? $opts{v} : "", + ] +); +unless($response->is_success) +{ + die "Failed uploading: ", + $response->status_line; +} +print "Done!\n"; +# DONT PRINT THIS - UNIX PHILOSPHY IS: IF IT WORKS DONT DISPLAY SHIT ! ( maybe add a -v switch ) diff --git a/branches/old-perl/trunk/torrentaction/1.torrent b/branches/old-perl/trunk/torrentaction/1.torrent new file mode 100644 index 0000000..266617d --- /dev/null +++ b/branches/old-perl/trunk/torrentaction/1.torrent @@ -0,0 +1 @@ +d8:announce30:http://my.tracker.tld/announce13:announce-listll8:tracker1ee7:comment9:kommentar10:created by7:yolanda13:creation datei2342134213e9:httpseedsl17:mydomain.tld/seede4:infod6:lengthi4020619e4:name9:some name12:piece lengthi262144e6:pieces320:Lz7xm*0/- aGDG]vb+-;2A)P"-#ҟTA\dk -BDrYN3ٖ(އcV(Q*bq'ȐeY1QJoEl݃_yn.-HF1Q9_x^VrY&:G?ѣG7i316BCnб0']pš=~m2R}42N/q'܆zG,pÂ$%%.^spee \ No newline at end of file diff --git a/branches/old-perl/trunk/torrentaction/torrent.pl b/branches/old-perl/trunk/torrentaction/torrent.pl new file mode 100644 index 0000000..970ca65 --- /dev/null +++ b/branches/old-perl/trunk/torrentaction/torrent.pl @@ -0,0 +1,81 @@ +$database = 'yolanda'; +$dbhost = 'localhost'; +$dbuser = 'root'; +$dbpass = ''; +$root = '/var/www/yolanda'; + + +use Digest::SHA qw{sha1}; + +open(FILE, "<$root/videos/1"); +while (my $BytesRead = read (FILE, $buff, 262144)) +{ + $hash .= sha1($buff); +} +close(FILE); + +%torrent = ( + 'announce' => 'http://my.tracker.tld/announce', + 'announce-list' => + [ + [ + 'tracker1' + ] + ], + 'creation date' => 2342134213, + 'comment' => 'kommentar', + 'created by' => 'yolanda', + 'httpseeds' => + [ + 'mydomain.tld/seed' + ], + 'info' => + { + 'length' => -s "$root/videos/1", + 'name' => 'some name', + 'piece length' => 262144, + 'pieces' => $hash + } +); + +open(TORRENT, ">$root/1.torrent"); +print TORRENT bencode(\%torrent); +close(TORRENT); + +sub bencode { + no locale; + my $item = shift; + my $line = ''; + + if(ref($item) eq 'HASH') + { + $line = 'd'; + foreach my $key (sort(keys %{$item})) + { + $line .= bencode($key); + $line .= bencode(${$item}{$key}); + } + $line .= 'e'; + } + elsif(ref($item) eq 'ARRAY') + { + $line = 'l'; + foreach my $l (@{$item}) + { + $line .= bencode($l); + } + $line .= 'e'; + } + elsif($item =~ /^\d+$/) + { + $line = 'i'; + $line .= $item; + $line .= 'e'; + } + else + { + $line = length($item).":"; + $line .= $item; + } + return $line; +} diff --git a/branches/old-perl/trunk/upload.pl b/branches/old-perl/trunk/upload.pl new file mode 100644 index 0000000..804cf56 --- /dev/null +++ b/branches/old-perl/trunk/upload.pl @@ -0,0 +1,67 @@ +require "functions.pl"; + +#create or resume session +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +$page->setNamespace( $config->{"xml_namespace_xforms"}, "xforms", 0); +$page->setNamespace( $config->{"xml_namespace_xsd"}, "xsd", 0); +$page->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0); +$page->setNamespace( $config->{"xml_namespace_dcterms"}, "dcterms", 0 ); + +my $instance = XML::LibXML::Element->new( "instance" ); +$instance->setNamespace( $config->{"xml_namespace_xforms"}, "xforms"); + +my $video = XML::LibXML::Element->new( "video" ); + +sub getElementDC +{ + my $node = XML::LibXML::Element->new( shift ); + $node->setNamespace( $config->{"xml_namespace_dcterms"}, "dcterms" ); + $node->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0 ); + $node->setAttributeNS( $config->{"xml_namespace_xsi"}, "type", shift ); + return $node; +} + +$video->appendChild( getElementDC( "title", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "alternative", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "abstract", "xsd:string") ); +$video->appendChild( getElementDC( "spatial", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "subject", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "temporal", "xsd:date") ); +$video->appendChild( getElementDC( "language", "xsd:language") ); + +$video->appendChild( getElementDC( "creator", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "contributor", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "created", "xsd:date") ); + +$video->appendChild( getElementDC( "hasFormat", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "hasPart", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "isFormatOf", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "isPartOf", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "references", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "replaces", "xsd:normalizedString") ); + +$video->appendChild( getElementDC( "rightsHolder", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "source", "xsd:normalizedString") ); +$video->appendChild( getElementDC( "license", "xsd:normalizedString") ); + +$node = XML::LibXML::Element->new( "data" ); +$node->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0 ); +$node->setAttributeNS( $config->{"xml_namespace_xsi"}, "type", "xsd:base64Binary" ); +$video->appendChild( $node ); + +$instance->appendChild($video); + +$page->appendChild($instance); + +$doc->setDocumentElement($page); + +output_page($doc); diff --git a/branches/old-perl/trunk/upload.pl.bak b/branches/old-perl/trunk/upload.pl.bak new file mode 100644 index 0000000..97f856a --- /dev/null +++ b/branches/old-perl/trunk/upload.pl.bak @@ -0,0 +1,170 @@ +require "functions.pl"; + +#create or resume session +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +@page = get_page_array(@userinfo); + +if($userinfo->{'username'}) +{ + $page->{'uploadform'}->{'DC.Title'} = $query->param('DC.Title'); + $page->{'uploadform'}->{'DC.Subject'} = $query->param('DC.Subject'); + $page->{'uploadform'}->{'DC.Description'} = $query->param('DC.Description'); + $page->{'uploadform'}->{'DC.Creator'} = $query->param('DC.Creator'); + $page->{'uploadform'}->{'DC.Source'} = $query->param('DC.Source'); + $page->{'uploadform'}->{'DC.Language'} = $query->param('DC.Language'); + $page->{'uploadform'}->{'DC.Coverage'} = $query->param('DC.Coverage'); + $page->{'uploadform'}->{'DC.Rights'} = $query->param('DC.Rights'); + $page->{'uploadform'}->{'DC.License'} = $query->param('DC.License'); + + if($query->param('2')) + { + #remove duplicates from tags + @subject = split(' ', $query->param('DC.Subject')); + @unique{ @subject } = (); + foreach $tag (keys %unique) + { + $tag =~ s/^\s*(.*?)\s*$/$1/; + if(length($tag) >= $config->{"page_tag_lenght_min"}) + { + $subject.=$tag." "; + } + } + $subject =~ s/\s*$//; + $page->{'uploadform'}->{'DC.Subject'} = $subject; + + if($query->param('DC.Title')&&$subject&&$query->param('DC.Description')) + { + $page->{'results-listing'} = ['']; + + my @args = (); + + #build mysql query + my $dbquery = "select v.id, v.title, v.description, u.username, + from_unixtime( v.timestamp ), v.creator, v.subject, + v.source, v.language, v.coverage, v.rights, + v.license, filesize, duration, width, height, fps, viewcount, + downloadcount, + match(v.title, v.description, v.subject) + against( ? in boolean mode) as relevance + from videos as v, users as u where u.id = v.userid + and match(v.title, v.description, v.subject) + against( ? in boolean mode)"; + push @args, $query->param('DC.Title'), $query->param('DC.Title'); + + fill_results($dbquery, @args); + $page->{'uploadform'}->{'page'} = '2'; + } + else + { + if(!$query->param('DC.Title')) + { + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_missing_DC.Title"; + } + elsif(!$query->param('DC.Subject')) + { + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_missing_DC.Subject"; + } + elsif(!$query->param('DC.Description')) + { + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_missing_DC.Description"; + } + $page->{'uploadform'}->{'page'} = '1'; + } + } + elsif($query->param('3')) + { + $page->{'uploadform'}->{'page'} = '3'; + } + elsif($query->param('4')) + { + if($query->param('DC.License') eq 'cc-by') + { + $page->{'uploadform'}->{'remix'} = 'true'; + } + elsif($query->param('DC.License') eq 'cc-by-sa') + { + $page->{'uploadform'}->{'sharealike'} = 'true'; + } + elsif($query->param('DC.License') eq 'cc-by-nd') + { + $page->{'uploadform'}->{'noderivatives'} = 'true'; + } + elsif($query->param('DC.License') eq 'cc-by-nc') + { + $page->{'uploadform'}->{'remix'} = 'true'; + $page->{'uploadform'}->{'noncommercial'} = 'true'; + } + elsif($query->param('DC.License') eq 'cc-by-nc-sa') + { + $page->{'uploadform'}->{'sharealike'} = 'true'; + $page->{'uploadform'}->{'noncommercial'} = 'true'; + } + elsif($query->param('DC.License') eq 'cc-by-nc-nd') + { + $page->{'uploadform'}->{'noderivatives'} = 'true'; + $page->{'uploadform'}->{'noncommercial'} = 'true'; + } + + $page->{'uploadform'}->{'page'} = '4'; + } + elsif($query->param('5')) + { + if($query->param('modification') and not $query->param('DC.License')) + { + if($query->param('modification') eq 'remix') + { + if($query->param('noncommercial')) + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by-nc'; + } + else + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by'; + } + } + elsif($query->param('modification') eq 'sharealike') + { + if($query->param('noncommercial')) + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by-nc-sa'; + } + else + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by-sa'; + } + } + elsif($query->param('modification') eq 'noderivatives') + { + if($query->param('noncommercial')) + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by-nc-nd'; + } + else + { + $page->{'uploadform'}->{'DC.License'} = 'cc-by-nd'; + } + } + } + + $page->{'uploadform'}->{'page'} = '5'; + } + else + { + $page->{'uploadform'}->{'page'} = '1'; + } +} +else +{ + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; +} + +print output_page(); diff --git a/branches/old-perl/trunk/uploader.pl b/branches/old-perl/trunk/uploader.pl new file mode 100644 index 0000000..6df214a --- /dev/null +++ b/branches/old-perl/trunk/uploader.pl @@ -0,0 +1,222 @@ +require "functions.pl"; + +CGI::Session->name($config->{"page_cookie_name"}); +$query = CGI->new(\&hook); +$session = new CGI::Session; + +sub hook +{ + #this is going to become an ajax progress bar + #alternatively, reloading every N seconds (mozilla doesn't flicker) + my ($filename, $buffer, $bytes_read, $data) = @_; + #print $ENV{'CONTENT_LENGTH'}; + #print sha256_hex($buffer); + #open(TEMP, ">>/var/www/perl/videos/temp.temp") or die "cannot open"; + #print "Read $bytes_read bytes of $filename\n"; + #close TEMP; +} + +@userinfo = get_userinfo_from_sid($session->id); + +@page = get_page_array(@userinfo); + +if($userinfo->{'id'} && $query->param("DC.Title") && + $query->param("DC.Description") && $query->param("DC.Subject")) +{ + #make new entry for video into the databse + #FIXME: contributor, rights + $dbh->do(qq{insert into uploaded (title, description, userid, timestamp, + creator, subject, source, language, coverage, rights, license) + values ( ?, ?, ?, unix_timestamp(), ?, ?, ?, ?, ?, ?, ? )}, undef, + $query->param("DC.Title"), $query->param("DC.Description"), $userinfo->{'id'}, + $query->param("DC.Creator"), $query->param("DC.Subject"), $query->param("DC.Source"), + $query->param("DC.Language"), $query->param("DC.Coverage"), + $query->param("DC.Rights"), $query->param("DC.License")) or die $dbh->errstr; + + #get the id of the inserted db entry + $sth = $dbh->prepare(qq{select last_insert_id() }) or die $dbh->errstr; + $sth->execute() or die $dbh->errstr; + my ($id) = $sth->fetchrow_array() or die $dbh->errstr; + $sth->finish() or die $dbh->errstr; + + #save uploaded file into temppath + $upload_filehandle = $query->upload("file"); + + open(TEMPFILE, ">/tmp/$id"); + #check that nothing more than max filesize is being uploaded + while ( <$upload_filehandle> ) + { + print TEMPFILE; + } + close TEMPFILE; + + #check if file is too small or too big + if( -s "/tmp/$id" < $config->{"video_filesize_min"}) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_file_too_small&value=".$config->{"video_filesize_min"}); + } + elsif( -s "/tmp/$id" > $config->{"video_filesize_max"}) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_file_too_big&value=".$config->{"video_filesize_max"}); + } + else + { + $info = `export SDL_VIDEODRIVER="dummy"; ffplay -stats -an -vn -nodisp /tmp/$id 2>&1`; + + if($info =~ /ignoring/) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_invalid_stream"); + } + elsif ($info =~ /I\/O error occured/) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_io"); + } + elsif ($info =~ /Unknown format/ or $info =~ /could not find codec parameters/) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_not_a_video"); + } + else + { + #generate unique hash + $sha = new Digest::SHA(256); + $sha->addfile("/tmp/$id"); + $sha = $sha->hexdigest; + + #check if this hash is already in database + my $sth = $dbh->prepare(qq{select id from videos where hash = ? limit 1}) or die $dbh->errstr; + $sth->execute($sha) or die $dbh->errstr; + my ($resultid) = $sth->fetchrow_array(); + $sth->finish() or die $dbh->errstr; + + #if so, then video is a duplicate (alternatively ALL HAIL QUANTUM COMPUTING) + if($resultid) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_duplicate"); + } + else + { + #get video container and duration + ($container, $duration) = $info =~ /Input \#0, (\w+),.+?\n.+?Duration: (\d{2}:\d{2}:\d{2}\.\d)/; + + #get audio, video, idth, height and fps + #these two regexes have to be applied seperately because nobody knows which stream (audio or video) comes first + ($audio) = $info =~ /Audio: (\w+)/; + ($video, $width, $height, $fps) = $info =~ /Video: ([\w\d]+),.+?(\d+)x(\d+),.+?(\d+\.\d+) fps/; + + #if there is no video stream or no duration + if(!$video or !$duration) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_invalid_stream"); + } + #if the video width is smaller than allowed + elsif($width < $config->{"video_width_min"}) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_video_width_too_small&value=".$config->{"video_width_min"}); + } + #if the video height is smaller than allowed + elsif($height < $config->{"video_height_min"}) + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + unlink "/tmp/$id"; + print $query->redirect("index.pl?error=error_upload_video_height_too_small&value=".$config->{"video_height_min"}); + } + else + { + #get video filesize + $filesize = -s "/tmp/$id"; + + #convert hh:mm:ss.s duration to full seconds - thanks perl for making this so damn easy! + #don't want to know how this would look in python or php... hell I don't even have to create extra variables! + $duration =~ /^(\d{2}):(\d{2}):(\d{2})\.(\d)$/; + $duration = int($1*3600 + $2*60 + $3 + $4/10 + .5); + + #get thumbnail position + $thumbnailsec = int(rand($duration)); + $previewsec = $thumbnailsec; + + #the width/height calculation could of course be much shorter but less readable then + #all thumbs have equal height + $tnheight = $config->{"video_thumbnail_height"}; + $tnwidth = int($tnheight*($width/$height)/2 + .5)*2; + + #create thumbnail and preview in original size + $ffthumb = system "ffmpeg -i /tmp/$id -vcodec mjpeg -vframes 1 -an -f rawvideo -ss $thumbnailsec -s ".$tnwidth."x$tnheight $root/video-stills/thumbnails/$id"; + $ffprev = system "ffmpeg -i /tmp/$id -vcodec mjpeg -vframes 1 -an -f rawvideo -ss $previewsec $root/video-stills/previews/$id"; + + #if thumbnail was created successfully + if($ffthumb == 0 and $ffprev == 0) + { + #check if the upload already is in the right format and smaller/equal max-width/height + if ($container eq 'ogg' and $video eq 'theora' and ($audio eq 'vorbis' or not $audio) and $height <= $config->{"video_height_max"} and $width <= $config->{"video_width_max"}) + { + #if so, move to destination + if(move("/tmp/$id", "$root/videos/$id")) + { + #if move was successful + #add video to videos table + $dbh->do(qq{insert into videos select id, title, description, userid, timestamp, creator, + subject, source, language, coverage, rights, license, ?, ?, ?, ?, ?, ?, 0, 0 + from uploaded where id = ?}, undef, $filesize, $duration, $width, + $height, $fps, $sha, $id) or die $dbh->errstr; + + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + } + else + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + die "cannot move video to $root/videos/$id - check your permissions!" + } + } + else + { + #write all valueable information to database so the daemon can fetch it + $dbh->do(qq{update uploaded set filesize = ?, duration = ?, width = ?, + height = ?, fps = ?, hash = ? where id = ?}, undef, $filesize, $duration, $width, + $height, $fps, $sha, $id) or die $dbh->errstr; + } + + #print success to the user + print $query->redirect("index.pl?information=information_uploaded&value=".$config->{"url_root"}."/video/".urlencode($query->param("DC.Title"))."/$id/"); + } + else + { + #delete from uploaded table + $dbh->do(qq{delete from uploaded where id = ?}, undef, $id) or die $dbh->errstr; + die "cannot create thumbnails - check your permissions!"; + } + } + } + } + } +} +else +{ + #print $query->redirect("index.pl?error=error_202c"); +} diff --git a/branches/old-perl/trunk/video.pl b/branches/old-perl/trunk/video.pl new file mode 100644 index 0000000..3f293ab --- /dev/null +++ b/branches/old-perl/trunk/video.pl @@ -0,0 +1,325 @@ +require "functions.pl"; + +#initialize session data +CGI::Session->name($config->{"page_cookie_name"}); +$query = new CGI; +$session = new CGI::Session; + +@userinfo = get_userinfo_from_sid($session->id); + +my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" ); + +my $page = get_page_array(@userinfo); + +$page->setNamespace( $config->{"xml_namespace_cc"}, "cc", 0); +$page->setNamespace( $config->{"xml_namespace_dc"}, "dc", 0); +$page->setNamespace( $config->{"xml_namespace_rdf"}, "rdf", 0); + +#check if id or title is passed +if($query->url_param('id')) +{ + #initiate database query + $dbquery = "select v.id, v.title, v.description, u.username, from_unixtime( v.timestamp ), + v.creator, v.subject, v.source, v.language, v.coverage, v.rights, + v.license, filesize, duration, width, height, fps, viewcount, downloadcount + from videos as v, users as u where v.id = ? and u.id=v.userid"; + + @args = ($query->url_param('id')); + + $sth = $dbh->prepare($dbquery); + + #test wether the video exists + $rowcount = $sth->execute(@args) or die $dbh->errstr; + + #if there are no results + if($rowcount == 0) + { + #check if maybe the video has not yet been converted + $dbquery = "select id from uploaded where id = ?"; + $sth = $dbh->prepare($dbquery); + $rowcount = $sth->execute($query->url_param('id')) or die $dbh->errstr; + + #if id is found + if($rowcount == 1) + { + #calculate the overall length of video to be encoded + $sth = $dbh->prepare("select sum(duration) from uploaded where id < ?"); + $sth->execute($query->url_param('id')) or die $dbh->errstr; + ($length) = $sth->fetchrow_array(); + + #convert hours, minutes and seconds fromoverall seconds + $h = int($length/3600); + $m = int($length/60-$h*60); + $s = int($length-$m*60-$h*3600); + + print $query->redirect("/index.pl?information=information_video_not_yet_available&value=".$h."h ".$m."m ".$s."s"); + } + else + { + # there is nothing we can do now - this video doesn't exist... + print $query->redirect("/index.pl?error=error_no_video"); + # this is a typical 404 situation, why is there no 404 ? + } + } + elsif($rowcount == 1) + { + #set embed attribute if requested + if($query->param('embed') eq "video") + { + $page->setAttribute( "embed", "video" ); + } + elsif($query->param('embed') eq "preview") + { + $page->setAttribute( "embed", "preview" ); + } + + #if there was a single result, display the video + my ($id, $title, $description, $publisher, $timestamp, $creator, $subject, + $source, $language, $coverage, $rights, $license, + $filesize, $duration, $width, $height, $fps, $viewcount, $downloadcount) = $sth->fetchrow_array(); + + #finish query + $sth->finish() or die $dbh->errstr; + + #if user is logged in + if($userinfo->{'username'}) + { + #check if a comment is about to be created + if($query->param('comment')) + { + #prepare new dtd + my $dtd = XML::LibXML::Dtd->new(0, "$root/site/comment.dtd"); + $dom = XML::LibXML->new; + $dom->clean_namespaces(1); + + #try to parse user's comment + eval { $doc = $dom->parse_string("".$query->param('comment')."") }; + + #die if error + if ($@) + { + die $@; + } + else + { + #try to validate against dtd + eval { $doc->validate($dtd) }; + + #die if error + if ($@) + { + die $@; + } + else + { + #output infobox + $page->appendChild(message("information", "information_comment_created")); + + #add to database + $dbh->do(qq{insert into comments (userid, videoid, text, timestamp) values (?, ?, ?, unix_timestamp())}, undef, + $userinfo->{'id'}, $id, $query->param('comment')) or die $dbh->errstr; + + #send pingbacks to every url in the comment + my (@matches) = $query->param('comment') =~ /]*href="(http:\/\/\S+)"[^>]*>.+?<\/a>/gi; + + #for every match send a pingback + foreach $match (@matches) + { + #ask for http header only - if pingbacks are implemented right, then we wont need the full site + my $request = HTTP::Request->new(HEAD => $match); + my $ua = LWP::UserAgent->new; + + my $response = $ua->request($request); + + #if successful response + if ($response->is_success) + { + my $pingbackurl = $response->header("x-pingback"); + + #if there was no x-pingback header, fetch the website and search for link element + if (!$pingbackurl) + { + $request = HTTP::Request->new(GET => $match); + $response = $ua->request($request); + + #get the link if response was successful + if ($response->is_success) + { + ($pingbackurl) = $response->content =~ //; + } + } + + #if requests were successful, send the pingbacks + if ($pingbackurl) + { + #TODO: expand xml entities < > & " in $pingbackurl + + #contruct the xml-rpc request + #TODO: do this with xml::libxml + my $xmlpost = (); + $xmlpost->{"methodName"} = ["pingback.ping"]; + push @{$xmlpost->{'params'}->{'param'} }, + { + "value" => + { + "string" => [$config->{"url_root"}."/video/".urlencode($title)."/$id/"] + } + }; + push @{$xmlpost->{'params'}->{'param'} }, + { + "value" => + { + "string" => [$match] + } + }; + + #post a xml-rpc request + $request = HTTP::Request->new(POST => $pingbackurl); + $request->header('Content-Type' => "application/xml"); + $request->content(XMLout( + $xmlpost, + XMLDecl => 1, + KeyAttr => {}, + RootName => 'methodCall' + )); + $ua = LWP::UserAgent->new; + $response = $ua->request($request); + #TODO: maybe do something on success? + } + } + } + } + } + } + } + + #construct video xml + my $video = XML::LibXML::Element->new( "video" ); + $video->setAttribute('thumbnail', $config->{"url_root"}."/video-stills/thumbnails/$id"); + $video->setAttribute('preview', $config->{"url_root"}."/video-stills/previews/$id"); + $video->setAttribute('filesize', $filesize); + $video->setAttribute('duration', $duration); + $video->setAttribute('width', $width); + $video->setAttribute('height', $height); + $video->setAttribute('fps', $fps); + $video->setAttribute('viewcount', $viewcount); + $video->setAttribute('downloadcount', $downloadcount); + + my $rdf = XML::LibXML::Element->new( "RDF" ); + $rdf->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf"); + + my $work = XML::LibXML::Element->new( "Work" ); + $work->setNamespace( "http://web.resource.org/cc/", "cc"); + $work->setNamespace( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $work->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", $config->{"url_root"}."/download/$id/" ); + + $node = XML::LibXML::Element->new( "coverage" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($coverage); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "creator" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($creator); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "date" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($date); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "description" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($description); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "identifier" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($config->{"url_root"}."/video/".urlencode($title)."/$id/"); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "language" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($language); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "publisher" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($publisher); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "rights" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($rights); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "source" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($source); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "subject" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($subjcet); + $work->appendChild($node); + + $node = XML::LibXML::Element->new( "title" ); + $node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); + $node->appendText($title); + $work->appendChild($node); + + #TODO: add license conditions + my $license = XML::LibXML::Element->new( "License" ); + $license->setNamespace("http://web.resource.org/cc/", "cc"); + $license->setNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf", 0); + $license->setAttributeNS( "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "about", "http://creativecommons.org/licenses/GPL/2.0/" ); + + $rdf->appendChild($work); + $rdf->appendChild($license); + + $video->appendChild($rdf); + + $page->appendChild($video); + + #get comments - this will also include newly created comments + my $comments = XML::LibXML::Element->new( "comments" ); + + $sth = $dbh->prepare(qq{select comments.id, comments.text, users.username, from_unixtime( comments.timestamp ) + from comments, users where + comments.videoid=? and users.id=comments.userid}) or die $dbh->errstr; + + $sth->execute($id) or die $dbh->errstr; + + #for every comment in the db + while (my ($commentid, $text, $username, $timestamp) = $sth->fetchrow_array()) + { + #create new xml node + my $dom = XML::LibXML->new; + + #parse database string to xml + my $doc = $dom->parse_string("".$text.""); + + my $comment = $doc->documentElement(); + + #add xhtml namespace prefix to every node + foreach $node ($comment->getElementsByTagName("*")) + { + $node->setNamespace("http://www.w3.org/1999/xhtml", "xhtml"); + } + $comment->setAttribute('username', $username); + $comment->setAttribute('timestamp', $timestamp); + $comment->setAttribute('id', $commentid); + $comments->appendChild($comment); + } + + $page->appendChild($comments); + + $doc->setDocumentElement($page); + + output_page($doc); + } +} +else +{ + print $query->redirect("index.pl?error=error_202c"); +} diff --git a/branches/old-perl/trunk/xsl/null.xsl b/branches/old-perl/trunk/xsl/null.xsl new file mode 100644 index 0000000..9596f69 --- /dev/null +++ b/branches/old-perl/trunk/xsl/null.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/opensearch.xsl b/branches/old-perl/trunk/xsl/opensearch.xsl new file mode 100644 index 0000000..1fa5930 --- /dev/null +++ b/branches/old-perl/trunk/xsl/opensearch.xsl @@ -0,0 +1,64 @@ + + + + + + + + + + + en + + + + + + + + + + + + + + + + images/favicon.ico + + + + + + + + + + + /search.pl?query={searchTerms} + + + + + + + diff --git a/branches/old-perl/trunk/xsl/rss.xsl b/branches/old-perl/trunk/xsl/rss.xsl new file mode 100644 index 0000000..66dc6ba --- /dev/null +++ b/branches/old-perl/trunk/xsl/rss.xsl @@ -0,0 +1,80 @@ + + + + + + + + + + + en + + + + + + + + + + + + + + + + + + + &xslt=rss + + + + + + + + + + & + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml-embed.xsl b/branches/old-perl/trunk/xsl/xhtml-embed.xsl new file mode 100644 index 0000000..19339ba --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml-embed.xsl @@ -0,0 +1,158 @@ + + + + + + + + + + + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml.xsl b/branches/old-perl/trunk/xsl/xhtml.xsl new file mode 100755 index 0000000..046eafa --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml.xsl @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/advancedsearch.xsl b/branches/old-perl/trunk/xsl/xhtml/advancedsearch.xsl new file mode 100644 index 0000000..fd0fbd2 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/advancedsearch.xsl @@ -0,0 +1,39 @@ + + + + + +query: + +tags: + +orderby: + +sort: + +title: + +description: + +creator: + +language: + +coverage: + +rights: + +license: + +filesize: + +duration: + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/embedded.xsl b/branches/old-perl/trunk/xsl/xhtml/embedded.xsl new file mode 100644 index 0000000..0af7908 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/embedded.xsl @@ -0,0 +1,25 @@ + + + + + + embedded stuff here + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/footer.xsl b/branches/old-perl/trunk/xsl/xhtml/footer.xsl new file mode 100644 index 0000000..1a181d9 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/footer.xsl @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/header.xsl b/branches/old-perl/trunk/xsl/xhtml/header.xsl new file mode 100644 index 0000000..d0bec8c --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/header.xsl @@ -0,0 +1,98 @@ + + + + + + + + + + + + /images/logo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/loginbox.xsl b/branches/old-perl/trunk/xsl/xhtml/loginbox.xsl new file mode 100644 index 0000000..2a2c03c --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/loginbox.xsl @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + : + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + : + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/messagebox.xsl b/branches/old-perl/trunk/xsl/xhtml/messagebox.xsl new file mode 100644 index 0000000..ee9f2bd --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/messagebox.xsl @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/pluginhelp.xsl b/branches/old-perl/trunk/xsl/xhtml/pluginhelp.xsl new file mode 100644 index 0000000..f37887b --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/pluginhelp.xsl @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/register.xsl b/branches/old-perl/trunk/xsl/xhtml/register.xsl new file mode 100644 index 0000000..9944545 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/register.xsl @@ -0,0 +1,41 @@ + + + + + + + + + + + + : + + + + : + + + + : + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/results.xsl b/branches/old-perl/trunk/xsl/xhtml/results.xsl new file mode 100644 index 0000000..eaa6269 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/results.xsl @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + disabled + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + disabled + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + disabled + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + disabled + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/searchbar.xsl b/branches/old-perl/trunk/xsl/xhtml/searchbar.xsl new file mode 100644 index 0000000..ca2629d --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/searchbar.xsl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/settings.xsl b/branches/old-perl/trunk/xsl/xhtml/settings.xsl new file mode 100644 index 0000000..016664e --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/settings.xsl @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/splash.xsl b/branches/old-perl/trunk/xsl/xhtml/splash.xsl new file mode 100644 index 0000000..34915ce --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/splash.xsl @@ -0,0 +1,26 @@ + + + + + + + + + + Welcome to the Yolanda Video CMS Demo Platform + +Weit hinten, hinter den Wortbergen, fern der Länder Vokalien und Konsonantien leben die Blindtexte. Abgeschieden wohnen Sie in Buchstabhausen an der Küste des Semantik, eines großen Sprachozeans. Ein kleines Bächlein namens Duden fließt durch ihren Ort und versorgt sie mit den nötigen Regelialien. Es ist ein paradiesmatisches Land, in dem einem gebratene Satzteile in den Mund fliegen. Nicht einmal von der allmächtigen Interpunktion werden die Blindtexte beherrscht - ein geradezu unorthographisches Leben.Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten. Und wenn es nicht umgeschrieben wurde, dann benutzen Sie es immernoch. Unterwegs traf es eine Copy. Die Copy warnte das Blindtextchen, da, wo sie herkäme wäre sie zigmal umgeschrieben worden und alles, was von ihrem Ursprung noch übrig wäre, sei das Wort „und“ und das Blindtextchen solle umkehren und wieder in sein eigenes, sicheres Land zurückkehren. Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten. Und wenn es nicht umgeschrieben wurde, dann benutzen Sie es immernoch. + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/tagcloud.xsl b/branches/old-perl/trunk/xsl/xhtml/tagcloud.xsl new file mode 100644 index 0000000..12b6615 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/tagcloud.xsl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + font-size:px + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/upload.xsl b/branches/old-perl/trunk/xsl/xhtml/upload.xsl new file mode 100644 index 0000000..64930f4 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/upload.xsl @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 31 + option + + + + + + + + 1 + 12 + option + + + + + + + + 1890 + 2008 + option + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/video.xsl b/branches/old-perl/trunk/xsl/xhtml/video.xsl new file mode 100644 index 0000000..1e1267c --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/video.xsl @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /user/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + + : + + + + + + + + + : + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <object data="" + type="application/xhtml+xml" + width="" + height="" + /> + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/xhtml-body.xsl b/branches/old-perl/trunk/xsl/xhtml/xhtml-body.xsl new file mode 100644 index 0000000..f3fb634 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/xhtml-body.xsl @@ -0,0 +1,86 @@ + + + + + + + + + + hide_movie() + + + + + + show_page_1() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xhtml/xhtml-head.xsl b/branches/old-perl/trunk/xsl/xhtml/xhtml-head.xsl new file mode 100644 index 0000000..25413d5 --- /dev/null +++ b/branches/old-perl/trunk/xsl/xhtml/xhtml-head.xsl @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + ?xslt=opensearch + + + + + + + + + pingback.pl + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + + + + + + &pagesize= + &page= + &xslt=rss + + + + + + + + + + + + &pagesize=99999 + &page=1 + &xslt=rss + + + + + + - + + "" + + + + + + + + + + + diff --git a/branches/old-perl/trunk/xsl/xspf.xsl b/branches/old-perl/trunk/xsl/xspf.xsl new file mode 100644 index 0000000..6c1a0fb --- /dev/null +++ b/branches/old-perl/trunk/xsl/xspf.xsl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ To view this video, install + VLC, + mplayer or + another player capable of playing + Ogg Theora + videos. +
+ For installation instructions, see the Wikipedia Media Help. +
Weit hinten, hinter den Wortbergen, fern der Länder Vokalien und Konsonantien leben die Blindtexte. Abgeschieden wohnen Sie in Buchstabhausen an der Küste des Semantik, eines großen Sprachozeans. Ein kleines Bächlein namens Duden fließt durch ihren Ort und versorgt sie mit den nötigen Regelialien. Es ist ein paradiesmatisches Land, in dem einem gebratene Satzteile in den Mund fliegen. Nicht einmal von der allmächtigen Interpunktion werden die Blindtexte beherrscht - ein geradezu unorthographisches Leben.Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten. Und wenn es nicht umgeschrieben wurde, dann benutzen Sie es immernoch.
Unterwegs traf es eine Copy. Die Copy warnte das Blindtextchen, da, wo sie herkäme wäre sie zigmal umgeschrieben worden und alles, was von ihrem Ursprung noch übrig wäre, sei das Wort „und“ und das Blindtextchen solle umkehren und wieder in sein eigenes, sicheres Land zurückkehren.
Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten. Und wenn es nicht umgeschrieben wurde, dann benutzen Sie es immernoch.
+ <object data="" + type="application/xhtml+xml" + width="" + height="" + /> +