Recent activity (actions) for a given user
769303
def recent_activity(self, user_id):
        """"""
        M = models  # noqa

        if request.args.get('limit'):
            limit = int(request.args.get('limit'))
        else:
            limit = 1000

        qry = (
            db.session.query(M.Log, M.Dashboard, M.Slice)
            .outerjoin(
                M.Dashboard,
                M.Dashboard.id == M.Log.dashboard_id,
            )
            .outerjoin(
                M.Slice,
                M.Slice.id == M.Log.slice_id,
            )
            .filter(
                sqla.and_(
                    ~M.Log.action.in_(('queries', 'shortner', 'sql_json')),
                    M.Log.user_id == user_id,
                ),
            )
            .order_by(M.Log.dttm.desc())
            .limit(limit)
        )
        payload = []
        for log in qry.all():
            item_url = None
            item_title = None
            if log.Dashboard:
                item_url = log.Dashboard.url
                item_title = log.Dashboard.dashboard_title
            elif log.Slice:
                item_url = log.Slice.slice_url
                item_title = log.Slice.slice_name

            payload.append({
                'action': log.Log.action,
                'item_url': item_url,
                'item_title': item_title,
                'time': log.Log.dttm,
            })
        return json_success(
            json.dumps(payload, default=utils.json_int_dttm_ser))
802628
def currentUser(extras=nil)
      method = 'currentUser'
      type = User
      args = {}
      args[:extras] = extras if extras
      return_object type,method,args,true
    end
242664
def history_activity(opt = {})
      url = "#{@base_url}/historyactivity"
      if !opt.empty?
        url += "?#{URI.encode_www_form opt}"
      end
      ret = @client.rpc.call_with_json("GET", url, nil)
      ret["items"]
    end
644511
def updated(self, user):
        
        for who, what, old, new in self.history(user):
            if (what == "comment" or what == "description") and new != "":
                return True
        return False
813674
def user_save_event(user):
    
    msg = 'User ({}){} updated/saved'.format(user.id, user.email)
    current_app.logger.info(msg)
1126835
public function index_onBulkAction()
    {
        if (
            ($bulkAction = post('action')) &&
            ($checkedIds = post('checked')) &&
            is_array($checkedIds) &&
            count($checkedIds)
        ) {

            foreach ($checkedIds as $userId) {
                if (!$user = User::withTrashed()->find($userId)) {
                    continue;
                }

                switch ($bulkAction) {
                    case 'delete':
                        $user->forceDelete();
                        break;

                    case 'activate':
                        $user->attemptActivation($user->activation_code);
                        break;

                    case 'deactivate':
                        $user->delete();
                        break;

                    case 'restore':
                        $user->restore();
                        break;

                    case 'ban':
                        $user->ban();
                        break;

                    case 'unban':
                        $user->unban();
                        break;
                }
            }

            Flash::success(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_success'));
        }
        else {
            Flash::error(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_empty'));
        }

        return $this->listRefresh();
    }
1177281
def activities(self, limit=1, event=None):
        """"""
        activities = self._activities or []

        # Filter our activity array if requested
        if event:
            activities = list(
                filter(
                    lambda activity:
                    activity[CONST.EVENT] == event, activities))

        # Return the requested number
        return activities[:limit]
701668
void onActivityReady(Activity activity) {
    this.activity = activity;

    PermissionStates permissionStates = null;
    synchronized (pendingPermissionsMutex) {
      if (activity != null) {
        permissionStates = getPermissionStates(pendingPermissions);
      }
    }

    if (permissionStates != null) {
      handleDeniedPermissions(permissionStates.getDeniedPermissions());
      updatePermissionsAsDenied(permissionStates.getImpossibleToGrantPermissions());
      updatePermissionsAsGranted(permissionStates.getGrantedPermissions());
    }
  }
720256
def run_activity(self):
        
        activity = self.current.activity
        if activity:
            if activity not in self.wf_activities:
                self._load_activity(activity)
            self.current.log.debug(
                "Calling Activity %s from %s" % (activity, self.wf_activities[activity]))
            self.wf_activities[self.current.activity](self.current)
284232
def history(self, user=None):
        
        for event in self.changelog:
            when, who, what, old, new, ignore = event
            if (when >= self.options.since.date and
                    when <= self.options.until.date):
                if user is None or who.startswith(user.login):
                    yield who, what, old, new
768441
def get_current_activities(self, login=None, **kwargs):
        

        _login = kwargs.get(
            'login',
            login or self._login
        )
        _activity_url = ACTIVITY_URL.format(login=_login)
        return self._request_api(url=_activity_url).json()
1353339
def get_activity(self):
        """"""
        method = 'GET'
        endpoint = '/rest/v1/{}/activity'.format(self.client.sauce_username)
        return self.client.request(method, endpoint)
150805
def add_to_current_action(self, controller):
        """"""
        item = self.current_item
        self._history[self._index] = item + (controller,)
689264
public function logLastActivity() {

		$user = Yii::$app->user->getIdentity();

		if( isset( $user ) ) {

			$user->lastActivityAt = Date( 'Y-m-d h:i:s' );

			$this->update( $user, [ 'attributes' => [ 'lastActivityAt' ] ] );
		}
	}
451407
def user_recent(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': ''
        }
        self.render('user/info_list/user_recent.html',
                    kwd=kwd,
                    user_name=self.get_current_user(),
                    userinfo=self.userinfo)
1275077
function doAction() {
            var now = (new Date()).getTime();
            var diff = now - lastTapTime;
            var isDiffElemSafeDelay = elem !== lastElemTapped && diff > 200;
            var isSameElemSafeDelay = elem === lastElemTapped && diff > sameElemSafeDelay;

            if (tapped && (isDiffElemSafeDelay || isSameElemSafeDelay)) {
                lastElemTapped = elem;
                lastTapTime = now;
                safeApply(action, scope);
            }

            // reset tapped at end
            tapped = false;
        }
1130474
def _on_action_triggered(self):
        
        action = self.sender()
        assert isinstance(action, QtWidgets.QAction)
        path = action.data()
        self.open_requested.emit(path)
        self.update_actions()