Registers new account.
@return int
4564
public function register()
    {
        $this->setPassword($this->password);
        $this->generateActivationToken();
        $this->generateAuthKey();
        $this->status = self::STATUS_REGISTERED;

        if (!$this->save()) {
            return self::RESP_ERR;
        }
        if (empty($this->email)) {
            return self::RESP_NO_EMAIL_ERR;
        }
        if (!$this->sendActivationEmail()) {
            return self::RESP_EMAIL_SEND_ERR;
        }
        return self::RESP_OK;
    }
45836
public function registerAction()
    {
        $entity  = new PreUser();
        $request = $this->getRequest();
        $form    = $this->createForm(new RegistrationForm(), $entity);
        $form->bindRequest($request);

        if ($form->isValid()) {

            $entity->setRegisteredOn(new \DateTime('now'));
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            //Generate Token based on ID assigned
            $entity->setToken(base_convert($entity->getId() + 100000000, 10, 32));
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('launcher_done', array('token' => $entity->getToken())));

        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }
1164084
public function register()
    {
        $this->app->singleton('gravatar-helper', function ($app) {
            return new Gravatar(
                $app['config']->get('gravatar-helper.size'),
                $app['config']->get('gravatar-helper.rating'),
                $app['config']->get('gravatar-helper.image_set')
            );
        });
    }
512781
public function register()
    {
        $this->mergeConfigFrom(__DIR__ . '/config/laravel-random.php', 'laravel-random');
        
        $this->app->singleton('random', function ($app) {
            $factory = new \RandomLib\Factory;
            
            $strength = $app['config']->get('laravel-random.strength');
            
            if ($strength === 'high') {
                return $factory->getHighStrengthGenerator();
            }
            
            if ($strength === 'medium') {
                return $factory->getMediumStrengthGenerator();
            }
            
            return $factory->getLowStrengthGenerator();
        });
    }
19734
public function register()
    {
        if ($this->getIsNewRecord() == false) {
            throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
        }
        $this->password = Yii::$app->settings->get('user.enableGeneratingPassword') ? PasswordHelper::generate(8) : $this->password;
        if ($this->scenario == self::SCENARIO_EMAIL_REGISTER) {
            $this->email_confirmed_at = Yii::$app->settings->get('user.enableConfirmation') ? null : time();
        }
        $this->trigger(self::BEFORE_REGISTER);
        if (!$this->save()) {
            return false;
        }
        if (Yii::$app->settings->get('user.enableConfirmation') && !empty($this->email)) {
            /** @var UserToken $token */
            $token = new UserToken(['type' => UserToken::TYPE_CONFIRMATION]);
            $token->link('user', $this);
            Yii::$app->sendMail($this->email, Yii::t('yuncms', 'Welcome to {0}', Yii::$app->name), 'user/welcome', ['user' => $this, 'token' => isset($token) ? $token : null, 'module' => Yii::$app->getModule('user'), 'showPassword' => false]);
        } else {
            Yii::$app->user->login($this, Yii::$app->settings->get('user.rememberFor'));
        }
        $this->trigger(self::AFTER_REGISTER);
        return true;
    }
593938
protected function registerFiscalYearInterface()
	{
		$this->app->bind('Mgallegos\DecimaAccounting\Accounting\Repositories\FiscalYear\FiscalYearInterface', function($app)
		{
			$AuthenticationManager = $app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface');

			return new \Mgallegos\DecimaAccounting\Accounting\Repositories\FiscalYear\EloquentFiscalYear(new FiscalYear(), $AuthenticationManager->getCurrentUserOrganizationConnection());
		});
	}
589742
public function register()
    {
        $this->app->singleton('antares.acl', function ($app) {
            return new Factory($app->make('auth.driver'));
        });

        $this->app->bind('antares.auth.permission', function () {
            return new Permission();
        });
        $this->app->bind('antares.auth.action', function () {
            return new Action();
        });
    }
255615
public function register()
    {
        return add_meta_box(
            $this->model->getSlug(),
            $this->model->getSingular(),
            [$this, 'fill'],
            $this->belongsTo,
            $this->model->getArgument('location'),
            $this->model->getArgument('priority')
        );
    }
1197216
protected function registerAccountChartTypeInterface()
	{
		$this->app->bind('Mgallegos\DecimaAccounting\System\Repositories\AccountChartType\AccountChartTypeInterface', function()
		{
			return new \Mgallegos\DecimaAccounting\System\Repositories\AccountChartType\EloquentAccountChartType( new AccountChartType() );
		});
	}
524317
public function actionCreate()
    {
        $model = new Account();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->account_id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
1058644
public function register()
    {
        $this->app->bind('avatar', function (Application $app) {
            $config = $app->make('config');
            $cache = $app->make('cache.store');

            $avatar = new Avatar($config->get('laravolt.avatar'), $cache);
            $avatar->setGenerator($app['avatar.generator']);

            return $avatar;
        });

        $this->app->bind('avatar.generator', function (Application $app) {
            $config = $app->make('config');
            $class = $config->get('laravolt.avatar.generator');

            return new $class;
        });
    }
1238187
protected function registerCurrency()
    {
        $this->app->singleton(Currency::class, function ($app) {
            $repository = new Currency;

            return $repository->setLocale($app['config']['app.locale'])->setFallbackLocale($app['config']['app.fallback_locale']);
        });

        $this->app->alias(Currency::class, 'intl.currency');
    }
39158
public function register()
    {
        $this->app->bind(Northstar::class, function ($app) {
            $client = new LaravelNorthstar(config('services.northstar'));
            $client->setLogger($app['log']);

            return $client;
        });

        $this->app->bind(Blink::class, function ($app) {
            $client = new Blink(config('services.blink'));
            $client->setLogger($app['log']);

            return $client;
        });

        $this->app->bind(Gladiator::class, function ($app) {
            $client = new Gladiator(config('services.gladiator'));
            $client->setLogger($app['log']);

            return $client;
        });

        // Set alias for requesting from app() helper.
        $this->app->alias(Northstar::class, 'gateway.northstar');
        $this->app->alias(Blink::class, 'gateway.blink');
        $this->app->alias(Gladiator::class, 'gateway.gladiator');

        // Backwards-compatibility.
        $this->app->alias(Northstar::class, 'northstar');

        // Register token validator w/ config dependency.
        $this->app->bind(Token::class, function ($app) {
            $key = config('auth.providers.northstar.key');

            // If not set, check old suggested config location:
            if (! $key) {
                $key = config('services.northstar.key');
            }

            return new Token(new LaravelRequestHandler(), $key);
        });

        // Register custom Gateway authentication guard.
        Auth::extend('gateway', function ($app, $name, array $config) {
            $provider = Auth::createUserProvider($config['provider']);

            return new GatewayGuard($provider, $app[Request::class]);
        });

        // Register custom Gateway user provider.
        Auth::provider('gateway', function ($app, array $config) {
            return new GatewayUserProvider();
        });
    }
507144
public function register()
    {

        $this->app->bind('mandrill_mail', function($app){
            return new Mail($app['config']['services']['mandrill']['secret']);
        });

        $this->app->bind('Weblee\Mandrill\Mail', function($app){
            return new Mail($app['config']['services']['mandrill']['secret']);
        });

    }
156624
protected function registerNumber()
    {
        $this->app->singleton(Number::class, function ($app) {
            $repository = new Number;

            return $repository->setLocale($app['config']['app.locale'])->setFallbackLocale($app['config']['app.fallback_locale']);
        });

        $this->app->alias(Number::class, 'intl.number');
    }
77689
public function register()
    {
        Paginator::setCurrentPageFinder(function(){
            if (isset($_GET['page'])) {
                $page = first(GUMP::xss_clean([$_GET['page']]));

                return $page;
            }else{
                return 1;
            }
        });


        $request = App::make('http.request');
        Paginator::setRequestPathFinder(function() use ($request){
            if ($request instanceof Request) {
                return $request->getBaseWithoutQuery();
            }
        });
    }
54676
public function register()
    {
        if (!Configure::read('CM.Register')) {
            return $this->redirect('/');
        }

        // Redirect if user is already logged in
        if ($this->authUser) {
            return $this->redirect('/login');
        }

        $user = $this->Users->newEntity();

        if ($this->request->is('post')) {
            $user = $this->Users->patchEntity($user, $this->request->data);

            $user->set('role_id', 3);
            $user->set('active', true);

            if (Configure::read('CM.ActivationOnRegister')) {
                $user->set('activation_key', $this->Users->generateActivationKey());
                $user->set('active', false);
            }

            if ($this->Users->save($user)) {
                // firing an event: afterRegister
                $_event = new Event('Controller.Users.afterRegister', $this, [
                    'user' => $user
                ]);
                $this->eventManager()->dispatch($_event);

                // firing an event: afterInvalidRegister
                $_event = new Event('Controller.Users.afterInvalidRegister', $this, [
                    'user' => $user
                ]);
                $this->eventManager()->dispatch($_event);

                $this->Flash->success(__('Registered succesfully!'));
                return $this->redirect(['action' => 'login']);
            } else {
                $this->Flash->error(__('Could not register. Please, try again.'));
            }
        }

        $this->set(compact('user'));

        $this->render(Configure::read('CM.UserViews.register'));
    }