//redirect with success redirect_header('index.php', 2, _PROFILE_MA_NEWMAILMSGSENT); } } else { //relevant error messages echo $xoopsMailer->getErrors(); } } } else { //check unique key $code = isset($_GET['code']) ? $_GET['code'] : redirect_header(XOOPS_URL, 2, _PROFILE_MA_CONFCODEMISSING); if ($code == $key) { //change email address to the proposed one $xoopsUser->setVar('email', $xoopsUser->getVar('newemail', 'n')); //update user data $member_handler =& xoops_gethandler('member'); if ($member_handler->insertUser($xoopsUser, true)) { //redirect with success redirect_header('index.php', 2, _PROFILE_MA_EMAILCHANGED); } else { //error in update process echo implode('<br />', $xoopsUser->getErrors()); } } else { //wrong key $eh =& XoopsErrorHandler::getInstance(); $eh->errorPage(1, $xoopsModule->getVar('mid')); } } } include XOOPS_ROOT_PATH . "/footer.php";
/** * User-defined shutdown function (called from 'exit') * * @access public * @return void */ function XoopsErrorHandler_Shutdown() { $error_handler =& XoopsErrorHandler::getInstance(); echo $error_handler->renderErrors(); }
function prepare() { $GLOBALS['xoopsErrorHandler'] =& XoopsErrorHandler::getInstance(); $GLOBALS['xoopsErrorHandler']->activate(true); }
/** * perform a query on the database * * this method allows only SELECT queries for safety. * * @param string $sql a valid MySQL query * @param int $limit number of records to return * @param int $start offset of first record to return * @return resource query result or FALSE if unsuccessful */ function query($sql, $limit = 0, $start = 0) { $sql = ltrim($sql); if (strtolower(substr($sql, 0, 6)) == 'select') { //if (preg_match("/^SELECT.*/i", $sql)) { return $this->queryF($sql, $limit, $start); } elseif (is_object($GLOBALS['xoopsSecurity']) && !$GLOBALS['xoopsSecurity']->checkReferer()) { $eh =& XoopsErrorHandler::getInstance(); $eh->errorPage(1); } $this->logger->addQuery($sql, 'Database update not allowed during processing of a GET request', 0); return false; }
function do_dbupdate() { if (XC_CLASS_EXISTS('XoopsErrorHandler')) { $xoopsErrorHandler =& XoopsErrorHandler::getInstance(); $xoopsErrorHandler->activate(true); } error_reporting(E_ERROR); //error_reporting(E_ALL); if (!$this->func->refcheck()) { exit('Invalid REFERER.'); } $this->conf['start_time'] = $this->cont['UTC']; header("Content-Type: text/html; charset=" . $this->cont['CONTENT_CHARSET']); // 出力をバッファリングしない $this->func->clear_output_buffer(); ob_implicit_flush(true); echo str_pad('', 256); //for IE echo <<<__EOD__ <html> <head> <meta http-equiv="content-type" content="text/html; charset={$this->cont['CONTENT_CHARSET']}" /> </head> <body> __EOD__; $this->root->post['init'] = !empty($this->root->post['init']) ? "on" : ""; $this->root->post['count'] = !empty($this->root->post['count']) ? "on" : ""; $this->root->post['reading'] = !empty($this->root->post['reading']) ? "on" : ""; $this->root->post['title'] = !empty($this->root->post['title']) ? "on" : ""; $this->root->post['plain'] = !empty($this->root->post['plain']) ? "on" : ""; $this->root->post['plain_all'] = !empty($this->root->post['plain_all']) ? "on" : ""; $this->root->post['attach'] = !empty($this->root->post['attach']) ? "on" : ""; $this->root->post['p_info'] = !empty($this->root->post['p_info']) ? "on" : ""; $this->root->post['plain_bg'] = !empty($this->root->post['plain_bg']) ? "on" : ""; $this->root->post['timelimit'] = !empty($this->root->post['timelimit']) ? intval($this->root->post['timelimit']) : $this->conf['timelimit']; $this->conf['timelimit'] = min($this->root->post['timelimit'], $this->conf['timelimit']); if ($this->root->post['init']) { $this->pginfo_db_init(); } if ($this->root->post['count']) { $this->count_db_init(); } if ($this->root->post['attach']) { $this->attach_db_init(); } if ($this->root->post['plain']) { $this->plain_db_init(); } // 各種キャッシュファイルの削除 // For AutoLink $this->func->autolink_dat_update(); // Update autoalias.dat (AutoAliasName) $aliases = $this->func->get_autoaliases(); if (empty($aliases)) { // Remove @unlink($this->cont['CACHE_DIR'] . $this->cont['PKWK_AUTOALIAS_REGEX_CACHE']); } else { // Create or Update $this->func->autolink_pattern_write($this->cont['CACHE_DIR'] . $this->cont['PKWK_AUTOALIAS_REGEX_CACHE'], $this->func->get_autolink_pattern(array_keys($aliases), $this->root->autoalias, true)); } // Clear cache *.autolink.api $base = $this->cont['CACHE_DIR']; if (function_exists('glob')) { chdir($base); if ($files = glob("*.autolink.api")) { foreach ($files as $file) { unlink($base . $file); } } chdir($this->cont['DATA_HOME']); } else { if ($dir = @opendir($base)) { while ($file = readdir($dir)) { if (substr($file, -13) === '.autolink.api') { unlink($base . $file); } } } } // Remove facemarks.js @unlink($this->cont['CACHE_DIR'] . md5(rtrim($this->cont['HOME_URL'], '/')) . '_facemarks.js'); echo $this->msg['msg_done']; echo "<script>parent.xpwiki_dbsync_done();parent.xpwiki_dbsync_blink('stop');</script>"; echo "</body></html>"; exit; }