Plugins
Problem with sso integration

Well first of all i would like to say this is an awesome forum script you have developed here.

Now on to my issue, i have been attempting to merge the logins for my existing site and the forum script using the sso plugin. I followed the directions closely from the install page, and it does link to the login page of my website, but when logging in it doesnt in turn log me into the forum. Hope i am making sense so far.

What is baffling me though, is the logout on my main website will also log me out of the forum once logged in manually using the user/pass i created when installing the forum script.

in the client.php at the bottom

$account['uid'] = [i have actual username here from my website]; //Your logged in user's userid
$account['name'] = [username from website]; //Your logged in user's username
$account['mail'] = [my physical email address]; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now

Not sure where i have gone wrong with this one :/

Well first of all i would like to say this is an awesome forum script you have developed here. Now on to my issue, i have been attempting to merge the logins for my existing site and the forum script using the sso plugin. I followed the directions closely from the install page, and it does link to the login page of my website, but when logging in it doesnt in turn log me into the forum. Hope i am making sense so far. What is baffling me though, is the logout on my main website will also log me out of the forum once logged in manually using the user/pass i created when installing the forum script. in the client.php at the bottom $account['uid'] = [i have actual username here from my website]; //Your logged in user's userid $account['name'] = [username from website]; //Your logged in user's username $account['mail'] = [my physical email address]; //Your logged in user's email id $account['avatar'] = ''; //not used as of now Not sure where i have gone wrong with this one :/

Would it have to be installed on the same sql database as the existing website? Or having its own seperate db is ok and still be able to integrate.

Its kinda odd, if i log in to the forum, i am logged out of the website, and vice versa.

this is the url of my website
gamestimeline.com/forum << will add a proper subdomain later

Would it have to be installed on the same sql database as the existing website? Or having its own seperate db is ok and still be able to integrate. Its kinda odd, if i log in to the forum, i am logged out of the website, and vice versa. this is the url of my website gamestimeline.com/forum &amp;lt;&amp;lt; will add a proper subdomain later

Can you post a screenshot of the sso settings page from codoforum backend ?

And post the code of the client.php file .

Can you post a screenshot of the sso settings page from codoforum backend ? And post the code of the client.php file .

client.php contents

<?php

/**

  • You do not have to edit sso.php file
  • This file/code should get executed when Codoforum sends a request
  • to the path <SSO Get User Path> as defined in SSO plugin settings
  • in Codoforum backend
  • */

require 'sso.php';

/**

  • The SSO client id and secret MUST be same as that set in the Codoforum
  • SSO plugin settings
    */
    $settings = array(

    "client_id" => 'secret-one',
    "secret" => 'secret-one',
    "timeout" => 6000
    );

$sso = new codoforum_sso($settings);

$account = array();

/**

  • Here comes your logic to check if the user is logged in or not.
  • A simple example would be using PHP SESSION
    */
    if (USER_IS_LOGGED_IN) {

    $account['uid'] = gamestimeline; //Your logged in user's userid
    $account['name'] = gamestimeline; //Your logged in user's username
    $account['mail'] = image1969@gmail.com; //Your logged in user's email id
    $account['avatar'] = ''; //not used as of now
    }

$sso->output_jsonp($account); //output above as JSON back to Codoforum
exit();

screenshot of admin backend as requested

Hope you can shed some light into what i might be doing wrong

client.php contents &amp;lt;?php /** * * You do not have to edit sso.php file * * This file/code should get executed when Codoforum sends a request * to the path &amp;lt;SSO Get User Path&amp;gt; as defined in SSO plugin settings * in Codoforum backend * * */ require &#039;sso.php&#039;; /** * * The SSO client id and secret MUST be same as that set in the Codoforum * SSO plugin settings */ $settings = array( &quot;client_id&quot; =&amp;gt; &#039;secret-one&#039;, &quot;secret&quot; =&amp;gt; &#039;secret-one&#039;, &quot;timeout&quot; =&amp;gt; 6000 ); $sso = new codoforum_sso($settings); $account = array(); /** * * Here comes your logic to check if the user is logged in or not. * A simple example would be using PHP SESSION */ if (USER_IS_LOGGED_IN) { $account[&#039;uid&#039;] = gamestimeline; //Your logged in user&#039;s userid $account[&#039;name&#039;] = gamestimeline; //Your logged in user&#039;s username $account[&#039;mail&#039;] = image1969@gmail.com; //Your logged in user&#039;s email id $account[&#039;avatar&#039;] = &#039;&#039;; //not used as of now } $sso-&amp;gt;output_jsonp($account); //output above as JSON back to Codoforum exit(); screenshot of admin backend as requested http://i.imgur.com/jyCojzW.jpg Hope you can shed some light into what i might be doing wrong

@adesh1414127033 is there any update or help with the issue i am having with sso integration? I am even willing to pay to have someoen help with this issue, and to actually get it working

@adesh1414127033 is there any update or help with the issue i am having with sso integration? I am even willing to pay to have someoen help with this issue, and to actually get it working

Hi,

We do not need payment to fix any bugs.
If it is urgent, you can provide us with your FTP details, we can then fix it for you

Hi, We do not need payment to fix any bugs. If it is urgent, you can provide us with your FTP details, we can then fix it for you

@adesh1414127033 do you see anything wrong with the above information you had asked for? I would prefer to try and repair it myself so i can learn as opposed to having someone do it for me if that makes sense. I am a new to this stuff so like to learn all aspects before just having someone else to do it for me.

If you could help me troubleshoot in this forum that would be great, and im sure any information you might add here may help others that might experience the same issues as i am as well.

The url of my main website is http://gamestimeline.com and i have the forum installed on the directory /forum > http://gamestimeline.com/forum

@adesh1414127033 do you see anything wrong with the above information you had asked for? I would prefer to try and repair it myself so i can learn as opposed to having someone do it for me if that makes sense. I am a new to this stuff so like to learn all aspects before just having someone else to do it for me. If you could help me troubleshoot in this forum that would be great, and im sure any information you might add here may help others that might experience the same issues as i am as well. The url of my main website is http://gamestimeline.com and i have the forum installed on the directory /forum &amp;gt; http://gamestimeline.com/forum
edited Dec 1 '15 at 10:07 pm

bumping this back up again. Hope someone can point me in the right direction

bumping this back up again. Hope someone can point me in the right direction

Hi,

In the client.php file

if (USER_IS_LOGGED_IN) {

You didn't put anything that evaluates to true when the user is logged in ?

And in sso settings,

SSO Get User Path,

It should point to the file which gives you the user details, if your website does not have any routing mechanism, it should be a direct path to the client.php file that you have edited.

Hi, In the client.php file ``` if (USER_IS_LOGGED_IN) { ``` You didn&#039;t put anything that evaluates to true when the user is logged in ? And in sso settings, SSO Get User Path, It should point to the file which gives you the user details, if your website does not have any routing mechanism, it should be a direct path to the client.php file that you have edited.

Ok thanks i will try and edit these things and report back

No i didnt add anything to if (USER_IS_LOGGED_IN) { ... i am unsure what to add there :/ .. and pointing to the client.php has worked for not logging out of one or the other, so i think that portion is fixed anyway. I just need to figure out what you mean by "You didn't put anything that evaluates to true when the user is logged in ?"

Ok thanks i will try and edit these things and report back No i didnt add anything to if (USER_IS_LOGGED_IN) { ... i am unsure what to add there :/ .. and pointing to the client.php has worked for not logging out of one or the other, so i think that portion is fixed anyway. I just need to figure out what you mean by &quot;You didn&#039;t put anything that evaluates to true when the user is logged in ?&quot;
edited Dec 2 '15 at 6:24 pm

Well its logging in, but it logs in with the user "username". Once again i am stumped. I am assuming i need to add something to the client.php as you suggested on this line

if (USER_IS_LOGGED_IN) {

My original site where i am getting the logins from is built with bootstrap, so of course there are no real php to point to really :/ Hope i am making sense, i am a real noob when it comes to php and coding issues, i am really quite eager to learn though

Well its logging in, but it logs in with the user &quot;username&quot;. Once again i am stumped. I am assuming i need to add something to the client.php as you suggested on this line ```` if (USER_IS_LOGGED_IN) { ```` My original site where i am getting the logins from is built with bootstrap, so of course there are no real php to point to really :/ Hope i am making sense, i am a real noob when it comes to php and coding issues, i am really quite eager to learn though

Can you send us your php code that does the user login and registration ?

Can you send us your php code that does the user login and registration ?

My issue with that is my website is built using Bootstrap, so i am unsure, as i am not super experienced with boostrap, how to find any php as you suggest :/

My issue with that is my website is built using Bootstrap, so i am unsure, as i am not super experienced with boostrap, how to find any php as you suggest :/

Bootstrap is just a js/css framework.

Your php files must be separate.

Can you provide us remote control via teamviewer, we can then solve this problem together, so you can understand everything thats happening as well as get a quick fix.

Bootstrap is just a js/css framework. Your php files must be separate. Can you provide us remote control via teamviewer, we can then solve this problem together, so you can understand everything thats happening as well as get a quick fix.

Hey sorry for late reply, was busy.

Anyway after some searching i think i found the php you were talking about.

<?php
/**
 * User: Andy
 * Date: 13/01/15
 * Time: 11:55
 */

namespace AVCMS\Bundles\Users\User;

use AVCMS\Bundles\Users\Event\CreateUserEvent;
use AVCMS\Bundles\Users\Model\Users;
use Cocur\Slugify\Slugify;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;

class NewUserBuilder
{
    /**
     * @var Users
     */
    private $users;

    /**
     * @var Slugify
     */
    private $slugify;

    /**
     * @var PasswordEncoderInterface
     */
    private $passwordEncoder;

    private $requestStack;

    private $eventDispatcher;

    public function __construct(Users $users, Slugify $slugify, PasswordEncoderInterface $passwordEncoder, RequestStack $requestStack, EventDispatcherInterface $eventDispatcher)
    {
        $this->users = $users;
        $this->slugify = $slugify;
        $this->passwordEncoder = $passwordEncoder;
        $this->requestStack = $requestStack;
        $this->eventDispatcher = $eventDispatcher;
    }

    public function createNewUser($username, $email, $password = null, $role = 'ROLE_USER')
    {
        $user = $this->users->newEntity();

        $user->setUsername($username);
        $user->setEmail($email);

        $slug = $this->slugify->slugify($username);

        if ($this->users->query()->where('slug', $slug)->count()) {
            $slug .= time();
        }

        $user->setSlug($slug);

        if ($password !== null) {
            $encodedPassword = $this->passwordEncoder->encodePassword($password, null);
            $user->setPassword($encodedPassword);
        }

        $user->setRoleList($role);

        $ip = $this->requestStack->getCurrentRequest()->getClientIp();
        $user->setRegistrationIp($ip);
        $user->setLastIp($ip);

        $user->setJoined(time());

        $event = new CreateUserEvent($user);
        $this->eventDispatcher->dispatch('user.create', $event);

        return $user;
    }
}
Hey sorry for late reply, was busy. Anyway after some searching i think i found the php you were talking about. ```` &amp;lt;?php /** * User: Andy * Date: 13/01/15 * Time: 11:55 */ namespace AVCMS\Bundles\Users\User; use AVCMS\Bundles\Users\Event\CreateUserEvent; use AVCMS\Bundles\Users\Model\Users; use Cocur\Slugify\Slugify; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface; class NewUserBuilder { /** * @var Users */ private $users; /** * @var Slugify */ private $slugify; /** * @var PasswordEncoderInterface */ private $passwordEncoder; private $requestStack; private $eventDispatcher; public function __construct(Users $users, Slugify $slugify, PasswordEncoderInterface $passwordEncoder, RequestStack $requestStack, EventDispatcherInterface $eventDispatcher) { $this-&amp;gt;users = $users; $this-&amp;gt;slugify = $slugify; $this-&amp;gt;passwordEncoder = $passwordEncoder; $this-&amp;gt;requestStack = $requestStack; $this-&amp;gt;eventDispatcher = $eventDispatcher; } public function createNewUser($username, $email, $password = null, $role = &#039;ROLE_USER&#039;) { $user = $this-&amp;gt;users-&amp;gt;newEntity(); $user-&amp;gt;setUsername($username); $user-&amp;gt;setEmail($email); $slug = $this-&amp;gt;slugify-&amp;gt;slugify($username); if ($this-&amp;gt;users-&amp;gt;query()-&amp;gt;where(&#039;slug&#039;, $slug)-&amp;gt;count()) { $slug .= time(); } $user-&amp;gt;setSlug($slug); if ($password !== null) { $encodedPassword = $this-&amp;gt;passwordEncoder-&amp;gt;encodePassword($password, null); $user-&amp;gt;setPassword($encodedPassword); } $user-&amp;gt;setRoleList($role); $ip = $this-&amp;gt;requestStack-&amp;gt;getCurrentRequest()-&amp;gt;getClientIp(); $user-&amp;gt;setRegistrationIp($ip); $user-&amp;gt;setLastIp($ip); $user-&amp;gt;setJoined(time()); $event = new CreateUserEvent($user); $this-&amp;gt;eventDispatcher-&amp;gt;dispatch(&#039;user.create&#039;, $event); return $user; } } ````

I think that was teh wrong php i sent, this looks more like what you had asked me for here. I just dont know which bit to add there.

 <?php
/**
 * User: Andy
 * Date: 10/02/2014
 * Time: 16:09
 */

namespace AVCMS\Bundles\Users\Controller;

use AV\Form\FormError;
use AVCMS\Bundles\Users\Form\LoginForm;
use AVCMS\Bundles\Users\Form\RegistrationForm;
use AVCMS\Bundles\Users\Model\EmailValidationKey;
use AVCMS\Bundles\Users\Model\User;
use AVCMS\Core\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\Util\SecureRandom;

class UserAuthController extends Controller
{
    /**
     * Shows a login form and displays any authentication errors
     *
     * @param Request $request
     * @return Response
     */
    public function loginAction(Request $request)
    {
        $loginFormBlueprint = new LoginForm();
        $loginFormBlueprint->setAction($this->generateUrl('login_check'));
        $loginForm = $this->buildForm($loginFormBlueprint);

        if ($request->attributes->has(Security::AUTHENTICATION_ERROR)) {
            $errorMessage = $request->attributes->get(Security::AUTHENTICATION_ERROR)->getMessage();
        } elseif($request->getSession()->get(Security::AUTHENTICATION_ERROR)) {
            $errorMessage = $request->getSession()->get(Security::AUTHENTICATION_ERROR)->getMessage();
        }
        if ($request->get('reauth')) {
            $loginForm->addCustomErrors([new FormError(null, 'Please re-authenticate to access this area', true)]);
        }

        if (isset($errorMessage)) {
            $loginForm->addCustomErrors(array(new FormError(null, $errorMessage, true)));
        }

        $loginForm->setData('username', $request->getSession()->get(Security::LAST_USERNAME));

        return new Response($this->render('@Users/login.twig', array('login_form' => $loginForm->createView())));
    }

    /**
     * Handles all aspects of user registration
     *
     * @param Request $request
     * @return Response
     */
    public function registerAction(Request $request)
    {
        if (!$this->setting('users_enabled')) {
            throw $this->createNotFoundException();
        }

        $users = $this->model('Users');

        $form = $this->buildForm(new RegistrationForm(), $request);

        if ($form->isValid() && $form->getData('password1') == $form->getData('password2')) {
            if ($this->setting('validate_email_addresses')) {
                $role = 'ROLE_NOT_VALIDATED';
            }
            else {
                $role = 'ROLE_USER';
            }

            $user = $this->container->get('users.new_user_builder')->createNewUser($form->getData('username'), $form->getData('email'), $form->getData('password1'), $role);

            $users->insert($user);

            $this->sendValidationEmail($user);

            return new Response($this->render('@Users/register_complete.twig', ['emailValidation' => $this->setting('validate_email_addresses'), 'user' => $user]));
        }
        elseif($form->isSubmitted() && $form->getData('password1') != $form->getData('password2')) {
            $form->addCustomErrors([new FormError('password2', 'The entered passwords do not match', true)]);
        }

        return new Response($this->render('@Users/register.twig', array('registration_form' => $form->createView())));
    }

    /**
     * Validates a user's email address
     *
     * @param $userId
     * @param $code
     * @return Response
     */
    public function validateEmailAction($userId, $code)
    {
        $emailValidationKeys = $this->model('EmailValidationKeys');
        if ($emailValidationKeys->isValidKey($userId, $code)) {
            $users = $this->model('Users');
            $users->query()->where('id', $userId)->update(['role_list' => 'ROLE_USER']);

            $emailValidationKeys->deleteUserKey($userId);

            $success = true;
        }
        else {
            $success = false;
        }

        return new Response($this->render('@Users/validate_email.twig', ['success' => $success]));
    }

    public function resendValidationEmailAction()
    {
        if (!$this->userLoggedIn() || $this->activeUser()->getRoleList() !== 'ROLE_NOT_VALIDATED') {
            throw new AccessDeniedException;
        }

        $this->sendValidationEmail($this->activeUser());

        return $this->redirect('home', [], 302, 'success', $this->trans('Email sent'));
    }

    private function sendValidationEmail(User $user)
    {
        if ($this->setting('validate_email_addresses')) {
            $randomGen = new SecureRandom();

            $emailKey = $this->model('EmailValidationKeys')->query()->where('user_id', $user->getId())->first();

            if (!$emailKey) {
                $emailKey = new EmailValidationKey();
                $emailKey->setCode(bin2hex($randomGen->nextBytes(20)));
                $emailKey->setGenerated(time());
                $emailKey->setUserId($user->getId());
                $this->model('EmailValidationKeys')->insert($emailKey);
            }

            $mailer = $this->container->get('mailer');

            $email = $mailer->newEmail($this->trans('Validate your new account'), $this->render("@Users/email/email.validate_address.twig", ['emailKey' => $emailKey]), 'text/html', 'UTF-8');
            $email->setTo($user->getEmail());

            $mailer->send($email);
        }
    }
}
I think that was teh wrong php i sent, this looks more like what you had asked me for here. I just dont know which bit to add there. ```` &amp;lt;?php /** * User: Andy * Date: 10/02/2014 * Time: 16:09 */ namespace AVCMS\Bundles\Users\Controller; use AV\Form\FormError; use AVCMS\Bundles\Users\Form\LoginForm; use AVCMS\Bundles\Users\Form\RegistrationForm; use AVCMS\Bundles\Users\Model\EmailValidationKey; use AVCMS\Bundles\Users\Model\User; use AVCMS\Core\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Util\SecureRandom; class UserAuthController extends Controller { /** * Shows a login form and displays any authentication errors * * @param Request $request * @return Response */ public function loginAction(Request $request) { $loginFormBlueprint = new LoginForm(); $loginFormBlueprint-&amp;gt;setAction($this-&amp;gt;generateUrl(&#039;login_check&#039;)); $loginForm = $this-&amp;gt;buildForm($loginFormBlueprint); if ($request-&amp;gt;attributes-&amp;gt;has(Security::AUTHENTICATION_ERROR)) { $errorMessage = $request-&amp;gt;attributes-&amp;gt;get(Security::AUTHENTICATION_ERROR)-&amp;gt;getMessage(); } elseif($request-&amp;gt;getSession()-&amp;gt;get(Security::AUTHENTICATION_ERROR)) { $errorMessage = $request-&amp;gt;getSession()-&amp;gt;get(Security::AUTHENTICATION_ERROR)-&amp;gt;getMessage(); } if ($request-&amp;gt;get(&#039;reauth&#039;)) { $loginForm-&amp;gt;addCustomErrors([new FormError(null, &#039;Please re-authenticate to access this area&#039;, true)]); } if (isset($errorMessage)) { $loginForm-&amp;gt;addCustomErrors(array(new FormError(null, $errorMessage, true))); } $loginForm-&amp;gt;setData(&#039;username&#039;, $request-&amp;gt;getSession()-&amp;gt;get(Security::LAST_USERNAME)); return new Response($this-&amp;gt;render(&#039;@Users/login.twig&#039;, array(&#039;login_form&#039; =&amp;gt; $loginForm-&amp;gt;createView()))); } /** * Handles all aspects of user registration * * @param Request $request * @return Response */ public function registerAction(Request $request) { if (!$this-&amp;gt;setting(&#039;users_enabled&#039;)) { throw $this-&amp;gt;createNotFoundException(); } $users = $this-&amp;gt;model(&#039;Users&#039;); $form = $this-&amp;gt;buildForm(new RegistrationForm(), $request); if ($form-&amp;gt;isValid() &amp;amp;&amp;amp; $form-&amp;gt;getData(&#039;password1&#039;) == $form-&amp;gt;getData(&#039;password2&#039;)) { if ($this-&amp;gt;setting(&#039;validate_email_addresses&#039;)) { $role = &#039;ROLE_NOT_VALIDATED&#039;; } else { $role = &#039;ROLE_USER&#039;; } $user = $this-&amp;gt;container-&amp;gt;get(&#039;users.new_user_builder&#039;)-&amp;gt;createNewUser($form-&amp;gt;getData(&#039;username&#039;), $form-&amp;gt;getData(&#039;email&#039;), $form-&amp;gt;getData(&#039;password1&#039;), $role); $users-&amp;gt;insert($user); $this-&amp;gt;sendValidationEmail($user); return new Response($this-&amp;gt;render(&#039;@Users/register_complete.twig&#039;, [&#039;emailValidation&#039; =&amp;gt; $this-&amp;gt;setting(&#039;validate_email_addresses&#039;), &#039;user&#039; =&amp;gt; $user])); } elseif($form-&amp;gt;isSubmitted() &amp;amp;&amp;amp; $form-&amp;gt;getData(&#039;password1&#039;) != $form-&amp;gt;getData(&#039;password2&#039;)) { $form-&amp;gt;addCustomErrors([new FormError(&#039;password2&#039;, &#039;The entered passwords do not match&#039;, true)]); } return new Response($this-&amp;gt;render(&#039;@Users/register.twig&#039;, array(&#039;registration_form&#039; =&amp;gt; $form-&amp;gt;createView()))); } /** * Validates a user&#039;s email address * * @param $userId * @param $code * @return Response */ public function validateEmailAction($userId, $code) { $emailValidationKeys = $this-&amp;gt;model(&#039;EmailValidationKeys&#039;); if ($emailValidationKeys-&amp;gt;isValidKey($userId, $code)) { $users = $this-&amp;gt;model(&#039;Users&#039;); $users-&amp;gt;query()-&amp;gt;where(&#039;id&#039;, $userId)-&amp;gt;update([&#039;role_list&#039; =&amp;gt; &#039;ROLE_USER&#039;]); $emailValidationKeys-&amp;gt;deleteUserKey($userId); $success = true; } else { $success = false; } return new Response($this-&amp;gt;render(&#039;@Users/validate_email.twig&#039;, [&#039;success&#039; =&amp;gt; $success])); } public function resendValidationEmailAction() { if (!$this-&amp;gt;userLoggedIn() || $this-&amp;gt;activeUser()-&amp;gt;getRoleList() !== &#039;ROLE_NOT_VALIDATED&#039;) { throw new AccessDeniedException; } $this-&amp;gt;sendValidationEmail($this-&amp;gt;activeUser()); return $this-&amp;gt;redirect(&#039;home&#039;, [], 302, &#039;success&#039;, $this-&amp;gt;trans(&#039;Email sent&#039;)); } private function sendValidationEmail(User $user) { if ($this-&amp;gt;setting(&#039;validate_email_addresses&#039;)) { $randomGen = new SecureRandom(); $emailKey = $this-&amp;gt;model(&#039;EmailValidationKeys&#039;)-&amp;gt;query()-&amp;gt;where(&#039;user_id&#039;, $user-&amp;gt;getId())-&amp;gt;first(); if (!$emailKey) { $emailKey = new EmailValidationKey(); $emailKey-&amp;gt;setCode(bin2hex($randomGen-&amp;gt;nextBytes(20))); $emailKey-&amp;gt;setGenerated(time()); $emailKey-&amp;gt;setUserId($user-&amp;gt;getId()); $this-&amp;gt;model(&#039;EmailValidationKeys&#039;)-&amp;gt;insert($emailKey); } $mailer = $this-&amp;gt;container-&amp;gt;get(&#039;mailer&#039;); $email = $mailer-&amp;gt;newEmail($this-&amp;gt;trans(&#039;Validate your new account&#039;), $this-&amp;gt;render(&quot;@Users/email/email.validate_address.twig&quot;, [&#039;emailKey&#039; =&amp;gt; $emailKey]), &#039;text/html&#039;, &#039;UTF-8&#039;); $email-&amp;gt;setTo($user-&amp;gt;getEmail()); $mailer-&amp;gt;send($email); } } } ````

Did you build this php code using symfony ?
Or are you using any exisitng framework/CMS ?
If yes, what is it's name ?

Did you build this php code using symfony ? Or are you using any exisitng framework/CMS ? If yes, what is it&#039;s name ?
edited Dec 7 '15 at 6:57 pm
12
944
28
4
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft