<commit_before><?php
class Kwf_Component_Plugin_LoginRedirect_Component extends Kwf_Component_Plugin_View_Abstract
    implements Kwf_Component_Plugin_Interface_Login
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['validUserRoles'] = null;
        return $ret;
    }

    public function getExecutionPoint()
    {
        return Kwf_Component_Plugin_Interface_View::EXECUTE_BEFORE;
    }

    public function processOutput($output)
    {
        if (!$this->isLoggedIn()) {
            $component = Kwf_Component_Data_Root::getInstance()->getComponentById($this->_componentId);
            $loginComponent = $this->getLoginComponent();
            if (!$loginComponent) throw new KWf_Exception('No login component found');
            $url = $loginComponent->url;
            if ($component->url != '/') {
                $url .= '?redirect=' . urlencode($component->url);
            }
            header('Location: ' . $url);
            exit;
        }
        return parent::processOutput($output);
    }
<commit_msg>fixed correct class name for exception<commit_after><?php
class Kwf_Component_Plugin_LoginRedirect_Component extends Kwf_Component_Plugin_View_Abstract
    implements Kwf_Component_Plugin_Interface_Login
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['validUserRoles'] = null;
        return $ret;
    }

    public function getExecutionPoint()
    {
        return Kwf_Component_Plugin_Interface_View::EXECUTE_BEFORE;
    }

    public function processOutput($output)
    {
        if (!$this->isLoggedIn()) {
            $component = Kwf_Component_Data_Root::getInstance()->getComponentById($this->_componentId);
            $loginComponent = $this->getLoginComponent();
            if (!$loginComponent) throw new Kwf_Exception('No login component found');
            $url = $loginComponent->url;
            if ($component->url != '/') {
                $url .= '?redirect=' . urlencode($component->url);
            }
            header('Location: ' . $url);
            exit;
        }
        return parent::processOutput($output);
    }

{'fraction_non_alphanumeric': 0.11596870685687989, 'fraction_numerical': 0.0, 'mean_word_length': 2.65993265993266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2266787', 'n_tokens_mistral': 584, 'n_tokens_neox': 574, 'n_words': 107}