Compare commits
	
		
			173 Commits
		
	
	
		
			master
			...
			feature-is
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9171bfd1ab | ||
| 
						 | 
					be4774c95c | ||
| 
						 | 
					9644784a79 | ||
| 
						 | 
					1940d5c0b5 | ||
| 
						 | 
					7c7e3cd1f1 | ||
| 
						 | 
					3e2f95a152 | ||
| 
						 | 
					92de88ba13 | ||
| 
						 | 
					02d0f0923e | ||
| 
						 | 
					765a86ba90 | ||
| 
						 | 
					34309e34c3 | ||
| 
						 | 
					2176d1cde2 | ||
| 
						 | 
					45d53e8d21 | ||
| 
						 | 
					b36b8e3afb | ||
| 
						 | 
					801af66a4e | ||
| 
						 | 
					df6ffdf420 | ||
| 
						 | 
					b3368071ac | ||
| 
						 | 
					67b80ee11c | ||
| 
						 | 
					dc31155de1 | ||
| 
						 | 
					0bae69908b | ||
| 
						 | 
					47a077bc82 | ||
| 
						 | 
					836ff71364 | ||
| 
						 | 
					0afa07b2bd | ||
| 
						 | 
					4ee3d471fe | ||
| 
						 | 
					29c7fed81b | ||
| 
						 | 
					fb62061e5a | ||
| 
						 | 
					9b92b7139f | ||
| 
						 | 
					5ea4b02205 | ||
| 
						 | 
					12d3eef3d1 | ||
| 
						 | 
					576c06ffaf | ||
| 
						 | 
					352dc3e179 | ||
| 
						 | 
					aa164936f4 | ||
| 
						 | 
					9a93acd1a5 | ||
| 
						 | 
					587aa11cda | ||
| 
						 | 
					d04ecd60c4 | ||
| 
						 | 
					ecef510f78 | ||
| 
						 | 
					4976c20935 | ||
| 
						 | 
					5553c37ccd | ||
| 
						 | 
					346b2c6cf8 | ||
| 
						 | 
					aa68fe3485 | ||
| 
						 | 
					e408fe8733 | ||
| 
						 | 
					836986462a | ||
| 
						 | 
					51c6cdb20d | ||
| 
						 | 
					766232f29b | ||
| 
						 | 
					2ed021f30b | ||
| 
						 | 
					899fe561df | ||
| 
						 | 
					67d8936083 | ||
| 
						 | 
					78f5cef5bd | ||
| 
						 | 
					8928b1654c | ||
| 
						 | 
					977fa0d1d4 | ||
| 
						 | 
					1d89cec2cf | ||
| 
						 | 
					6c6b7d6bb2 | ||
| 
						 | 
					f92e88e9b4 | ||
| 
						 | 
					6e58899fdf | ||
| 
						 | 
					1513598420 | ||
| 
						 | 
					9cfc060760 | ||
| 
						 | 
					a531e34ec2 | ||
| 
						 | 
					2cce23b5b4 | ||
| 
						 | 
					e518bc9b68 | ||
| 
						 | 
					8e02d05ba9 | ||
| 
						 | 
					f131083315 | ||
| 
						 | 
					39ba5b37ef | ||
| 
						 | 
					002fa05c7f | ||
| 
						 | 
					1a52133fd4 | ||
| 
						 | 
					30900f7196 | ||
| 
						 | 
					b753cf0837 | ||
| 
						 | 
					53ab5b6aff | ||
| 
						 | 
					78a0402351 | ||
| 
						 | 
					5b5705fe90 | ||
| 
						 | 
					f08b5c5e3f | ||
| 
						 | 
					aa87acd432 | ||
| 
						 | 
					7af7ef8357 | ||
| 
						 | 
					627bc4e45f | ||
| 
						 | 
					909c76ebfb | ||
| 
						 | 
					0899ba8515 | ||
| 
						 | 
					b7c0b40491 | ||
| 
						 | 
					48257ccfed | ||
| 
						 | 
					269949a65f | ||
| 
						 | 
					c2de7123e4 | ||
| 
						 | 
					e0c6dcd5a4 | ||
| 
						 | 
					734ddda363 | ||
| 
						 | 
					02cd448f89 | ||
| 
						 | 
					5fc3a987de | ||
| 
						 | 
					be39d72d3c | ||
| 
						 | 
					045eb766f1 | ||
| 
						 | 
					22d4bd0e6f | ||
| 
						 | 
					5a7bf49cbb | ||
| 
						 | 
					a3dd1c45f3 | ||
| 
						 | 
					be7725694e | ||
| 
						 | 
					366d278182 | ||
| 
						 | 
					5f008a14f5 | ||
| 
						 | 
					21a8c281ec | ||
| 
						 | 
					51dde5766d | ||
| 
						 | 
					61d7b4a58d | ||
| 
						 | 
					19b35565a2 | ||
| 
						 | 
					baa88412b9 | ||
| 
						 | 
					6fb9b72e22 | ||
| 
						 | 
					b75884c57e | ||
| 
						 | 
					603188f6ce | ||
| 
						 | 
					15442140cf | ||
| 
						 | 
					9f877d4309 | ||
| 
						 | 
					8631529268 | ||
| 
						 | 
					96bc198b0f | ||
| 
						 | 
					146ffb5f4c | ||
| 
						 | 
					867c3d3382 | ||
| 
						 | 
					75b0f27fe2 | ||
| 
						 | 
					4b001d8f03 | ||
| 
						 | 
					a7bec96a80 | ||
| 
						 | 
					a8706e38ca | ||
| 
						 | 
					265fd41717 | ||
| 
						 | 
					67c23ffe24 | ||
| 
						 | 
					e9a09889e4 | ||
| 
						 | 
					e6756a2072 | ||
| 
						 | 
					f4050b8a76 | ||
| 
						 | 
					bb4fa7ca2f | ||
| 
						 | 
					2648603f24 | ||
| 
						 | 
					b7a9a1c8fd | ||
| 
						 | 
					d45566d692 | ||
| 
						 | 
					4411086f29 | ||
| 
						 | 
					0b3ce03036 | ||
| 
						 | 
					027886737d | ||
| 
						 | 
					35f45015ea | ||
| 
						 | 
					618f412bed | ||
| 
						 | 
					6ab9c754a5 | ||
| 
						 | 
					c59332c8f8 | ||
| 
						 | 
					32d9d04b4b | ||
| 
						 | 
					62d0fb6eee | ||
| 
						 | 
					bc82ee24d8 | ||
| 
						 | 
					6ab1f4a4f0 | ||
| 
						 | 
					3e6527bab3 | ||
| 
						 | 
					9b7691c1ae | ||
| 
						 | 
					c3cd494386 | ||
| 
						 | 
					fba5841bdc | ||
| 
						 | 
					da7fc3e7e3 | ||
| 
						 | 
					00ebe1633c | ||
| 
						 | 
					f63bfcb4f6 | ||
| 
						 | 
					177cf836b4 | ||
| 
						 | 
					04069871bb | ||
| 
						 | 
					31469204e0 | ||
| 
						 | 
					9b148c8c4a | ||
| 
						 | 
					98f4eac82a | ||
| 
						 | 
					29d966cdb3 | ||
| 
						 | 
					23d2bd552c | ||
| 
						 | 
					41cfbbd0d9 | ||
| 
						 | 
					cc89a7e6f8 | ||
| 
						 | 
					c486fe98fb | ||
| 
						 | 
					f0ac256ff6 | ||
| 
						 | 
					e4b3adb2f5 | ||
| 
						 | 
					58a5bc46d9 | ||
| 
						 | 
					6e5c3a551d | ||
| 
						 | 
					52f8261d8c | ||
| 
						 | 
					721c385993 | ||
| 
						 | 
					9c80de19d7 | ||
| 
						 | 
					4ffd11caf5 | ||
| 
						 | 
					f2c4faf054 | ||
| 
						 | 
					bc54b663e0 | ||
| 
						 | 
					6f1bb309d4 | ||
| 
						 | 
					cdedaa4604 | ||
| 
						 | 
					2130b327df | ||
| 
						 | 
					3e238bea0b | ||
| 
						 | 
					266c297632 | ||
| 
						 | 
					4477b07bc6 | ||
| 
						 | 
					74b44186d2 | ||
| 
						 | 
					c2bf1bac38 | ||
| 
						 | 
					c279313048 | ||
| 
						 | 
					0301ba0336 | ||
| 
						 | 
					5e6d61b3a7 | ||
| 
						 | 
					4e00051a10 | ||
| 
						 | 
					38e6e4f8d3 | ||
| 
						 | 
					dfa223b39e | ||
| 
						 | 
					0a8d771c11 | ||
| 
						 | 
					5afd073ff3 | ||
| 
						 | 
					46fda14e08 | ||
| 
						 | 
					bbf9ef8b3d | 
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
src/IDF/version.php     export-subst
 | 
			
		||||
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -9,3 +9,6 @@ indefero-*.zip
 | 
			
		||||
src/IDF/conf/path.php
 | 
			
		||||
.tx/config
 | 
			
		||||
src/IDF/locale/idf.pot.bak
 | 
			
		||||
test/test.db
 | 
			
		||||
test/tmp
 | 
			
		||||
test/config.php
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										54
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								AUTHORS
									
									
									
									
									
								
							@@ -1,30 +1,42 @@
 | 
			
		||||
InDefero was originally created during summer 2008 
 | 
			
		||||
InDefero was originally created during summer 2008
 | 
			
		||||
by Loïc d'Anterroches with the support of Céondo Ltd.
 | 
			
		||||
 | 
			
		||||
Much appreciated contributors:
 | 
			
		||||
Much appreciated contributors (in alphabetical order):
 | 
			
		||||
 | 
			
		||||
    Nicolas Lassalle <http://www.beroot.org/> - Subversion support
 | 
			
		||||
    bohwaz <http://bohwaz.net/>
 | 
			
		||||
    Benjamin Jorand <benjamin.jorand@gmail.com> - Mercurial support
 | 
			
		||||
    Baptiste Michaud <bactisme@gmail.com> - Subversion synchronization
 | 
			
		||||
    Julien Issler 
 | 
			
		||||
    Adrien Bustany <madcat@mymadcat.com>
 | 
			
		||||
    Andrew Nguyen <andrew-git-indefero@na-consulting.net>
 | 
			
		||||
    Baptiste Durand-Bret <bathizte@ozazar.org>
 | 
			
		||||
    Baptiste Michaud <bactisme@gmail.com>           - Subversion sync
 | 
			
		||||
    Benjamin Jorand <benjamin.jorand@gmail.com>     - Mercurial support
 | 
			
		||||
    Brenda Wallace <shiny@cpan.org>
 | 
			
		||||
    Brian Armstrong <brianar>
 | 
			
		||||
    Charles Melbye <charlie@yourwiki.net>
 | 
			
		||||
    Ciaran Gultnieks <ciaran@ciarang.com>
 | 
			
		||||
    David Feeney <davidf>
 | 
			
		||||
    Denis Kot <denis.kot@gmail.com>                 - Russian translation
 | 
			
		||||
    Dmitry Dulepov <dmitryd>
 | 
			
		||||
    Fernando Sayago Gil <mikados.mikados@gmail.com> - Spanish translation
 | 
			
		||||
    Jakub Viták <mainiak@gmail.com>                 - Czech translation
 | 
			
		||||
    Janez Troha <http://www.dz0ny.info>             - Slovenian translation
 | 
			
		||||
    Jean-Philippe Fleury <jpfleury>
 | 
			
		||||
    Jerry <lxb429@gmail.com>                        - Chinese translation
 | 
			
		||||
    Julien Issler <julien@issler.net>
 | 
			
		||||
    Ludovic Bellière <xrogaan>
 | 
			
		||||
    Manuel Eidenberger <eidenberger@gmail.com>
 | 
			
		||||
    Ciaran Gultnieks
 | 
			
		||||
    Matthew Dawson <mjd>
 | 
			
		||||
    Matías Halles <matias@halles.cl>
 | 
			
		||||
    Mehdi Kabab <http://pioupioum.fr/>
 | 
			
		||||
    Sindre R. Myren
 | 
			
		||||
    Nicolas Lassalle <nicolas@beroot.org>           - Subversion support
 | 
			
		||||
    Patrick Georgi <patrick.georgi@coresystems.de>
 | 
			
		||||
    Adrien Bustany
 | 
			
		||||
    Charles Melbye
 | 
			
		||||
    Baptiste Durand-Bret
 | 
			
		||||
    Andrew Nguyen
 | 
			
		||||
    David Feeney
 | 
			
		||||
    Denis Kot <denis.kot@gmail.com>
 | 
			
		||||
    Samuel Suther
 | 
			
		||||
    Ludovic Bellière
 | 
			
		||||
    Brian Armstrong
 | 
			
		||||
    Raphaël Emourgeon
 | 
			
		||||
    Jakub Viták
 | 
			
		||||
    Vladimir Solomatin
 | 
			
		||||
    Raphaël Emourgeon <raphael>
 | 
			
		||||
    Samuel Suther <info@suther.de>                  - German translation
 | 
			
		||||
    Sindre R. Myren <sindrero@stud.ntnu.no>
 | 
			
		||||
    Stewart Platt <stew@futurete.ch>
 | 
			
		||||
    Thomas Keller <me@thomaskeller.biz>             - Monotone support
 | 
			
		||||
    Vladimir Solomatin <slash>
 | 
			
		||||
    William Martin <william.martin@lcpc.fr>
 | 
			
		||||
    Xavier Brochard <xavier@alternatif.org>
 | 
			
		||||
    bohwaz <http://bohwaz.net/>
 | 
			
		||||
 | 
			
		||||
And all the nice users who spent time reporting issues and promoting
 | 
			
		||||
the project. The project could not live without them.
 | 
			
		||||
 
 | 
			
		||||
@@ -104,12 +104,13 @@ without first talking to us.
 | 
			
		||||
 | 
			
		||||
## I am a translator
 | 
			
		||||
 | 
			
		||||
We currently use (transifex)[http://trac.transifex.org] to help our
 | 
			
		||||
users to translate indefero. You don't have to use it, but it's an
 | 
			
		||||
easy way to do the job. You can visit the indefero page at transifex
 | 
			
		||||
here : http://www.transifex.net/projects/p/indefero/c/indefero/
 | 
			
		||||
We currently use [transifex](http://trac.transifex.org) to help our
 | 
			
		||||
users translate indefero. You don't have to use it, but it's an easy
 | 
			
		||||
way to do the job. You can visit the indefero page at transifex here:
 | 
			
		||||
 | 
			
		||||
    http://www.transifex.net/projects/p/indefero/
 | 
			
		||||
 | 
			
		||||
Please understand that your changes will not be commited instantly,
 | 
			
		||||
but are sent to the maintainers e-mails before. Then, your changes
 | 
			
		||||
will not be in the main repository until da-loic push the changes. In
 | 
			
		||||
that way, try to do big changes with less submissions.
 | 
			
		||||
will not be in the main repository until the maintainer pushs the
 | 
			
		||||
changes. In that way, try to do big changes with less submissions.
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,12 @@ The installation of InDefero is composed of 2 parts, first the
 | 
			
		||||
installation of the [Pluf framework](http://www.pluf.org) and second,
 | 
			
		||||
the installation of InDefero by itself.
 | 
			
		||||
 | 
			
		||||
## PHP modules for indefero
 | 
			
		||||
 | 
			
		||||
Indefero need the GD module for PHP. It's named "php5-gd" in debian.
 | 
			
		||||
 | 
			
		||||
    $ apt-get install php5-gd
 | 
			
		||||
 | 
			
		||||
## Recommended Layout of the Files
 | 
			
		||||
 | 
			
		||||
If your server document root is in `/var/www` a good thing is to keep
 | 
			
		||||
@@ -37,6 +43,7 @@ docroot.
 | 
			
		||||
    $ sudo pear upgrade-all
 | 
			
		||||
    $ sudo pear install --alldeps Mail
 | 
			
		||||
    $ sudo pear install --alldeps Mail_mime
 | 
			
		||||
    $ sudo pear install --alldeps Console_Getopt
 | 
			
		||||
 | 
			
		||||
If you already have some of the PEAR packages installed with your
 | 
			
		||||
distribution, the `Mail` package is often not up-to-date, 
 | 
			
		||||
@@ -125,6 +132,7 @@ The documentation is available in the `doc` folder.
 | 
			
		||||
* Subversion: `doc/syncsvn.mdtext`.
 | 
			
		||||
* Mercurial: `doc/syncmercurial.mdtext`.
 | 
			
		||||
* Git: `doc/syncgit.mdtext`.
 | 
			
		||||
* Monotone: `doc/syncmonotone.mdtext`
 | 
			
		||||
 | 
			
		||||
## For the Apache Webserver Users
 | 
			
		||||
 | 
			
		||||
@@ -222,4 +230,4 @@ functions. You need to prevent the overload as it does not make sense
 | 
			
		||||
anyway (magic in the background is bad!). 
 | 
			
		||||
See the [corresponding ticket][reglink].
 | 
			
		||||
 | 
			
		||||
[reglink]: http://projects.ceondo.com/p/indefero/issues/481/
 | 
			
		||||
[reglink]: http://projects.ceondo.com/p/indefero/issues/481/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										105
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										105
									
								
								Makefile
									
									
									
									
									
								
							@@ -22,25 +22,36 @@
 | 
			
		||||
#   sudo apt-get install python-setuptools
 | 
			
		||||
#   sudo easy_install -U transifex-client
 | 
			
		||||
 | 
			
		||||
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
 | 
			
		||||
 | 
			
		||||
all help:
 | 
			
		||||
	@echo "Rules for generate tarball :"
 | 
			
		||||
 | 
			
		||||
.PHONY: help
 | 
			
		||||
help:
 | 
			
		||||
	@printf "Rules for generating distributable files :\n"
 | 
			
		||||
	@for b in `git branch | sed "s/^. //g"`; do \
 | 
			
		||||
		echo -e "\t"$$b"_tarball - Generate a zip archive of the "$$b" branch."; \
 | 
			
		||||
		printf "\t"$$b"-zipfile - Generate a zip archive of the "$$b" branch.\n"; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo -e "\nRules for internationnalization :";
 | 
			
		||||
	@echo -e "\tpot-update - Update the POT file from HTML template and PHP source, then merge it with PO file"
 | 
			
		||||
	@echo -e "\tpot-push - Send the POT file on transifex server"
 | 
			
		||||
	@echo -e "\tpo-update - Merge POT file into PO file. POT is not regenerated."
 | 
			
		||||
	@echo -e "\tpo-push - Send the all PO file on transifex server"
 | 
			
		||||
	@echo -e "\tpo-pull - Get all PO file from transifex server"
 | 
			
		||||
	@printf "\nRules for internationalization :\n";
 | 
			
		||||
	@printf "\tpot-update - Update the POT file from HTML templates and PHP sources, then merge it with PO file.\n"
 | 
			
		||||
	@printf "\tpot-push   - Send the POT file to the transifex server.\n"
 | 
			
		||||
	@printf "\tpo-update  - Merge the POT file into the PO file. The POT is not regenerated.\n"
 | 
			
		||||
	@printf "\tpo-push    - Send the all PO files to the transifex server.\n"
 | 
			
		||||
	@printf "\tpo-pull    - Get all PO files from the transifex server.\n"
 | 
			
		||||
	@printf "\tpo-stats   - Show translation statistics of all PO files.\n"
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#   Internationnalization rule, POT & PO file manipulation
 | 
			
		||||
#   
 | 
			
		||||
#   Internationalization rule, POT & PO file manipulation
 | 
			
		||||
#
 | 
			
		||||
.PHONY: pluf_path
 | 
			
		||||
pluf_path:
 | 
			
		||||
ifeq (src/IDF/conf/path.php, $(wildcard src/IDF/conf/path.php))
 | 
			
		||||
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
 | 
			
		||||
else
 | 
			
		||||
	@printf "File 'src/IDF/conf/path.php' don't exist. Please configure it !\n"
 | 
			
		||||
	@exit 1
 | 
			
		||||
endif
 | 
			
		||||
 
 | 
			
		||||
.PHONY: pot-update po-update
 | 
			
		||||
pot-update:
 | 
			
		||||
pot-update: pluf_path
 | 
			
		||||
	# Backup pot file
 | 
			
		||||
	@if [ -e src/IDF/locale/idf.pot ]; then                     \
 | 
			
		||||
	mv -f src/IDF/locale/idf.pot src/IDF/locale/idf.pot.bak;    \
 | 
			
		||||
@@ -49,19 +60,20 @@ pot-update:
 | 
			
		||||
	# Extract string
 | 
			
		||||
	@cd src; php $(PLUF_PATH)/extracttemplates.php IDF/conf/idf.php IDF/gettexttemplates
 | 
			
		||||
	@cd src; for phpfile in `find . -iname "*.php"`; do \
 | 
			
		||||
		echo "Parsing file : "$$phpfile; \
 | 
			
		||||
		xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j --keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
 | 
			
		||||
		printf "Parsing file : "$$phpfile"\n"; \
 | 
			
		||||
		xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j \
 | 
			
		||||
			--keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
 | 
			
		||||
		done
 | 
			
		||||
	#	Remove tmp folder
 | 
			
		||||
	rm -Rf src/IDF/gettexttemplates
 | 
			
		||||
	# Update PO
 | 
			
		||||
	@make po-update
 | 
			
		||||
 | 
			
		||||
po-update:
 | 
			
		||||
po-update: pluf_path
 | 
			
		||||
	@for pofile in `ls src/IDF/locale/*/idf.po`; do \
 | 
			
		||||
		echo "Updating file : "$$pofile; \
 | 
			
		||||
		printf "Updating file : "$$pofile"\n"; \
 | 
			
		||||
		msgmerge -v -U $$pofile src/IDF/locale/idf.pot; \
 | 
			
		||||
		echo ; \
 | 
			
		||||
		printf "\n"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
@@ -72,22 +84,22 @@ check-tx-config:
 | 
			
		||||
	@if [ ! -e .tx/config ]; then                                       \
 | 
			
		||||
	mkdir -p .tx;                                                       \
 | 
			
		||||
	touch .tx/config;                                                   \
 | 
			
		||||
	echo "[main]" >> .tx/config;                                        \
 | 
			
		||||
	echo "host = http://www.transifex.net" >> .tx/config;               \
 | 
			
		||||
	echo "" >> .tx/config;                                              \
 | 
			
		||||
	echo "[indefero.idfpot]" >> .tx/config;                             \
 | 
			
		||||
	echo "file_filter = src/IDF/locale/<lang>/idf.po" >> .tx/config;    \
 | 
			
		||||
	echo "source_file = src/IDF/locale/idf.pot" >> .tx/config;          \
 | 
			
		||||
	echo "source_lang = en" >> .tx/config;                              \
 | 
			
		||||
	printf "[main]\n" >> .tx/config;                                        \
 | 
			
		||||
	printf "host = http://www.transifex.net\n" >> .tx/config;               \
 | 
			
		||||
	printf "\n" >> .tx/config;                                              \
 | 
			
		||||
	printf "[indefero.idfpot]\n" >> .tx/config;                             \
 | 
			
		||||
	printf "file_filter = src/IDF/locale/<lang>/idf.po\n" >> .tx/config;    \
 | 
			
		||||
	printf "source_file = src/IDF/locale/idf.pot\n" >> .tx/config;          \
 | 
			
		||||
	printf "source_lang = en\n" >> .tx/config;                              \
 | 
			
		||||
	fi
 | 
			
		||||
	@if [ ! -e $(HOME)/.transifexrc ]; then								\
 | 
			
		||||
	@if [ ! -e $(HOME)/.transifexrc ]; then					\
 | 
			
		||||
	touch $(HOME)/.transifexrc;												\
 | 
			
		||||
	echo "[http://www.transifex.net]" >> $(HOME)/.transifexrc;				\
 | 
			
		||||
	echo "username = " >> $(HOME)/.transifexrc;								\
 | 
			
		||||
	echo "token = " >> $(HOME)/.transifexrc;									\
 | 
			
		||||
	echo "password = " >> $(HOME)/.transifexrc;								\
 | 
			
		||||
	echo "hostname = http://www.transifex.net" >> $(HOME)/.transifexrc;		\
 | 
			
		||||
	echo "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !";		\
 | 
			
		||||
	printf "[http://www.transifex.net]\n" >> $(HOME)/.transifexrc;						\
 | 
			
		||||
	printf "username = \n" >> $(HOME)/.transifexrc;								\
 | 
			
		||||
	printf "token = \n" >> $(HOME)/.transifexrc;								\
 | 
			
		||||
	printf "password = \n" >> $(HOME)/.transifexrc;								\
 | 
			
		||||
	printf "hostname = http://www.transifex.net\n" >> $(HOME)/.transifexrc;					\
 | 
			
		||||
	printf "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !\n";	\
 | 
			
		||||
	exit 1;																\
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
@@ -98,13 +110,32 @@ po-push: check-tx-config
 | 
			
		||||
	@tx push -t
 | 
			
		||||
 | 
			
		||||
po-pull: check-tx-config
 | 
			
		||||
	# Save PO
 | 
			
		||||
	@for pofile in `ls src/IDF/locale/*/idf.po`; do \
 | 
			
		||||
	    cp $$pofile $$pofile".save"; \
 | 
			
		||||
	done
 | 
			
		||||
	# Get new one
 | 
			
		||||
	@tx pull -a
 | 
			
		||||
	# Merge Transifex PO into local PO (so fuzzy entry is correctly saved)
 | 
			
		||||
	@for pofile in `ls src/IDF/locale/*/idf.po`; do \
 | 
			
		||||
	    msgmerge -U $$pofile".save" $$pofile; \
 | 
			
		||||
	    rm -f $$pofile; \
 | 
			
		||||
	    mv $$pofile".save" $$pofile; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
po-stats:
 | 
			
		||||
	@msgfmt --statistics -v src/IDF/locale/idf.pot
 | 
			
		||||
	@for pofile in `ls src/IDF/locale/*/idf.po`; do \
 | 
			
		||||
	    msgfmt --statistics -v $$pofile; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#   Generic rule to build a tarball of indefero for a specified branch
 | 
			
		||||
#   ex: make master_tarball
 | 
			
		||||
#       make dev_tarball
 | 
			
		||||
#   Generic rule to build a zipfile of indefero for a specified branch
 | 
			
		||||
#   ex: make master_zipfile
 | 
			
		||||
#       make develop_zipfile
 | 
			
		||||
#
 | 
			
		||||
%_tarball:
 | 
			
		||||
	@git archive --format=zip --prefix="indefero/" $(@:_tarball=) > indefero-$(@:_tarball=)-`git log $(@:_tarball=) -n 1 --pretty=format:%H`.zip
 | 
			
		||||
%-zipfile:
 | 
			
		||||
	@git archive --format=zip --prefix="indefero/" $(@:-zipfile=) \
 | 
			
		||||
		> indefero-$(@:-zipfile=)-`git log $(@:-zipfile=) -n 1 \
 | 
			
		||||
		--pretty=format:%h`.zip
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										105
									
								
								NEWS.mdtext
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								NEWS.mdtext
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,105 @@
 | 
			
		||||
# InDefero 1.2 - xxx xxx xx xx:xx 2011 UTC
 | 
			
		||||
 | 
			
		||||
## New Features
 | 
			
		||||
 | 
			
		||||
## Bugfixes 
 | 
			
		||||
 | 
			
		||||
- monotone zip archive entries now all carry the revision date as mtime (issue 645)
 | 
			
		||||
- Timeline only displays filter options for items a user has actually access to (issue 655)
 | 
			
		||||
- Fix the self-link of the RSS feed (issue 666)
 | 
			
		||||
 | 
			
		||||
## Documentation
 | 
			
		||||
 | 
			
		||||
## Translations
 | 
			
		||||
 | 
			
		||||
# InDefero 1.1.1 - Mon Mar 28 15:52 2011 UTC
 | 
			
		||||
 | 
			
		||||
## Bugfixes
 | 
			
		||||
 | 
			
		||||
- Fix an incompatibility with Python 3.1 in gitserve.py (issue 554)
 | 
			
		||||
- Fix PHP error when the commit view shows a commit with changed binary files (issue 643)
 | 
			
		||||
- A migration problem prevented the preferences page being displayed properly (issues 644 and 653)
 | 
			
		||||
- Fix PHP error when trying to create Mercurial source archives (issue 648)
 | 
			
		||||
- Improve the French translation (issue 651)
 | 
			
		||||
- Registration page missed a link to password recovery that was mentioned in a form error (issue 652)
 | 
			
		||||
 | 
			
		||||
# InDefero 1.1 - Sun Mar 20 11:44 2011 UTC
 | 
			
		||||
 | 
			
		||||
## New Features
 | 
			
		||||
 | 
			
		||||
* _Version control_:
 | 
			
		||||
 - Support for the monotone Version Control system (see [[InstallationScmMonotone]])
 | 
			
		||||
 - Display detailed changeset information in the commit details (git, mtn) (issue 544)
 | 
			
		||||
 - Show branch in the commit details (git, mtn, hg) (issue 450)
 | 
			
		||||
 - Render branch and tag names in a popup and make them filterable (git, hg, mtn) (issue 601)
 | 
			
		||||
 | 
			
		||||
* _Issue tracking_:
 | 
			
		||||
 - Forge-wide and per-project watch lists of starred issues (issue 589)
 | 
			
		||||
 - Configure a default issue template for each project (issues 212 and 540)
 | 
			
		||||
 - Pick default issue labels from the configured project settings (issue 556)
 | 
			
		||||
 - Navigate to a preceding / following issue in the issue detail view
 | 
			
		||||
 - Many new text syntaxes to auto-link revisions (see [[AutomaticLinks]], issue 569)
 | 
			
		||||
 | 
			
		||||
* _Documentation wiki_:
 | 
			
		||||
 - Automatically create a table of contents on wiki pages (issue 350)
 | 
			
		||||
 - Allow the usage of text labels for Wiki text links (issue 456)
 | 
			
		||||
 | 
			
		||||
* _Other_:
 | 
			
		||||
 - Enhanced user profile page (issue 510)
 | 
			
		||||
 - Manage multiple (commit) emails in the account settings (issues 136 and 500)
 | 
			
		||||
 - Filter the timeline and its feed by item type (issue 543)
 | 
			
		||||
 - Add multiple email addresses for project notifications (issue 372)
 | 
			
		||||
 - Direct links to other projects via the new `Project List` dropdown
 | 
			
		||||
 - InDefero gained a favicon (issue 594)
 | 
			
		||||
 | 
			
		||||
## Bugfixes
 | 
			
		||||
 | 
			
		||||
- Fix `Need SSH_ORIGINAL_COMMAND in environment` error for git sync (issue 198)
 | 
			
		||||
- Added an option to disable lengthy project size calculation in the forge (issue 403)
 | 
			
		||||
- Fix a problem when deleting an orphaned git repository (issue 467)
 | 
			
		||||
- Ignore XML parsing problems when trying to retrieve commit messages for svn (issues 469 and 518)
 | 
			
		||||
- Sort the project list by the display name of the project (issue 477)
 | 
			
		||||
- Project creation form now has a short description field as well (issue 479)
 | 
			
		||||
- Add more file extensions supported by our in-tree prettify version (issues 490 and 567)
 | 
			
		||||
- Improve the parsing of hg's log output (issues 507 and 508)
 | 
			
		||||
- Do not clean `<ins>` and `<del>` HTML markup from user input (issue 509)
 | 
			
		||||
- Improve HTML validation by switching from `strict` to `transitional` DOCTYPE (issue 511)
 | 
			
		||||
- Properly handle git commits without a changelog title (issue 520)
 | 
			
		||||
- Improve BSD compatibility in shell scripts (issue 526)
 | 
			
		||||
- Properly render inner whitespaces in viewed issue attachments (issue 528)
 | 
			
		||||
- Support for uploading SSH keys without optional comment (issue 531)
 | 
			
		||||
- Recognize irc: and git: protocols in Markdown renderer (issue 546)
 | 
			
		||||
- New config option `git_core_quotepath` to handle non-ASCII git file names (issue 553)
 | 
			
		||||
- Ensured that active views are rendered in the menu as such (issue 555)
 | 
			
		||||
- Add CSS for nested and mixed ordered and unordered lists (issue 557)
 | 
			
		||||
- Directories are now sorted before files in source tree views (issue 573)
 | 
			
		||||
- File attachments now have explicit view and download links in issue views (issue 575)
 | 
			
		||||
- Display anonymous access URL when user has no SSH key registered (issue 588)
 | 
			
		||||
- Improve the rendering of tag lists in issue views (issue 591)
 | 
			
		||||
- Improved error page when a commit or branch was not found (issue 609)
 | 
			
		||||
- Disable browser autocomplete of password fields in the account settings (issue 616)
 | 
			
		||||
- Improvements in the automatic linker parser (issue 618)
 | 
			
		||||
- The `createIssue` API method did not check the API authentication (issue 619)
 | 
			
		||||
- Reduce the memory footprint and compatibility of the internal diff parser (issues 627 and 633)
 | 
			
		||||
- Print the git branches and tags in bold which contain the currently displayed revision
 | 
			
		||||
 | 
			
		||||
## Documentation
 | 
			
		||||
 | 
			
		||||
- Document how to contribute to Indefero in `CONTRIBUTE.mdtext` (issue 486)
 | 
			
		||||
- Note possible problems with mbstring.func_overload in `INSTALL.mdtext` (issue 481)
 | 
			
		||||
- Improve links to Markdown documentation (issue 489)
 | 
			
		||||
- Explain purpose of `idf_strong_key_check` in `idf.php-dist` (issue 516)
 | 
			
		||||
 | 
			
		||||
## Translations
 | 
			
		||||
 | 
			
		||||
- Spanish translation added
 | 
			
		||||
- Started with a Simplified Chinese translation (issue 521)
 | 
			
		||||
- Started with a Russian translation
 | 
			
		||||
- Updates and fixes to the French translation (issue 574)
 | 
			
		||||
- Updates and fixes to the German translation
 | 
			
		||||
- English source language has been improved (issues 441, 478, and 631)
 | 
			
		||||
 | 
			
		||||
# InDefero 1.0 - Tue Apr 20 07:00 2010 UTC
 | 
			
		||||
 | 
			
		||||
First stable release.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										173
									
								
								logo/no_logo.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								logo/no_logo.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,173 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 | 
			
		||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
 | 
			
		||||
 | 
			
		||||
<svg
 | 
			
		||||
   xmlns:dc="http://purl.org/dc/elements/1.1/"
 | 
			
		||||
   xmlns:cc="http://creativecommons.org/ns#"
 | 
			
		||||
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 | 
			
		||||
   xmlns:svg="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
 | 
			
		||||
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
 | 
			
		||||
   sodipodi:docname="no_logo.svg"
 | 
			
		||||
   inkscape:version="0.47 r22583"
 | 
			
		||||
   id="svg2985"
 | 
			
		||||
   height="32"
 | 
			
		||||
   width="32"
 | 
			
		||||
   version="1.1"
 | 
			
		||||
   inkscape:export-filename="/Users/tommyd/Entwicklung/indefero/www/media/idf/img/no_logo.png"
 | 
			
		||||
   inkscape:export-xdpi="89.989998"
 | 
			
		||||
   inkscape:export-ydpi="89.989998">
 | 
			
		||||
  <sodipodi:namedview
 | 
			
		||||
     pagecolor="#ffffff"
 | 
			
		||||
     bordercolor="#666666"
 | 
			
		||||
     borderopacity="1"
 | 
			
		||||
     objecttolerance="10"
 | 
			
		||||
     gridtolerance="10"
 | 
			
		||||
     guidetolerance="10"
 | 
			
		||||
     inkscape:pageopacity="0"
 | 
			
		||||
     inkscape:pageshadow="2"
 | 
			
		||||
     inkscape:window-width="1440"
 | 
			
		||||
     inkscape:window-height="852"
 | 
			
		||||
     id="namedview9"
 | 
			
		||||
     showgrid="false"
 | 
			
		||||
     inkscape:zoom="16.0625"
 | 
			
		||||
     inkscape:cx="8.5507561"
 | 
			
		||||
     inkscape:cy="16.122403"
 | 
			
		||||
     inkscape:window-x="0"
 | 
			
		||||
     inkscape:window-y="0"
 | 
			
		||||
     inkscape:window-maximized="0"
 | 
			
		||||
     inkscape:current-layer="g2847"
 | 
			
		||||
     showguides="true"
 | 
			
		||||
     inkscape:guide-bbox="true">
 | 
			
		||||
    <sodipodi:guide
 | 
			
		||||
       orientation="1,0"
 | 
			
		||||
       position="16,25.836575"
 | 
			
		||||
       id="guide3752" />
 | 
			
		||||
    <sodipodi:guide
 | 
			
		||||
       orientation="0,1"
 | 
			
		||||
       position="-18.677042,16"
 | 
			
		||||
       id="guide3754" />
 | 
			
		||||
  </sodipodi:namedview>
 | 
			
		||||
  <defs
 | 
			
		||||
     id="defs2987">
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       sodipodi:type="inkscape:persp3d"
 | 
			
		||||
       inkscape:vp_x="0 : 16 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_z="32 : 16 : 1"
 | 
			
		||||
       inkscape:persp3d-origin="16 : 10.666667 : 1"
 | 
			
		||||
       id="perspective13" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective2863"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective3676"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective3717"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <filter
 | 
			
		||||
       inkscape:collect="always"
 | 
			
		||||
       id="filter3816"
 | 
			
		||||
       x="-0.14434362"
 | 
			
		||||
       width="1.2886872"
 | 
			
		||||
       y="-0.11562817"
 | 
			
		||||
       height="1.2312563">
 | 
			
		||||
      <feGaussianBlur
 | 
			
		||||
         inkscape:collect="always"
 | 
			
		||||
         stdDeviation="1.1799243"
 | 
			
		||||
         id="feGaussianBlur3818" />
 | 
			
		||||
    </filter>
 | 
			
		||||
  </defs>
 | 
			
		||||
  <metadata
 | 
			
		||||
     id="metadata2990">
 | 
			
		||||
    <rdf:RDF>
 | 
			
		||||
      <cc:Work
 | 
			
		||||
         rdf:about="">
 | 
			
		||||
        <dc:format>image/svg+xml</dc:format>
 | 
			
		||||
        <dc:type
 | 
			
		||||
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
 | 
			
		||||
        <dc:title></dc:title>
 | 
			
		||||
      </cc:Work>
 | 
			
		||||
    </rdf:RDF>
 | 
			
		||||
  </metadata>
 | 
			
		||||
  <g
 | 
			
		||||
     inkscape:groupmode="layer"
 | 
			
		||||
     id="layer2"
 | 
			
		||||
     inkscape:label="shadow"
 | 
			
		||||
     style="display:inline"
 | 
			
		||||
     sodipodi:insensitive="true">
 | 
			
		||||
    <g
 | 
			
		||||
       transform="translate(0.44042901,0.78704792)"
 | 
			
		||||
       id="g2847-8"
 | 
			
		||||
       style="opacity:0.79710143;fill:#000000;stroke:#000000;stroke-opacity:1;filter:url(#filter3816)">
 | 
			
		||||
      <g
 | 
			
		||||
         id="g3838-0"
 | 
			
		||||
         style="fill:#000000;stroke:#000000;stroke-opacity:1" />
 | 
			
		||||
      <g
 | 
			
		||||
         id="g2401-2"
 | 
			
		||||
         transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
 | 
			
		||||
         style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
         inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
 | 
			
		||||
         inkscape:export-xdpi="12.330909"
 | 
			
		||||
         inkscape:export-ydpi="12.330909">
 | 
			
		||||
        <path
 | 
			
		||||
           id="path2383-4"
 | 
			
		||||
           d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
 | 
			
		||||
           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
           inkscape:connector-curvature="0" />
 | 
			
		||||
        <path
 | 
			
		||||
           id="path2391-8"
 | 
			
		||||
           d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
 | 
			
		||||
           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
           inkscape:connector-curvature="0" />
 | 
			
		||||
      </g>
 | 
			
		||||
    </g>
 | 
			
		||||
  </g>
 | 
			
		||||
  <g
 | 
			
		||||
     inkscape:groupmode="layer"
 | 
			
		||||
     id="layer3"
 | 
			
		||||
     inkscape:label="logo"
 | 
			
		||||
     style="display:inline">
 | 
			
		||||
    <g
 | 
			
		||||
       id="layer1"
 | 
			
		||||
       transform="translate(-0.06540759,0.09444087)">
 | 
			
		||||
      <g
 | 
			
		||||
         id="g2847">
 | 
			
		||||
        <g
 | 
			
		||||
           id="g3838" />
 | 
			
		||||
        <g
 | 
			
		||||
           id="g2401"
 | 
			
		||||
           transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
 | 
			
		||||
           style="fill:#e6e6e6;fill-opacity:1;stroke:#a0a0a0;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
           inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
 | 
			
		||||
           inkscape:export-xdpi="12.330909"
 | 
			
		||||
           inkscape:export-ydpi="12.330909">
 | 
			
		||||
          <path
 | 
			
		||||
             id="path2383"
 | 
			
		||||
             d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
 | 
			
		||||
             style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
             inkscape:connector-curvature="0" />
 | 
			
		||||
          <path
 | 
			
		||||
             id="path2391"
 | 
			
		||||
             d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
 | 
			
		||||
             style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
             inkscape:connector-curvature="0" />
 | 
			
		||||
        </g>
 | 
			
		||||
      </g>
 | 
			
		||||
    </g>
 | 
			
		||||
  </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 8.4 KiB  | 
							
								
								
									
										27
									
								
								phpunit.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								phpunit.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
<phpunit backupGlobals="true"
 | 
			
		||||
         backupStaticAttributes="false"
 | 
			
		||||
         bootstrap="test/bootstrap.php"
 | 
			
		||||
         convertErrorsToExceptions="true"
 | 
			
		||||
         convertNoticesToExceptions="true"
 | 
			
		||||
         convertWarningsToExceptions="true"
 | 
			
		||||
         strict="false"
 | 
			
		||||
         verbose="true">
 | 
			
		||||
 | 
			
		||||
    <testsuites>
 | 
			
		||||
        <testsuite name="Everything">
 | 
			
		||||
            <directory>test/IDF/</directory>
 | 
			
		||||
        </testsuite>
 | 
			
		||||
    </testsuites>
 | 
			
		||||
 | 
			
		||||
    <filter>
 | 
			
		||||
        <whitelist>
 | 
			
		||||
            <directory suffix=".php">src/IDF</directory>
 | 
			
		||||
            <exclude>
 | 
			
		||||
                <directory suffix=".php">src/IDF/Tests</directory>
 | 
			
		||||
                <directory suffix=".php">src/IDF/conf</directory>
 | 
			
		||||
                <file>src/IDF/version.php</file>
 | 
			
		||||
            </exclude>
 | 
			
		||||
        </whitelist>
 | 
			
		||||
    </filter>
 | 
			
		||||
</phpunit>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								run-tests
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								run-tests
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
#!/usr/bin/env php
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$xmlfile = dirname(__FILE__) .'/test/report.xml';
 | 
			
		||||
passthru('phpunit --coverage-clover='.$xmlfile);
 | 
			
		||||
$xml = simplexml_load_string(file_get_contents($xmlfile));
 | 
			
		||||
unlink($xmlfile);
 | 
			
		||||
printf(
 | 
			
		||||
   '>>> code coverage %s/%s (%s%%)'."\n",
 | 
			
		||||
   $xml->project->metrics['coveredstatements'],
 | 
			
		||||
   $xml->project->metrics['statements'],
 | 
			
		||||
   round(($xml->project->metrics['coveredstatements']/(float)$xml->project->metrics['statements']) * 100.0, 2)
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
#!/usr/bin/env python
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
# 
 | 
			
		||||
#
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -23,14 +23,17 @@
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
import commands
 | 
			
		||||
import traceback
 | 
			
		||||
import subprocess
 | 
			
		||||
 | 
			
		||||
SCRIPTDIR = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
 | 
			
		||||
GITSERVEPHP = '%s/gitserve.php' % SCRIPTDIR
 | 
			
		||||
process = subprocess.Popen(['php', GITSERVEPHP, sys.argv[1]],
 | 
			
		||||
                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 | 
			
		||||
output = str.encode("\n").join(process.communicate()).strip()
 | 
			
		||||
status = process.wait()
 | 
			
		||||
 | 
			
		||||
n = len("/gitserve.py")
 | 
			
		||||
GITSERVEPHP = '%s/gitserve.php' % traceback.extract_stack(limit=1)[0][0][0:-n]
 | 
			
		||||
status, output = commands.getstatusoutput('php %s %s' % (GITSERVEPHP, sys.argv[1]))
 | 
			
		||||
if status == 0:
 | 
			
		||||
    os.execvp('git', ['git', 'shell', '-c', output.strip()])
 | 
			
		||||
else:
 | 
			
		||||
    sys.stderr.write("%s\n" % output)
 | 
			
		||||
    sys.stderr.write("%s\n" % output.strip())
 | 
			
		||||
sys.exit(1)
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										209
									
								
								src/IDF/Diff.php
									
									
									
									
									
								
							
							
						
						
									
										209
									
								
								src/IDF/Diff.php
									
									
									
									
									
								
							@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -27,17 +27,17 @@
 | 
			
		||||
 */
 | 
			
		||||
class IDF_Diff
 | 
			
		||||
{
 | 
			
		||||
    public $repo = '';
 | 
			
		||||
    public $diff = '';
 | 
			
		||||
    public $path_strip_level = 0;
 | 
			
		||||
    protected $lines = array();
 | 
			
		||||
 | 
			
		||||
    public $files = array();
 | 
			
		||||
 | 
			
		||||
    public function __construct($diff, $repo='')
 | 
			
		||||
    public function __construct($diff, $path_strip_level = 0)
 | 
			
		||||
    {
 | 
			
		||||
        $this->repo = $repo;
 | 
			
		||||
        $this->diff = $diff;
 | 
			
		||||
        $this->lines = preg_split("/\015\012|\015|\012/", $diff);
 | 
			
		||||
        $this->path_strip_level = $path_strip_level;
 | 
			
		||||
        // this works because in unified diff format even empty lines are
 | 
			
		||||
        // either prefixed with a '+', '-' or ' '
 | 
			
		||||
        $this->lines = preg_split("/\015\012|\015|\012/", $diff, -1, PREG_SPLIT_NO_EMPTY);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function parse()
 | 
			
		||||
@@ -49,118 +49,95 @@ class IDF_Diff
 | 
			
		||||
        $files = array();
 | 
			
		||||
        $indiff = false; // Used to skip the headers in the git patches
 | 
			
		||||
        $i = 0; // Used to skip the end of a git patch with --\nversion number
 | 
			
		||||
        foreach ($this->lines as $line) {
 | 
			
		||||
            $i++;
 | 
			
		||||
            if (0 === strpos($line, '--') and isset($this->lines[$i])
 | 
			
		||||
                and preg_match('/^\d+\.\d+\.\d+\.\d+$/', $this->lines[$i])) {
 | 
			
		||||
                break;
 | 
			
		||||
        $diffsize = count($this->lines);
 | 
			
		||||
        while ($i < $diffsize) {
 | 
			
		||||
            // look for the potential beginning of a diff
 | 
			
		||||
            if (substr($this->lines[$i], 0, 4) !== '--- ') {
 | 
			
		||||
                $i++;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, 'diff --git a')) {
 | 
			
		||||
                $current_file = self::getFile($line);
 | 
			
		||||
                $files[$current_file] = array();
 | 
			
		||||
                $files[$current_file]['chunks'] = array();
 | 
			
		||||
                $files[$current_file]['chunks_def'] = array();
 | 
			
		||||
                $current_chunk = 0;
 | 
			
		||||
                $indiff = true;
 | 
			
		||||
 | 
			
		||||
            // we're inside a diff candiate
 | 
			
		||||
            $oldfileline = $this->lines[$i++];
 | 
			
		||||
            $newfileline = $this->lines[$i++];
 | 
			
		||||
            if (substr($newfileline, 0, 4) !== '+++ ') {
 | 
			
		||||
                // not a valid diff here, move on
 | 
			
		||||
                continue;
 | 
			
		||||
            } else if (preg_match('#^diff -r [^\s]+ -r [^\s]+ (.+)$#', $line, $matches)) {
 | 
			
		||||
                $current_file = $matches[1];
 | 
			
		||||
                $files[$current_file] = array();
 | 
			
		||||
                $files[$current_file]['chunks'] = array();
 | 
			
		||||
                $files[$current_file]['chunks_def'] = array();
 | 
			
		||||
                $current_chunk = 0;
 | 
			
		||||
                $indiff = true;
 | 
			
		||||
                continue;
 | 
			
		||||
            } else if (!$indiff && 0 === strpos($line, '=========')) {
 | 
			
		||||
                // ignore pseudo stanzas with a hint of a binary file
 | 
			
		||||
                if (preg_match("/^# (.+) is binary/", $this->lines[$i]))
 | 
			
		||||
                    continue;
 | 
			
		||||
                // by default always use the new name of a possibly renamed file
 | 
			
		||||
                $current_file = self::getMtnFile($this->lines[$i+1]);
 | 
			
		||||
                // mtn 0.48 and newer set /dev/null as file path for dropped files
 | 
			
		||||
                // so we display the old name here
 | 
			
		||||
                if ($current_file == "/dev/null") {
 | 
			
		||||
                    $current_file = self::getMtnFile($this->lines[$i]);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // use new file name by default
 | 
			
		||||
            preg_match("/^\+\+\+ ([^\t]+)/", $newfileline, $m);
 | 
			
		||||
            $current_file = $m[1];
 | 
			
		||||
            if ($current_file === '/dev/null') {
 | 
			
		||||
                // except if it's /dev/null, use the old one instead
 | 
			
		||||
                // eg. mtn 0.48 and newer
 | 
			
		||||
                preg_match("/^--- ([^\t]+)/", $oldfileline, $m);
 | 
			
		||||
                $current_file = $m[1];
 | 
			
		||||
            }
 | 
			
		||||
            if ($this->path_strip_level > 0) {
 | 
			
		||||
                $fileparts = explode('/', $current_file, $this->path_strip_level+1);
 | 
			
		||||
                $current_file = array_pop($fileparts);
 | 
			
		||||
            }
 | 
			
		||||
            $current_chunk = 0;
 | 
			
		||||
            $files[$current_file] = array();
 | 
			
		||||
            $files[$current_file]['chunks'] = array();
 | 
			
		||||
            $files[$current_file]['chunks_def'] = array();
 | 
			
		||||
 | 
			
		||||
            while ($i < $diffsize && substr($this->lines[$i], 0, 3) === '@@ ') {
 | 
			
		||||
                $elems = preg_match('/@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@.*/',
 | 
			
		||||
                                    $this->lines[$i++], $results);
 | 
			
		||||
                if ($elems != 1) {
 | 
			
		||||
                    // hunk is badly formatted
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                if ($current_file == "/dev/null") {
 | 
			
		||||
                    throw new Exception(
 | 
			
		||||
                        "could not determine path from diff"
 | 
			
		||||
                    );
 | 
			
		||||
                }
 | 
			
		||||
                $files[$current_file] = array();
 | 
			
		||||
                $files[$current_file]['chunks'] = array();
 | 
			
		||||
                $files[$current_file]['chunks_def'] = array();
 | 
			
		||||
                $current_chunk = 0;
 | 
			
		||||
                $indiff = true;
 | 
			
		||||
                continue;
 | 
			
		||||
            } else if (0 === strpos($line, 'Index: ')) {
 | 
			
		||||
                $current_file = self::getSvnFile($line);
 | 
			
		||||
                $files[$current_file] = array();
 | 
			
		||||
                $files[$current_file]['chunks'] = array();
 | 
			
		||||
                $files[$current_file]['chunks_def'] = array();
 | 
			
		||||
                $current_chunk = 0;
 | 
			
		||||
                $indiff = true;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (!$indiff) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, '@@ ')) {
 | 
			
		||||
                $files[$current_file]['chunks_def'][] = self::getChunk($line);
 | 
			
		||||
                $delstart = $results[1];
 | 
			
		||||
                $dellines = $results[2] === '' ? 1 : $results[2];
 | 
			
		||||
                $addstart = $results[3];
 | 
			
		||||
                $addlines = $results[4] === '' ? 1 : $results[4];
 | 
			
		||||
 | 
			
		||||
                $files[$current_file]['chunks_def'][] = array(
 | 
			
		||||
                    array($delstart, $dellines), array($addstart, $addlines)
 | 
			
		||||
                );
 | 
			
		||||
                $files[$current_file]['chunks'][] = array();
 | 
			
		||||
 | 
			
		||||
                while ($i < $diffsize && ($addlines >= 0 || $dellines >= 0)) {
 | 
			
		||||
                    $linetype = $this->lines[$i] != '' ? $this->lines[$i][0] : ' ';
 | 
			
		||||
                    switch ($linetype) {
 | 
			
		||||
                        case ' ':
 | 
			
		||||
                            $files[$current_file]['chunks'][$current_chunk][] =
 | 
			
		||||
                                array($delstart, $addstart, substr($this->lines[$i++], 1));
 | 
			
		||||
                            $dellines--;
 | 
			
		||||
                            $addlines--;
 | 
			
		||||
                            $delstart++;
 | 
			
		||||
                            $addstart++;
 | 
			
		||||
                            break;
 | 
			
		||||
                        case '+':
 | 
			
		||||
                            $files[$current_file]['chunks'][$current_chunk][] =
 | 
			
		||||
                                array('', $addstart, substr($this->lines[$i++], 1));
 | 
			
		||||
                            $addlines--;
 | 
			
		||||
                            $addstart++;
 | 
			
		||||
                            break;
 | 
			
		||||
                        case '-':
 | 
			
		||||
                            $files[$current_file]['chunks'][$current_chunk][] =
 | 
			
		||||
                                array($delstart, '', substr($this->lines[$i++], 1));
 | 
			
		||||
                            $dellines--;
 | 
			
		||||
                            $delstart++;
 | 
			
		||||
                            break;
 | 
			
		||||
                        case '\\':
 | 
			
		||||
                            // ignore newline handling for now, see issue 636
 | 
			
		||||
                            $i++;
 | 
			
		||||
                            continue;
 | 
			
		||||
                        default:
 | 
			
		||||
                            break 2;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                $current_chunk++;
 | 
			
		||||
                $lline = $files[$current_file]['chunks_def'][$current_chunk-1][0][0];
 | 
			
		||||
                $rline = $files[$current_file]['chunks_def'][$current_chunk-1][1][0];
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, '---') or 0 === strpos($line, '+++')) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, '-')) {
 | 
			
		||||
                $files[$current_file]['chunks'][$current_chunk-1][] = array($lline, '', substr($line, 1));
 | 
			
		||||
                $lline++;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, '+')) {
 | 
			
		||||
                $files[$current_file]['chunks'][$current_chunk-1][] = array('', $rline, substr($line, 1));
 | 
			
		||||
                $rline++;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (0 === strpos($line, ' ')) {
 | 
			
		||||
                $files[$current_file]['chunks'][$current_chunk-1][] = array($lline, $rline, substr($line, 1));
 | 
			
		||||
                $rline++;
 | 
			
		||||
                $lline++;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if ($line == '') {
 | 
			
		||||
                $files[$current_file]['chunks'][$current_chunk-1][] = array($lline, $rline, $line);
 | 
			
		||||
                $rline++;
 | 
			
		||||
                $lline++;
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        $this->files = $files;
 | 
			
		||||
        return $files;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function getFile($line)
 | 
			
		||||
    {
 | 
			
		||||
        $line = substr(trim($line), 10);
 | 
			
		||||
        $n = (int) strlen($line)/2;
 | 
			
		||||
        return trim(substr($line, 3, $n-3));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function getSvnFile($line)
 | 
			
		||||
    {
 | 
			
		||||
        return substr(trim($line), 7);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function getMtnFile($line)
 | 
			
		||||
    {
 | 
			
		||||
        preg_match("/^[+-]{3} ([^\t]+)/", $line, $m);
 | 
			
		||||
        return $m[1];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Return the html version of a parsed diff.
 | 
			
		||||
     */
 | 
			
		||||
@@ -197,7 +174,6 @@ class IDF_Diff
 | 
			
		||||
        return Pluf_Template::markSafe($out);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public static function padLine($line)
 | 
			
		||||
    {
 | 
			
		||||
        $line = str_replace("\t", '    ', $line);
 | 
			
		||||
@@ -210,19 +186,6 @@ class IDF_Diff
 | 
			
		||||
        return str_repeat(' ', $i).substr($line, $i);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return array array(array(start, n), array(start, n))
 | 
			
		||||
     */
 | 
			
		||||
    public static function getChunk($line)
 | 
			
		||||
    {
 | 
			
		||||
        $elts = explode(' ', $line);
 | 
			
		||||
        $res = array();
 | 
			
		||||
        for ($i=1;$i<3;$i++) {
 | 
			
		||||
            $res[] = explode(',', trim(substr($elts[$i], 1)));
 | 
			
		||||
        }
 | 
			
		||||
        return $res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Review patch.
 | 
			
		||||
     *
 | 
			
		||||
@@ -347,7 +310,6 @@ class IDF_Diff
 | 
			
		||||
        return $nnew_chunks;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public function renderCompared($chunks, $filename)
 | 
			
		||||
    {
 | 
			
		||||
        $fileinfo = IDF_FileUtil::getMimeType($filename);
 | 
			
		||||
@@ -381,6 +343,5 @@ class IDF_Diff
 | 
			
		||||
            $i++;
 | 
			
		||||
        }
 | 
			
		||||
        return Pluf_Template::markSafe($out);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										96
									
								
								src/IDF/EmailAddress.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/IDF/EmailAddress.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,96 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Storage of Email addresses
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
class IDF_EmailAddress extends Pluf_Model
 | 
			
		||||
{
 | 
			
		||||
    public $_model = __CLASS__;
 | 
			
		||||
 | 
			
		||||
    function init()
 | 
			
		||||
    {
 | 
			
		||||
        $this->_a['table'] = 'idf_emailaddresses';
 | 
			
		||||
        $this->_a['model'] = __CLASS__;
 | 
			
		||||
        $this->_a['cols'] = array(
 | 
			
		||||
                             // It is mandatory to have an "id" column.
 | 
			
		||||
                            'id' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Sequence',
 | 
			
		||||
                                  //It is automatically added.
 | 
			
		||||
                                  'blank' => true,
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'user' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Foreignkey',
 | 
			
		||||
                                  'model' => 'Pluf_User',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('user'),
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'address' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Email',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('email'),
 | 
			
		||||
                                  'unique' => true,
 | 
			
		||||
                                  ),
 | 
			
		||||
                            );
 | 
			
		||||
        // WARNING: Not using getSqlTable on the Pluf_User object to
 | 
			
		||||
        // avoid recursion.
 | 
			
		||||
        $t_users = $this->_con->pfx.'users';
 | 
			
		||||
        $this->_a['views'] = array(
 | 
			
		||||
                              'join_user' =>
 | 
			
		||||
                              array(
 | 
			
		||||
                                    'join' => 'LEFT JOIN '.$t_users
 | 
			
		||||
                                    .' ON '.$t_users.'.id='.$this->_con->qn('user'),
 | 
			
		||||
                                    'select' => $this->getSelect().', '
 | 
			
		||||
                                    .$t_users.'.login AS login',
 | 
			
		||||
                                    'props' => array('login' => 'login'),
 | 
			
		||||
                                    )
 | 
			
		||||
                                   );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function get_email_addresses_for_user($user)
 | 
			
		||||
    {
 | 
			
		||||
        $addr = $user->get_idf_emailaddress_list();
 | 
			
		||||
        $addr[] = (object)array("address" => $user->email, "id" => -1, "user" => $user);
 | 
			
		||||
        return $addr;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function get_user_for_email_address($email)
 | 
			
		||||
    {
 | 
			
		||||
        $sql = new Pluf_SQL('email=%s', array($email));
 | 
			
		||||
        $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
 | 
			
		||||
        if ($users->count() > 0) {
 | 
			
		||||
            return $users[0];
 | 
			
		||||
        }
 | 
			
		||||
        $sql = new Pluf_SQL('address=%s', array($email));
 | 
			
		||||
        $matches = Pluf::factory('IDF_EmailAddress')->getList(array('filter'=>$sql->gen()));
 | 
			
		||||
        if ($matches->count() > 0) {
 | 
			
		||||
            return new Pluf_User($matches[0]->user);
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -182,7 +182,7 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
 | 
			
		||||
        // we accept only starting with http(s):// to avoid people
 | 
			
		||||
        // trying to access the local filesystem.
 | 
			
		||||
        if (!preg_match('#^(http|https)://#', $url)) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('Only a remote repository available throught http or https are allowed. For example "http://somewhere.com/svn/trunk".'));
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('Only a remote repository available through HTTP or HTTPS is allowed. For example "http://somewhere.com/svn/trunk".'));
 | 
			
		||||
        }
 | 
			
		||||
        return $url;
 | 
			
		||||
    }
 | 
			
		||||
@@ -319,6 +319,7 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
 | 
			
		||||
                           'labels_issue_closed' => IDF_Form_IssueTrackingConf::init_closed,
 | 
			
		||||
                           'labels_issue_predefined' =>  IDF_Form_IssueTrackingConf::init_predefined,
 | 
			
		||||
                           'labels_issue_one_max' => IDF_Form_IssueTrackingConf::init_one_max,
 | 
			
		||||
                           'issue_relations' => IDF_Form_IssueTrackingConf::init_relations,
 | 
			
		||||
                           'webhook_url' => '',
 | 
			
		||||
                           'downloads_access_rights' => 'all',
 | 
			
		||||
                           'review_access_rights' => 'all',
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -88,7 +88,7 @@ class IDF_Form_Admin_ProjectUpdate extends Pluf_Form
 | 
			
		||||
                        $mtn_master_branch)) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__(
 | 
			
		||||
                'The master branch is empty or contains illegal characters, '.
 | 
			
		||||
                'please use only letters, digits, dashs and dots as separators.'
 | 
			
		||||
                'please use only letters, digits, dashes and dots as separators.'
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -68,7 +68,7 @@ class IDF_Form_Admin_UserCreate extends Pluf_Form
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                            'label' => __('Email'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'help_text' => __('Double check the email address as the password is directly sent to the user.'),
 | 
			
		||||
                                            'help_text' => __('Double check the email address as the password is sent directly to the user.'),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['language'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -78,7 +78,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
 | 
			
		||||
                                            'label' => __('Password'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_PasswordInput',
 | 
			
		||||
                                            'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change the password.').'<br />'.__('The password must be hard for other people to find it, but easy for the user to remember.')),
 | 
			
		||||
                                            'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change the password.').'<br />'.__('The password must be hard for other people to guess, but easy for the user to remember.')),
 | 
			
		||||
                                            'widget_attrs' => array(
 | 
			
		||||
                                                       'maxlength' => 50,
 | 
			
		||||
                                                       'size' => 15,
 | 
			
		||||
@@ -161,7 +161,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
 | 
			
		||||
                          'label' => __('Staff'),
 | 
			
		||||
                          'initial' => $this->user->staff,
 | 
			
		||||
                          'widget' => 'Pluf_Form_Widget_CheckboxInput',
 | 
			
		||||
                          'help_text' => __('If you give staff rights to a user, you really need to trust him.'),
 | 
			
		||||
                          'help_text' => __('If you give staff rights to a user, you really need to trust them.'),
 | 
			
		||||
                          ));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -173,7 +173,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
 | 
			
		||||
                          'initial' => $this->user->active,
 | 
			
		||||
                          'widget' => 'Pluf_Form_Widget_CheckboxInput',
 | 
			
		||||
                          'widget_attrs' => $attrs,
 | 
			
		||||
                          'help_text' => __('If the user is not getting the confirmation email or is abusing the system, you can directly enable or disable his account here.'),
 | 
			
		||||
                          'help_text' => __('If the user is not getting the confirmation email or is abusing the system, you can directly enable or disable their account here.'),
 | 
			
		||||
                          ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,19 +3,19 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# Plume Framework is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU Lesser General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2.1 of the License, or
 | 
			
		||||
# InDefero 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.
 | 
			
		||||
#
 | 
			
		||||
# Plume Framework is distributed in the hope that it will be useful,
 | 
			
		||||
# InDefero 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 Lesser General Public License for more details.
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU Lesser General Public License
 | 
			
		||||
# 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -76,11 +76,11 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
        // case of someone allowing the upload path to be accessible
 | 
			
		||||
        // to everybody.
 | 
			
		||||
        for ($i=1;$i<4;$i++) {
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy'; 
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy';
 | 
			
		||||
            $this->fields['attachment'.$i] = new Pluf_Form_Field_File(
 | 
			
		||||
                array('required' => false,
 | 
			
		||||
                      'label' => __('Attach a file'),
 | 
			
		||||
                      'move_function_params' => 
 | 
			
		||||
                      'move_function_params' =>
 | 
			
		||||
                      array('upload_path' => $upload_path,
 | 
			
		||||
                            'upload_path_create' => true,
 | 
			
		||||
                            'file_name' => $filename,
 | 
			
		||||
@@ -109,6 +109,21 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
                                                                    ),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
            $relation_types =  $extra['project']->getRelationsFromConfig();
 | 
			
		||||
            $this->fields['relation_type'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => __('This issue'),
 | 
			
		||||
                                'initial' => $relation_types[0],
 | 
			
		||||
                                'widget_attrs' => array('size' => 15),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            $this->fields['relation_issue'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => null,
 | 
			
		||||
                                'initial' => '',
 | 
			
		||||
                                'widget_attrs' => array('size' => 10),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * get predefined tags for issues from current project
 | 
			
		||||
             *
 | 
			
		||||
@@ -181,7 +196,7 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
            $this->cleaned_data['label'.$i] = trim($this->cleaned_data['label'.$i]);
 | 
			
		||||
            if (strpos($this->cleaned_data['label'.$i], ':') !== false) {
 | 
			
		||||
                list($class, $name) = explode(':', $this->cleaned_data['label'.$i], 2);
 | 
			
		||||
                list($class, $name) = array(mb_strtolower(trim($class)), 
 | 
			
		||||
                list($class, $name) = array(mb_strtolower(trim($class)),
 | 
			
		||||
                                            trim($name));
 | 
			
		||||
            } else {
 | 
			
		||||
                $class = 'other';
 | 
			
		||||
@@ -215,10 +230,10 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
    function clean_status()
 | 
			
		||||
    {
 | 
			
		||||
        // Check that the status is in the list of official status
 | 
			
		||||
        $tags = $this->project->getTagsFromConfig('labels_issue_open', 
 | 
			
		||||
        $tags = $this->project->getTagsFromConfig('labels_issue_open',
 | 
			
		||||
                                          IDF_Form_IssueTrackingConf::init_open,
 | 
			
		||||
                                          'Status');
 | 
			
		||||
        $tags = array_merge($this->project->getTagsFromConfig('labels_issue_closed', 
 | 
			
		||||
        $tags = array_merge($this->project->getTagsFromConfig('labels_issue_closed',
 | 
			
		||||
                                          IDF_Form_IssueTrackingConf::init_closed,
 | 
			
		||||
                                          'Status')
 | 
			
		||||
                            , $tags);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -72,12 +72,15 @@ Performance          = Performance issue
 | 
			
		||||
Usability            = Affects program usability
 | 
			
		||||
Maintainability      = Hinders future changes';
 | 
			
		||||
    const init_one_max = 'Type, Priority, Milestone';
 | 
			
		||||
    const init_relations = 'is related to
 | 
			
		||||
blocks, is blocked by
 | 
			
		||||
duplicates, is duplicated by';
 | 
			
		||||
 | 
			
		||||
    public function initFields($extra=array())
 | 
			
		||||
    {
 | 
			
		||||
        $this->fields['labels_issue_template'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('Define an issue template to hint the reporter to provide certain information'),
 | 
			
		||||
                                            'label' => __('Define an issue template to hint to the reporter to provide certain information'),
 | 
			
		||||
                                            'initial' => self::init_template,
 | 
			
		||||
                                            'widget_attrs' => array('rows' => 7,
 | 
			
		||||
                                                                    'cols' => 75),
 | 
			
		||||
@@ -114,10 +117,19 @@ Maintainability      = Hinders future changes';
 | 
			
		||||
        $this->fields['labels_issue_one_max'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('Each issue may have at most one label with each of these classes'),
 | 
			
		||||
                                            'initial' => self::init_one_max, 
 | 
			
		||||
                                            'initial' => self::init_one_max,
 | 
			
		||||
                                            'widget_attrs' => array('size' => 60),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['issue_relations'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                            'label' => __('Issue relations'),
 | 
			
		||||
                                            'initial' => self::init_relations,
 | 
			
		||||
                                            'help_text' => __('You can define bidirectional relations like "is related to" or "blocks, is blocked by".'),
 | 
			
		||||
                                            'widget_attrs' => array('rows' => 7,
 | 
			
		||||
                                                                    'cols' => 75),
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
                                            ));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -86,7 +86,7 @@ class IDF_Form_Password extends Pluf_Form
 | 
			
		||||
                $return_url = Pluf_HTTP_URL_urlForView('IDF_Views::passwordRecoveryInputCode');
 | 
			
		||||
                $tmpl = new Pluf_Template('idf/user/passrecovery-email.txt');
 | 
			
		||||
                $cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
 | 
			
		||||
                $code = trim($cr->encrypt($user->email.':'.$user->id.':'.time()), 
 | 
			
		||||
                $code = trim($cr->encrypt($user->email.':'.$user->id.':'.time().':primary'), 
 | 
			
		||||
                             '~');
 | 
			
		||||
                $code = substr(md5(Pluf::f('secret_key').$code), 0, 2).$code;
 | 
			
		||||
                $url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views::passwordRecovery', array($code), array(), false);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										140
									
								
								src/IDF/Form/ProjectConf.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										140
									
								
								src/IDF/Form/ProjectConf.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,140 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright(C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Configuration of the project.
 | 
			
		||||
 */
 | 
			
		||||
class IDF_Form_ProjectConf extends Pluf_Form
 | 
			
		||||
{
 | 
			
		||||
    public $project = null;
 | 
			
		||||
 | 
			
		||||
    public function initFields($extra=array())
 | 
			
		||||
    {
 | 
			
		||||
        $this->project = $extra['project'];
 | 
			
		||||
 | 
			
		||||
        // Basic part
 | 
			
		||||
        $this->fields['name'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                  'label' => __('Name'),
 | 
			
		||||
                                                                  'initial' => $this->project->name,
 | 
			
		||||
                                                                 ));
 | 
			
		||||
        $this->fields['shortdesc'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                       'label' => __('Short Description'),
 | 
			
		||||
                                                                       'initial' => $this->project->shortdesc,
 | 
			
		||||
                                                                       'widget_attrs' => array('size' => '68'),
 | 
			
		||||
                                                                      ));
 | 
			
		||||
        $this->fields['description'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                         'label' => __('Description'),
 | 
			
		||||
                                                                         'initial' => $this->project->description,
 | 
			
		||||
                                                                         'widget_attrs' => array('cols' => 68,
 | 
			
		||||
                                                                                                 'rows' => 26,
 | 
			
		||||
                                                                                                ),
 | 
			
		||||
                                                                         'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
                                                                        ));
 | 
			
		||||
 | 
			
		||||
        // Logo part
 | 
			
		||||
        $upload_path = Pluf::f('upload_path', false);
 | 
			
		||||
        if (false === $upload_path) {
 | 
			
		||||
            throw new Pluf_Exception_SettingError(__('The "upload_path" configuration variable was not set.'));
 | 
			
		||||
        }
 | 
			
		||||
        $upload_path .= '/' . $this->project->shortname;
 | 
			
		||||
        $filename = '/%s';
 | 
			
		||||
        $this->fields['logo'] = new Pluf_Form_Field_File(array('required' => false,
 | 
			
		||||
                                                         'label' => __('Update the logo'),
 | 
			
		||||
                                                         'initial' => '',
 | 
			
		||||
                                                         'help_text' => __('The logo must be a picture with a size of 32 by 32.'),
 | 
			
		||||
                                                         'max_size' => Pluf::f('max_upload_size', 5 * 1024),
 | 
			
		||||
                                                         'move_function_params' =>
 | 
			
		||||
                                                         array('upload_path' => $upload_path,
 | 
			
		||||
                                                               'upload_path_create' => true,
 | 
			
		||||
                                                               'file_name' => $filename,
 | 
			
		||||
                                                               )
 | 
			
		||||
                                                         ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['logo_remove'] = new Pluf_Form_Field_Boolean(array('required' => false,
 | 
			
		||||
                                                                         'label' => __('Remove the current logo'),
 | 
			
		||||
                                                                         'initial' => false,
 | 
			
		||||
                                                                         'widget' => 'Pluf_Form_Widget_CheckboxInput',
 | 
			
		||||
                                                                         ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * If we have uploaded a file, but the form failed remove it.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    function failed()
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($this->cleaned_data['logo'])
 | 
			
		||||
            && file_exists(Pluf::f('upload_path').'/'.$this->cleaned_data['logo'])) {
 | 
			
		||||
            unlink(Pluf::f('upload_path').'/'.$this->cleaned_data['logo']);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function clean()
 | 
			
		||||
    {
 | 
			
		||||
        if (!isset($this->cleaned_data['logo_remove'])) {
 | 
			
		||||
            $this->cleaned_data['logo_remove'] = false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this->cleaned_data;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function clean_logo()
 | 
			
		||||
    {
 | 
			
		||||
        if (empty($this->cleaned_data['logo'])) {
 | 
			
		||||
            return '';
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $meta = getimagesize(Pluf::f('upload_path') . '/' . $this->project->shortname . $this->cleaned_data['logo']);
 | 
			
		||||
 | 
			
		||||
        if ($meta === false) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('Could not determine the size of the uploaded picture.'));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($meta[0] !== 32 || $meta[1] !== 32) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('The picture must have a size of 32 by 32.'));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this->cleaned_data['logo'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function save($commit=true)
 | 
			
		||||
    {
 | 
			
		||||
        $conf = $this->project->getConf();
 | 
			
		||||
 | 
			
		||||
        // Basic part
 | 
			
		||||
        $this->project->name = $this->cleaned_data['name'];
 | 
			
		||||
        $this->project->shortdesc = $this->cleaned_data['shortdesc'];
 | 
			
		||||
        $this->project->description = $this->cleaned_data['description'];
 | 
			
		||||
        $this->project->update();
 | 
			
		||||
 | 
			
		||||
        // Logo part
 | 
			
		||||
        if ($this->cleaned_data['logo'] !== "") {
 | 
			
		||||
            $conf->setVal('logo', $this->cleaned_data['logo']);
 | 
			
		||||
        }
 | 
			
		||||
        if ($this->cleaned_data['logo_remove'] === true) {
 | 
			
		||||
            @unlink(Pluf::f('upload_path') . '/' . $this->project->shortname . $conf->getVal('logo'));
 | 
			
		||||
            $conf->delVal('logo');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -42,7 +42,7 @@ class IDF_Form_Register extends Pluf_Form
 | 
			
		||||
                                            'max_length' => 15,
 | 
			
		||||
                                            'min_length' => 3,
 | 
			
		||||
                                            'initial' => $login,
 | 
			
		||||
                                            'help_text' => __('The login must be between 3 and 15 characters long and contains only letters and digits.'),
 | 
			
		||||
                                            'help_text' => __('The login must be between 3 and 15 characters long and contain only letters and digits.'),
 | 
			
		||||
                                            'widget_attrs' => array(
 | 
			
		||||
                                                       'maxlength' => 15,
 | 
			
		||||
                                                       'size' => 10,
 | 
			
		||||
@@ -52,7 +52,7 @@ class IDF_Form_Register extends Pluf_Form
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                            'label' => __('Your email'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'help_text' => __('We will never send you any unsolicited emails. We hate spams too!'),
 | 
			
		||||
                                            'help_text' => __('We will never send you any unsolicited emails. We hate spam too!'),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['terms'] = new Pluf_Form_Field_Boolean(
 | 
			
		||||
@@ -93,10 +93,8 @@ class IDF_Form_Register extends Pluf_Form
 | 
			
		||||
    function clean_email()
 | 
			
		||||
    {
 | 
			
		||||
        $this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
 | 
			
		||||
        $guser = new Pluf_User();
 | 
			
		||||
        $sql = new Pluf_SQL('email=%s', $this->cleaned_data['email']);
 | 
			
		||||
        if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used. If you need, click on the help link to recover your password.'), $this->cleaned_data['email']));
 | 
			
		||||
        if (Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']) != null) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used. If you need to, click on the help link to recover your password.'), $this->cleaned_data['email']));
 | 
			
		||||
        }
 | 
			
		||||
        return $this->cleaned_data['email'];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -69,7 +69,7 @@ class IDF_Form_RegisterConfirmation extends Pluf_Form
 | 
			
		||||
                                            'label' => __('Your password'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_PasswordInput',
 | 
			
		||||
                                            'help_text' => __('Your password must be hard for other people to find it, but easy for you to remember.'),
 | 
			
		||||
                                            'help_text' => __('Your password must be hard for other people to guess, but easy for you to remember.'),
 | 
			
		||||
                                            'widget_attrs' => array(
 | 
			
		||||
                                                       'maxlength' => 50,
 | 
			
		||||
                                                       'size' => 15,
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -52,7 +52,7 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
 | 
			
		||||
                                            ));
 | 
			
		||||
        }
 | 
			
		||||
        $this->fields['content'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('General comment'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
@@ -64,6 +64,8 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
 | 
			
		||||
        if ($this->user->hasPerm('IDF.project-owner', $this->project)
 | 
			
		||||
            or $this->user->hasPerm('IDF.project-member', $this->project)) {
 | 
			
		||||
            $this->show_full = true;
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->show_full = false;
 | 
			
		||||
        }
 | 
			
		||||
        if ($this->show_full) {
 | 
			
		||||
            $this->fields['summary'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
@@ -94,24 +96,40 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
 | 
			
		||||
     */
 | 
			
		||||
    public function clean()
 | 
			
		||||
    {
 | 
			
		||||
        foreach ($this->files as $filename => $def) {
 | 
			
		||||
            if (!empty($this->cleaned_data[md5($filename)])) {
 | 
			
		||||
                return $this->cleaned_data;
 | 
			
		||||
        $isOk = false;
 | 
			
		||||
        
 | 
			
		||||
        foreach($this->files as $filename => $def) {
 | 
			
		||||
            $this->cleaned_data[md5($filename)] = trim($this->cleaned_data[md5($filename)]);
 | 
			
		||||
            if(!empty($this->cleaned_data[md5($filename)])) {
 | 
			
		||||
                $isOk = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        throw new Pluf_Form_Invalid(__('You need to provide comments on at least one file.'));
 | 
			
		||||
        
 | 
			
		||||
        if(!empty($this->cleaned_data['content'])) {
 | 
			
		||||
            $isOk = true;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if (!$isOk) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal, or comments on at least one file.'));
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        return $this->cleaned_data;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_content()
 | 
			
		||||
    {
 | 
			
		||||
        $content = trim($this->cleaned_data['content']);
 | 
			
		||||
        if (!$this->show_full and strlen($content) == 0) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal.'));
 | 
			
		||||
        if(empty($content)) {
 | 
			
		||||
            if ($this->fields['status']->initial != $this->fields['status']->value) {
 | 
			
		||||
                return __('The status have been updated.');
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            return $content;
 | 
			
		||||
        }
 | 
			
		||||
        return $content;
 | 
			
		||||
        
 | 
			
		||||
        throw new Pluf_Form_Invalid(__('This field is required.'));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Save the model in the database.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -83,7 +83,7 @@ class IDF_Form_Upload extends Pluf_Form
 | 
			
		||||
        if (strlen($extra)) $extra .= '|';
 | 
			
		||||
        if (!preg_match('/\.('.$extra.'png|jpg|jpeg|gif|bmp|psd|tif|aiff|asf|avi|bz2|css|doc|eps|gz|jar|mdtext|mid|mov|mp3|mpg|ogg|pdf|ppt|ps|qt|ra|ram|rm|rtf|sdd|sdw|sit|sxi|sxw|swf|tgz|txt|wav|xls|xml|war|wmv|zip)$/i', $this->cleaned_data['file'])) {
 | 
			
		||||
            @unlink(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']);
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('For security reason, you cannot upload a file with this extension.'));
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('For security reasons, you cannot upload a file with this extension.'));
 | 
			
		||||
        }
 | 
			
		||||
        return $this->cleaned_data['file'];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -79,6 +79,7 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_PasswordInput',
 | 
			
		||||
                                            'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change your password.').'<br />'.__('Your password must be hard for other people to find it, but easy for you to remember.')),
 | 
			
		||||
                                            'widget_attrs' => array(
 | 
			
		||||
                                                       'autocomplete' => 'off',
 | 
			
		||||
                                                       'maxlength' => 50,
 | 
			
		||||
                                                       'size' => 15,
 | 
			
		||||
                                                                    ),
 | 
			
		||||
@@ -89,6 +90,7 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_PasswordInput',
 | 
			
		||||
                                            'widget_attrs' => array(
 | 
			
		||||
                                                       'autocomplete' => 'off',
 | 
			
		||||
                                                       'maxlength' => 50,
 | 
			
		||||
                                                       'size' => 15,
 | 
			
		||||
                                                                    ),
 | 
			
		||||
@@ -161,8 +163,44 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
                                            'widget_attrs' => array('rows' => 3,
 | 
			
		||||
                                                                    'cols' => 40),
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
                                            'help_text' => __('Paste a SSH or monotone public key. Be careful to not provide your private key here!')
 | 
			
		||||
                                            'help_text' => __('Paste an SSH or monotone public key. Be careful to not provide your private key here!')
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['secondary_mail'] = new Pluf_Form_Field_Email(
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('Add a secondary mail address'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'help_text' => __('You will get a mail to confirm that you own the address you specify.'),
 | 
			
		||||
                                            ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function send_validation_mail($new_email, $secondary_mail=false)
 | 
			
		||||
    {
 | 
			
		||||
        if ($secondary_mail) {
 | 
			
		||||
            $type = "secondary";
 | 
			
		||||
        } else {
 | 
			
		||||
            $type = "primary";
 | 
			
		||||
        }
 | 
			
		||||
        $cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
 | 
			
		||||
        $encrypted = trim($cr->encrypt($new_email.':'.$this->user->id.':'.time().':'.$type), '~');
 | 
			
		||||
        $key = substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
 | 
			
		||||
        $url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailDo', array($key), array(), false);
 | 
			
		||||
        $urlik = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailInputKey', array(), array(), false);
 | 
			
		||||
        $context = new Pluf_Template_Context(
 | 
			
		||||
             array('key' => Pluf_Template::markSafe($key),
 | 
			
		||||
                   'url' => Pluf_Template::markSafe($url),
 | 
			
		||||
                   'urlik' => Pluf_Template::markSafe($urlik),
 | 
			
		||||
                   'email' => $new_email,
 | 
			
		||||
                   'user'=> $this->user,
 | 
			
		||||
                   )
 | 
			
		||||
        );
 | 
			
		||||
        $tmpl = new Pluf_Template('idf/user/changeemail-email.txt');
 | 
			
		||||
        $text_email = $tmpl->render($context);
 | 
			
		||||
        $email = new Pluf_Mail(Pluf::f('from_email'), $new_email,
 | 
			
		||||
                               __('Confirm your new email address.'));
 | 
			
		||||
        $email->addTextMessage($text_email);
 | 
			
		||||
        $email->sendMail();
 | 
			
		||||
        $this->user->setMessage(sprintf(__('A validation email has been sent to "%s" to validate the email address change.'), Pluf_esc($new_email)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -188,26 +226,7 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
        $new_email = $this->cleaned_data['email'];
 | 
			
		||||
        unset($this->cleaned_data['email']);
 | 
			
		||||
        if ($old_email != $new_email) {
 | 
			
		||||
            $cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
 | 
			
		||||
            $encrypted = trim($cr->encrypt($new_email.':'.$this->user->id.':'.time()), '~');
 | 
			
		||||
            $key = substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
 | 
			
		||||
            $url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailDo', array($key), array(), false);
 | 
			
		||||
            $urlik = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailInputKey', array(), array(), false);
 | 
			
		||||
            $context = new Pluf_Template_Context(
 | 
			
		||||
                 array('key' => Pluf_Template::markSafe($key),
 | 
			
		||||
                       'url' => Pluf_Template::markSafe($url),
 | 
			
		||||
                       'urlik' => Pluf_Template::markSafe($urlik),
 | 
			
		||||
                       'email' => $new_email,
 | 
			
		||||
                       'user'=> $this->user,
 | 
			
		||||
                       )
 | 
			
		||||
            );
 | 
			
		||||
            $tmpl = new Pluf_Template('idf/user/changeemail-email.txt');
 | 
			
		||||
            $text_email = $tmpl->render($context);
 | 
			
		||||
            $email = new Pluf_Mail(Pluf::f('from_email'), $new_email,
 | 
			
		||||
                                   __('Confirm your new email address.'));
 | 
			
		||||
            $email->addTextMessage($text_email);
 | 
			
		||||
            $email->sendMail();
 | 
			
		||||
            $this->user->setMessage(sprintf(__('A validation email has been sent to "%s" to validate the email address change.'), Pluf_esc($new_email)));
 | 
			
		||||
            $this->send_validation_mail($new_email);
 | 
			
		||||
        }
 | 
			
		||||
        $this->user->setFromFormData($this->cleaned_data);
 | 
			
		||||
        // Add key as needed.
 | 
			
		||||
@@ -219,6 +238,9 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
                $key->create();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if ('' !== $this->cleaned_data['secondary_mail']) {
 | 
			
		||||
            $this->send_validation_mail($this->cleaned_data['secondary_mail'], true);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($commit) {
 | 
			
		||||
            $this->user->update();
 | 
			
		||||
@@ -337,7 +359,7 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            throw new Pluf_Form_Invalid(
 | 
			
		||||
                __('Public key looks neither like a SSH '.
 | 
			
		||||
                __('Public key looks like neither an SSH '.
 | 
			
		||||
                   'nor monotone public key.'));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -393,15 +415,22 @@ class IDF_Form_UserAccount  extends Pluf_Form
 | 
			
		||||
    function clean_email()
 | 
			
		||||
    {
 | 
			
		||||
        $this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
 | 
			
		||||
        $guser = new Pluf_User();
 | 
			
		||||
        $sql = new Pluf_SQL('email=%s AND id!=%s',
 | 
			
		||||
                            array($this->cleaned_data['email'], $this->user->id));
 | 
			
		||||
        if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
 | 
			
		||||
        $user = Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']);
 | 
			
		||||
        if ($user != null and $user->id != $this->user->id) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used.'), $this->cleaned_data['email']));
 | 
			
		||||
        }
 | 
			
		||||
        return $this->cleaned_data['email'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_secondary_mail()
 | 
			
		||||
    {
 | 
			
		||||
        $this->cleaned_data['secondary_mail'] = mb_strtolower(trim($this->cleaned_data['secondary_mail']));
 | 
			
		||||
        if (Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['secondary_mail']) != null) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used.'), $this->cleaned_data['secondary_mail']));
 | 
			
		||||
        }
 | 
			
		||||
        return $this->cleaned_data['secondary_mail'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_public_key()
 | 
			
		||||
    {
 | 
			
		||||
        $this->cleaned_data['public_key'] =
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -53,7 +53,7 @@ class IDF_Form_UserChangeEmail extends Pluf_Form
 | 
			
		||||
     * Throw a Pluf_Form_Invalid exception if the key is not valid.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string Key
 | 
			
		||||
     * @return array array($new_email, $user_id, time())
 | 
			
		||||
     * @return array array($new_email, $user_id, time(), [primary|secondary])
 | 
			
		||||
     */
 | 
			
		||||
    public static function validateKey($key)
 | 
			
		||||
    {
 | 
			
		||||
@@ -63,7 +63,7 @@ class IDF_Form_UserChangeEmail extends Pluf_Form
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('The validation key is not valid. Please copy/paste it from your confirmation email.'));
 | 
			
		||||
        }
 | 
			
		||||
        $cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
 | 
			
		||||
        return explode(':', $cr->decrypt($encrypted), 3);
 | 
			
		||||
        return explode(':', $cr->decrypt($encrypted), 4);
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -80,7 +80,10 @@ class IDF_Key extends Pluf_Model
 | 
			
		||||
        if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) {
 | 
			
		||||
            return array('mtn', $m[1], $m[2]);
 | 
			
		||||
        }
 | 
			
		||||
        else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) {
 | 
			
		||||
        else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S*))?$#', $this->content, $m)) {
 | 
			
		||||
            if (!isset($m[2])) {
 | 
			
		||||
                $m[2] = "";
 | 
			
		||||
            }
 | 
			
		||||
            return array('ssh', $m[2], $m[1]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -87,6 +87,7 @@ class IDF_Middleware
 | 
			
		||||
                              'markdown' => 'IDF_Template_Markdown',
 | 
			
		||||
                              'showuser' => 'IDF_Template_ShowUser',
 | 
			
		||||
                              'ashowuser' => 'IDF_Template_AssignShowUser',
 | 
			
		||||
                              'appversion' => 'IDF_Template_AppVersion',
 | 
			
		||||
                                            ));
 | 
			
		||||
        $params['modifiers'] = array_merge($params['modifiers'],
 | 
			
		||||
                                           array(
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								src/IDF/Migrations/16AddUserMail.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								src/IDF/Migrations/16AddUserMail.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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.
 | 
			
		||||
#
 | 
			
		||||
# InDefero 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Add the new IDF_Gconf model.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function IDF_Migrations_16AddUserMail_up($params=null)
 | 
			
		||||
{
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
    $schema->model = new IDF_EmailAddress();
 | 
			
		||||
    $schema->createTables();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function IDF_Migrations_16AddUserMail_down($params=null)
 | 
			
		||||
{
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
    $schema->model = new IDF_EmailAddress();
 | 
			
		||||
    $schema->dropTables();
 | 
			
		||||
}
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -53,6 +53,7 @@ function IDF_Migrations_Backup_run($folder, $name=null)
 | 
			
		||||
                    'IDF_Scm_Cache_Git',
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    // Now, for each table, we dump the content in json, this is a
 | 
			
		||||
@@ -98,6 +99,7 @@ function IDF_Migrations_Backup_restore($folder, $name)
 | 
			
		||||
                    'IDF_Scm_Cache_Git',
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
@@ -110,4 +112,4 @@ function IDF_Migrations_Backup_restore($folder, $name)
 | 
			
		||||
        Pluf_Test_Fixture::load($data, false);
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -50,6 +50,7 @@ function IDF_Migrations_Install_setup($params=null)
 | 
			
		||||
                    'IDF_Scm_Cache_Git',
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
@@ -107,6 +108,7 @@ function IDF_Migrations_Install_teardown($params=null)
 | 
			
		||||
                    'IDF_Tag',
 | 
			
		||||
                    'IDF_Commit',
 | 
			
		||||
                    'IDF_Project',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
@@ -114,4 +116,4 @@ function IDF_Migrations_Install_teardown($params=null)
 | 
			
		||||
        $schema->model = new $model();
 | 
			
		||||
        $schema->dropTables();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2010 Thomas Keller <me@thomaskeller.biz>
 | 
			
		||||
--                    Richard Levitte <richard@levitte.org>
 | 
			
		||||
--
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
--
 | 
			
		||||
-- InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
-- it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
--
 | 
			
		||||
-- InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
-- it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -190,7 +190,12 @@ class IDF_Precondition
 | 
			
		||||
            return true; // Again need authentication error
 | 
			
		||||
        }
 | 
			
		||||
        $request->user = $users[0];
 | 
			
		||||
        IDF_Middleware::setRights($request);
 | 
			
		||||
        
 | 
			
		||||
        // Don't try to load projects rights access if we are not in one
 | 
			
		||||
        if ($request->query !== "/api/") {
 | 
			
		||||
            IDF_Middleware::setRights($request);
 | 
			
		||||
        }
 | 
			
		||||
            
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -256,4 +261,4 @@ class IDF_Precondition
 | 
			
		||||
        $encrypted = trim($cr->encrypt($user->id.':'.$project->id), '~');
 | 
			
		||||
        return substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -233,6 +233,22 @@ class IDF_Project extends Pluf_Model
 | 
			
		||||
        return $tags;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a list of relations which are available in this project
 | 
			
		||||
     *
 | 
			
		||||
     * @return array List of relation names
 | 
			
		||||
     */
 | 
			
		||||
    public function getRelationsFromConfig()
 | 
			
		||||
    {
 | 
			
		||||
        $conf = $this->getConf();
 | 
			
		||||
        $rel = $conf->getVal('issue_relations', IDF_Form_IssueTrackingConf::init_relations);
 | 
			
		||||
        $relations = array();
 | 
			
		||||
        foreach (preg_split("/\015\012|\015|\012/", $rel, -1, PREG_SPLIT_NO_EMPTY) as $s) {
 | 
			
		||||
            $relations = array_merge($relations, preg_split("/\s*,\s*/", $s, 2));
 | 
			
		||||
        }
 | 
			
		||||
        return $relations;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Return membership data.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -473,5 +473,14 @@ class IDF_Scm
 | 
			
		||||
    {
 | 
			
		||||
        return str_replace('%2F', '/', rawurlencode($path));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns the number of slashes and preceeding path components
 | 
			
		||||
     * that should be stripped from paths in the SCM's diff output
 | 
			
		||||
     */
 | 
			
		||||
    public function getDiffPathStripLevel()
 | 
			
		||||
    {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -41,6 +41,60 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
        $this->project = $project;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @see IDF_Scm::getChanges()
 | 
			
		||||
     *
 | 
			
		||||
     * Git command output is like :
 | 
			
		||||
     * M       doc/Guide utilisateur/Manuel_distrib.tex
 | 
			
		||||
     * M       doc/Guide utilisateur/Manuel_intro.tex
 | 
			
		||||
     * M       doc/Guide utilisateur/Manuel_libpegase_exemples.tex
 | 
			
		||||
     * M       doc/Guide utilisateur/Manuel_page1_version.tex
 | 
			
		||||
     * A       doc/Guide utilisateur/images/ftp-nautilus.png
 | 
			
		||||
     * M       doc/Guide utilisateur/textes/log_boot_PEGASE.txt
 | 
			
		||||
     *
 | 
			
		||||
     * Status letters mean : Added (A), Deleted (D), Modified (M), Renamed (R)
 | 
			
		||||
     */
 | 
			
		||||
    public function getChanges($commit)
 | 
			
		||||
    {
 | 
			
		||||
        $cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show %s --name-status --pretty="format:" --diff-filter="[A|D|M|R]" -M',
 | 
			
		||||
                   escapeshellarg($this->repo),
 | 
			
		||||
                   escapeshellarg($commit));
 | 
			
		||||
        $out = array();
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
 | 
			
		||||
        self::exec('IDF_Scm_Git::getChanges', $cmd, $out);
 | 
			
		||||
 | 
			
		||||
        $return = (object) array(
 | 
			
		||||
            'additions'  => array(),
 | 
			
		||||
            'deletions'  => array(),
 | 
			
		||||
            'renames'    => array(),
 | 
			
		||||
            'patches'    => array(),
 | 
			
		||||
            'properties' => array(),
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        foreach ($out as $line) {
 | 
			
		||||
            $line = trim($line);
 | 
			
		||||
            if ($line != '') {
 | 
			
		||||
                $action = $line[0];
 | 
			
		||||
 | 
			
		||||
                if ($action == 'A') {
 | 
			
		||||
                    $filename = trim(substr($line, 1));
 | 
			
		||||
                    $return->additions[] = $filename;
 | 
			
		||||
                } else if ($action == 'D') {
 | 
			
		||||
                    $filename = trim(substr($line, 1));
 | 
			
		||||
                    $return->deletions[] = $filename;
 | 
			
		||||
                } else if ($action == 'M') {
 | 
			
		||||
                    $filename = trim(substr($line, 1));
 | 
			
		||||
                    $return->patches[] = $filename;
 | 
			
		||||
                } else if ($action == 'R') {
 | 
			
		||||
                    $matches = split ("\t", $line);
 | 
			
		||||
                    $return->renames[$matches[1]] = $matches[2];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getRepositorySize()
 | 
			
		||||
    {
 | 
			
		||||
        if (!file_exists($this->repo)) {
 | 
			
		||||
@@ -113,7 +167,29 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
     */
 | 
			
		||||
    public function inBranches($commit, $path)
 | 
			
		||||
    {
 | 
			
		||||
        return $this->_inObject($commit, 'branch');
 | 
			
		||||
        if (isset($this->cache['inBranches'][$commit])) {
 | 
			
		||||
            return $this->cache['inBranches'][$commit];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '')
 | 
			
		||||
            .sprintf('GIT_DIR=%s %s branch --contains %s',
 | 
			
		||||
                     escapeshellarg($this->repo),
 | 
			
		||||
                     Pluf::f('git_path', 'git'),
 | 
			
		||||
                     escapeshellarg($commit));
 | 
			
		||||
        self::exec('IDF_Scm_Git::inBranches', $cmd, $out, $return);
 | 
			
		||||
        if (0 != $return) {
 | 
			
		||||
            throw new IDF_Scm_Exception(sprintf($this->error_tpl,
 | 
			
		||||
                                                $cmd, $return,
 | 
			
		||||
                                                implode("\n", $out)));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $res = array();
 | 
			
		||||
        foreach ($out as $line) {
 | 
			
		||||
            $res[] = substr($line, 2);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->cache['inBranches'][$commit] = $res;
 | 
			
		||||
        return $res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -162,35 +238,36 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
     **/
 | 
			
		||||
    public function inTags($commit, $path)
 | 
			
		||||
    {
 | 
			
		||||
        return $this->_inObject($commit, 'tag');
 | 
			
		||||
    }
 | 
			
		||||
        if (isset($this->cache['inTags'][$commit])) {
 | 
			
		||||
            return $this->cache['inTags'][$commit];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns in which branches or tags a commit is.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string Commit
 | 
			
		||||
     * @param string Object's type: 'branch' or 'tag'.
 | 
			
		||||
     * @return array
 | 
			
		||||
     */
 | 
			
		||||
    private function _inObject($commit, $object)
 | 
			
		||||
    {
 | 
			
		||||
        $object = strtolower($object);
 | 
			
		||||
        if ('branch' === $object) {
 | 
			
		||||
            $objects = $this->getBranches();
 | 
			
		||||
        } else if ('tag' === $object) {
 | 
			
		||||
            $objects = $this->getTags();
 | 
			
		||||
        } else {
 | 
			
		||||
            throw new InvalidArgumentException(sprintf(__('Invalid value for the parameter %1$s: %2$s. Use %3$s.'),
 | 
			
		||||
                                                       '$object',
 | 
			
		||||
                                                       $object,
 | 
			
		||||
                                                       '\'branch\' or \'tag\''));
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '')
 | 
			
		||||
            .sprintf('GIT_DIR=%s %s tag --contains %s',
 | 
			
		||||
                     escapeshellarg($this->repo),
 | 
			
		||||
                     Pluf::f('git_path', 'git'),
 | 
			
		||||
                     escapeshellarg($commit));
 | 
			
		||||
        self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return);
 | 
			
		||||
        // `git tag` gained the `--contains` option in 1.6.2, earlier
 | 
			
		||||
        // versions report a bad usage error (129) which we ignore here
 | 
			
		||||
        if (129 == $return) {
 | 
			
		||||
            $this->cache['inTags'][$commit] = array();
 | 
			
		||||
            return array();
 | 
			
		||||
        }
 | 
			
		||||
        unset($object);
 | 
			
		||||
        $result = array();
 | 
			
		||||
        if (array_key_exists($commit, $objects)) {
 | 
			
		||||
            $result[] = $commit;
 | 
			
		||||
        // any other error should of course get noted
 | 
			
		||||
        if (0 != $return) {
 | 
			
		||||
            throw new IDF_Scm_Exception(sprintf($this->error_tpl,
 | 
			
		||||
                                                $cmd, $return,
 | 
			
		||||
                                                implode("\n", $out)));
 | 
			
		||||
        }
 | 
			
		||||
        return $result;
 | 
			
		||||
 | 
			
		||||
        $res = array();
 | 
			
		||||
        foreach ($out as $line) {
 | 
			
		||||
            $res[] = $line;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->cache['inTags'][$commit] = $res;
 | 
			
		||||
        return $res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -271,14 +348,12 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
        if (!preg_match('/<(.*)>/', $author, $match)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        foreach (array('email', 'login') as $what) {
 | 
			
		||||
            $sql = new Pluf_SQL($what.'=%s', array($match[1]));
 | 
			
		||||
            $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
 | 
			
		||||
            if ($users->count() > 0) {
 | 
			
		||||
                return $users[0];
 | 
			
		||||
            }
 | 
			
		||||
        $sql = new Pluf_SQL('login=%s', array($match[1]));
 | 
			
		||||
        $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
 | 
			
		||||
        if ($users->count() > 0) {
 | 
			
		||||
            return $users[0];
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
        return Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($match[1]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function getAnonymousAccessUrl($project, $commit=null)
 | 
			
		||||
@@ -294,8 +369,8 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
            $keys = $user->get_idf_key_list();
 | 
			
		||||
            if (count ($keys) == 0)
 | 
			
		||||
                return self::getAnonymousAccessUrl($project);
 | 
			
		||||
        } 
 | 
			
		||||
        
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return sprintf(Pluf::f('git_write_remote_url'), $project->shortname);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -453,7 +528,7 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
            $out[0]->diff = '';
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $out[0]->branch = implode(', ', $this->inBranches($commit, null));
 | 
			
		||||
        $out[0]->branch = implode(', ', $this->inBranches($out[0]->commit, null));
 | 
			
		||||
        return $out[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -581,6 +656,14 @@ class IDF_Scm_Git extends IDF_Scm
 | 
			
		||||
        return new Pluf_HTTP_Response_CommandPassThru($cmd, 'application/x-zip');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @see IDF_Scm::getDiffPathStripLevel()
 | 
			
		||||
     */
 | 
			
		||||
    public function getDiffPathStripLevel()
 | 
			
		||||
    {
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * =====================================================
 | 
			
		||||
     *             Specific Git Commands
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -27,10 +27,13 @@
 | 
			
		||||
 */
 | 
			
		||||
class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
{
 | 
			
		||||
    protected $hg_log_template;
 | 
			
		||||
 | 
			
		||||
    public function __construct($repo, $project=null)
 | 
			
		||||
    {
 | 
			
		||||
        $this->repo = $repo;
 | 
			
		||||
        $this->project = $project;
 | 
			
		||||
        $this->hg_log_template = "'".'changeset: {rev}:{node|short}\nauthor: {author}\ndate: {date|isodate}\nfiles: {files}\n{desc}\n'."'";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getRepositorySize()
 | 
			
		||||
@@ -67,9 +70,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
        if (!preg_match('/<(.*)>/', $author, $match)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        $sql = new Pluf_SQL('email=%s', array($match[1]));
 | 
			
		||||
        $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
 | 
			
		||||
        return ($users->count() > 0) ? $users[0] : null;
 | 
			
		||||
        return Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($match[1]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getMainBranch()
 | 
			
		||||
@@ -93,7 +94,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
                       escapeshellarg($this->repo),
 | 
			
		||||
                       escapeshellarg($rev));
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
 | 
			
		||||
        self::exec('IDF_Scm_Mercurial::isValidRevision', $cmd, $out, $ret);
 | 
			
		||||
        self::exec('IDF_Scm_Mercurial::validateRevision', $cmd, $out, $ret);
 | 
			
		||||
 | 
			
		||||
        // FIXME: apparently a given hg revision can also be ambigious -
 | 
			
		||||
        //        handle this case here sometime
 | 
			
		||||
@@ -335,13 +336,17 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
     */
 | 
			
		||||
    public function getCommit($commit, $getdiff=false)
 | 
			
		||||
    {
 | 
			
		||||
        if (!$this->isValidRevision($commit)) {
 | 
			
		||||
        if ($this->validateRevision($commit) != IDF_Scm::REVISION_VALID) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        $tmpl = ($getdiff) ?
 | 
			
		||||
            Pluf::f('hg_path', 'hg').' log -p -r %s -R %s' : Pluf::f('hg_path', 'hg').' log -r %s -R %s';
 | 
			
		||||
        $tmpl = ($getdiff)
 | 
			
		||||
            ? Pluf::f('hg_path', 'hg').' log -p -r %s -R %s --template %s'
 | 
			
		||||
            : Pluf::f('hg_path', 'hg').' log -r %s -R %s --template %s';
 | 
			
		||||
        $cmd = sprintf($tmpl,
 | 
			
		||||
                       escapeshellarg($commit), escapeshellarg($this->repo));
 | 
			
		||||
                       escapeshellarg($commit),
 | 
			
		||||
                       escapeshellarg($this->repo),
 | 
			
		||||
                       $this->hg_log_template);
 | 
			
		||||
 | 
			
		||||
        $out = array();
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
 | 
			
		||||
        self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
 | 
			
		||||
@@ -358,7 +363,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
                $log[] = $line;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        $out = self::parseLog($log, 6);
 | 
			
		||||
        $out = self::parseLog($log, 4);
 | 
			
		||||
        $out[0]->diff = implode("\n", $change);
 | 
			
		||||
        return $out[0];
 | 
			
		||||
    }
 | 
			
		||||
@@ -383,11 +388,11 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
     */
 | 
			
		||||
    public function getChangeLog($commit='tip', $n=10)
 | 
			
		||||
    {
 | 
			
		||||
        $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
 | 
			
		||||
        $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s --template %s', escapeshellarg($this->repo), $n, $this->hg_log_template, $commit);
 | 
			
		||||
        $out = array();
 | 
			
		||||
        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
 | 
			
		||||
        self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out);
 | 
			
		||||
        return self::parseLog($out, 6);
 | 
			
		||||
        return self::parseLog($out, 4);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -423,7 +428,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            $match = array();
 | 
			
		||||
            if (preg_match('/(\S+)\s*:\s*(.*)/', $line, $match)) {
 | 
			
		||||
            if (preg_match('/^(\S+):\s*(.*)/', $line, $match)) {
 | 
			
		||||
                $match[1] = strtolower($match[1]);
 | 
			
		||||
                if ($match[1] == 'user') {
 | 
			
		||||
                    $c['author'] = $match[2];
 | 
			
		||||
@@ -458,7 +463,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
     * @param string Prefix ('git-repo-dump')
 | 
			
		||||
     * @return Pluf_HTTP_Response The HTTP response containing the zip archive
 | 
			
		||||
     */
 | 
			
		||||
    protected function getArchiveStream($commit, $prefix='')
 | 
			
		||||
    public function getArchiveStream($commit, $prefix='')
 | 
			
		||||
    {
 | 
			
		||||
        $cmd = sprintf(Pluf::f('idf_exec_cmd_prefix', '').
 | 
			
		||||
                       Pluf::f('hg_path', 'hg').' archive --type=zip -R %s -r %s -',
 | 
			
		||||
@@ -466,4 +471,12 @@ class IDF_Scm_Mercurial extends IDF_Scm
 | 
			
		||||
                       escapeshellarg($commit));
 | 
			
		||||
        return new Pluf_HTTP_Response_CommandPassThru($cmd, 'application/x-zip');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @see IDF_Scm::getDiffPathStripLevel()
 | 
			
		||||
     */
 | 
			
		||||
    public function getDiffPathStripLevel()
 | 
			
		||||
    {
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user