controllers/AuthItemController.php
public function actionDelete()
    {
        if (isset($_GET['name'])) {
            $name = $_GET['name'];

            /* @var $am CAuthManager|AuthBehavior */
            $am = Yii::app()->getAuthManager();

            $item = $am->getAuthItem($name);
            if ($item instanceof CAuthItem) {
                $am->removeAuthItem($name);
                if ($am instanceof CPhpAuthManager) {
                    $am->save();
                }

                if (!isset($_POST['ajax'])) {
                    $this->redirect(array('index'));
                }
            } else {
                throw new CHttpException(404, Yii::t('AuthModule.main', 'Item does not exist.'));
            }
        } else {
            throw new CHttpException(400, Yii::t('AuthModule.main', 'Invalid request.'));
        }
    }
public function actionDelete()
    {
        if (isset($_GET['name'])) {
            $name = $_GET['name'];

            /* @var $am CAuthManager|AuthBehavior */
            $am = Yii::app()->getAuthManager();

            $item = $am->getAuthItem($name);
            if ($item instanceof CAuthItem) {
                $am->removeAuthItem($name);
                if ($am instanceof CPhpAuthManager) {
                    $am->save();
                }

                if (!isset($_POST['ajax'])) {
                    $this->redirect(array('index'));
                }
            } else {
                throw new CHttpException(404, Yii::t('AuthModule.main', 'Item does not exist.'));
            }
        } else {
            throw new CHttpException(400, Yii::t('AuthModule.main', 'Invalid request.'));
        }
    }
public function actionDelete ( ) { if ( isset ( $ _GET [ 'name' ] ) ) { $ name = $ _GET [ 'name' ] ; /* @var $am CAuthManager|AuthBehavior */ $ am = Yii :: app ( ) -> getAuthManager ( ) ; $ item = $ am -> getAuthItem ( $ name ) ; if ( $ item instanceof CAuthItem ) { $ am -> removeAuthItem ( $ name ) ; if ( $ am instanceof CPhpAuthManager ) { $ am -> save ( ) ; } if ( ! isset ( $ _POST [ 'ajax' ] ) ) { $ this -> redirect ( array ( 'index' ) ) ; } } else { throw new CHttpException ( 404 , Yii :: t ( 'AuthModule.main' , 'Item does not exist.' ) ) ; } } else { throw new CHttpException ( 400 , Yii :: t ( 'AuthModule.main' , 'Invalid request.' ) ) ; } }
Deletes the item with the given name.
@throws CHttpException if the item does not exist or if the request is invalid.
Deletes the item with the given name .