expired-message.ctrl.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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', 'save');
  8. $do = in_array($_GPC['do'], $dos) ? $do : 'display';
  9. $expired_message_settings = setting_load('account_expired_message');
  10. $expired_message_settings = $expired_message_settings['account_expired_message'];
  11. if ($do == 'display') {
  12. if (!empty($expired_message_settings)) {
  13. foreach($expired_message_settings as $account_type => $account_setting) {
  14. $account_all_type_sign[$account_type]['expired_message'] = $account_setting;
  15. }
  16. }
  17. }
  18. if ($do == 'save') {
  19. $account_type = safe_gpc_string($_GPC['account_type']);
  20. $status = intval($_GPC['status']);
  21. $message = safe_gpc_string($_GPC['message']);
  22. $expired_message_settings[$account_type] = array('status' => $status, 'message' => $message);
  23. if ($_W['isajax'] && $_W['ispost']) {
  24. setting_save($expired_message_settings, 'account_expired_message');
  25. }
  26. iajax(0, '保存设置成功', url('account/expired-message'));
  27. }
  28. template('account/manage-expired-message');