| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/data/wwwroot/2026_06_02_05/source/function/ |
Upload File : |
<?php
/**
* [Discuz!] (C)2001-2099 Discuz! Team
* This is NOT a freeware, use is subject to license terms
* https://license.discuz.vip
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
function dshowmessage($message, $url_forward = '', $values = [], $extraparam = [], $custom = 0) {
global $_G, $show_message;
$vars = explode(':', $message);
if(count($vars) == 2) {
$show_message = lang('plugin/'.$vars[0], $vars[1], $values);
} else {
$show_message = lang('message', $message, $values);
}
$_G['messageparam'] = func_get_args();
if(defined('IN_RESTFUL')) {
$_G['dshowmessageParam'] = [
'message' => $message,
'show_message' => $show_message,
'url_forward' => $url_forward,
'values' => $values,
'extraparam' => $extraparam,
'custom' => $custom,
];
}
if(empty($_G['inhookscript']) && defined('CURMODULE')) {
hookscript(CURMODULE, $_G['basescript'], 'messagefuncs', ['param' => $_G['messageparam']]);
}
if(!empty($extraparam['break'])) {
return;
}
$_G['inshowmessage'] = true;
$param = [
'header' => false,
'timeout' => null,
'refreshtime' => null,
'closetime' => null,
'locationtime' => null,
'alert' => null,
'return' => false,
'redirectmsg' => 0,
'msgtype' => 1,
'showmsg' => true,
'showdialog' => false,
'login' => false,
'handle' => false,
'extrajs' => '',
'mobileextrajs' => '',
'striptags' => true,
];
if($message == 'submit_seccode_invalid' && !empty($_GET['seccodehash'])) {
$param['extrajs'] .= '<script type="text/javascript" reload="1">if(typeof updateseccode != \'undefined\') { updateseccode(\''.$_GET['seccodehash'].'\'); } else if(typeof updateseccode_'.$_GET['seccodehash'].' != \'undefined\') { updateseccode_'.$_GET['seccodehash'].'(\''.$_GET['seccodehash'].'\'); }</script>';
}
$navtitle = lang('core', 'title_board_message');
if($custom) {
$alerttype = 'alert_info';
$show_message = $message;
include template('common/showmessage');
dexit();
}
define('CACHE_FORBIDDEN', TRUE);
$_G['setting']['msgforward'] = @dunserialize($_G['setting']['msgforward']);
$handlekey = $leftmsg = '';
if(defined('IN_MOBILE')) {
unset($extraparam['showdialog']);
unset($extraparam['closetime']);
unset($extraparam['extrajs']);
if(!$url_forward && dreferer() && defined('IN_MOBILE') && constant('IN_MOBILE') == 1) {
$url_forward = $referer = dreferer();
}
if(!empty($url_forward) && !str_contains($url_forward, 'mobile')) {
$url_forward_arr = explode('#', $url_forward);
if(str_contains($url_forward_arr[0], '?')) {
$url_forward_arr[0] = $url_forward_arr[0].'&mobile='.IN_MOBILE;
} else {
$url_forward_arr[0] = $url_forward_arr[0].'?mobile='.IN_MOBILE;
}
$url_forward = implode('#', $url_forward_arr);
}
} else {
unset($extraparam['mobileextrajs']);
}
if(empty($_G['inajax']) && (!empty($_GET['quickforward']) || $_G['setting']['msgforward']['quick'] && empty($extraparam['clean_msgforward']) && $_G['setting']['msgforward']['messages'] && is_array($_G['setting']['msgforward']['messages']) && in_array($message, $_G['setting']['msgforward']['messages']))) {
$param['header'] = true;
}
$_GET['handlekey'] = !empty($_GET['handlekey']) && preg_match('/^\w+$/', $_GET['handlekey']) ? $_GET['handlekey'] : '';
if(!empty($_G['inajax'])) {
$handlekey = $_GET['handlekey'] = !empty($_GET['handlekey']) ? dhtmlspecialchars($_GET['handlekey']) : '';
$param['handle'] = true;
$param['msgtype'] = empty($_GET['ajaxmenu']) && (empty($_POST) || !empty($_GET['nopost'])) ? 2 : 3;
}
if($url_forward) {
$param['timeout'] = true;
if($param['handle'] && !empty($_G['inajax'])) {
$param['showmsg'] = false;
}
}
foreach($extraparam as $k => $v) {
$param[$k] = $v;
}
if(array_key_exists('set', $extraparam)) {
$setdata = ['1' => ['msgtype' => 3]];
if($setdata[$extraparam['set']]) {
foreach($setdata[$extraparam['set']] as $k => $v) {
$param[$k] = $v;
}
}
}
$timedefault = intval($param['refreshtime'] === null ? $_G['setting']['msgforward']['refreshtime'] : $param['refreshtime']);
if($param['timeout'] !== null) {
$refreshsecond = !empty($timedefault) ? $timedefault : 3;
$refreshtime = $refreshsecond * 1000;
} else {
$refreshtime = $refreshsecond = 0;
}
if($param['login'] && $_G['uid'] || $url_forward) {
$param['login'] = false;
}
$param['header'] = $url_forward && $param['header'];
if(getgpc('ajaxdata') === 'json') {
$param['header'] = '';
}
if($param['header']) {
header('HTTP/1.1 301 Moved Permanently');
dheader('location: '.str_replace('&', '&', $url_forward));
}
$url_forward_js = addslashes(str_replace('\\', '%27', $url_forward));
if(!empty($param['location']) && !empty($_G['inajax'])) {
include template('common/header_ajax');
echo '<script type="text/javascript" reload="1">window.location.href=\''.$url_forward_js.'\';</script>';
include template('common/footer_ajax');
dexit();
}
$_G['hookscriptmessage'] = $message;
$_G['hookscriptvalues'] = $values;
if(isset($_GET['ajaxdata'])) {
if($_GET['ajaxdata'] === 'json') {
helper_output::json(['message' => $show_message, 'data' => $values]);
} else if($_GET['ajaxdata'] === 'html') {
helper_output::html($show_message);
}
}
if($param['msgtype'] == 2 && $param['login']) {
dheader('location: member.php?mod=logging&action=login&handlekey='.$handlekey.'&infloat=yes&inajax=yes&guestmessage=yes');
}
if(strpos($message, 'nopermission') > 0) {
if($_G['member']['groupid'] == 8 && $_G['setting']['regverify'] == 1) {
$show_message .= lang('message', 'nopermission_email');
} else if($_G['member']['groupid'] == 8 && $_G['setting']['regverify'] == 2) {
$show_message .= lang('message', 'nopermission_verify');
}
}
$show_jsmessage = str_replace("'", "\\'", $param['striptags'] ? strip_tags($show_message) : $show_message);
if((!$param['showmsg'] || !empty($param['showid'])) && !defined('IN_MOBILE')) {
$show_message = '';
}
$allowreturn = !$param['timeout'] && !$url_forward && !$param['login'] || $param['return'];
if($param['alert'] === null) {
$alerttype = $url_forward ? (preg_match('/\_(succeed|success)$/', $message) ? 'alert_right' : 'alert_info') : ($allowreturn ? 'alert_error' : 'alert_info');
} else {
$alerttype = 'alert_'.$param['alert'];
}
$extra = '';
if(!empty($param['showid'])) {
$extra .= 'if($(\''.$param['showid'].'\')) {$(\''.$param['showid'].'\').innerHTML = \''.$show_jsmessage.'\';}';
}
if($param['handle']) {
$valuesjs = $comma = $subjs = '';
foreach($values as $k => $v) {
$v = daddslashes($v);
if(is_array($v)) {
$subcomma = '';
foreach($v as $subk => $subv) {
$subjs .= $subcomma.'\''.$subk.'\':\''.$subv.'\'';
$subcomma = ',';
}
$valuesjs .= $comma.'\''.$k.'\':{'.$subjs.'}';
} else {
$valuesjs .= $comma.'\''.$k.'\':\''.$v.'\'';
}
$comma = ',';
}
$valuesjs = '{'.$valuesjs.'}';
if($url_forward) {
$extra .= 'if(typeof succeedhandle_'.$handlekey.'==\'function\') {succeedhandle_'.$handlekey.'(\''.$url_forward_js.'\', \''.$show_jsmessage.'\', '.$valuesjs.');}';
} else {
$extra .= 'if(typeof errorhandle_'.$handlekey.'==\'function\') {errorhandle_'.$handlekey.'(\''.$show_jsmessage.'\', '.$valuesjs.');}';
}
}
if($param['closetime'] !== null) {
$param['closetime'] = $param['closetime'] === true ? $timedefault : $param['closetime'];
}
if($param['locationtime'] !== null) {
$param['locationtime'] = $param['locationtime'] === true ? $timedefault : $param['locationtime'];
}
if($handlekey) {
if($param['showdialog']) {
$modes = ['alert_error' => 'alert', 'alert_right' => 'right', 'alert_info' => 'notice'];
$extra .= 'hideWindow(\''.$handlekey.'\');showDialog(\''.$show_jsmessage.'\', \''.$modes[$alerttype].'\', null, '.($param['locationtime'] !== null ? 'function () { window.location.href =\''.$url_forward_js.'\'; }' : 'null').', 0, null, null, null, null, '.($param['closetime'] ? $param['closetime'] : 'null').', '.($param['locationtime'] ? $param['locationtime'] : 'null').');';
$param['closetime'] = null;
$st = '';
if($param['showmsg']) {
$show_message = '';
}
}
if($param['closetime'] !== null) {
$extra .= 'setTimeout("hideWindow(\''.$handlekey.'\')", '.($param['closetime'] * 1000).');';
}
} else {
$st = $param['locationtime'] !== null ? 'setTimeout("window.location.href =\''.$url_forward_js.'\';", '.($param['locationtime'] * 1000).');' : '';
}
if(!$extra && $param['timeout'] && !defined('IN_MOBILE')) {
$extra .= 'setTimeout("window.location.href =\''.$url_forward_js.'\';", '.$refreshtime.');';
}
$show_message .= $extra ? '<script type="text/javascript" reload="1">'.$extra.$st.'</script>' : '';
$show_message .= $param['extrajs'] ? $param['extrajs'] : '';
include template('common/showmessage');
dexit();
}