Esempio n. 1
0
     $username = isset($_POST['email']) ? $_POST['email'] : '';
     //由于md5函数对空串也加密,所以要进行判空操作
     $password = isset($_POST['password']) && $_POST['password'] !== '' ? md5($_POST['password']) : '';
     $result = $sms->restore($username, $password);
     $link[] = array('text' => $_LANG['back'], 'href' => 'sms.php?act=display_my_info');
     if ($result === true) {
         sys_msg($_LANG['enable_ok'], 0, $link);
     } else {
         @($error_detail = $_LANG['server_errors'][$sms->errors['server_errors']['error_no']] . $_LANG['api_errors']['auth'][$sms->errors['api_errors']['error_no']]);
         sys_msg($_LANG['enable_error'] . $error_detail, 1, $link);
     }
     break;
     /* 注销短信特服信息 */
 /* 注销短信特服信息 */
 case 'disable':
     $result = $sms->clear_my_info();
     $link[] = array('text' => $_LANG['back'], 'href' => 'sms.php?act=display_my_info');
     if ($result === true) {
         sys_msg($_LANG['disable_ok'], 0, $link);
     } else {
         sys_msg($_LANG['disable_error'], 1, $link);
     }
     break;
     /* 显示短信发送界面,如果尚未注册或启用短信服务则显示注册界面。 */
 /* 显示短信发送界面,如果尚未注册或启用短信服务则显示注册界面。 */
 case 'display_send_ui':
     /* 检查权限 */
     admin_priv('sms_send');
     if ($sms->has_registered()) {
         $smarty->assign('ur_here', $_LANG['03_sms_send']);
         assign_query_info();