sms-sign.ctrl.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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('cloud');
  8. load()->model('setting');
  9. $dos = array('display', 'save_sms_sign');
  10. $do = in_array($do, $dos) ? $do : 'display';
  11. $setting_sms_sign = setting_load('site_sms_sign');
  12. $setting_sms_sign = !empty($setting_sms_sign['site_sms_sign']) ? $setting_sms_sign['site_sms_sign'] : array();
  13. if ($do == 'display') {
  14. $sms_info = cloud_sms_info();
  15. $cloud_sms_signs = !empty($sms_info) ? $sms_info['sms_sign'] : array();
  16. $setting_sms_sign['register'] = !empty($setting_sms_sign['register']) ? $setting_sms_sign['register'] : '';
  17. $setting_sms_sign['find_password'] = !empty($setting_sms_sign['find_password']) ? $setting_sms_sign['find_password'] : '';
  18. $setting_sms_sign['user_expire'] = !empty($setting_sms_sign['user_expire']) ? $setting_sms_sign['user_expire'] : '';
  19. }
  20. if ($do == 'save_sms_sign') {
  21. if (isset($_GPC['register'])) {
  22. $setting_sms_sign['register'] = safe_gpc_string($_GPC['register']);
  23. }
  24. if (isset($_GPC['find_password'])) {
  25. $setting_sms_sign['find_password'] = safe_gpc_string($_GPC['find_password']);
  26. }
  27. if (isset($_GPC['user_expire'])) {
  28. $setting_sms_sign['user_expire'] = safe_gpc_string($_GPC['user_expire']);
  29. }
  30. $result = setting_save($setting_sms_sign, 'site_sms_sign');
  31. if (is_error($result)) {
  32. iajax(-1, '设置失败', url('cloud/sms-sign'));
  33. }
  34. iajax(0, '设置成功', url('cloud/sms-sign'));
  35. }
  36. template('cloud/sms-sign');