View to forget the user
970494
def logout(request):
    """"""
    request.response.headers.extend(forget(request))
    return {'redirect': request.POST.get('came_from', '/')}
1269382
def clear_uservars(self, user=None):
        

        if user is None:
            # All the users!
            self._session.reset_all()
        else:
            # Just this one.
            self._session.reset(user)
1281969
def delete_user(ctx, yes):
    """"""

    if ctx.obj['username'] is None:
        username = _ask("Please enter username:")
    else:
        username = ctx.obj['username']

    del_user = ctx.obj['db'].objectmodels['user'].find_one({'name': username})
    if yes or _ask('Confirm deletion', default=False, data_type='bool'):
        try:
            del_user.delete()
            log("Done")
        except AttributeError:
            log('User not found', lvl=warn)
    else:
        log("Cancelled")
1248912
def action_inactivate(self, ids):
        """"""
        try:
            count = 0
            for user_id in ids:
                user = _datastore.get_user(user_id)
                if user is None:
                    raise ValueError(_("Cannot find user."))
                if _datastore.deactivate_user(user):
                    count += 1
            if count > 0:
                flash(_('User(s) were successfully inactivated.'), 'success')
        except Exception as exc:
            if not self.handle_view_exception(exc):
                raise

            current_app.logger.exception(str(exc))  # pragma: no cover
            flash(_('Failed to inactivate users.'),
                  'error')
410527
def unregister_cozy():
    '''
        
    '''
    req = curl_couchdb('/cozy/_design/user/_view/all')
    users = req.json()['rows']

    if len(users) > 0:
        user = users[0]['value']
        user_id = user['_id']
        user_rev = user['_rev']

        print 'Delete cozy user: {}'.format(user_id)
        req = curl_couchdb('/cozy/{}?rev={}'.format(user_id, user_rev),
                           method='DELETE')

        return req.json()
    else:
        print 'Cozy not registered'
        return None
306880
def deactivate_user(self, user):
        
        if user.active:
            user.active = False
            return True
        return False
445939
def logout_user():
    '''
    
    '''

    user = _get_user()

    if 'user_id' in session:
        session.pop('user_id')

    if '_fresh' in session:
        session.pop('_fresh')

    if '_id' in session:
        session.pop('_id')

    cookie_name = current_app.config.get('REMEMBER_COOKIE_NAME', COOKIE_NAME)
    if cookie_name in request.cookies:
        session['remember'] = 'clear'
        if 'remember_seconds' in session:
            session.pop('remember_seconds')

    user_logged_out.send(current_app._get_current_object(), user=user)

    current_app.login_manager._update_request_context_with_user()
    return True
1073375
def remove_user(self, user, **kwargs):
        """"""
        if isinstance(user, Entity):
            user = user['id']

        assert isinstance(user, six.string_types)

        endpoint = '{0}/{1}/users/{2}'.format(
            self.endpoint,
            self['id'],
            user,
        )
        return self.request('DELETE', endpoint=endpoint, query_params=kwargs)
1336467
public function cleanUpUnusedAccounts()
    {
        $sTable = getViewName('oxuser');
        $sSql = "SELECT oxid, oxusername
            FROM {$sTable}
            WHERE oxusername LIKE '%-%-%@amazon.com'
              AND oxcreate < (NOW() - INTERVAL 1440 MINUTE)";

        $aData = $this->getDatabase()->getAll($sSql);

        foreach ($aData as $aUser) {
            //Delete user from OXID
            $oUser = $this->getObjectFactory()->createOxidObject('oxUser');

            if ($oUser->load($aUser['oxid'])) {
                $oUser->delete();
            }
        }
    }
861557
def user_remove(user,
                host='localhost',
                **connection_args):
    '''
    
    '''
    dbc = _connect(**connection_args)
    if dbc is None:
        return False

    cur = dbc.cursor()
    qry = 'DROP USER %(user)s@%(host)s'
    args = {}
    args['user'] = user
    args['host'] = host
    try:
        _execute(cur, qry, args)
    except MySQLdb.OperationalError as exc:
        err = 'MySQL Error {0}: {1}'.format(*exc.args)
        __context__['mysql.error'] = err
        log.error(err)
        return False

    if not user_exists(user, host, **connection_args):
        log.info('User \'%s\'@\'%s\' has been removed', user, host)
        return True

    log.info('User \'%s\'@\'%s\' has NOT been removed', user, host)
    return False
1109321
def user_deleted(sender, **kwargs):
    
    if kwargs.get('created'):
        write('user_variations', {'variation': 1}, tags={'action': 'created'})
        write('user_count', {'total': User.objects.count()})
807822
public synchronized void free(Value value, CloseableListenable user) {
		Data<Value> data = values.get(value);
		if (data == null) return;
		data.lastUsage = System.currentTimeMillis();
		data.users.remove(user);
	}
272663
def _forget_page(self, page):
        """"""
        pid = id(page)
        if pid in self._page_refs:
            self._page_refs[pid] = None
1064732
async def forget_ticket(self, request):
        
        session = await get_session(request)
        session.pop(self.cookie_name, '')
197824
def handle_delete(self):
        """"""
        from intranet.apps.eighth.models import EighthScheduledActivity
        EighthScheduledActivity.objects.filter(eighthsignup_set__user=self).update(
            archived_member_count=F('archived_member_count')+1)
151457
function performRemove() {
        UserService.remove(vm.user)
          .then(deleteUserSuccess)
          .catch(deleteUserCatch);

        function deleteUserSuccess() {
          Toast.show({type: 'success', text: 'User ' + vm.displayName + ' deleted'});
          vm.showList();
        }

        function deleteUserCatch(err) {
          Toast.show({
            type: 'warn',
            text: 'Error while deleting user ' + vm.displayName,
            link: {state: $state.$current, params: $stateParams}
          });

          if (form && err) {
            form.setResponseErrors(err, vm.errors);
          }
        }
      }
627810
function forgotten() {
    var self = this
      , username = $('.modal input[name="username"]')
      , button = $('.modal button[type="submit"]');

    // Add an disabled state to the button as we are processing it
    button.addClass('disabled loading')
      .set('disabled', 'disabled')
      .set('innerHTML', 'Submitting');

    username = username.set('readOnly', true).get('value');

    Cortex.request({
        url: '/forgot'
      , method: 'post'
      , type: 'json'
      , data: {
            username: username
        }
      , success: function success(res) {
          if (res.error) {
            return self.render('forgot', {
                error: 'Invalid user account'
              , username: username
            });
          }

          return self.render('forgot', {
              success: 'We have sent an password reset request to your e-mail address'
            , username: username
          });
        }
    });
  }