'.cplang('message_redirect').'');
}
try {
$cloudClient = & Cloud::loadClass('Service_Client_Cloud', array(true));
if ($_G['setting']['my_app_status']) {
$manyouClient = Cloud::loadClass('Service_Client_Manyou');
$manyouClient->sync();
}
$res = $cloudClient->sync();
} catch (Cloud_Service_Client_RestfulException $e) {
cpmsg('cloud_sync_failure', '', 'error', array('errorCode' => $e->getCode(), 'errorMessage' => $e->getMessage()));
}
cpmsg('cloud_sync_success', '', 'succeed', array(), ''.cplang('message_redirect').'
');
} elseif(submitcheck('resetsubmit')) {
if (!isfounder()) {
cpmsg('action_noaccess', '', 'error');
}
if($cloudstatus != 'cloud') {
cpmsg('cloud_open_first', '', 'succeed', array(), ''.cplang('message_redirect').'
');
}
try {
$cloudClient = Cloud::loadClass('Service_Client_Cloud');
$res = $cloudClient->resetKey();
} catch (Cloud_Service_Client_RestfulException $e) {
cpmsg($e->getMessage(), '', 'error');
}
$sId = intval($res['sId']);
$sKey = trim($res['sKey']);
C::t('common_setting')->update_batch(array('my_siteid' => $sId, 'my_sitekey' => $sKey));
updatecache('setting');
cpmsg('cloud_reset_success', '', 'succeed', array(), ''.cplang('message_redirect').'
');
} elseif(submitcheck('ipsubmit')) {
$_POST['cloud_api_ip'] = trim($_POST['cloud_api_ip']);
$_POST['my_ip'] = trim($_POST['my_ip']);
$_POST['connect_api_ip'] = trim($_POST['connect_api_ip']);
if($_G['setting']['cloud_api_ip'] != $_POST['cloud_api_ip'] || $_G['setting']['my_ip'] != $_POST['my_ip'] || $_G['setting']['connect_api_ip'] != $_POST['connect_api_ip']) {
C::t('common_setting')->update_batch(array('cloud_api_ip' => $_POST['cloud_api_ip'], 'my_ip' => $_POST['my_ip'], 'connect_api_ip' => $_POST['connect_api_ip']));
updatecache('setting');
}
$locationUrl = ADMINSCRIPT.'?frames=yes&action=cloud&operation=doctor';
cpmsg('cloud_ipsetting_success', '', 'succeed', array(), ''.cplang('message_redirect').'
');
} elseif ($_GET['anchor'] == 'cloud_ip') {
ajaxshowheader();
echo '
';
echo '';
showformheader('cloud');
showhiddenfields(array('operation' => $operation));
if($_GET['callback']) {
showhiddenfields(array('callback' => $_GET['callback']));
}
showtableheader();
showsetting('cloud_api_ip', 'cloud_api_ip', $_G['setting']['cloud_api_ip'], 'text');
showsetting('cloud_manyou_ip', 'my_ip', $_G['setting']['my_ip'], 'text');
showsetting('cloud_connect_api_ip', 'connect_api_ip', $_G['setting']['connect_api_ip'], 'text');
showsubmit('ipsubmit');
showtablefooter();
showformfooter();
echo '
';
ajaxshowfooter();
} else {
shownav('navcloud', 'menu_cloud_siteinfo');
showsubmenu('menu_cloud_siteinfo');
showtips('cloud_siteinfo_tips');
echo '';
showformheader('cloud');
showhiddenfields(array('operation' => $operation));
showtableheader();
showtitle('menu_cloud_siteinfo');
showtablerow('', array('class="td24"'), array(
''.cplang('cloud_site_name').'',
$_G['setting']['bbname']
));
showtablerow('', array('class="td24"'), array(
''.cplang('cloud_site_url').'',
$_G['siteurl']
));
showtablerow('', array('class="td24"'), array(
''.cplang('cloud_site_id').'',
$_G['setting']['my_siteid']
));
$resetSubmitButton = isfounder() ? ' ' : '';
showsubmit('syncsubmit', 'cloud_sync', '',$resetSubmitButton.'');
showtablefooter();
showformfooter();
}