人人商城

plugin.ctrl.php 990B

12345678910111213141516171819202122232425262728293031
  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. $dos = array('display', 'enable');
  8. $do = !empty($_GPC['do']) ? $_GPC['do'] : 'display';
  9. uni_user_permission_check('mc_plugin');
  10. load()->model('mc');
  11. $plugins = mc_plugins();
  12. $unisetting = uni_setting_load('mcplugin');
  13. $account_plugins = !empty($unisetting['mcplugin']) ? $unisetting['mcplugin'] : array();
  14. if($do == 'display') {
  15. $_W['page']['title'] = '会员 - 功能管理';
  16. template('mc/plugin');
  17. } elseif ($do == 'enable') {
  18. $name = $_GPC['name'];
  19. if(empty($plugins[$name])) {
  20. message('抱歉,你操作的功能插件不存在!');
  21. }
  22. if (empty($_GPC['enabled'])) {
  23. unset($account_plugins[$name]);
  24. } else {
  25. $account_plugins[$name] = $name;
  26. }
  27. uni_setting_save('mcplugin', $account_plugins);
  28. message('功能插件操作成功!', referer(), 'success');
  29. }