Exemple #1
0
function rssError($msg)
{
    $tpl = new Template_Helper();
    $tpl->setTemplate('rss_error.tpl.xml');
    header('Content-Type: text/xml; charset=' . APP_CHARSET);
    $tpl->assign(array('error' => $msg));
    $tpl->displayTemplate();
}
/*
 * This file is part of the Eventum (Issue Tracking System) package.
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
Auth::checkAuthentication();
if (!empty($_REQUEST['iss_id'])) {
    $fields = Custom_Field::getListByIssue(Auth::getCurrentProject(), $_REQUEST['iss_id']);
} else {
    $fields = Custom_Field::getListByProject(Auth::getCurrentProject(), $_REQUEST['form_type']);
}
$data = array();
foreach ($fields as $field) {
    $backend = Custom_Field::getBackend($field['fld_id']);
    if (is_object($backend) && is_subclass_of($backend, 'Dynamic_Custom_Field_Backend')) {
        $field['structured_data'] = $backend->getStructuredData();
        $data[] = $field;
    }
}
header('Content-Type: text/javascript; charset=UTF-8');
$tpl = new Template_Helper();
$tpl->setTemplate('js/dynamic_custom_field.tpl.js');
$tpl->assign('fields', $data);
$tpl->displayTemplate();
Exemple #3
0
 public static function displayErrorMessage($msg)
 {
     self::setMessage($msg, self::MSG_ERROR);
     $tpl = new Template_Helper();
     $tpl->setTemplate('error_message.tpl.html');
     $tpl->displayTemplate();
     exit;
 }
Exemple #4
0
$relative_url[] = '';
$relative_url = implode('/', $relative_url);
define('APP_REL_URL', $relative_url);
$tpl->assign('phpversion', phpversion());
$tpl->assign('core', array('rel_url' => $relative_url, 'app_title' => APP_NAME));
if (@$_SERVER['HTTPS'] == 'on') {
    $ssl_mode = 'enabled';
} else {
    $ssl_mode = 'disabled';
}
$tpl->assign('ssl_mode', $ssl_mode);
$tpl->assign('zones', Date_Helper::getTimezoneList());
$tpl->assign('default_timezone', getTimezone());
$tpl->assign('default_weekday', getFirstWeekday());
$tpl->setTemplate('setup.tpl.html');
$tpl->displayTemplate(false);
/**
 * Checks for $file for write permission.
 *
 * IMPORTANT: if the file does not exist, an empty file is created.
 */
function checkPermissions($file, $desc, $is_directory = false)
{
    clearstatcache();
    if (!file_exists($file)) {
        if (!$is_directory) {
            // try to create the file ourselves then
            $fp = @fopen($file, 'w');
            if (!$fp) {
                return getPermissionError($file, $desc, $is_directory, false);
            }
Exemple #5
0
 /**
  * @return Auth_Backend_Interface
  */
 public static function getAuthBackend()
 {
     /** @var Auth_Backend_Interface $instance */
     static $instance = false;
     if ($instance == false) {
         $class = APP_AUTH_BACKEND;
         // legacy: allow lowercase variants
         if (strtolower($class) == 'mysql_auth_backend') {
             $class = 'Mysql_Auth_Backend';
         } elseif (strtolower($class) == 'ldap_auth_backend') {
             $class = 'LDAP_Auth_Backend';
         }
         try {
             $instance = new $class();
         } catch (AuthException $e) {
             $message = "Unable to use auth backend '{$class}'";
             Logger::app()->critical($message, array('exception' => $e));
             if (APP_AUTH_BACKEND_ALLOW_FALLBACK != true) {
                 $tpl = new Template_Helper();
                 $tpl->setTemplate('authentication_error.tpl.html');
                 $tpl->assign('error_message', $e->getMessage());
                 $tpl->displayTemplate();
                 exit;
             }
             $instance = self::getFallBackAuthBackend();
         }
     }
     return $instance;
 }