Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $user = new User();
     $user->setUsername('admin');
     $user->setEmail('*****@*****.**');
     $user->setEnabled(true);
     $user->setRoles(array('ROLE_SUPER_ADMIN'));
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     $user->setPassword($encoder->encodePassword('admin', $user->getSalt()));
     $manager->persist($user);
     $manager->flush();
     $this->addReference('user1', $user);
     $user = new User();
     $user->setUsername('o.quiroz');
     $user->setEmail('*****@*****.**');
     $user->setEnabled(true);
     $user->setRoles(array('ROLE_SUPER_ADMIN'));
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     $user->setPassword($encoder->encodePassword('o.quiroz', $user->getSalt()));
     $manager->persist($user);
     $manager->flush();
     $this->addReference('user2', $user);
     $user = new User();
     $user->setUsername('n.ramirez');
     $user->setEmail('*****@*****.**');
     $user->setEnabled(true);
     $user->setRoles(array('ROLE_SUPER_ADMIN'));
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     $user->setPassword($encoder->encodePassword('o.quiroz', $user->getSalt()));
     $manager->persist($user);
     $manager->flush();
     $this->addReference('user3', $user);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $objectManager)
 {
     $user = new User();
     $user->addRole("ROLE_SUPER_ADMIN");
     $user->setEnabled(true);
     $user->setUsername("AlexL");
     $user->setPlainPassword("alexl");
     $user->setEmail("*****@*****.**");
     $user->setFirstName("Alexandre");
     $user->setLastname("Lesage");
     $user->setDateOfBirth(\DateTime::createFromFormat('j/m/Y', '23/08/1994'));
     $objectManager->persist($user);
     $objectManager->flush();
 }
Ejemplo n.º 3
0
 public function load(ObjectManager $manager)
 {
     $admin = new User();
     $admin->setCreatedAt(new \DateTime());
     $admin->setUpdatedAt(new \DateTime());
     $admin->setUsername('admin');
     $admin->setUsernameCanonical('admin');
     $admin->setEmail('*****@*****.**');
     $admin->setEmailCanonical('*****@*****.**');
     $admin->setEnabled(1);
     $admin->setPlainPassword('admin');
     $admin->setSuperAdmin(true);
     //$admin->addRole(static::ROLE_SUPER_ADMIN);
     $manager->persist($admin);
     $manager->flush();
     $this->addReference('admin', $admin);
 }
Ejemplo n.º 4
0
 public function load(ObjectManager $em)
 {
     $factory = $this->getSecurityManager();
     $faker = $this->getFaker();
     // user romain
     $user1 = new User();
     $user1->addGroup($em->merge($this->getReference('group-admin')));
     $user1->setFirstname('Romain');
     $user1->setLastname('Coeur');
     $user1->setFirstname('Romain');
     $user1->setLastname('Coeur');
     $user1->setEmail('*****@*****.**');
     $user1->setUsername('romain');
     $user1->setEnabled(true);
     $user1->setSuperAdmin(true);
     $user1->setLocked(false);
     $this->addReference('user-romain', $user1);
     $encoder = $factory->getEncoder($user1);
     $encodedPassword = $encoder->encodePassword('Rogvog4', $user1->getSalt());
     $user1->setPassword($encodedPassword);
     $em->persist($user1);
     // user admin
     $user2 = new User();
     $user2->addGroup($em->merge($this->getReference('group-admin')));
     $user2->setEmail('*****@*****.**');
     $user2->setUsername('admin');
     $user2->setFirstname('Steeve');
     $user2->setLastname('Jobs');
     $user2->setEnabled(true);
     $user2->setSuperAdmin(true);
     $user2->setLocked(false);
     $this->addReference('user-admin', $user2);
     $encoder = $factory->getEncoder($user2);
     $encodedPassword = $encoder->encodePassword('password', $user2->getSalt());
     $user2->setPassword($encodedPassword);
     $em->persist($user2);
     // user user
     $user3 = new User();
     $user3->addGroup($em->merge($this->getReference('group-user')));
     $user3->setEmail('*****@*****.**');
     $user3->setUsername('user');
     $user3->setFirstname('User');
     $user3->setLastname('Jobs');
     $user3->setEnabled(true);
     $user3->setSuperAdmin(true);
     $user3->setLocked(false);
     $this->addReference('user-user', $user3);
     $encoder = $factory->getEncoder($user3);
     $encodedPassword = $encoder->encodePassword('password', $user3->getSalt());
     $user3->setPassword($encodedPassword);
     $em->persist($user3);
     // user tom
     $user4 = new User();
     $user4->addGroup($em->merge($this->getReference('group-admin')));
     $user4->setFirstname('Tom');
     $user4->setLastname('Nana');
     $user4->setEmail('*****@*****.**');
     $user4->setEnabled(true);
     $user4->setUsername('tom');
     $user4->setSuperAdmin(false);
     $user4->setLocked(false);
     $this->addReference('user-tom', $user4);
     $encoder = $factory->getEncoder($user4);
     $encodedPassword = $encoder->encodePassword('azerty', $user4->getSalt());
     $user4->setPassword($encodedPassword);
     $em->persist($user4);
     foreach (range(1, 43) as $id) {
         $user = new User();
         $user->addGroup($em->merge($this->getReference('group-user')));
         $user->setFirstname($faker->firstName);
         $user->setLastname($faker->lastName);
         $user->setEmail($faker->safeEmail);
         $user->setPhone($faker->phoneNumber);
         $user->setUsername($faker->userName);
         $user->setPassword('');
         $user->setEnabled(true);
         $user->setLocked(false);
         $this->addReference('user-' . $id, $user);
         $em->persist($user);
     }
     $em->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function setEnabled($boolean)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEnabled', array($boolean));
     return parent::setEnabled($boolean);
 }
Ejemplo n.º 6
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $config = new Config();
     $config->setName('Footer copyright');
     $config->setValue('© 2015 Bellon Company');
     $config->setKeyValue('FOOTER_COPYRIGHT');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Footer описание');
     $config->setValue('By Alexey');
     $config->setKeyValue('FOOTER_DESCRIPTION');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Адресс');
     $config->setValue('ул. Чапаева 3 офис 303	Минск Беларусь');
     $config->setKeyValue('ADDRESS');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Телефон');
     $config->setValue('(123) 456-7890');
     $config->setKeyValue('PHONE_1');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Телефон');
     $config->setValue('(123) 456-7890');
     $config->setKeyValue('PHONE_2');
     $manager->persist($config);
     $config = new Config();
     $config->setName('email');
     $config->setValue('*****@*****.**');
     $config->setKeyValue('EMAIL');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Куда будет отправлено сообщение');
     $config->setValue('*****@*****.**');
     $config->setKeyValue('EMAIL_TO');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Страница о нас');
     $config->setValue('');
     $config->setKeyValue('ABOUT');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-title на главной');
     $config->setValue('Meta-title на главной');
     $config->setKeyValue('META_TITLE_MAIN');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-description на главной');
     $config->setValue('Meta-description на главной');
     $config->setKeyValue('META_DESCRIPTION_MAIN');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-keywords на главной');
     $config->setValue('Meta-keywords на главной');
     $config->setKeyValue('META_KEYWORDS_MAIN');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-title на О нас');
     $config->setValue('Meta-title на О нас');
     $config->setKeyValue('META_TITLE_ABOUT');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-description на О нас');
     $config->setValue('Meta-description на О нас');
     $config->setKeyValue('META_DESCRIPTION_ABOUT');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-keywords на О нас');
     $config->setValue('Meta-keywords на О нас');
     $config->setKeyValue('META_KEYWORDS_ABOUT');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-title на Контактах');
     $config->setValue('Meta-title на Контактах');
     $config->setKeyValue('META_TITLE_CONTACTS');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-description на Контактах');
     $config->setValue('Meta-description на Контактах');
     $config->setKeyValue('META_DESCRIPTION_CONTACTS');
     $manager->persist($config);
     $config = new Config();
     $config->setName('Meta-keywords на Контактах');
     $config->setValue('Meta-keywords на Контактах');
     $config->setKeyValue('META_KEYWORDS_CONTACTS');
     $manager->persist($config);
     $User = new User();
     $User->setEmail("*****@*****.**");
     $User->setPlainPassword("admin");
     $User->setSuperAdmin(true);
     $User->setUsername("admin");
     $User->setEnabled(true);
     $manager->persist($User);
     $manager->flush();
 }