Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.21 KB | None | 0 0
  1. doctrine:
  2. dbal:
  3. default_connection: website
  4. connections:
  5. #MySql
  6. aodb:
  7. driver: pdo_mysql
  8. host: "%database_host%"
  9. port: "%database_port%"
  10. dbname: "%ao_db_database_name%"
  11. user: "%database_user%"
  12. password: "%database_password%"
  13. charset: UTF8
  14.  
  15. abdb:
  16. driver: pdo_mysql
  17. host: "%database_host%"
  18. port: "%database_port%"
  19. dbname: "%ab_db_database_name%"
  20. user: "%database_user%"
  21. password: "%database_password%"
  22. charset: UTF8
  23.  
  24. website:
  25. mapping_types:
  26. enum: string
  27. driver: pdo_mysql
  28. host: "%database_host%"
  29. port: "%database_port%"
  30. dbname: "%web_database_name%"
  31. user: "%database_user%"
  32. password: "%database_password%"
  33. charset: UTF8
  34.  
  35. #Postgresql
  36. pgsql:
  37. driver: pdo_pgsql
  38. host: "%psql_database_host%"
  39. port: "%psql_database_port%"
  40. dbname: "%psql_database_name%"
  41. user: "%psql_database_user%"
  42. password: "%psql_database_password%"
  43. charset: UTF8
  44.  
  45. orm:
  46. auto_generate_proxy_classes: "%kernel.debug%"
  47. default_entity_manager: website
  48.  
  49. entity_managers:
  50. website:
  51. connection: website
  52. mappings:
  53. WebsiteBundle: ~
  54. UserBundle: ~
  55. pgsql:
  56. connection: pgsql
  57. mappings:
  58. UserBundle: ~
  59.  
  60. <?php
  61.  
  62. namespace UserBundleEntity;
  63.  
  64. use DoctrineORMMapping as ORM;
  65. use DoctrineDBALTypesType;
  66. use SymfonyComponentSecurityCoreUserEquatableInterface;
  67. use SymfonyComponentSecurityCoreUserUserInterface;
  68.  
  69. Type::overrideType('datetime', 'DoctrineDBALTypesVarDateTimeType');
  70. Type::overrideType('datetimetz', 'DoctrineDBALTypesVarDateTimeType');
  71. Type::overrideType('time', 'DoctrineDBALTypesVarDateTimeType');
  72.  
  73. /**
  74. * GameAccount
  75. *
  76. * @ORMTable(name="account")
  77. * @ORMEntity(repositoryClass="UserBundleRepositoryGameAccountRepository")
  78. */
  79. class GameAccount implements UserInterface, EquatableInterface
  80. {
  81. /**
  82. * @var int
  83. *
  84. * @ORMColumn(name="id", type="integer")
  85. * @ORMId
  86. * @ORMGeneratedValue(strategy="AUTO")
  87. */
  88. private $id;
  89.  
  90. /**
  91. * @var string
  92. *
  93. * @ORMColumn(name="identifier", type="string", length=100, unique=true)
  94. */
  95. private $identifier;
  96.  
  97. /**
  98. * @var string
  99. *
  100. * @ORMColumn(name="title", type="string", length=100)
  101. */
  102. private $title;
  103.  
  104. /**
  105. * @var string
  106. *
  107. * @ORMColumn(name="password", type="string", length=100)
  108. */
  109. private $password;
  110.  
  111. /**
  112. * @var string
  113. *
  114. * @ORMColumn(name="external_id", type="string", length=30)
  115. */
  116. private $externalId;
  117.  
  118. /**
  119. * @var string
  120. *
  121. * @ORMColumn(name="salt", type="string", length=100)
  122. */
  123. private $salt;
  124.  
  125. /**
  126. * @var string
  127. *
  128. * @ORMColumn(name="last_shard_name", type="string", length=100)
  129. */
  130. private $lastShardName;
  131.  
  132. /**
  133. * @var string
  134. *
  135. * @ORMColumn(name="access_level", type="string", length=16)
  136. */
  137. private $accessLevel;
  138.  
  139. /**
  140. * @var string
  141. *
  142. * @ORMColumn(name="current_access_level", type="string", length=16)
  143. */
  144. private $currentAccessLevel;
  145.  
  146. /**
  147. * @var int
  148. *
  149. * @ORMColumn(name="status", type="integer")
  150. */
  151. private $status;
  152.  
  153. /**
  154. * @var int
  155. *
  156. * @ORMColumn(name="flags", type="bigint")
  157. */
  158. private $flags;
  159.  
  160. /**
  161. * @var int
  162. *
  163. * @ORMColumn(name="reseacher", type="smallint")
  164. */
  165. private $reseacher;
  166.  
  167. /**
  168. * @var DateTime
  169. *
  170. * @ORMColumn(name="creation_time", type="datetimetz")
  171. */
  172. private $creationTime;
  173.  
  174. /**
  175. * @var int
  176. *
  177. * @ORMColumn(name="hash_algorithm_id", type="bigint")
  178. */
  179. private $hashAlgorithmId;
  180.  
  181. /**
  182. * @var string
  183. *
  184. * @ORMColumn(name="last_ip", type="string", length=15)
  185. */
  186. private $lastIp;
  187.  
  188. /**
  189. * @var int
  190. *
  191. * @ORMColumn(name="is_last_login_from_pccafe", type="smallint")
  192. */
  193. private $isLastLoginFromPccafe;
  194.  
  195. /**
  196. * @var DateTime
  197. *
  198. * @ORMColumn(name="last_game_start", type="datetimetz", nullable=true)
  199. */
  200. private $lastGameStart;
  201.  
  202. /**
  203. * @var DateTime
  204. *
  205. * @ORMColumn(name="last_game_end", type="datetimetz", nullable=true)
  206. */
  207. private $lastGameEnd;
  208.  
  209. /**
  210. * @var int
  211. *
  212. * @ORMColumn(name="last_avatar_id", type="bigint")
  213. */
  214. private $lastAvatarId;
  215.  
  216. /**
  217. * @var DateTime
  218. *
  219. * @ORMColumn(name="subscribe_until", type="datetimetz", nullable=true)
  220. */
  221. private $subscribeUntil;
  222.  
  223. /**
  224. * @var string
  225. *
  226. * @ORMColumn(name="alt_identifier", type="string", length=100, nullable=true)
  227. */
  228. private $altIdentifier;
  229.  
  230. /**
  231. * @var string
  232. *
  233. * @ORMColumn(name="access_mode", type="string", length=30)
  234. */
  235. private $accessMode;
  236.  
  237. /**
  238. * @var int
  239. *
  240. * @ORMColumn(name="time_played", type="bigint")
  241. */
  242. private $timePlayed;
  243.  
  244. /**
  245. * @var int
  246. *
  247. * @ORMColumn(name="time_rested", type="bigint")
  248. */
  249. private $timeRested;
  250.  
  251. /**
  252. * @var int
  253. *
  254. * @ORMColumn(name="refer_owner_id", type="integer")
  255. */
  256. private $referOwnerId;
  257.  
  258. /**
  259. * @var int
  260. *
  261. * @ORMColumn(name="max_avatar_level", type="integer")
  262. */
  263. private $maxAvatarLevel;
  264.  
  265. /**
  266. * @var string
  267. *
  268. * @ORMColumn(name="hardware", type="string", length=200)
  269. */
  270. private $hardware;
  271.  
  272.  
  273.  
  274.  
  275. /**
  276. * Get id
  277. *
  278. * @return int
  279. */
  280. public function getId()
  281. {
  282. return $this->id;
  283. }
  284.  
  285. /**
  286. * Set identifier
  287. *
  288. * @param string $identifier
  289. *
  290. * @return GameAccount
  291. */
  292. public function setIdentifier($identifier)
  293. {
  294. $this->identifier = $identifier;
  295.  
  296. return $this;
  297. }
  298.  
  299. /**
  300. * Get identifier
  301. *
  302. * @return string
  303. */
  304. public function getIdentifier()
  305. {
  306. return $this->identifier;
  307. }
  308.  
  309. /**
  310. * Set title
  311. *
  312. * @param string $title
  313. *
  314. * @return GameAccount
  315. */
  316. public function setTitle($title)
  317. {
  318. $this->title = $title;
  319.  
  320. return $this;
  321. }
  322.  
  323. /**
  324. * Get title
  325. *
  326. * @return string
  327. */
  328. public function getTitle()
  329. {
  330. return $this->title;
  331. }
  332.  
  333. /**
  334. * Set password
  335. *
  336. * @param string $password
  337. *
  338. * @return GameAccount
  339. */
  340. public function setPassword($password)
  341. {
  342. $this->password = $password;
  343.  
  344. return $this;
  345. }
  346.  
  347. /**
  348. * Get password
  349. *
  350. * @return string
  351. */
  352. public function getPassword()
  353. {
  354. return $this->password;
  355. }
  356.  
  357. /**
  358. * Set externalId
  359. *
  360. * @param string $externalId
  361. *
  362. * @return GameAccount
  363. */
  364. public function setExternalId($externalId)
  365. {
  366. $this->externalId = $externalId;
  367.  
  368. return $this;
  369. }
  370.  
  371. /**
  372. * Get externalId
  373. *
  374. * @return string
  375. */
  376. public function getExternalId()
  377. {
  378. return $this->externalId;
  379. }
  380.  
  381. /**
  382. * Set salt
  383. *
  384. * @param string $salt
  385. *
  386. * @return GameAccount
  387. */
  388. public function setSalt($salt)
  389. {
  390. $this->salt = $salt;
  391.  
  392. return $this;
  393. }
  394.  
  395. /**
  396. * Get salt
  397. *
  398. * @return string
  399. */
  400. public function getSalt()
  401. {
  402. return $this->salt;
  403. }
  404.  
  405. /**
  406. * Set lastShardName
  407. *
  408. * @param string $lastShardName
  409. *
  410. * @return GameAccount
  411. */
  412. public function setLastShardName($lastShardName)
  413. {
  414. $this->lastShardName = $lastShardName;
  415.  
  416. return $this;
  417. }
  418.  
  419. /**
  420. * Get lastShardName
  421. *
  422. * @return string
  423. */
  424. public function getLastShardName()
  425. {
  426. return $this->lastShardName;
  427. }
  428.  
  429. /**
  430. * Set accessLevel
  431. *
  432. * @param string $accessLevel
  433. *
  434. * @return GameAccount
  435. */
  436. public function setAccessLevel($accessLevel)
  437. {
  438. $this->accessLevel = $accessLevel;
  439.  
  440. return $this;
  441. }
  442.  
  443. /**
  444. * Get accessLevel
  445. *
  446. * @return string
  447. */
  448. public function getAccessLevel()
  449. {
  450. return $this->accessLevel;
  451. }
  452.  
  453. /**
  454. * Set currentAccessLevel
  455. *
  456. * @param string $currentAccessLevel
  457. *
  458. * @return GameAccount
  459. */
  460. public function setCurrentAccessLevel($currentAccessLevel)
  461. {
  462. $this->currentAccessLevel = $currentAccessLevel;
  463.  
  464. return $this;
  465. }
  466.  
  467. /**
  468. * Get currentAccessLevel
  469. *
  470. * @return string
  471. */
  472. public function getCurrentAccessLevel()
  473. {
  474. return $this->currentAccessLevel;
  475. }
  476.  
  477. /**
  478. * Set status
  479. *
  480. * @param integer $status
  481. *
  482. * @return GameAccount
  483. */
  484. public function setStatus($status)
  485. {
  486. $this->status = $status;
  487.  
  488. return $this;
  489. }
  490.  
  491. /**
  492. * Get status
  493. *
  494. * @return int
  495. */
  496. public function getStatus()
  497. {
  498. return $this->status;
  499. }
  500.  
  501. /**
  502. * Set flags
  503. *
  504. * @param integer $flags
  505. *
  506. * @return GameAccount
  507. */
  508. public function setFlags($flags)
  509. {
  510. $this->flags = $flags;
  511.  
  512. return $this;
  513. }
  514.  
  515. /**
  516. * Get flags
  517. *
  518. * @return int
  519. */
  520. public function getFlags()
  521. {
  522. return $this->flags;
  523. }
  524.  
  525. /**
  526. * Set reseacher
  527. *
  528. * @param integer $reseacher
  529. *
  530. * @return GameAccount
  531. */
  532. public function setReseacher($reseacher)
  533. {
  534. $this->reseacher = $reseacher;
  535.  
  536. return $this;
  537. }
  538.  
  539. /**
  540. * Get reseacher
  541. *
  542. * @return int
  543. */
  544. public function getReseacher()
  545. {
  546. return $this->reseacher;
  547. }
  548.  
  549. /**
  550. * Set creationTime
  551. *
  552. * @param DateTime $creationTime
  553. *
  554. * @return GameAccount
  555. */
  556. public function setCreationTime($creationTime)
  557. {
  558. $this->creationTime = $creationTime;
  559.  
  560. return $this;
  561. }
  562.  
  563. /**
  564. * Get creationTime
  565. *
  566. * @return DateTime
  567. */
  568. public function getCreationTime()
  569. {
  570. return $this->creationTime;
  571. }
  572.  
  573. /**
  574. * Set hashAlgorithmId
  575. *
  576. * @param integer $hashAlgorithmId
  577. *
  578. * @return GameAccount
  579. */
  580. public function setHashAlgorithmId($hashAlgorithmId)
  581. {
  582. $this->hashAlgorithmId = $hashAlgorithmId;
  583.  
  584. return $this;
  585. }
  586.  
  587. /**
  588. * Get hashAlgorithmId
  589. *
  590. * @return int
  591. */
  592. public function getHashAlgorithmId()
  593. {
  594. return $this->hashAlgorithmId;
  595. }
  596.  
  597. /**
  598. * Set lastIp
  599. *
  600. * @param string $lastIp
  601. *
  602. * @return GameAccount
  603. */
  604. public function setLastIp($lastIp)
  605. {
  606. $this->lastIp = $lastIp;
  607.  
  608. return $this;
  609. }
  610.  
  611. /**
  612. * Get lastIp
  613. *
  614. * @return string
  615. */
  616. public function getLastIp()
  617. {
  618. return $this->lastIp;
  619. }
  620.  
  621. /**
  622. * Set isLastLoginFromPccafe
  623. *
  624. * @param integer $isLastLoginFromPccafe
  625. *
  626. * @return GameAccount
  627. */
  628. public function setIsLastLoginFromPccafe($isLastLoginFromPccafe)
  629. {
  630. $this->isLastLoginFromPccafe = $isLastLoginFromPccafe;
  631.  
  632. return $this;
  633. }
  634.  
  635. /**
  636. * Get isLastLoginFromPccafe
  637. *
  638. * @return int
  639. */
  640. public function getIsLastLoginFromPccafe()
  641. {
  642. return $this->isLastLoginFromPccafe;
  643. }
  644.  
  645. /**
  646. * Set lastGameStart
  647. *
  648. * @param DateTime $lastGameStart
  649. *
  650. * @return GameAccount
  651. */
  652. public function setLastGameStart($lastGameStart)
  653. {
  654. $this->lastGameStart = $lastGameStart;
  655.  
  656. return $this;
  657. }
  658.  
  659. /**
  660. * Get lastGameStart
  661. *
  662. * @return DateTime
  663. */
  664. public function getLastGameStart()
  665. {
  666. return $this->lastGameStart;
  667. }
  668.  
  669. /**
  670. * Set lastGameEnd
  671. *
  672. * @param DateTime $lastGameEnd
  673. *
  674. * @return GameAccount
  675. */
  676. public function setLastGameEnd($lastGameEnd)
  677. {
  678. $this->lastGameEnd = $lastGameEnd;
  679.  
  680. return $this;
  681. }
  682.  
  683. /**
  684. * Get lastGameEnd
  685. *
  686. * @return DateTime
  687. */
  688. public function getLastGameEnd()
  689. {
  690. return $this->lastGameEnd;
  691. }
  692.  
  693. /**
  694. * Set lastAvatarId
  695. *
  696. * @param integer $lastAvatarId
  697. *
  698. * @return GameAccount
  699. */
  700. public function setLastAvatarId($lastAvatarId)
  701. {
  702. $this->lastAvatarId = $lastAvatarId;
  703.  
  704. return $this;
  705. }
  706.  
  707. /**
  708. * Get lastAvatarId
  709. *
  710. * @return int
  711. */
  712. public function getLastAvatarId()
  713. {
  714. return $this->lastAvatarId;
  715. }
  716.  
  717. /**
  718. * Set subscribeUntil
  719. *
  720. * @param DateTime $subscribeUntil
  721. *
  722. * @return GameAccount
  723. */
  724. public function setSubscribeUntil($subscribeUntil)
  725. {
  726. $this->subscribeUntil = $subscribeUntil;
  727.  
  728. return $this;
  729. }
  730.  
  731. /**
  732. * Get subscribeUntil
  733. *
  734. * @return DateTime
  735. */
  736. public function getSubscribeUntil()
  737. {
  738. return $this->subscribeUntil;
  739. }
  740.  
  741. /**
  742. * Set altIdentifier
  743. *
  744. * @param string $altIdentifier
  745. *
  746. * @return GameAccount
  747. */
  748. public function setAltIdentifier($altIdentifier)
  749. {
  750. $this->altIdentifier = $altIdentifier;
  751.  
  752. return $this;
  753. }
  754.  
  755. /**
  756. * Get altIdentifier
  757. *
  758. * @return string
  759. */
  760. public function getAltIdentifier()
  761. {
  762. return $this->altIdentifier;
  763. }
  764.  
  765. /**
  766. * Set accessMode
  767. *
  768. * @param string $accessMode
  769. *
  770. * @return GameAccount
  771. */
  772. public function setAccessMode($accessMode)
  773. {
  774. $this->accessMode = $accessMode;
  775.  
  776. return $this;
  777. }
  778.  
  779. /**
  780. * Get accessMode
  781. *
  782. * @return string
  783. */
  784. public function getAccessMode()
  785. {
  786. return $this->accessMode;
  787. }
  788.  
  789. /**
  790. * Set timePlayed
  791. *
  792. * @param integer $timePlayed
  793. *
  794. * @return GameAccount
  795. */
  796. public function setTimePlayed($timePlayed)
  797. {
  798. $this->timePlayed = $timePlayed;
  799.  
  800. return $this;
  801. }
  802.  
  803. /**
  804. * Get timePlayed
  805. *
  806. * @return int
  807. */
  808. public function getTimePlayed()
  809. {
  810. return $this->timePlayed;
  811. }
  812.  
  813. /**
  814. * Set timeRested
  815. *
  816. * @param integer $timeRested
  817. *
  818. * @return GameAccount
  819. */
  820. public function setTimeRested($timeRested)
  821. {
  822. $this->timeRested = $timeRested;
  823.  
  824. return $this;
  825. }
  826.  
  827. /**
  828. * Get timeRested
  829. *
  830. * @return int
  831. */
  832. public function getTimeRested()
  833. {
  834. return $this->timeRested;
  835. }
  836.  
  837. /**
  838. * Set referOwnerId
  839. *
  840. * @param integer $referOwnerId
  841. *
  842. * @return GameAccount
  843. */
  844. public function setReferOwnerId($referOwnerId)
  845. {
  846. $this->referOwnerId = $referOwnerId;
  847.  
  848. return $this;
  849. }
  850.  
  851. /**
  852. * Get referOwnerId
  853. *
  854. * @return int
  855. */
  856. public function getReferOwnerId()
  857. {
  858. return $this->referOwnerId;
  859. }
  860.  
  861. /**
  862. * Set maxAvatarLevel
  863. *
  864. * @param integer $maxAvatarLevel
  865. *
  866. * @return GameAccount
  867. */
  868. public function seMaxAvatarLevel($maxAvatarLevel)
  869. {
  870. $this->maxAvatarLevel = $maxAvatarLevel;
  871.  
  872. return $this;
  873. }
  874.  
  875. /**
  876. * Get maxAvatarLevel
  877. *
  878. * @return int
  879. */
  880. public function getMaxAvatarLevel()
  881. {
  882. return $this->maxAvatarLevel;
  883. }
  884.  
  885. /**
  886. * Set hardware
  887. *
  888. * @param string $hardware
  889. *
  890. * @return GameAccount
  891. */
  892. public function setHardware($hardware)
  893. {
  894. $this->hardware = $hardware;
  895.  
  896. return $this;
  897. }
  898.  
  899. /**
  900. * Get hardware
  901. *
  902. * @return string
  903. */
  904. public function getHardware()
  905. {
  906. return $this->hardware;
  907. }
  908.  
  909.  
  910. /**
  911. * Returns the roles granted to the user.
  912. *
  913. * <code>
  914. * public function getRoles()
  915. * {
  916. * return array('ROLE_USER');
  917. * }
  918. * </code>
  919. *
  920. * Alternatively, the roles might be stored on a ``roles`` property,
  921. * and populated in any number of different ways when the user object
  922. * is created.
  923. *
  924. * @return (Role|string)[] The user roles
  925. */
  926. public function getRoles()
  927. {
  928. return array('ROLE_USER');
  929. }
  930.  
  931. /**
  932. * Returns the username used to authenticate the user.
  933. *
  934. * @return string The username
  935. */
  936. public function getUsername()
  937. {
  938. return $this->identifier;
  939. }
  940.  
  941. /**
  942. * Removes sensitive data from the user.
  943. *
  944. * This is important if, at any given point, sensitive information like
  945. * the plain-text password is stored on this object.
  946. */
  947. public function eraseCredentials()
  948. {
  949. // TODO: Implement eraseCredentials() method.
  950. }
  951.  
  952. /**
  953. * The equality comparison should neither be done by referential equality
  954. * nor by comparing identities (i.e. getId() === getId()).
  955. *
  956. * However, you do not need to compare every attribute, but only those that
  957. * are relevant for assessing whether re-authentication is required.
  958. *
  959. * Also implementation should consider that $user instance may implement
  960. * the extended user interface `AdvancedUserInterface`.
  961. *
  962. * @param UserInterface $user
  963. *
  964. * @return bool
  965. */
  966. public function isEqualTo(UserInterface $user)
  967. {
  968. // TODO: Implement isEqualTo() method.
  969. }
  970. }
  971.  
  972. <?php
  973.  
  974.  
  975. namespace UserBundleController;
  976.  
  977. use SymfonyBundleFrameworkBundleControllerController;
  978. use SymfonyComponentHttpFoundationRequest;
  979. use SymfonyComponentSecurityCoreAuthenticationTokenUsernamePasswordToken;
  980. use SymfonyComponentSecurityHttpEventInteractiveLoginEvent;
  981. use UserBundleEntityGameAccount;
  982.  
  983. class SecurityController extends Controller
  984. {
  985. public function loginAction(Request $request)
  986. {
  987. $authentUtils = $this->get('security.authentication_utils');
  988. $error = $authentUtils->getLastAuthenticationError();
  989. $lastUsername = $authentUtils->getLastUsername();
  990.  
  991. if($request->get('login') && $request->get('password'))
  992. {
  993. $proceed = $this->proceedAction($request->get('login'), $request->get('password'));
  994. if(!$proceed)
  995. {
  996. $error = 'Mauvais indentifiants';
  997. } else {
  998. $token = new UsernamePasswordToken($proceed, null, 'main', []);
  999. $this->get('security.token_storage')->setToken($token);
  1000. $event = new InteractiveLoginEvent($request, $token);
  1001. $this->get('event_dispatcher')->dispatch('security.interactive_login', $event);
  1002.  
  1003. // dump($this->getUser()); exit;
  1004. return $this->redirectToRoute('news');
  1005. }
  1006. }
  1007.  
  1008. return $this->render('UserBundle:Security:login.html.twig',
  1009. [
  1010. 'last_username' => $lastUsername,
  1011. 'error' => $error
  1012. ]
  1013. );
  1014. }
  1015.  
  1016. private function proceedAction($login, $password)
  1017. {
  1018. $ga_repo = $this
  1019. ->getDoctrine()
  1020. ->getManager('pgsql')
  1021. ->getRepository('UserBundle:GameAccount')
  1022. ;
  1023.  
  1024. $login = $ga_repo->check_login($login);
  1025.  
  1026.  
  1027. if(null !== $login)
  1028. {
  1029. if($login->getPassword() === $this->hashPassSalt($login, $password))
  1030. {
  1031. return $login;
  1032. }
  1033. } else {
  1034. return false;
  1035. }
  1036.  
  1037. return false;
  1038. }
  1039.  
  1040. private function hashPassSalt($login, $password)
  1041. {
  1042. $ha_repo = $this
  1043. ->getDoctrine()
  1044. ->getManager('pgsql')
  1045. ->getRepository('UserBundle:HashAlgorithms')
  1046. ;
  1047.  
  1048. if(null !== $hash = $ha_repo->hashPassSalt($login->getHashAlgorithmId()))
  1049. {
  1050. if('SHA-1' === $hash->getName())
  1051. {
  1052. return sha1($password. $login->getSalt());
  1053. }
  1054. else if ('MD5' === $hash->getName())
  1055. {
  1056. return md5($password.$login->getSalt());
  1057. }
  1058. else {
  1059. return $password.$login->getSalt();
  1060. }
  1061. }
  1062.  
  1063. return false;
  1064. }
  1065. }
  1066.  
  1067. entity_managers:
  1068. website:
  1069. connection: website
  1070. mappings:
  1071. WebsiteBundle: ~
  1072. pgsql:
  1073. connection: pgsql
  1074. mappings:
  1075. UserBundle: ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement