<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     get_slider
 * Purpose:  get a slider of known name or id
 * -------------------------------------------------------------
 */
function smarty_function_require_login($params, &$smarty)
{
    global $ctrl;

    if ($smarty->getTemplateVars('view') instanceof \KupShop\UserBundle\View\LoginView) {
        return;
    }

    if (!$ctrl['logged']) {
        redirection('LOGIN');
    }
}
