提交 1f886370 编写于 作者: U unknown

组织管理和个人设置增加字段登录IP

上级 7091083d
......@@ -49,6 +49,7 @@ MWF.xApplication.Org.PersonExplorer = new Class({
"weibo": "",
"mobile": "",
"name": "",
"ipAddress" : "",
"controllerList": [],
"woPersonAttributeList":[],
"woIdentityList": [],
......@@ -692,6 +693,9 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
var n = this.editContentNode.getElement(".infor_birthday");
if (n) n.set("text", this.data.birthday || "");
var n = this.editContentNode.getElement(".infor_ipAddress");
if (n) n.set("text", this.data.ipAddress || "");
this.editContentNode.getElements("td.inforTitle").setStyles(this.style.baseInforTitleNode);
this.editContentNode.getElements("td.inforContent").setStyles(this.style.baseInforContentNode);
this.editContentNode.getElements("td.inforAction").setStyles(this.style.baseInforActionNode);
......@@ -715,6 +719,8 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
"<td class='inforTitle'>"+this.explorer.app.lp.personOfficePhone+":</td><td class='inforContent infor_officePhone'>"+(this.data.officePhone || "")+"</td></tr>";
html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.personBoardDate+":</td><td class='inforContent infor_boardDate'>"+(this.data.boardDate || "")+"</td>" +
"<td class='inforTitle'>"+this.explorer.app.lp.personBirthday+":</td><td class='inforContent infor_birthday'>"+(this.data.birthday || "")+"</td></tr>";
html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.ipAddress+":</td><td class='inforContent infor_ipAddress'>"+(this.data.ipAddress || "")+"</td>" +
"<td class='inforTitle'></td></tr>";
html += "<tr><td colspan='4' class='inforAction'></td></tr>";
//this.baseInforRightNode.set("html", html);
......@@ -829,6 +835,11 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
});
}.bind(this));
tdContents[12].setStyles(this.style.baseInforContentNode_edit).empty();
this.ipAddressInputNode = new Element("input", {"styles": this.style.inputNode, "placeHolder": this.explorer.app.lp.ipAddressPlaceHolder, }).inject(tdContents[12]);
this.ipAddressInputNode.set("value", (this.data.ipAddress));
var _self = this;
this.editContentNode.getElements("input").addEvents({
......@@ -857,6 +868,21 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
this.explorer.app.notice(this.explorer.app.lp.inputPersonInfor, "error", this.explorer.propertyContentNode);
return false;
}
var array = [];
var ipAddress = this.ipAddressInputNode.get("value") || "";
var ipV4Format = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
var ipV6Format = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
if( ipAddress.trim() ){
ipAddress.split(",").each( function(ip){
if(!ip.match(ipV4Format) && !ip.match(ipV6Format))array.push( ip );
})
}
if( array.length > 0 ){
this.explorer.app.notice( this.explorer.app.lp.ipAddressIncorrectNotice + array.join(","), "error", this.explorer.propertyContentNode);
return false;
}
//this.data.genderType = gender;
if (!this.uniqueInputNode.get("value")) this.data.unique = this.employeeInputNode.get("value");
this.content.propertyContentScrollNode.mask({
......@@ -896,6 +922,7 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
data.officePhone = this.officePhoneInputNode.get("value");
data.boardDate = this.boardDateInputNode.get("value");
data.birthday = this.birthdayInputNode.get("value");
data.ipAddress = this.ipAddressInputNode.get("value");
var tdContents = this.editContentNode.getElements("td.inforContent");
var radios = tdContents[4].getElements("input");
......@@ -947,6 +974,7 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
tdContents[9].setStyles(this.style.baseInforContentNode).set("text", this.data.officePhone || "");
tdContents[10].setStyles(this.style.baseInforContentNode).set("text", this.data.boardDate || "");
tdContents[11].setStyles(this.style.baseInforContentNode).set("text", this.data.birthday || "");
tdContents[12].setStyles(this.style.baseInforContentNode).set("text", this.data.ipAddress || "");
this.mode = "read";
......
......@@ -40,7 +40,9 @@ MWF.xApplication.Org.LP = {
"back": "返回",
"name": "名称",
"description": "描述",
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录该账号,用“,”分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"createSubCompany": "创建子公司",
"createSubDepartment": "创建子部门",
......
......@@ -40,7 +40,9 @@ MWF.xApplication.Org.LP = {
"back": "返回",
"name": "名称",
"description": "描述",
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录该账号,用“,”分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"createSubCompany": "创建子公司",
"createSubDepartment": "创建子部门",
......
......@@ -68,6 +68,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -68,6 +68,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -68,6 +68,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -68,6 +68,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -35,7 +35,7 @@
height: 100%;
}
.o2_profile_configNode {
min-height: 640px;
min-height: 690px;
/*position: relative;*/
}
.o2_profile_inforConfigArea {
......
......@@ -61,6 +61,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -61,6 +61,13 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.ipAddress }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -8,7 +8,7 @@ MWF.xApplication.Profile.Main = new Class({
"name": "Profile",
"icon": "icon.png",
"width": "1100",
"height": "768",
"height": "820",
"isResize": false,
"isMax": false,
"mvcStyle": "style.css",
......@@ -122,7 +122,10 @@ MWF.xApplication.Profile.Main = new Class({
this.officePhoneInputNode = inputs[2];
this.weixinInputNode = inputs[3];
this.qqInputNode = inputs[4];
this.signatureInputNode = this.tab.pages[0].contentNode.getElement("textarea").addEvent("focus",function(){
this.ipAddressInputNode = inputs[5];
this.signatureInputNode = this.tab.pages[0].contentNode.getElement("textarea");
this.signatureInputNode.addEvent("focus",function(){
this.addClass("mainColor_border mainColor_color");
}).addEvent("blur",function(){
this.removeClass("mainColor_border mainColor_color");
......@@ -815,11 +818,27 @@ MWF.xApplication.Profile.Main = new Class({
},
savePersonInfor: function(){
var array = [];
var ipAddress = this.ipAddressInputNode.get("value") || "";
var ipV4Format = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
var ipV6Format = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
if( ipAddress.trim() ){
ipAddress.split(",").each( function(ip){
if(!ip.match(ipV4Format) && !ip.match(ipV6Format))array.push( ip );
})
}
if( array.length > 0 ){
this.notice( this.lp.ipAddressIncorrectNotice + array.join(","), "error");
return false;
}
this.personData.officePhone = this.officePhoneInputNode.get("value");
this.personData.mail = this.mailInputNode.get("value");
this.personData.mobile = this.mobileInputNode.get("value");
this.personData.weixin = this.weixinInputNode.get("value");
this.personData.qq = this.qqInputNode.get("value");
this.personData.ipAddress = this.ipAddressInputNode.get("value");
this.personData.signature = this.signatureInputNode.get("value");
this.action.updatePerson(this.personData, function(){
this.notice(this.lp.saveInforOk, "success");
......
......@@ -32,6 +32,9 @@ MWF.xApplication.Profile.LP = {
"signature": "个人签名",
"saveInfor": "保存个人信息",
"saveInforOk": "保存个人信息成功",
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录该账号,用“,”分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"passwordRule" : "密码规则",
"oldPassword": "原密码",
......
......@@ -33,6 +33,9 @@ MWF.xApplication.Profile.LP = {
"signature": "个人签名",
"saveInfor": "保存个人信息",
"saveInforOk": "保存个人信息成功",
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录,用,分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"passwordRule" : "密码规则",
"oldPassword": "原密码",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册