public function deleteUser($userLogin)
    {
        Piwik::checkUserHasSuperUserAccess();
        $this->checkUserIsNotAnonymous($userLogin);

        $this->checkUserExist($userLogin);

        if ($this->isUserTheOnlyUserHavingSuperUserAccess($userLogin)) {
            $message = Piwik::translate("UsersManager_ExceptionDeleteOnlyUserWithSuperUserAccess", $userLogin)
                        . " "
                        . Piwik::translate("UsersManager_ExceptionYouMustGrantSuperUserAccessFirst");
            throw new Exception($message);
        }

        $this->model->deleteUserOnly($userLogin);
        $this->model->deleteUserAccess($userLogin);

        Cache::deleteTrackerCache();
    }
public function deleteUser($userLogin)
    {
        Piwik::checkUserHasSuperUserAccess();
        $this->checkUserIsNotAnonymous($userLogin);

        $this->checkUserExist($userLogin);

        if ($this->isUserTheOnlyUserHavingSuperUserAccess($userLogin)) {
            $message = Piwik::translate("UsersManager_ExceptionDeleteOnlyUserWithSuperUserAccess", $userLogin)
                        . " "
                        . Piwik::translate("UsersManager_ExceptionYouMustGrantSuperUserAccessFirst");
            throw new Exception($message);
        }

        $this->model->deleteUserOnly($userLogin);
        $this->model->deleteUserAccess($userLogin);

        Cache::deleteTrackerCache();
    }
public function deleteUser ( $ userLogin ) { Piwik :: checkUserHasSuperUserAccess ( ) ; $ this -> checkUserIsNotAnonymous ( $ userLogin ) ; $ this -> checkUserExist ( $ userLogin ) ; if ( $ this -> isUserTheOnlyUserHavingSuperUserAccess ( $ userLogin ) ) { $ message = Piwik :: translate ( "UsersManager_ExceptionDeleteOnlyUserWithSuperUserAccess" , $ userLogin ) . " " . Piwik :: translate ( "UsersManager_ExceptionYouMustGrantSuperUserAccessFirst" ) ; throw new Exception ( $ message ) ; } $ this -> model -> deleteUserOnly ( $ userLogin ) ; $ this -> model -> deleteUserAccess ( $ userLogin ) ; Cache :: deleteTrackerCache ( ) ; }
Delete one or more users and all its access, given its login.

@param string $userLogin the user login(s).

@throws Exception if the user doesn't exist or if deleting the users would leave no superusers.

@return bool true on success
Delete one or more users and all its access given its login .