PageRenderTime 32ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/firstrend/src/admin/Lib/Action/IntegrateAction.class.php

http://ownerpress.googlecode.com/
PHP | 718 lines | 474 code | 96 blank | 148 comment | 74 complexity | e7f1496e7235c9549f8d2e73025b0d7b MD5 | raw file
Possible License(s): Apache-2.0, AGPL-1.0, GPL-2.0, GPL-3.0, LGPL-2.1
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Fanwe ???????? (Build on ThinkPHP)
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2009 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author:
  10. // +----------------------------------------------------------------------
  11. class IntegrateAction extends CommonAction{
  12. /**
  13. * ???????????????
  14. *
  15. * @access public
  16. * @param string $directory ???????
  17. * @return array
  18. */
  19. function read_modules($directory = '.')
  20. {
  21. $dir = @opendir($directory);
  22. $set_modules = true;
  23. $modules = array();
  24. while (false !== ($file = @readdir($dir)))
  25. {
  26. if (preg_match("/^.*?\.php$/", $file))
  27. {
  28. include_once($directory. '/' .$file);
  29. }
  30. }
  31. @closedir($dir);
  32. unset($set_modules);
  33. foreach ($modules AS $key => $value)
  34. {
  35. ksort($modules[$key]);
  36. }
  37. ksort($modules);
  38. return $modules;
  39. }
  40. /**
  41. * ?????????
  42. *
  43. * @access public
  44. * @param
  45. *
  46. * @return void
  47. */
  48. function get_charset_list()
  49. {
  50. return array(
  51. 'utf8' => 'UTF-8',
  52. 'gbk' => 'GB2312/GBK',
  53. 'big5' => 'BIG5',
  54. );
  55. }
  56. /**
  57. * ???????????
  58. *
  59. * @access public
  60. * @param string $file_path ????
  61. * @param bool $rename_prv ??????????????rename()?????
  62. *
  63. * @return int ?????????{0 <= x <= 15}??????????????????????
  64. * ??????????????????????
  65. * ???rename()????????????????????????????????
  66. */
  67. function file_mode_info($file_path)
  68. {
  69. /* ?????????????????? */
  70. if (!file_exists($file_path))
  71. {
  72. return false;
  73. }
  74. $mark = 0;
  75. if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
  76. {
  77. /* ???? */
  78. $test_file = $file_path . '/cf_test.txt';
  79. /* ????? */
  80. if (is_dir($file_path))
  81. {
  82. /* ???????? */
  83. $dir = @opendir($file_path);
  84. if ($dir === false)
  85. {
  86. return $mark; //???????????????????????????
  87. }
  88. if (@readdir($dir) !== false)
  89. {
  90. $mark ^= 1; //???? 001?????? 000
  91. }
  92. @closedir($dir);
  93. /* ???????? */
  94. $fp = @fopen($test_file, 'wb');
  95. if ($fp === false)
  96. {
  97. return $mark; //???????????????????
  98. }
  99. if (@fwrite($fp, 'directory access testing.') !== false)
  100. {
  101. $mark ^= 2; //??????011???????? 010
  102. }
  103. @fclose($fp);
  104. @unlink($test_file);
  105. /* ????????? */
  106. $fp = @fopen($test_file, 'ab+');
  107. if ($fp === false)
  108. {
  109. return $mark;
  110. }
  111. if (@fwrite($fp, "modify test.\r\n") !== false)
  112. {
  113. $mark ^= 4;
  114. }
  115. @fclose($fp);
  116. /* ??????????rename()????? */
  117. if (@rename($test_file, $test_file) !== false)
  118. {
  119. $mark ^= 8;
  120. }
  121. @unlink($test_file);
  122. }
  123. /* ????? */
  124. elseif (is_file($file_path))
  125. {
  126. /* ?????? */
  127. $fp = @fopen($file_path, 'rb');
  128. if ($fp)
  129. {
  130. $mark ^= 1; //?? 001
  131. }
  132. @fclose($fp);
  133. /* ?????? */
  134. $fp = @fopen($file_path, 'ab+');
  135. if ($fp && @fwrite($fp, '') !== false)
  136. {
  137. $mark ^= 6; //??????? 111?????????011...
  138. }
  139. @fclose($fp);
  140. /* ??????????rename()????? */
  141. if (@rename($test_file, $test_file) !== false)
  142. {
  143. $mark ^= 8;
  144. }
  145. }
  146. }
  147. else
  148. {
  149. if (@is_readable($file_path))
  150. {
  151. $mark ^= 1;
  152. }
  153. if (@is_writable($file_path))
  154. {
  155. $mark ^= 14;
  156. }
  157. }
  158. return $mark;
  159. }
  160. /**
  161. *
  162. *
  163. * @access public
  164. * @param
  165. *
  166. * @return void
  167. */
  168. function save_integrate_config ($code, $user_field, $cfg)
  169. {
  170. $sql = "SELECT COUNT(*) as number FROM ".C("DB_PREFIX")."sys_conf WHERE name = 'INTEGRATE_CODE'";
  171. $number = M()->query($sql);
  172. if (intval($number[0]['number']) == 0)
  173. {
  174. $sql = "INSERT INTO ".C("DB_PREFIX")."sys_conf(name, is_show, status, val) VALUES ('INTEGRATE_CODE', 0, 1,'$code')";
  175. }
  176. else
  177. {
  178. $sql = "SELECT val FROM ".C("DB_PREFIX")."sys_conf WHERE name = 'INTEGRATE_CODE'";
  179. $tmp = M()->query($sql);
  180. $sql = "UPDATE ".C("DB_PREFIX")."sys_conf SET val = '$code' WHERE name = 'INTEGRATE_CODE'";
  181. }
  182. M()->query($sql);
  183. /* ????? */
  184. if (isset($_SERVER['HTTP_X_FORWARDED_HOST']))
  185. {
  186. $cur_domain = $_SERVER['HTTP_X_FORWARDED_HOST'];
  187. }
  188. elseif (isset($_SERVER['HTTP_HOST']))
  189. {
  190. $cur_domain = $_SERVER['HTTP_HOST'];
  191. }
  192. else
  193. {
  194. if (isset($_SERVER['SERVER_NAME']))
  195. {
  196. $cur_domain = $_SERVER['SERVER_NAME'];
  197. }
  198. elseif (isset($_SERVER['SERVER_ADDR']))
  199. {
  200. $cur_domain = $_SERVER['SERVER_ADDR'];
  201. }
  202. }
  203. /* ??????? */
  204. $int_domain = str_replace(array('http://', 'https://'), array('', ''), $cfg['integrate_url']);
  205. if (strrpos($int_domain, '/'))
  206. {
  207. $int_domain = substr($int_domain, 0, strrpos($int_domain, '/'));
  208. }
  209. if ($cur_domain != $int_domain)
  210. {
  211. $same_domain = true;
  212. $domain = '';
  213. /* ??????????????? */
  214. $cur_domain_arr = explode(".", $cur_domain);
  215. $int_domain_arr = explode(".", $int_domain);
  216. if (count($cur_domain_arr) != count($int_domain_arr) || $cur_domain_arr[0] == '' || $int_domain_arr[0] == '')
  217. {
  218. /* ??????? */
  219. $same_domain = false;
  220. }
  221. else
  222. {
  223. /* ???????????????????????? */
  224. $count = count($cur_domain_arr);
  225. for ($i = 1; $i < $count; $i++)
  226. {
  227. if ($cur_domain_arr[$i] != $int_domain_arr[$i])
  228. {
  229. $domain = '';
  230. $same_domain = false;
  231. break;
  232. }
  233. else
  234. {
  235. $domain .= ".$cur_domain_arr[$i]";
  236. }
  237. }
  238. }
  239. if ($same_domain == false)
  240. {
  241. /* ???????????? */
  242. $cfg['cookie_domain'] = '';
  243. $cfg['cookie_path'] = '/';
  244. }
  245. else
  246. {
  247. $cfg['cookie_domain'] = $domain;
  248. $cfg['cookie_path'] = '/';
  249. }
  250. }
  251. else
  252. {
  253. $cfg['cookie_domain'] = '';
  254. $cfg['cookie_path'] = '/';
  255. }
  256. $sql = "SELECT COUNT(*) as number FROM ".C("DB_PREFIX")."sys_conf WHERE name = 'INTEGRATE_CONFIG'";
  257. $number = M()->query($sql);
  258. if (intval($number[0]['number']) == 0)
  259. {
  260. $sql = "INSERT INTO ".C("DB_PREFIX")."sys_conf (name, is_show, status, val) ".
  261. "VALUES ('INTEGRATE_CONFIG', 0, 1, '" . serialize($cfg) . "')";
  262. }
  263. else
  264. {
  265. $sql = "UPDATE ".C("DB_PREFIX")."sys_conf SET val='". serialize($cfg) ."' ".
  266. "WHERE name='INTEGRATE_CONFIG'";
  267. }
  268. M()->query($sql);
  269. $sql = "SELECT COUNT(*) as number FROM ".C("DB_PREFIX")."sys_conf WHERE name = 'INTEGRATE_FIELD_ID'";
  270. $number = M()->query($sql);
  271. if (intval($number[0]['number']) == 0)
  272. {
  273. $sql = "INSERT INTO ".C("DB_PREFIX")."sys_conf (name, is_show, status, val) ".
  274. "VALUES ('INTEGRATE_FIELD_ID', 0, 1, '" . $user_field . "')";
  275. }
  276. else
  277. {
  278. $sql = "UPDATE ".C("DB_PREFIX")."sys_conf SET val='". $user_field ."' ".
  279. "WHERE name='INTEGRATE_FIELD_ID'";
  280. }
  281. M()->query($sql);
  282. return true;
  283. }
  284. public function index() {
  285. //echo FANWE_ROOT.'core/include/integrates';
  286. $modules = $this->read_modules(FANWE_ROOT.'core/include/integrates');
  287. //dump($modules);exit;
  288. $code = fanweC('INTEGRATE_CODE');
  289. //dump($code);
  290. for ($i = 0; $i < count($modules); $i++)
  291. {
  292. $modules[$i]['installed'] = ($modules[$i]['code'] == $code) ? 1 : 0;
  293. }
  294. $allow_set_points = fanweC('INTEGRATE_CODE') == 'fanwe' ? 0 : 1;
  295. $allow_set_points = 0;
  296. $this->assign('allow_set_points', $allow_set_points);
  297. $this->assign('modules', $modules);
  298. //dump($modules);
  299. //assign_query_info();
  300. //$this->display('integrates_list.htm');
  301. $this->display ();
  302. }
  303. /*------------------------------------------------------ */
  304. //-- ??????????
  305. /*------------------------------------------------------ */
  306. public function install()
  307. {
  308. /* ??ucenter??????uc_client?uc_client/data???? */
  309. if ($_GET['code'] == 'ucenter')
  310. {
  311. $uc_client_dir = $this->file_mode_info(FANWE_ROOT. 'uc_client/data');
  312. if ($uc_client_dir === false)
  313. {
  314. $this->error('uc_client?????????uc_client???????????????');
  315. //return;
  316. }
  317. if ($uc_client_dir < 7)
  318. {
  319. $this->error ('uc_client/data?????????uc_client/data???????777');
  320. //return;
  321. }
  322. //eval()
  323. $a = M()->query('select user_name from '.C("DB_PREFIX").'user group by user_name having count(*) > 1');
  324. if (!empty($a)){
  325. $this->error ('???????????????.<br>'.M('User')->getLastSql());
  326. }
  327. }
  328. if ($_GET['code'] == 'fanwe')
  329. {
  330. D("SysConf")->where("status=1 and name='INTEGRATE_CODE'")->setField("val", "fanwe");
  331. D("SysConf")->where("status=1 and name='INTEGRATE_FIELD_ID'")->setField("val", "uid");
  332. D("SysConf")->where("status=1 and name='POINTS_RULE'")->setField("val", "");
  333. //clear_cache_files();
  334. clearCache();
  335. $this->assign ('jumpUrl', u('Integrate/index'));
  336. $this->success ( '???????????????');
  337. return;
  338. }
  339. else
  340. {
  341. //D("User")->where("sync_flag > 0")->setField(array("sync_flag","nickname"), array("0",""));
  342. $set_modules = true;
  343. include_once(FANWE_ROOT.'core/include/integrates/'.$_GET['code'].".php");
  344. $set_modules = false;
  345. $cfg = $modules[0]['default'];
  346. $cfg['integrate_url'] = "http://";
  347. if (empty($cfg['db_charset']))
  348. $cfg['db_charset'] = 'UTF-8';
  349. $this->assign('cfg', $cfg);
  350. $this->assign('save', 0);
  351. $this->assign('set_list', $this->get_charset_list());
  352. $this->assign('code', $_GET['code']);
  353. $this->assign('user_field', $modules[0]['user_field']);
  354. //dump($this->get_charset_list());
  355. $this->display("install");
  356. }
  357. }
  358. /*------------------------------------------------------ */
  359. //-- ??UCenter??
  360. /*------------------------------------------------------ */
  361. public function setup_ucenter()
  362. {
  363. require_once(FANWE_ROOT.'core/class/transport.class.php');
  364. $result = array('status' => 0, 'info' => '', 'data' => '');
  365. $app_type = 'OTHER';
  366. $app_name = 'FANWE';//fanweC('SHOP_NAME'); //$db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . " WHERE code = 'shop_name'");
  367. $app_url = 'http://'.$_SERVER['HTTP_HOST'].__ROOT__;
  368. $app_charset = 'UTF-8';
  369. $app_dbcharset = strtolower((str_replace('-', '', 'UTF-8')));
  370. $ucapi = trim($_REQUEST['uc_url']);
  371. $ucfounderpw = trim($_REQUEST['uc_pass']);
  372. $postdata ="m=app&a=add&ucfounder=&ucfounderpw=".urlencode($ucfounderpw)."&apptype=".urlencode($app_type).
  373. "&appname=".urlencode($app_name)."&appurl=".urlencode($app_url)."&appip=&appcharset=".$app_charset.
  374. '&appdbcharset='.$app_dbcharset;
  375. $t = new transport;
  376. $ucconfig = $t->request($ucapi.'/index.php', $postdata);
  377. // dump($ucconfig);exit;
  378. $ucconfig = $ucconfig['body'];
  379. if(empty($ucconfig))
  380. {
  381. //ucenter ????
  382. $result['error'] = 1;
  383. $result['info'] = '????:'.$ucapi.'/index.php?'.$postdata;
  384. }
  385. elseif($ucconfig == '-1')
  386. {
  387. //???????
  388. $result['error'] = 1;
  389. $result['info'] = '???????';
  390. }
  391. else
  392. {
  393. list($appauthkey, $appid) = explode('|', $ucconfig);
  394. if(empty($appauthkey) || empty($appid))
  395. {
  396. //ucenter ??????
  397. $result['error'] = 1;
  398. $result['info'] = '??????:'.$ucconfig;
  399. }
  400. else
  401. {
  402. $result['error'] = 0;
  403. $result['data'] = $ucconfig;
  404. $result['info'] = '??????????';
  405. }
  406. }
  407. return $result;
  408. }
  409. /*------------------------------------------------------ */
  410. //-- ?????UCenter?????
  411. /*------------------------------------------------------ */
  412. public function save_uc_config_first()
  413. {
  414. $result = $this->setup_ucenter();
  415. if ($result['error'] == 1)
  416. $this->error($result['info']);
  417. $ucconfig = $result['data'];
  418. $user_field = $_REQUEST['user_field'];
  419. $code = $_REQUEST['code'];
  420. //echo $ucconfig; exit;
  421. list($appauthkey, $appid, $ucdbhost, $ucdbname, $ucdbuser, $ucdbpw, $ucdbcharset, $uctablepre, $uccharset, $ucapi, $ucip) = explode('|', $ucconfig);
  422. $uc_url = !empty($ucapi)? $ucapi : trim($_REQUEST['uc_url']);
  423. $cfg = array(
  424. 'uc_id' => $appid,
  425. 'uc_key' => $appauthkey,
  426. 'uc_url' => $uc_url,
  427. 'uc_ip' => '',
  428. 'uc_connect' => 'post',
  429. 'uc_charset' => $uccharset,
  430. 'db_host' => $ucdbhost,
  431. 'db_user' => $ucdbuser,
  432. 'db_name' => $ucdbname,
  433. 'db_pass' => $ucdbpw,
  434. 'db_pre' => $uctablepre,
  435. 'db_charset' => strtolower($ucdbcharset),
  436. );
  437. /* ??UC??? */
  438. //$cfg['uc_lang'] = $_LANG['uc_lang'];
  439. /* ?????????????? */
  440. $_SESSION['cfg'] = $cfg;
  441. $_SESSION['code'] = $code;
  442. /* ?????? */
  443. if ($_POST['save'] == 1)
  444. {
  445. if ($this->save_integrate_config($code, $user_field, $cfg))
  446. {
  447. $this->assign ('jumpUrl', U('Integrate/index'));
  448. $this->success ('????!');
  449. }
  450. else
  451. {
  452. $this->assign ('jumpUrl', U('Integrate/index'));
  453. $this->error('????!');
  454. }
  455. }
  456. /* ?????? */
  457. $this->save_integrate_config($code, $user_field, $cfg);
  458. //include_once(VENDOR_PATH."mysql.php");
  459. //$ucdb = new cls_mysql($cfg['db_host'], $cfg['db_user'], $cfg['db_pass'], $cfg['db_name'], $cfg['db_charset'], null, 1);
  460. $user_startid_intro = "?????????????????";
  461. $this->assign('user_startid_intro', $user_startid_intro);
  462. //$this->assign('user_startid_intro', "??????ID?".$user_maxid."; UC????ID?".$maxuid."?<br>?? ID ? 888 ?????? ".$maxuid."+888 ???");
  463. $this->display('uc_import');
  464. }
  465. /*------------------------------------------------------ */
  466. //-- ??UCenter?????
  467. /*------------------------------------------------------ */
  468. public function save_uc_config()
  469. {
  470. $code = $_POST['code'];
  471. $user_field = $_POST['user_field'];
  472. $cfg = unserialize(fanweC('INTEGRATE_CONFIG'));
  473. if ($_POST['cfg']['uc_connect'] == 'mysql'){
  474. include_once(VENDOR_PATH."integrates/".$code.".php");
  475. $_POST['cfg']['quiet'] = 1;
  476. $cls_user = new $code ($_POST['cfg']);
  477. if ($cls_user->error)
  478. {
  479. if ($cls_user->error == 1)
  480. {
  481. $this->error('??????????????');
  482. }
  483. elseif ($cls_user->error == 2)
  484. {
  485. $this->error('?????????????????????');
  486. }
  487. elseif ($cls_user->error == 1049)
  488. {
  489. $this->error('??????');
  490. }
  491. else
  492. {
  493. sys_msg($cls_user->db->error());
  494. }
  495. }
  496. }
  497. /* ????????? */
  498. $cfg = array_merge($cfg, $_POST['cfg']);
  499. /* ?????? */
  500. if ($this->save_integrate_config($code, $user_field, $cfg))
  501. {
  502. $this->assign ('jumpUrl', U('Integrate/index'));
  503. $this->success('????!');
  504. }
  505. else
  506. {
  507. $this->assign ('jumpUrl', U('Integrate/index'));
  508. $this->error('????!');
  509. }
  510. }
  511. public function import_user()
  512. {
  513. //???????????????????????????
  514. ini_set("memory_limit","100M");
  515. $cfg = unserialize(fanweC('INTEGRATE_CONFIG'));// INTEGRATE_CONFIG $_SESSION['cfg'];
  516. //echo VENDOR_PATH."mysql.php"; exit;
  517. //include_once(VENDOR_PATH."mysql.php");
  518. /*
  519. //include_once(__ROOT__."/app/source/class/mysql_db.php");
  520. include_once(FANWE_ROOT."/core/class/db.class.php");
  521. include_once(FANWE_ROOT."/core/class/mysql.class.php");
  522. $db_cfg = array(
  523. 'DB_HOST'=>$cfg['db_host'],
  524. 'DB_NAME'=>$cfg['db_name'],
  525. 'DB_USER'=>$cfg['db_user'],
  526. 'DB_PWD'=>$cfg['db_pass'],
  527. 'DB_PORT'=>3306,
  528. 'DB_PREFIX'=>$cfg['db_pre'],
  529. );
  530. $class = 'FDbMySql';
  531. $ucdb = &FDB::object($class);
  532. $ucdb->setConfig($db_cfg);
  533. $ucdb->connect();
  534. */
  535. $db_cfg = array(
  536. 'dbhost'=>$cfg['db_host'],
  537. 'dbname'=>$cfg['db_name'],
  538. 'dbuser'=>$cfg['db_user'],
  539. 'dbpwd'=>$cfg['db_pass'],
  540. 'dbcharset'=>$cfg['db_charset'],
  541. 'pconnect'=>'',
  542. );
  543. Vendor('mysql');
  544. $ucdb = new mysqldb($db_cfg);
  545. //dump($ucdb); exit;
  546. Log::record("==================uc???? begin======================");
  547. $item_list = M()->query("SELECT uid as id,user_name,password as user_pwd, ucenter_id, email, '' as last_ip,reg_time as create_time FROM " . C("DB_PREFIX") . "user ORDER BY `id` ASC");
  548. foreach ($item_list AS $data)
  549. {
  550. $salt = rand(100000, 999999);
  551. $password = md5($data['user_pwd'].$salt); //uc?????md5(md5(??)+???)
  552. if (strtolower($cfg['db_charset']) == 'gbk'){
  553. $data['username'] = addslashes(utf8ToGB($data['user_name']));
  554. }else{
  555. $data['username'] = addslashes($data['user_name']);
  556. }
  557. $uc_userinfo = $ucdb->fetchFirst("SELECT `uid`, `password`, `salt` FROM ".$cfg['db_pre']."members WHERE `username`='$data[username]'");
  558. //dump($uc_userinfo);
  559. if(!$uc_userinfo) //???uc????????????UC?
  560. {
  561. $ucdb->query("INSERT INTO ".$cfg['db_pre']."members SET username='$data[username]', password='$password', email='$data[email]', regip='$data[last_ip]', regdate='$data[create_time]', salt='$salt'", 'SILENT');
  562. $lastuid = $ucdb->insertId();
  563. $ucdb->query("INSERT INTO ".$cfg['db_pre']."memberfields SET uid='$lastuid'",'SILENT');
  564. M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`='" . $lastuid . "' WHERE `uid`='" . $data['id'] . "'");
  565. //Log::record("INSERT INTO ".$cfg['db_pre']."members SET username='$data[username]', password='$password', email='$data[email]', regip='$data[last_ip]', regdate='$data[create_time]', salt='$salt'");
  566. //Log::record("INSERT INTO ".$cfg['db_pre']."memberfields SET uid='$lastuid'");
  567. //M()->query("UPDATE " . C("DB_PREFIX") . "user SET `id`= $lastuid "." where id = ".$data['id']);
  568. }
  569. else
  570. {
  571. M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`='" . $uc_userinfo['uid'] . "' WHERE `uid`='" . $data['id'] . "'");
  572. /*
  573. if ($merge_method == 1)//1:??UC??????????????????
  574. {
  575. if (md5($data['user_pwd'].$uc_userinfo['salt']) == $uc_userinfo['password'])
  576. {
  577. //$merge_uid[] = $data['id'];
  578. $uc_uid[] = array('user_id' => $data['id'], //???ID
  579. 'uid' => $uc_userinfo['uid'] //???ID
  580. );
  581. continue;
  582. }
  583. }
  584. */
  585. $ucdb->query("REPLACE INTO ".$cfg['db_pre']."mergemembers SET appid='".UC_APPID."', username='$data[username]'", 'SILENT');
  586. //Log::record("REPLACE INTO ".$cfg['db_pre']."mergemembers SET appid='".UC_APPID."', username='$data[username]'");
  587. }
  588. }
  589. //M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`= ucenter_id_tmp");
  590. //Log::record("==================uc???? end======================");
  591. //Log::save();
  592. clearCache();
  593. $this->assign ('jumpUrl', u('Integrate/index'));
  594. $this->success ('?????????? UCenter');
  595. }
  596. public function edit()
  597. {
  598. /*
  599. $set_modules = true;
  600. include_once(FANWE_ROOT.'core/include/integrates/'.$_GET['code'].".php");
  601. $set_modules = false;
  602. */
  603. $user_field = fanweC('INTEGRATE_FIELD_ID');
  604. $this->assign('user_field', $user_field);// $modules[0]['user_field']);
  605. if ($_GET['code'] == 'fanwe')
  606. {
  607. $this->assign ('jumpUrl', U('Integrate/index'));
  608. $this->error('????FANWE?????????????');
  609. }
  610. else
  611. {
  612. $cfg = unserialize(fanweC('INTEGRATE_CONFIG'));
  613. $this->assign('save', 1);
  614. $this->assign('set_list', $this->get_charset_list());
  615. $this->assign('code', $_GET['code']);
  616. $this->assign('cfg', $cfg);
  617. //dump($this->get_charset_list());
  618. $this->display('edit');
  619. }
  620. }
  621. }
  622. ?>