protected function actionListUser()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $uid) {

            if ($this->isSuperadmin($uid)) {
                continue;
            }

            if ($action === 'status' && $this->access('user_edit')) {
                $updated += (int) $this->user->update($uid, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('user_delete')) {
                $deleted += (int) $this->user->delete($uid);
            }
        }

        if ($updated > 0) {
            $text = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($text, 'success');
        }

        if ($deleted > 0) {
            $text = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($text, 'success');
        }
    }
protected function actionListUser()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $uid) {

            if ($this->isSuperadmin($uid)) {
                continue;
            }

            if ($action === 'status' && $this->access('user_edit')) {
                $updated += (int) $this->user->update($uid, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('user_delete')) {
                $deleted += (int) $this->user->delete($uid);
            }
        }

        if ($updated > 0) {
            $text = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($text, 'success');
        }

        if ($deleted > 0) {
            $text = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($text, 'success');
        }
    }
protected function actionListUser ( ) { list ( $ selected , $ action , $ value ) = $ this -> getPostedAction ( ) ; $ deleted = $ updated = 0 ; foreach ( $ selected as $ uid ) { if ( $ this -> isSuperadmin ( $ uid ) ) { continue ; } if ( $ action === 'status' && $ this -> access ( 'user_edit' ) ) { $ updated += ( int ) $ this -> user -> update ( $ uid , array ( 'status' => $ value ) ) ; } if ( $ action === 'delete' && $ this -> access ( 'user_delete' ) ) { $ deleted += ( int ) $ this -> user -> delete ( $ uid ) ; } } if ( $ updated > 0 ) { $ text = $ this -> text ( 'Updated %num item(s)' , array ( '%num' => $ updated ) ) ; $ this -> setMessage ( $ text , 'success' ) ; } if ( $ deleted > 0 ) { $ text = $ this -> text ( 'Deleted %num item(s)' , array ( '%num' => $ deleted ) ) ; $ this -> setMessage ( $ text , 'success' ) ; } }
Applies an action to the selected users
Applies an action to the selected users