When user logs in, update the AccessLog related to the user.
426744
def user_logged_in(self, sender, request: AxesHttpRequest, user, **kwargs):  # pylint: disable=unused-argument
        

        username = user.get_username()
        credentials = get_credentials(username)
        client_str = get_client_str(username, request.axes_ip_address, request.axes_user_agent, request.axes_path_info)

        log.info('AXES: Successful login by %s.', client_str)

        if settings.AXES_RESET_ON_SUCCESS:
            cache_key = get_client_cache_key(request, credentials)
            failures_since_start = self.cache.get(cache_key, default=0)
            self.cache.delete(cache_key)
            log.info('AXES: Deleted %d failed login attempts by %s from cache.', failures_since_start, client_str)
21655
def users_activate(user):
    """"""
    user_obj = _datastore.get_user(user)
    if user_obj is None:
        raise click.UsageError('ERROR: User not found.')
    if _datastore.activate_user(user_obj):
        click.secho('User "{0}" has been activated.'.format(user), fg='green')
    else:
        click.secho('User "{0}" was already activated.'.format(user),
                    fg='yellow')
1293292
def update(self, access_token=None, id_token=None, id_token_jwt=None, userinfo=None):
        

        def set_if_defined(session_key, value):
            if value:
                self._session_storage[session_key] = value

        auth_time = int(time.time())
        if id_token:
            auth_time = id_token.get('auth_time', auth_time)

        self._session_storage['last_authenticated'] = auth_time
        set_if_defined('access_token', access_token)
        set_if_defined('id_token', id_token)
        set_if_defined('id_token_jwt', id_token_jwt)
        set_if_defined('userinfo', userinfo)
1122617
def update_cb(self, context, t, idx, userdata):
        """"""

        if t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK == PA_SUBSCRIPTION_EVENT_SERVER:
            pa_operation_unref(
                pa_context_get_server_info(context, self._server_info_cb, None))

        self.request_update(context)
904036
def setLogEntries(self, entries, save=True, update_policies=True):
        """"""
        prev = None;  # "previous" valid entry for "Prev" link
        uplink = os.path.join("..", Purr.RenderIndex.INDEX);  # "Up" link
        self.entries = []
        for entry in entries:
            if not entry.ignore:
                entry.setPrevUpNextLinks(prev=prev, up=uplink)
                prev = entry
                self.entries.append(entry)
        if save:
            self.save()
        if update_policies:
            # populate default policies and renames based on entry list
            self._default_dp_props = {}
            for entry in entries:
                self.updatePoliciesFromEntry(entry)
            dprint(4, "default policies:", self._default_dp_props)
1334475
@Override
    public synchronized void updateLastAccessTime(long accessTime) {
        if (_lastAccessedTime == 0) { // newly created session object
            _lastAccessedTime = accessTime;
        } else {
            _lastAccessedTime = _currentAccessTime;
        }
        _currentAccessTime = accessTime;
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[UPDATE_LAST_ACCESS_TIME], "" + accessTime);
        }
    }
559511
def loggin(self, user_id, mdp, autolog):
        """"""
        r = sql.abstractRequetesSQL.check_mdp_user(user_id, mdp)
        if r():
            # update auto-log params
            self.autolog[user_id] = autolog and mdp or False
            self.modules = self.users[user_id]["modules"]  # load modules list

            dic = {"autolog": self.autolog, "modules": self.modules}
            s = json.dumps(dic, indent=4, ensure_ascii=False)
            b = security.protege_data(s, True)
            with open("local/init", "wb") as f:
                f.write(b)

            self.mode_online = True  # authorization to execute bakground tasks
            return True
        else:
            logging.debug("Bad password !")
430500
def refresh_oauth_credential(self):
        """"""
        credential = self.session.oauth2credential

        if credential.is_stale():
            refresh_session = refresh_access_token(credential)
            self.session = refresh_session
826599
protected function updatePermission()
    {
        foreach ($this->permissions() as $Permission) {
            $this->authManager->add($Permission);

            echo sprintf('    > permission `%s` added.', $Permission->name) . PHP_EOL;
        }
    }
40197
def update_db(self, userkarma, username):
        

        kt = self.db.session.query(KarmaTable)
        for user in userkarma:
            if user != username:
                # Modify the db accourdingly
                urow = kt.filter(KarmaTable.user == ude(user)).first()
                # If the user doesn't exist, create it
                if not urow:
                    urow = KarmaTable(ude(user))
                urow.kcount += userkarma[user]
                self.db.session.add(urow)
        self.db.session.commit()
840019
def update(self, user, **kwargs):
        """"""
        yield self.get_parent()

        if not self.parent.editable:
            err = 'Cannot update child of {} resource'.format(self.parent.state.name)
            raise exceptions.Unauthorized(err)

        yield super(SubResource, self).update(user, **kwargs)
945774
private function handleSuccessfulLogin()
    {
        event(new UserLoggedIn(auth()->user()));

        // Update the user with the log in details.
        auth()->user()->updateLogin();

        return Response::passed('You have been logged in.')
                       ->route('home');
    }
580635
void logAuditRecord() {
        trackConfigurationChange();
        if (!auditLogged) {
            try {
                AccessAuditContext accessContext = SecurityActions.currentAccessAuditContext();
                Caller caller = getCaller();
                auditLogger.log(
                        isReadOnly(),
                        resultAction,
                        caller == null ? null : caller.getName(),
                        accessContext == null ? null : accessContext.getDomainUuid(),
                        accessContext == null ? null : accessContext.getAccessMechanism(),
                        accessContext == null ? null : accessContext.getRemoteAddress(),
                        getModel(),
                        controllerOperations);
                auditLogged = true;
            } catch (Exception e) {
                ControllerLogger.MGMT_OP_LOGGER.failedToUpdateAuditLog(e);
            }
        }
    }
1101245
def user_update(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_openstack_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    if 'new_name' in kwargs:
        kwargs['name'] = kwargs.pop('new_name')
    return cloud.update_user(**kwargs)
69904
public function updateProfile()
    {
        if ($this->v["uID"] > 0) {
            // $GLOBALS["SL"]->user() returns an instance of the authenticated user...
            if ($this->v["uID"] == $GLOBALS["SL"]->REQ->uID || $this->v["user"]->hasRole('administrator')) {
                $user = User::find($GLOBALS["SL"]->REQ->uID);
                $user->name = $GLOBALS["SL"]->REQ->name;
                $user->email = $GLOBALS["SL"]->REQ->email;
                $user->save();
                $user->loadRoles();
                if ($this->v["user"]->hasRole('administrator')) {
                    if ($GLOBALS["SL"]->REQ->has('roles') && is_array($GLOBALS["SL"]->REQ->roles)
                        && sizeof($GLOBALS["SL"]->REQ->roles) > 0) {
                        foreach ($user->roles as $i => $role) {
                            if (in_array($role->DefID, $GLOBALS["SL"]->REQ->roles)) {
                                if (!$user->hasRole($role->DefSubset)) {
                                    $user->assignRole($role->DefSubset);
                                }
                            } elseif ($user->hasRole($role->DefSubset)) {
                                $user->revokeRole($role->DefSubset);
                            }
                        }
                    } else { // no roles selected, delete all that exist
                        foreach ($user->roles as $i => $role) {
                            if ($user->hasRole($role->DefSubset)) {
                                $user->revokeRole($role->DefSubset);
                            }
                        }
                    }
                }
                $this->redir('/profile/' . urlencode($user->name), true);
                return true;
            }
        }
        return false;
    }
51202
public function resetLoginData()
    {
        $this->extend->updateAttributes(['login_at' => time()]);
        $this->extend->updateAttributes(['login_ip' => Yii::$app->request->userIP]);
        $this->extend->updateCounters(['login_num' => 1]);
    }
15844
private function updateUsersTable()
    {
        Schema::table('users', function ($table) {
            foreach ($this->fields as $field => $value) {
                if (!Schema::hasColumn('users', $field)) {
                    $type  = $value['type'];
                    $query = $table->$type($field);

                    if (isset($value['extra'])) {
                        $extra = $value['extra'];
                        $query->$extra();
                    }

                    if ($field == 'role_id') {
                        $table->foreign('role_id')->references('id')->on('roles');
                    }
                }
            }

            if (!Schema::hasColumn('users', 'created_at') && !Schema::hasColumn('users', 'updated_at')) {
                $table->timestamps();
            }

            if (!Schema::hasColumn('users', 'deleted_at')) {
                $table->softDeletes();
            }
        });
    }