Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 800 → Rev 806

/impl/conf/language/MessageResourcesProfile.properties
103,3 → 103,16
 
profile.record.publisher.all=Instituição / Empresa / Conferência / Workshop / Revista
profile.record.publisher.paper=Conferência / Workshop / Revista
 
 
profile.autoBlockMode=Modo de Bloqueio
profile.autoBlockMode.true=Modo de Bloqueio Automatico
profile.autoBlockMode.false=Modo de Bloqueio Manual
 
profile.autoBlock=Em Automático
profile.autoBlock.true=Bloqueado
profile.autoBlock.false=Desbloqueado
 
profile.manualBlock=Em Manual
profile.manualBlock.true=Bloqueado
profile.manualBlock.false=Desbloqueado
/impl/conf/language/MessageResourcesAnnouncements.properties
39,7 → 39,7
announcement.internal.no=Público
announcement.courseunit.internal=Interno aos alunos e docentes da unidade
 
annoucement.position=Prioridade do anúncio
announcement.position=Prioridade do anúncio
 
announcements.type.news=Notícias
announcements.type.top.flash.news=Destaques
/impl/conf/language/MessageResources.properties
335,6 → 335,7
logout.ok=Caro/a {0},<br> Obrigado por usar o nosso serviço.
authentication.first.time=Olá bem-vindo, é a primeira vez que que se esta a ligar
authenticate.already.authenticated=O seu usuário já está autênticado
authenticate.blocked=O seu usuário está bloqueado pelo sistema. Para mais informações contacte o Centro Informático.
username=Nome de Utilizador
password=Palavra Passe
password.again=Repita a password
/impl/src/java/pt/estgp/estgweb/services/authenticate/AuthenticateService.java
44,7 → 44,7
throw new AuthenticateException(AuthenticateException.ALREADY_AUTHENTICATED);
 
if(username == null || username.trim().length() == 0 || password == null || password.trim().length() == 0)
throw new AuthenticateException(AuthenticateException.FAIL_AUTHENTICATION);
throw new AuthenticateException(AuthenticateException.FAIL_AUTHENTICATION);
boolean go = false;
if(USE_LDAP)
go = ldapManager.login(username,password);
78,11 → 78,11
u.setPassword(jomm.utils.BytesUtils.getDigestMD5Hex(password));
if(u.getRoles().contains("teacher"))
{
 
}
else if (u.getRoles().contains("student"))
{
 
}
}
else
94,7 → 94,19
// u.setPassword(passwordAux);
u.setPassword(jomm.utils.BytesUtils.getDigestMD5Hex(password));
}
 
//CHECK USER BLOCK's
if(!u.isAdmin() && !u.isSuperuser())
{
if(u.isAutoBlockMode() && u.isAutoBlock()
||
!u.isAutoBlockMode() && u.isManualBlock())
{
logger.warn("user:" + username + " blocked");
throw new AuthenticateException(AuthenticateException.BLOCKED);
}
}
 
logger.warn("user:" + username + " authenticated");
((UserSessionImpl)userSession).clearObjectsWithOpenTransaction();
userSession.setName(u.getName());
/impl/src/java/pt/estgp/estgweb/services/authenticate/AuthenticateException.java
6,6 → 6,7
{
public static final String ALREADY_AUTHENTICATED = "authenticate.already.authenticated";
public static final String FAIL_AUTHENTICATION = "fail.authenticate";
public static final String BLOCKED = "authenticate.blocked";
 
public AuthenticateException()
{
/impl/src/java/pt/estgp/estgweb/domain/views/UserView.java
59,6 → 59,11
//This field should be set true when a user View is representing a deleted user
private boolean deleted = false;
 
 
private boolean autoBlockMode;
private boolean autoBlock;
private boolean manualBlock;
 
private List<RecordView> creatorRecords;
private List<RecordView> contributorRecords;
 
101,6 → 106,10
this.office = user.getOffice();
this.ext = user.getExt();
 
this.autoBlockMode = user.isAutoBlockMode();
this.autoBlock = user.isAutoBlock();
this.manualBlock = user.isManualBlock();
 
if(user instanceof Teacher)
{
mainArea = ((Teacher)user).getMainArea();
114,8 → 123,30
}
}
 
public boolean isAutoBlockMode() {
return autoBlockMode;
}
 
public void setAutoBlockMode(boolean autoBlockMode) {
this.autoBlockMode = autoBlockMode;
}
 
public boolean isAutoBlock() {
return autoBlock;
}
 
public void setAutoBlock(boolean autoBlock) {
this.autoBlock = autoBlock;
}
 
public boolean isManualBlock() {
return manualBlock;
}
 
public void setManualBlock(boolean manualBlock) {
this.manualBlock = manualBlock;
}
 
public void persistViewInObjectAdmin(User user)
{
user.setName(name);
139,6 → 170,9
user.setScholarDegree(scholarDegree);
user.setOffice(office);
user.setExt(ext);
user.setAutoBlockMode(autoBlockMode);
user.setAutoBlock(autoBlock);
user.setManualBlock(manualBlock);
 
if(password != null && password.length() > 0)
{
/impl/src/updates/db/update-16.sql
New file
0,0 → 1,3
ALTER TABLE `user` ADD COLUMN `autoBlockMode` TINYINT(1) UNSIGNED DEFAULT 1 AFTER `mainArea`,
ADD COLUMN `autoBlock` TINYINT(1) UNSIGNED DEFAULT 0 AFTER `autoBlockMode`,
ADD COLUMN `manualBlock` TINYINT(1) UNSIGNED DEFAULT 0 AFTER `autoBlock`;
/impl/src/hbm/pt/estgp/estgweb/domain/GenericUser.hbm.xml
48,6 → 48,11
<property name="gmail" type="string"/>
<property name="msn" type="string"/>
<property name="scholarDegree" type="string"/>
 
<property name="autoBlockMode" type="boolean"/>
<property name="autoBlock" type="boolean"/>
<property name="manualBlock" type="boolean"/>
 
<set name="groups" table="group_users" lazy="false">
<key column="user_id"/>
<many-to-many column="group_id" class="pt.estgp.estgweb.domain.Group"/>
/impl/src/web/admin/profile/profilePersonalData.jsp
31,6 → 31,45
<html:hidden property="role"/>
<html:hidden property="typeClass"/>
<table class="form">
 
<baco:isAdmin>
<tr>
<th>
<bean:message key="profile.autoBlockMode"/>
</th>
<td>
<html:select property="userView.autoBlockMode">
<html:option value="true" key="profile.autoBlockMode.true"/>
<html:option value="false" key="profile.autoBlockMode.false"/>
</html:select>
</td>
</tr>
<tr>
<th>
<bean:message key="profile.autoBlock"/>
</th>
<td>
<html:select property="userView.autoBlock">
<html:option value="true" key="profile.autoBlock.true"/>
<html:option value="false" key="profile.autoBlock.false"/>
</html:select>
</td>
</tr>
<tr>
<th>
<bean:message key="profile.manualBlock"/>
</th>
<td>
<html:select property="userView.manualBlock">
<html:option value="true" key="profile.manualBlock.true"/>
<html:option value="false" key="profile.manualBlock.false"/>
</html:select>
</td>
</tr>
<tr>
<td colspan="2"><hr/></td>
</tr>
</baco:isAdmin>
<baco:isNotAdmin>
<tr>
<th>
/impl/src/web/admin/announcements/submitAnnouncement.jsp
41,6 → 41,7
</th>
<td>
<html:select property="announcementView.position">
<html:option value="0">NEUTRO</html:option>
<html:option value="1">1</html:option>
<html:option value="2">2</html:option>
<html:option value="3">3</html:option>
/impl/src/web/public/index.jsp
5,6 → 5,7
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
60,41 → 61,48
AnnouncementView announcementView = announcementViews.get(i);
request.setAttribute("item",announcementView);
%> <td class="cont">
<table class="flashNew" cellpadding="0" cellspacing="0"><tr>
<th class="imageContainer">
<logic:present name="item" property="smallImage">
<img alt="${item.title}" src="<%=request.getContextPath()%>/imageStream/${item.smallImage.id}">
</logic:present>
</th>
<td class="textContainer">
<logic:empty name="item" property="url">
<h2>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.title}</html:link>
</h2>
<p>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.textSummarySmall}</html:link>
</p>
</logic:empty>
<logic:notEmpty name="item" property="url">
<logic:equal value="false" name="item" property="textBiggerThenPermited">
<h2>
<html:link href="${item.url}">${item.title}</html:link>
</h2>
<p>
<html:link href="${item.url}">${item.textSummarySmall}</html:link>
</p>
</logic:equal>
<logic:equal value="true" name="item" property="textBiggerThenPermited">
<h2>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.title}</html:link>
</h2>
<p>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.textSummarySmall}</html:link>
</p>
</logic:equal>
</logic:notEmpty>
</td>
</tr></table>
<table class="flashNew" cellpadding="0" cellspacing="0">
<tr>
<th class="imageContainer">
<logic:present name="item" property="smallImage">
<img alt="${item.title}" src="<%=request.getContextPath()%>/imageStream/${item.smallImage.id}">
</logic:present>
</th>
<td class="textContainer">
<logic:empty name="item" property="url">
<h2>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.title}</html:link>
</h2>
<p>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.textSummarySmall}</html:link>
</p>
</logic:empty>
<logic:notEmpty name="item" property="url">
<logic:equal value="false" name="item" property="textBiggerThenPermited">
<h2>
<html:link href="${item.url}">${item.title}</html:link>
</h2>
<p>
<html:link href="${item.url}">${item.textSummarySmall}</html:link>
</p>
</logic:equal>
<logic:equal value="true" name="item" property="textBiggerThenPermited">
<h2>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.title}</html:link>
</h2>
<p>
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.textSummarySmall}</html:link>
</p>
</logic:equal>
</logic:notEmpty>
</td>
</tr>
<baco:canManage name="item">
<tr>
<td colspan="2"><a href="<%=request.getContextPath()%>/startEditAnnouncement.do?id=${item.id}">Editar</a></td>
</tr>
</baco:canManage>
</table>
<%
}
%>
154,7 → 162,13
</logic:equal>
</logic:notEmpty>
</td>
</tr></table>
</tr>
<baco:canManage name="item">
<tr>
<td colspan="2"><a href="<%=request.getContextPath()%>/startEditAnnouncement.do?id=${item.id}">Editar</a></td>
</tr>
</baco:canManage>
</table>
<%
}
i = j;
/impl/src/web/public/announcements/announcementsPortalLeft.jsp
51,6 → 51,9
<tr>
<td>
<div class="portalAnnouncementTop">
<baco:canManage name="item">
( <a href="<%=request.getContextPath()%>/startEditAnnouncement.do?id=${item.id}">Editar</a> )
</baco:canManage>
<div class="imageAnnouncementTop">
 
<%
114,6 → 117,7
<%}%>
</logic:notEmpty>
</div>
 
</div>
</td>
</tr>
/impl/src/web/public/announcements/announcements.jsp
6,6 → 6,7
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%
38,6 → 39,9
<html:link action="/loadAnnouncement?id=${item.id}&dispatch=load">${item.title}</html:link>
<%}%>
</logic:notEmpty>
<baco:canManage name="item">
( <a href="<%=request.getContextPath()%>/startEditAnnouncement.do?id=${item.id}">Editar</a> )
</baco:canManage>
</li>
</logic:equal>
</logic:iterate>