Exemple #1
0
$fs->projects = array_filter($prs, array($user, 'can_view_project'));
// Get e-mail addresses of the admins
if ($user->isAnon() && !$fs->prefs['user_notify']) {
    $sql = $db->Query('SELECT email_address
                         FROM {users} u
                    LEFT JOIN {users_in_groups} g ON u.user_id = g.user_id
                        WHERE g.group_id = 1');
    $page->assign('admin_emails', array_map(create_function('$x', 'return str_replace("@", "#", $x);'), $db->fetchCol($sql)));
}
// default title
$page->setTitle($fs->prefs['page_title'] . $proj->prefs['project_title']);
$page->assign('do', $do);
$page->assign('supertask_id', $supertask_id);
$page->pushTpl('header.tpl');
if (!defined('NO_DO')) {
    require_once BASEDIR . "/scripts/{$do}.php";
} else {
    # not nicest solution, NO_DO currently only used on register actions
    $page->pushTpl('register.ok.tpl');
}
$page->pushTpl('footer.tpl');
$page->setTheme($proj->prefs['theme_style']);
$page->render();
if (isset($_SESSION)) {
    // remove dupe data on error, since no submission happened
    if (isset($_SESSION['ERROR']) && isset($_SESSION['requests_hash'])) {
        $currentrequest = md5(serialize($_POST));
        unset($_SESSION['requests_hash'][$currentrequest]);
    }
    unset($_SESSION['ERROR'], $_SESSION['SUCCESS']);
}