人人商城

site.ctrl.php 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('system');
  8. $dos = array('copyright');
  9. $do = in_array($do, $dos) ? $do : 'copyright';
  10. $_W['page']['title'] = '站点设置 - 工具 - 系统管理';
  11. $settings = $_W['setting']['copyright'];
  12. if(empty($settings) || !is_array($settings)) {
  13. $settings = array();
  14. } else {
  15. $settings['slides'] = iunserializer($settings['slides']);
  16. }
  17. $path = IA_ROOT . '/web/themes/';
  18. if(is_dir($path)) {
  19. if ($handle = opendir($path)) {
  20. while (false !== ($templatepath = readdir($handle))) {
  21. if ($templatepath != '.' && $templatepath != '..') {
  22. if(is_dir($path.$templatepath)){
  23. $template[] = $templatepath;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. if ($do == 'copyright') {
  30. $template_ch_name = system_template_ch_name();
  31. if (checksubmit('submit')) {
  32. header('X-XSS-Protection: 0');
  33. $data = array(
  34. 'status' => intval($_GPC['status']),
  35. 'verifycode' => $settings['verifycode'],
  36. 'reason' => trim($_GPC['reason']),
  37. 'sitename' => trim($_GPC['sitename']),
  38. 'url' => (strexists($_GPC['url'], 'http://') || strexists($_GPC['url'], 'https://')) ? $_GPC['url'] : "http://{$_GPC['url']}",
  39. 'statcode' => system_check_statcode($_GPC['statcode']),
  40. 'footerleft' => safe_gpc_html(htmlspecialchars_decode($_GPC['footerleft'])),
  41. 'footerright' => safe_gpc_html(htmlspecialchars_decode($_GPC['footerright'])),
  42. 'icon' => trim($_GPC['icon']),
  43. 'flogo' => trim($_GPC['flogo']),
  44. 'background_img' => trim($_GPC['background_img']),
  45. 'slides' => iserializer($_GPC['slides']),
  46. 'notice' => trim($_GPC['notice']),
  47. 'blogo' => trim($_GPC['blogo']),
  48. 'baidumap' => $_GPC['baidumap'],
  49. 'company' => trim($_GPC['company']),
  50. 'companyprofile' => safe_gpc_html(htmlspecialchars_decode($_GPC['companyprofile'])),
  51. 'address' => trim($_GPC['address']),
  52. 'person' => trim($_GPC['person']),
  53. 'phone' => trim($_GPC['phone']),
  54. 'qq' => trim($_GPC['qq']),
  55. 'email' => trim($_GPC['email']),
  56. 'keywords' => trim($_GPC['keywords']),
  57. 'description' => trim($_GPC['description']),
  58. 'showhomepage' => intval($_GPC['showhomepage']),
  59. 'leftmenufixed' => (!empty($_GPC['leftmenu_fixed'])) ? 1 : 0,
  60. 'mobile_status' => $settings['mobile_status'],
  61. 'login_type' => $settings['login_type'],
  62. 'log_status' => intval($_GPC['log_status']),
  63. 'develop_status' => intval($_GPC['develop_status']),
  64. 'icp' => safe_gpc_string($_GPC['icp']),
  65. 'bind' => $settings['bind'],
  66. 'welcome_link' => $settings['welcome_link'],
  67. 'oauth_bind' => $settings['oauth_bind'],
  68. );
  69. $test = setting_save($data, 'copyright');
  70. $template = trim($_GPC['template']);
  71. setting_save(array('template' => $template), 'basic');
  72. itoast('更新设置成功!', url('system/site'), 'success');
  73. }
  74. }
  75. template('system/site');