<commit_before><?php
class Vps_Component_Plugin_Password_Component extends Vps_Component_Plugin_View_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['password'] = '<PASSWORD>';
        $ret['generators']['loginForm'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vps_Component_Plugin_Password_LoginForm_Component'
        );
        return $ret;
    }

    protected function _getPassword()
    {
        return $this->_getSetting('password');
    }

    public function isLoggedId()
    {
        $pw = $this->_getPassword();
        if (!is_array($pw)) $pw = array($pw);
        $msg = '';
        $session = new Zend_Session_Namespace('login_password');
        if (isset($_POST['login_password'])) {
            if (in_array($_POST['login_password'], $pw)) {
                $session->login = true;
            }
        }
        return $session->login;
    }

    public function processOutput($output)
    {
        if ($this->isLoggedId()) return $output;

        $templateVars = array();
        $templateVars['loginForm'] = Vps_Component_Data_Root::getInstance()
            ->getComponentById($this->_componentId)->getChildComponent('-loginForm');
        $templateVars['wrongLogin'] = isset($_POST['login_password']);
        $templateVars['placeholder'] = $this->_getSetting('placeholder');

        $template = Vpc_Admin::getComponentFile($this, 'Component', 'tpl');
        $view = new Vps_View_Component();<commit_msg>Bugfix Password-Plugin: verwendet jetzt ignoreVisible, hat sonst bei neuen Seiten im Seitenbaum nicht funktioniert<commit_after><?php
class Vps_Component_Plugin_Password_Component extends Vps_Component_Plugin_View_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['password'] = '<PASSWORD>';
        $ret['generators']['loginForm'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vps_Component_Plugin_Password_LoginForm_Component'
        );
        return $ret;
    }

    protected function _getPassword()
    {
        return $this->_getSetting('password');
    }

    public function isLoggedId()
    {
        $pw = $this->_getPassword();
        if (!is_array($pw)) $pw = array($pw);
        $msg = '';
        $session = new Zend_Session_Namespace('login_password');
        if (isset($_POST['login_password'])) {
            if (in_array($_POST['login_password'], $pw)) {
                $session->login = true;
            }
        }
        return $session->login;
    }

    public function processOutput($output)
    {
        if ($this->isLoggedId()) return $output;

        $templateVars = array();
        $templateVars['loginForm'] = Vps_Component_Data_Root::getInstance()
            ->getComponentById($this->_componentId, array('ignoreVisible' => true))->getChildComponent('-loginForm');
        $templateVars['wrongLogin'] = isset($_POST['login_password']);
        $templateVars['placeholder'] = $this->_getSetting('placeholder');

        $template = Vpc_Admin::getComponentFile($this, 'Component', 'tpl');
        $view = new Vps_View_Component();
{'fraction_non_alphanumeric': 0.1440546414157094, 'fraction_numerical': 0.0, 'mean_word_length': 2.987623762376238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 28, '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': '1876064', 'n_tokens_mistral': 896, 'n_tokens_neox': 893, 'n_words': 156}