本文整理汇总了PHP中Horde::fatal方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::fatal方法的具体用法?PHP Horde::fatal怎么用?PHP Horde::fatal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::fatal方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
* Copyright 1999-2004 Jon Parise <jon@horde.org>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
@define('AUTH_HANDLER', true);
@define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Menu.php';
require_once HORDE_LIBS . 'Horde/Secret.php';
/* Initialize the Auth credentials key. */
Secret::setKey('auth');
/* Get an Auth object. */
$auth =& Auth::singleton($conf['auth']['driver']);
if (is_a($auth, 'PEAR_Error')) {
Horde::fatal($auth, __FILE__, __LINE__);
}
/* Get parameters. */
$logout_reason = $auth->getLogoutReason();
$url_param = Util::getFormData('url');
if ($logout_reason) {
$login_screen = $auth->_getLoginScreen();
if (Util::removeParameter($login_screen, array('url', 'nocache')) != Util::removeParameter(Horde::url(Horde::selfUrl(), true), array('url', 'nocache'))) {
$url = Auth::addLogoutParameters($login_screen);
if ($url_param) {
$url = Util::addParameter($login_screen, 'url', $url_param);
}
header('Location: ' . $url);
exit;
}
$language = isset($prefs) ? $prefs->getValue('language') : NLS::select();
示例2: define
* .horde_templates/$app/_themes/$theme/sometemplatedir/templatefile
* to be able to call up an entire theme group of templates? better error
* checking; downloading of original templates; the application side of
* allowing a different template to be chosen/prefs/etc.
*
* Copyright 2003-2004 Marko Djukic <marko@oblo.com>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
define('HORDE_BASE', dirname(__FILE__) . '/..');
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Menu.php';
require_once HORDE_LIBS . 'Horde/Variables.php';
if (!Auth::isAdmin()) {
Horde::fatal('Forbidden.', __FILE__, __LINE__);
}
$auth =& Auth::singleton($conf['auth']['driver']);
function _setValuesToKeys($in)
{
$out = array();
foreach ($in as $value) {
$out[$value] = $value;
}
asort($out);
return $out;
}
/* Set up VFS. */
require_once HORDE_LIBS . 'VFS.php';
$vfs_type = $conf['vfs']['type'];
$vfs_args = Horde::getDriverConfig('vfs', $vfs_type);
示例3:
<?php
/**
* $Horde: horde/services/download/index.php,v 1.6 2004/01/01 15:17:01 jan Exp $
*
* Copyright 2002-2004 Michael Slusarz <slusarz@bigworm.colorado.edu>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
include_once '../../lib/base.php';
if (!($module = Util::getFormData('module')) || !file_exists($registry->getParam('fileroot', $module))) {
Horde::fatal('Do not call this script directly.', __FILE__, __LINE__);
}
include $registry->getParam('fileroot', $module) . '/view.php';
示例4: setupSessionHandler
/**
* Sets a custom session handler up, if there is one.
* If the global variable 'session_cache_limiter' is defined, its value
* will override the cache limiter setting found in the configuration
* file.
*/
function setupSessionHandler()
{
global $conf;
ini_set('url_rewriter.tags', 0);
if (!empty($conf['session']['use_only_cookies'])) {
ini_set('session.use_only_cookies', 1);
if (!empty($conf['cookie']['domain']) && strpos($conf['server']['name'], '.') === false) {
Horde::fatal('Session cookies will not work without a FQDN and with a non-empty cookie domain. Either use a fully qualified domain name like "http://www.example.com" instead of "http://example" only, or set the cookie domain in the Horde configuration to an empty value, or enable non-cookie (url-based) sessions in the Horde configuration.', __FILE__, __LINE__);
}
}
session_set_cookie_params($conf['session']['timeout'], $conf['cookie']['path'], $conf['cookie']['domain'], $conf['use_ssl'] == 1 ? 1 : 0);
session_cache_limiter(Util::nonInputVar('session_cache_limiter', $conf['session']['cache_limiter']));
session_name(urlencode($conf['session']['name']));
$type = !empty($conf['sessionhandler']['type']) ? $conf['sessionhandler']['type'] : 'none';
if ($type == 'external') {
$calls = $conf['sessionhandler']['params'];
session_set_save_handler($calls['open'], $calls['close'], $calls['read'], $calls['write'], $calls['destroy'], $calls['gc']);
} elseif ($type != 'none') {
require_once 'Horde/SessionHandler.php';
$sh =& SessionHandler::singleton($conf['sessionhandler']['type'], array_merge(Horde::getDriverConfig('sessionhandler', $conf['sessionhandler']['type']), array('memcache' => !empty($conf['sessionhandler']['memcache']))));
if (is_a($sh, 'PEAR_Error')) {
Horde::fatal(PEAR::raiseError('Horde is unable to correctly start the custom session handler.'), __FILE__, __LINE__, false);
} else {
ini_set('session.save_handler', 'user');
session_set_save_handler(array(&$sh, 'open'), array(&$sh, 'close'), array(&$sh, 'read'), array(&$sh, 'write'), array(&$sh, 'destroy'), array(&$sh, 'gc'));
}
}
}
示例5: _
}
$title = _("User Administration");
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_TEMPLATES . '/admin/common-header.inc';
$notification->notify(array('listeners' => 'status'));
if (isset($update_form) && $auth->hasCapability('list')) {
require_once HORDE_LIBS . 'Horde/Identity.php';
$identity =& Identity::singleton('none', $f_user_name);
require HORDE_TEMPLATES . '/admin/user/update.inc';
} elseif (isset($remove_form) && $auth->hasCapability('list') && $auth->hasCapability('remove')) {
require HORDE_TEMPLATES . '/admin/user/remove.inc';
} elseif (isset($removequeued_form)) {
require HORDE_TEMPLATES . '/admin/user/removequeued.inc';
} elseif ($auth->hasCapability('add')) {
require HORDE_TEMPLATES . '/admin/user/add.inc';
if ($conf['signup']['approve']) {
require HORDE_TEMPLATES . '/admin/user/approve.inc';
}
} else {
require HORDE_TEMPLATES . '/admin/user/noadd.inc';
}
if ($auth->hasCapability('list')) {
$users = $auth->listUsers();
if (is_a($users, 'PEAR_Error')) {
Horde::fatal($users, __FILE__, __LINE__);
}
require HORDE_TEMPLATES . '/admin/user/list.inc';
} else {
require HORDE_TEMPLATES . '/admin/user/nolist.inc';
}
require HORDE_TEMPLATES . '/common-footer.inc';
示例6: dirname
* will need, and sets up objects that all scripts use.
*/
// Check for a prior definition of HORDE_BASE (perhaps by an
// auto_prepend_file definition for site customization).
if (!defined('HORDE_BASE')) {
@define('HORDE_BASE', dirname(__FILE__) . '/../..');
}
// Load the Horde Framework core, and set up inclusion paths.
require_once HORDE_BASE . '/lib/core.php';
// Registry
$registry =& Registry::singleton();
if (is_a($pushed = $registry->pushApp('chora', !defined('AUTH_HANDLER')), 'PEAR_Error')) {
if ($pushed->getCode() == 'permission_denied') {
Horde::authenticationFailureRedirect();
}
Horde::fatal($pushed, __FILE__, __LINE__, false);
}
$conf =& $GLOBALS['conf'];
@define('CHORA_TEMPLATES', $registry->getParam('templates'));
// Notification system.
$notification =& Notification::singleton();
$notification->attach('status');
// Find the base file path of Chora.
@define('CHORA_BASE', dirname(__FILE__) . '/..');
// Horde base libraries.
require_once HORDE_LIBS . 'Horde/Text.php';
require_once HORDE_LIBS . 'Horde/Help.php';
// Chora libraries and config.
require_once CHORA_BASE . '/config/sourceroots.php';
require_once CHORA_BASE . '/lib/Chora.php';
require_once HORDE_LIBS . 'Horde/VC.php';
示例7: define
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
define('HORDE_BASE', dirname(__FILE__) . '/../..');
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Menu.php';
require_once HORDE_LIBS . 'Horde/Form.php';
require_once HORDE_LIBS . 'Horde/Form/Action.php';
require_once HORDE_LIBS . 'Horde/Form/Renderer.php';
require_once HORDE_LIBS . 'Horde/Config.php';
require_once HORDE_LIBS . 'Horde/Variables.php';
if (!Auth::isAdmin()) {
Horde::fatal('Forbidden.', __FILE__, __LINE__);
}
if (!Util::extensionExists('domxml')) {
Horde::fatal(PEAR::raiseError('You need the domxml PHP extension to use the configuration tool.'), __FILE__, __LINE__);
}
$app = Util::getFormData('app');
$appname = $registry->getParam('name', $app);
$title = sprintf(_("%s Configuration"), $appname);
if ($app === null && in_array($app, $registry->listApps(array('inactive', 'hidden', 'notoolbar', 'active', 'admin')))) {
$notification->push(_("Invalid application."), 'horde.error');
$url = Horde::applicationUrl('admin/setup/index.php', true);
header('Location: ' . $url);
exit;
}
$vars = Variables::getDefaultVariables();
$form =& new ConfigForm($vars, $app);
$form->setTitle($title);
$form->setButtons(sprintf(_("Generate %s Configuration"), $appname));
$php = '';
示例8: header
include_once '../lib/base.php';
include_once HORDE_LIBS . 'Horde/Maintenance.php';
/* Make sure there is a user logged in. */
if (!Auth::getAuth()) {
$url = Horde::url($registry->getParam('webroot', 'horde') . '/login.php', true);
$url = Util::addParameter($url, 'url', Horde::selfUrl());
header('Location: ' . $url);
exit;
}
/* If no 'module' parameter passed in, return error. */
if (!($module = basename(Util::getFormData('module', '')))) {
Horde::fatal(PEAR::raiseError(_("Do not directly access maintenance.php")), __FILE__, __LINE__);
}
/* Load the module specific maintenance class now. */
if (!($maint =& Maintenance::factory($module))) {
Horde::fatal(PEAR::raiseError(_("The Maintenance:: class did not load successfully")), __FILE__, __LINE__);
}
/* Have the maintenance module do all necessary processing. */
list($action, $tasks) = $maint->runMaintenancePage();
/* Print top elements of confirmation page. */
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_TEMPLATES . '/maintenance/maintenance_top.inc';
if ($action == MAINTENANCE_OUTPUT_CONFIRM) {
/* Confirmation-style output */
require HORDE_TEMPLATES . '/maintenance/confirm_top.inc';
if ($browser->hasFeature('javascript')) {
include HORDE_TEMPLATES . '/maintenance/javascript.inc';
}
/* $pref, $descrip, & $checked need to be set for the templates. */
foreach ($tasks as $pref) {
list($descrip, $checked) = $maint->infoMaintenance($pref);