通过ldap登录的用户不能修改密码和邮箱

This commit is contained in:
shiziyuan9527 2020-07-10 16:27:41 +08:00
parent 96e2d4f98d
commit aca19f6dfa
9 changed files with 190 additions and 95 deletions

View File

@ -1,8 +1,7 @@
package io.metersphere.base.domain; package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data;
@Data @Data
public class User implements Serializable { public class User implements Serializable {
@ -28,5 +27,7 @@ public class User implements Serializable {
private String phone; private String phone;
private String source;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -175,72 +175,72 @@ public class UserExample {
} }
public Criteria andNameIsNull() { public Criteria andNameIsNull() {
addCriterion("name is null"); addCriterion("`name` is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameIsNotNull() { public Criteria andNameIsNotNull() {
addCriterion("name is not null"); addCriterion("`name` is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameEqualTo(String value) { public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name"); addCriterion("`name` =", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameNotEqualTo(String value) { public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name"); addCriterion("`name` <>", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameGreaterThan(String value) { public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name"); addCriterion("`name` >", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameGreaterThanOrEqualTo(String value) { public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name"); addCriterion("`name` >=", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameLessThan(String value) { public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name"); addCriterion("`name` <", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameLessThanOrEqualTo(String value) { public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name"); addCriterion("`name` <=", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameLike(String value) { public Criteria andNameLike(String value) {
addCriterion("name like", value, "name"); addCriterion("`name` like", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameNotLike(String value) { public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name"); addCriterion("`name` not like", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameIn(List<String> values) { public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name"); addCriterion("`name` in", values, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameNotIn(List<String> values) { public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name"); addCriterion("`name` not in", values, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameBetween(String value1, String value2) { public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name"); addCriterion("`name` between", value1, value2, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNameNotBetween(String value1, String value2) { public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name"); addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this; return (Criteria) this;
} }
@ -315,142 +315,142 @@ public class UserExample {
} }
public Criteria andPasswordIsNull() { public Criteria andPasswordIsNull() {
addCriterion("password is null"); addCriterion("`password` is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordIsNotNull() { public Criteria andPasswordIsNotNull() {
addCriterion("password is not null"); addCriterion("`password` is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordEqualTo(String value) { public Criteria andPasswordEqualTo(String value) {
addCriterion("password =", value, "password"); addCriterion("`password` =", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotEqualTo(String value) { public Criteria andPasswordNotEqualTo(String value) {
addCriterion("password <>", value, "password"); addCriterion("`password` <>", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordGreaterThan(String value) { public Criteria andPasswordGreaterThan(String value) {
addCriterion("password >", value, "password"); addCriterion("`password` >", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordGreaterThanOrEqualTo(String value) { public Criteria andPasswordGreaterThanOrEqualTo(String value) {
addCriterion("password >=", value, "password"); addCriterion("`password` >=", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLessThan(String value) { public Criteria andPasswordLessThan(String value) {
addCriterion("password <", value, "password"); addCriterion("`password` <", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLessThanOrEqualTo(String value) { public Criteria andPasswordLessThanOrEqualTo(String value) {
addCriterion("password <=", value, "password"); addCriterion("`password` <=", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLike(String value) { public Criteria andPasswordLike(String value) {
addCriterion("password like", value, "password"); addCriterion("`password` like", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotLike(String value) { public Criteria andPasswordNotLike(String value) {
addCriterion("password not like", value, "password"); addCriterion("`password` not like", value, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordIn(List<String> values) { public Criteria andPasswordIn(List<String> values) {
addCriterion("password in", values, "password"); addCriterion("`password` in", values, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotIn(List<String> values) { public Criteria andPasswordNotIn(List<String> values) {
addCriterion("password not in", values, "password"); addCriterion("`password` not in", values, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordBetween(String value1, String value2) { public Criteria andPasswordBetween(String value1, String value2) {
addCriterion("password between", value1, value2, "password"); addCriterion("`password` between", value1, value2, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotBetween(String value1, String value2) { public Criteria andPasswordNotBetween(String value1, String value2) {
addCriterion("password not between", value1, value2, "password"); addCriterion("`password` not between", value1, value2, "password");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("status is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusIsNotNull() { public Criteria andStatusIsNotNull() {
addCriterion("status is not null"); addCriterion("`status` is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusEqualTo(String value) { public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status"); addCriterion("`status` =", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusNotEqualTo(String value) { public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status"); addCriterion("`status` <>", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusGreaterThan(String value) { public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status"); addCriterion("`status` >", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusGreaterThanOrEqualTo(String value) { public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status"); addCriterion("`status` >=", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusLessThan(String value) { public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status"); addCriterion("`status` <", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusLessThanOrEqualTo(String value) { public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status"); addCriterion("`status` <=", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusLike(String value) { public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status"); addCriterion("`status` like", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusNotLike(String value) { public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status"); addCriterion("`status` not like", value, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusIn(List<String> values) { public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status"); addCriterion("`status` in", values, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusNotIn(List<String> values) { public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status"); addCriterion("`status` not in", values, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusBetween(String value1, String value2) { public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status"); addCriterion("`status` between", value1, value2, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusNotBetween(String value1, String value2) { public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status"); addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this; return (Criteria) this;
} }
@ -575,72 +575,72 @@ public class UserExample {
} }
public Criteria andLanguageIsNull() { public Criteria andLanguageIsNull() {
addCriterion("language is null"); addCriterion("`language` is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageIsNotNull() { public Criteria andLanguageIsNotNull() {
addCriterion("language is not null"); addCriterion("`language` is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageEqualTo(String value) { public Criteria andLanguageEqualTo(String value) {
addCriterion("language =", value, "language"); addCriterion("`language` =", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageNotEqualTo(String value) { public Criteria andLanguageNotEqualTo(String value) {
addCriterion("language <>", value, "language"); addCriterion("`language` <>", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageGreaterThan(String value) { public Criteria andLanguageGreaterThan(String value) {
addCriterion("language >", value, "language"); addCriterion("`language` >", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageGreaterThanOrEqualTo(String value) { public Criteria andLanguageGreaterThanOrEqualTo(String value) {
addCriterion("language >=", value, "language"); addCriterion("`language` >=", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageLessThan(String value) { public Criteria andLanguageLessThan(String value) {
addCriterion("language <", value, "language"); addCriterion("`language` <", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageLessThanOrEqualTo(String value) { public Criteria andLanguageLessThanOrEqualTo(String value) {
addCriterion("language <=", value, "language"); addCriterion("`language` <=", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageLike(String value) { public Criteria andLanguageLike(String value) {
addCriterion("language like", value, "language"); addCriterion("`language` like", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageNotLike(String value) { public Criteria andLanguageNotLike(String value) {
addCriterion("language not like", value, "language"); addCriterion("`language` not like", value, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageIn(List<String> values) { public Criteria andLanguageIn(List<String> values) {
addCriterion("language in", values, "language"); addCriterion("`language` in", values, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageNotIn(List<String> values) { public Criteria andLanguageNotIn(List<String> values) {
addCriterion("language not in", values, "language"); addCriterion("`language` not in", values, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageBetween(String value1, String value2) { public Criteria andLanguageBetween(String value1, String value2) {
addCriterion("language between", value1, value2, "language"); addCriterion("`language` between", value1, value2, "language");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLanguageNotBetween(String value1, String value2) { public Criteria andLanguageNotBetween(String value1, String value2) {
addCriterion("language not between", value1, value2, "language"); addCriterion("`language` not between", value1, value2, "language");
return (Criteria) this; return (Criteria) this;
} }
@ -853,6 +853,76 @@ public class UserExample {
addCriterion("phone not between", value1, value2, "phone"); addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSourceIsNull() {
addCriterion("`source` is null");
return (Criteria) this;
}
public Criteria andSourceIsNotNull() {
addCriterion("`source` is not null");
return (Criteria) this;
}
public Criteria andSourceEqualTo(String value) {
addCriterion("`source` =", value, "source");
return (Criteria) this;
}
public Criteria andSourceNotEqualTo(String value) {
addCriterion("`source` <>", value, "source");
return (Criteria) this;
}
public Criteria andSourceGreaterThan(String value) {
addCriterion("`source` >", value, "source");
return (Criteria) this;
}
public Criteria andSourceGreaterThanOrEqualTo(String value) {
addCriterion("`source` >=", value, "source");
return (Criteria) this;
}
public Criteria andSourceLessThan(String value) {
addCriterion("`source` <", value, "source");
return (Criteria) this;
}
public Criteria andSourceLessThanOrEqualTo(String value) {
addCriterion("`source` <=", value, "source");
return (Criteria) this;
}
public Criteria andSourceLike(String value) {
addCriterion("`source` like", value, "source");
return (Criteria) this;
}
public Criteria andSourceNotLike(String value) {
addCriterion("`source` not like", value, "source");
return (Criteria) this;
}
public Criteria andSourceIn(List<String> values) {
addCriterion("`source` in", values, "source");
return (Criteria) this;
}
public Criteria andSourceNotIn(List<String> values) {
addCriterion("`source` not in", values, "source");
return (Criteria) this;
}
public Criteria andSourceBetween(String value1, String value2) {
addCriterion("`source` between", value1, value2, "source");
return (Criteria) this;
}
public Criteria andSourceNotBetween(String value1, String value2) {
addCriterion("`source` not between", value1, value2, "source");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -2,9 +2,8 @@ package io.metersphere.base.mapper;
import io.metersphere.base.domain.User; import io.metersphere.base.domain.User;
import io.metersphere.base.domain.UserExample; import io.metersphere.base.domain.UserExample;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserMapper { public interface UserMapper {
long countByExample(UserExample example); long countByExample(UserExample example);
@ -28,7 +27,4 @@ public interface UserMapper {
int updateByPrimaryKeySelective(User record); int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record); int updateByPrimaryKey(User record);
} }

View File

@ -13,6 +13,7 @@
<result column="last_workspace_id" jdbcType="VARCHAR" property="lastWorkspaceId" /> <result column="last_workspace_id" jdbcType="VARCHAR" property="lastWorkspaceId" />
<result column="last_organization_id" jdbcType="VARCHAR" property="lastOrganizationId" /> <result column="last_organization_id" jdbcType="VARCHAR" property="lastOrganizationId" />
<result column="phone" jdbcType="VARCHAR" property="phone" /> <result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="source" jdbcType="VARCHAR" property="source" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -73,8 +74,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, email, password, status, create_time, update_time, language, last_workspace_id, id, `name`, email, `password`, `status`, create_time, update_time, `language`, last_workspace_id,
last_organization_id, phone last_organization_id, phone, `source`
</sql> </sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.UserExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.base.domain.UserExample" resultMap="BaseResultMap">
select select
@ -107,14 +108,16 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.User"> <insert id="insert" parameterType="io.metersphere.base.domain.User">
insert into user (id, name, email, insert into user (id, `name`, email,
password, status, create_time, `password`, `status`, create_time,
update_time, language, last_workspace_id, update_time, `language`, last_workspace_id,
last_organization_id, phone) last_organization_id, phone, `source`
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{password,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{language,jdbcType=VARCHAR}, #{lastWorkspaceId,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{language,jdbcType=VARCHAR}, #{lastWorkspaceId,jdbcType=VARCHAR},
#{lastOrganizationId,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}) #{lastOrganizationId,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.User"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.User">
insert into user insert into user
@ -123,16 +126,16 @@
id, id,
</if> </if>
<if test="name != null"> <if test="name != null">
name, `name`,
</if> </if>
<if test="email != null"> <if test="email != null">
email, email,
</if> </if>
<if test="password != null"> <if test="password != null">
password, `password`,
</if> </if>
<if test="status != null"> <if test="status != null">
status, `status`,
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
@ -141,7 +144,7 @@
update_time, update_time,
</if> </if>
<if test="language != null"> <if test="language != null">
language, `language`,
</if> </if>
<if test="lastWorkspaceId != null"> <if test="lastWorkspaceId != null">
last_workspace_id, last_workspace_id,
@ -152,6 +155,9 @@
<if test="phone != null"> <if test="phone != null">
phone, phone,
</if> </if>
<if test="source != null">
`source`,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -187,6 +193,9 @@
<if test="phone != null"> <if test="phone != null">
#{phone,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
</if> </if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.UserExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.metersphere.base.domain.UserExample" resultType="java.lang.Long">
@ -202,16 +211,16 @@
id = #{record.id,jdbcType=VARCHAR}, id = #{record.id,jdbcType=VARCHAR},
</if> </if>
<if test="record.name != null"> <if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.email != null"> <if test="record.email != null">
email = #{record.email,jdbcType=VARCHAR}, email = #{record.email,jdbcType=VARCHAR},
</if> </if>
<if test="record.password != null"> <if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR}, `password` = #{record.password,jdbcType=VARCHAR},
</if> </if>
<if test="record.status != null"> <if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
</if> </if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
@ -220,7 +229,7 @@
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
</if> </if>
<if test="record.language != null"> <if test="record.language != null">
language = #{record.language,jdbcType=VARCHAR}, `language` = #{record.language,jdbcType=VARCHAR},
</if> </if>
<if test="record.lastWorkspaceId != null"> <if test="record.lastWorkspaceId != null">
last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR}, last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR},
@ -231,6 +240,9 @@
<if test="record.phone != null"> <if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR}, phone = #{record.phone,jdbcType=VARCHAR},
</if> </if>
<if test="record.source != null">
`source` = #{record.source,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -239,16 +251,17 @@
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update user update user
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
email = #{record.email,jdbcType=VARCHAR}, email = #{record.email,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR}, `password` = #{record.password,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
language = #{record.language,jdbcType=VARCHAR}, `language` = #{record.language,jdbcType=VARCHAR},
last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR}, last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR},
last_organization_id = #{record.lastOrganizationId,jdbcType=VARCHAR}, last_organization_id = #{record.lastOrganizationId,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR} phone = #{record.phone,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -257,16 +270,16 @@
update user update user
<set> <set>
<if test="name != null"> <if test="name != null">
name = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="email != null"> <if test="email != null">
email = #{email,jdbcType=VARCHAR}, email = #{email,jdbcType=VARCHAR},
</if> </if>
<if test="password != null"> <if test="password != null">
password = #{password,jdbcType=VARCHAR}, `password` = #{password,jdbcType=VARCHAR},
</if> </if>
<if test="status != null"> <if test="status != null">
status = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
@ -275,7 +288,7 @@
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
</if> </if>
<if test="language != null"> <if test="language != null">
language = #{language,jdbcType=VARCHAR}, `language` = #{language,jdbcType=VARCHAR},
</if> </if>
<if test="lastWorkspaceId != null"> <if test="lastWorkspaceId != null">
last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR}, last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR},
@ -286,22 +299,25 @@
<if test="phone != null"> <if test="phone != null">
phone = #{phone,jdbcType=VARCHAR}, phone = #{phone,jdbcType=VARCHAR},
</if> </if>
<if test="source != null">
`source` = #{source,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.User"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.User">
update user update user
set name = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR}, email = #{email,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR}, `password` = #{password,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
language = #{language,jdbcType=VARCHAR}, `language` = #{language,jdbcType=VARCHAR},
last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR}, last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR},
last_organization_id = #{lastOrganizationId,jdbcType=VARCHAR}, last_organization_id = #{lastOrganizationId,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR} phone = #{phone,jdbcType=VARCHAR},
`source` = #{source,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -0,0 +1,5 @@
package io.metersphere.commons.constants;
public enum UserSource {
Local, Ldap
}

View File

@ -21,6 +21,8 @@ public class UserDTO {
private String status; private String status;
private String source;
private Long createTime; private Long createTime;
private Long updateTime; private Long updateTime;

View File

@ -2,6 +2,7 @@ package io.metersphere.ldap.controller;
import io.metersphere.base.domain.User; import io.metersphere.base.domain.User;
import io.metersphere.commons.constants.ParamConstants; import io.metersphere.commons.constants.ParamConstants;
import io.metersphere.commons.constants.UserSource;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.controller.ResultHolder; import io.metersphere.controller.ResultHolder;
import io.metersphere.controller.request.LoginRequest; import io.metersphere.controller.request.LoginRequest;
@ -55,6 +56,7 @@ public class LdapController {
user.setName(username); user.setName(username);
user.setEmail(email); user.setEmail(email);
user.setPassword(password); user.setPassword(password);
user.setSource(UserSource.Ldap.name());
userService.createUser(user); userService.createUser(user);
} else { } else {
request.setUsername(u.getId()); request.setUsername(u.getId());

View File

@ -0,0 +1 @@
alter table user add source varchar(50) null;

View File

@ -24,7 +24,7 @@
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-table-operator-button :tip="$t('member.edit_information')" icon="el-icon-edit" <ms-table-operator-button :tip="$t('member.edit_information')" icon="el-icon-edit"
type="primary" @exec="edit(scope.row)"/> type="primary" @exec="edit(scope.row)"/>
<ms-table-operator-button :tip="$t('member.edit_password')" icon="el-icon-s-tools" <ms-table-operator-button :tip="$t('member.edit_password')" icon="el-icon-s-tools" v-if="!isLdapUser"
type="success" @exec="editPassword(scope.row)"/> type="success" @exec="editPassword(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
@ -43,7 +43,7 @@
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.email')" prop="email"> <el-form-item :label="$t('commons.email')" prop="email">
<el-input v-model="form.email" autocomplete="off"/> <el-input v-model="form.email" autocomplete="off" :disabled="isLdapUser"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.phone')" prop="phone"> <el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off"/> <el-input v-model="form.phone" autocomplete="off"/>
@ -89,6 +89,7 @@
data() { data() {
return { return {
result: {}, result: {},
isLdapUser: false,
updateVisible: false, updateVisible: false,
editPasswordVisible: false, editPasswordVisible: false,
tableData: [], tableData: [],
@ -198,6 +199,7 @@
initTableData() { initTableData() {
this.result = this.$get("/user/info/" + this.currentUser().id, response => { this.result = this.$get("/user/info/" + this.currentUser().id, response => {
let data = response.data; let data = response.data;
this.isLdapUser = response.data.source === 'Ldap' ? true : false;
let dataList = []; let dataList = [];
dataList[0] = data; dataList[0] = data;
this.tableData = dataList; this.tableData = dataList;