fetch('connect', true); if (!array_key_exists('reply', $connect['t'])) { $connect['t']['reply'] = 1; } if (!array_key_exists('reply_showauthor', $connect['t'])) { $connect['t']['reply_showauthor'] = 1; } $needCreateGroup = false; if ($connect['guest_groupid']) { $group = C::t('common_usergroup')->fetch($connect['guest_groupid']); if (!$group) { $needCreateGroup = true; } } else { $needCreateGroup = true; } $newConnect = array(); include DISCUZ_ROOT . 'source/language/lang_admincp_cloud.php'; $name = $extend_lang['connect_guest_group_name']; if ($needCreateGroup) { $userGroupData = array( 'type' => 'special', 'grouptitle' => $name, 'allowvisit' => 1, 'color' => '', 'stars' => '', ); $newGroupId = C::t('common_usergroup')->insert($userGroupData, true); $dataField = array( 'groupid' => $newGroupId, 'allowsearch' => 2, 'readaccess' => 1, 'allowgetattach' => 1, 'allowgetimage' => 1, ); C::t('common_usergroup_field')->insert($dataField); $newConnect['guest_groupid'] = $newGroupId; } $https = json_decode(dfsockopen('https://graph.qq.com/user/get_user_info')); $newConnect['oauth2'] = $https->ret == -1 ? 1 : 0; $updateData = array_merge($connect, $newConnect); C::t('common_setting')->update('connect', serialize($updateData)); updatecache('setting'); $finish = true;