Insert user data into.
182068
protected function createsession(){
		bimport('users.general');
		bimport('users.social.user');
		bimport('users.social.users');
		$bsu=BUsersSocialUsers::getInstance();
		$list=$bsu->items_filter(array('provider'=>$this->provider,'social_id'=>$this->getSocialId()));
		$user=NULL;
		if(!empty($list)){
			BLog::addToLog('[Social.Adapter] Found social record in the database!');
			$su=reset($list);
			$user=$su->getuser();
			}else{
			BLog::addToLog('[Social.Adapter] Could not find social record in the database! Need to create it.');
			//Try to load existing user with such email.
			$email=$this->getEmail();
			if(!empty($email)){
				BLog::addToLog('[Social.Adapter] Loading user by email "'.$email.'"!');
				$bu=BUsers::getInstance();
				$user=$bu->get_user_byemail($email);
				}
			//If we have not loaded user = 
			if(empty($user)){
				BLog::addToLog('[Social.Adapter] Could not load user! Creating it. Email="'.$email.'"');
				$user=new BUser();
				$user->email=empty($email)?NULL:$email;
				$user->name=$this->getName();
				$user->active='Y';
				$user->birthday=$this->getBirthdayObject();
				$user->last_action=new DateTime();
				$r=$user->saveToDB();
				if(empty($r)){
					BLog::addToLog('[Social.Adapter] Could not save user!',LL_ERROR);
					return false;
					}
				BLog::addToLog('[Social.Adapter] User saved. User id='.$user->id.'.');
				//User saved.
				}
			$su=new BUsersSocialUser();
			$su->user=$user->id;
			$su->social_id=$this->getSocialId();
			$su->provider=$this->provider;
			$su->created=new DateTime();
			}
		if(empty($su)){
			BLog::addToLog('[Social.Adapter] Could not load social user record!',LL_ERROR);
			return false;
			}
		if(empty($user)){
			BLog::addToLog('[Social.Adapter] Could not load user!',LL_ERROR);
			return false;
			}
		//Get fields.
		$su->name=$this->getName();
		$su->email=$this->getEmail();
		$su->sex=$this->getSex();
		$su->birthday=$this->getBirthdayObject();
		$su->lastlogin=new DateTime();
		$su->avatar_remote=$this->getAvatar();
		$su->social_page=$this->getSocialPage();
		if(!empty($su->avatar_remote)){
			$r=$su->downloadavatar();
			if(!$r){
				return false;
				}
			}
		$r=$su->saveToDB();
		if(!$r){
			return false;
			}
		if((!empty($su->avatar_local))&&($user->avatar!=$su->avatar_local)){
			$user->avatar=$su->avatar_local;
			$user->saveToDB();
			}
		//Session.
		$options=array('interval'=>2592000,'updatestep'=>60);
		$sess=BUsersSession::getInstance();
		$r=$sess->newSession($user->id,$options);
		if(empty($r)){
			return false;
			}
		return true;
		}
347006
def insert(self, data, return_object=False):
        

        obj = self(data)  # pylint: disable=E1102
        obj.save()

        if return_object:
            return obj
        else:
            return obj["_id"]
228482
def allow_user(user):
    """"""
    def processor(action, argument):
        db.session.add(
            ActionUsers.allow(action, argument=argument, user_id=user.id)
        )
    return processor
1136335
def _create_user(ctx):
    """"""

    username, passhash = _get_credentials(ctx.obj['username'],
                                          ctx.obj['password'],
                                          ctx.obj['db'])

    if ctx.obj['db'].objectmodels['user'].count({'name': username}) > 0:
        raise KeyError()

    new_user = ctx.obj['db'].objectmodels['user']({
        'uuid': str(uuid4()),
        'created': std_now()
    })

    new_user.name = username
    new_user.passhash = passhash

    return new_user
690336
def AuthorizeUser(self, user, subject):
    """"""

    user_set = self.authorized_users.setdefault(subject, set())
    user_set.add(user)
1094939
function insertPersonData(filename, tableSchema) {
  return getSampleData(filename).then(
      function(data) {
        var rows = data.map(function(obj) {
          obj.dateOfBirth = convertDate(obj.dateOfBirth);
          obj.dateOfDeath = convertDate(obj.dateOfDeath);
          return tableSchema.createRow(obj);
        });
        return db.insert().into(tableSchema).values(rows);
      });
}
63095
function insertUser (client, { id, name, organizationId, metadata }, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      id = id || uuidV4()

      const sqlQuery = SQL`
        INSERT INTO users (
          id, name, org_id, metadata
        ) VALUES (
          ${id}, ${name}, ${organizationId}, ${metadata}
        )
        RETURNING id
      `

      client.query(sqlQuery, (err, result) => {
        if (utils.isUniqueViolationError(err)) return cb(Boom.conflict(err.detail))
        if (err) return cb(Boom.badImplementation(err))

        cb(null, result)
      })

      return promise
    }
541619
def add_user(self, nick, prefixes=None):
        """"""
        if nick not in self._user_nicks:
            self._user_nicks.append(nick)

        self.prefixes[nick] = prefixes
247785
def create_user(self, **kwargs):
        """"""
        kwargs = self._prepare_create_user_args(**kwargs)
        user = self.user_model(**kwargs)
        return self.put(user)
492418
def create(self, name):
        """"""
        with contextlib.closing(self.database.cursor()) as cursor:
            cursor.execute('INSERT INTO users(name) VALUES (?)', (name,))
            return cursor.lastrowid
74627
def user(context, name, email):
    """"""
    existing_user = context.obj['store'].user(email)
    if existing_user:
        click.echo(existing_user.to_dict())
    elif name:
        new_user = context.obj['store'].add_user(name, email)
        click.echo(click.style(f"New user added: {email} ({new_user.id})", fg='green'))
    else:
        click.echo(click.style('User not found', fg='yellow'))
480019
def put(self, name=None, user_ids=None):
        
        return self.connection.put('account', data=dict(name=name, user_ids=user_ids))
1129288
def logged_insert(self, user):
        """"""

        # Insert the frame's document
        self.insert()

        # Log the insert
        entry = ChangeLogEntry({
            'type': 'ADDED',
            'documents': [self],
            'user': user
            })
        entry.insert()

        return entry
276959
function addUser(req, res, next) {
  res.locals.user = req.user;
  next();
}
1029426
public boolean insertUser(String name)
	{
		if (isUserExist(name))
		{
			throw new SystemException(String.format("User '%s' already exist.", name));
		}

		return allUsers.add(name);
	}
960612
protected function _setupUserData() {
		if (is_string($this->_config['session'])) {
			$this->_userData = $this->_View->request->session()->read($this->_config['session']);
		} else {
			if (!array_key_exists($this->_config['viewVar'], $this->_View->viewVars)) {
				if ($this->_config['viewVarException'] === true) {
					throw new \RuntimeException(sprintf('View var `%s` not present! Please set the auth data to the view. See the documentation.', $this->_config['viewVar']));
				} else {
					$this->_userData = [];
				}
			} else {
				$this->_userData = $this->_View->viewVars[$this->_config['viewVar']];
			}
		}
	}
198633
def _add_user_to_file(file_id, service, user_email,
                      perm_type='user', role='writer'):
    
    new_permission = {
        'value': user_email,
        'type': perm_type,
        'role': role
    }
    try:
        service.permissions()\
            .insert(fileId=file_id, body=new_permission)\
            .execute()
    except errors.HttpError as error:
        show_error('An error adding users to spreadsheet: {0}'.format(error))