本文整理汇总了PHP中die_error函数的典型用法代码示例。如果您正苦于以下问题:PHP die_error函数的具体用法?PHP die_error怎么用?PHP die_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了die_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$a_pref = $prefs->get('UserGroupDB', 'activedirectory');
if (is_array($a_pref)) {
foreach ($a_pref as $k => $v) {
$this->preferences[$k] = $v;
}
}
// Generate parent (ldap) settings
$this->preferences['filter'] = '(objectClass=group)';
$this->preferences['match'] = array('name' => 'name', 'description' => 'description');
$this->preferences['group_match_user'] = array('user_field', 'group_field');
$this->preferences['user_field'] = 'memberOf';
$this->preferences['user_field_type'] = 'group_dn';
$this->preferences['group_field'] = 'member';
$this->preferences['group_field_type'] = 'user_dn';
$this->preferences['ou'] = '';
if (array_key_exists('use_child_group', $this->preferences)) {
if (in_array($this->preferences['use_child_group'], array(1, '1'))) {
$this->preferences['user_field'] .= ':1.2.840.113556.1.4.1941:';
$this->preferences['group_field'] .= ':1.2.840.113556.1.4.1941:';
}
}
}
示例2: __autoload
function __autoload($class_name)
{
//what about NameSpaces ?
$class_files = array();
if (!class_exists($class_name)) {
$class_files[] = PREMIUM_CLASSES_DIR . '/' . $class_name . '.class.php';
$class_files[] = CLASSES_DIR . '/' . $class_name . '.class.php';
$class_files[] = CLASSES_DIR . '/configelements/' . $class_name . '.class.php';
$class_files[] = CLASSES_DIR . '/events/' . $class_name . '.class.php';
$class_files[] = EVENTS_DIR . '/' . $class_name . '.class.php';
$class_files[] = CLASSES_DIR . '/tasks/' . $class_name . '.class.php';
$class_files[] = MODULES_DIR . '/' . $class_name . '.php';
$class_files[] = ABSTRACT_CLASSES_DIR . '/' . $class_name . '.class.php';
$class_files[] = ABSTRACT_CLASSES_DIR . '/liaison/' . $class_name . '.class.php';
$class_files[] = ADMIN_CLASSES_DIR . '/' . $class_name . '.class.php';
$class_files[] = MODULES_DIR . '/' . preg_replace('/_/', '/', $class_name, 1) . '.php';
foreach ($class_files as $class_file) {
if (file_exists($class_file)) {
require_once $class_file;
return;
}
}
if (isset($autoload_die) && $autoload_die === true) {
die_error('Class \'' . $class_name . '\' not found', __FILE__, __LINE__);
}
}
}
示例3: invitation
public function invitation()
{
$id = $this->input->post('id', true);
if (!is_numeric($id)) {
die_error($id . ' : bad identifier.');
}
// ...
die($id . ' not invited.');
}
示例4: __construct
public function __construct()
{
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$this->config = $prefs->get('UserDB', 'ldap');
$this->cache_users = array();
}
示例5: __construct
public function __construct()
{
$prefs = Preferences::getInstance();
if ($prefs) {
$this->config = $prefs->get('UserGroupDB', 'sql_external');
} else {
die_error('USERGROUPDB::MYSQL_external::construct get Prefs failed', __FILE__, __LINE__);
}
}
示例6: send_alert_mail
function send_alert_mail($subject_, $message_)
{
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$tos = $prefs->get('events', 'mail_to');
foreach ($tos as $to) {
sendamail($to, $subject_, $message_);
}
}
示例7: makeLDAPconfig
public function makeLDAPconfig($config_ = NULL)
{
if ($config_ != NULL) {
$config = $config_;
} else {
$config = $this->config_ad;
}
$ldap_suffix = domain2suffix($config['domain']);
if (!$ldap_suffix) {
die_error('Active Directory configuration not valid (domain2suffix error)2', __FILE__, __LINE__);
}
$match_minimal = array('login' => 'sAMAccountName', 'displayname' => 'displayName', 'real_login' => 'sAMAccountName', 'countrycode' => 'c', 'objectclass' => 'objectClass');
$config_ldap = array('hosts' => $config['hosts'], 'suffix' => $ldap_suffix, 'login' => $config['login'] . '@' . $config['domain'], 'password' => $config['password'], 'port' => '389', 'options' => array('LDAP_OPT_PROTOCOL_VERSION' => '3', 'LDAP_OPT_REFERRALS' => 0), 'filter' => '(&(objectCategory=person)(objectClass=user))', 'match' => array_merge($match_minimal, $config['match']));
return $config_ldap;
}
示例8: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$enabled_modules = $prefs->get('general', 'module_enable');
if (!in_array('SessionManagement', $enabled_modules)) {
die_error('SessionManagement module must be enabled', __FILE__, __LINE__);
}
$SessionManagement_module_name = 'SessionManagement_' . $prefs->get('SessionManagement', 'enable');
self::$instance = new $SessionManagement_module_name();
}
return self::$instance;
}
示例9: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$mods_enable = $prefs->get('general', 'module_enable');
if (!in_array('UserDB', $mods_enable)) {
die_error(_('UserDB module must be enabled'), __FILE__, __LINE__);
}
$mod_app_name = 'UserDB_' . $prefs->get('UserDB', 'enable');
self::$instance = new $mod_app_name();
}
return self::$instance;
}
示例10: getLocale
public function getLocale()
{
if ($this->hasAttribute('countrycode')) {
$language = $this->getAttribute('countrycode');
// only works for ISO-3166
} else {
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$default_settings = $prefs->get('general', 'session_settings_defaults');
$language = $default_settings['language'];
}
$locale = locale2unix($language);
return $locale;
}
示例11: __autoload
function __autoload($class_name)
{
//what about NameSpaces ?
$class_files = array();
if (!class_exists($class_name)) {
$class_files[] = CLASSES_DIR . '/' . $class_name . '.class.php';
foreach ($class_files as $class_file) {
if (file_exists($class_file)) {
require_once $class_file;
return;
}
}
if (isset($autoload_die) && $autoload_die === true) {
die_error('Class \'' . $class_name . '\' not found', __FILE__, __LINE__);
}
}
}
示例12: __construct
public function __construct($id_, $name_, $description_, $url_)
{
Logger::debug('main', "Application_weblink::construct('{$id_}','{$name_}','{$description_}','{$url_}')");
parent::__construct($id_, $name_, $description_, 'weblink', $url_, NULL, NULL, NULL, true, $name_ . '.weblink');
// executable_path <=> url;
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$mods_enable = $prefs->get('general', 'module_enable');
if (!in_array('ApplicationDB', $mods_enable)) {
die_error('Module ApplicationDB must be enabled', __FILE__, __LINE__);
}
$default_browser = $prefs->get('general', 'default_browser');
if (!is_array($default_browser)) {
Logger::error('main', 'Application_weblink::construct failed to get default_browser preferences');
}
$this->default_browser = $default_browser;
}
示例13: execute
public function execute($dataContainer)
{
defined('_AEXEC') or die("Access denied");
require_once 'AdminHelpProcessing.php';
require_once 'AdminHelpInterface.php';
require_once PATH_ACCESS . '/GlobalSettingsManager.php';
$gbManager = new GlobalSettingsManager();
$helpInterface = new AdminHelpInterface($this->relPath);
$helpProcessing = new AdminHelpProcessing($helpInterface);
if ('POST' == $_SERVER['REQUEST_METHOD']) {
try {
switch ($_GET['action']) {
case 1:
//show the Help-Text
try {
$helptext = $gbManager->getHelpText();
} catch (MySQLVoidDataException $e) {
$helptext = ' ';
}
$helpInterface->ShowHelp($helptext);
break;
case 2:
//edit the Help-Text
if (isset($_POST['helptext'])) {
$helpProcessing->change_help($_POST['helptext']);
} else {
try {
$helptext = $gbManager->getHelpText();
} catch (MySQLVoidDataException $e) {
$helptext = ' ';
}
$helpInterface->EditHelp($helptext);
}
break;
}
} catch (Exception $e) {
die_error($e->getMessage());
}
} else {
$helpInterface->IndexMenu();
}
}
示例14: __construct
public function __construct($id_, $application_id, $url_prefix, $raw_configuration, $values)
{
Logger::debug('api', "Application_webapp_configuration::construct('{$id_}','{$application_id}','{$url_prefix}','{$raw_configuration}','{$values}')");
$prefs = Preferences::getInstance();
if (!$prefs) {
die_error('get Preferences failed', __FILE__, __LINE__);
}
$mods_enable = $prefs->get('general', 'module_enable');
if (!in_array('ApplicationDB', $mods_enable)) {
die_error('Module ApplicationDB must be enabled', __FILE__, __LINE__);
}
if (!in_array('WebAppConfDB', $mods_enable)) {
die_error('Module WebAppConfDB must be enabled', __FILE__, __LINE__);
}
$this->attributes = array();
$this->attributes['id'] = $id_;
$this->attributes['application_id'] = $application_id;
$this->attributes['url_prefix'] = $url_prefix;
$this->attributes['raw_configuration'] = $raw_configuration;
$this->attributes['values'] = $values;
}
示例15: __construct
public function __construct($login_, $password_, $ssl_ = true)
{
if (defined('DEBUG_MODE') && DEBUG_MODE === true) {
ini_set('soap.wsdl_cache_enabled', 0);
}
$xff = $_SERVER['REMOTE_ADDR'];
$headers = apache_request_headers();
foreach ($headers as $k => $v) {
// Internet explorer send http headers in lower cases...
$k = strtolower($k);
if ($k == 'x-forwarded-for') {
$xff = $v . ', ' . $_SERVER['REMOTE_ADDR'];
}
}
try {
$this->service = new SoapClient(ADMIN_ROOT . '/includes/ovd-admin.wsdl', array('login' => $login_, 'password' => $password_, 'location' => ($ssl_ ? 'https' : 'http') . '://' . SESSIONMANAGER_HOST . '/ovd/service/admin', 'stream_context' => stream_context_create(array('http' => array('header' => 'X-Forwarded-For: ' . $xff)))));
} catch (Exception $e) {
die_error(self::format_soap_error_message($e));
throw $e;
}
}