* $Author: sunxiaodong $ * $Id: sms.php 15532 2009-01-07 10:48:14Z sunxiaodong $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; require_once ROOT_PATH . 'includes/cls_sms.php'; $action = isset($_REQUEST['act']) ? $_REQUEST['act'] : 'display_my_info'; $sms = new sms(); switch ($action) { /* 注册短信服务。*/ case 'register': $email = isset($_POST['email']) ? $_POST['email'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; $domain = isset($_POST['domain']) ? $_POST['domain'] : ''; $phone = isset($_POST['phone']) ? $_POST['phone'] : ''; $result = $sms->register($email, $password, $domain, $phone); $link[] = array('text' => $_LANG['back'], 'href' => 'sms.php?act=display_my_info'); if ($result === true) { sys_msg($_LANG['register_ok'], 0, $link); } else { @($error_detail = $_LANG['server_errors'][$sms->errors['server_errors']['error_no']] . $_LANG['api_errors']['register'][$sms->errors['api_errors']['error_no']]); sys_msg($_LANG['register_error'] . $error_detail, 1, $link); } break; /* 启用短信服务。 */ /* 启用短信服务。 */ case 'enable': $username = isset($_POST['email']) ? $_POST['email'] : ''; //由于md5函数对空串也加密,所以要进行判空操作 $password = isset($_POST['password']) && $_POST['password'] !== '' ? md5($_POST['password']) : ''; $result = $sms->restore($username, $password);