ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
src
/
AppBundle
/
DataFixtures
/
Viewing: StaffFixtures.php
<?php namespace AppBundle\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; use AppBundle\Entity\Staff; use AppBundle\Entity\Address; class StaffFixtures extends Fixture implements DependentFixtureInterface { private $encoder; public function __construct(UserPasswordEncoderInterface $encoder) { $this->encoder = $encoder; } public function load(ObjectManager $manager) { $companies = $manager ->getRepository("AppBundle:Company") ->findAll(); $floor = 1; // create staffs for each company foreach($companies as $company){ $staffs = array(); // for each company, create 9 staff with all possible roles. for ($i = $floor; $i <= $floor+8; $i++) { $staff = new Staff(); $staff->setUsername("staff".$i); $staff->setFirstName("Firstname of staff ".$i." of company ".$company->getCompanyId() ); $staff->setLastName("Lastname of staff ".$i." of company ".$company->getCompanyId() ); $staff->setEmail($staff->getUsername()."@email.com"); $password = $this->encoder->encodePassword($staff, $staff->getUsername()); $staff->setPassword($password); $address = new Address(); $address->setTown("town of staff".$i); $address->setArea("area of staff". $i); $staff->setCompany($company); $staff->setAddress($address); $staffs[] = $staff; $manager->persist($staff); } $staffs[0]->setRoles(["ROLE_OPERATOR"]); $staffs[1]->setRoles(["ROLE_OPERATOR"]); $staffs[2]->setRoles(["ROLE_CONTROLLER"]); $staffs[3]->setRoles(["ROLE_CONTROLLER"]); $staffs[4]->setRoles(["ROLE_MECHANIC"]); $staffs[5]->setRoles(["ROLE_MECHANIC"]); $staffs[6]->setRoles(["ROLE_AGENCY_ADMIN"]); $staffs[7]->setRoles(["ROLE_AGENCY_ADMIN"]); $staffs[8]->setRoles(["ROLE_COMPANY_ADMIN"]); $floor = $floor+9; } // create the superAdmin $superAdmin = new Staff(); $superAdmin->setUsername("superAdmin"); $superAdmin->setFirstName("Firstname of superAdmin"); $superAdmin->setLastName("Lastname of superAdmin"); $superAdmin->setEmail("superadmin@email.com"); $password = $this->encoder->encodePassword($superAdmin, "superAdmin"); $superAdmin->setPassword($password); $superAdmin->setRoles(["ROLE_SUPER_ADMIN"]); $address = new Address(); $address->setTown("town of superAdmin"); $address->setArea("area of superAdmin"); $superAdmin->setAddress($address); $manager->persist($superAdmin); $manager->flush(); } public function getDependencies() { return array( CompanyFixtures::class, ); } }
Coded With 💗 by
0x6ick