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"?>
<database name="default"
namespace="Trinity\Bundle\SlideshowBundle\Model"
defaultIdMethod="native"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd">
<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" />
<column name="uid" type="integer" required="true" />
<column name="cms_block_id" type="integer" required="true" />
<column name="title" type="varchar" size="128" required="false" />
<column name="rank" type="integer" default="0" />
<column name="picture" type="varchar" size="128" required="true" />
<column name="content" type="longvarchar" required="true" />
<column name="link" type="varchar" size="255" />
<behavior name="uploadable">
<parameter name="fields" value="picture" />
<parameter name="paths" value="uploads/slideshow/" />
</behavior>
<foreign-key foreignTable="cms_block">
<reference local="cms_block_id" foreign="id"/>
</foreign-key>
</table>
</database>
namespace="Trinity\Bundle\SlideshowBundle\Model"
defaultIdMethod="native"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd">
<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" />
<column name="uid" type="integer" required="true" />
<column name="cms_block_id" type="integer" required="true" />
<column name="title" type="varchar" size="128" required="false" />
<column name="rank" type="integer" default="0" />
<column name="picture" type="varchar" size="128" required="true" />
<column name="content" type="longvarchar" required="true" />
<column name="link" type="varchar" size="255" />
<behavior name="uploadable">
<parameter name="fields" value="picture" />
<parameter name="paths" value="uploads/slideshow/" />
</behavior>
<foreign-key foreignTable="cms_block">
<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);
}
}
}

View file

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