html_error_quit("请等待识别的图片显示完毕!"); } if (strcasecmp($_SESSION['num_auth'], $num_auth)) { html_error_quit("图片上的字符串识别错误!难道你是机器人?"); } if (!strchr($reg_email, '@')) { html_error_quit("错误的注册 email 地址!"); } if ($password != $re_password) { html_error_quit("密码与确认密码不一致! "); } if (strlen($password) < 4 || strlen($password) > 39) { html_error_quit("密码不规范, 密码长度应为 4-39 位! "); } //create new id $ret = bbs_createnewid($userid, $password, $nickname); switch ($ret) { case 0: break; case 1: html_error_quit("用户名有非数字字母字符或者首字符不是字母!"); break; case 2: html_error_quit("用户名至少为两个字母!"); break; case 3: html_error_quit("系统用字或不雅用字!"); break; case 4: html_error_quit("该用户名已经被使用!"); break;
/** * function create create a new user * * @param string $id * @param string $pwd * @param string $name nickname * @return null * @static * @access public * @throws UserCreateException */ public static function create($id, $pwd, $name) { $ret = bbs_createnewid($id, $pwd, $name); switch ($ret) { case 0: break; case 1: case 2: case 5: case 6: throw new UserCreateException(ECode::$REG_FORMAT); case 3: case 4: throw new UserCreateException(ECode::$REG_IDUSED); case 10: throw new UserCreateException(ECode::$SYS_ERROR); default: throw new UserCreateException(ECode::$SYS_ERROR); } }