Get information to create the user
964790
protected function getInformation()
    {
        $dbColumns = $this->model->getConnection()->select('SHOW COLUMNS FROM ' . $this->model->getTable());
        $availableColumns = [];
        $askColumn = null;
        $availableComparators = ['=', '<', '>', '<=', '>=', 'LIKE', 'like'];
        $comparator = null;

        $this->info("Columns available to search user against");
        foreach ($dbColumns as $value) {
            $availableColumns[] = $value->Field;
            $this->info($value->Field);
        }

        while(! in_array($askColumn, $availableColumns)) {
            $askColumn = $this->ask('Which column do you want to search against?');
        }

        while(! in_array($comparator, $availableComparators)) {
            $comparator = $this->ask('Which sql operator do you want to use? e.g. =, LIKE etc');
        }

        $search = $this->ask('Value of Search term');

        $results = $this->model->where($askColumn, $comparator, $search)->get();

        $this->presentUsersToSelect($results);

        $this->selectTypeOfPassword();

        $this->persist();
    }
898424
function createUser(req, res, next){

        // the HTML form names are conveniently named the same as
        // the UserApp fields...
        var user = req.body;

        // Create the user in UserApp
        UserApp.User.save(user, function(err, user){

            // We can just pass through messages like "Password must be at least 5 characters." etc.
            if (err) return res.render('signup', {user: false, message: err.message});

            // UserApp passport needs a username parameter
            req.body.username = req.body.login;

            //on to authentication
            next();
        });

    // authenticate the user using passport
}
1046463
def info_user(self,userid):
        ''''''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/standings.phtml',"User-Agent": user_agent}
        req = self.session.get('http://'+self.domain+'/playerInfo.phtml?pid='+userid,headers=headers).content
        soup = BeautifulSoup(req)
        title = soup.title.string
        community = soup.find_all('table',border=0)[1].a.text
        info = []
        info.append(title)
        info.append(community)
        for i in soup.find_all('table',border=0)[1].find_all('td')[1:]:
            info.append(i.text)
        for i in soup.find('table',cellpadding=2).find_all('tr')[1:]:
            cad = i.find_all('td')
            numero=cad[0].text
            nombre=cad[2].text.strip()
            team=cad[3].find('img')['alt']
            precio=cad[4].text.replace(".","")
            puntos=cad[5].text
            posicion=cad[6].text
            info.append([numero,nombre,team,precio,puntos,posicion])
        return info
1046473
def get_user_if_exists(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        return {'is_new': False}
    try:
        username = details.get('username')

        # Return the user if it exists
        return {
            'is_new': False,
            'user': User.objects.get(username=username)
        }
    except User.DoesNotExist:
        # Fall to the default return value
        pass

    # Nothing to return since we don't have a user
    return {}
620574
def get_userinfo(self):
        """"""
        wanted_fields = ["name", "mobile", "orgEmail", "position", "avatar"]
        userinfo = {k: self.json_response.get(k, None) for k in wanted_fields}
        return userinfo
871007
def create(self, user_id, name, department=None, position=None,
               mobile=None, gender=0, tel=None, email=None,
               weixin_id=None, extattr=None):
        
        user_data = optionaldict()
        user_data['userid'] = user_id
        user_data['name'] = name
        user_data['gender'] = gender
        user_data['department'] = department
        user_data['position'] = position
        user_data['mobile'] = mobile
        user_data['tel'] = tel
        user_data['email'] = email
        user_data['weixinid'] = weixin_id
        user_data['extattr'] = extattr

        return self._post(
            'user/create',
            data=user_data
        )
341325
def get_user(self, uid):
		""""""
		
		r = requests.get(api_url+'users/'+str(uid)+'/', headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return User(r.json())
1374929
public function createUser()
    {
        $data['name']     = $this->ask('Administrator name');
        $data['email']    = $this->ask('Administrator email');
        $data['password'] = bcrypt($this->secret('Administrator password'));
        $data['role_id']  = 1;
        User::create($data);
        $this->info('User has been created');
    }
269091
def create(self, user: str, *,
               pwd: str, sgrp: str, comment: str=None) -> None:
        """"""
        data = {
            'action': 'add',
            'user': user,
            'pwd': pwd,
            'grp': 'users',
            'sgrp': sgrp
        }

        if comment:
            data['comment'] = comment

        self._request('post', URL, data=data)
134518
def register(self):
        
        user = {}

        print('--------------------------------------------------------------')
        print('Welcome to the user registration process.')
        print('--------------------------------------------------------------')
        print("To continue you must fill the following fields.")
        for attribute, value in self.attributes.items():

            is_required = attribute in self.required
            field_name = value['field_name']
            pattern = value['pattern']

            if attribute != 'password':
                user[attribute] = self.ask_question(field_name, pattern,
                                                    is_required)
            else:
                user[attribute] = self.ask_question(field_name, pattern,
                                                    password=True)

        return self._users_client.register(user)
31800
def create_user(name, email, datum = nil)
      current_path = '/api/v1/users'
      payload = { name: name, mail: email }
      payload.merge!(datum) unless datum.nil?
      @conn.post(current_path, payload.to_json)
    end
228762
function (req, res) {
    User.create({ firstName: req.body.firstName, lastName: req.body.lastName}).exec(function (err, user) {
      if(err) return res.json({ err: err }, 500);
      else res.json(user);
    });
  }
786387
def get_user_info(apikey, username, password):
    
    user = authenticate(username, password)
    site = Site.objects.get_current()
    return user_structure(user, site)
719747
def users_info(self, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_get('users.info', userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_get('users.info', username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
212719
def get_user(username, **kwargs):
    '''
    
    '''
    command = 'show run | include "^username {0} password 5 "'.format(username)
    info = ''
    info = show(command, **kwargs)
    if isinstance(info, list):
        info = info[0]
    return info
1322129
def _create_user(self):
        

        def error(field, message):
            if field:
                message = "%s: %s" % (field, message)
            self.context.plone_utils.addPortalMessage(message, 'error')
            return self.request.response.redirect(
                self.context.absolute_url() + "/login_details")

        form = self.request.form
        contact = self.context

        password = safe_unicode(form.get('password', '')).encode('utf-8')
        username = safe_unicode(form.get('username', '')).encode('utf-8')
        confirm = form.get('confirm', '')
        email = safe_unicode(form.get('email', '')).encode('utf-8')

        if not username:
            return error('username', PMF("Input is required but not given."))

        if not email:
            return error('email', PMF("Input is required but not given."))

        reg_tool = self.context.portal_registration
        # properties = self.context.portal_properties.site_properties
        # if properties.validate_email:
        #     password = reg_tool.generatePassword()
        # else:
        if password != confirm:
            return error('password', PMF("Passwords do not match."))

        if not password:
            return error('password', PMF("Input is required but not given."))

        if not confirm:
            return error('password', PMF("Passwords do not match."))

        if len(password) < 5:
            return error('password', PMF("Passwords must contain at least 5 "
                                         "characters."))
        for user in self.get_users():
            userid = user.get("id", None)
            if userid is None:
                continue
            user_obj = api.get_user(userid)
            if user_obj.getUserName() == username:
                msg = "Username {} already exists, please, choose " \
                      "another one.".format(username)
                return error(None, msg)

        try:
            reg_tool.addMember(username,
                               password,
                               properties={
                                   'username': username,
                                   'email': email,
                                   'fullname': username})
        except ValueError, msg:
            return error(None, msg)

        # set the user to the contact
        contact.setUser(username)

        # Additional groups for LabContact users only!
        # -> This is not visible in the Client Contact Form
        if "groups" in self.request and self.request["groups"]:
            groups = self.request["groups"]
            if not type(groups) in (list, tuple):
                groups = [groups, ]
            for group in groups:
                group = self.portal_groups.getGroupById(group)
                group.addMember(username)

        if self.request.get('mail_me', 0):
            try:
                reg_tool.registeredNotify(username)
            except Exception:
                transaction.abort()
                message = _("SMTP server disconnected. User creation aborted.")
                return error(None, message)

        message = _("Member registered and linked to the current Contact.")
        self.context.plone_utils.addPortalMessage(message, 'info')
        return self.request.response.redirect(
            self.context.absolute_url() + "/login_details")
906488
def cli(ctx, email, first_name, last_name, password, role="user", metadata={}):
    
    return ctx.gi.users.create_user(email, first_name, last_name, password, role=role, metadata=metadata)