DEPRECATED : The $user is replaced by its entry from now on
779404
public function checkDateOccurrenceByGameId($instant_win)
    {
        $now = new \DateTime("now");
        $now = $now->format('Y-m-d H:i:s');

        $query = $this->em->createQuery(
            'SELECT i FROM PlaygroundGame\Entity\InstantWinOccurrence i
                WHERE i.instantwin = :game
                AND i.active = 1
                AND i.value <= :now
                ORDER BY i.value DESC
                '
        );
        $query->setParameter('game', $instant_win);
        $query->setParameter('now', $now);
        $query->setMaxResults(1);
        $result = $query->getResult();

        if (count($result) == 1) {
            return current($result);
        } else {
            return null;
        }
    }
452666
def finish_user(self, subid):
    ''''''        

    p = self.revoke_token(subid)
    p.token = "finished"
    self.session.commit()
    return p
1226446
function onCopyLastUser() {
  // If last user is null, NULL_USER error will be thrown.
  auth.updateCurrentUser(lastUser).then(function() {
    alertSuccess('Copied last user to Auth');
  }, function(error) {
    alertError('Error: ' + error.code);
  });
}
469558
function checkUser( &$siteBasics, $uri )
    {
        $http = eZHTTPTool::instance();
        $check = array( "module" => "user",
                        "function" => "login" );
        if ( eZSession::issetkey( 'eZUserLoggedInID', false ) &&
             $http->sessionVariable( "eZUserLoggedInID" ) != '' &&
             $http->sessionVariable( "eZUserLoggedInID" ) != self::anonymousId() )
        {
            $currentUser = eZUser::currentUser();
            if ( !$currentUser->isEnabled() )
            {
                eZUser::logoutCurrent();
                $currentUser = eZUser::currentUser();
            }
            else
            {
                return null;
            }
        }

        $ini        = eZINI::instance();
        $moduleName = $uri->element();
        $viewName   = $uri->element( 1 );
        $anonymousAccessList = $ini->variable( "SiteAccessSettings", "AnonymousAccessList" );
        foreach ( $anonymousAccessList as $anonymousAccess )
        {
            $elements = explode( '/', $anonymousAccess );
            if ( !isset( $elements[1] ) )
            {
                if ( $moduleName == $elements[0] )
                {
                    return null;
                }
            }
            else
            {
                if ( $moduleName == $elements[0] and
                     $viewName == $elements[1] )
                {
                    return null;
                }
            }
        }

        return $check;
    }
228154
static function sessionCleanup()
    {
        $http = eZHTTPTool::instance();

        $valueList = array( self::AVAILABLE_ARRAY,
                            self::STEP,
                            self::USER_INFO,
                            self::LAST_CHECK_REDIRECT,
                            self::FORCE_LOGIN );

        foreach ( $valueList as $value )
        {
            if ( $http->hasSessionVariable( $value ) )
            {
                $http->removeSessionVariable( $value );
            }
        }

        $ini = eZINI::instance();
        $handlerList = array( 'standard' );
        if ( $ini->hasVariable( 'UserSettings', 'LoginHandler' ) )
        {
            $handlerList = $ini->variable( 'UserSettings', 'LoginHandler' );
        }

        foreach( $handlerList as $handler )
        {
            $loginHandler = eZUserLoginHandler::instance( $handler );
            if ( $loginHandler )
            {
                $loginHandler->sessionCleanup();
            }
        }
    }
27898
function destroy(req, res, next) {
  db.users.del(req.params.user, function(err) {
    if(err) { return next(err); }
    res.json(null);
  });
}
1343844
def prj_remove_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        i = self.prj_user_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            log.debug("Removing user %s.", user.username)
            item.set_parent(None)
            self.cur_prj.users.remove(user)
1267423
function definition_after_data() {
        $mform   = $this->_form;
        $columns = $this->_customdata['columns'];

        foreach ($columns as $column) {
            if ($mform->elementExists($column)) {
                $mform->removeElement($column);
            }
        }

        if (!in_array('password', $columns)) {
            // password resetting makes sense only if password specified in csv file
            if ($mform->elementExists('uuforcepasswordchange')) {
                $mform->removeElement('uuforcepasswordchange');
            }
        }
    }
461631
public function change(
		User $user,
		$add = [],
		$remove = [],
		array $extraParams = []
	) {
		$result = $this->api->postRequest(
			new SimpleRequest(
				'query', [
				'list' => 'users',
				'ustoken' => 'userrights',
				'ususers' => $user->getName(),
			]
			)
		);

		$params = [
			'user' => $user->getName(),
			'token' => $result['query']['users'][0]['userrightstoken'],
		];
		if ( !empty( $add ) ) {
			$params['add'] = implode( '|', $add );
		}
		if ( !empty( $remove ) ) {
			$params['remove'] = implode( '|', $remove );
		}

		$this->api->postRequest(
			new SimpleRequest( 'userrights', array_merge( $extraParams, $params ) )
		);

		return true;
	}
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
1225276
def remove(self, username=None):
        """"""
        self._user_list = [user for user in self._user_list if user.name != username]
297713
@Deprecated
    public static void clear() {
        if (ExtensionList.lookup(AllUsers.class).isEmpty()) {
            return;
        }
        UserIdMapper.getInstance().clear();
        AllUsers.clear();
    }
956562
function (n) {
            //get user from db
            dbAction.get("findByUserId", userId, function (err, u) {
                if (u) {
                    user = u.toObject();
                }
                else {
                    err = err || new Error("User not found by userId: " + userId);
                }
                n(err);
            })
        }
545822
def logged_delete(self, user):
        """"""

        self.delete()

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

        return entry
289727
private function restoreLastUserInput()
    {
        $this->userInput = $this->lastInput;
        $this->cursorPosition = mb_strlen($this->userInput);
    }
878487
function removeUserVals() {
        _.each(user, function reset(val, key) {
            if (!_.isFunction(val) && key !== 'initComplete') {
                user[key] = null;
            }
        });
    }
1336447
def disable(ctx):
    """"""

    if ctx.obj['username'] is None:
        log('Specify the username with "iso db user --username ..."')
        return

    change_user = ctx.obj['db'].objectmodels['user'].find_one({
        'name': ctx.obj['username']
    })

    change_user.active = False
    change_user.save()
    log('Done')