include_once 'session_check.php'; include_once '../scripts/myErrorHandler.php'; include_once '../scripts/Database.php'; include_once '../scripts/utils.php'; $addResultText = ""; $code = getParameter('code'); if ($code != null) { $code = strtoupper($_GET['code']); $db = new Database(); if ($db->updateUserAccount($uid, $code) == true) { $addResultText = "Dziękujemy za zakup<br/>"; include 'session_check.php'; } else { $addResultText = "Podany kod jest niewłaściwy<br/>"; } $db->destroy(); } $user_login = "******"; // -1 aby nie proponować gościowi piosenki za darochę $user_coins = -1; if ($uid != null) { $user_login = $rowUser['login']; $user_coins = $rowUser['coins']; } trigger_error("user_coins: " . $user_coins, E_USER_NOTICE); trigger_error("{$rowUser['coins']}: " . $rowUser['coins'], E_USER_NOTICE); $wap_title = "mobiKAR"; include "add_head.php"; ?> <h1>Witaj <?php echo $user_login;
/** * API请求处理开始 * * @access public * @param 无 * @return void */ public function execute() { Logger::debug('********************START***********************'); Logger::debug('Headers: ', $this->getAllRequestHeaderValues()); try { // 初始化请求处理 $this->initial(); $path_info = $this->getPathInfo(); // API白名单检查 if (!in_array($path_info, array_keys(ApiConfig::getApiList()))) { throw new NotFoundException('The "PATH_INFO" is not defined.'); } // 执行过滤器 $config = FiltersConfig::$API_FILTER_CONFIG; if (isset($config[$path_info])) { $list = $config[$path_info]; Logger::debug(' ' . count($list) . ' filters are defined.'); foreach ($list as $filter_name) { // 过滤器初始化 $filter = new $filter_name($this); Logger::debug('Executing filter "' . $filter_name . '".'); // 执行过滤器 $filter->execute($this); } } Logger::debug('Executing action "' . $this->getActionName() . '#' . $this->getMethodName() . '".'); // 连接后关闭 Database::destroy(); // 过滤结束,执行对应的方法 $view = $this->startRequest(); if (!$view instanceof BaseView) { throw new Exception('"' . $this->getActionName() . '#' . $this->getMethodName() . '" returned invalid value.'); } Logger::debug('********************FINISH***********************'); // 输出结果 $view->display(); } catch (NotFoundException $ne) { // 404回应 header("HTTP/1.1 404 Not Found"); } catch (ForbiddenException $fe) { // 403回应 header("HTTP/1.1 403 Forbidden"); } catch (ModelException $me) { //在Model层异常(DB相关的处理) Logger::error($me->getMessage() . "\n" . $me->getTraceAsString()); // E-mail通知 HandlerManager::exceptionReport($me); // 服务器错误 header('HTTP/1.1 500 Internal Server Error'); } catch (PDOException $pe) { Logger::error($pe->getMessage() . "\n" . $pe->getTraceAsString()); // E-mail通知 HandlerManager::exceptionReport($pe); // 服务器错误 header('HTTP/1.1 500 Internal Server Error'); } catch (Exception $e) { Logger::error($e->getMessage() . "\n" . $e->getTraceAsString()); // E-mail通知 HandlerManager::exceptionReport($e); // 服务器错误 header('HTTP/1.1 500 Internal Server Error'); } }