Commit 559d0c1c authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Remove user fixture (was buggy)

parent 377419f9
......@@ -5,7 +5,7 @@ Installation and Production Instructions
Feel free to add some more informations if you solve installation issues !
**There is a script for debian installation** named install_debian.sh in this docs directory ! The script is more appropriate for production server installation, but having a look to the script can probably help you for some steps.
**There is a script for debian installation** named install_debian.sh in this docs directory ! After installation completed, go to http://localhost/GoGoCarto/web/app_dev.php/project/initialize to initialize your project
Requirements
------------
......@@ -76,13 +76,13 @@ doctrine:mongodb:generate:proxies
doctrine:mongodb:fixtures:load
```
The last command will generate a basic configuration, and two default users : "admin/admin" and "user/user"
The last command will generate a basic configuration
Then generate if necessary random point on the map :
app:elements:generate 200
Everthing is ready, enjoy :
http://localhost/GoGoCarto/web/app_dev.php
Now initialize your project with following route
http://localhost/GoGoCarto/web/app_dev.php/project/initialize
Production
----------
......
<?php
namespace Biopen\Corebundle\DataFixtures\MongoDB;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class LoadUserData implements FixtureInterface, ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function load(ObjectManager $manager)
{
// Get our userManager, you must implement `ContainerAwareInterface`
$userManager = $this->container->get('fos_user.user_manager');
// Create our user and set details
$user = $userManager->createUser();
$user->setUsername('admin');
$user->setEmail('admin@domain.com');
$user->setPlainPassword('admin');
//$user->setPassword('3NCRYPT3D-V3R51ON');
$user->setEnabled(true);
$user->setRoles(array('ROLE_SUPER_ADMIN','ROLE_ADMIN'));
// Update the user
$userManager->updateUser($user, true);
// Create our user and set details
$user = $userManager->createUser();
$user->setUsername('user');
$user->setEmail('user@domain.com');
$user->setPlainPassword('user');
//$user->setPassword('3NCRYPT3D-V3R51ON');
$user->setEnabled(true);
$user->setRoles(array('ROLE_USER'));
// Update the user
$userManager->updateUser($user, true);
$manager->persist($user);
$manager->flush();
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment