true))); C::t('setting')->update('sitelicensedata',$licdata); updatecache( 'setting' ); exit(json_encode(array('success' => true))); }else{ exit(json_encode(array('error'=>true))); } } } elseif($do == 'updateauth'){ include_once libfile( 'function/cache' ); $username = isset($_GET['username']) ? trim($_GET['username']):''; $password = isset($_GET['password']) ? trim($_GET['password']):''; $mcode = getglobal('setting/machinecode'); $datastr = $username."\t".$password."\t".$mcode; $data = dzzencode($datastr,$mcode,0,4); $authurl = APP_CHECK_URL.'authlicense/getauth/'.$mcode.'/'.$data.'/'. TIMESTAMP; $response = json_decode(dfsockopen($authurl,0, '', '', FALSE, '',3),true); if(isset($response['authcode'])){ C::t('setting')->update('sitelicensedata',$response['authcode']); updatecache( 'setting' ); } if(isset($response['error']))exit(json_encode(array('error'=>$response['error']))); else exit(json_encode(array('success'=>true))); }else{ $version = defined('LICENSE_VERSION') ? lang(LICENSE_VERSION):lang('Home'); $limitusernum = defined('LICENSE_LIMIT') ? LICENSE_LIMIT:1; if(defined('NOLIMITUSER')) $limitusernum = '无限'; $authdate = defined('LICENSE_CTIME') ? dgmdate(LICENSE_CTIME,'Y-m-d H:i:s'):''; include template('index'); }