/hostadmiral/trunk/src/ak/hostadmiral/core/action/GeneralExceptionHandler.java |
---|
80,8 → 80,6 |
{ |
logger.info("user exception handle:" + ex.getMessage()); |
request.setAttribute("TRANSACTION_FAILED", Boolean.TRUE); |
// try to get property for this exception if any |
String property = ActionMessages.GLOBAL_MESSAGE; |
if(ex instanceof FormException) { |
112,8 → 110,6 |
{ |
logger.info("model user exception handle:" + ex.getMessage()); |
request.setAttribute("TRANSACTION_FAILED", Boolean.TRUE); |
// create new error message |
ActionErrors errors = (ActionErrors)request.getAttribute(Globals.ERROR_KEY); |
if(errors == null) { |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/UserAction.java |
---|
40,7 → 40,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter()) || "partsubmit".equals(mapping.getParameter())) { |
if("submit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute("user"); |
initUserList(request, user); |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/UserValidatorAtDomain.java |
---|
11,17 → 11,8 |
public void validateUser(User editor, User user) |
throws ModelException |
{ |
// superuser |
if(editor.isSuperuser()) return; |
// name not changed |
if(user.getOrigin() != null && user.getOrigin().getLogin() != null |
&& user.getLogin().equals(user.getOrigin().getLogin())) |
{ |
return; |
} |
// go throug all domains |
Collection domains = InetDomainManager.getInstance().listInetDomains(editor); |
for(Iterator i = domains.iterator(); i.hasNext(); ) { |
InetDomain domain = (InetDomain)i.next(); |
30,7 → 21,6 |
return; |
} |
// nothing found |
throw new ModelUserException("ak.hostadmiral.core.uservalidator.atdomain.login.wrong"); |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/UserManager.java |
---|
132,9 → 132,6 |
listener.userModified(editor, user, oldUser); |
} |
} |
// reset backup |
user.resetOrigin(); |
} |
public void addCreatedListener(UserCreatedListener listener) |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/InetDomainManager.java |
---|
102,9 → 102,6 |
listener.inetDomainModified(editor, domain, oldDomain); |
} |
} |
// reset backup |
domain.resetOrigin(); |
} |
public void addCreatedListener(InetDomainCreatedListener listener) |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailboxManager.java |
---|
117,9 → 117,6 |
listener.mailboxModified(editor, mailbox, oldMailbox); |
} |
} |
// reset backup |
mailbox.resetOrigin(); |
} |
public void addCreatedListener(MailboxCreatedListener listener) |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/SystemUserManager.java |
---|
118,9 → 118,6 |
listener.systemUserModified(editor, systemUser, oldSystemUser); |
} |
} |
// reset backup |
systemUser.resetOrigin(); |
} |
public void addCreatedListener(SystemUserCreatedListener listener) |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAliasManager.java |
---|
108,9 → 108,6 |
listener.mailAliasModified(editor, mailAlias, oldMailAlias); |
} |
} |
// reset backup |
mailAlias.resetOrigin(); |
} |
public void addCreatedListener(MailAliasCreatedListener listener) |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/Mailbox.java |
---|
55,11 → 55,6 |
origin = new Mailbox(this); |
} |
protected void resetOrigin() |
{ |
origin = null; |
} |
/** |
* |
* @hibernate.property |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/User.java |
---|
62,11 → 62,6 |
origin = new User(this); |
} |
protected void resetOrigin() |
{ |
origin = null; |
} |
/** |
* |
* @hibernate.property |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAlias.java |
---|
41,11 → 41,6 |
origin = new MailAlias(this); |
} |
protected void resetOrigin() |
{ |
origin = null; |
} |
/** |
* |
* @hibernate.property |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/InetDomain.java |
---|
36,11 → 36,6 |
origin = new InetDomain(this); |
} |
protected void resetOrigin() |
{ |
origin = null; |
} |
/** |
* |
* @hibernate.property |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/SystemUser.java |
---|
39,11 → 39,6 |
origin = new SystemUser(this); |
} |
protected void resetOrigin() |
{ |
origin = null; |
} |
/** |
* |
* @hibernate.property |
/hostadmiral/trunk/src/ak/hostadmiral/core/servlet/HibernateFilter.java |
---|
35,7 → 35,28 |
public void init(FilterConfig filterConfig) |
throws ServletException |
{ |
// get config |
this.filterConfig = filterConfig; |
if(filterConfig != null) { |
// register hibernate classes |
String toRegister = filterConfig.getInitParameter("register"); |
if(toRegister != null) { |
String[] registers = toRegister.split("\\s*;\\s*"); |
for(int i = 0; i < registers.length; i++) { |
try { |
String name = registers[i].trim(); |
if(name.equals("")) continue; |
Class cl = Class.forName(name); |
} |
catch(Exception ex) { |
logger.error("cannot register class", ex); |
} |
} |
} |
} |
} |
public void doFilter(ServletRequest request, ServletResponse response, |
49,14 → 70,8 |
chain.doFilter(request, response); |
if(HibernateUtil.isTransactionOpen()) { |
if(Boolean.TRUE.equals(request.getAttribute("TRANSACTION_FAILED"))) { |
logger.info("rollback transaction because it is marked as failed"); |
HibernateUtil.rollbackTransaction(); |
} |
else { |
logger.info("commit transaction"); |
HibernateUtil.commitTransaction(); |
} |
logger.info("commit transaction"); |
HibernateUtil.commitTransaction(); |
} |
} |
catch(Exception ex) { |
63,7 → 78,7 |
logger.error("exception by program execution", ex); |
try { |
if(HibernateUtil.isTransactionOpen()) { |
logger.info("rollback transaction because of exception"); |
logger.info("rollback transaction"); |
HibernateUtil.rollbackTransaction(); |
} |
} |