uninstall.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /*
  3. * Install Uninstall Upgrade AutoStat System Code 2017040223vYV23HJDj3
  4. * This is NOT a freeware, use is subject to license terms
  5. * From www.1314study.com
  6. */
  7. if(!defined('IN_ADMINCP')) {
  8. exit('Access Denied');
  9. }
  10. require_once DISCUZ_ROOT.'./source/discuz_version.php';
  11. require_once 'installlang.lang.php';
  12. $request_url = str_replace('&step='.$_GET['step'],'',$_SERVER['QUERY_STRING']);
  13. //3.1以后版本直接跳到删除数据库
  14. if(str_replace('X', '', DISCUZ_VERSION) >= 3.1){
  15. $_GET['step'] = 'sql';
  16. $_GET['deletesql'] = '2017040223vYV23HJDj3';
  17. }
  18. empty($pluginarray['plugin']) && $pluginarray['plugin'] = $plugin;
  19. $identifier = $identifier ? $identifier : $pluginarray['plugin']['identifier'];
  20. $available = dfsockopen('http://addon.1314study.com/api/available.php?siteurl='.rawurlencode($_G['siteurl']).'&identifier='.$identifier);
  21. if($available == 'succeed'){
  22. $available = 1;
  23. }else{
  24. $available = 0;
  25. }
  26. //$sql = <<<EOF
  27. //DROP TABLE IF EXISTS cdb_study_demo;
  28. //EOF;
  29. //runquery($sql);
  30. $_statInfo = array();
  31. $_statInfo['pluginName'] = $pluginarray['plugin']['identifier'];
  32. $_statInfo['pluginVersion'] = $pluginarray['plugin']['version'];
  33. $_statInfo['bbsVersion'] = DISCUZ_VERSION;
  34. $_statInfo['bbsRelease'] = DISCUZ_RELEASE;
  35. $_statInfo['timestamp'] = TIMESTAMP;
  36. $_statInfo['bbsUrl'] = $_G['siteurl'];
  37. $_statInfo['SiteUrl'] = 'http://bbs.9026.com/';
  38. $_statInfo['ClientUrl'] = 'http://www.9026.com/';
  39. $_statInfo['SiteID'] = 'CAC3A6DA-13A8-9E17-F159-85D92EDD916A';
  40. $_statInfo['bbsAdminEMail'] = $_G['setting']['adminemail'];
  41. $_statInfo['action'] = 'uninstall';
  42. $_statInfo['genuine'] = splugin_genuine($pluginarray['plugin']['identifier']);
  43. $_statInfo = base64_encode(serialize($_statInfo));
  44. $_md5Check = md5($_statInfo);
  45. $StatUrl = 'http://addon.1314study.com/stat.php';
  46. $_StatUrl = $StatUrl.'?info='.$_statInfo.'&md5check='.$_md5Check;
  47. dfsockopen($_StatUrl, 0, '', '', false, '', 999);
  48. $_statInfo = array();
  49. $_statInfo['pluginName'] = $pluginarray['plugin']['identifier'];
  50. $_statInfo['bbsVersion'] = DISCUZ_VERSION;
  51. $_statInfo['bbsUrl'] = $_G['siteurl'];
  52. $_statInfo['action'] = 'uninstall';
  53. $_statInfo['nextUrl'] = ADMINSCRIPT.'?'.$request_url;
  54. $_statInfo = base64_encode(serialize($_statInfo));
  55. $_md5Check = md5($_statInfo);
  56. $_StatUrl = 'http://addon.1314study.com/api/outer_addon.php?type=js&info='.$_statInfo.'&md5check='.$_md5Check;
  57. if(preg_match("/^[a-z]+[a-z0-9_]*$/i", $identifier)){
  58. if(function_exists('cron_delete')) {
  59. cron_delete($identifier);
  60. }
  61. loadcache('pluginlanguage_install', 1);
  62. if(!empty($_G['cache']['pluginlanguage_install']) && isset($_G['cache']['pluginlanguage_install'][$identifier])) {
  63. unset($_G['cache']['pluginlanguage_install'][$identifier]);
  64. savecache('pluginlanguage_install', $_G['cache']['pluginlanguage_install']);
  65. }
  66. cloudaddons_uninstall($identifier.'.plugin', DISCUZ_ROOT.'./source/plugin/'.$identifier);
  67. }
  68. C::t('common_syscache')->delete('scache_'.$pluginarray['plugin']['identifier']);
  69. cpmsg('plugins_delete_succeed', $_StatUrl, 'succeed');