Skip to content

Feature1615 #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions blog/blog-war/src/main/webapp/blog/jsp/check.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.

--%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
Expand Down Expand Up @@ -79,8 +79,8 @@ response.setDateHeader ("Expires",-1); //prevents caching at the proxy
<%@ page errorPage="../../admin/jsp/errorpageMain.jsp"%>

<%
GraphicElementFactory gef = (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");
MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute("SilverSessionController");
GraphicElementFactory gef = (GraphicElementFactory) session.getAttribute(GraphicElementFactory.GE_FACTORY_SESSION_ATT);
MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);

String m_context = GeneralPropertiesManager.getGeneralResourceLocator().getString("ApplicationURL");

Expand All @@ -99,4 +99,4 @@ String spaceId = browseContext[2];
String instanceId = browseContext[3];

String userId = m_MainSessionCtrl.getUserId();
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ private PublicationTemplateManager getPublicationTemplateManager() {
}

private boolean isAnonymousAccess(HttpServletRequest request) {
LookHelper lookHelper = (LookHelper) request.getSession().getAttribute("Silverpeas_LookHelper");
LookHelper lookHelper = (LookHelper) request.getSession().getAttribute(LookHelper.SESSION_ATT);
if (lookHelper != null) {
return lookHelper.isAnonymousAccess();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
PortletSession session = request.getPortletSession();
MainSessionController m_MainSessionCtrl = (MainSessionController) session
.getAttribute("SilverSessionController",
.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT,
PortletSession.APPLICATION_SCOPE);

Iterator<AttachmentDetail> attachments = null;
Expand Down Expand Up @@ -94,7 +94,7 @@ private void include(RenderRequest request, RenderResponse response,
String pageName) throws PortletException {
response.setContentType(request.getResponseContentType());
if (!StringUtil.isDefined(pageName)) {
// assert
// assert
throw new NullPointerException("null or empty page name");
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)

if (kmeliaSC == null && (toLink || attachmentToLink)) {
MainSessionController mainSessionCtrl = (MainSessionController) session.getAttribute(
"SilverSessionController");
MainSessionController.MAIN_SESSION_CONTROLLER_ATT);
ComponentContext componentContext =
mainSessionCtrl.createComponentContext(null, componentId);
kmeliaSC =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
String userId = "undefined";
HttpSession session = req.getSession(true);
MainSessionController mainSessionCtrl = (MainSessionController) session
.getAttribute("SilverSessionController");
.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);
if (mainSessionCtrl != null)
userId = mainSessionCtrl.getUserId();

Expand All @@ -99,7 +99,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
String language = req.getParameter("lang");
AttachmentDetail attachment = null;
if (StringUtil.isDefined(attachmentId)) {
// Check first if attachment exists
// Check first if attachment exists
attachment = AttachmentController.searchAttachmentByPK(new AttachmentPK(
attachmentId));
if (attachment != null) {
Expand Down Expand Up @@ -142,15 +142,15 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)

List<Alias> aliases = (List<Alias>) getPublicationBm().getAlias(pubPK);

// check if user have rights to see alias files
// check if user have rights to see alias files
Alias alias;
boolean rightsOK = false;
KmeliaSecurity security = new KmeliaSecurity();
for (int a = 0; !rightsOK && a < aliases.size(); a++) {
alias = aliases.get(a);
if (!contextComponentId.equals(alias.getInstanceId())) {
// it's an alias
// Check if user is allowed to see topic's content
// it's an alias
// Check if user is allowed to see topic's content
rightsOK = security.isAccessAuthorized(alias.getInstanceId(), userId,
alias.getId(), "Node");
}
Expand Down Expand Up @@ -188,7 +188,7 @@ private void display(HttpServletResponse res, String htmlFilePath)
displayWarningHtmlCode(res);
} else {
while (read != -1) {
out2.write(read); // writes bytes into the response
out2.write(read); // writes bytes into the response
read = input.read();
}
}
Expand All @@ -197,7 +197,7 @@ private void display(HttpServletResponse res, String htmlFilePath)
"root.EX_CANT_READ_FILE", "file name=" + htmlFilePath);
displayWarningHtmlCode(res);
} finally {
// we must close the in and out streams
// we must close the in and out streams
try {
if (input != null)
input.close();
Expand All @@ -209,7 +209,7 @@ private void display(HttpServletResponse res, String htmlFilePath)
}
}

// Add By Mohammed Hguig
// Add By Mohammed Hguig

private void displayWarningHtmlCode(HttpServletResponse res)
throws IOException {
Expand All @@ -221,7 +221,7 @@ private void displayWarningHtmlCode(HttpServletResponse res)
try {
int read = sr.read();
while (read != -1) {
out2.write(read); // writes bytes into the response
out2.write(read); // writes bytes into the response
read = sr.read();
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<%@ page errorPage="../../admin/jsp/errorpage.jsp"%>
<%

MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute("SilverSessionController");
MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);
GraphicElementFactory gef = (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");

QuestionReplySessionController scc = (QuestionReplySessionController) request.getAttribute("questionReply");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
PortletSession session = request.getPortletSession();
MainSessionController m_MainSessionCtrl = (MainSessionController) session
.getAttribute("SilverSessionController",
.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT,
PortletSession.APPLICATION_SCOPE);

QuickInfoTransversalSC quickinfoTransversal = new QuickInfoTransversalSC();
Expand Down Expand Up @@ -79,7 +79,7 @@ private void include(RenderRequest request, RenderResponse response,
String pageName) throws PortletException {
response.setContentType(request.getResponseContentType());
if (!StringUtil.isDefined(pageName)) {
// assert
// assert
throw new NullPointerException("null or empty page name");
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)

HttpSession session = req.getSession(true);
MainSessionController mainSessionCtrl = (MainSessionController) session
.getAttribute("SilverSessionController");
.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);
if (mainSessionCtrl == null || !isUserAllowed(mainSessionCtrl, componentId)) {
SilverTrace.warn("silverCrawler", "FileServer.doPost()",
"root.MSG_GEN_SESSION_TIMEOUT", "NewSessionId="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ public void doFilter(ServletRequest request, ServletResponse response,
* Retrieve main session controller
*/
MainSessionController mainSessionCtrl = (MainSessionController) session
.getAttribute("SilverSessionController");
.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);

/*
* If no main session controller, forward user to timeout page
*/
if (mainSessionCtrl == null) {
SilverTrace.warn("whitePages", "LoginFilter.doFilter",
"root.MSG_GEN_SESSION_TIMEOUT", "NewSessionId=" + session.getId());
RequestDispatcher dispatcher = request
.getRequestDispatcher(GeneralPropertiesManager
RequestDispatcher dispatcher = request.getRequestDispatcher(GeneralPropertiesManager
.getGeneralResourceLocator().getString("sessionTimeout"));
dispatcher.forward(request, response);
}
Expand All @@ -96,8 +95,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
String userId = mainSessionCtrl.getUserId();
try {
Admin admin = new Admin();
CompoSpace[] availableInstances = admin.getCompoForUser(userId,
"whitePages");
CompoSpace[] availableInstances = admin.getCompoForUser(userId, "whitePages");

for (int i = 0; i < availableInstances.length; i++) {
String instanceId = availableInstances[i].getComponentId();
Expand Down Expand Up @@ -155,11 +153,11 @@ public FilterConfig getFilterConfig() {
* @see javax.servlet.Filter#setFilterConfig(javax.servlet.FilterConfig)
*/
public void setFilterConfig(FilterConfig arg0) {
// this.config = config;
// this.config = config;
}

public void init(FilterConfig arg0) {
// this.config = config;
// this.config = config;
}

public void destroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.

--%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
Expand Down Expand Up @@ -76,7 +76,7 @@ response.setDateHeader ("Expires",-1); //prevents caching at the proxy

<%

MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute("SilverSessionController");
MainSessionController m_MainSessionCtrl = (MainSessionController) session.getAttribute(MainSessionController.MAIN_SESSION_CONTROLLER_ATT);
//OrganizationController organizationCtrl = m_MainSessionCtrl.getOrganizationController();
GraphicElementFactory gef = (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");

Expand Down