Create a user

@param  string  $first_name
@param  string  $last_name
@param  string  $email
@param  int  $active
@param  string  $password
@return Post
514313
public function create($first_name, $last_name, $email, $active, $password)
	{
		$password = Hash::make($password);

		return User::create(compact('first_name', 'last_name', 'email', 'password', 'active'));
	}
823560
public function make(string $username, string $password, string $email): User
    {
        $this->validate(compact('username', 'password', 'email'));

        $user = wp_create_user($username, $password, $email);

        if (is_a($user, 'WP_Error')) {
            if ('existing_user_login' === $user->get_error_code()) {
                throw new DuplicateUserException($user->get_error_message());
            }

            throw new UserException($user->get_error_message());
        }

        return $this->get($user);
    }
1120485
public function addAdminUser($email, $username = 'admin', $password = 'admin1234')
    {
        $options = $this->getServiceLocator()->get('zfcuser_module_options');
        $cost = $options->getPasswordCost();
        $crypt = new Bcrypt();
        $crypt->setCost($cost);
        $adminRole = $this->getEntityManager()->getRepository('JaztecAcl\Entity\Acl\Role')->findOneBy(['name'  => 'admin']);
        $user = new User();
        $user->setUsername($username)
            ->setPassword($crypt->create($password))
            ->setEmail($email)
            ->setRole($adminRole)
            ->setFirstName('Admin')
            ->setLastName('User')
            ->setDisplayName('Administration user')
            ->setActive(true)
            ->setState(true);
        $this->getEntityManager()->persist($user);
        $this->getEntityManager()->flush($user);
    }
1010798
public function create(string $user_name, string $real_name, string $email, string $password): User
    {
        DB::table('user')->insert([
            'user_name' => $user_name,
            'real_name' => $real_name,
            'email'     => $email,
            'password'  => password_hash($password, PASSWORD_DEFAULT),
        ]);

        $user_id = (int) DB::connection()->getPdo()->lastInsertId();

        return new User($user_id, $user_name, $real_name, $email);
    }
975315
public function addAuthor($name=null, $user=null, $email=null)
    {
        $this->_authors[] = array(
            'name' =>$name,
            'user' =>$user,
            'email'=>$email
        );
        $author = $this->_packageXml->authors->addChild('author');
        $author->addChild('name', $name);
        $author->addChild('user', $user);
        $author->addChild('email', $email);
        return $this;
    }
1111273
def create_user(self, username, password, family_name, given_name, primary_email,
            details={}):
        
        self.assert_has_permission('scim.write')

        data = {
            'userName': username,
            'password': password,
            'name': {
                'familyName': family_name,
                'givenName': given_name,
                },
            'emails': [{
                'value': primary_email,
                'primary': True,
                }]
            }

        if details:
            data.update(details)

        return self._post_user(data)
505308
function create(req, res, next) {
  var options = req.connectionOptions;
  req.user = req.user || {};
  var params = {
    userEmail: req.user.email || req.body.updatedBy
  };

  options = _.extend(options, params);

  logger.debug("Middleware: create form: ", {options: options});

  forms.updateForm(options, req.body, formsResultHandlers(constants.resultTypes.forms, req, next));
}
743015
public static function login($key, $email, $password)
    {
        $params = [
            "username" => $email,
            "password" => $password,
        ];

        $headers = [
            'W-Key' => $key
        ];

        $login = new static();
        $response = $login->makeRequest("login", self::METHOD_POST, $params, $headers);

        return $response;
    }
1213858
function createUser(ctx, next) {
            client.post({
                path: '/v1/users/'
            }, {
                username: opts.username,
                email: opts.email,
                password: opts.password
            }, function _afterCreateUser(err, req, res, body) {
                if (err && !res) {  // e.g. connect error
                    return next(err);
                }
                ctx.createStatusCode = res.statusCode;
                ctx.createErr = err;
                ctx.createBody = body;
                next();
            });
        }
1173956
public static function _Login ($email, $password)
	{
		
		// Authenticate
		
		if (static::_Authenticate ($email, $password) !== TRUE)
		{
			return 'authentication_fail';
		}
		
		// Get user
		
		$user	= static::_readFromEmail ($email);
		
		if (!$user)
		{
			return 'invalid_user';
		}
		
		// Reset password
		
		$user->reset ('password');
		
		// Set timestamps
		
		$user->loginTimestamp	= time ();
		$user->lastAction		= $user->loginTimestamp;
		
		// Set session
		
		$user->setSessionData ();
		
		// Return user object
		
		return $user;
		
	}
847745
protected function createTemporaryAccount($accountIdentifier, $password, $firstName, $lastName)
    {
        if (strlen($firstName) === 0 && strlen($lastName) === 0) {
            $firstName = 'Santa';
            $lastName = 'Claus';
        }

        $user = new User();
        $user->setName(new PersonName('', $firstName, '', $lastName));
        $user->getPreferences()->set('context.workspace', 'user-' . $accountIdentifier);
        $this->partyRepository->add($user);

        $account = $this->accountFactory->createAccountWithPassword($accountIdentifier, $password, array('Neos.Neos:Editor'), 'Neos.Neos:Backend');
        $this->partyService->assignAccountToParty($account, $user);
        $account->setExpirationDate(new \DateTime('+1 week'));

        $this->accountRepository->add($account);
    }
1335570
def add_user(
        self,
        username,
        first_name,
        last_name,
        email,
        role,
        password="",
        hashed_password="",
    ):
        
        try:
            user = self.user_model()
            user.first_name = first_name
            user.last_name = last_name
            user.username = username
            user.email = email
            user.active = True
            user.roles.append(role)
            if hashed_password:
                user.password = hashed_password
            else:
                user.password = generate_password_hash(password)
            self.get_session.add(user)
            self.get_session.commit()
            log.info(c.LOGMSG_INF_SEC_ADD_USER.format(username))
            return user
        except Exception as e:
            log.error(c.LOGMSG_ERR_SEC_ADD_USER.format(str(e)))
            self.get_session.rollback()
            return False
56404
def create_redditor(self, user_name, password, email=''):
        
        data = {'email': email,
                'passwd': password,
                'passwd2': password,
                'user': user_name}
        return self.request_json(self.config['register'], data=data)
992385
def create
      user = Blogo::User.find_by_email(params[:email])
      if user && user.authenticate(params[:password])
        session[:blogo_user_id] = user.id
        redirect_to blogo_admin_url, notice: I18n.translate('blogo.admin.logged_in')
      else
        flash.now.alert = I18n.translate('blogo.admin.login_fail')
        render "new"
      end
    end
392736
public function updateUser(User $user, $name, $emailAddress, $password = null, $isAdmin = null)
    {
        $user->setName($name);
        $user->setEmail($emailAddress);

        if (!empty($password)) {
            $user->setHash(password_hash($password, PASSWORD_DEFAULT));
        }

        if (!is_null($isAdmin)) {
            $user->setIsAdmin(($isAdmin ? 1 : 0));
        }

        return $this->store->save($user);
    }
1362552
public static function createAdmin(string $name, string $email, string $password)
    {
        if (static::where('email', $email)->exists()) {
            throw new Exception('User exist');
        }

        $permissions = collect();

        Dashboard::getPermission()
            ->collapse()
            ->each(function ($item) use ($permissions) {
                $permissions->put($item['slug'], true);
            });

        $user = static::create([
            'name'        => $name,
            'email'       => $email,
            'password'    => Hash::make($password),
            'permissions' => $permissions,
        ]);

        $user->notify(new DashboardNotification([
            'title'   => "Welcome {$name}",
            'message' => 'You can find the latest news of the project on the website',
            'action'  => 'https://orchid.software/',
            'type'    => DashboardNotification::INFO,
        ]));
    }
407373
def create
      user = Lines::User.find_by(email: params[:email])
      if user && user.authenticate(params[:password])
        session[:user_id] = user.id
        redirect_to admin_root_url
      else
        flash.now[:error] = t('lines.login_error')
        render "new"
      end
    end