This commit is contained in:
Simon Vieille 2015-03-05 19:47:19 +01:00
parent fd30d137fc
commit 6c46a807f9
3 changed files with 31 additions and 37 deletions

View file

@ -1,32 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<database name="default" <database name="default"
namespace="Trinity\Bundle\SlideshowBundle\Model" namespace="Trinity\Bundle\SlideshowBundle\Model"
defaultIdMethod="native" defaultIdMethod="native"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd"> xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd">
<external-schema filename="../../../ContentManagerBundle/Resources/config/cms_schema.xml" referenceOnly="true"/>
<external-schema filename="../../../ContentManagerBundle/Resources/config/cms_schema.xml" referenceOnly="true"/> <table name="slideshow_item" phpName="SlideshowItem">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<table name="slideshow_item" phpName="SlideshowItem"> <column name="uid" type="integer" required="true" />
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" /> <column name="cms_block_id" type="integer" required="true" />
<column name="uid" type="integer" required="true" /> <column name="title" type="varchar" size="128" required="false" />
<column name="cms_block_id" type="integer" required="true" /> <column name="rank" type="integer" default="0" />
<column name="title" type="varchar" size="128" required="false" /> <column name="picture" type="varchar" size="128" required="true" />
<column name="rank" type="integer" default="0" /> <column name="content" type="longvarchar" required="true" />
<column name="picture" type="varchar" size="128" required="true" /> <column name="link" type="varchar" size="255" />
<column name="content" type="longvarchar" required="true" /> <behavior name="uploadable">
<column name="link" type="varchar" size="255" /> <parameter name="fields" value="picture" />
<parameter name="paths" value="uploads/slideshow/" />
<behavior name="uploadable"> </behavior>
<parameter name="fields" value="picture" /> <foreign-key foreignTable="cms_block">
<parameter name="paths" value="uploads/slideshow/" /> <reference local="cms_block_id" foreign="id"/>
</behavior> </foreign-key>
</table>
<foreign-key foreignTable="cms_block"> </database>
<reference local="cms_block_id" foreign="id"/>
</foreign-key>
</table>
</database>

View file

@ -43,4 +43,4 @@ class AuthenticationFailureHandler extends DefaultAuthenticationFailureHandler
return parent::onAuthenticationFailure($request, $exception); return parent::onAuthenticationFailure($request, $exception);
} }
} }

View file

@ -2,11 +2,11 @@
namespace Trinity\Bundle\UserBundle\Handler; namespace Trinity\Bundle\UserBundle\Handler;
use \Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler; use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler;
use \Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use \Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use \Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use \Symfony\Component\Security\Http\HttpUtils; use Symfony\Component\Security\Http\HttpUtils;
class AuthenticationSuccessHandler extends DefaultAuthenticationSuccessHandler class AuthenticationSuccessHandler extends DefaultAuthenticationSuccessHandler
{ {
@ -30,9 +30,10 @@ class AuthenticationSuccessHandler extends DefaultAuthenticationSuccessHandler
$result = array('success' => true); $result = array('success' => true);
$response = new Response(json_encode($result)); $response = new Response(json_encode($result));
$response->headers->set('Content-Type', 'application/json'); $response->headers->set('Content-Type', 'application/json');
return $response; return $response;
} }
return parent::onAuthenticationSuccess($request, $token); return parent::onAuthenticationSuccess($request, $token);
} }
} }