Corrections travail en groupe

This commit is contained in:
2008-02-24 18:46:33 +00:00
parent 6bae365791
commit 7227de0598
29 changed files with 438 additions and 191 deletions

View File

@@ -103,23 +103,24 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
/secure/**=ROLE_ADMIN,ROLE_AUTHOR,ROLE_PCMEMBER /secure/**=ROLE_ADMIN,ROLE_AUTHOR,ROLE_PCMEMBER
/secure/**=IS_AUTHENTICATED_REMEMBERED /secure/**=IS_AUTHENTICATED_REMEMBERED
/listarticle.htm=ROLE_CHAIRMAN /listarticle.htm=ROLE_CHAIRMAN
/managearticle.htm=ROLE_USER /managearticle.htm=ROLE_AUTHOR
/registeruser.htm=ROLE_ANONYMOUS,ROLE_USER /registeruser.htm=ROLE_ANONYMOUS,ROLE_USER
/submissionarticle.htm=ROLE_USER /submissionarticle.htm=ROLE_USER
/choosepreference.htm=ROLE_PCMEMBER /choosepreference.htm=ROLE_PCMEMBER
/dispatcharticlelist.htm=ROLE_PCMEMBER /conflictlist.htm=ROLE_CHAIRMAN
/dispatcharticle.htm=ROLE_PCMEMBER /dispatcharticle.htm=ROLE_CHAIRMAN
/delegatearticle.htm=ROLE_PCMEMBER
/addconference.htm=ROLE_CHAIRMAN,ROLE_CONFERENCE_CREATOR /addconference.htm=ROLE_CHAIRMAN,ROLE_CONFERENCE_CREATOR
/evaluation.htm=ROLE_PCMEMBER,ROLE_REFEREE /evaluation.htm=ROLE_PCMEMBER,ROLE_REFEREE
/createreport.htm=ROLE_PCMEMBER,ROLE_REFEREE /createreport.htm=ROLE_PCMEMBER,ROLE_REFEREE
/listconference.htm=ROLE_USER
/validatearticle.htm=ROLE_CHAIRMAN /validatearticle.htm=ROLE_CHAIRMAN
/validateorreject.htm=ROLE_CHAIRMAN /validateorreject.htm=ROLE_CHAIRMAN
/listevaluation.htm=ROLE_USER /listevaluation.htm=ROLE_PCMEMBER,ROLE_REFEREE
/download.htm=ROLE_USER /download.htm=ROLE_USER
/deletearticle.htm=ROLE_AUTHOR,ROLE_CHAIRMAN,ROLE_ADMIN /deletearticle.htm=ROLE_AUTHOR
/listreport.htm=ROLE_PCMEMBER,ROLE_REFEREE,ROLE_CHAIRMAN /listreport.htm=ROLE_USER
/detailarticle.htm=ROLE_USER /detailarticle.htm=ROLE_USER
/admin.htm=ROLE_ADMIN
/**=IS_AUTHENTICATED_ANONYMOUSLY /**=IS_AUTHENTICATED_ANONYMOUSLY
</value> </value>
</property> </property>

View File

@@ -18,9 +18,11 @@ home.referee=I am a program committee member. How Yacos can help me ?
home.referee.txt=If you are the chairman, a PC member or simply a referee, thanks to yacos you can follow articles posted by authors.<br />As chairman, you can dispatch articles to your members for review and rating, manage your conference, the deadlines...<br />As the PC member or referee, you can review an article, post your comments and rate it, express your preference toward the submitted articles,... home.referee.txt=If you are the chairman, a PC member or simply a referee, thanks to yacos you can follow articles posted by authors.<br />As chairman, you can dispatch articles to your members for review and rating, manage your conference, the deadlines...<br />As the PC member or referee, you can review an article, post your comments and rate it, express your preference toward the submitted articles,...
home.youknow=So now you know... home.youknow=So now you know...
home.link.choose=Choose one conference home.link.choose=Choose one conference
home.link.userBoard=Go to your dashboard
connected.noconference.title=No conference selected connected.noconference.title=No conference selected
connected.noconference.warning=You must choose a conference to access all your features : connected.noconference.warning=You must choose a conference to access all your features :
connected.noconference.warning=Or you can see a recap of your current involvement in the conferences available in the system :
article.post.noconference=You must choose a conference before post or edit an article. article.post.noconference=You must choose a conference before post or edit an article.
conference.detail.description=Description conference.detail.description=Description
@@ -207,6 +209,7 @@ dispatch.title=Dispatch the articles to the members
# Conference Form # Conference Form
step=Step ({0}/{1}) step=Step ({0}/{1})
conference.remainingTokens=You have {0} tokens left to create new conferences.<br/>\n You can ask to the admin if you need more.
conference.help.step1= conference.help.step1=
conference.help.step2=This step is used to define some dates like the starting date for the conference.<br/>\nYou just have to click on a field and the calendar will appear. conference.help.step2=This step is used to define some dates like the starting date for the conference.<br/>\nYou just have to click on a field and the calendar will appear.
conference.help.step3=Here you can add some constraints at your conference like the number of pages by articles or the type of file you want the authors to use. conference.help.step3=Here you can add some constraints at your conference like the number of pages by articles or the type of file you want the authors to use.

View File

@@ -6,7 +6,7 @@
<!-- Doctype --> <!-- Doctype -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<link rel="icon" type="image/png" href="./images/favicon.png" /> <link rel="icon" type="image/png" href="./images/favicon.png" />
<title><fmt:message key="title" /></title> <title><fmt:message key="title" /></title>
@@ -14,7 +14,7 @@
<script type='text/javascript' src='./javascripts/prototype.js'></script> <script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript' src='./javascripts/rounded_boxes.js'></script> <script type='text/javascript' src='./javascripts/rounded_boxes.js'></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[
var LoginManager = Class.create({ var LoginManager = Class.create({
initialize: function(inputField, inputField2){ initialize: function(inputField, inputField2){
$(inputField).observe("keypress", this.KeyPressHandler.bindAsEventListener(this)); $(inputField).observe("keypress", this.KeyPressHandler.bindAsEventListener(this));
@@ -30,7 +30,7 @@ var LoginManager = Class.create({
} }
} }
}); });
//]]>
</script> </script>
<decorator:head /> <decorator:head />
</head> </head>

View File

@@ -15,20 +15,21 @@
<!-- MENU : ROLE_USER for general option --> <!-- MENU : ROLE_USER for general option -->
<authz:authorize ifAllGranted="ROLE_USER"> <authz:authorize ifAllGranted="ROLE_USER">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.general.title" /></h4> <h4><fmt:message key="menu.general.title" /></h4>
<ul> <ul>
<li><a href="<c:url value="userBoard.htm"/>"><fmt:message key="menu.general.userBoard" /></a></li> <li><a href="<c:url value="userBoard.htm"/>"><fmt:message key="menu.general.userBoard" /></a></li>
<li><a href="<c:url value="main.htm"/>"><fmt:message key="menu.general.confInfo" /></a></li> <li><a href="<c:url value="main.htm"/>"><fmt:message key="menu.general.confInfo" /></a></li>
<li><a href="<c:url value="listConference.htm"/>"><fmt:message key="conference.linkMenu.choose" /></a></li>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>
<!-- MENU : CHAIRMAN --> <!-- MENU : CHAIRMAN -->
<authz:authorize ifAllGranted="ROLE_CHAIRMAN"> <authz:authorize ifAnyGranted="ROLE_CHAIRMAN,ROLE_CONFERENCE_CREATOR">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.chairman.title" /></h4> <h4><fmt:message key="menu.chairman.title" /></h4>
<ul> <ul>
<authz:authorize ifAllGranted="ROLE_CONFERENCE_CREATOR"> <authz:authorize ifAllGranted="ROLE_CONFERENCE_CREATOR">
@@ -41,13 +42,13 @@
<li><a href="<c:url value="conflictList.htm"/>"><fmt:message key="menu.chairman.article.conflict" /></a></li> <li><a href="<c:url value="conflictList.htm"/>"><fmt:message key="menu.chairman.article.conflict" /></a></li>
<li><a href="<c:url value="forum.htm?role=chairman"/>"><fmt:message key="menu.chairman.article.discussion" /></a></li> <li><a href="<c:url value="forum.htm?role=chairman"/>"><fmt:message key="menu.chairman.article.discussion" /></a></li>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>
<!-- MENU : ROLE_PCMEMBER --> <!-- MENU : ROLE_PCMEMBER -->
<authz:authorize ifAllGranted="ROLE_PCMEMBER"> <authz:authorize ifAllGranted="ROLE_PCMEMBER">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.pcmember.title" /></h4> <h4><fmt:message key="menu.pcmember.title" /></h4>
<ul> <ul>
<li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="menu.pcmember.article.preference" /></a></li> <li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="menu.pcmember.article.preference" /></a></li>
@@ -55,24 +56,24 @@
<li><a href="<c:url value="listEvaluation.htm?role=pcmember"/>"><fmt:message key="menu.pcmember.article.evaluation.modify" /></a></li> <li><a href="<c:url value="listEvaluation.htm?role=pcmember"/>"><fmt:message key="menu.pcmember.article.evaluation.modify" /></a></li>
<li><a href="<c:url value="forum.htm?role=pcmember"/>"><fmt:message key="menu.pcmember.article.discussion" /></a></li> <li><a href="<c:url value="forum.htm?role=pcmember"/>"><fmt:message key="menu.pcmember.article.discussion" /></a></li>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>
<!-- MENU : ROLE_REFEREE --> <!-- MENU : ROLE_REFEREE -->
<authz:authorize ifAllGranted="ROLE_REFEREE"> <authz:authorize ifAllGranted="ROLE_REFEREE">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.referee.title" /></h4> <h4><fmt:message key="menu.referee.title" /></h4>
<ul> <ul>
<li><a href="<c:url value="listEvaluation.htm?role=referee"/>"><fmt:message key="menu.referee.article.evaluation.modify" /></a></li> <li><a href="<c:url value="listEvaluation.htm?role=referee"/>"><fmt:message key="menu.referee.article.evaluation.modify" /></a></li>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>
<!-- MENU : ROLE_AUTHOR for articles management and ROLE_USER for submission --> <!-- MENU : ROLE_AUTHOR for articles management and ROLE_USER for submission -->
<authz:authorize ifAllGranted="ROLE_USER"> <authz:authorize ifAllGranted="ROLE_USER">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.author.title" /></h4> <h4><fmt:message key="menu.author.title" /></h4>
<ul> <ul>
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li> <li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li>
@@ -80,18 +81,18 @@
<li><a href="<c:url value="manageArticle.htm"/>"><fmt:message key="menu.author.article.modify" /></a></li> <li><a href="<c:url value="manageArticle.htm"/>"><fmt:message key="menu.author.article.modify" /></a></li>
</authz:authorize> </authz:authorize>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>
<!-- MENU : ROLE_ANONYMOUS --> <!-- MENU : ROLE_ANONYMOUS -->
<authz:authorize ifNotGranted="ROLE_USER"> <authz:authorize ifNotGranted="ROLE_USER">
<div id="mainmenubloc"> <div class="mainmenubloc">
<h4><fmt:message key="menu.anonymous.title" /></h4> <h4><fmt:message key="menu.anonymous.title" /></h4>
<ul> <ul>
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.anonymous.article.submission" /></a></li> <li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.anonymous.article.submission" /></a></li>
</ul> </ul>
<div id="footer"></div> <div class="footer"></div>
</div> </div>
</authz:authorize> </authz:authorize>

View File

@@ -18,7 +18,13 @@
<fmt:param value="5" /> <fmt:param value="5" />
</fmt:message> </fmt:message>
<form:form commandName="formConference" name="monForm"> <p class="formHelp">
<fmt:message key="conference.remainingTokens">
<fmt:param value="${currentUser.conferenceCreationTokens}"/>
</fmt:message>
</p>
<form:form commandName="formConference">
<table class="form"> <table class="form">
<tbody> <tbody>
<tr> <tr>
@@ -50,7 +56,7 @@
<tfoot> <tfoot>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" align="middle" name="_target1" <td><input type="submit" name="_target1"
value="Next" /></td> value="Next" /></td>
</tr> </tr>
</tfoot> </tfoot>

View File

@@ -23,7 +23,7 @@
</fmt:message> </fmt:message>
<p class="formHelp"><fmt:message key="conference.help.step2" /></p> <p class="formHelp"><fmt:message key="conference.help.step2" /></p>
<form:form commandName="formConference" name="monForm"> <form:form commandName="formConference">
<table class="form"> <table class="form">
<tbody> <tbody>
<tr> <tr>

View File

@@ -21,7 +21,7 @@
</fmt:message> </fmt:message>
<p class="formHelp"><fmt:message key="conference.help.step3" /></p> <p class="formHelp"><fmt:message key="conference.help.step3" /></p>
<form:form commandName="formConference" name="monForm"> <form:form commandName="formConference">
<table> <table>
<thead> <thead>
<tr> <tr>

View File

@@ -9,7 +9,7 @@
<script type='text/javascript' src='./javascripts/prototype.js'></script> <script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript'> <script type='text/javascript'>
//<![CDATA[
function init() { function init() {
fillTable2(); fillTable2();
fillTable(); fillTable();
@@ -157,6 +157,7 @@ var CritereManager = Class.create({
} }
} }
}); });
//]]>
</script> </script>
</head> </head>
@@ -178,7 +179,7 @@ var CritereManager = Class.create({
</fmt:message> </fmt:message>
<p class="formHelp"><fmt:message key="conference.help.step4" /></p> <p class="formHelp"><fmt:message key="conference.help.step4" /></p>
<form:form commandName="formConference" name="monForm"> <form:form commandName="formConference">
<table> <table>
<tbody> <tbody>
<tr> <tr>

View File

@@ -12,7 +12,7 @@
<script type='text/javascript' src='./javascripts/scriptaculous.js'></script> <script type='text/javascript' src='./javascripts/scriptaculous.js'></script>
<script type='text/javascript'> <script type='text/javascript'>
//<![CDATA[
function init() { function init() {
dwr.engine.setAsync(false); // a v<>rifier dwr.engine.setAsync(false); // a v<>rifier
//AddCriteriaJS.initPerson(); //AddCriteriaJS.initPerson();
@@ -86,7 +86,7 @@ function addPerson(eleid) {
function deletePerson(eleid) { function deletePerson(eleid) {
var person = peopleCache2[eleid.substring(11)]; var person = peopleCache2[eleid.substring(11)];
if (confirm("Are you sure you want to delete " + person.firstName + " " + person.lastName + "?")) { if (confirm("Are you sure you want to remove " + person.firstName + " " + person.lastName + "?")) {
dwr.engine.beginBatch(); dwr.engine.beginBatch();
AddCriteriaJS.deletePerson(person); AddCriteriaJS.deletePerson(person);
filterUser(null, dwr.util.getValue("myfilter")); filterUser(null, dwr.util.getValue("myfilter"));
@@ -104,7 +104,7 @@ function filterUser(el, value) {
AddCriteriaJS.fillUser(value); AddCriteriaJS.fillUser(value);
setTimeout("fillTable()", 500); setTimeout("fillTable()", 500);
} }
//]]>
</script> </script>
</head> </head>
@@ -126,7 +126,7 @@ function filterUser(el, value) {
<p class="formHelp"><fmt:message key="conference.help.step5" /></p> <p class="formHelp"><fmt:message key="conference.help.step5" /></p>
<form:form commandName="formConference" name="monForm"> <form:form commandName="formConference">
<table> <table>
<tbody> <tbody>
<tr> <tr>
@@ -166,7 +166,7 @@ function filterUser(el, value) {
<tr id="patternadded" style="display: none;"> <tr id="patternadded" style="display: none;">
<td><span id="tablePersonadded">Person</span></td> <td><span id="tablePersonadded">Person</span></td>
<td><a id="supprPerson" href="#" <td><a id="supprPerson" href="#"
onclick="deletePerson(this.id)">Delete</a></td> onclick="deletePerson(this.id)">Remove</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -11,7 +11,7 @@
</head> </head>
<body> <body>
<h4>YACOS Administration</h4>
<div class="cbb"> <div class="cbb">
<h2>Edit users</h2> <h2>Edit users</h2>
<label>Filter :<input id="userFilterInput" type="text" name="userFilter"/></label> <label>Filter :<input id="userFilterInput" type="text" name="userFilter"/></label>
@@ -22,8 +22,13 @@
<div class="dynamicListPlaceholder"> <div class="dynamicListPlaceholder">
Please enter a value in the filter field. Please enter a value in the filter field.
</div> </div>
<div class="dynamicListItem"> <div class="dynamicListItem" id="person_item_pattern" style="display:none;height:0px;width:0px;">
<div id="person_name" style="display:table-cell;">Name</div>
<div style="display:table-cell">
<a href="#" id="person_add_token">+</a>
<span id="person_num_tokens">Num Tokens</span>
<a href="#" id="person_remove_token">-</a>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -8,7 +8,7 @@
<script type='text/javascript' src='./dwr/util.js'></script> <script type='text/javascript' src='./dwr/util.js'></script>
<script type='text/javascript' src='./dwr/interface/DelegateArticlesJS.js'></script> <script type='text/javascript' src='./dwr/interface/DelegateArticlesJS.js'></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[
var selectedArticleId; var selectedArticleId;
var articleId; var articleId;
var pattern; var pattern;
@@ -111,13 +111,13 @@
function removeRemote() { function removeRemote() {
var itemsToRemove = $('refereesList'+articleId).select('div.selected'); var itemsToRemove = $('refereesList'+articleId).select('div.selected');
var membersId = itemsToRemove.pluck('id'); var refereeId = itemsToRemove.pluck('id');
//var articleId = $('articleId').value; //var articleId = $('articleId').value;
DelegateArticlesJS.removeMembers(membersId, articleId, remove); DelegateArticlesJS.removeReferee(refereeId, articleId, remove);
} }
function remove() { function remove() {
var itemsToRemove = $('membersArticleList'+articleId).select('div.selected'); var itemsToRemove = $('refereesArticleList'+articleId).select('div.selected');
//suppression dans la premi<6D>re liste //suppression dans la premi<6D>re liste
itemsToRemove.invoke('remove'); itemsToRemove.invoke('remove');
@@ -135,12 +135,12 @@
var itemsToAdd = $('refereesList'+articleId).select('div.selected'); var itemsToAdd = $('refereesList'+articleId).select('div.selected');
var refereeId = itemsToAdd.pluck('id'); var refereeId = itemsToAdd.pluck('id');
//var articleId = $('articleId').value; //var articleId = $('articleId').value;
DelegateArticlesJS.addReferee(membersId, articleId, add()); DelegateArticlesJS.addReferee(refereeId, articleId, add());
} }
function add() { function add() {
var itemsToAdd = $('refereeList'+articleId).select('div.selected'); var itemsToAdd = $('refereesList'+articleId).select('div.selected');
//suppression dans la premi<6D>re liste //suppression dans la premi<6D>re liste
itemsToAdd.invoke('remove'); itemsToAdd.invoke('remove');
@@ -159,7 +159,8 @@
itemsToRemove.invoke('remove'); itemsToRemove.invoke('remove');
itemsToRemove = $('refereesList'+artId).select('div.dynamicListItem'); itemsToRemove = $('refereesList'+artId).select('div.dynamicListItem');
itemsToRemove.invoke('remove'); itemsToRemove.invoke('remove');
} }
//]]>
</script> </script>
</head> </head>

View File

@@ -7,8 +7,9 @@
<script type='text/javascript' src='./dwr/engine.js'></script> <script type='text/javascript' src='./dwr/engine.js'></script>
<script type='text/javascript' src='./dwr/util.js'></script> <script type='text/javascript' src='./dwr/util.js'></script>
<script type='text/javascript' src='./dwr/interface/DispatchArticlesJS.js'></script> <script type='text/javascript' src='./dwr/interface/DispatchArticlesJS.js'></script>
<script type="text/javascript"> <script type="text/javascript">
// Mandatory for XHTML strict validation
//<![CDATA[
var selectedArticleId; var selectedArticleId;
var articleId; var articleId;
var pattern; var pattern;
@@ -155,7 +156,8 @@
itemsToRemove.invoke('remove'); itemsToRemove.invoke('remove');
itemsToRemove = $('membersList'+artId).select('div.dynamicListItem'); itemsToRemove = $('membersList'+artId).select('div.dynamicListItem');
itemsToRemove.invoke('remove'); itemsToRemove.invoke('remove');
} }
//]]>
</script> </script>
</head> </head>
@@ -196,8 +198,8 @@
</div> </div>
</td><td> </td><td>
<input type="button" id="addButton" value="add>>>" onclick="addRemote()"/><br/> <input type="button" name="addButton" value="add&gt;&gt;&gt;" onclick="addRemote()"/><br/>
<input type="button" id="removeButton" value="<<<remove" onclick="removeRemote()"/> <input type="button" name="removeButton" value="&lt;&lt;&lt;remove" onclick="removeRemote()"/>
</td><td> </td><td>
<h1><fmt:message key="members.list2"/></h1> <h1><fmt:message key="members.list2"/></h1>
<div id="membersArticleList${article.id}" style="border:1px solid black; max-height:150px;overflow:auto;"> <div id="membersArticleList${article.id}" style="border:1px solid black; max-height:150px;overflow:auto;">
@@ -207,8 +209,8 @@
</div> </div>
</div> </div>
</div> </div>
</c:forEach> </c:forEach>
</body> </body>
</html> </html>

View File

@@ -6,6 +6,7 @@
<script type='text/javascript' src='./javascripts/prototype.js'></script> <script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[
function HideRegistered() { function HideRegistered() {
var listElem = $$('.isRegistered'); var listElem = $$('.isRegistered');
for (var i = 0; i < listElem.length; i++) { for (var i = 0; i < listElem.length; i++) {
@@ -25,6 +26,7 @@
listElem[i].style.display = ""; listElem[i].style.display = "";
} }
} }
//]]>
</script> </script>
</head> </head>

View File

@@ -29,7 +29,7 @@
</td> </td>
<td> <td>
<form action="<c:url value='j_acegi_security_check'/>" method="POST" id="mainformlogin2"> <form action="<c:url value='j_acegi_security_check'/>" method="post" id="mainformlogin2">
<table class="content_table"> <table class="content_table">
<tr> <tr>
<td width="100" align="left"> <td width="100" align="left">

View File

@@ -47,8 +47,14 @@
<!-- Connected but no conference chosen --> <!-- Connected but no conference chosen -->
<h4 class="title"><fmt:message key="connected.noconference.title" /></h4> <h4 class="title"><fmt:message key="connected.noconference.title" /></h4>
<div class="warningBox"> <div class="warningBox">
<fmt:message key="connected.noconference.warning" /> <p>
<a href="<c:url value="listConference.htm"/>"><fmt:message key="home.link.choose" /></a> <fmt:message key="connected.noconference.warning" />
<a href="<c:url value="listConference.htm"/>"><fmt:message key="home.link.choose" /></a>
</p>
<p>
<fmt:message key="connected.noconference.warning.userBoard" />
<a href="<c:url value="userBoard.htm"/>"><fmt:message key="home.link.userBoard" /></a>
</p>
</div> </div>
</authz:authorize> </authz:authorize>
<authz:authorize ifAllGranted="ROLE_ANONYMOUS"> <authz:authorize ifAllGranted="ROLE_ANONYMOUS">

View File

@@ -8,7 +8,7 @@
<script type='text/javascript' src='./javascripts/effects.js'></script> <script type='text/javascript' src='./javascripts/effects.js'></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[
function showConfAll() { function showConfAll() {
if ($('confList').visible()) if ($('confList').visible())
$('confList').fade(); $('confList').fade();
@@ -64,7 +64,7 @@ function showArticleReferee() {
else else
$('articleListReferee').appear(); $('articleListReferee').appear();
} }
//]]>
</script> </script>
</head> </head>
@@ -98,32 +98,21 @@ function showArticleReferee() {
</c:if> </c:if>
</div> </div>
<h3 class="descriptionTitle">Chairman's informations</h3> <a name="listConfAuthor"></a>
<div class="textBox"> <h3 class="descriptionTitle">Author's informations</h3>
You are Chairman in <b>${numberChairman}</b> conference(s)<br /><br /> <div class="textBox">
You are Author in <b>${numberAuthor}</b> conference(s)<br /><br />
<c:choose>
<c:when test="${numberCreationTokens} != 0">
You can create <b>${numberCreationTokens}</b> conference(s). Click
<a href="addConference.htm">here</a> to create one now.
</c:when>
<c:otherwise>
You can't create a conference at the moment. If you want to create a conference, you should address to the <a href="mailto:admin@yacos.org">administrator</a> of this site.
</c:otherwise>
</c:choose>
<a name="listConfChairman"></a>
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
<br /><br /> If you want to see the list of conferences you are registered in, click <a href="#listConfAuthor" onclick="showConfAuthor();">here</a>.
If you want to see the list of conferences you are registered in, click <a href="#listConfChairman" onclick="showConfChairman();">here</a>.
<div id="confListChairman" style="display: none;"> <div id="confListAuthor" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
<c:forEach items="${listConfForUser}" var="conf"> <c:forEach items="${listConfForUser}" var="conf">
<c:forEach items="${listRole}" var="role"> <c:forEach items="${listRole}" var="role">
<c:if test="${conf.id == role.conference.id and role.type == 'CHAIRMAN'}"> <c:if test="${conf.id == role.conference.id and role.type == 'AUTHOR'}">
<tr> <tr>
<td align="center">${conf.title}</td> <td align="center">${conf.title}</td>
<td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td> <td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td>
@@ -134,65 +123,25 @@ function showArticleReferee() {
</tbody> </tbody>
</table> </table>
</div> </div>
<br /><br />
</c:if> </c:if>
<a name="listArticleAuthor"></a>
</div> You have posted <b>${numberArticle}</b> article(s).<br /><br />
<a name="listConfPcmember"></a>
<h3 class="descriptionTitle">PCMember's informations</h3>
<div class="textBox">
You are PCMember in <b>${numberPCMember}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#listConfPcmember" onclick="showConfPcmember();">here</a>. If you want to see the list of articles you have submitted, click <a href="#listArticleAuthor" onclick="showArticleAll();">here</a>.
<div id="confListPcmember" style="display: none;"> <div id="articleList" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
<c:forEach items="${listConfForUser}" var="conf"> <c:forEach var="article" items="${listAllArticle}" varStatus="i">
<c:forEach items="${listRole}" var="role">
<c:if test="${conf.id == role.conference.id and role.type == 'PCMEMBER'}">
<tr>
<td align="center">${conf.title}</td>
<td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td>
</tr>
</c:if>
</c:forEach>
</c:forEach>
</tbody>
</table>
</div>
<br /><br />
</c:if>
<a name="listArticlePcMember"></a>
You have <b>${numberArticlePCMember}</b> article(s) in your evaluation list.<br /><br />
<c:if test="${not empty listArticlePCMember}">
If you want to see the list of articles you have in your evaluation list, click <a href="#listArticlePcMember" onclick="showArticlePcMember();">here</a>.
<div id="articleListPcMember" style="display: none;">
<table width="100%" align="center">
<tbody>
<c:forEach var="article" items="${listArticlePCMember}" varStatus="i">
<tr> <tr>
<td align="center" width="25%">${article.title}</td> <td align="center" width="25%">${article.title}</td>
<td align="center" width="25%"> <td align="center" width="25%">
<c:choose>
<c:when test="${not empty article.referee}">
Delegated to:<br />
<c:forEach var="referee" items="${article.referee}">
${referee.firstName} ${referee.lastName}<br/>
</c:forEach>
</c:when>
<c:otherwise>
<c:if test="${article.state == 'SUBMITED'}"> <c:if test="${article.state == 'SUBMITED'}">
To evaluate Submitted
</c:if> </c:if>
<c:if test="${article.state == 'EVALUATED'}"> <c:if test="${article.state == 'EVALUATED'}">
Evaluated Evaluated
@@ -202,10 +151,7 @@ function showArticleReferee() {
</c:if> </c:if>
<c:if test="${article.state == 'ACCEPTED'}"> <c:if test="${article.state == 'ACCEPTED'}">
Accepted Accepted
</c:if> </c:if>
</c:otherwise>
</c:choose>
</td> </td>
<td align="center" width="25%"> <td align="center" width="25%">
<a href="chooseConference.htm?idConf=${article.conference.id}">${article.conference.title}</a> <a href="chooseConference.htm?idConf=${article.conference.id}">${article.conference.title}</a>
@@ -292,21 +238,21 @@ function showArticleReferee() {
</c:if> </c:if>
</div> </div>
<a name="listConfAuthor"></a> <a name="listConfPcmember"></a>
<h3 class="descriptionTitle">Author's informations</h3> <h3 class="descriptionTitle">PCMember's informations</h3>
<div class="textBox"> <div class="textBox">
You are Author in <b>${numberAuthor}</b> conference(s)<br /><br /> You are PCMember in <b>${numberPCMember}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#listConfAuthor" onclick="showConfAuthor();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConfPcmember" onclick="showConfPcmember();">here</a>.
<div id="confListAuthor" style="display: none;"> <div id="confListPcmember" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
<c:forEach items="${listConfForUser}" var="conf"> <c:forEach items="${listConfForUser}" var="conf">
<c:forEach items="${listRole}" var="role"> <c:forEach items="${listRole}" var="role">
<c:if test="${conf.id == role.conference.id and role.type == 'AUTHOR'}"> <c:if test="${conf.id == role.conference.id and role.type == 'PCMEMBER'}">
<tr> <tr>
<td align="center">${conf.title}</td> <td align="center">${conf.title}</td>
<td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td> <td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td>
@@ -317,25 +263,34 @@ function showArticleReferee() {
</tbody> </tbody>
</table> </table>
</div> </div>
<br /><br /> <br /><br />
</c:if> </c:if>
<a name="listArticleAuthor"></a>
You have posted <b>${numberArticle}</b> article(s).<br /><br />
<c:if test="${not empty listConfForUser}"> <a name="listArticlePcMember"></a>
If you want to see the list of articles you have submitted, click <a href="#listArticleAuthor" onclick="showArticleAll();">here</a>. You have <b>${numberArticlePCMember}</b> article(s) in your evaluation list.<br /><br />
<c:if test="${not empty listArticlePCMember}">
If you want to see the list of articles you have in your evaluation list, click <a href="#listArticlePcMember" onclick="showArticlePcMember();">here</a>.
<div id="articleList" style="display: none;"> <div id="articleListPcMember" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
<c:forEach var="article" items="${listAllArticle}" varStatus="i"> <c:forEach var="article" items="${listArticlePCMember}" varStatus="i">
<tr> <tr>
<td align="center" width="25%">${article.title}</td> <td align="center" width="25%">${article.title}</td>
<td align="center" width="25%"> <td align="center" width="25%">
<c:choose>
<c:when test="${not empty article.referee}">
Delegated to:<br />
<c:forEach var="referee" items="${article.referee}">
${referee.firstName} ${referee.lastName}<br/>
</c:forEach>
</c:when>
<c:otherwise>
<c:if test="${article.state == 'SUBMITED'}"> <c:if test="${article.state == 'SUBMITED'}">
Submitted To evaluate
</c:if> </c:if>
<c:if test="${article.state == 'EVALUATED'}"> <c:if test="${article.state == 'EVALUATED'}">
Evaluated Evaluated
@@ -345,7 +300,10 @@ function showArticleReferee() {
</c:if> </c:if>
<c:if test="${article.state == 'ACCEPTED'}"> <c:if test="${article.state == 'ACCEPTED'}">
Accepted Accepted
</c:if> </c:if>
</c:otherwise>
</c:choose>
</td> </td>
<td align="center" width="25%"> <td align="center" width="25%">
<a href="chooseConference.htm?idConf=${article.conference.id}">${article.conference.title}</a> <a href="chooseConference.htm?idConf=${article.conference.id}">${article.conference.title}</a>
@@ -361,6 +319,48 @@ function showArticleReferee() {
</c:if> </c:if>
</div> </div>
<h3 class="descriptionTitle">Chairman's informations</h3>
<div class="textBox">
You are Chairman in <b>${numberChairman}</b> conference(s)<br /><br />
<c:choose>
<c:when test="${numberCreationTokens} != 0">
You can create <b>${numberCreationTokens}</b> conference(s). Click
<a href="addConference.htm">here</a> to create one now.
</c:when>
<c:otherwise>
You can't create a conference at the moment. If you want to create a conference, you should address to the <a href="mailto:admin@yacos.org">administrator</a> of this site.
</c:otherwise>
</c:choose>
<a name="listConfChairman"></a>
<c:if test="${not empty listConfForUser}">
<br /><br />
If you want to see the list of conferences you are registered in, click <a href="#listConfChairman" onclick="showConfChairman();">here</a>.
<div id="confListChairman" style="display: none;">
<table width="100%" align="center">
<tbody>
<c:forEach items="${listConfForUser}" var="conf">
<c:forEach items="${listRole}" var="role">
<c:if test="${conf.id == role.conference.id and role.type == 'CHAIRMAN'}">
<tr>
<td align="center">${conf.title}</td>
<td align="center"><a href="chooseConference.htm?idConf=${conf.id}">Select</a></td>
</tr>
</c:if>
</c:forEach>
</c:forEach>
</tbody>
</table>
</div>
</c:if>
</div>
</body> </body>
</html> </html>

View File

@@ -338,7 +338,11 @@
<dwr:convert type="bean" <dwr:convert type="bean"
class="org.yacos.web.PCmember.controller.RefereeBean"> class="org.yacos.web.PCmember.controller.RefereeBean">
</dwr:convert> </dwr:convert>
<dwr:convert type="bean"
class="org.yacos.web.admin.DWRPersonBean">
</dwr:convert>
<dwr:convert type="bean" class="java.lang.StackTraceElement"></dwr:convert> <dwr:convert type="bean" class="java.lang.StackTraceElement"></dwr:convert>
<dwr:convert type="exception" class="java.lang.exception"></dwr:convert> <dwr:convert type="exception" class="java.lang.exception"></dwr:convert>

View File

@@ -1,30 +1,59 @@
var AdminController = Class.create({ var AdminManager = Class.create({
initialize: function(){ initialize: function(){
this.input = $('userFilterInput'); this.input = $('userFilterInput');
input.observe('keyPress',this.userInputKeyHandler.bind(this)); this.input.observe('keyPress',this.userInputKeyHandler.bind(this));
this.fillUserList();
}, },
addConferenceCreationToken: function(event){ addConferenceCreationToken: function(event,user_object){
AdminController.addConferenceCreationToken(user_object.login,
function(updated_number){
dwr.util.setValue("person_num_tokens"+"_"+user_object.id,
updated_number);
}
);
event.stop();
}, },
removeConferenceCreationToken: function(event){ removeConferenceCreationToken: function(event,user_object){
AdminController.removeConferenceCreationToken(user_object.login,
function(updated_number){
dwr.util.setValue("person_num_tokens"+"_"+user_object.id,
updated_number);
}
);
event.stop();
}, },
userInputKeyHandler: function(){ userInputKeyHandler: function(){
switch(event.keyCode){
case Event.KEY_RETURN:
this.addRemote();
event.stop();
return false;
}
}, },
fillUserList: function(){ fillUserList: function(){
AdminController.getUserList(function(people){ AdminController.getUsersList(function(people){
var newPersonItem; var content;
var elemName; var elemName;
var contentValue; var contentValue;
var id;
var person;
for (var i = 0; i < people.length; i++) { for (var i = 0; i < people.length; i++) {
newPersonItem = new Element('div',{ person = people[i];
'class':'dynamicListItem', id = "_"+person.id;
'style':'display:none;height:0px;width:0px;', elemName="person_item_pattern"+id;
'id':elemName}).update(value).insert(hidden);
dwr.util.cloneNode("person_item_pattern", { idSuffix:id });
dwr.util.setValue("person_name" + id, person.firstName + " " + person.lastName);
dwr.util.setValue("person_num_tokens"+id,person.numTokens);
$("person_add_token"+id).observe('click',
this.addConferenceCreationToken.bindAsEventListener(this,person));
$("person_remove_token"+id).observe('click',
this.removeConferenceCreationToken.bindAsEventListener(this,person));
$(elemName).appear();
} }
}.bind(this) ); }.bind(this) );
} }
}); });
new AdminController(); Event.observe(window,'load',function(e){new AdminManager();});

View File

@@ -4,8 +4,8 @@
<head> <head>
</head> </head>
<body> <body>
<form action="<c:url value='j_acegi_security_check'/>" method="POST" id="mainformlogin"> <form action="<c:url value='j_acegi_security_check'/>" method="post" id="mainformlogin">
<fmt:message key="login.txt.login"/> : <label for="j_username"><fmt:message key="login.txt.login"/> :</label>
<input id="username" type='text' name='j_username' value="<fmt:message key='login.field.login' />" onfocus="if (this.value == '<fmt:message key='login.field.login' />') { this.value = ''; }" onblur="if (this.value == '') { this.value = '<fmt:message key='login.field.login' />'; }" /> <input id="username" type='text' name='j_username' value="<fmt:message key='login.field.login' />" onfocus="if (this.value == '<fmt:message key='login.field.login' />') { this.value = ''; }" onblur="if (this.value == '') { this.value = '<fmt:message key='login.field.login' />'; }" />
<input id="password" type='password' name='j_password' /> <input id="password" type='password' name='j_password' />
<a href="javascript:document.getElementById('mainformlogin').submit();" id="submit_btn"><fmt:message key="login.btn.connexion" /></a> <a href="javascript:document.getElementById('mainformlogin').submit();" id="submit_btn"><fmt:message key="login.btn.connexion" /></a>

View File

@@ -260,9 +260,7 @@ form > table > thead th {
#main { #main {
position: relative; position: relative;
/*background-color: #8bff74;*/
padding: 15px 0 0; padding: 15px 0 0;
width: 100%; width: 100%;
display: table; display: table;
@@ -340,19 +338,19 @@ table.content_table {
width: 300px; width: 300px;
} }
/* @end */ /* @end */
/* @group manageArticle */ /* @group manageArticle */
a.manage_link { a.manage_link {
text-decoration: none; text-decoration: none;
padding-right: 50px; padding-right: 50px;
color: #008281; color: #008281;
font-weight: bold; font-weight: bold;
} }
a.manage_link:hover { a.manage_link:hover {
color: #003e82; color: #003e82;
} }
/* @end */ /* @end */
@@ -360,16 +358,16 @@ a.manage_link:hover {
#main #mainmenu { #main #mainmenu {
width: 150px; width: 150px;
float: left; display: table-cell;
} }
#main #mainmenu #mainmenubloc { #main #mainmenu .mainmenubloc {
margin: 10px auto; margin: 10px auto;
width: 161px; width: 161px;
background: url(../images/title-small.png) no-repeat left top; background: url(../images/title-small.png) no-repeat left top;
} }
#main #mainmenu #mainmenubloc h4 { #main #mainmenu .mainmenubloc h4 {
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
@@ -378,36 +376,36 @@ a.manage_link:hover {
top: 2px; top: 2px;
} }
#main #mainmenu #mainmenubloc ul { #main #mainmenu .mainmenubloc ul {
background: url(../images/menu-background-repeat.png) repeat-y; background: url(../images/menu-background-repeat.png) repeat-y;
padding-top: 5px; padding-top: 5px;
} }
#main #mainmenu #mainmenubloc ul li { #main #mainmenu .mainmenubloc ul li {
background: url(../images/menu-background-repeat.png) repeat-y; background: url(../images/menu-background-repeat.png) repeat-y;
height: 22px; height: 22px;
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
#main #mainmenu #mainmenubloc ul li:hover { #main #mainmenu .mainmenubloc ul li:hover {
background-image: url(../images/menu-background-repeat-hover.png); background-image: url(../images/menu-background-repeat-hover.png);
height: 22px; height: 22px;
} }
#main #mainmenu #mainmenubloc a { #main #mainmenu .mainmenubloc a {
text-decoration: none; text-decoration: none;
color: #8d0000; color: #8d0000;
text-align: left; text-align: left;
font-size: 11px; font-size: 11px;
} }
#main #mainmenu #mainmenubloc a:hover { #main #mainmenu .mainmenubloc a:hover {
color: #ff7a00; color: #ff7a00;
font-size: 11px; font-size: 11px;
} }
#main #mainmenu #mainmenubloc #footer { #main #mainmenu .mainmenubloc .footer {
background-image: url(../images/menu-bottom.png); background-image: url(../images/menu-bottom.png);
width: 161px; width: 161px;
height: 6px; height: 6px;
@@ -417,7 +415,7 @@ a.manage_link:hover {
/* @group maincontent */ /* @group maincontent */
#main #maincontent { #main #maincontent {
margin-left: 200px; margin-left: 20px;
width: 780px; width: 780px;
background: url(../images/title-big.png) no-repeat left top; background: url(../images/title-big.png) no-repeat left top;
margin-top: 10px; margin-top: 10px;
@@ -779,4 +777,10 @@ div.user_new {
#loginFull_forgotPassword { #loginFull_forgotPassword {
float: right; float: right;
}
.hidden {
display:none;
height:0px;
width:0px;
} }

View File

@@ -51,6 +51,10 @@ public class UserDetails implements org.acegisecurity.userdetails.UserDetails {
ArrayList<GrantedAuthority> authoritiesList = new ArrayList<GrantedAuthority>(); ArrayList<GrantedAuthority> authoritiesList = new ArrayList<GrantedAuthority>();
if(this.login.equals("admin")){
authoritiesList.add(new GrantedAuthorityImpl("ROLE_ADMIN"));
}
if(SessionService.getInstance().getConferenceManager().canCreateConference(login)){ if(SessionService.getInstance().getConferenceManager().canCreateConference(login)){
authoritiesList.add(new GrantedAuthorityImpl("ROLE_CONFERENCE_CREATOR")); authoritiesList.add(new GrantedAuthorityImpl("ROLE_CONFERENCE_CREATOR"));
} }

View File

@@ -15,8 +15,10 @@ import org.yacos.core.article.IArticleManager;
import org.yacos.core.conferences.Conference; import org.yacos.core.conferences.Conference;
import org.yacos.core.conferences.IConferenceManager; import org.yacos.core.conferences.IConferenceManager;
import org.yacos.core.users.IUserManager; import org.yacos.core.users.IUserManager;
import org.yacos.core.users.Role;
import org.yacos.core.users.Speciality; import org.yacos.core.users.Speciality;
import org.yacos.core.users.User; import org.yacos.core.users.User;
import org.yacos.core.users.Role.RoleType;
import org.yacos.web.system.session.SessionService; import org.yacos.web.system.session.SessionService;
public class DelegateArticleController implements Controller{ public class DelegateArticleController implements Controller{
@@ -129,6 +131,7 @@ public List<RefereeBean> getRefereesWithTheArticle(int articleId ){
public void addReferee(List<String> refereesId,int articleId){ public void addReferee(List<String> refereesId,int articleId){
for (String refereeId : refereesId) { for (String refereeId : refereesId) {
articleManager.delegateArticleToReferee(articleId, refereeId,memberId); articleManager.delegateArticleToReferee(articleId, refereeId,memberId);
conferenceManager.addRole(RoleType.REFEREE, refereeId, SessionService.getInstance().getCurrentConference().getId());
} }
logger.debug("add referee to article"); logger.debug("add referee to article");
} }
@@ -136,6 +139,9 @@ public List<RefereeBean> getRefereesWithTheArticle(int articleId ){
public void removeReferee(List<String> refereesId,int articleId){ public void removeReferee(List<String> refereesId,int articleId){
for (String refereeId : refereesId) { for (String refereeId : refereesId) {
articleManager.undelegateArticleToReferee(articleId, refereeId, memberId); articleManager.undelegateArticleToReferee(articleId, refereeId, memberId);
User referee = userManager.getUser(refereeId);
Role role = new Role(RoleType.REFEREE,referee,SessionService.getInstance().getCurrentConference());
conferenceManager.removeRole(role);
} }
logger.debug("remove members to article"); logger.debug("remove members to article");

View File

@@ -124,4 +124,4 @@ public class ListEvaluationController extends SimpleFormController {
return new ModelAndView("listEvaluation", "listArticle", listArticleBean); return new ModelAndView("listEvaluation", "listArticle", listArticleBean);
} }
} }

View File

@@ -1,18 +1,28 @@
package org.yacos.web.admin; package org.yacos.web.admin;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController; import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
import org.yacos.core.article.IArticleManager; import org.yacos.core.article.IArticleManager;
import org.yacos.core.conferences.IConferenceManager; import org.yacos.core.conferences.IConferenceManager;
import org.yacos.core.exceptions.NoConferenceCreationTokenLeftException;
import org.yacos.core.users.IUserManager; import org.yacos.core.users.IUserManager;
import org.yacos.core.users.User;
import org.yacos.web.system.controller.MailSenderService;
import org.yacos.web.system.session.SessionService;
import org.yacos.web.system.session.YACOSUtils;
public class AdminController extends MultiActionController { public class AdminController extends MultiActionController {
private IArticleManager articleManager; private IArticleManager articleManager;
private IUserManager userManager; private IUserManager userManager;
private IConferenceManager conferenceManager; private IConferenceManager conferenceManager;
private HashSet<String> addedConferenceCreationTokens = new HashSet<String>();
/** /**
* @return the articleManager * @return the articleManager
*/ */
@@ -50,6 +60,48 @@ public class AdminController extends MultiActionController {
this.conferenceManager = conferenceManager; this.conferenceManager = conferenceManager;
} }
public int addConferenceCreationToken(String login){
conferenceManager.addConferenceCreationToken(login);
addedConferenceCreationTokens.add(login);
return conferenceManager.conferenceCreationTokens(login);
}
public int removeConferenceCreationToken(String login){
try {
conferenceManager.useConferenceCreationToken(login);
} catch (NoConferenceCreationTokenLeftException e) {
// We don't have to handle this exception, the count just won't change
}
return conferenceManager.conferenceCreationTokens(login);
}
public void sendNotifications(){
User user;
for(String login : addedConferenceCreationTokens){
user = userManager.getUser(login);
MailSenderService.getInstance().sendEMail(user.getEmail(),
"YACOS : "+user.getFirstName()+" "+user.getLastName()+" you have been granted a conference creation token",
"You receive this email because the YACOS admin allowed you to create a new conference in the system.\n"
+ "Your current conference creation token count is "+user.getConferenceCreationTokens()+"\n"
+ YACOSUtils.fullURL("addConference.htm"));
}
}
public List<DWRPersonBean> getUsersList(){
List<DWRPersonBean> beans = new ArrayList<DWRPersonBean>();
DWRPersonBean bean;
for(User user : userManager.getUsers()){
bean = new DWRPersonBean();
bean.setLogin(user.getLogin());
bean.setFirstName(user.getFirstName());
bean.setLastName(user.getLastName());
bean.setId(beans.size());
bean.setNumTokens(conferenceManager.conferenceCreationTokens(user.getLogin()));
beans.add(bean);
}
return beans;
}
public ModelAndView show(HttpServletRequest request, HttpServletResponse response){ public ModelAndView show(HttpServletRequest request, HttpServletResponse response){
return new ModelAndView("admin"); return new ModelAndView("admin");
} }

View File

@@ -0,0 +1,69 @@
package org.yacos.web.admin;
public class DWRPersonBean {
private int id;
private String login;
private String firstName;
private String lastName;
private int numTokens;
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the login
*/
public String getLogin() {
return login;
}
/**
* @param login the login to set
*/
public void setLogin(String login) {
this.login = login;
}
/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @return the numTokens
*/
public int getNumTokens() {
return numTokens;
}
/**
* @param numTokens the numTokens to set
*/
public void setNumTokens(int numTokens) {
this.numTokens = numTokens;
}
}

View File

@@ -32,6 +32,7 @@ import org.yacos.web.chairman.form.FormConference;
import org.yacos.web.chairman.validation.ConferenceValidator; import org.yacos.web.chairman.validation.ConferenceValidator;
import org.yacos.web.system.controller.MailSenderService; import org.yacos.web.system.controller.MailSenderService;
import org.yacos.web.system.session.SessionService; import org.yacos.web.system.session.SessionService;
import org.yacos.web.system.session.YACOSUtils;
public class AddConferenceController extends AbstractWizardFormController { public class AddConferenceController extends AbstractWizardFormController {
@@ -467,8 +468,7 @@ public class AddConferenceController extends AbstractWizardFormController {
mailBody += "You've been invited to join the program comity of the conference :\n"; mailBody += "You've been invited to join the program comity of the conference :\n";
mailBody += conf.getTitle()+"/n"; mailBody += conf.getTitle()+"/n";
mailBody += "You can register on this page : \n"; mailBody += "You can register on this page : \n";
String baseUrl = request.getSession().getServletContext().getContextPath(); mailBody += YACOSUtils.fullURL("registerUser.htm")+" /n";
mailBody += baseUrl+"/registerUser.htm /n";
mailBody += "Please note that you MUST use this eMail address in the registration form in order to get the appropriate credentials."; mailBody += "Please note that you MUST use this eMail address in the registration form in order to get the appropriate credentials.";
// TODO : use a template // TODO : use a template
for(String invitationEmail : listInvitations){ for(String invitationEmail : listInvitations){
@@ -477,10 +477,9 @@ public class AddConferenceController extends AbstractWizardFormController {
MailSenderService.getInstance().sendEMail(invitationEmail, mailSubject , mailBody); MailSenderService.getInstance().sendEMail(invitationEmail, mailSubject , mailBody);
} catch (ConferenceDoesntExistException e) { } catch (ConferenceDoesntExistException e) {
// Should never happen // Should never happen
e.printStackTrace(); logger.warn("Could not send invitation email.");
} catch (MailSendException e) { } catch (MailSendException e) {
// TODO : see what we can do about this logger.warn("Could not send invitation email.");
e.printStackTrace();
} }
} }

View File

@@ -54,6 +54,9 @@ public class SUserRegistrationController extends SimpleFormController {
userCommand.getLastName(), userCommand.getLastName(),
userCommand.getOrganization(), userCommand.getOrganization(),
userCommand.getEmail()); userCommand.getEmail());
SessionService.getInstance().authenticate(
userCommand.getLogin(),
userCommand.getPassword());
model.put("account", "2"); model.put("account", "2");
} catch (PKAlreadyUsedException e) { } catch (PKAlreadyUsedException e) {
errors.rejectValue("login", "form.register.error.alreadyExists"); errors.rejectValue("login", "form.register.error.alreadyExists");

View File

@@ -250,10 +250,19 @@ public class SessionService {
return WebUtils.getSessionAttribute(request, name); return WebUtils.getSessionAttribute(request, name);
} }
/**
* Refresh the user credentials
* Forces the system to reload the user details, including the roles
*/
public void refreshAuthentication(){ public void refreshAuthentication(){
refreshAuthentication(null); refreshAuthentication(null);
} }
/**
* Refresh the user credentials, optionally providing a new password
* Forces the system to reload the user details, including the roles
* @param newPassword An optional new password, null if not needed
*/
public void refreshAuthentication(String newPassword) { public void refreshAuthentication(String newPassword) {
// First step : remove user from the cache // First step : remove user from the cache
DaoAuthenticationProvider authProvider = (DaoAuthenticationProvider) RequestContextUtils.getWebApplicationContext(request).getBean("daoAuthenticationProvider"); DaoAuthenticationProvider authProvider = (DaoAuthenticationProvider) RequestContextUtils.getWebApplicationContext(request).getBean("daoAuthenticationProvider");
@@ -276,4 +285,14 @@ public class SessionService {
} }
} }
/**
* Try to authenticate a user given a login and password
* @param login The user login
* @param password The user password
*/
public void authenticate(String login, String password) {
Authentication newAuth = new UsernamePasswordAuthenticationToken(login,password);
SecurityContextHolder.getContext().setAuthentication(newAuth);
}
} }

View File

@@ -1,5 +1,9 @@
package org.yacos.web.system.session; package org.yacos.web.system.session;
import java.net.MalformedURLException;
import java.net.URL;
import javax.servlet.http.HttpServletRequest;
public class YACOSUtils { public class YACOSUtils {
private static String VALID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!?%$()"; private static String VALID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!?%$()";
@@ -12,4 +16,30 @@ public class YACOSUtils {
return password; return password;
} }
/**
* Constructs an absolute URL from a relative Path
* CAN ONLY BE CALLED IN A HttpRequest CONTEXT
* @param path A relative path to a server resource
* @return The corresponding absolute http URL, null if the URL is malformed
*/
public static String fullURL(String path) {
HttpServletRequest request = SessionService.request;
String resource = path;
if(! resource.substring(0, 1).equals("/")){
resource = "/"+resource;
}
try {
URL url = new URL(request.getScheme(),
request.getServerName(),
request.getServerPort(),
resource);
return url.toString();
} catch (MalformedURLException e) {
return null;
}
}
} }