Commit bf128b69 authored by Hermann Mayer's avatar Hermann Mayer

Added EWZRecaptchaBundle. Contact Service now uses the captcha fieldType to protect us from spam.

parent add4ecfc
......@@ -5,6 +5,7 @@
/vendor/
/app/config/parameters.yml
/app/config/oauth.yml
/app/config/recaptcha.yml
/.settings/
/.buildpath
......
......@@ -27,6 +27,7 @@ class AppKernel extends Kernel
new JMS\SerializerBundle\JMSSerializerBundle(),
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
new SunCat\MobileDetectBundle\MobileDetectBundle(),
new EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
......
......@@ -3,6 +3,7 @@ imports:
- { resource: security.yml }
- { resource: jity.yml }
- { resource: oauth.yml }
- { resource: recaptcha.yml }
framework:
#esi: ~
......
hwi_oauth:
resource_owners:
any_name:
google:
type: google
client_id:
client_secret:
client_id: "19729315507.apps.googleusercontent.com"
client_secret: "Z3DxaRjiIRw23Bnb54dAGLHw"
scope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
# name of the firewall the oauth bundle is active in
firewall_name: secured_area
firewall_name: oauth_area
connect: ~
ewz_recaptcha:
public_key: here_is_your_public_key
private_key: here_is_your_private_key
secure: false
locale_key: kernel.default_locale
No preview for this file type
......@@ -35,7 +35,8 @@
"stof/doctrine-extensions-bundle": "dev-master",
"xi/breadcrumbs-bundle": "dev-master",
"hwi/oauth-bundle": "dev-master",
"suncat/mobile-detect-bundle": "dev-master"
"suncat/mobile-detect-bundle": "dev-master",
"excelwebzone/recaptcha-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
......
{
"hash": "978aa6d74d17a0f828a095bfc79e3a31",
"hash": "429b6a3d3411cf9ad33039db7b3519b7",
"packages": [
{
"name": "dflydev/markdown",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/dflydev/dflydev-markdown.git",
"reference": "v1.0.2"
},
"dist": {
"type": "zip",
"url": "https://github.com/dflydev/dflydev-markdown/zipball/v1.0.2",
"reference": "v1.0.2",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"time": "2012-01-15 19:36:37",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"dflydev\\markdown": "src"
}
},
"license": [
"New BSD License"
],
"authors": [
{
"name": "Dragonfly Development Inc.",
"email": "info@dflydev.com",
"homepage": "http://dflydev.com"
},
{
"name": "Beau Simensen",
"email": "beau@dflydev.com",
"homepage": "http://beausimensen.com"
},
{
"name": "Michel Fortin",
"homepage": "http://michelf.com"
},
{
"name": "John Gruber",
"homepage": "http://daringfireball.net"
}
],
"description": "PHP Markdown & Extra",
"homepage": "http://github.com/dflydev/dflydev-markdown",
"keywords": [
"markdown"
]
},
{
"name": "doctrine/common",
"version": "2.3.0",
......@@ -362,6 +416,48 @@
"orm"
]
},
{
"name": "excelwebzone/recaptcha-bundle",
"version": "dev-master",
"target-dir": "EWZ/Bundle/RecaptchaBundle",
"source": {
"type": "git",
"url": "https://github.com/excelwebzone/EWZRecaptchaBundle",
"reference": "d8398bf9b48c0286be4fb8b2f0f7bc19885c7432"
},
"dist": {
"type": "zip",
"url": "https://github.com/excelwebzone/EWZRecaptchaBundle/zipball/d8398bf9b48c0286be4fb8b2f0f7bc19885c7432",
"reference": "d8398bf9b48c0286be4fb8b2f0f7bc19885c7432",
"shasum": ""
},
"require": {
"symfony/framework-bundle": "2.*"
},
"time": "1347928594",
"type": "symfony-bundle",
"installation-source": "source",
"autoload": {
"psr-0": {
"EWZ\\Bundle\\RecaptchaBundle": ""
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Michael H. Arieli",
"email": "excelwebzone@gmail.com",
"homepage": "http://excelwebzone.com/"
}
],
"description": "This bundle provides easy reCAPTCHA form field integration",
"homepage": "https://github.com/excelwebzone/EWZRecaptchaBundle",
"keywords": [
"recaptcha"
]
},
{
"name": "gedmo/doctrine-extensions",
"version": "v2.3.2",
......@@ -760,12 +856,12 @@
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSSerializerBundle.git",
"reference": "356c35d3c70084486e112327e34e3e747d8931aa"
"reference": "83521b0f49538bd6445394e1d77b65520beb5d3d"
},
"dist": {
"type": "zip",
"url": "https://github.com/schmittjoh/JMSSerializerBundle/zipball/356c35d3c70084486e112327e34e3e747d8931aa",
"reference": "356c35d3c70084486e112327e34e3e747d8931aa",
"url": "https://github.com/schmittjoh/JMSSerializerBundle/zipball/83521b0f49538bd6445394e1d77b65520beb5d3d",
"reference": "83521b0f49538bd6445394e1d77b65520beb5d3d",
"shasum": ""
},
"require": {
......@@ -788,7 +884,7 @@
"suggest": {
"symfony/framework-bundle": "2.*"
},
"time": "1350122690",
"time": "1350639143",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
......@@ -829,24 +925,30 @@
"source": {
"type": "git",
"url": "https://github.com/KnpLabs/KnpMarkdownBundle",
"reference": "d3350c1da06fa7e3ecdc68dec3cb83b72499152b"
"reference": "1a31848de5aad77b32d2b152bdce51cfbc9edcca"
},
"dist": {
"type": "zip",
"url": "https://github.com/KnpLabs/KnpMarkdownBundle/zipball/d3350c1da06fa7e3ecdc68dec3cb83b72499152b",
"reference": "d3350c1da06fa7e3ecdc68dec3cb83b72499152b",
"url": "https://github.com/KnpLabs/KnpMarkdownBundle/zipball/1a31848de5aad77b32d2b152bdce51cfbc9edcca",
"reference": "1a31848de5aad77b32d2b152bdce51cfbc9edcca",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/framework-bundle": ">=2.0,<2.3-dev"
"symfony/framework-bundle": ">=2.0,<2.3-dev",
"dflydev/markdown": "1.0.*@dev"
},
"suggest": {
"symfony/twig-bundle": "to use the Twig markdown filter",
"ext-sundown": "to use optional support for php-sundown extension instead of php implementation"
},
"time": "1350137709",
"time": "1350500955",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
......@@ -1184,24 +1286,24 @@
"source": {
"type": "git",
"url": "https://github.com/stof/StofDoctrineExtensionsBundle",
"reference": "773b37310ca244570032541be3c8ab27b814a83f"
"reference": "41d9399e56868f82f871723a1842b5f2053e2e24"
},
"dist": {
"type": "zip",
"url": "https://github.com/stof/StofDoctrineExtensionsBundle/zipball/773b37310ca244570032541be3c8ab27b814a83f",
"reference": "773b37310ca244570032541be3c8ab27b814a83f",
"url": "https://github.com/stof/StofDoctrineExtensionsBundle/zipball/41d9399e56868f82f871723a1842b5f2053e2e24",
"reference": "41d9399e56868f82f871723a1842b5f2053e2e24",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": "2.1.*",
"gedmo/doctrine-extensions": ">=2.3-dev"
"symfony/framework-bundle": ">=2.1,<2.3-dev",
"gedmo/doctrine-extensions": "2.3.*"
},
"suggest": {
"doctrine/doctrine-bundle": "*",
"doctrine/mongodb-odm-bundle": "2.1.*"
},
"time": "1349111035",
"time": "1350324852",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
......@@ -1701,22 +1803,22 @@
},
{
"name": "twig/twig",
"version": "v1.10.0",
"version": "v1.10.3",
"source": {
"type": "git",
"url": "git://github.com/fabpot/Twig.git",
"reference": "v1.10.0"
"reference": "v1.10.3"
},
"dist": {
"type": "zip",
"url": "https://github.com/fabpot/Twig/zipball/v1.10.0",
"reference": "v1.10.0",
"url": "https://github.com/fabpot/Twig/zipball/v1.10.3",
"reference": "v1.10.3",
"shasum": ""
},
"require": {
"php": ">=5.2.4"
},
"time": "2012-09-28 20:11:39",
"time": "2012-10-19 03:45:49",
"type": "library",
"extra": {
"branch-alias": {
......@@ -1819,6 +1921,7 @@
"stof/doctrine-extensions-bundle": 20,
"xi/breadcrumbs-bundle": 20,
"hwi/oauth-bundle": 20,
"suncat/mobile-detect-bundle": 20
"suncat/mobile-detect-bundle": 20,
"excelwebzone/recaptcha-bundle": 20
}
}
......@@ -2,12 +2,27 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* ArticleType
*
* @uses AbstractType
* @version $id$
* @author Hermann Mayer <hermann.mayer92@gmail.com>
*/
class ArticleType extends AbstractType
{
/**
* buildForm
*
* @param FormBuilderInterface $builder
* @param array $options
* @access public
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
......@@ -85,6 +100,13 @@ class ArticleType extends AbstractType
;
}
/**
* setDefaultOptions
*
* @param OptionsResolverInterface $resolver
* @access public
* @return void
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
......@@ -92,6 +114,12 @@ class ArticleType extends AbstractType
));
}
/**
* getName
*
* @access public
* @return void
*/
public function getName()
{
return 'jity_homepagebundle_articletype';
......
......@@ -2,9 +2,9 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* CategoryType
......
......@@ -2,14 +2,28 @@
namespace Jity\HomepageBundle\Form;
use Jity\HomepageBundle\Form\UserType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Jity\HomepageBundle\Form\UserType,
Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* CommentType
*
* @uses AbstractType
* @version $id$
* @author Hermann Mayer <hermann.mayer92@gmail.com>
*/
class CommentType extends AbstractType
{
/**
* buildForm
*
* @param FormBuilderInterface $builder
* @param array $options
* @access public
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
......@@ -25,6 +39,13 @@ class CommentType extends AbstractType
;
}
/**
* setDefaultOptions
*
* @param OptionsResolverInterface $resolver
* @access public
* @return void
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
......@@ -32,6 +53,12 @@ class CommentType extends AbstractType
));
}
/**
* getName
*
* @access public
* @return void
*/
public function getName()
{
return 'jity_homepagebundle_commenttype';
......
......@@ -2,9 +2,10 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface,
EWZ\Bundle\RecaptchaBundle\Validator\Constraints\True;
/**
* ContactType
......@@ -33,14 +34,28 @@ class ContactType extends AbstractType
'label' => 'Ihre Email Adresse'
))
->add('message', 'textarea', array(
'attr' => array(
'rows' => '6',
'class' => 'span4',
'attr' => array(
'rows' => '6',
'class' => 'span4',
'data-target' => '#editor_modal',
'data-toggle' => 'modal'
),
'label' => 'Nachricht'
))
->add('recaptcha', 'ewz_recaptcha', array(
'attr' => array(
'options' => array(
'theme' => 'white'
)
),
'property_path' => false,
'constraints' => array(
new True(array(
'message' => 'Diese Angabe passt nicht zum angezeigten Captcha.'
))
),
'label' => 'ReCaptcha Sicherheitsabfrage'
))
;
}
......
......@@ -2,9 +2,9 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* PageType
......
......@@ -2,12 +2,27 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* SectionType
*
* @uses AbstractType
* @version $id$
* @author Hermann Mayer <hermann.mayer92@gmail.com>
*/
class SectionType extends AbstractType
{
/**
* buildForm
*
* @param FormBuilderInterface $builder
* @param array $options
* @access public
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
......@@ -31,6 +46,13 @@ class SectionType extends AbstractType
;
}
/**
* setDefaultOptions
*
* @param OptionsResolverInterface $resolver
* @access public
* @return void
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
......@@ -38,6 +60,12 @@ class SectionType extends AbstractType
));
}
/**
* getName
*
* @access public
* @return void
*/
public function getName()
{
return 'jity_homepagebundle_sectiontype';
......
......@@ -2,11 +2,10 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Jity\HomepageBundle\Form\SectionType;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface,
Jity\HomepageBundle\Form\SectionType;
/**
* SidebarType
......
......@@ -2,12 +2,27 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* TagType
*
* @uses AbstractType
* @version $id$
* @author Hermann Mayer <hermann.mayer92@gmail.com>
*/
class TagType extends AbstractType
{
/**
* buildForm
*
* @param FormBuilderInterface $builder
* @param array $options
* @access public
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
......@@ -19,6 +34,13 @@ class TagType extends AbstractType
;
}
/**
* setDefaultOptions
*
* @param OptionsResolverInterface $resolver
* @access public
* @return void
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
......@@ -26,6 +48,12 @@ class TagType extends AbstractType
));
}
/**
* getName
*
* @access public
* @return void
*/
public function getName()
{
return 'jity_homepagebundle_tagtype';
......
......@@ -2,9 +2,9 @@
namespace Jity\HomepageBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType,
Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* UserType
......
{% extends 'form_div_layout.html.twig' %}
{#
Standard Error Styling for a Row
#}
......@@ -35,10 +37,16 @@
{#
Standard Label Styling
#}
{% block field_label %}
{% block form_label %}
{% if label %}
{{ block('form_label') }}
{% if required %}
{% set label = label ~ ' <b>*</b>' %}
{# ' <span class="badge badge-important"><i class="icon-white icon-asterisk"></i></span>' #}
{% endif %}
{{ parent() }}
{% endif %}
{% endblock %}
......@@ -305,107 +313,6 @@
</div>
<!-- <script> -->
<!-- $(document).ready(function() { -->
<!-- collections = { -->
<!-- form: "{{ form.vars.full_name }}".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), -->
<!-- itemPattern: "(" -->
<!-- + "{{ form.vars.full_name }}".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") -->
<!-- + "\\[).+(\\]\\[.+\\]$)", -->
<!-- replaceItemIndex: function(name, index) { -->
<!-- return name.replace( -->
<!-- new RegExp(this.itemPattern), -->
<!-- "$1" + index +"$2" -->
<!-- ); -->
<!-- }, -->
<!-- reorderWidgetsNames: function() { -->
<!-- -->
<!-- $('.' + this.form).each(function (c, el){ -->
<!-- $(el).find(':input').each(function (i, input){ -->
<!-- var cur = $(input); -->
<!-- cur.attr('name', collections.replaceItemIndex(cur.attr('name'), c)); -->
<!-- }); -->
<!-- }); -->
<!-- }, -->
<!-- add: function(attr, data) { -->
<!-- var coll = $('#{{ form.vars.id }}'); -->
<!-- var prototype = coll.attr('data-prototype'); -->
<!-- // Replace '__name__' in the prototype's HTML to -->
<!-- // instead be a number based on the current collection's length. -->
<!-- var el = $( -->
<!-- prototype.replace(/__name__/g, coll.children('.sortable').length) -->
<!-- ); -->
<!-- // If we got attr data for our prototype -->
<!-- if (attr) { -->
<!-- if (attr.class) { -->
<!-- -->
<!-- var preClass = el.attr('class'); -->
<!-- attr.class = preClass + ' ' + attr.class; -->
<!-- } -->
<!-- el.attr(attr); -->
<!-- } -->
<!-- // If we got data to fill our prototype with -->
<!-- if (data) { -->
<!-- -->
<!-- el.find(':input').each(function (i, input) { -->
<!-- -->
<!-- $(input).val(data[i]); -->
<!-- }); -->
<!-- } -->
<!-- // Add new element to the top of the collection -->
<!-- el.prependTo(coll).hide().slideDown(); -->
<!-- // Reorder elements after adding, fixes the order even if we -->
<!-- // never sorted some elements (Adding to the top of a list needs this) -->
<!-- this.reorderWidgetsNames(); -->
<!-- }, -->
<!-- initSortable: function() { -->
<!-- $('.collection > div').sortable({ -->
<!-- placeholder: "ui-state-highlight", -->
<!-- helper: 'clone', -->