/** * action implement */ public function actionImplement($in) { parent::actionImplement($in); if (!WBB_TAPATALK_REG_TYPE) { $this->data['sign_in'] = 0; $this->data['sso_signin'] = 0; $this->data['sso_register'] = 0; $this->data['inappreg'] = 0; $this->data['native_register'] = 0; } $isTTServerCall = false; if (isset($_SERVER['HTTP_X_TT'])) { $code = trim($_SERVER['HTTP_X_TT']); if (file_exists(WBB_TAPATALK_DIR . '/mbqFrame/3rdLib/classTTConnection.php')) { require_once WBB_TAPATALK_DIR . '/mbqFrame/3rdLib/classTTConnection.php'; } if (class_exists('classTTConnection')) { $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'get_config'); if ($response) { $isTTServerCall = true; } } } if ($isTTServerCall) { if (!defined('WBB_TAPATALK_BANNER_CONTROL')) { $this->data['banner_control'] = new xmlrpcval(-1, 'string'); } else { $this->data['banner_control'] = new xmlrpcval(WBB_TAPATALK_BANNER_CONTROL, 'string'); } } }
function get_config_func() { global $mobiquo_config, $user_info, $modSettings, $maintenance, $mmessage; exttMbqMakeFlags(); $config_list = array('is_open' => new xmlrpcval($maintenance == 0 ? true : false, 'boolean'), 'guest_okay' => new xmlrpcval($modSettings['allow_guestAccess'] ? true : false, 'boolean'), 'push' => new xmlrpcval('1', 'string'), 'result_text' => new xmlrpcval($maintenance == 1 ? $mmessage : '', 'base64'), 'sign_in' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqSignIn'], 'string'), 'inappreg' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqInappreg'], 'string'), 'sso_login' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqSsoLogin'], 'string'), 'sso_signin' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqSsoSignin'], 'string'), 'sso_register' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqSsoRegister'], 'string'), 'native_register' => new xmlrpcval(ExttMbqBase::$otherParameters['exttMbqNativeRegister'], 'string')); if (allowedTo('search_posts')) { $config_list['guest_search'] = new xmlrpcval('1', 'string'); } if (allowedTo('who_view')) { $config_list['guest_whosonline'] = new xmlrpcval('1', 'string'); } $isTTServerCall = false; if (isset($_SERVER['HTTP_X_TT'])) { $code = trim($_SERVER['HTTP_X_TT']); $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'get_config'); if ($response) { $isTTServerCall = true; } } foreach ($mobiquo_config as $key => $value) { if (!$isTTServerCall && $key == 'version') { $config_list[$key] = new xmlrpcval(substr($mobiquo_config['version'], 0, strpos($mobiquo_config['version'], '_')), 'string'); } else { if (!in_array($key, array('is_open', 'guest_okay', 'mod_function', 'conflict_mod', 'push'))) { $config_list[$key] = new xmlrpcval($value, 'string'); } } } if ($user_info['is_guest'] && allowedTo('search_posts')) { $config_list['guest_search'] = new xmlrpcval('1', 'string'); } if ($user_info['is_guest'] && allowedTo('who_view')) { $config_list['guest_whosonline'] = new xmlrpcval('1', 'string'); } if (isset($modSettings['tp_push_key']) && !empty($modSettings['tp_push_key'])) { $config_list['api_key'] = new xmlrpcval(md5($modSettings['tp_push_key']), 'string'); } if (isset($modSettings['tp_ads_disabled']) && !empty($modSettings['tp_ads_disabled'])) { $ads_disabled_group = implode(',', array_map('intval', explode(',', $modSettings['tp_ads_disabled']))); $config_list['ads_disabled_group'] = new xmlrpcval($ads_disabled_group, 'string'); $config_list['guest_group_id'] = new xmlrpcval(-1, 'string'); } if ($isTTServerCall) { $config_list['sys_version'] = new xmlrpcval($modSettings['smfVersion'], 'string'); $config_list['php_version'] = new xmlrpcval(phpversion(), 'string'); action_get_board_stat(); $stats = array('user' => new xmlrpcval($modSettings['totalMembers'], 'int'), 'topic' => new xmlrpcval($modSettings['totalTopics'], 'int'), 'post' => new xmlrpcval($modSettings['totalMessages'], 'int')); $config_list['stats'] = new xmlrpcval($stats, 'struct'); if (!isset($modSettings['tt_banner_control'])) { $config_list['banner_control'] = new xmlrpcval(1, 'string'); } else { $config_list['banner_control'] = new xmlrpcval(intval($modSettings['tt_banner_control']), 'string'); } } $response = new xmlrpcval($config_list, 'struct'); return new xmlrpcresp($response); }
/** * action implement */ protected function actionImplement($in) { $cfg = MbqMain::$oMbqConfig->getAllCfg(); $isTTServerCall = false; if (isset($_COOKIE['X-TT'])) { $code = trim($_COOKIE['X-TT']); } else { if (isset($_SERVER['HTTP_X_TT'])) { $code = trim($_SERVER['HTTP_X_TT']); } } if (isset($code)) { if (!class_exists('classTTConnection')) { require_once MBQ_3RD_LIB_PATH . 'classTTConnection.php'; } $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'get_config'); if ($response) { $isTTServerCall = true; } } if ($isTTServerCall) { $this->data['mbqframe_version'] = '1.0'; } foreach ($cfg as $moduleName => $module) { foreach ($module as $k => $v) { if ($k !== 'module_name' && $k != 'module_version' && $k != 'module_enable') { if (isset($this->data[$k])) { MbqError::alert('', "Find repeat config {$k}!"); } else { if (!$v->isAdvCfgValueType()) { if ($v->hasSetOriValue()) { if ($k == 'is_open' || $k == 'guest_okay' || $k == 'min_search_length') { $this->data[$k] = $v->oriValue; } else { if (!$isTTServerCall) { if ($k == 'version') { $v->setOriValue(substr($v->oriValue, 0, strpos($v->oriValue, '_'))); } if ($k == 'sys_version' || $k == 'stats') { continue; } } $this->data[$k] = (string) $v->oriValue; } } else { MbqError::alert('', "Need set config {$k}!"); } } } } } } }
function getInput() { $in = new stdClass(); if (MbqMain::isRawPostProtocol()) { $in->code = MbqMain::$input['code']; } include_once MBQ_3RD_LIB_PATH . 'classTTConnection.php'; $connection = new classTTConnection(); $response = $connection->actionVerification($in->code, 'reset_push_slug'); if (!$response) { MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_PARAMS_ERROR); } return $in; }
/** * action implement */ protected function actionImplement($in) { if (!MbqMain::$oMbqConfig->moduleIsEnable('user')) { MbqError::alert('', "Not support module user!", '', MBQ_ERR_NOT_SUPPORT); } $code = ''; if (isset($_COOKIE['X-TT'])) { $code = trim($_COOKIE['X-TT']); } else { if (isset($_SERVER['HTTP_X_TT'])) { $code = trim($_SERVER['HTTP_X_TT']); } } include_once MBQ_3RD_LIB_PATH . 'classTTConnection.php'; $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'login'); if ($connection->success && $response !== true) { if ($response === false && empty($connection->errors)) { $this->data['result_text'] = "Unauthorized app detected."; } else { $this->data['result_text'] = "The site failed to connect to Tapatalk servers and some functions will not work properly. Please contact the forum admin to resolve this issue."; } } $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); $result = $oMbqRdEtUser->login($in->login, $in->password, $in->anonymous, $in->trustCode); if ($result === true) { $this->data['result'] = true; $data1 = $oMbqRdEtUser->returnApiDataUser(MbqMain::$oCurMbqEtUser); MbqMain::$oMbqCm->mergeApiData($this->data, $data1); $oTapatalkPush = new TapatalkPush(); $oTapatalkPush->callMethod('doAfterAppLogin', MbqMain::$oCurMbqEtUser->userId->oriValue); } else { $this->data['result'] = false; if ($result == 'two-step-required') { $this->data['two_step_required'] = true; } else { $this->data['result_text'] = $result; } if (!$oMbqRdEtUser->initOMbqEtUser($in->login, array('case' => 'byLoginName'))) { $this->data['status'] = (string) 2; //!!! attention the (string) } } }
function action_push_content_check() { global $smcFunc, $modSettings; $code = trim($_POST['code']); $format = trim($_POST['format']); $push_date = unserialize($_POST['data']); $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'push_content_check'); if ($response !== TRUE) { $data = array('result' => false, 'result_text' => $response); @ob_end_clean(); echo $format == 'json' ? json_encode($data) : serialize($data); exit; } if (!isset($modSettings['tp_push_key']) || !isset($push_date['key']) || $modSettings['tp_push_key'] != $push_date['key']) { $data = array('result' => false, 'result_text' => 'incorrect api key'); @ob_end_clean(); echo $format == 'json' ? json_encode($data) : serialize($data); exit; } if (!isset($push_date['dateline']) || time() - intval($push_date['dateline']) > 86400) { $data = array('result' => false, 'result_text' => 'time out'); @ob_end_clean(); echo $format == 'json' ? json_encode($data) : serialize($data); exit; } switch ($push_date['type']) { case 'newtopic': case 'sub': case 'quote': case 'tag': $request = $smcFunc['db_query']('', ' SELECT msg.id_msg FROM {db_prefix}messages as msg WHERE msg.id_msg = {int:subid} AND msg.id_topic = {int:id} AND id_board = {int:subfid} AND id_member = {int:authorid} LIMIT 1', array('id' => isset($push_date['id']) ? intval($push_date['id']) : 0, 'subid' => isset($push_date['subid']) ? intval($push_date['subid']) : 0, 'subfid' => isset($push_date['subfid']) ? intval($push_date['subfid']) : 0, 'authorid' => isset($push_date['authorid']) ? intval($push_date['authorid']) : 0)); break; case 'pm': $request = $smcFunc['db_query']('', ' SELECT pm.id_pm FROM {db_prefix}personal_messages as pm WHERE pm.id_pm = {int:id} AND pm.id_member_from ={int:authorid} AND pm.msgtime = {int:dateline} LIMIT 1', array('id' => isset($push_date['id']) ? intval($push_date['id']) : 0, 'authorid' => isset($push_date['authorid']) ? intval($push_date['authorid']) : 0, 'dateline' => isset($push_date['dateline']) ? intval($push_date['dateline']) : 0)); break; } if (isset($request) && !empty($request) && $smcFunc['db_fetch_assoc']($request)) { $data = array('result' => true, 'result_text' => ''); } else { $data = array('result' => false, 'result_text' => 'fail'); } @ob_end_clean(); echo $format == 'json' ? json_encode($data) : serialize($data); exit; }
*/ define('MBQ_IN_IT', true); /* is in mobiquo flag */ define('MBQ_REG_SHUTDOWN', true); /* register shutdown function flag */ require_once 'MbqConfig.php'; require_once '../global.php'; $mbqDebug = false; if (isset($_SERVER['HTTP_X_PHPDEBUG'])) { if (isset($_SERVER['HTTP_X_PHPDEBUGCODE'])) { $code = trim($_SERVER['HTTP_X_PHPDEBUGCODE']); if (!class_exists('classTTConnection')) { require_once MBQ_3RD_LIB_PATH . 'classTTConnection.php'; } $connection = new classTTConnection(); $response = $connection->actionVerification($code, 'PHPDEBUG'); if ($response) { $mbqDebug = $_SERVER['HTTP_X_PHPDEBUG']; } } } if ($mbqDebug == false && file_exists(MBQ_PATH . 'debug.on')) { $mbqDebug = E_ALL; } define('MBQ_DEBUG', $mbqDebug); /* is in debug mode flag */ if (MBQ_DEBUG) { ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting($mbqDebug); } else {