Example #1
0
<?php

defined('SOME_PATH') or die('Unauthorized access');
/**
* @package content
* @subpackage user
*/
#
# this is user content bootstrap
#
$user = SomeFactory::getUser();
$app = SomeFactory::getApplication();
#
# create controller here and call its execute. See
#  content/example, content/hello or content/numberguessmvc  for examples.
#
include PATH_CONTENT . DS . 'controller' . DS . 'default.php';
$c = new SomeControllerDefault();
$c->execute();
/*
Kun tänne tullaan (etusivulle), vaihdetaan kirjautumisen ajaksi template=login
*/
$app->setTemplate('login');
Example #2
0
<?php

defined('SOME_PATH') or die("Unauthorized access!");
$user = SomeFactory::getUser();
$app = SomeFactory::getApplication();
if (!$user->getId()) {
    $app->redirect("index.php?app=login", "You need to be logged in!");
} else {
    include PATH_CONTENT . DS . 'controller' . DS . 'default.php';
    $controller = new SomeControllerDefault();
    $controller->execute();
}