function __construct($class, $method, $params) { $this->class = $class; $this->method = $method; $this->params = $params; $this->base = sgContext::getRelativeBaseUrl(); }
function __construct($matches = array()) { $this->matches = $matches; $this->matchedRoute = sgContext::getCurrentRoute(); $this->base = sgContext::getRelativeBaseUrl(); $this->title = $this->guessTitle(); $this->site_name = sgConfiguration::get('settings.site_name'); $this->scripts = array(); $this->styles = array(); $this->js_settings = sgConfiguration::get('settings.js_settings'); }
public static function url($path, $absolute = false) { $env = sgContext::getEnvironment(); if (strpos($path, '/') === 0) { $path = substr($path, 1); } if ($absolute) { $protocol = 'http'; if (isset($env['HTTPS'])) { $protocol .= 's://'; } else { $protocol .= '://'; } return $protocol . $env['HTTP_HOST'] . sgContext::getRelativeBaseUrl() . '/' . $path; } return sgContext::getRelativeBaseUrl() . '/' . $path; }
public function POST() { $data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); $adapter = new Zend_Auth_Adapter_Digest(sgConfiguration::get('settings.ZendAuthPlugin.passwd_path'), '*', $data['username'], $data['password']); $result = Zend_Auth::getInstance()->authenticate($adapter); if ($result && $result->isValid()) { if (isset($data['destination'])) { header('Location: ' . sgToolkit::url(filter_var($data['destination'], FILTER_SANITIZE_URL))); exit; } header('Location: ' . sgContext::getRelativeBaseUrl()); exit; } else { $this->errors = $result->getMessages(); if (isset($data['destination'])) { $_GET['destination'] = $data['destination']; } return self::GET(); } }
<?php return array('magic_routing' => true, 'debug' => false, 'cache_templates' => false, 'cache_routes' => false, 'cache_autoload' => false, 'cache_dir' => sgConfiguration::getRootDir() . '/cache', 'autoload_exclusions' => array('Twig', '.svn', 'CVS', '.git', dirname(__FILE__) . '/../skeleton', dirname(__FILE__) . '/../config'), 'enabled_plugins' => array('Components'), 'js_settings' => array('base' => sgContext::getRelativeBaseUrl()));
function GET() { Zend_Auth::getInstance()->clearIdentity(); header('Location: ' . sgContext::getRelativeBaseUrl()); }