本文整理汇总了PHP中standard_error函数的典型用法代码示例。如果您正苦于以下问题:PHP standard_error函数的具体用法?PHP standard_error怎么用?PHP standard_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了standard_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findDirs
/**
* Returns an array of found directories
*
* This function checks every found directory if they match either $uid or $gid, if they do
* the found directory is valid. It uses recursive function calls to find subdirectories. Due
* to the recursive behauviour this function may consume much memory.
*
* @param string path The path to start searching in
* @param integer uid The uid which must match the found directories
* @param integer gid The gid which must match the found direcotries
* @param array _fileList recursive transport array !for internal use only!
* @return array Array of found valid pathes
*
* @author Martin Burchert <martin.burchert@syscp.de>
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
*/
function findDirs($path, $uid, $gid)
{
$list = array($path);
$_fileList = array();
while (sizeof($list) > 0) {
$path = array_pop($list);
$path = makeCorrectDir($path);
if (!is_readable($path) || !is_executable($path)) {
//return $_fileList;
// only 'skip' this directory, #611
continue;
}
$dh = opendir($path);
if ($dh === false) {
/*
* this should never be called because we checked
* 'is_readable' before...but we never know what might happen
*/
standard_error('cannotreaddir', $path);
return null;
} else {
while (false !== ($file = @readdir($dh))) {
if ($file == '.' && (fileowner($path . '/' . $file) == $uid || filegroup($path . '/' . $file) == $gid)) {
$_fileList[] = makeCorrectDir($path);
}
if (is_dir($path . '/' . $file) && $file != '..' && $file != '.') {
array_push($list, $path . '/' . $file);
}
}
@closedir($dh);
}
}
return $_fileList;
}
示例2: verify_strike_status
function verify_strike_status($username = '', $supress_error = false)
{
global $vbulletin;
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "strikes WHERE striketime < " . (TIMENOW - 3600));
if (!$vbulletin->options['usestrikesystem']) {
return 0;
}
$strikes = $vbulletin->db->query_first("\n\t\tSELECT COUNT(*) AS strikes, MAX(striketime) AS lasttime\n\t\tFROM " . TABLE_PREFIX . "strikes\n\t\tWHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "'\n\t");
if ($strikes['strikes'] >= 5 and $strikes['lasttime'] > TIMENOW - 900) {
//they've got it wrong 5 times or greater for any username at the moment
// the user is still not giving up so lets keep increasing this marker
exec_strike_user($username);
if (!$supress_error) {
eval(standard_error(fetch_error('strikes', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'])));
} else {
return false;
}
} else {
if ($strikes['strikes'] > 5) {
// a bit sneaky but at least it makes the error message look right
$strikes['strikes'] = 5;
}
}
return $strikes['strikes'];
}
示例3: verify_visitormessage
/**
* Fetches information about the selected message with permission checks
*
* @param integer The post we want info about
* @param mixed Should a permission check be performed as well
*
* @return array Array of information about the message or prints an error if it doesn't exist / permission problems
*/
function verify_visitormessage($vmid, $alert = true, $perm_check = true)
{
global $vbulletin, $vbphrase;
$messageinfo = fetch_visitormessageinfo($vmid);
if (!$messageinfo) {
if ($alert) {
standard_error(fetch_error('invalidid', $vbphrase['visitor_message'], $vbulletin->options['contactuslink']));
} else {
return 0;
}
}
if ($perm_check) {
if ($messageinfo['state'] == 'deleted') {
$can_view_deleted = (can_moderate(0, 'canmoderatevisitormessages') or $messageinfo['userid'] == $vbulletin->userinfo['userid'] and $vbulletin->userinfo['permissions']['visitormessagepermissions'] & $vbulletin->bf_ugp_visitormessagepermissions['canmanageownprofile']);
if (!$can_view_deleted) {
standard_error(fetch_error('invalidid', $vbphrase['visitor_message'], $vbulletin->options['contactuslink']));
}
}
if ($messageinfo['state'] == 'moderation') {
$can_view_moderated = ($messageinfo['postuserid'] == $vbulletin->userinfo['userid'] or $messageinfo['userid'] == $vbulletin->userinfo['userid'] and $vbulletin->userinfo['permissions']['visitormessagepermissions'] & $vbulletin->bf_ugp_visitormessagepermissions['canmanageownprofile'] or can_moderate(0, 'canmoderatevisitormessages'));
if (!$can_view_moderated) {
standard_error(fetch_error('invalidid', $vbphrase['visitor_message'], $vbulletin->options['contactuslink']));
}
}
// Need coventry support first
// if (in_coventry($userinfo['userid']) AND !can_moderate())
// {
// standard_error(fetch_error('invalidid', $vbphrase['visitor_message'], $vbulletin->options['contactuslink']));
// }
}
return $messageinfo;
}
示例4: validate
/**
* Validates the given string by matching against the pattern, prints an error on failure and exits
*
* @param string $str the string to be tested (user input)
* @param string the $fieldname to be used in error messages
* @param string $pattern the regular expression to be used for testing
* @param string language id for the error
* @return string the clean string
*
* If the default pattern is used and the string does not match, we try to replace the
* 'bad' values and log the action.
*
*/
function validate($str, $fieldname, $pattern = '', $lng = '', $emptydefault = array())
{
global $log;
if (!is_array($emptydefault)) {
$emptydefault_array = array($emptydefault);
unset($emptydefault);
$emptydefault = $emptydefault_array;
unset($emptydefault_array);
}
// Check if the $str is one of the values which represent the default for an 'empty' value
if (is_array($emptydefault) && !empty($emptydefault) && in_array($str, $emptydefault) && isset($emptydefault[0])) {
return $emptydefault[0];
}
if ($pattern == '') {
$pattern = '/^[^\\r\\n\\t\\f\\0]*$/D';
if (!preg_match($pattern, $str)) {
// Allows letters a-z, digits, space (\\040), hyphen (\\-), underscore (\\_) and backslash (\\\\),
// everything else is removed from the string.
$allowed = "/[^a-z0-9\\040\\.\\-\\_\\\\]/i";
preg_replace($allowed, "", $str);
$log->logAction(null, LOG_WARNING, "cleaned bad formatted string (" . $str . ")");
}
}
if (preg_match($pattern, $str)) {
return $str;
}
if ($lng == '') {
$lng = 'stringformaterror';
}
standard_error($lng, $fieldname);
exit;
}
示例5: correctErrorDocument
/**
* this functions validates a given value as ErrorDocument
* refs #267
*
* @param string error-document-string
*
* @return string error-document-string
*
*/
function correctErrorDocument($errdoc = null)
{
global $idna_convert;
if ($errdoc !== null && $errdoc != '') {
// not a URL
if (strtoupper(substr($errdoc, 0, 5)) != 'HTTP:' && strtoupper(substr($errdoc, 0, 6)) != 'HTTPS:' || !validateUrl($errdoc)) {
// a file
if (substr($errdoc, 0, 1) != '"') {
$errdoc = makeCorrectFile($errdoc);
// apache needs a starting-slash (starting at the domains-docroot)
if (!substr($errdoc, 0, 1) == '/') {
$errdoc = '/' . $errdoc;
}
} else {
// string won't work for lighty
if (Settings::Get('system.webserver') == 'lighttpd') {
standard_error('stringerrordocumentnotvalidforlighty');
} elseif (substr($errdoc, -1) != '"') {
$errdoc .= '"';
}
}
} else {
if (Settings::Get('system.webserver') == 'lighttpd') {
standard_error('urlerrordocumentnotvalidforlighty');
}
}
}
return $errdoc;
}
示例6: findDirs
/**
* Returns an array of found directories
*
* This function checks every found directory if they match either $uid or $gid, if they do
* the found directory is valid. It uses recursive function calls to find subdirectories. Due
* to the recursive behauviour this function may consume much memory.
*
* @param string path The path to start searching in
* @param integer uid The uid which must match the found directories
* @param integer gid The gid which must match the found direcotries
* @param array _fileList recursive transport array !for internal use only!
* @return array Array of found valid pathes
*
* @author Martin Burchert <martin.burchert@syscp.de>
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
*/
function findDirs($path, $uid, $gid)
{
$list = array($path);
$_fileList = array();
while (sizeof($list) > 0) {
$path = array_pop($list);
$path = makeCorrectDir($path);
$dh = opendir($path);
if ($dh === false) {
standard_error('cannotreaddir', $path);
return null;
} else {
while (false !== ($file = @readdir($dh))) {
if ($file == '.' && (fileowner($path . '/' . $file) == $uid || filegroup($path . '/' . $file) == $gid)) {
$_fileList[] = makeCorrectDir($path);
}
if (is_dir($path . '/' . $file) && $file != '..' && $file != '.') {
array_push($list, $path . '/' . $file);
}
}
@closedir($dh);
}
}
return $_fileList;
}
示例7: output
public function output()
{
global $vbulletin;
$vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT));
// verify the userid exists, don't want useless entries in our table.
if ($vbulletin->GPC['userid'] and $vbulletin->GPC['userid'] != $vbulletin->userinfo['userid']) {
if (!($userinfo = fetch_userinfo($vbulletin->GPC['userid']))) {
standard_error(fetch_error('invalidid', $vbphrase['user'], $vbulletin->options['contactuslink']));
}
// are we a member of this user's blog?
if (!is_member_of_blog($vbulletin->userinfo, $userinfo)) {
print_no_permission();
}
$userid = $userinfo['userid'];
/* Blog posting check */
if (!($userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_canpost']) or !($userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown'])) {
print_no_permission();
}
} else {
$userinfo =& $vbulletin->userinfo;
$userid = '';
/* Blog posting check, no guests! */
if (!($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown']) or !($vbulletin->userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_canpost']) or !$vbulletin->userinfo['userid']) {
print_no_permission();
}
}
require_once DIR . '/includes/blog_functions_shared.php';
prepare_blog_category_permissions($userinfo, true);
$globalcats = $this->construct_category($userinfo, 'global');
$localcats = $this->construct_category($userinfo, 'local');
return array('globalcategorybits' => $globalcats, 'localcategorybits' => $localcats);
}
示例8: fetch_search_forumids
function fetch_search_forumids(&$forumchoice, $childforums = 0)
{
global $vbulletin, $display;
// make sure that $forumchoice is an array
if (!is_array($forumchoice)) {
$forumchoice = array($forumchoice);
}
// initialize the $forumids for return by this function
$forumids = array();
foreach ($forumchoice as $forumid) {
// get subscribed forumids
if ($forumid === 'subscribed' and $vbulletin->userinfo['userid'] != 0) {
DEVDEBUG("Querying subscribed forums for " . $vbulletin->userinfo['username']);
$sforums = $vbulletin->db->query_read_slave("\n\t\t\t\tSELECT forumid FROM " . TABLE_PREFIX . "subscribeforum\n\t\t\t\tWHERE userid = " . $vbulletin->userinfo['userid']);
if ($vbulletin->db->num_rows($sforums) == 0) {
// no subscribed forums
eval(standard_error(fetch_error('not_subscribed_to_any_forums')));
}
while ($sforum = $vbulletin->db->fetch_array($sforums)) {
$forumids["{$sforum['forumid']}"] .= $sforum['forumid'];
}
unset($sforum);
$vbulletin->db->free_result($sforums);
} else {
$forumid = intval($forumid);
if (isset($vbulletin->forumcache["{$forumid}"]) and $vbulletin->forumcache["{$forumid}"]['link'] == '') {
$forumids["{$forumid}"] = $forumid;
}
}
}
// now if there are any forumids we have to query, work out their child forums
if (empty($forumids)) {
$forumchoice = array();
$display['forums'] = array();
} else {
// set $forumchoice to show the returned forumids
#$forumchoice = implode(',', $forumids);
// put current forumids into the display table
$display['forums'] = $forumids;
// get child forums of selected forums
if ($childforums) {
require_once DIR . '/includes/functions_misc.php';
foreach ($forumids as $forumid) {
$children = fetch_child_forums($forumid, 'ARRAY');
if (!empty($children)) {
foreach ($children as $childid) {
$forumids["{$childid}"] = $childid;
}
}
unset($children);
}
}
}
// return the array of forumids
return $forumids;
}
示例9: show_inline_mod_login
/**
* Shows the form for inline mod authentication.
*/
function show_inline_mod_login($showerror = false)
{
global $vbulletin, $vbphrase, $show;
$show['inlinemod_form'] = true;
$show['passworderror'] = $showerror;
if (!$showerror) {
$vbulletin->url = SCRIPTPATH;
}
$forumHome = vB_Library::instance('content_channel')->getForumHomeChannel();
eval(standard_error(fetch_error('nopermission_loggedin', $vbulletin->userinfo['username'], vB_Template_Runtime::fetchStyleVar('right'), vB::getCurrentSession()->get('sessionurl'), $vbulletin->userinfo['securitytoken'], vB5_Route::buildUrl($forumHome['routeid'] . 'home|fullurl'))));
}
示例10: validate_ip
/**
* Checks whether it is a valid ip
*
* @return mixed ip address on success, standard_error on failure
*/
function validate_ip($ip, $return_bool = false, $lng = 'invalidip')
{
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === FALSE && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) === FALSE) {
if ($return_bool) {
return false;
} else {
standard_error($lng, $ip);
exit;
}
} else {
return $ip;
}
}
示例11: getFormOverviewGroupOutput
function getFormOverviewGroupOutput($groupname, $groupdetails)
{
global $lng, $filename, $s, $theme;
$group = '';
$title = $groupdetails['title'];
$part = $groupname;
$activated = true;
$option = '';
if (isset($groupdetails['fields'])) {
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (isset($fielddetails['overview_option']) && $fielddetails['overview_option'] == true) {
if ($fielddetails['type'] != 'option' && $fielddetails['type'] != 'bool') {
standard_error('overviewsettingoptionisnotavalidfield');
}
if ($fielddetails['type'] == 'option') {
$options_array = $fielddetails['option_options'];
$options = '';
foreach ($options_array as $value => $vtitle) {
$options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
}
$option .= $fielddetails['label'] . ': ';
$option .= '<select class="dropdown_noborder" name="' . $fieldname . '">';
$option .= $options;
$option .= '</select>';
$activated = true;
} else {
$option .= $lng['admin']['activated'] . ': ';
$option .= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
$activated = (int) Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']);
}
}
}
}
/**
* this part checks for the 'websrv_avail' entry in the settings
* if found, we check if the current webserver is in the array. If this
* is not the case, we change the setting type to "hidden", #502
*/
$do_show = true;
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
$websrv = Settings::Get('system.webserver');
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
$do_show = false;
$title .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
// hack disabled flag into select-box
$option = str_replace('<select class', '<select disabled="disabled" class', $option);
}
}
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
return $group;
}
示例12: validate_ip2
/**
* Checks whether it is a valid ip
*
* @return mixed ip address on success, false on failure
*/
function validate_ip2($ip, $return_bool = false, $lng = 'invalidip', $allow_localhost = false)
{
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE)) {
return $ip;
}
// special case where localhost ip is allowed (mysql-access-hosts for example)
if ($allow_localhost && $ip == '127.0.0.1') {
return $ip;
}
if ($return_bool) {
return false;
} else {
standard_error($lng, $ip);
exit;
}
}
示例13: getResponse
/**
* Main entry point for the controller.
*
* @return string - The final page output
*/
public function getResponse()
{
// Register the templater to be used for XHTML
vB_View::registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());
$error = vB_Router::getSegment('error');
// Resolve rerouted error
$error = in_array($error, array('403', '404', '409', '500')) ? $error : '404';
$current_page = $_SERVER['SCRIPT_NAME'] . ($_SERVER['SCRIPT_NAME'] == '' ? '' : '?' . $_SERVER['QUERY_STRING']);
if ('403' == $error) {
define('WOLPATH', '403|cpglobal|403_error|' . new vB_Phrase('wol', 'viewing_no_permission_message'));
vB::$vbulletin->session->set('location', $current_page);
print_no_permission();
} else {
if ('409' == $error) {
$message = ($message = vB_Router::getRerouteMessage()) ? $message : new vB_Phrase('error', 'error_409_description', vB_Router::getInitialURL(), vB_Router::getBaseURL(), vB::$vbulletin->options['contactuslink']);
define('WOLPATH', '409|wol|' . new vB_Phrase('cpglobal', 'error') . "|{$message}");
vB::$vbulletin->session->set('location', $current_page);
standard_error($message);
} else {
if ('500' == $error) {
$message = new vB_Phrase('error', 'error_500_description', vB_Router::getInitialURL(), vB_Router::getBaseURL(), vB::$vbulletin->options['contactuslink']);
define('WOLPATH', '500|wol|' . new vB_Phrase('cpglobal', 'error') . "|{$message}");
vB::$vbulletin->session->set('location', $current_page);
standard_error($message);
} else {
$message = new vB_Phrase('error', 'error_404_description', vB_Router::getBaseURL(), vB::$vbulletin->options['contactuslink']);
define('WOLPATH', '404|wol|' . new vB_Phrase('cpglobal', 'error') . "|{$message}");
vB::$vbulletin->session->set('location', $current_page);
}
}
}
// Create the page view
$page_view = new vB_View_Page('page');
$title = new vB_Phrase('error', 'error_404');
$page_view->setPageTitle($title);
// Create the body view
$error_view = new vB_View('error_message');
$subtitle = $title != ($subtitle = vB_Router::getRerouteMessage()) ? $subtitle : false;
$error_view->title = $title;
$error_view->subtitle = $subtitle;
$error_view->message = new vB_Phrase('error', 'error_404_description', vB_Router::getBaseURL(), vB::$vbulletin->options['contactuslink']);
$page_view->setBodyView($error_view);
// Add general page info
$page_view->setPageTitle($title);
return $page_view->render();
}
示例14: kbank_print_stop_message
function kbank_print_stop_message()
{
global $vbulletin;
$args = func_get_args();
if (VB_AREA == 'AdminCP') {
//back-end
call_user_func_array('print_stop_message', $args);
} else {
//font-end
$message = call_user_func_array('fetch_error', $args);
if (defined('CP_REDIRECT')) {
$vbulletin->url = CP_REDIRECT;
eval(print_standard_redirect($message, false, true));
} else {
eval(standard_error($message));
}
}
}
示例15: doAction
function doAction($action)
{
global $kbank, $vbulletin, $bbuserinfo, $permissions, $KBANK_HOOK_NAME;
if ($action == 'enable') {
$item = $this->data;
eval('$tmp = "' . fetch_template('kbank_template_announce_enable') . '";');
eval(standard_error($tmp));
}
if ($action == 'do_enable') {
if ($this->ready2Enable()) {
$vbulletin->input->clean_array_gpc('r', array('url' => TYPE_NOHTML, 'text' => TYPE_NOHTML));
if (strlen($vbulletin->GPC['text']) > $this->itemtypedata['options']['text_max']) {
$vbulletin->GPC['text'] = substr($vbulletin->GPC['text'], 0, $this->itemtypedata['options']['text_max']) . '..';
}
$url_cutoff = array('javascript:', 'ftp://');
$vbulletin->GPC['url'] = str_replace($url_cutoff, '', $vbulletin->GPC['url']);
if (substr($vbulletin->GPC['url'], 0, 7) != 'http://') {
$vbulletin->GPC['url'] = 'http://' . $vbulletin->GPC['url'];
}
$item_new = array('status' => KBANK_ITEM_ENABLED, 'expire_time' => iif(!$this->data['options']['enabled'], iif($this->data['options']['duration'] > 0, TIMENOW + $this->data['options']['duration'] * 24 * 60 * 60, -1), $this->data['expire_time']), 'options' => serialize(array('url' => $vbulletin->GPC['url'], 'text' => $vbulletin->GPC['text'], 'enabled' => 1)));
$vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data['itemid']}"));
//Update datastore
updateAnnounceCache();
}
}
if ($this->data['status'] == KBANK_ITEM_ENABLED and ($action == 'sell' or $action == 'gift')) {
//Update datastore
updateAnnounceCache();
}
if ($action == 'disable') {
if ($this->ready2Disable()) {
$item_new = array('status' => KBANK_ITEM_AVAILABLE);
$vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data[itemid]}"));
//Update datastore
updateAnnounceCache();
}
}
if ($action == 'work_real' && $KBANK_HOOK_NAME == KBANK_GLOBAL_START) {
global $kbank_announces;
$kbank_announces[] = array('url' => $this->data['options']['url'], 'text' => $vbulletin->kbankBBCodeParser->parse_bbcode($this->data['options']['text'], true), 'owner' => getUsername($this->data));
}
return parent::doAction($action);
}