Repository: WMJonssen/Centcount-Analytics
Branch: master
Commit: c339b33f2eb8
Files: 133
Total size: 2.2 MB
Directory structure:
gitextract_wovxv__r/
├── README.md
├── api/
│ ├── api_ca.php
│ └── api_manage.php
├── ca.php
├── ca_version.php
├── cache_settings.php
├── command.php
├── common.php
├── config/
│ ├── config_common.php
│ ├── config_mail.php
│ ├── config_redis.php
│ └── config_security.php
├── core.php
├── css/
│ ├── common.css
│ ├── ichart.css
│ ├── icontrol.css
│ └── manager.css
├── errlog.php
├── forgot.php
├── host/
│ └── hosts_host_status.php
├── html.php
├── install.php
├── ipdb/
│ └── README.md
├── ipdb.class.php
├── js/
│ ├── common.js
│ ├── ichart.js
│ ├── icontrol.js
│ ├── iline.js
│ ├── ilog.js
│ ├── imap.js
│ ├── iprocess.js
│ └── itable.js
├── kernel.func.php
├── kernel.php
├── kernel.sql.php
├── language/
│ ├── lan-de-DE.php
│ ├── lan-en-US.php
│ ├── lan-ja-JP.php
│ ├── lan-zh-CN.php
│ └── lan-zh-TW.php
├── language.php
├── license.txt
├── login.php
├── logout.php
├── manager.php
├── maps/
│ ├── china.js
│ └── world.js
├── passport.php
├── persistence.php
├── relogin.php
├── report/
│ ├── actions_all_page.php
│ ├── actions_bounce_page.php
│ ├── actions_entry_page.php
│ ├── actions_exit_page.php
│ ├── actions_robot_crawled_page.php
│ ├── dashboard.php
│ ├── referrers_all_referrer.php
│ ├── referrers_channel.php
│ ├── referrers_se_keyword.php
│ ├── referrers_website.php
│ ├── visitors_active.php
│ ├── visitors_active_visitor.php
│ ├── visitors_day_trend.php
│ ├── visitors_device.php
│ ├── visitors_location.php
│ ├── visitors_log.php
│ ├── visitors_map.php
│ ├── visitors_overview.php
│ ├── visitors_realtime.php
│ ├── visitors_robot_log.php
│ ├── visitors_software.php
│ └── visitors_times.php
├── reset_pw.php
├── robots.txt
├── setting/
│ ├── settings.php
│ └── settings_about_ca.php
├── site/
│ ├── sites_add_site.php
│ ├── sites_all_sites.php
│ ├── sites_blocked_ids.php
│ ├── sites_blocked_ips.php
│ ├── sites_blocked_pages.php
│ ├── sites_blocked_sites.php
│ ├── sites_delete_site.php
│ ├── sites_domains.php
│ ├── sites_filtered_domains.php
│ ├── sites_get_js_code.php
│ ├── sites_modify_site_config.php
│ └── sites_visitor_password.php
├── validcode.php
├── vendor/
│ ├── autoload.php
│ ├── composer/
│ │ ├── ClassLoader.php
│ │ ├── autoload_classmap.php
│ │ ├── autoload_namespaces.php
│ │ ├── autoload_psr4.php
│ │ ├── autoload_real.php
│ │ └── autoload_static.php
│ ├── geoip2/
│ │ └── geoip2/
│ │ └── src/
│ │ ├── Compat/
│ │ │ └── JsonSerializable.php
│ │ ├── Database/
│ │ │ └── Reader.php
│ │ ├── Exception/
│ │ │ ├── AddressNotFoundException.php
│ │ │ ├── AuthenticationException.php
│ │ │ ├── GeoIp2Exception.php
│ │ │ ├── HttpException.php
│ │ │ ├── InvalidRequestException.php
│ │ │ └── OutOfQueriesException.php
│ │ ├── Model/
│ │ │ ├── AbstractModel.php
│ │ │ ├── AnonymousIp.php
│ │ │ ├── City.php
│ │ │ ├── ConnectionType.php
│ │ │ ├── Country.php
│ │ │ ├── Domain.php
│ │ │ ├── Enterprise.php
│ │ │ ├── Insights.php
│ │ │ └── Isp.php
│ │ ├── ProviderInterface.php
│ │ ├── Record/
│ │ │ ├── AbstractPlaceRecord.php
│ │ │ ├── AbstractRecord.php
│ │ │ ├── City.php
│ │ │ ├── Continent.php
│ │ │ ├── Country.php
│ │ │ ├── Location.php
│ │ │ ├── MaxMind.php
│ │ │ ├── Postal.php
│ │ │ ├── RepresentedCountry.php
│ │ │ ├── Subdivision.php
│ │ │ └── Traits.php
│ │ └── WebService/
│ │ └── Client.php
│ └── maxmind-db/
│ └── reader/
│ └── src/
│ └── MaxMind/
│ └── Db/
│ ├── Reader/
│ │ ├── Decoder.php
│ │ ├── InvalidDatabaseException.php
│ │ ├── Metadata.php
│ │ └── Util.php
│ └── Reader.php
├── verify.php
└── visitor.php
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
# Centcount Analytics 1.0
## An open-source web analytics software
## Centcount Analytics 2.0 Pro is available now! Read More
y.indexOf('presto')? (a.bc=15<=Math.floor(a.bv)?'Blink':'WebKit',a.bcv=x(y,'webkit',['/',' ',';',')','('],[],1,1,0)):(a.bc='Presto',a.bcv=x(y,'presto',['/',' ',';',')','('],[],1,1,0))}else{if(y){for(w=u=E.length-1;0<=w;w--)if('undefined'!==typeof n[E[w][0]]){a.bn=n[E[w][0]];a.bv=x(y,E[w][0],['/',' ',';',')','('],[],1,1,0);break}else if('undefined'!==typeof n[E[w][1]]){a.bn=n[E[w][1]];a.bv=x(y,E[w][1],['/',' ',';',')','('],[],1,1,0);break}if(''===a.bn)for(w=u;0<=w;w--)if('undefined'!==typeof I[E[w][0]]){a.bn=I[E[w][0]]; a.bv=x(y,E[w][0],['/',' ',';',')','('],[],1,1,0);break}''===a.bn&&-1r)&&(p=r);h+=m;return-1 =F.requestStart?F.responseEnd-F.requestStart:b-va;case 2:return F.domContentLoadedEventEnd>=F.navigationStart?F.domContentLoadedEventEnd-F.navigationStart:b-R;case 3:return F.loadEventEnd>=F.navigationStart?F.loadEventEnd-F.navigationStart:b-R}}catch(n){return t(n, 'gTI failed'),1y.indexOf('.')&&(y+='.');if(-1
a.lvt||a.lvt>C)a.lvt=C}catch(b){t(b,'gVT failed')}}function Lb(){try{a.rd='';Aa=!1;var b=eb(q.location.href),c=eb(m.referrer);a.pd=b;if(a.se||(b.length>c.length? 0>b.indexOf(c):0>c.indexOf(b)))a.rd=c;a.se&&P('CA_RF5','')!==fb&&(Aa=!0,A('CA_RF5',fb,365,1))}catch(n){t(n,'cNS failed')}}function kb(){try{a.nv=0,a.vs=0,a.pv=0,V=!1,ua!==P('CA_VSD','')?(za=V=!0,a.vs=1,a.pv=1):P('CA_LAT',0)+fa p;p++)wa[p]&&(c=p);for(p=0;p<=c;p++)n[p]=wa[p];aa.push(n);v=[b,a.mx,a.my,a.dst,a.mbi,a.dsl,a.dsh, a.dsw,a.bcw,a.bch,a.bcl,a.bct]}}catch(z){t(z,'gRS failed')}0===na%150?(J(7),aa=[],v=[0,0,0,0,0,0,0,0,0,0,0,0],4===U?U=1:U++):50===na&&(J(7),ea=0)}}catch(z){t(z,'RVA failed')}}function Ob(){try{(new Date).getTime()-xa>fa&&(J(4),Z=1)}catch(b){t(b,'CT failed')}}function Ta(){try{1===Z&&(Z=3,Ra(sa+'/ca.php?wakeup=1&tz='+ob+'&r='+Math.random()))}catch(b){t(b,'eW failed')}}function Pb(){try{if(!D){try{q.addEventListener?(q.addEventListener('click',Ha),q.addEventListener('mousedown',Ea),q.addEventListener('mouseup', Fa),q.addEventListener('mousemove',Da),q.addEventListener('mousewheel',Ga),q.addEventListener('touchstart',mb),q.addEventListener('touchmove',nb),q.addEventListener('scroll',Ia),m.addEventListener('submit',Ja),m.addEventListener('keydown',wb)):q.attachEvent&&(m.attachEvent('onclick',Ha),m.attachEvent('onmousedown',Ea),m.attachEvent('onmouseup',Fa),m.attachEvent('onmousemove',Da),m.attachEvent('onmousewheel',Ga),m.attachEvent('onscroll',Ia),m.attachEvent('onsubmit',Ja),m.attachEvent('onkeydown',wb))}catch(b){t(b, 'AE failed')}qb=Ba(2);a.cs=(m.charset||m.characterSet)+'';a.dt=L(m.title+'');db();J(2);Za=setInterval(Nb,100);setInterval(Ob,1E3)}}catch(b){t(b,'eR failed')}}function Ka(){try{if(!D){u=m.body;G=m.documentElement;rb=Ba(3);a.cs=(m.charset||m.characterSet)+'';a.dt=L(m.title+'');sb=1;db();J(3);Qb();try{var b=document.getElementsByTagName('video');if(!(1>b.length||'function'!==typeof b[0].addEventListener))for(var c=0;c(new Date).getTime())){var n=N!==a.mx||M!==a.my?0:1;N=a.mx;M=a.my;K=Ua(c,n,'INPUT'!==c.tagName&&'BUTTON'!==c.tagName||'submit'!==c.type?0:3);''!==K&&J(8)}}}catch(p){t(p,'eC failed')}}function Ea(b){try{if(!D){Ta();1>a.pa&&(a.pa=1);b=b||window.event;if(b.pageX||b.pageY)ma=b.pageX,la=b.pageY,T=b.button+1;else switch(ma=b.clientX+u.scrollLeft- u.clientLeft,la=b.clientY+u.scrollTop-u.clientTop,b.button){case 1:T=1;break;case 4:T=2;break;case 2:T=3;break;default:T=b.button+1}xa=(new Date).getTime()}}catch(c){t(c,'eD failed')}}function Fa(a){try{D||(a=a||window.event,a.pageX||a.pageY?(ka=a.pageX,ja=a.pageY):(ka=a.clientX+u.scrollLeft-u.clientLeft,ja=a.clientY+u.scrollTop-u.clientTop),ia=1)}catch(c){t(c,'eP failed')}}function Da(b){try{D||(Ta(),2>a.pa&&(CPA++,2 a.pa&&(a.pa=2)}catch(c){t(c,'eMW failed')}}function mb(b){try{3>a.pa&&(a.pa=3)}catch(c){t(c,'eTS failed')}}function nb(b){try{a.pa=4}catch(c){t(c,'eTM failed')}}function Ia(){try{D||Ta()}catch(b){t(b,'eS failed')}}function wb(b){try{if(!D){Ta();b=b||window.event;var c=b.srcElement||b.target;13!==(b.which?b.which:b.keyCode)||'INPUT'!== c.tagName&&'BUTTON'!==c.tagName||(N=a.mx,M=a.my,da=Ua(c,0,4),gb=(new Date).getTime())}}catch(n){t(n,'eS failed')}}function Sb(a){function b(){try{u=m.body,G=m.documentElement,G.scrollLeft,u.scrollLeft,G.scrollTop,u.scrollTop,G.scrollWidth,u.scrollWidth,G.scrollHeight,u.scrollHeight,a&&a()}catch(n){setTimeout(b,1)}}setTimeout(b,1)}function Ra(a){try{if(!a)return!1;var b=m.getElementsByTagName('head')[0],n=m.createElement('script');n.setAttribute('src',a);n.setAttribute('type','text/javascript');b.appendChild(n); return!0}catch(p){t(p,'dL failed')}}function Ua(a,c,n){try{if('undefined'===typeof a||1===Tb[a.tagName])return'';var b='',m='',r='',t='',v='',h='',k='',g='',f='',e='',d='',x='',D='',F='',w=0,I=0,E=0,X=0,H=0,xb=0,yb=0,B={},C,A;for(A=a;A;)0===xb&&(X=A.offsetWidth||0,H=A.offsetHeight||0,xb=1),0===yb&&'fixed'===(q.getComputedStyle?q.getComputedStyle(A,null).position:A.currentStyle.position)&&(I+=u.scrollLeft||G.scrollLeft||0,E+=u.scrollTop||G.scrollTop||0,yb=1),I+=A.offsetLeft||0,E+=A.offsetTop||0,A= A.offsetParent;f=3===n?'Submit By Click':4===n?'Submit By Enter':'';e=hb(a.innerText,256);x=a.id;do{if('undefined'===typeof a.tagName)break;''===v&&(v=hb(a.href,1024));''===t&&(t=hb(a.onclick,1024));''===g&&(g=Ub(a.outerHTML));''===k&&(k=a.id?a.id:'');m=a.tagName;d=a.className?a.className:'';w=0;for(C=a.previousSibling;C;)F=C.tagName+'',F===m&&w++,C=C.previousSibling;''===k&&(b=m+'('+d+')->'+b);''===h&&k&&(h=k+':'+b);D=m+'['+w+']('+d+')->'+D;r=m+'['+w+']->'+r;a=a.parentNode}while('HTML'!==a.tagName); h+='HTML('+g+')'+(v||t?'{'+(v||t)+'}':'');B.id=ha(x,2);B.html=ha(h,2);B.tag=ha(D,2);B.node=ha(r,2);B.href=v||t||f;B.act=n?n:v?1:t?2:0;B.txt=B.act?e:'';B.rpc=c;B.x=N>I&&NE&&M c&&(a=a.substring(0,c-3)+'...');return L(a)}catch(n){return''}}function Ja(){try{D||(''!==da&&gb+500>(new Date).getTime()?(K=da,J(8)):3!==K.act&&(ya--,K.act=3,K.href='Submit By Click', K.fix=1,J(8)),da='')}catch(b){t(b,'submitEvent failed')}}function Rb(a){try{this.obj=a,this.maxtime=this.duration=0,a.addEventListener('play',zb),a.addEventListener('pause',zb)}catch(c){t(c,'videoEvent failed')}}function zb(b){try{if(!D&&(N!==a.mx||M!==a.my)){b=b||window.event;N=a.mx;M=a.my;var c=b.srcElement||b.target;'undefined'!==typeof c&&(K=Ua(c,0,5),''!==K&&J(8))}}catch(n){t(n,'getVideoClick failed')}}function Qb(){try{for(var b=m.getElementsByTagName('iframe'),c=0;c =c;c++){var d=a>>>8*c&255;d='0'+d.toString(16);b+=d.substr(d.length-2,2)}return b},p=function(a,b,c,d,g,e,f){a=u(a,u(u(c^(b|~d),g),f));return u(a< >>32-e,b)},m=function(a,b,c,d,g,e,f){a=u(a,u(u(b^c^d,g),f));return u(a< >>32-e,b)},r=function(a,b,c,d,e,g,f){a=u(a,u(u(b&d|c&~d,e),f));return u(a< >>32-g,b)},q=function(a,b,c,d,g,e,f){a= u(a,u(u(b&c|~b&d,g),f));return u(a< >>32-e,b)},u=function(a,b){var c=a&2147483648;var d=b&2147483648;var e=a&1073741824;var g=b&1073741824;var f=(a&1073741823)+(b&1073741823);return e&g?f^2147483648^c^d:e|g?f&1073741824?f^3221225472^c^d:f^1073741824^c^d:f^c^d};if(''===a)return'';var h=[],k;a=function(a){a=a.replace(/\\r\\n/g,'\\n');for(var b='',c=0;c d?b+=String.fromCharCode(d):(127 d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12| 224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b}(a);h=function(a){var b=a.length;var c=b+8;for(var d=16*((c-c%64)/64+1),e=Array(d-1),g,f=0;f>>29;return e}(a);var g=1732584193;var f=4023233417;var e=2562383102;var d=271733878;for(k=0;k Bb||S+9E7 CONNECT(REDIS_IP_0, REDIS_PORT_0) !== true) exit('//*/'); $REDIS_0->SELECT(REDIS_DB_0);//select redis No 0 database for record process infomation & query list //************ connect redis end ************* $REDIS_0->MULTI() ->INCRBY('PerformanceConsumeJS', (int)(microtime(true) * 1E6) - $rn)//set performance consume ->INCR('PerformanceCountJS')//set performance count ->EXEC(); //******************* RECORD PERFORMANCE END ****************** } exit('//*/'); function verify_cahm($sid, $ip, $visa) { $v = substr($visa, 0, 32); $t = substr($visa, 32, 10); $n = time(); if ($t < $n) return 0; if (empty($ip)) return 0; $matchvisa = md5($sid . $t . ENCODE_FACTOR); if ($v === $matchvisa) return 1; return 0; } function get_ip() { foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $_SERVER)) { foreach (explode(',', $_SERVER[$key]) as $ip) { if ((bool) filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) return $ip; } } } return ''; } function use_db($siteid) { $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { exit('//*/'); } $db_selected = mysqli_select_db($con, 'site'.$siteid); if (!$db_selected) { mysqli_close($con); exit('//*/'); } return $con; } function check_block($ref, $siteid, $ip, &$tz, &$ipdb, &$REDIS_2) { //echo '5-1, '; if ($REDIS_2->EXISTS($siteid.'-Updating') === true) return check_block_mysql($ref, $siteid, $ip, $tz, $ipdb); //echo '5-2, '; if ($REDIS_2->EXISTS($siteid.'-UpdateTime') === true AND $REDIS_2->SCARD($siteid.'-1') > 0) {//return data from redis cache //echo '5-3, '; return check_block_redis($ref, $siteid, $ip, $tz, $ipdb, $REDIS_2); } else {//return data from mysql //echo '5-4, '; pclose(popen('php -f ' . __DIR__ . '/cache_settings.php ' . $siteid . ' 0 &', 'r'));//argv[2] = 0, normal update domains & settings cache data return check_block_mysql($ref, $siteid, $ip, $tz, $ipdb); } } function check_block_redis($ref, $siteid, $ip, &$tz, &$ipdb, &$REDIS_2) { //echo '5-3-0, '; //check sitestatus $RETURN_ARRAY = $REDIS_2->MGET(array($siteid.'-SiteStatus', $siteid.'-TimeZone', $siteid.'-IPDatabase')); if ($RETURN_ARRAY[0] !== '0') exit('//*/'); //echo '5-3-1, '; //check blocked IP of setting check_block_url_redis(5, $ip, $siteid, $REDIS_2); //echo '5-3-2, '; //get settings $tz = $RETURN_ARRAY[1];//$REDIS_2->GET($siteid.'-TimeZone'); $ipdb = $RETURN_ARRAY[2];//$REDIS_2->GET($siteid.'-IPDatabase'); if (empty($tz) || is_null($ipdb)) { pclose(popen('php -f ' . __DIR__ . '/cache_settings.php ' . $siteid . ' 1 &', 'r'));//argv[2] = 1, force update domains & settings cache data return check_block_mysql($ref, $siteid, $ip, $tz, $ipdb); } //check blocked site $siteurl = parse_url($ref, PHP_URL_SCHEME) . '://' . parse_url($ref, PHP_URL_HOST); if ($siteurl) { check_block_url_redis(3, $siteurl, $siteid, $REDIS_2); } else { exit('//*/'); } //echo '5-3-3, '; //check blocked page check_block_url_redis(4, $ref, $siteid, $REDIS_2); //check domain $subdomain = parse_url($ref, PHP_URL_HOST); $domain = substr($subdomain, stripos($subdomain, '.') + 1); if (stripos($domain, '.') === false) $domain = ''; if ($domain) { if (check_block_url_redis(1, $domain, $siteid, $REDIS_2) === false) { if (check_block_url_redis(1, $subdomain, $siteid, $REDIS_2) === false) { check_block_url_redis(2, $subdomain, $siteid, $REDIS_2); } } } else if ($subdomain) { if (check_block_url_redis(1, $subdomain, $siteid, $REDIS_2) === false) { check_block_url_redis(2, $subdomain, $siteid, $REDIS_2); } } else { exit('//*/'); } } function check_block_url_redis($type, $ref, $siteid, &$REDIS_2) { switch ($type) { case 1://check domain //echo '5-8-1, '; $md5 = md5($ref); if ($REDIS_2->SISMEMBER($siteid.'-1', $md5)) return true; return false; case 2://record filter domain //echo '5-8-2, '; $REDIS_2->ZADD($siteid.'-BlockedTime', time(), $ref); $REDIS_2->ZINCRBY($siteid.'-BlockedCount', 1, $ref); exit('//*/'); case 3://check blocked site case 4://check blocked page case 5://check blocked IP //echo '5-8-3, '; $md5 = md5($ref); if ($REDIS_2->SISMEMBER($siteid.'-'.$type, $md5)) { $REDIS_2->ZADD($siteid.'-BlockedTime', time(), $ref); $REDIS_2->ZINCRBY($siteid.'-BlockedCount', 1, $ref); exit('//*/'); } break; } } function check_block_mysql($ref, $siteid, $ip, &$tz, &$ipdb) { //echo '5-4-0, '; //connect database $con = use_db($siteid); //echo '5-4-1, '; //check blocked ip check_block_url_mysql(5, $ip, $con); //echo '5-4-2, '; //get settings $result = mysqli_query($con, "SELECT TimeZone,IPDatabase,SiteStatus FROM setting WHERE pKey=0"); if ($result && mysqli_num_rows($result)) { $row = mysqli_fetch_assoc($result); mysqli_free_result($result); if ($row['SiteStatus'] !== '0') { mysqli_close($con); exit('//*/'); } $tz = $row['TimeZone']; $ipdb = $row['IPDatabase']; } else { exit('//*/'); } //echo '5-4-3, '; //check blocked site $siteurl = parse_url($ref, PHP_URL_SCHEME) . '://' . parse_url($ref, PHP_URL_HOST); if ($siteurl) { check_block_url_mysql(3, $siteurl, $con); } else { mysqli_close($con); exit('//*/'); } //echo '5-4-4, '; //check blocked page check_block_url_mysql(4, $ref, $con); //check domain $subdomain = parse_url($ref, PHP_URL_HOST); $domain = substr($subdomain, stripos($subdomain,'.') + 1); if (stripos($domain,'.') === false) $domain = ''; if ($domain) { if (!check_block_url_mysql(1, $domain, $con)) { if (!check_block_url_mysql(1, $subdomain, $con)) { check_block_url_mysql(2, $subdomain, $con); mysqli_close($con); exit('//*/'); } } } else if ($subdomain) { if (!check_block_url_mysql(1, $subdomain, $con)) { check_block_url_mysql(2, $subdomain, $con); mysqli_close($con); exit('//*/'); } } else { mysqli_close($con); exit('//*/'); } mysqli_close($con); } function check_block_url_mysql($type, $ref, $con) { switch ($type) { case 1://check domain //echo '5-9-1, '; $md5 = md5($ref); $result = mysqli_query($con, "SELECT DomainType FROM domain WHERE MD5='$md5'"); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_assoc($result)) { $domainType = (int)$row['DomainType']; if ($domainType === 1) { mysqli_free_result($result); return true; } else if ($domainType === 2) { mysqli_query($con, "UPDATE domain SET BlockedTimes=BlockedTimes+1 WHERE MD5='$md5'"); mysqli_free_result($result); mysqli_close($con); exit('//*/'); } } mysqli_free_result($result); return true; } else { return false; } break; case 2://insert fliter domain //echo '5-9-2, '; $now = time(); $md5 = md5($ref); mysqli_query($con, "INSERT INTO domain(Domain,MD5,BlockedTimes,DomainType,CreateTime) VALUES('{$ref}','{$md5}',1,2,{$now})"); break; case 3://check blocked site case 4://check blocked page case 5://check blocked IP //echo '5-9-3, '; $md5 = md5($ref); $result = mysqli_query($con, "SELECT MD5 FROM domain WHERE MD5='{$md5}'"); if ($result && mysqli_num_rows($result)) { mysqli_query($con, "UPDATE domain SET BlockedTimes=BlockedTimes+1 WHERE MD5='{$md5}'"); mysqli_free_result($result); mysqli_close($con); exit('//*/'); } break; } } ?> ================================================ FILE: ca_version.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ defined('CA_VERSION') || define('CA_VERSION', "1.00.180523001"); defined('CA_UPDATE') || define('CA_UPDATE' , "2018/05/23"); ?> ================================================ FILE: cache_settings.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ if (isset($_SERVER['argv'][1])) { $siteid = (int)$_SERVER['argv'][1]; $force_update = (int)$_SERVER['argv'][2]; } else if (isset($_GET['siteid'])) { $siteid = (int)$_GET['siteid']; } empty($siteid) AND exit; @require './config/config_common.php'; ignore_user_abort(1); set_time_limit(0); $REDIS = new Redis(); $REDIS->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true AND exit; $REDIS->SELECT(REDIS_DB_2); $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) exit; $db_selected = mysqli_select_db($con, 'site'.$siteid); if (!$db_selected) { mysqli_close($con); exit; } if ($REDIS->SETNX($siteid.'-Updating', '') !== true && $force_update === 0) exit; $REDIS->SET($siteid.'-UpdateTime', time()); $REDIS->DEL($siteid.'-1'); $REDIS->DEL($siteid.'-2'); $REDIS->DEL($siteid.'-3'); $REDIS->DEL($siteid.'-4'); $REDIS->DEL($siteid.'-5'); $REDIS->DEL($siteid.'-6'); $result = mysqli_query($con, 'SELECT MD5, DomainType FROM domain'); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_assoc($result)) { $REDIS->SADD($siteid.'-'.$row['DomainType'], $row['MD5']); } mysqli_free_result($result); } $result = mysqli_query($con, "SELECT TimeZone,IPDatabase,SiteStatus FROM setting WHERE pKey=0"); if ($result && mysqli_num_rows($result)) { $row = mysqli_fetch_assoc($result); $REDIS->SET($siteid.'-SiteStatus', $row['SiteStatus']); $REDIS->SET($siteid.'-TimeZone', $row['TimeZone']); $REDIS->SET($siteid.'-IPDatabase', $row['IPDatabase']); mysqli_free_result($result); } $result = mysqli_query($con, 'SELECT NIP, DomainType FROM robot'); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_assoc($result)) { $REDIS->SADD($siteid.'-'.$row['DomainType'], $row['MD5']); } mysqli_free_result($result); } $REDIS->DEL($siteid.'-Updating'); mysqli_close($con); if (isset($_GET['siteid'])) echo 'Update OK!'; ?> ================================================ FILE: command.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ header('Access-Control-Allow-Origin:*'); header('Content-type: text/html; charset=utf-8'); @require './config/config_common.php'; $uid = SDATA_OUT('uid', 6, 'EXIT'); $t = SDATA_OUT('t', 6, 'EXIT'); $v = SDATA_OUT('v', 4, 'EXIT', 32); $q = SDATA_OUT('q', 0, '', 32); verify_admin($uid, $t, $v); $REDIS_0 = new Redis(); if ($REDIS_0->CONNECT(REDIS_IP_0, REDIS_PORT_0) !== true) exit('Conect REDIS_0 Failed.'); $REDIS_0->SELECT(REDIS_DB_0); switch ($q) { case 'process info': $REDIS_2 = new Redis(); if ($REDIS_2->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true) exit('Conect REDIS_2 Failed.'); $REDIS_2->SELECT(REDIS_DB_2); $arr_data = array(); $PROCESS_ARRAY = $REDIS_0->MGET(array('ProcessGlobalCount','ProcessGlobalConsume','ProcessMax','ProcessMin','ProcessLimit','KernelVersion','PersistenceStatus', 'PersistenceVersion')); $Requests = $REDIS_0->LLEN('TicketListL'); $TotalProcessed = $PROCESS_ARRAY[0]; $TotalConsume = $PROCESS_ARRAY[1]; $FatalErrors = $REDIS_0->LLEN('ErrorFatal'); $BadRequests = $REDIS_2->LLEN('BadRequests'); $ExecuteFailures = $REDIS_0->LLEN('ErrorExecute'); $PROCESS_MAX= $PROCESS_ARRAY[2]; $PROCESS_MIN = $PROCESS_ARRAY[3]; $PROCESS_LIMIT = $PROCESS_ARRAY[4]; $KERNEL_VERSION = $PROCESS_ARRAY[5]; $PERSISTENCE_STATUS = $PROCESS_ARRAY[6]; $PERSISTENCE_VERSION = $PROCESS_ARRAY[7]; $arr_data[0] = array((int)$Requests, (int)$TotalProcessed, (int)$TotalConsume, (int)$FatalErrors, (int)$BadRequests, (int)$ExecuteFailures, (int)$PROCESS_MAX, (int)$PROCESS_MIN, (int)$PROCESS_LIMIT, $KERNEL_VERSION, (int)$PERSISTENCE_STATUS, $PERSISTENCE_VERSION); $PROCESS_ARRAY = $REDIS_0->SMEMBERS('ProcessList'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) { $PROCESS_STRUCTURE = $REDIS_0->HGETALL($PID); if (count($PROCESS_STRUCTURE) === 11) { $arr_data[] = array($PROCESS_STRUCTURE['PID'], $PROCESS_STRUCTURE['Status'], $PROCESS_STRUCTURE['StartTime'], $PROCESS_STRUCTURE['LastResponseTime'], $PROCESS_STRUCTURE['TotalCount'], $PROCESS_STRUCTURE['TotalConsume'], $PROCESS_STRUCTURE['CurrentCount'], $PROCESS_STRUCTURE['PeakCount'], $PROCESS_STRUCTURE['MaxConsume'], $PROCESS_STRUCTURE['MinConsume'], $PROCESS_STRUCTURE['MemoryUsage']); } } } $PROCESS_ARRAY = $REDIS_0->ZREVRANGEBYSCORE('SSIDS', '+INF', '-INF', array('withscores'=>true, 'limit'=>array(0, 20))); $arr_data[] = $PROCESS_ARRAY; $PROCESS_ARRAY = $REDIS_0->MGET(array('PerformanceCountJS', 'PerformanceConsumeJS', 'PerformanceCount0', 'PerformanceConsume0','PerformanceCount1', 'PerformanceConsume1','PerformanceCount2', 'PerformanceConsume2','PerformanceCount3', 'PerformanceConsume3','PerformanceCount4', 'PerformanceConsume4','PerformanceCount5', 'PerformanceConsume5','PerformanceCount6', 'PerformanceConsume6','PerformanceCount7', 'PerformanceConsume7','PerformanceCount8', 'PerformanceConsume8','PerformanceCount9', 'PerformanceConsume9','PerformanceCount10', 'PerformanceConsume10','PerformanceCount11', 'PerformanceConsume11','PerformanceCount12', 'PerformanceConsume12', 'TotalMemory','UsedMemory','FreeMemory', 'TotalDisk','UsedDisk')); $arr_data[] = $PROCESS_ARRAY; echo json_encode($arr_data); break; case 'process sum': $REDIS_2 = new Redis(); if ($REDIS_2->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true) exit('Conect REDIS_2 Failed.'); $REDIS_2->SELECT(REDIS_DB_2); $arr_data = array(); $PROCESS_ARRAY = $REDIS_0->MGET(array('ProcessGlobalCount','ProcessGlobalConsume','ProcessMax','ProcessMin','ProcessLimit','KernelVersion','PersistenceStatus', 'PersistenceVersion')); $Requests = $REDIS_0->LLEN('TicketListL'); $TotalProcessed = $PROCESS_ARRAY[0]; $TotalConsume = $PROCESS_ARRAY[1]; $FatalErrors = $REDIS_0->LLEN('ErrorFatal'); $BadRequests = $REDIS_2->LLEN('BadRequests'); $ExecuteFailures = $REDIS_0->LLEN('ErrorExecute'); $PROCESS_MAX= $PROCESS_ARRAY[2]; $PROCESS_MIN = $PROCESS_ARRAY[3]; $PROCESS_LIMIT = $PROCESS_ARRAY[4]; $KERNEL_VERSION = $PROCESS_ARRAY[5]; $PERSISTENCE_STATUS = $PROCESS_ARRAY[6]; $PERSISTENCE_VERSION = $PROCESS_ARRAY[7]; $arr_data[0] = array((int)$Requests, (int)$TotalProcessed, (int)$TotalConsume, (int)$FatalErrors, (int)$BadRequests, (int)$ExecuteFailures, (int)$PROCESS_MAX, (int)$PROCESS_MIN, (int)$PROCESS_LIMIT, $KERNEL_VERSION, (int)$PERSISTENCE_STATUS, $PERSISTENCE_VERSION); $PROCESS_ARRAY = $REDIS_0->SMEMBERS('ProcessList'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) { $PROCESS_STRUCTURE = $REDIS_0->HGETALL($PID); if (count($PROCESS_STRUCTURE) === 11) { $arr_data[] = array($PROCESS_STRUCTURE['PID'], $PROCESS_STRUCTURE['Status'], $PROCESS_STRUCTURE['StartTime'], $PROCESS_STRUCTURE['LastResponseTime'], $PROCESS_STRUCTURE['TotalCount'], $PROCESS_STRUCTURE['TotalConsume'], $PROCESS_STRUCTURE['CurrentCount'], $PROCESS_STRUCTURE['PeakCount'], $PROCESS_STRUCTURE['MaxConsume'], $PROCESS_STRUCTURE['MinConsume'], $PROCESS_STRUCTURE['MemoryUsage']); } } } echo json_encode($arr_data); break; case 'set process': $opt = SDATA_OUT('opt', 6, 'EXIT'); $pid = SDATA_OUT('pid', 0, 'EXIT', 32); switch ($opt) { case 0: $REDIS_0->HSET($pid, 'Status', 0); echo $pid . ' is terminated successful!'; break; case 1: $REDIS_0->HSET($pid, 'Status', 1); echo $pid . ' is running now!'; break; case 2: $REDIS_0->HSET($pid, 'Status', 2); echo $pid . ' is paused successful!'; break; case 4: $PROCESS_MIN = $REDIS_0->GET('ProcessMin'); if ((int)$pid > 8) { echo 'Error: Max Processes is setted up 8 by administrator!'; exit; } if ((int)$PROCESS_MIN <= (int)$pid) { $REDIS_0->SET('ProcessMax', (int)$pid); echo 'Max Processes is ' . $pid . ' now!'; } else { echo 'Error: Max Processes must be larger than Min Processes!'; } break; case 5: $PROCESS_MAX = $REDIS_0->GET('ProcessMax'); if ((int)$PROCESS_MAX >= (int)$pid) { $REDIS_0->SET('ProcessMin', (int)$pid); echo 'Min Processes is ' . $pid . ' now!'; } else { echo 'Error: Min Processes must be less than Max Processes!'; } break; case 13: $PROCESS_COUNT = $REDIS_0->SCARD('ProcessList'); $PROCESS_MAX = $REDIS_0->GET('ProcessMax'); if ($PROCESS_COUNT < $PROCESS_MAX) { pclose(popen('php -f ' . __DIR__ . '/kernel.php &', 'r')); echo 'A new process is running now!'; } else { echo 'Error: The count of process exceeds maximum limit.'; } break; case 14: $REDIS_0->SET('ProcessLimit', 1); $PROCESS_COUNT = $REDIS_0->SCARD('ProcessList'); if ((int)$PROCESS_COUNT > 0) { $PROCESS_ARRAY = $REDIS_0->LRANGE('ProcessList',0,($PROCESS_COUNT - 1)); for ($i = 0; $i < $PROCESS_COUNT; $i++) { $PID = $PROCESS_ARRAY[$i]; $REDIS_0->LSET($PID, 1, 0); } } sleep(3); $PROCESS_ARRAY = $REDIS_0->KEYS('PID*'); $PROCESS_COUNT = count($PROCESS_ARRAY); if ($PROCESS_COUNT > 0) for ($i = 0; $i < $PROCESS_COUNT; $i++) { $REDIS_0->DEL($PROCESS_ARRAY[$i]); } $REDIS_0->DEL('ProcessList'); echo 'This host is disabled now!'; break; case 15: $REDIS_0->SET('ProcessLimit', 0); $PROCESS_MAX = $REDIS_0->GET('ProcessMax'); for ($i = 0; $i < (int)$PROCESS_MAX; $i++) { pclose(popen('php -f ' . __DIR__ . '/kernel.php &', 'r')); } echo 'This host is enabled now!'; break; case 20: $REDIS_0->SET('PersistenceStatus', 1); sleep(3); echo 'Persistence is disabled now!'; break; case 21: $REDIS_0->SET('PersistenceStatus', 0); $REDIS_0->DEL('PersistenceMutualExclusion'); pclose(popen('php -f ' . __DIR__ . '/persistence.php &', 'r')); echo 'Persistence is enabled now!'; break; case 30: $REDIS_0->SET('ProcessLimit', 1); $PROCESS_ARRAY = $REDIS_0->SMEMBERS('ProcessList'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) { $REDIS_0->HSET($PID, 'Status', 0); } } sleep(3); $PROCESS_ARRAY = $REDIS_0->KEYS('PID*'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) $REDIS_0->DEL($PID); } $REDIS_0->DEL('ProcessList'); $REDIS_0->SET('PersistenceStatus', 1); sleep(3); echo 'This host is disabled now!'; break; case 31: $REDIS_0->SET('ProcessLimit', 0); $PROCESS_MAX = (int)$REDIS_0->GET('ProcessMax'); for ($i = 0; $i < $PROCESS_MAX; $i++) { pclose(popen('php -f ' . __DIR__ . '/kernel.php &', 'r')); } $REDIS_0->SET('PersistenceStatus', 0); $REDIS_0->DEL('PersistenceMutualExclusion'); pclose(popen('php -f ' . __DIR__ . '/persistence.php &', 'r')); echo 'This host is enabled now!'; break; case 90: $REDIS_0->DEL('PerformanceCountJS', 'PerformanceConsumeJS','PerformanceCount0', 'PerformanceConsume0','PerformanceCount1', 'PerformanceConsume1','PerformanceCount2', 'PerformanceConsume2','PerformanceCount3', 'PerformanceConsume3','PerformanceCount4', 'PerformanceConsume4','PerformanceCount5', 'PerformanceConsume5','PerformanceCount6', 'PerformanceConsume6','PerformanceCount7', 'PerformanceConsume7','PerformanceCount8', 'PerformanceConsume8','PerformanceCount9', 'PerformanceConsume9','PerformanceCount10', 'PerformanceConsume10','PerformanceCount11', 'PerformanceConsume11','PerformanceCount12', 'PerformanceConsume12','ProcessGlobalCount','ProcessGlobalConsume', 'MissedCA', 'MissedVA', 'MissedVC', 'MissedVID', 'MissedIND'); $REDIS_0->DEL('SSIDS'); echo 'Clean all log successfully!'; break; case 91: $REDIS = new Redis(); $REDIS->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true AND exit; $REDIS->SELECT(REDIS_DB_2); $RETURN_ARRAY = $REDIS->KEYS('1*'); $REDIS->DEL($RETURN_ARRAY); echo 'Clean settings cache successfully!'; break; case 99: $REDIS_0->SET('ProcessLimit', 1); $PROCESS_ARRAY = $REDIS_0->SMEMBERS('ProcessList'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) { $REDIS_0->HSET($PID, 'Status', 0); } } $REDIS_0->SET('PersistenceStatus', 1); sleep(3); $PROCESS_ARRAY = $REDIS_0->KEYS('PID*'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) $REDIS_0->DEL($PID); } $REDIS_0->DEL('ProcessList'); $REDIS_ARR = $REDIS_0->SMEMBERS('DayPeriod'); if (count($REDIS_ARR) > 0) $REDIS_0->DEL($REDIS_ARR); $REDIS_0->DEL('DayPeriod', 'TimeLine'); $REDIS_1 = new Redis(); if ($REDIS_1->CONNECT(REDIS_IP_1, REDIS_PORT_1) !== true) exit('Clean today data failed from redis 1.'); $REDIS_1->SELECT(REDIS_DB_1); $REDIS_1->FLUSHDB(); $REDIS_3 = new Redis(); if ($REDIS_3->CONNECT(REDIS_IP_3, REDIS_PORT_3) !== true) exit('Clean today data failed from redis 3.'); $REDIS_3->SELECT(REDIS_DB_3); $REDIS_3->FLUSHDB(); $DB = con_db(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if ($DB === false) exit('Clean today data failed from connecting database'); foreach($REDIS_ARR AS $redis_tb) { $TMP = explode('-', $redis_tb); $SID = $TMP[0]; $TB_DATE = $TMP[1]; if (use_db($DB, 'site' . $SID)) { $sql = "DROP TABLE log{$TB_DATE}"; mysqli_query($DB, $sql); $sql = "DROP TABLE act{$TB_DATE}"; mysqli_query($DB, $sql); $sql = "DROP TABLE clk{$TB_DATE}"; mysqli_query($DB, $sql); $sql = "DROP TABLE vid{$TB_DATE}"; mysqli_query($DB, $sql); $sql = "DROP TABLE ind{$TB_DATE}"; mysqli_query($DB, $sql); } } echo 'Clean today data successfully!'; break; } break; case 'error': $REDIS = $REDIS_0; $opt = SDATA_OUT('opt', 6, 'EXIT'); switch ($opt) { case 1: $error_type = 'ErrorExecute'; break; case 2: $error_type = 'ErrorFatal'; break; case 3: $REDIS = new Redis(); if ($REDIS->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true) exit('Conect REDIS_2 Failed.'); $REDIS->SELECT(REDIS_DB_2); $error_type = 'BadRequests'; break; case 101: $error_type = 'ErrorExecute'; break; case 102: $error_type = 'ErrorFatal'; break; case 103: $REDIS = new Redis(); if ($REDIS->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true) exit('Conect REDIS_2 Failed.'); $REDIS->SELECT(REDIS_DB_2); $error_type = 'BadRequests'; break; } if ($opt > 100) { if ($REDIS->DEL($error_type) > 0) { echo 'Delete successfully!'; } else { echo 'Delete failed!'; } exit; } $start = SDATA_OUT('start', 6, 0); $row = 20; $arr_data = array(); $PROCESS_COUNT = $REDIS->LLEN($error_type); if ($PROCESS_COUNT > 0) { if ($start === -1 || $start > $PROCESS_COUNT) $start = ($PROCESS_COUNT > $row ? $PROCESS_COUNT - $row : 0); $arr_data = $REDIS->LRANGE($error_type, $start, ($start + $row - 1)); } else { $start = 0; } $arr_data[] = array($PROCESS_COUNT, $start); echo json_encode($arr_data); break; } exit; function SDATA_OUT($key, $opt, $def, $maxL=0, $minL=0) { if (isset($_GET[$key])) { $val = $_GET[$key]; } else { if ($def === 'EXIT') { exit; } else { return $def; } } switch ($opt) { case 0: $mval = filter_var($val, FILTER_SANITIZE_STRING); if (strlen($mval) !== strlen($val)) { return ''; } else { if (strlen($val) > $maxL) { return substr($val, 0, $maxL); } else { return $val; } } case 4: $mval = filter_var($val, FILTER_SANITIZE_STRING); if (strlen($mval) === $maxL) { return $val; } else { exit; } case 6: $tmp = (int)$val; if ((string)$tmp !== (string)$val) { exit; } else { return $tmp; } } return NULL; } function verify_admin($uid, $t, $v) { $n = time(); if ($t < $n) exit; $matchvisa = md5($uid . $t . ENCODE_FACTOR . '4'); if ($v === $matchvisa) return true; exit; } function con_db($host, $user, $pw) { $con = mysqli_connect($host,$user,$pw); if (mysqli_connect_errno($con)) return false; return $con; } function use_db(&$con, $db) { $db_selected = mysqli_select_db($con, $db); if ($db_selected) return true; return false; } ?> ================================================ FILE: common.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ isset($_SESSION['admin']) || die(header('Location: relogin.php?tip=Session has expired, Please re-login.')); function get_guide_menu_html() { $menu_html = ''; $menu_html .= ''; return $menu_html; } function get_side_menu_html() { $menu_url = 'manager.php?id=' . $GLOBALS['USERID'] . '&siteid=' . $GLOBALS['SITEID']; return ' '; } function get_sites_menu_html() { $i = count($GLOBALS['SITES']); $sn = ''; if ($i) { if ($_SESSION['admin'] == 2 || $_SESSION['admin'] == 4) { for ($row = 0; $row < $i; $row++) { if (empty($GLOBALS['SITEID'])) $GLOBALS['SITEID'] = $GLOBALS['SITES'][$row]['SiteID']; if ($GLOBALS['SITES'][$row]['SiteID'] == $GLOBALS['SITEID']) { $sn .= '' . $GLOBALS['SITES'][$row]['SiteName'] . ''; } else { $sn .= '' . $GLOBALS['SITES'][$row]['SiteName'] . ''; } } return $sn; } else if ($_SESSION['admin'] < 2) { for ($row = 0; $row < $i; $row++) { if ($GLOBALS['SITES'][$row]['SiteID'] == $GLOBALS['SITEID']) { $sn .= '' . $GLOBALS['SITES'][$row]['SiteName'] . ''; break; } } return $sn; } } return ''; } function get_hosts_menu_html() { $i = count($GLOBALS['HOSTS']); $sn = ''; if ($i) { if ($_SESSION['admin'] == 1 || $_SESSION['admin'] == 4) { for ($row = 0; $row < $i; $row++) { if ($GLOBALS['HOSTS'][$row]['Domain'] == $GLOBALS['DOMAIN_NAME']) { $sn .= '' . $GLOBALS['HOSTS'][$row]['Hostname'] . ''; $_SESSION['HOSTNAME'] = $GLOBALS['HOSTS'][$row]['Hostname']; } else { $sn .= '' . $GLOBALS['HOSTS'][$row]['Hostname'] . ''; } } return $sn; } } return ''; } function get_option_html() { switch($GLOBALS['MENU']) { case 'Settings': return ''; break; case 'Hosts': switch($GLOBALS['ACTION']) { default: case 'Hosts': case 'Add Host': return ''; break; case 'Host Status': return ' '; break; } break; } if (empty($GLOBALS['SITEID'])) return ''; return ' '; } function SDATA($val, $opt, $maxL=0, $minL=0, $con=0) { if ($con) { $val = rawurldecode($val); $encoding = mb_detect_encoding($val, 'UTF-8, GB18030', true); switch ($encoding) { case 'UTF-8': break; case 'GB18030': $val = mb_convert_encoding($val, 'UTF-8', 'GB18030'); break; default: $val = mb_convert_encoding($val, 'UTF-8', 'UTF-8'); break; } if (mb_detect_encoding($val, 'UTF-8', true) === false) return ''; } switch ($opt) { case 0: if ($con) $val = mysqli_real_escape_string($con, $val); $mval = filter_var($val, FILTER_SANITIZE_STRING); if (mb_strlen($mval,'UTF-8') !== mb_strlen($val,'UTF-8')) { return ''; } else { if (mb_strlen($val,'UTF-8') > $maxL) { return mb_substr($val, 0, $maxL, 'UTF-8'); } else { return $val; } } case 1: $val = filter_var($val, FILTER_SANITIZE_STRING); if ($con) $val = mysqli_real_escape_string($con, $val); if (mb_strlen($val,'UTF-8') > $maxL) { return mb_substr($val, 0, $maxL, 'UTF-8'); } else { return $val; } case 2: $tmp = (int)$val; return ($tmp > $maxL || $tmp < $minL) ? 0 : $tmp; case 3: $mval = filter_var($val, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION + FILTER_FLAG_ALLOW_THOUSAND); if (strlen($mval) !== strlen($val)) { return ''; } else { if (strlen($val) > $maxL) { return ''; } else { return $val; } } case 4: $mval = filter_var($val, FILTER_SANITIZE_STRING); if ($con) $mval = mysqli_real_escape_string($con, $mval); if (strlen($mval) === $maxL) { return $val; } else { exit; } case 5: $mval = filter_var($val, FILTER_VALIDATE_EMAIL); if ($con) $mval = mysqli_real_escape_string($con, $mval); if (strlen($mval) !== strlen($val)) { return ''; } else { if (strlen($val) > $maxL) { return ''; } else { return $val; } } case 6: $tmp = (int)$val; if ((string)$tmp !== (string)$val) { return false; } else { return $tmp; } case 7: if (mb_strlen($val,'UTF-8') > $maxL) { return mb_substr($val, 0, $maxL, 'UTF-8'); } else { return $val; } } return NULL; } function check_sites() { $GLOBALS['PERIOD_FROM'] = ''; $GLOBALS['PERIOD_TO'] = ''; $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { die('Could not connect database host. Please contact Administrator!'); } $db_selected = mysqli_select_db($con, DB_NAME_USER); if (!$db_selected) { mysqli_close($con); die( 'Could not select database. Please contact Administrator!'); } else { $result = mysqli_query($con, "SELECT * FROM st{$GLOBALS['SITELIST_TABLE']} WHERE UserID={$GLOBALS['USERID']}"); if ($result && mysqli_num_rows($result)) { $GLOBALS['SITES'] = array(); while ($row = mysqli_fetch_assoc($result)) { $GLOBALS['SITES'][] = $row; } mysqli_free_result($result); } mysqli_close($con); } if (empty($GLOBALS['SITES']) && $GLOBALS['ACTION'] !== 'Add Site' && $GLOBALS['MENU'] !== 'Hosts') { header("Location: manager.php?id={$GLOBALS['USERID']}&menu=Sites&action=Add Site"); exit; } else if (!empty($GLOBALS['SITES']) && count($GLOBALS['SITES']) > 0) { if (empty($GLOBALS['SITEID'])) { $GLOBALS['SITEID'] = $GLOBALS['SITES'][0]['SiteID']; $GLOBALS['TIMEZONE'] = $GLOBALS['SITES'][0]['TimeZone']; $GLOBALS['SITENAME'] = $GLOBALS['SITES'][0]['SiteName']; $GLOBALS['PERIOD_FROM'] = $GLOBALS['SITES'][0]['CreateTime']; } else { $i = count($GLOBALS['SITES']); $t = 0; for ($row = 0; $row < $i; $row++) { if ($GLOBALS['SITEID'] == $GLOBALS['SITES'][$row]['SiteID']) { $GLOBALS['TIMEZONE'] = $GLOBALS['SITES'][$row]['TimeZone']; $GLOBALS['SITENAME'] = $GLOBALS['SITES'][$row]['SiteName']; $GLOBALS['PERIOD_FROM'] = $GLOBALS['SITES'][$row]['CreateTime']; $t = 1; break; } } if ($t == 0) $GLOBALS['SITEID'] = 0; } } if (!empty($GLOBALS['SITEID'])) { date_default_timezone_set($GLOBALS['TIMEZONE']) ? $today = time() : exit; $GLOBALS['TODAY'] = date("Y-m-d", $today); $GLOBALS['PERIOD_TO'] = date("Ymd", $today); $GLOBALS['PERIOD_FROM'] = date("Ymd", $GLOBALS['PERIOD_FROM']); } } function get_sites() { $GLOBALS['SITES'] = array(); $err = ''; $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { die('Could not connect database host. Please contact Administrator! - Common Function[get_sites]'); } $db_selected = mysqli_select_db($con, DB_NAME_USER); if (!$db_selected) { mysqli_close($con); die('Could not select database. Please contact Administrator! - Common Function[get_sites]'); } else { $result = mysqli_query($con, "SELECT * FROM st{$GLOBALS['SITELIST_TABLE']} WHERE UserID={$GLOBALS['USERID']}"); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_assoc($result)) { $GLOBALS['SITES'][] = $row; } mysqli_free_result($result); } mysqli_close($con); } return true; } function get_hosts() { $err = ''; $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { die('Could not connect database. Please contact Administrator! - Common Function[get_hosts]'); } $db_selected = mysqli_select_db($con, DB_NAME_USER); if (!$db_selected) { mysqli_close($con); die('Could not use database. Please contact Administrator! - Common Function[get_hosts]'); } else { $result = mysqli_query($con, "SELECT * FROM host"); if ($result && mysqli_num_rows($result)) { $GLOBALS['HOSTS'] = array(); while ($row = mysqli_fetch_assoc($result)) { $GLOBALS['HOSTS'][] = $row; if ($row['Domain'] == $GLOBALS['DOMAIN_NAME']) $_SESSION['HOSTNAME'] = $row['Hostname']; } mysqli_free_result($result); } else if ($GLOBALS['ACTION'] !== 'Add Host') { mysqli_close($con); header("Location: manager.php?id={$GLOBALS['USERID']}&menu=Hosts&action=Add Host"); exit; } mysqli_close($con); } return true; } function get_datacenter_region($server) { $len = count($GLOBALS['HOSTS']); for ($i=0; $i<$len; $i++) if ($GLOBALS['HOSTS'][$i]['Domain'] == $server) return $GLOBALS['HOSTS'][$i]['Hostname']; return ''; } function get_site_info($info) { if (empty($GLOBALS['SITES'])) return ''; $i = count($GLOBALS['SITES']); for ($row = 0; $row < $i; $row++) { if ($GLOBALS['SITES'][$row]['SiteID'] == $GLOBALS['SITEID']) { return $GLOBALS['SITES'][$row][$info]; } } return ''; } function get_domains() { $v = get_visa(); $host = get_site_info('DataCenter'); $curl = CURL_PROTOCOL . $host . '/api/api_manage.php'; $q = $v . 'sid='.$GLOBALS['SITEID'].'&q=get domain'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $curl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_POSTFIELDS, $q); $ret = curl_exec($ch); $GLOBALS['DOMAINS'] = empty($ret) ? '' : json_decode($ret, true); curl_close($ch); } function check_table($con, $tb, $db) { $ret = false; $sql = "SHOW TABLES FROM {$db}"; $result = mysqli_query($con, $sql); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_row($result)) { if ($row[0] == $tb) { $ret = true; break; } } mysqli_free_result($result); } return $ret; } function con_db($host, $username, $pw) { $con = mysqli_connect($host, $username, $pw); if (mysqli_connect_errno($con)) { $GLOBALS['ERROR'] .= '
Could not connect mysql. Please contact Administrator! - Common Function[con_db]'; return 0; } return $con; } function use_db($host, $username, $pw, $db, $mod, $func) { $con = mysqli_connect($host, $username, $pw); if (mysqli_connect_errno($con)) { $GLOBALS['ERROR'] .= "
Could not connect mysql - Common Function[use_db], Called From Module[{$mod}] Function[{$func}]"; return 0; } $db_selected = mysqli_select_db($con, $db); if (!$db_selected) { $GLOBALS['ERROR'] .= "
Could not select database - Common Function[use_db], Called From Module[{$mod}] Function[{$func}]"; mysqli_close($con); return 0; } return $con; } function verify_login_for_change($pw, &$success) { $success = false; $err = ''; $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { return 'Could not connect mysql. Please contact Administrator! - Common Function[verify_login_for_change]'; } $db_selected = mysqli_select_db($con, DB_NAME_USER); if (!$db_selected) { $err .= '
Could not select database. Please contact Administrator! - Common Function[verify_login_for_change]'; mysqli_close($con); return $err; } $result = mysqli_query($con, "SELECT * FROM User WHERE UserID={$GLOBALS['USERID']}"); if ($result && mysqli_num_rows($result) == 1) { while ($row = mysqli_fetch_array($result)) { $apw = $row['Password']; break; } mysqli_free_result($result); mysqli_close($con); } else { $err .= '
Login failed! User is not existed'; mysqli_close($con); return $err; } $md5pw = md5($pw); if ($md5pw === $apw && strlen($md5pw) !== 0) { $success = true; } else { $err .= '
Wrong password'; } return $err; } function get_visa($sid=0) { if ($sid === 0) $sid = $GLOBALS['SITEID']; if (!$sid) return false; $t = time() + 30; $v = md5($sid . $t . ENCODE_FACTOR); return 't=' . $t . '&v=' . $v . '&'; } function get_cahm_visa() { if (empty($GLOBALS['SITEID'])) return false; $t = time() + 86400; $pass = md5($GLOBALS['SITEID'] . $t . ENCODE_FACTOR); return 'cahm_visa=' . $pass . $t; } function verify_user() { if (!isset($_SESSION['admin'])) { return false; } if (empty($_SESSION['visa'])) { return false; } else { $visa = $_SESSION['visa']; } if (empty($_SESSION['r'])) { return false; } else { $r = $_SESSION['r']; } if (empty($GLOBALS['USERID'])) return false; if ($_SESSION['admin'] === 4) { $matchvisa = md5($r . ENCODE_FACTOR); if ($visa === $matchvisa) return true; } else if ($_SESSION['admin'] === 2) { $matchvisa = md5($GLOBALS['USERID'] . $r . ENCODE_FACTOR); if ($visa === $matchvisa) return true; } else if ($_SESSION['admin'] < 2) { if (empty($GLOBALS['SITEID'])) return false; $matchvisa = md5($GLOBALS['USERID'] . $GLOBALS['SITEID'] . $r . ENCODE_FACTOR); if ($visa === $matchvisa) return true; } return false; } function get_ip() { foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $_SERVER)) { foreach (explode(',', $_SERVER[$key]) as $ip) { if ((bool)filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { return $ip; } } } } return ''; } ?> ================================================ FILE: config/config_common.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ /*********** Load Other Config Start **********/ @require 'config_redis.php';//load Redis Config @require 'config_mail.php';//load Mail Config /********* Load Other Config End ********/ /*************** COMMON CONFIG BEGIN **************/ //encode factor define('ENCODE_FACTOR', 'abcdef123456');//RESET YOUR PRIVATE ENCODE FACTOR, IT IS VERY IMPORTANT //mysql local host name define('DB_HOST_LOCAL', '127.0.0.1');//set your mysql host name or ip //mysql local root name define('ROOT_USER_LOCAL', 'root');//set your mysql login username here (Creating Database Permission Is Necessary) //mysql local root password define('ROOT_PASSWORD_LOCAL', 'password');//set your mysql login password here //administrator's timezone: PRC define('ADMIN_TIMEZONE', 'PRC');//set administrator's timezone //default timezone: PRC define('DEFAULT_TIME_ZONE', 'PRC');//set default timezone //error log host define('ERROR_LOG_HOST', 'www.yourdomainname.com');//set Error Log host /**************** COMMON CONFIG END ***************/ /**********************************************/ /****** DO NOT CHANGE ANY CONSTANT BELOW ******/ /**********************************************/ /****** Local Database Information Start ******/ //mysql user database name define('DB_NAME_USER', 'ccdata'); //mysql robot database name define('DB_NAME_ROBOT', 'ccrobot'); //mysql error database name define('DB_NAME_ERROR', 'ccerror'); /******* Local Database Information End *******/ //************* CA Constant Begin ************* //max bigint define('MAX_BIGINT', 2^63-1 ); //max int define('MAX_INT', 2147483647); //max smallint define('MAX_SMALLINT', 32767); //max tinyint define('MAX_TINYINT', 127); //CA Realtime Array Length define('CA_READY_ARRAY_LENGTH', 23);//23 //CA BASIC INFO Array Length define('CA_BASIC_ARRAY_LENGTH', 91);//91 //CA TOTAL Array Length define('CA_TOTAL_ARRAY_LENGTH', 112);//112 //CA Indicator Array Length define('CA_INDICATOR_ARRAY_LENGTH', 31);//31 //CA Visitor Action Array Length define('CA_VA_ARRAY_LENGTH', 8);//8 //CA Visitor Click Array Length define('CA_VC_ARRAY_LENGTH', 35);//35 //************** CA Constant End ************** ?> ================================================ FILE: config/config_mail.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ /************* Config Mail Start ***********/ //administrator mail defined('ADMIN_MAIL') || define('ADMIN_MAIL', 'admin@centcount.com'); //auto response mail defined('AUTORESPONSE_MAIL') || define('AUTORESPONSE_MAIL', 'autoresponse@centcount.com'); //notification mail defined('NOTIFICATION_MAIL') || define('NOTIFICATION_MAIL', 'notification@centcount.com'); //fatal error mail defined('FATALERROR_MAIL') || define('FATALERROR_MAIL', 'fatalerror@centcount.com'); /************** Config Mail End ************/ ?> ================================================ FILE: config/config_redis.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ /************* Redis Config Start *************/ //redis instance 0 for kernel process (information of process, ticket, session) define('REDIS_IP_0', '127.0.0.1'); define('REDIS_PORT_0', 6379); define('REDIS_DB_0', 0); //redis instance 1 for realtime visitor data (all information of realtime) define('REDIS_IP_1', '127.0.0.1'); define('REDIS_PORT_1', 6379); define('REDIS_DB_1', 1); //redis instance 2 for CA javascript (site settings, site domains, robots list) define('REDIS_IP_2', '127.0.0.1'); define('REDIS_PORT_2', 6379); define('REDIS_DB_2', 2); //redis instance 3 for session (session information) define('REDIS_IP_3', '127.0.0.1'); define('REDIS_PORT_3', 6379); define('REDIS_DB_3', 3); /************** Redis Config End **************/ ?> ================================================ FILE: config/config_security.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ /************* Security Config Start *************/ //force ssl define('FORCE_SSL', true);//If you don't have SSL Certificate, please set this const to "false". //check ssl define('IS_HTTPS', isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 1 || $_SERVER['HTTPS'] === 'on') ? true : false); //define security transfer protocol define('PROTOCOL', IS_HTTPS ? 'https://' : 'http://'); //define API transfer protocol define('CURL_PROTOCOL', 'https://');//If you don't have SSL Certificate, please set this const to "http://". /************** Security Config End **************/ //check protocol FORCE_SSL && (IS_HTTPS || die(header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']))); @require 'config_mail.php';//load Mail Config ?> ================================================ FILE: core.php ================================================ - All rights reserved. * * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ ignore_user_abort(1); $START_TIME = $_SERVER['REQUEST_TIME_FLOAT']; empty($START_TIME) && $START_TIME = microtime(true); $TIMESTAMP = (int)$START_TIME; $START_TIME = (int)($START_TIME * 1E6); if (isset($_GET['rn']) === true) ((int)$_GET['rn'] > 15E14 && (int)$_GET['rn'] < ($START_TIME - 36E8)) AND exit; @require './config/config_redis.php'; $REDIS_2 = new Redis(); if ($REDIS_2->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true) exit; $REDIS_2->SELECT(REDIS_DB_2); $IP = ''; foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $_SERVER)) { foreach (explode(',', $_SERVER[$key]) as $val) { if ((bool)filter_var($val, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { $IP = $val; goto skip; } } } } skip: if ($REDIS_2->SISMEMBER('NewRobots', $IP) === true) goto SkipAttackCheck; $IPB = substr($IP, 0, strrpos($IP, '.')); if ($REDIS_2->SISMEMBER('NewRobots', $IPB) === true) goto SkipAttackCheck; foreach (array('stp','stat','sid','vid','rn','ipdb','ls','tvs') as $key) isset($_GET[$key]) === false AND Record_BadRequest($REDIS_2, $IP, $TIMESTAMP, 1); ((int)$_GET['rn'] > $START_TIME || (int)$_GET['rn'] < 15E14 || (int)$_GET['vid'] > $START_TIME || (int)$_GET['vid'] < 1E15 || (int)$_GET['sid'] > 2E15 || (int)$_GET['sid'] < 15E14 || empty($_GET['tz'])) AND Record_BadRequest($REDIS_2, $IP, $TIMESTAMP, 2); SkipAttackCheck: $REDIS_2->GET($_GET['sid'].'-SiteStatus') !== '0' AND Record_BadRequest($REDIS_2, $IP, $TIMESTAMP, 3); $REDIS_0 = new Redis(); if ($REDIS_0->CONNECT(REDIS_IP_0, REDIS_PORT_0) !== true) exit; $REDIS_0->SELECT(REDIS_DB_0); $RC = $_GET['rn']; $RC_EXIST = (bool)$REDIS_0->EXISTS($RC); if ($REDIS_0->RPUSH($RC, '&' . $_SERVER['QUERY_STRING'] . '&ip=' . $IP . '&ts=' . $START_TIME) > 0) { $RC_EXIST === false AND $REDIS_0->RPUSH('TicketListL', $RC); if ($_GET['stat'] === '1' || $_GET['stat'] === '9') { header('Content-type: application/javascript'); echo "var _caq = _caq || [];_caq.push(['_responseStatusCA',0]);"; } $REDIS_0->ZINCRBY('SSIDS', 1, $_GET['sid']); } $REDIS_1 = new Redis(); if ($REDIS_1->CONNECT(REDIS_IP_1, REDIS_PORT_1) !== true) exit; $REDIS_1->SELECT(REDIS_DB_1); $EXPIRE = 900; switch ((int)$_GET['stat']) { case 1: case 9: if (!date_default_timezone_set($_GET['tz'])) exit; $DAY_PERIOD_NOW = date('ymd', $TIMESTAMP); $DAY_PERIOD = $REDIS_1->GET('DayPeriod'.$_GET['sid']); if ($DAY_PERIOD_NOW !== $DAY_PERIOD) { $REDIS_1->MSET(array('PeakPV'.$_GET['sid'] => 1, 'RealPV'.$_GET['sid'] => 1, 'PeakUV'.$_GET['sid'] => 1, 'RealUV'.$_GET['sid'] => 1, 'PeakIP'.$_GET['sid'] => 1, 'RealIP'.$_GET['sid'] => 1, 'DayPeriod'.$_GET['sid'] => $DAY_PERIOD_NOW)); } $REAL_MINUTE = date('H:i', $TIMESTAMP); $RANG_MINUTE = floor(($TIMESTAMP - 840) / 60) * 60; $LAST_MINUTE = $REDIS_1->GETSET('MinPeriod'.$_GET['sid'], $REAL_MINUTE); if ($LAST_MINUTE != $REAL_MINUTE) { $CHECK_ARRAY = $REDIS_1->MGET(array('PeakPV'.$_GET['sid'], 'RealPV'.$_GET['sid'], 'PeakUV'.$_GET['sid'], 'RealUV'.$_GET['sid'], 'PeakIP'.$_GET['sid'], 'RealIP'.$_GET['sid'], 'MinData'.$_GET['sid'])); $REDIS_ARRAY = array(); if ($CHECK_ARRAY[0] < $CHECK_ARRAY[1]) $REDIS_ARRAY['PeakPV'.$_GET['sid']] = $CHECK_ARRAY[1]; if ($CHECK_ARRAY[2] < $CHECK_ARRAY[3]) $REDIS_ARRAY['PeakUV'.$_GET['sid']] = $CHECK_ARRAY[3]; if ($CHECK_ARRAY[4] < $CHECK_ARRAY[5]) $REDIS_ARRAY['PeakIP'.$_GET['sid']] = $CHECK_ARRAY[5]; $REDIS_1->PIPELINE(); $REDIS_1->MSET($REDIS_ARRAY); if ($CHECK_ARRAY[6]) $REDIS_1->ZADD('SMINS'.$_GET['sid'], (int)substr($CHECK_ARRAY[6], 0, 10), substr($CHECK_ARRAY[6], 10)); $REDIS_1->DEL('VIDS'.$_GET['sid'],'IPS'.$_GET['sid']); $REDIS_1->MSET(array('RealPV'.$_GET['sid'] => 1, 'RealUV'.$_GET['sid'] => 1, 'RealIP'.$_GET['sid'] => 1, 'MinData'.$_GET['sid'] => $TIMESTAMP . $REAL_MINUTE . ',1,1,1')); $REDIS_1->SADD('VIDS'.$_GET['sid'], $_GET['vid']); $REDIS_1->SADD('IPS'.$_GET['sid'], $IP); $REDIS_1->EXPIRE('MinData'.$_GET['sid'], 900); $REDIS_1->ZREMRANGEBYSCORE('SVIDS'.$_GET['sid'], 0, ($RANG_MINUTE-60)); $REDIS_1->ZREMRANGEBYSCORE('SMINS'.$_GET['sid'], 0, ($RANG_MINUTE-60)); $REDIS_1->EXEC(); } else { $REAL_PV = $REDIS_1->INCR('RealPV'.$_GET['sid']); if ($REDIS_1->SISMEMBER('VIDS'.$_GET['sid'], $_GET['vid']) === false) { $REAL_UV = $REDIS_1->INCR('RealUV'.$_GET['sid']); $REDIS_1->SADD('VIDS'.$_GET['sid'], $_GET['vid']); } else { $REAL_UV = $REDIS_1->GET('RealUV'.$_GET['sid']); } if ($REDIS_1->SISMEMBER('IPS'.$_GET['sid'], $IP) === false) { $REAL_IP = $REDIS_1->INCR('RealIP'.$_GET['sid']); $REDIS_1->SADD('IPS'.$_GET['sid'], $IP); } else { $REAL_IP = $REDIS_1->GET('RealIP'.$_GET['sid']); } $CHECK_ARRAY = $REDIS_1->GET('MinData'.$_GET['sid']); $CHECK_ARRAY = $CHECK_ARRAY ? substr($CHECK_ARRAY, 0, 10) : $TIMESTAMP; $REDIS_1->SET('MinData'.$_GET['sid'], $CHECK_ARRAY . $REAL_MINUTE . ',' . $REAL_PV . ',' . $REAL_UV . ',' . $REAL_IP); $REDIS_1->EXPIRE('MinData'.$_GET['sid'], 900); } case 2: $RET = $REDIS_1->GET($_GET['vid']); $REDIS_1->PIPELINE(); if ($RET) { $TMP = '&pv=' . $_GET['pv'] . '&dt=' . $_GET['dt'] . '&ds=' . $_GET['ds'] . '&rs=' . $_GET['rs']; $TMP = MDATA($RET, '&pv=', $TMP); $REDIS_1->SET($_GET['vid'], $TMP); } else { $REDIS_1->ZADD('SVIDS'.$_GET['sid'], $TIMESTAMP, $_GET['vid']); $REDIS_1->APPEND($_GET['vid'], 'stat=' . $_GET['stat'] . '&rn=' . $_GET['rn'] . '&vid=' . $_GET['vid'] . '&ip=' . $IP . '&ipdb='. $_GET['ipdb'] . '&pg=' . rawurlencode($_GET['pg']) . '&rf=' . (empty($_GET['rf']) ? '' : parse_url($_GET['rf'], PHP_URL_HOST)) . '&kw=' . (empty($_GET['kw']) ? '' : $_GET['kw']) . '&pv=' . $_GET['pv'] . '&dt=' . $_GET['dt'] . '&ds=' . $_GET['ds'] . '&rs=' . $_GET['rs'] ); } $REDIS_1->EXPIRE($_GET['vid'], $EXPIRE); $REDIS_1->EXEC(); break; case 3: $RET = $REDIS_1->GET($_GET['vid']); $REDIS_1->PIPELINE(); if ($RET) { $TMP = '&pv=' . $_GET['pv'] . '&dt=' . $_GET['dt'] . '&ds=' . $_GET['ds'] . '&rs=' . $_GET['rs'] . '&ls=' . $_GET['ls'] . '&mnrx='. $_GET['mnrx'] . '&mnry='. $_GET['mnry'] . '&mxrx='. $_GET['mxrx'] . '&mxry='. $_GET['mxry']; $TMP = MDATA($RET, '&pv=', $TMP); $REDIS_1->SET($_GET['vid'], $TMP); } else { $REDIS_1->APPEND($_GET['vid'], 'stat='. $_GET['stat'] . '&rn=' . $_GET['rn'] . '&vid=' . $_GET['vid'] . '&ip=' . $IP . '&ipdb='. $_GET['ipdb'] . '&pg=' . rawurlencode($_GET['pg']) . '&rf=' . (empty($_GET['rf']) ? '' : parse_url($_GET['rf'], PHP_URL_HOST)) . '&kw=' . (empty($_GET['kw']) ? '' : $_GET['kw']) . '&pv=' . $_GET['pv'] . '&dt=' . $_GET['dt'] . '&ds=' . $_GET['ds'] . '&rs=' . $_GET['rs'] . '&ls=' . $_GET['ls'] . '&mnrx='. $_GET['mnrx'] . '&mnry='. $_GET['mnry'] . '&mxrx='. $_GET['mxrx'] . '&mxry='. $_GET['mxry'] ); } $REDIS_1->EXPIRE($_GET['vid'], $EXPIRE); $REDIS_1->EXEC(); break; case 4: case 5: $REDIS_1->PIPELINE(); $REDIS_1->DEL($_GET['vid']); $REDIS_1->ZREM('SVIDS'.$_GET['sid'], $_GET['vid']); $REDIS_1->EXEC(); break; case 6: break; case 7: if ((bool)$REDIS_1->EXISTS($_GET['vid']) === false) break; $RET = $REDIS_1->GET($_GET['vid']); $TMP = '&ds=' . $_GET['ds'] . '&rs=' . $_GET['rs'] . '&ls=' . $_GET['ls'] . '&ols=' . $_GET['ols'] . '&mnrx='. $_GET['mnrx'] . '&mnry='. $_GET['mnry'] . '&mxrx='. $_GET['mxrx'] . '&mxry='. $_GET['mxry']; $TMP = MDATA($RET, '&ds=', $TMP); $REDIS_1->PIPELINE(); $REDIS_1->SET($_GET['vid'], $TMP); $REDIS_1->EXPIRE($_GET['vid'], $EXPIRE); $REDIS_1->ZADD('SVIDS'.$_GET['sid'], $TIMESTAMP, $_GET['vid']); $REDIS_1->EXEC(); break; } $CHECK_ARRAY = $REDIS_0->MGET(array('ProcessLimit', 'ProcessCheckTime', 'ProcessMax', 'ProcessMin')); if ($CHECK_ARRAY[0] !== '1') { $PROCESS_CHECK_TIME = (int)$CHECK_ARRAY[1]; if (($START_TIME - $PROCESS_CHECK_TIME) > 6E7) { $PROCESS_MAX = (int)$CHECK_ARRAY[2]; if ($PROCESS_MAX < 1 || $PROCESS_MAX > 128) $PROCESS_MAX = 4; $PROCESS_MIN = (int)$CHECK_ARRAY[3]; if ($PROCESS_MIN < 1 || $PROCESS_MAX > 128) $PROCESS_MIN = 2; $REDIS_0->MSET(array('ProcessCheckTime' => $START_TIME, 'ProcessMax' => $PROCESS_MAX, 'ProcessMin' => $PROCESS_MIN)); $PROCESS_ENABLED = 0; $PROCESS_ARRAY = $REDIS_0->SMEMBERS('ProcessList'); if (count($PROCESS_ARRAY) > 0) { foreach ($PROCESS_ARRAY as $PID) { $PROCESS_STRUCTURE = $REDIS_0->HMGET($PID, array('Status', 'LastResponseTime')); if (count($PROCESS_STRUCTURE) < 2 OR $PROCESS_STRUCTURE['Status'] === '1' && ($START_TIME - $PROCESS_STRUCTURE['LastResponseTime']) > 6E7) { $REDIS_0->DEL($PID); $REDIS_0->SREM('ProcessList', $PID); } else { $PROCESS_ENABLED++; if ($PROCESS_ENABLED > $PROCESS_MAX) $REDIS_0->HSET($PID, 'Status', 0); } } } if ($PROCESS_ENABLED < $PROCESS_MIN) { $n = $PROCESS_MIN - $PROCESS_ENABLED; for ($i = 0; $i < $n; $i++) { pclose(popen('php -f ' . __DIR__ . '/kernel.php &', 'r')); } } } } $REDIS_0->MULTI() ->INCRBY('PerformanceConsume0', (int)(microtime(true) * 1E6) - $START_TIME) ->INCR('PerformanceCount0') ->EXEC(); exit; function Record_BadRequest(&$redis, $ip, $time, $type) { $redis->PIPELINE(); $redis->INCR('BlockedIPCount'); $redis->RPUSH('BadRequests', $_SERVER['QUERY_STRING'] . '&ip=' . $ip . '&time=' . $time . '&type=' . $type); if ($type > 0) { $redis->SADD('BlockedIPList', $ip); $redis->SADD('BlockedIPHistory', $ip); } $redis->EXEC(); exit; } function MDATA($request, $key, $value) { $ret = $request; $spos = strpos($request, $key); if ($spos !== false) { $ret = substr($request, 0, $spos) . $value; } else { $ret = $request . $value; } return $ret; } ?> ================================================ FILE: css/common.css ================================================ /*! * ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! * * module: Centcount Analytics Free CA Common CSS Code * * version: 1.00 Free * * author: WM Jonssen * * date: 03/12/2018 * * copyright 2015-2018 WM Jonssen- All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ @charset "utf-8"; *{color:#555; font-family:"Microsoft Yahei",Arial,Verdana; font-weight:300; padding:0px; margin:auto; border:0; border-radius:0;} h1{color:#333; letter-spacing:3px; margin-top:15px; margin-bottom:15px;} a{color:#39F; text-decoration:none;} a:hover{text-decoration:underline;} .errmsg, .successmsg, .retmsg, .successbtn{width:calc(100% - 32px); height:auto; font-size:13px; line-height:18px; text-align:center; color:rgb(181,68,123); display:none; padding:15px; background-color:rgb(242,222,222); border-radius:4px; border:rgb(235,204,209) 1px solid; word-wrap:break-word; float:left;} .successmsg, .successbtn{width:calc(100% - 26px); display:block; padding:12px;} .successbtn{border-color:rgb(6,105,161); background-color:rgb(16,151,228); color:#fff; margin-top:15px;} .successbtn:hover{opacity:0.7; text-decoration:none;} .retmsg{display:block; text-align:left;} #header{width:100%; min-width:360px; height:auto; font-size:12px; text-align:left; color:#aaa; float:left; border-bottom:#ccc 1px solid;} #logo{width:auto; height:auto; line-height:16px; font-size:12px; text-align:left; color:#222; float:left; padding:10px;} img.mid{vertical-align:middle; float:left;} #guide{width:auto; height:auto; line-height:36px; font-size:12px; text-align:right; color:#aaa; float:right; padding:0; padding-left:10px; padding-right:10px;} .guidebtn,.guidespan,.langbtn,.lastbtn{width:auto; height:12px; line-height:12px; color:#4283C4; text-align:center; padding-left:10px; padding-right:11px; font-size:12px;} .langbtn{background:url(../images/menu.png) top right no-repeat; padding-right:21px;} .lastbtn{background:none; padding-right:10px;} .guidebtn:hover,.langbtn:hover,.lastbtn:hover{text-decoration:none;} .guidespan{background:none; padding-right:10px; color:#333;} #guide ul{background-color:#fff; list-style:none; width:auto; height:auto; float:right; margin:0; padding:0;} #guide li{background-color:#fff; width:auto; height:auto; font-size:12px; float:left;} #guide li:hover{background-color:#eee;} #guide li ul{display:none; width:auto; height:auto; border:#ddd 1px solid; position:absolute; z-index:999; background-color:#fff; overflow:hidden;} #guide li:hover ul{display:block;} #guide li li {display:block; width:auto; height:auto; float:none; text-align:left; overflow:hidden;} #guide li ul li a{display:block;height:30px; line-height:30px; font-size:12px;text-align:left;} #guide li ul li a:hover{text-decoration:none; background-color:#eee;} #title, .title{width:100%; min-width:360px; font-size:14px; text-align:center; padding-top:20px; padding-bottom:20px; float:left; border-bottom:#ccc 1px solid;} #bodyframe{border-bottom:#ccc 1px solid; text-align:center; padding-top:30px; padding-bottom:30px; width:100%; min-width:360px; float:left; font-size:14px;} .framebody{margin:auto; text-align:center; width:330px; min-width:330px; height:auto; font-size:12px;} p{font-size:14px; color:#555;} .section{width:100%; height:auto; font-size:14px; margin:auto; text-align:center; float:left;} .sImgL, .sImgR, .sTxtL, .sTxtR, .sBoxC, .sLogL, .sLogR{width:50%; height:450px; margin:auto; background-color:#f7f7f7; text-align:left; float:right; overflow:hidden;} .sImgL{background-position:top right; background-repeat:no-repeat; background-size:100% auto; float:left;} .sImgR{background-position:top left; background-repeat:no-repeat; background-size:100% auto; float:right;} .sTxtL{text-align:right; float:left;} .sBoxC{height:auto; background-color:#fff; float:left; overflow:hidden;} .sLogL, .sLogR{height:auto; float:left;} .logoImg{width:550px; height:550px; margin:auto; margin-top:-50px;} .sText{width:auto; height:auto; padding:60px; padding-left:80px; padding-right:80px; text-align:left; float:none;} .pBoxL, .pBoxC{max-width:480px; line-height:24px; font-size:16px; font-family:Verdana,"Microsoft Yahei",Arial; float:none;} .pBoxL{float:left;} .sWord{max-width:960px; line-height:42px; margin:auto; color:#fff; font-family:Serif,Tahoma,"Microsoft Yahei",Arial; font-size:28px; font-weight:300; letter-spacing:1px;} .bBox{width:250px; text-align:center; margin:auto; padding:30px;} .word{font-size:15px; font-family:Tahoma,"Microsoft Yahei",Arial,Verdana; color:#555; letter-spacing:1px;} .btnB, .btnR{display:block; margin:auto; text-align:center; width:220px; height:auto; line-height:18px; margin-top:10px; margin-bottom:10px; padding:10px; background-color:rgb(16,151,228); color:#fff; font-size:14px; border-radius:4px; float:none;} .btnR{background-color:#e50e0e;} .btnB:hover, .btnR:hover{opacity:0.7; text-decoration:none;} .bImgC{width:auto; height:480px; margin:30px;} .sRed{background-color:#e50e0e;} .sBlue{background-color:#00b0ff;} .sGray{background-color:#f7f7f7;} .sWhite{background-color:#fff;} .sP30{padding:30px;} .sP15{padding:15px;} .bTop{border-top:#ddd 1px solid;} .bBot{border-bottom:#ddd 1px solid;} .fR, .tR{float:right;} .fL, .tL{float:left;} .tC{text-align:center;} .h545{height:545px;} .h480{height:480px;} .h475{height:475px;} .mh450{max-height:450px;} .h415{height:415px;} @media only screen and (max-width: 1920px) { .sImgL, .sImgR{background-size:100% 100%;} } @media only screen and (max-width: 1800px) { .sImgL, .sImgR{background-size:auto 100%;} } @media only screen and (max-width: 960px) { .sBoxC, .sImgL, .sLogL, .sImgR{width:100%; float:left;} .sBoxC{text-align:center;} .sTxtL, .sTxtR, .sLogR{width:100%; height:auto; float:left;} .sText{padding:45px; float:left;} .fR{max-width:640px; float:left; margin:auto;} .bBox{padding:30px;} .logoImg{width:450px; height:450px; margin-top:30px;} } @media only screen and (max-width: 768px) { .guidespan{display:none;} } @media only screen and (max-width: 640px) { #logo, .title{display:none;} .sWord{font-size:20px; line-height:32px;} .sImgL, .sImgR{width:100%; height:360px; float:left; background-size:auto 100%;} .sLogL{width:100%; float:left;} .bBox{padding-left:15px; padding-right:15px;} .sText, .sP30{padding:15px;} .logoImg{width:300px; height:300px;} } #footer{font-size:12px; line-height:18px; font-family:Arial,"Microsoft Yahei",Verdana; color:#777; text-align:center; float:left; width:100%; min-width:360px; padding-top:30px; padding-bottom:30px;} td{width:100%; height:auto; min-height:20px; line-height:16px; text-align:left; margin-top:15px; float:left;} tr, tbody, table, form{width:100%; border:0px; margin:0px; padding:0px; outline-style:none; outline-width:0px; border-spacing:0px; float:left;} .email{width:calc(100% - 37px); padding-left:30px; background:url(../images/login.png) top left no-repeat;} .pwd{width:calc(100% - 37px); padding-left:30px; background:url(../images/login.png) no-repeat; background-position:0px -30px;} .fresh{width:30px; height:34px; float:right; background:url(../images/login.png) no-repeat; background-position:0px -88px; background-size:30px;} .name{width:65px; font-size:12px; text-align:right; float:none;} .sug{width:100%; height:20px; line-height:20px; font-size:12px; text-align:center; margin-top:5px; float:left;} input{width:calc(100% - 12px); height:32px; line-height:32px; font-size:13px; border:#ccc 1px solid; ime-mode:disabled; outline-style:none; outline-width:0px; background-size:30px; float:left; padding-left:5px; padding-right:5px;} button, select{width:100%; height:34px; line-height:33px; color:#333; border:#ccc 1px solid; float:left; padding-left:5px; padding-right:5px;} button{background:url(../images/login.png) bottom left repeat-x;} button:hover{border:#777 1px solid;} textarea{width:100%; font-size:13px; color:#333; border:#ccc 1px solid; resize:none; float:left; padding-left:5px; padding-right:5px;} .short{width:98px; margin-right:15px; padding-left:30px; background:url(../images/login.png) no-repeat; background-position:0px -60px;} .vcode{width:135px; height:34px; float:left; margin-right:10px;} .suggestion{text-align:left; width:auto; float:left;} .strength{width:255px; height:16px; background-image:url(../images/cc_images.png); background-position:5px -39px; background-repeat: no-repeat; float:right;} .frameform{width:100%; margin:auto; text-align:center; float:left;} .frameagree{width:100%; height:100%; display:none; position:fixed; top:0; left:0; text-align:center; margin:auto; background:rgba(0,0,0,1); float:left;} .agreebox{width:auto; max-width:600px; min-width:330px; height:-moz-calc(100% - 120px); height:-webkit-calc(100% - 120px); height:calc(100% - 120px); line-height:20px; text-align:justify; font-size:14px; margin:auto; background:#eee; color:#555; float:none; overflow-y:auto; border-radius:5px;} .agreebtn{width:100%; height:60px; line-height:60px; font-size:16px; font-weight:700; color:#fff; text-align:center; margin:auto; background-color:transparent; float:left;} .mTop{margin-top:0px;} .mTop15{margin-top:15px;} .dShow{display:block;} ================================================ FILE: css/ichart.css ================================================ /*! * ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! * * module: Centcount Analytics Free CA Chart CSS Code * version: 1.00 Free * * author: WM Jonssen * * date: 03/12/2018 * * copyright 2015-2018 WM Jonssen - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ @charset "utf-8"; /*box*/ .selectframe{font-size:14px; font-family:"Microsoft Yahei",Arial,Verdana; width:100%; min-width:360px; height:auto; float:left; border-bottom:#ccc 1px solid; margin:auto; text-align:center;} .framebody{width:auto; min-width:345px; height:auto; float:none; margin:0px; margin-left:15px; text-align:left; overflow-x:auto; overflow-y:hidden;} .errmsg{margin-bottom:10px;} .frametable{width:100%; height:auto; text-align:center; float:none;} .frameinner, .framesum{width:100%; height:auto; text-align:center; float:left;} .innertable{width:100%; min-width:330px; height:auto; margin:0px; text-align:left; float:left;} .innertitle{width:calc(100% - 27px); height:45px; line-height:45px; padding-left:10px; margin-right:15px; text-align:left; font-size:20px; color:#111; font-family:Verdana,"Microsoft Yahei",Arial; border:1px #ccc solid; border-bottom:0px; float:left;} .innerbody, .innerbodywithborder, .innerbodynoborder{width:calc(100% - 17px); height:auto; margin-right:15px; text-align:left; border:0px; border-left:#ccc 1px solid; border-right:#ccc 1px solid; scrolling:no; overflow-x:auto; float:left;} .innerbodywithborder{border:1px #ccc solid;} .innerbodynoborder{border:0px;} .innerfoot{width:calc(100% - 17px); height:45px; margin-right:15px; margin-bottom:15px; text-align:left; font-size:16px; font-weight:bold; border:1px #ccc solid; border-top:0px; float:left;} /*global var*/ .ca_refresh_btn{width:32px; height:32px; margin-top:6px; margin-right:6px; float:right; background:url(../images/tool_btn.png) no-repeat; background-position:0px 0px; position:relative; background-color:#fff;} .ca_refresh_btn:hover{background-position:-32px 0px;} .ca_table_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -32px;} .ca_table_btn:hover{background-position:-32px -32px;} .ca_pie_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -64px;} .ca_pie_btn:hover{background-position:-32px -64px;} .ca_bar_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -96px;} .ca_bar_btn:hover{background-position:-32px -96px;} .ca_map_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -128px;} .ca_map_btn:hover{background-position:-32px -128px;} .ca_location_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -160px;} .ca_location_btn:hover{background-position:-32px -160px;} .ca_realmap_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -192px;} .ca_realmap_btn:hover{background-position:-32px -192px;} .ca_all_btn{width:32px; height:32px; margin-top:6px; margin-left:6px; float:left; background:url(../images/tool_btn.png) no-repeat; background-position:0px -224px;} .ca_all_btn:hover{background-position:-32px -224px;} /*ca line css code*/ .ca_line, .ca_bar{width:auto; height:auto; font-size:13px; font-family:"Microsoft Yahei",Arial, Verdana; text-align:left; overflow:hidden;} .ca_bar{border:0px; border-top:#ccc 1px solid; border-bottom:#ccc 1px solid;} .line_title, .bar_title, .pie_title{width:calc(100% - 15px); font-size:11px; padding-top:10px; padding-left:10px; font-family:"Microsoft Yahei",Arial, Verdana; float:none;} .pie_title{padding-bottom:10px;} /*ca online number css code*/ .ca_online_no{height:auto; width:100%; font-size:14px; line-height:16px; text-align:center; color:#333; margin-top:60px; margin-bottom:60px; float:none;} .ca_online_p{height:45px; font-size:36px; line-height:40px; font-weight:bold; margin:0px; padding:0px;} .ca_online_p2{height:auto; font-size:14px; line-height:14px; margin:0px; padding:0px;} /*ca table css code*/ .ca_table{width:100%; height:auto; text-align:center;} table{width:100%; border:#ccc 1px solid; border:0px; border-collapse:collapse; border-spacing:0; font-family:"Microsoft Yahei",Arial, Verdana; table-layout:fixed; float:left;} tr{width:100%; height:40px; color:#000; margin:0px; padding:0px; background-color:#fff; border:#ccc 1px solid; border-left-width:0px; border-right-width:0px; border-collapse:collapse; border-spacing:0;} td{border:0px; font-size:12px; color:#333; padding-left:10px; padding-right:0px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .trhead{background-color:#e7e7e7;} .trfoot{background-color:#f6f6f6;} .tra, .trb{background-color:#fff;} .trb{background-color:#f7f7f7;} .trc, .trd{height:auto; border:0px;} .trd{height:40px;} .tre{height:80px; border:0px; border-top:#eee 1px solid;} .tra:hover, .trb:hover, .trd:hover{background-color:#C6E2FF;} .tdhlt, .tdhrt, .tdhmid{text-align:left; border:0px; font-size:13px; line-height:15px; color:#000; white-space:normal;} .tdhrt{text-align:right;} .tdhmid{text-align:center;} .tdlt{text-align:left;} .tdltnoborder{text-align:left; border:0px;} .tdrt{text-align:right;} .tdrtnoborder{text-align:right; border:0px;} .tdmid{text-align:center;} .tdmidnoborder{text-align:center; border:0px;} .tdfoot{height:auto; text-align:left; padding:5px; padding-left:10px; padding-right:10px; border:0px; vertical-align:top;} .tdfootinfo, .pagination{width:100%; height:auto; text-align:left; padding:0px; border:0px; vertical-align:top;} .tdfootdiv, .tdfootdiv2{width:-moz-calc(20% - 20px); width:-webkit-calc(20% - 20px); width:calc(20% - 20px); min-width:300px; height:auto; white-space:normal; text-align:left; padding:5px; padding-left:10px; padding-right:10px; border:0px; vertical-align:top; float:left;} .tdfootdiv2{width:-moz-calc(100% - 20px); width:-webkit-calc(100% - 20px); width:calc(100% - 20px);} .pagination{width:calc(100% - 8px); border:0px; border-bottom:#ccc 1px solid; padding:4px; background-color:#f6f6f6; float:left;} .tbdiv{width:100%; overflow-x:auto; float:left;} .pR{padding-right:10px;} .plast{color:#999;} select{width:auto; height:24px;} .subtb{border:0px;} .subtr{width:100%; height:18px; border:0px;} .subtd{font-size:12px; color:#555; padding:0px; border:0px;} button{width:120px; height:28px; font-family:"Microsoft Yahei",Arial,Verdana; color:#333; float:right; margin-right:5px;} textarea,text{width:240px; height:24px; line-height:22px; font-family:"Microsoft Yahei",Arial,Verdana; font-size:13px; color:#333; float:right; border:#ccc 1px solid; padding-left:5px; margin-right:10px; ime-mode:disabled;} img.mid{vertical-align:middle;} .lnk{width:auto; height:auto; font-size:12px; color:#333; text-decoration:none;} .expand{width:11px; height:11px; margin-top:5px; margin-right:10px; background-image:url(../images/cc_images.png); background-position:0px -90px; background-repeat:no-repeat; float:left; cursor:pointer;} .collapse{background-position:0px -110px;} .tbfootbar{width:auto; height:auto; line-height:33px; float:right; border:0px; background-color:transparent;} .tbfootbar a.select{width:auto; height:23px;line-height:23px; font-size:12px; text-align:left; color:#333; padding-left:7px; padding-right:20px; border:#ccc 1px solid; border-radius:3px; margin:4px; margin-right:5px; background:url(../images/dp.png) bottom right no-repeat; background-color:transparent; display:block; float:left; cursor:pointer;} .tbfootbar a.select:hover{text-decoration:none; border:#bbb 1px solid; border-bottom:#bbb 1px solid; border-right:#bbb 1px solid; -webkit-box-shadow:1px 1px 3px 0px #bbb; box-shadow:1px 1px 3px 0px #bbb; -webkit-transition:all 0.2s ease-in; transition:all 0.2s ease-in;} .tbfootbar ul{width:auto; height:auto; float:left; margin:0px; padding:0px; background-color:transparent; list-style:none;} .tbfootbar li{background-color:transparent; width:auto; height:auto; font-size:12px; float:left; margin:0px; padding:0px;} .tbfootbar li ul{display:none; width:auto; height:auto; max-height:168px; border:#ccc 1px solid; position:absolute; z-index:999; background-color:#fff; margin-left:4px; margin-top:28px; overflow-x:hidden; overflow-y:auto;} .tbfootbar li li {display:block; width:auto; height:auto; float:none; text-align:left;} .tbfootbar li ul li a{width:100%; height:28px; line-height:28px; font-size:12px;text-align:left; color:#333; display:block; padding-left:7px; cursor:pointer;} .tbfootbar li ul li a:hover{text-decoration:none; background-color:#eee;} .tbfootbar li ul li span{width:100%; height:28px; line-height:28px; font-size:12px;text-align:left; color:#333; background-color:#eee; display:block; padding-left:7px; cursor:pointer;} .innertitle span{width:calc(100% - 50px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; float:left;} a.page{width:auto; min-width:23px; height:23px; line-height:23px; padding:0px; font-size:12px; text-align:center; color:#333; background-color:transparent; border:#ccc 1px solid; display:block; float:left; margin:4px; margin-right:5px; border-radius:3px; cursor:pointer;} a.pagebut{width:auto; min-width:23px; height:23px; line-height:21px; padding:0px; font-size:12px; text-align:center; color:#333; background-color:transparent; border:#ccc 1px solid; display:block; float:left; margin:4px; margin-right:5px; border-radius:3px; cursor:pointer; font-family:Verdana,'Microsoft Yahei',Arial;} a.page:hover, a.pagebut:hover{text-decoration:none; border:#bbb 1px solid; border-bottom:#bbb 1px solid; border-right:#bbb 1px solid; -webkit-box-shadow:1px 1px 3px 0px #bbb; box-shadow:1px 1px 3px 0px #bbb; -webkit-transition:all 0.2s ease-in; transition:all 0.2s ease-in;} .page_focus{width:auto; min-width:23px; height:23px; line-height:23px; padding:0px; font-size:12px; text-align:center; color:#39F; background-color:#fff; border:#39F 1px solid; display:block; float:left; margin:4px; margin-right:5px; border-radius:3px;} .sort-default{width:auto; height:auto; font-size:12px; color:#333; text-decoration:none; cursor:pointer; display:inline-block;} .sort-default:hover{text-decoration:none;} .sort-asc, .sort-desc{width:10px; height:10px; margin:0px; margin-left:4px; cursor:pointer; display:inline-block; background-color:transparent; background-image:url(../images/sortbtn.png);} .sort-asc{background-position:0px 0px;} .sort-desc{background-position:0px -10px;} /*ca chart css code*/ .canvasbox, .mapbox{width:auto; height:auto; overflow:hidden; margin:0px; padding-right:0px; padding-bottom:35px; border:0px; border-top:1px #ccc solid; border-bottom:1px #ccc solid;} .mapbox{padding:0px; border:0px;} .pie-legend_holder {width:auto; height:auto; float:none; margin:0px; text-align:left;} .pie-legend {width:auto; height:auto; list-style:none; float:none; margin:0px; padding:0px; text-align:left; font-family:'Microsoft Yahei',Arial,Verdana;} .pie-legend li {display:block; padding-left:30px; position:relative; margin-bottom:3px; margin-left:10px; margin-right:10px; border-radius:3px; padding:1px 0px 1px 24px; font-size:12px; height:15px; line-height:15px; cursor:default; -webkit-transition:background-color 200ms ease-in-out; -moz-transition:background-color 200ms ease-in-out; -o-transition:background-color 200ms ease-in-out; transition:background-color 200ms ease-in-out; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .pie-legend li:hover {background-color:#f7f7f7;} .pie-legend li span {display:block; position:absolute; left:0; top:0; width:16px; height:16px; border-radius:3px;} /*customer tooltip*/ #chartjs-tooltip { width:auto; font-size:13px; line-height:20px; font-family:'Microsoft Yahei',Arial,Verdana; opacity:0; position:absolute; left:-10px; background:rgba(0, 0, 0, 0.8); color:white; padding:3px; padding-left:7px; padding-right:7px; border-radius:3px; -webkit-transition:all .1s ease; transition:all .1s ease; pointer-events:none; -webkit-transform:translate(-50%, 0); transform:translate(-50%, 0); overflow:visible; } #chartjs-tooltip.below { -webkit-transform:translate(-50%, 0); transform:translate(-50%, 0); } #chartjs-tooltip.below:before { border:solid; border-color:#111 transparent; border-color:rgba(0, 0, 0, 0.8) transparent; border-width:0 8px 8px 8px; bottom:1em; content:""; display:block; left:50%; position:absolute; z-index:999999; -webkit-transform:translate(-50%, -100%); } #chartjs-tooltip.above { -webkit-transform:translate(-50%, -100%); transform:translate(-50%, -100%); } #chartjs-tooltip.above:before { border:solid; border-color:#111 transparent; border-color:rgba(0, 0, 0, 0.8) transparent; border-width:8px 8px 0 8px; bottom:1em; content:""; display:block; left:50%; top:100%; position:absolute; z-index:999999; -webkit-transform:translate(-50%, 0); transform:translate(-50%, 0); } ================================================ FILE: css/icontrol.css ================================================ /*! * ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! * * module: Centcount Analytics Free CA Control CSS Code * * version: 1.00 Free * * author: WM Jonssen * * date: 03/12/2018 * * copyright 2015-2018 WM Jonssen - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ @charset "utf-8"; .framespace{width:100%; height:15px;} .frameoptionsites{width:100%; min-width:330px; height:auto; float:none; margin:0px; text-align:left; overflow-x:auto; overflow-y:hidden;} .frameoption{width:auto; height:auto; float:left; margin:12px; margin-bottom:2px; margin-right:0px;} .d_clone{width:auto; height:auto; float:left; border:0px; background-color:transparent; margin-bottom:9px; margin-right:9px;} .d_frame{width:auto; height:32px; font-size:12px; line-height:32px; color:#333; text-align:left; float:left; display:block; margin:3px; border:#ccc 1px solid; z-index:99999; overflow:hidden; background-color:#fff;} .d_frame:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .d_active{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .d_body{width:auto; height:auto; text-align:left; line-height:32px; display:none; padding-left:20px; padding-bottom:10px; overflow-x:hidden; overflow-y:auto;} .d_body a.butok{width:70px; height:24px; line-height:22px; font-size:12px; text-align:center; color:#333; background-color:#F6F6F6; border:#ccc 1px solid; display:inline-block; margin:4px; border-radius:3px;} .d_body a.butok:hover{text-decoration:none; border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .d_refresh{width:32px; height:32px; font-size:12px; line-height:30px; color:#333; text-align:center; float:left; display:block; margin:3px; margin-bottom:13px; margin-right:9px; border:#ccc 1px solid; z-index:99999; background:url(../images/btn.png) no-repeat; background-position: 0px -32px; cursor:pointer; overflow:hidden; background-color:#fff;} .d_refresh:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .d_btn{width:85px; height:24px; line-height:24px; border:#ccc 1px solid; display:block; margin:5px; margin-left:0px; margin-right:15px; text-align:center; color:#555; font-size:12px; border-radius:3px; float:left;} .d_btn:hover{border:#bbb 1px solid; text-decoration:none; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .dd_body{width:auto; height:auto; max-height:480px; text-align:left; line-height:32px; display:none; padding-top:0px; padding-bottom:0px; overflow-x:hidden; overflow-y:auto; border-top:#ccc 1px solid;} .dd_body a{width:auto; height:auto; text-align:left; height:32px; font-size:12px; line-height:32px; display:block; color:#333; background-color:#fff; padding-left:20px; padding-right:20px; white-space:nowrap; text-overflow:ellipsis; cursor:pointer;} .dd_body a.active{background-color:#f6f6f6;} .dd_body a:hover{text-decoration:none; background-color:#eee;} .dd_title{width:auto; height:32px; font-size:12px; color:#333; line-height:32px; text-align:left; padding-left:20px; padding-right:30px; background:url(../images/btn.png) top right no-repeat; cursor:pointer; overflow:hidden; background-color:#fff; white-space:nowrap; text-overflow:ellipsis;} .dp_title{width:auto; height:auto; font-size:12px; color:#333; line-height:32px; text-align:left; padding-left:20px; padding-right:40px; background:url(../images/btn.png) bottom right no-repeat; cursor:pointer; overflow:hidden; background-color:#fff;} .popup{width:auto; height:auto; max-height:480px; text-align:left; line-height:32px; display:block; position:absolute; z-index:99999999999; padding-top:0px; padding-bottom:0px; overflow-x:hidden; overflow-y:auto; border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow:1px 1px 3px 0px #bbb; box-shadow:1px 1px 3px 0px #bbb; background-color:#fff; visibility:hidden;} /*-webkit-transition:all 0.2s ease-in; transition:all 0.2s ease-in; */ .popup a{width:auto; height:auto; text-align:left; height:32px; font-size:12px; line-height:32px; display:block; color:#333; background-color:#fff; padding-left:20px; padding-right:20px; white-space:nowrap; text-overflow:ellipsis; cursor:pointer;} .popup a.active{background-color:#f6f6f6;} .popup a:hover{text-decoration:none; background-color:#eee;} .popup span{width:auto; height:auto; text-align:left; height:36px; font-size:12px; line-height:36px; display:block; color:#333; background-color:#fff; padding-left:20px; padding-right:20px; white-space:nowrap; text-overflow:ellipsis; cursor:default; border-bottom:#ccc 1px solid;} /*calendar*/ .c_body{width:210px; height:auto; float:left; border:#ccc 1px solid; border-bottom:0px; padding:0px; margin-top:10px; margin-bottom:10px; margin-right:20px; display:block;} .c_box{width:210px; height:auto; float:left; background-color:#fff; margin:0px; padding:0px; border-bottom:#ccc 1px solid;} .c_box a{width:30px; height:30px; line-height:28px; font-size:12px; text-align:center; color:#333; background-color:#fff; display:block; float:left; cursor:pointer;} .c_box a:hover{text-decoration:none; background-color:#C6E2FF;} .c_box .focus{width:28px; height:28px; line-height:26px; font-size:12px; text-align:center; color:#39F; background-color:#fff; border:#39F 1px solid; display:block; float:left;} .c_box .focus:hover{background-color:#6CF;} .c_box span{width:30px; height:30px; line-height:28px; font-size:12px; text-align:center; color:#aaa; background-color:#fff; display:block; float:left;} .c_box weekday{width:30px; height:30px; line-height:30px; font-size:12px; text-align:center; color:#aaa; background-color:#FcFcFc; display:block; float:left;} .c_box a.last{width:22px; height:22px; line-height:20px; font-size:12px; text-align:center; color:#333; background-color:#F6F6F6; border:#ccc 1px solid; display:block; float:left; margin:4px; margin-right:5px; background:url(../images/dp.png) top left no-repeat; border-radius:3px;} .c_box a.last:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .c_box a.next{width:22px; height:22px; line-height:20px; font-size:12px; text-align:center; color:#333; background-color:#F6F6F6; border:#ccc 1px solid; display:block; float:left; margin:4px; margin-left:5px; background:url(../images/dp.png) 1px -23px no-repeat; border-radius:3px;} .c_box a.next:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .c_box a.year{width:37px; height:22px;line-height:20px; font-size:12px; text-align:center; color:#333; padding-left:5px; padding-right:20px; border:#ccc 1px solid; border-radius:3px; margin:4px; background:url(../images/dp.png) bottom right no-repeat; background-color:#fff; display:block; float:left; cursor:pointer;} .c_box a.year:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .c_clone{width:auto; height:auto; float:left; border:0px; background-color:transparent; margin:1px; margin-left:2px; margin-right:2px;} .c_frame{width:60px; min-width:60px; height:22px; font-size:12px; line-height:20px; color:#333; text-align:left; float:left; display:block; margin:3px; border:#ccc 1px solid; border-radius:3px; z-index:999999; overflow:hidden; background-color:#fff;} .c_frame:hover{border:#bbb 1px solid; border-bottom:#ccc 1px solid; border-right:#ccc 1px solid; -webkit-box-shadow: 1px 1px 3px 0px #bbb; box-shadow: 1px 1px 3px 0px #bbb; -webkit-transition: all 0.2s ease-in; transition: all 0.2s ease-in;} .cd_body{width:auto; height:auto; max-height:220px; text-align:left; line-height:22px; display:none; padding-top:0px; padding-bottom:10px; overflow-x:hidden; overflow-y:auto; border-top:#ccc 1px solid;} .cd_body a{width:auto; height:auto; text-align:left; height:22px; font-size:12px; line-height:22px; display:block; color:#333; background-color:#fff; padding-left:10px; padding-right:10px; white-space:nowrap; text-overflow:ellipsis;} .cd_body a.active{background-color:#f6f6f6;} .cd_body a:hover{text-decoration:none; background-color:#eee;} .cd_title{width:auto; height:22px; font-size:12px; color:#333; line-height:20px; text-align:center; padding-left:5px; padding-right:22px; background:url(../images/dp.png) bottom right no-repeat; cursor:pointer; overflow:hidden; background-color:#fff; white-space:nowrap; text-overflow:ellipsis;} .c_year{width:auto; height:auto; font-size:12px; font-family:'Microsoft Yahei',Arial,Verdana; text-align:left; color:#aaa; float:left;} .guidebtn,.guidespan{width:auto; height:14px; line-height:14px;color:#4283C4; text-align:center; padding-left:9px; padding-right:11px; font-size:12px; font-family:'Microsoft Yahei',Arial,Verdana; cursor:pointer;} .guidebtn:hover{text-decoration:none;} .guidespan{color:#333;} .c_year ul{width:auto; height:auto; float:left; margin:0px; padding:0px; background-color:#fff; list-style:none;} .c_year li{background-color:#fff; width:auto; height:auto; font-size:12px; float:left; margin:0px; padding:0px;} .c_year li ul{display:none; width:62px; height:auto; max-height:168px; border:#ccc 1px solid; position:absolute; z-index:999; background-color:#fff; margin-left:4px; margin-top:27px; overflow-x:hidden; overflow-y:auto;} .c_year li li {display:block; width:auto; height:24px; float:none; text-align:left;} .c_year li ul li a{width:100%; height:28px; line-height:28px; font-size:12px;text-align:left;display:block;} .c_year li ul li a:hover{text-decoration:none; background-color:#ddd;} /*.c_year li:hover ul{display:block;}*/ ================================================ FILE: css/manager.css ================================================ /*! * ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! * * module: Centcount Analytics Free CA Manager CSS Code * * version: 1.00 Free * * author: WM Jonssen * * date: 03/12/2018 * * copyright 2015-2018 WM Jonssen - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ @charset "utf-8"; body,html{font-size:12px; font-family:'Microsoft Yahei',Arial,Verdana; color:#555; padding:0px; margin:auto; border:0px;} img{border:0px;} a{color:#39F; text-decoration:none;} a:hover{text-decoration:underline;} .taba:hover{color:#000;} .errmsg{display:none; margin:auto;text-align:center; width:auto; height:auto; line-height:18px; margin:0px; margin-bottom:0px; padding:15px; background-color:rgb(242,222,222); color:rgb(181,68,123); font-size:13px; border-radius:5px; border:rgb(235,204,209) 1px solid;} #header{font-size:14px; font-family:'Microsoft Yahei',Arial,Verdana; width:100%; height:auto; min-width:360px; float:left;} .body_left_side{width:100%; max-width:210px; height:100%; min-height:100%; line-height:22px; background-color:#fff; border-right:#ccc 1px solid; transition:all 0.2s ease-in; position:fixed; top:0px; left:0px; margin:auto; text-align:left; overflow:visible; float:left; z-index:99999999;} .body_right_side{width:calc(100% - 211px); height:auto; line-height:22px; text-align:left; transition:all 0.2s ease-in; float:right;} .div_guide_frame{width:100%; height:60px; min-width:300px; float:none; padding:0px; background-color:#fff; border-bottom:#ccc 1px solid; font-size:14px; text-align:center; position:fixed; top:0; left:0; z-index:99999990;} .div_side_menu_bar{width:100%; height:100%; line-height:22px; background-color:#fff; overflow:hidden;} .div_side_menu{width:100%; max-width:195px; height:100%; float:left; padding:15px; padding-left:0px; overflow-y:auto; overflow-x:hidden;} .div_side_menu_hide_btn, .div_side_menu_show_btn{width:15px; height:60px; margin-top:0px; float:right; background:url(../images/switch_btn.png) 0px 0px no-repeat; border:#111 1px solid; border-top:0px; position:absolute; left:210px; top:0; cursor:pointer;} .div_side_menu_show_btn{background:url(../images/switch_btn.png) -15px 0px no-repeat;} .div_logo{width:100%; height:60px; float:left; overflow:hidden; border-bottom:#ccc 1px solid; padding:0px;} .img_logo{width:auto; height:40px; margin-top:10px; margin-left:10px; float:left;} .div_copyright{width:100%; height:40px; font-size:12px; line-height:20px; font-family:Arial,'Microsoft Yahei',Verdana; color:#777; text-align:center; float:left; padding-top:15px; border-top:#ccc 1px solid;} #side_menu ul{width:auto; height:auto; float:none; list-style:none; margin:0px; margin-left:15px; padding:0; display:none; overflow:hidden;} #side_menu li{width:auto; height:auto; line-height:30px; font-size:14px; color:#555; float:none; text-overflow:ellipsis; white-space:nowrap; position:relative; overflow:hidden; cursor:pointer;} #side_menu li:hover{text-decoration:none; color:#000;} #side_menu li a{width:auto; height:30px; line-height:30px; font-size:13px; color:#555; float:none; text-overflow:ellipsis; white-space:nowrap; position:relative; overflow:hidden; display:block;} #side_menu li a:hover{text-decoration:none; color:rgb(16,151,228);} #side_menu .main_menu{font-size:14px; color:#555; background:url(../images/menu1.png) right top no-repeat; padding-right:10px;} #side_menu .menu_hidden{background:url(../images/menu1.png) right top no-repeat; padding-right:10px; cursor:pointer;} #side_menu .menu_shown{background:url(../images/menu1.png) right bottom no-repeat; padding-right:10px; cursor:pointer;} .title{width:auto; height:60px; line-height:60px; font-size:22px; text-align:left; color:#000; float:left; padding-left:30px; font-family:Verdana,Arial,'Microsoft Yahei'; white-space:nowrap;} .guide{width:auto; height:46px; line-height:24px; font-size:12px; text-align:right; color:#aaa; float:right; margin:0px; margin-top:14px; margin-right:10px; overflow:hidden;} .btn_msg, .btn_help, .btn_language, .btn_account{width:32px; height:32px; float:left; margin-left:5px; margin-right:5px; text-align:center; font-size:10px; line-height:30px; color:#F00; background:url(../images/account.png) no-repeat; font-weight:bold; cursor:pointer;} .btn_msg{background-position:0px 0px;} .btn_help{background-position:-32px 0px;} .btn_language{background-position:-64px 0px;} .btn_account{background-position:-96px 0px;} .btn_msg:hover, .btn_help:hover, .btn_language:hover, .btn_account:hover{text-decoration:none;} .sitebar{width:auto; height:50px; line-height:47px; font-size:12px; font-family:Verdana,'Microsoft Yahei',Arial; color:#555; text-align:center; float:right; margin-right:5px;} .menuselect{width:180px; margin-left:10px; margin-right:10px; margin-top:12px; height:26px; vertical-align:middle; color:#777; display:block; float:right; text-align:left; font-size:10px; font-family:Verdana,'Microsoft Yahei',Arial;} .menuoption{height:20px; padding-top:3px; padding-left:5px; vertical-align:middle; color:#333; font-size:12px; font-family:Verdana,'Microsoft Yahei',Arial;} #bodyframe{font-size:14px; font-family:'Microsoft Yahei',Arial,Verdana; width:100%; min-width:360px; height:auto; float:left; border-bottom:#ccc 1px solid; overflow:hidden; margin:auto; text-align:center;} #footer{width:100%; min-width:360px; min-height:35px; font-size:12px; line-height:20px; font-family:Arial,'Microsoft Yahei',Verdana; color:#777; text-align:center; float:left; padding-top:15px;} @media only screen and (max-width: 720px) { .guide{display:none;} } ================================================ FILE: errlog.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ header('Content-type: text/html; charset=utf-8'); @require './config/config_security.php'; @require './config/config_common.php'; if ($_GET) { $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) exit; $db_selected = mysqli_select_db($con, DB_NAME_ERROR); if (!$db_selected) { if (!mysqli_query($con, 'CREATE DATABASE IF NOT EXISTS '.DB_NAME_ERROR.' DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci')) { mysqli_close($con); exit; } $db_selected = mysqli_select_db($con, DB_NAME_ERROR); if (!$db_selected) { mysqli_close($con); exit; } } if (!check_table_exist($con, 'jserror')) { $sql = 'CREATE TABLE IF NOT EXISTS jserror ( pKey int AUTO_INCREMENT NOT NULL PRIMARY KEY, SiteID bigint NOT NULL DEFAULT 0, VID bigint NOT NULL DEFAULT 0, RecordNo bigint NOT NULL DEFAULT 0, ErrorName varchar(128) NOT NULL DEFAULT "", ErrorMsg varchar(1024) NOT NULL DEFAULT "", ErrorPosition varchar(128) NOT NULL DEFAULT "", Referrer varchar(1024) NOT NULL DEFAULT "", Page varchar(1024) NOT NULL DEFAULT "", Agent varchar(512) NOT NULL DEFAULT "", Extra varchar(255) NOT NULL DEFAULT "", IP varchar(15) NOT NULL DEFAULT "", RecordTime varchar(20) NOT NULL DEFAULT "" ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci'; if (!mysqli_query($con, $sql)) { mysqli_close($con); exit; } } $err = 0; isset($_GET['siteid']) ? $siteid = (int)$_GET['siteid'] : $err++; isset($_GET['vid']) ? $vid = (int)$_GET['vid'] : 0; isset($_GET['rn']) ? $rn = (int)$_GET['rn'] : $err++; isset($_GET['name']) ? $name = SDATA($con,$_GET['name'],1,128) : $err++; isset($_GET['msg']) ? $msg = SDATA($con,$_GET['msg'],1,1024) : $err++; isset($_GET['pos']) ? $pos = SDATA($con,$_GET['pos'],1,128) : $err++; isset($_GET['rf']) ? $rf = SDATA($con,$_GET['rf'],1,1024) : $err++; isset($_GET['page']) ? $page = SDATA($con,$_GET['page'],1,1024) : $err++; isset($_GET['agent']) ? $agent = SDATA($con,$_GET['agent'],1,512) : $err++; isset($_GET['ex']) ? $ex = SDATA($con,$_GET['ex'],1,255) : $err++; $ip = get_ip(); if ($err) exit; date_default_timezone_set('PRC'); $now = date('Y-m-d H:i:s', time()); $sql = "INSERT INTO jserror (SiteID,VID,RecordNo,ErrorName,ErrorMsg,ErrorPosition,Referrer,Page,Agent,Extra,IP,RecordTime) VALUES($siteid, $vid, $rn,'{$name}','{$msg}','{$pos}','{$rf}','{$page}','{$agent}','{$ex}','{$ip}','{$now}')"; mysqli_query($con, $sql); mysqli_close($con); autoresponse($siteid,$rn,$vid,$name,$msg,$pos,$rf,$page,$agent,$ex,$ip,$now); } function autoresponse($siteid,$rn,$vid,$name,$msg,$pos,$rf,$page,$agent,$ex,$ip,$now){ $subject = "Notification of CA JS Error"; $message = " CA JS Error "; $headers = "MIME-Version: 1.0\r\n". "Content-type: text/html; charset=utf-8\r\n". "From:Hi,
You received a notification message from JS CA Error Log
Details:
Site ID: ".$siteid. "
VID: ".$vid. "
Record No: ".$rn. "
Error Name: ". $name . "
Error Msg: ". $msg . "
Error Position: ". $pos . "
Referrer: ". $rf . "
Page: ". $page . "
Agent: ". $agent . "
Extra: ". $ex . "
IP: ". $ip . "
Remote IP: ". $_SERVER['REMOTE_ADDR'] . "
Log Time: ". $now ."
Regards,
Centcount Team
This is an auto-response mail. Please do not reply.
"; return mail(ADMIN_MAIL, $subject, $message, $headers); } function get_ip() { foreach (array('REMOTE_ADDR') as $key) { if (array_key_exists($key, $_SERVER)) { foreach (explode(',', $_SERVER[$key]) as $ip) { if ((bool) filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) return $ip; } } } return ''; } function check_table($con, $tb, $db) { $ret = false; $sql = 'SHOW TABLES FROM ' . $db; $result = mysqli_query($con, $sql); if ($result && mysqli_num_rows($result)) { while ($row = mysqli_fetch_row($result)) { if ($row[0] == $tb){ $ret = true; break; } } mysqli_free_result($result); } return $ret; } function check_table_exist($con, $cTB) { $result = mysqli_query($con, "SHOW TABLES LIKE '{$cTB}'"); if ($result && mysqli_num_rows($result)) { mysqli_free_result($result); return true; } return false; } function SDATA($con, $val, $opt, $maxL, $minL=0) { switch ($opt) { case 1://string with sanitize & check length, use sanitized data $val = rawurldecode($val); $encoding = mb_detect_encoding($val, 'UTF-8, GB18030', true); switch ($encoding) { case 'UTF-8': break; case 'GB18030': $val = mb_convert_encoding($val, 'UTF-8', 'GB18030'); break; default: $val = mb_convert_encoding($val, 'UTF-8', 'UTF-8'); break; } if (mb_detect_encoding($val, 'UTF-8', true) === false) return ''; $val = filter_var($val, FILTER_SANITIZE_STRING); $val = mysqli_real_escape_string($con, $val); if (mb_strlen($val,'UTF-8') > $maxL) { return mb_substr($val, 0, $maxL, 'UTF-8'); } else { return $val; } case 2://format int data and check length $tmp = (int)$val; return ($tmp > $maxL || $tmp < $minL) ? $def : $tmp; } return NULL; } ?> ================================================ FILE: forgot.php ================================================ - All rights reserved.* * license: Dual licensed under the Free License and Commercial License. * * https://www.centcount.com * */ session_name('CASESSID'); session_start(); header('Content-type: text/html; charset=utf-8'); @require './config/config_security.php'; @require './config/config_common.php'; require 'language.php'; require 'html.php'; $success = 0; $err = ''; if ($_POST) { if (empty($_POST['email'])) { $err .= '
' . $GLOBALS['language']['RegErrEmail1'];//'Email must not be empty'; } else if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $err .= '
' . $GLOBALS['language']['RegErrEmail2'];//'Email is not valid'; } $vcode = empty($_SESSION['vcode']) ? '' : $_SESSION['vcode']; $_SESSION['vcode'] = mt_rand(1E6,1E9); if (empty($_POST['captcha'])) { $err .= '
' . $GLOBALS['language']['RegErrCaptcha1'];//'
Captcha must not be empty'; } else if (strlen($_POST['captcha']) !== 4) { $err .= '
' . $GLOBALS['language']['RegErrCaptcha2'];//'
Captcha must be 4 characters long'; } else if ($vcode !== strtolower($_POST['captcha']) || $vcode === '') { $err .= '
' . $GLOBALS['language']['RegErrCaptcha3'];//'
Wrong captcha'; } if ($err === '') { $err = forgot($_POST['email'], $success); } if (substr($err, 0, 5) === '
') $err = substr($err, 5); } function forgot($user, &$success) { $err = ''; $con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL); if (mysqli_connect_errno($con)) { $err = 'Could not connect mysql host. Please contact Administrator!'; return $err; } $user = mysqli_real_escape_string($con, $user); $db_selected = mysqli_select_db($con, DB_NAME_USER); if (!$db_selected) { $err = '
Could not use database. Please contact Administrator!'; mysqli_close($con); return $err; } //check useremail $result = mysqli_query($con, "SELECT * FROM User WHERE Username='{$user}'"); if (mysqli_num_rows($result) == 1) { while ($row = mysqli_fetch_assoc($result)) { $apw = $row['Password']; $actived = $row['Activated']; $id = $row['UserID']; break; } mysqli_free_result($result); } else { $err = '
' . $GLOBALS['language']['ForgotFailed1'];//Email is not exist. Error No: 3001 mysqli_close($con); return $err; } $ActivateCode = mt_rand(1E8,2E9); $CreateTime = time(); $ActivateTime = $CreateTime + 604800;//7*24*60*60; //reset password $sql = "UPDATE User SET ActivateCode=$ActivateCode, ActivateTime=$ActivateTime WHERE Username='{$user}'"; if (mysqli_query($con, $sql)) { if (autoresponse($user, $id, $ActivateCode)) { $err .= '
' . $GLOBALS['language']['ForgotSuccess1'];//Request was successfully! Please check the verify-mail to reset new password within 7 days $success = 1; } else { $err .= '
' . $GLOBALS['language']['ForgotFailed2'];//Send verify email failed! Please try again or send error information to us. Error No: 3002 } } else { $err .= '
' . $GLOBALS['language']['ForgotFailed3'];//Request was failed, Error No: 3003 } mysqli_close($con); return $err; } function autoresponse($to, $cc_id, $cc_code) { $subject = 'Customer Password-Reset Request'; $v_url = 'http://' . $_SERVER['HTTP_HOST'] . '/reset_pw.php?id=' . $cc_id . '&vcode=' . $cc_code . '&rnd=' . mt_rand(1E6,1E9); $message = "Customer Password-Reset Request "; // 当发送 HTML 电子邮件时,请始终设置 content-type $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; // 更多报头 $headers .= 'From: <' . AUTORESPONSE_MAIL . '>'; $ret = mail($to, $subject, $message, $headers); return $ret; } ?>Hi,
You're receiving this e-mail because you requested a password reset for your user account at Centcount
Click on the following link to reset a new password
" . $v_url . "
Regards,
Centcount Team
This is an auto-response mail. Please do not reply.
Centcount Analytics - Forgot Password '.$err.'' : ''); ?>