diff --git a/pom.xml b/pom.xml
index 8861d2b..26c8f72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
http://www.rekoe.com
UTF-8
- 1.r.63-SNAPSHOT
+ 1.r.63
2.3.26-incubating
diff --git a/src/main/java/com/rekoe/domain/Usr.java b/src/main/java/com/rekoe/domain/Usr.java
index 44ba930..316eccd 100644
--- a/src/main/java/com/rekoe/domain/Usr.java
+++ b/src/main/java/com/rekoe/domain/Usr.java
@@ -47,6 +47,26 @@ public class Usr implements Serializable {
@Default("0")
private boolean lock;
+ @Column("is_local")
+ @Default("0")
+ private boolean local;
+
+ public boolean isLock() {
+ return lock;
+ }
+
+ public void setLock(boolean lock) {
+ this.lock = lock;
+ }
+
+ public boolean isLocal() {
+ return local;
+ }
+
+ public void setLocal(boolean local) {
+ this.local = local;
+ }
+
/**
* @return 用户ID
*/
diff --git a/src/main/java/com/rekoe/module/admin/AdminProjectGroupUsrAct.java b/src/main/java/com/rekoe/module/admin/AdminProjectGroupUsrAct.java
index 940c485..90c1fb4 100644
--- a/src/main/java/com/rekoe/module/admin/AdminProjectGroupUsrAct.java
+++ b/src/main/java/com/rekoe/module/admin/AdminProjectGroupUsrAct.java
@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.async.Async;
import org.nutz.dao.Cnd;
+import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
@@ -141,6 +142,9 @@ public class AdminProjectGroupUsrAct extends BaseAction {
@Inject
private ProjectAuthService projectAuthService;
+ @Inject
+ private PropertiesProxy conf;
+
private void sendProjectOpenEmail1(Pj project, ProjectConfig conf, Usr usr, EmailService emailService) {
if (Lang.isEmpty(usr)) {
log.error("send open email user empty");
@@ -151,7 +155,8 @@ public class AdminProjectGroupUsrAct extends BaseAction {
root.put("name", usr.getName());
root.put("pwd", EncryptUtil.decrypt(usr.getPsw()));
root.put("project", project.getDes());
- String url = conf.getDomainPath() + project.getPj();
+ String host = usr.isLocal() ? this.conf.get("server.local", "http://192.168.3.2/repository/") : this.conf.get("server.outside", "http://119.2.19.101/repository/");
+ String url = host + project.getPj();
root.put("url", url);
List urlList = new ArrayList();
Cnd cnd = Cnd.where("pj", "=", project.getPj()).and("usr", "=", usr.getUsr());
@@ -170,6 +175,7 @@ public class AdminProjectGroupUsrAct extends BaseAction {
}
}
root.put("urls", urlList);
+ root.put("addr", usr.isLocal() ? this.conf.get("server.local", "192.168.3.2") : this.conf.get("server.outside", "119.2.19.101"));
boolean send = emailService.projectOpen(usr.getEmail(), root);
if (send) {
log.info("email send OK");
diff --git a/src/main/java/com/rekoe/module/admin/AdminSvnUserAct.java b/src/main/java/com/rekoe/module/admin/AdminSvnUserAct.java
index aedfada..6404dd3 100644
--- a/src/main/java/com/rekoe/module/admin/AdminSvnUserAct.java
+++ b/src/main/java/com/rekoe/module/admin/AdminSvnUserAct.java
@@ -14,6 +14,7 @@ import org.apache.shiro.crypto.hash.Sha256Hash;
import org.nutz.aop.interceptor.async.Async;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
+import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
@@ -254,6 +255,9 @@ public class AdminSvnUserAct extends BaseAction {
return Message.success("ok", req);
}
+ @Inject
+ private PropertiesProxy conf;
+
@Async
private void emailNotify(Usr user, EmailService emailService, ProjectConfig conf, String to, String pwd) {
if (conf.isEmailNotify() && Strings.isEmail(to)) {
@@ -261,6 +265,7 @@ public class AdminSvnUserAct extends BaseAction {
root.put("name", user.getName());
root.put("pwd", pwd);
root.put("usr", user.getUsr());
+ root.put("addr", user.isLocal() ? this.conf.get("server.local", "192.168.3.2") : this.conf.get("server.outside", "119.2.19.101"));
emailService.restpwd(to, root);
}
}
diff --git a/src/main/resources/conf.properties b/src/main/resources/conf.properties
index 4a2b0b0..491eb45 100644
--- a/src/main/resources/conf.properties
+++ b/src/main/resources/conf.properties
@@ -1,11 +1,17 @@
-db.url=jdbc:mysql://127.0.0.1:3306/rk_svnadmin?useUnicode=true&characterEncoding=utf-8&useSSL=false
+db.url=jdbc:mysql://127.0.0.1:3306/rk_svnadmin?useUnicode=true&characterEncoding=utf-8
db.username=root
-db.password=rekoe@5382211
+db.password=kfzx_sy!@#%
db.maxActive=50
-mail.HostName=smtp.mxhichina.com
+#mail.HostName=smtp.mxhichina.com
+#mail.SmtpPort=465
+#mail.UserName=koux@rekoe.com
+#mail.Password=RK@53822111
+#mail.SSLOnConnect=true
+#mail.From=webmaster@rekoe.com
+# qq user mail
+mail.HostName=smtp.qq.com
mail.SmtpPort=465
-mail.UserName=webmaster@rekoe.com
-mail.Password=Rk@5382211
-mail.SSLOnConnect=true
-mail.From=webmaster@rekoe.com
\ No newline at end of file
+mail.UserName=koukou890@qq.com
+mail.Password=rekoe@5382211
+mail.SSLOnConnect=true
\ No newline at end of file
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index b16b2b7..6f109bb 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,6 +1,6 @@
-log4j.rootLogger=ERROR,A1,file
+log4j.rootLogger=DEBUG,A1,file
log4j.logger.velocity_log=INFO
-log4j.category.org.nutz=ERROR,A1,file
+log4j.category.org.nutz=DEBUG,A1,file
log4j.category.org.nutz.dao=DEBUG
log4j.category.org.nutz.ioc=INFO
log4j.category.org.nutz.mvc=DEBUG
diff --git a/src/main/webapp/WEB-INF/template/admin/svn_user/add.ftl b/src/main/webapp/WEB-INF/template/admin/svn_user/add.ftl
index 52c8a99..8085a3c 100644
--- a/src/main/webapp/WEB-INF/template/admin/svn_user/add.ftl
+++ b/src/main/webapp/WEB-INF/template/admin/svn_user/add.ftl
@@ -22,6 +22,7 @@ $(function() {
<@p.form id="jvForm" action="o_save" labelWidth="12" onsubmit="return false;">
<@p.text width="30" label="姓名" id="user.name" name="user.name" value="" maxlength="100" class="required" required="true"/><@p.tr/>
<@p.text width="30" label="用户名" id="user.usr" name="user.usr" value="" maxlength="100" class="required" required="true"/><@p.tr/>
+<@p.radio width="30" colspan="1" label="是否101办公室" name="user.local" value="false" list={"true":"global.true","false":"global.false"} required="true" help="是否101办公室"/><@p.tr/>
<@p.text width="30" label="邮箱地址" id="user.email" name="user.email" value="" maxlength="100" class="required" required="true"/><@p.tr/>
<@p.td width="50" label="角色" required="true">
<@p.select id="user.role" name="user.role" value='0' list={"guest":"选择角色","admin":"admin","small":"small"} required="true"/>
diff --git a/src/main/webapp/WEB-INF/template/admin/svn_user/edit.ftl b/src/main/webapp/WEB-INF/template/admin/svn_user/edit.ftl
index cf65ed0..c91139e 100644
--- a/src/main/webapp/WEB-INF/template/admin/svn_user/edit.ftl
+++ b/src/main/webapp/WEB-INF/template/admin/svn_user/edit.ftl
@@ -22,6 +22,7 @@ $(function() {
<@p.form id="jvForm" action="o_update" labelWidth="12" onsubmit="return false;">
<@p.hidden name="usr" value='${obj.usr}' />
<@p.text width="30" label="密码" id="pwd" name="pwd" value='' maxlength="100" class="required" required="true"/><@p.tr/>
+<@p.radio width="30" colspan="1" label="是否101办公室" name="user.local" value=obj.local list={"true":"global.true","false":"global.false"} required="true" help="是否101办公室"/><@p.tr/>
<@p.td width="50" label="角色" required="true">
<@p.select id="user.role" name="role" value='${obj.role}' list={"guest":"选择角色","admin":"admin","small":"small"} required="true"/>
@p.td><@p.tr/>