Arreglo de errores
This commit is contained in:
parent
97036bf369
commit
a44f2d9fad
File diff suppressed because it is too large
Load Diff
@ -60,7 +60,7 @@ public class EmployeesControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
pm.close();
|
pm.close();
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Employee updated successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Empleado creado con éxito.\"}");
|
||||||
|
|
||||||
} else if (action.equals("redirect")){
|
} else if (action.equals("redirect")){
|
||||||
|
|
||||||
@ -82,13 +82,13 @@ public class EmployeesControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to create/update an Employee.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para crear un Empleado.\"}");
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/e/users");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class EmployeesControllerDelete extends HttpServlet {
|
|||||||
|
|
||||||
pm.deletePersistent(employee);
|
pm.deletePersistent(employee);
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Employee deleted successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Empleado eliminado con éxito.\"}");
|
||||||
} catch (JDOObjectNotFoundException e){
|
} catch (JDOObjectNotFoundException e){
|
||||||
System.err.println("Exception catched -> " + e.getMessage());
|
System.err.println("Exception catched -> " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -41,13 +41,13 @@ public class EmployeesControllerDelete extends HttpServlet {
|
|||||||
response.sendRedirect("/e/employees");
|
response.sendRedirect("/e/employees");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to delete a Employee.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Empleado.\"}");
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/e/users");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,12 +44,12 @@ public class EmployeesControllerIndex extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to access /employees.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/employees.\"}");
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/e/");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class EmployeesControllerView extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
response.sendRedirect("/e/users");
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class MaterialsControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para crear un Material.\"}");
|
||||||
response.sendRedirect("/e/materials");
|
response.sendRedirect("/e/materials");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,8 @@ public class MaterialsControllerDelete extends HttpServlet {
|
|||||||
response.sendRedirect("/e/materials");
|
response.sendRedirect("/e/materials");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Material.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Material.\"}");
|
||||||
response.sendRedirect("/e/materials");
|
response.sendRedirect("/e/materials");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
|
@ -44,7 +44,8 @@ public class MaterialsControllerIndex extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
response.sendRedirect("/e/services");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/materials.\"}");
|
||||||
|
response.sendRedirect("/e/");
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch (NullPointerException e){
|
}catch (NullPointerException e){
|
||||||
|
@ -43,7 +43,7 @@ public class ServicesControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
Service service = new Service (name, price, description,userCreatorKey);
|
Service service = new Service (name, price, description,userCreatorKey);
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Service created successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Servicio creado con éxito.\"}");
|
||||||
|
|
||||||
pm.makePersistent(service);
|
pm.makePersistent(service);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class ServicesControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
pm.close();
|
pm.close();
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Service updated successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Servicio editado con éxito.\"}");
|
||||||
|
|
||||||
} else if (action.equals("redirect")){
|
} else if (action.equals("redirect")){
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public class ServicesControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to create/update a Service.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para crear un Servicio.\"}");
|
||||||
response.sendRedirect("/services");
|
response.sendRedirect("/services");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class ServicesControllerDelete extends HttpServlet {
|
|||||||
|
|
||||||
pm.deletePersistent(service);
|
pm.deletePersistent(service);
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Service deleted successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Servicio eliminado con éxito.\"}");
|
||||||
} catch (JDOObjectNotFoundException e){
|
} catch (JDOObjectNotFoundException e){
|
||||||
System.err.println("Exception catched -> " + e.getMessage());
|
System.err.println("Exception catched -> " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ public class ServicesControllerDelete extends HttpServlet {
|
|||||||
response.sendRedirect("/services");
|
response.sendRedirect("/services");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to delete a Service.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Servicio.\"}");
|
||||||
response.sendRedirect("/services");
|
response.sendRedirect("/services");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ public class ServicesControllerIndex extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to access /services.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/services.\"}");
|
||||||
response.sendRedirect("/");
|
response.sendRedirect("/e/");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
|
@ -72,7 +72,7 @@ public class ServicesControllerView extends HttpServlet {
|
|||||||
pm.close();
|
pm.close();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to view/edit a Service.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para ver/editar un Servicio.\"}");
|
||||||
response.sendRedirect("/services");
|
response.sendRedirect("/services");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class AccessControllerAdd extends HttpServlet {
|
|||||||
Access a = new Access(idRole, idResource,true);
|
Access a = new Access(idRole, idResource,true);
|
||||||
//persist the entity
|
//persist the entity
|
||||||
pm.makePersistent(a);
|
pm.makePersistent(a);
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Access created successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Acceso creado con éxito.\"}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (request.getParameter("info").equals("check")){
|
else if (request.getParameter("info").equals("check")){
|
||||||
@ -103,7 +103,7 @@ public class AccessControllerAdd extends HttpServlet {
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to create an access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para crear un Acceso.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,14 @@ public class AccessControllerDelete extends HttpServlet {
|
|||||||
|
|
||||||
pm.deletePersistent(r);
|
pm.deletePersistent(r);
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Access deleted successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Acceso eliminado con éxito.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
} catch(javax.jdo.JDOObjectNotFoundException nf) {
|
} catch(javax.jdo.JDOObjectNotFoundException nf) {
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to delete an access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Acceso.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class AccessControllerEdit extends HttpServlet {
|
|||||||
a.setResourceKey(idResource);
|
a.setResourceKey(idResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Access updated successfully.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Acceso editado con éxito.\"}");
|
||||||
|
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ public class AccessControllerEdit extends HttpServlet {
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to edit an access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para editar un Acceso.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ public class AccessControllerIndex extends HttpServlet {
|
|||||||
// create the persistence manager instance
|
// create the persistence manager instance
|
||||||
PersistenceManager pm = PMF.get().getPersistenceManager();
|
PersistenceManager pm = PMF.get().getPersistenceManager();
|
||||||
|
|
||||||
|
|
||||||
//Se usa para revisar si hay una sesion activa
|
//Se usa para revisar si hay una sesion activa
|
||||||
HttpSession sesion= request.getSession();
|
HttpSession sesion= request.getSession();
|
||||||
|
|
||||||
@ -65,8 +64,8 @@ public class AccessControllerIndex extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to access /access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/access.\"}");
|
||||||
response.sendRedirect("/");
|
response.sendRedirect("/e/");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public class AccessControllerView extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to view an access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para ver un Acceso.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ public class AccessControllerView extends HttpServlet {
|
|||||||
} catch(javax.jdo.JDOObjectNotFoundException nf) {
|
} catch(javax.jdo.JDOObjectNotFoundException nf) {
|
||||||
System.err.println("JDOObjectNotFound -> AccessControllerView");
|
System.err.println("JDOObjectNotFound -> AccessControllerView");
|
||||||
nf.printStackTrace();
|
nf.printStackTrace();
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"darkorange\",\"response\":\"Error trying to view the Access.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"darkorange\",\"response\":\"Ocurrio un error.\"}");
|
||||||
response.sendRedirect("/e/access");
|
response.sendRedirect("/e/access");
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
|
69
src/controller/usersManagement/index.java
Normal file
69
src/controller/usersManagement/index.java
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
package controller.usersManagement;
|
||||||
|
|
||||||
|
import controller.PMF;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
|
import model.Access;
|
||||||
|
import model.User;
|
||||||
|
|
||||||
|
import javax.jdo.PersistenceManager;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class index extends HttpServlet {
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
|
|
||||||
|
// create the persistence manager instance
|
||||||
|
PersistenceManager pm = PMF.get().getPersistenceManager();
|
||||||
|
|
||||||
|
//Se usa para revisar si hay una sesion activa
|
||||||
|
HttpSession sesion= request.getSession();
|
||||||
|
|
||||||
|
//Intenta hallar una sesion activa
|
||||||
|
try{
|
||||||
|
User user = UsersControllerView.getUser(sesion.getAttribute("userID").toString());
|
||||||
|
if (user == null) throw new NullPointerException("UsersControllerIndex: El usuario recibido es nulo.");
|
||||||
|
|
||||||
|
request.setAttribute("User",user);
|
||||||
|
|
||||||
|
request.setAttribute("serverResponse",sesion.getAttribute("serverResponse"));
|
||||||
|
sesion.setAttribute("serverResponse","!");
|
||||||
|
|
||||||
|
// forward the request to the jsp
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/eIndex.jsp");
|
||||||
|
dispatcher.forward(request, response);
|
||||||
|
|
||||||
|
}
|
||||||
|
//Si no la encuentra, redirige a la pagina inicial para que se cree la sesion.
|
||||||
|
catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
response.getWriter().println("<html><head><script>window.location.replace(\"../\")</script></head><body></body></html>");
|
||||||
|
} finally {
|
||||||
|
pm.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"Oops. No tienes permiso para acceder.\"}");
|
||||||
|
response.sendRedirect("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
doPost(request, response);
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package controller.usersManagement.resources;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.Resource;
|
import model.Resource;
|
||||||
|
|
||||||
@ -17,57 +18,69 @@ import java.io.IOException;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ResourcesControllerAdd extends HttpServlet {
|
public class ResourcesControllerAdd extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
|
||||||
|
|
||||||
//Accion a realizar
|
try {
|
||||||
String action = request.getParameter("action");
|
|
||||||
|
|
||||||
if (action == null)
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
action = "";
|
|
||||||
|
|
||||||
switch (action){
|
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
||||||
//Crea
|
|
||||||
case "create":
|
|
||||||
|
|
||||||
String url = request.getParameter("url");
|
//Accion a realizar
|
||||||
Boolean status = Boolean.parseBoolean(request.getParameter("status"));
|
String action = request.getParameter("action");
|
||||||
|
|
||||||
createRole(url,status,pm);
|
if (action == null)
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Resource created successfully.\"}");
|
action = "";
|
||||||
break;
|
|
||||||
|
|
||||||
case "redirect":
|
switch (action){
|
||||||
HttpSession sesion= request.getSession();
|
//Crea
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/add.jsp");
|
case "create":
|
||||||
request.setAttribute("User",UsersControllerView.getUser(sesion.getAttribute("userID").toString()));
|
|
||||||
dispatcher.forward(request, response);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "update":
|
String url = request.getParameter("url");
|
||||||
|
Boolean status = Boolean.parseBoolean(request.getParameter("status"));
|
||||||
|
|
||||||
Key a = KeyFactory.stringToKey(request.getParameter("key"));
|
createRole(url,status,pm);
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Recurso creado con éxito.\"}");
|
||||||
|
break;
|
||||||
|
|
||||||
Resource resourc = pm.getObjectById(Resource.class, a);
|
case "redirect":
|
||||||
|
HttpSession sesion= request.getSession();
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/add.jsp");
|
||||||
|
request.setAttribute("User",UsersControllerView.getUser(sesion.getAttribute("userID").toString()));
|
||||||
|
dispatcher.forward(request, response);
|
||||||
|
break;
|
||||||
|
|
||||||
resourc.setUrl(request.getParameter("url"));
|
case "update":
|
||||||
resourc.setStatus(Boolean.parseBoolean(request.getParameter("status")));
|
|
||||||
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Resource updated successfully.\"}");
|
Key a = KeyFactory.stringToKey(request.getParameter("key"));
|
||||||
break;
|
|
||||||
|
|
||||||
|
Resource resourc = pm.getObjectById(Resource.class, a);
|
||||||
|
|
||||||
|
resourc.setUrl(request.getParameter("url"));
|
||||||
|
resourc.setStatus(Boolean.parseBoolean(request.getParameter("status")));
|
||||||
|
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Recurso Actualizado con éxito.\"}");
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pm.close();
|
||||||
|
try{
|
||||||
|
response.sendRedirect("/e/resources");
|
||||||
|
}
|
||||||
|
//Al redirigr al jsp para crear, se usa RequestDispatcher, y este entra en conflicto con sendRedirect.
|
||||||
|
catch (IllegalStateException e){
|
||||||
|
System.err.println("IllegalStateException: There was a double redirect.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para crear un Recurso.\"}");
|
||||||
|
response.sendRedirect("/e/resources");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
pm.close();
|
|
||||||
try{
|
|
||||||
response.sendRedirect("/e/resources");
|
|
||||||
}
|
|
||||||
//Al redirigr al jsp para crear, se usa RequestDispatcher, y este entra en conflicto con sendRedirect.
|
|
||||||
catch (IllegalStateException e){
|
|
||||||
System.err.println("IllegalStateException: There was a double redirect.");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
@ -2,6 +2,7 @@ package controller.usersManagement.resources;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import model.Resource;
|
import model.Resource;
|
||||||
|
|
||||||
import javax.jdo.JDOObjectNotFoundException;
|
import javax.jdo.JDOObjectNotFoundException;
|
||||||
@ -17,24 +18,37 @@ import java.io.IOException;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ResourcesControllerDelete extends HttpServlet {
|
public class ResourcesControllerDelete extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
|
||||||
|
|
||||||
try {
|
try{
|
||||||
Key key = KeyFactory.stringToKey(request.getParameter("key"));
|
|
||||||
try{
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
pm.deletePersistent(pm.getObjectById(Resource.class, key));
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Resource deleted successfully.\"}");
|
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
||||||
} catch (JDOObjectNotFoundException e){
|
|
||||||
System.err.println("Exception catched -> " + e.getMessage());
|
try {
|
||||||
|
Key key = KeyFactory.stringToKey(request.getParameter("key"));
|
||||||
|
try{
|
||||||
|
pm.deletePersistent(pm.getObjectById(Resource.class, key));
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Recurso eliminado con éxito.\"}");
|
||||||
|
} catch (JDOObjectNotFoundException e){
|
||||||
|
System.err.println("Exception catched -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
response.sendRedirect("/e/resources");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Recurso.\"}");
|
||||||
|
response.sendRedirect("/e/resources");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
response.sendRedirect("/e/resources");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package controller.usersManagement.resources;
|
package controller.usersManagement.resources;
|
||||||
|
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.User;
|
import model.User;
|
||||||
|
|
||||||
@ -14,29 +15,41 @@ import java.io.IOException;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ResourcesControllerIndex extends HttpServlet {
|
public class ResourcesControllerIndex extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
//Se usa para revisar si hay una sesion activa
|
|
||||||
HttpSession sesion= request.getSession();
|
|
||||||
|
|
||||||
//Intenta hallar una sesion activa
|
try {
|
||||||
try{
|
|
||||||
User user = UsersControllerView.getUser(sesion.getAttribute("userID").toString());
|
|
||||||
if (user == null) throw new NullPointerException("UsersControllerIndex: El usuario recibido es nulo.");
|
|
||||||
|
|
||||||
request.setAttribute("User",user);
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
request.setAttribute("ResourceList",ResourcesControllerView.getAllResources());
|
//Se usa para revisar si hay una sesion activa
|
||||||
request.setAttribute("serverResponse",sesion.getAttribute("serverResponse"));
|
HttpSession sesion= request.getSession();
|
||||||
sesion.setAttribute("serverResponse","!");
|
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/index.jsp");
|
|
||||||
dispatcher.forward(request,response);
|
|
||||||
|
|
||||||
|
//Intenta hallar una sesion activa
|
||||||
|
try{
|
||||||
|
User user = UsersControllerView.getUser(sesion.getAttribute("userID").toString());
|
||||||
|
if (user == null) throw new NullPointerException("UsersControllerIndex: El usuario recibido es nulo.");
|
||||||
|
|
||||||
|
request.setAttribute("User",user);
|
||||||
|
request.setAttribute("ResourceList",ResourcesControllerView.getAllResources());
|
||||||
|
request.setAttribute("serverResponse",sesion.getAttribute("serverResponse"));
|
||||||
|
sesion.setAttribute("serverResponse","!");
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/index.jsp");
|
||||||
|
dispatcher.forward(request,response);
|
||||||
|
|
||||||
|
}
|
||||||
|
//Si no la encuentra, redirige a la pagina inicial.
|
||||||
|
catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
response.getWriter().println("<html><head><script>window.location.replace(\"../\")</script></head><body></body></html>");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/resources.\"}");
|
||||||
|
response.sendRedirect("/e/");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
//Si no la encuentra, redirige a la pagina inicial.
|
|
||||||
catch (Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
response.getWriter().println("<html><head><script>window.location.replace(\"../\")</script></head><body></body></html>");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
@ -2,6 +2,7 @@ package controller.usersManagement.resources;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.Resource;
|
import model.Resource;
|
||||||
|
|
||||||
@ -17,49 +18,60 @@ import java.util.List;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ResourcesControllerView extends HttpServlet {
|
public class ResourcesControllerView extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
String action = request.getParameter("action");
|
|
||||||
|
|
||||||
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
try {
|
||||||
if (action == null)
|
if(AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
action = "";
|
|
||||||
|
|
||||||
String key = request.getParameter("key");
|
String action = request.getParameter("action");
|
||||||
|
|
||||||
//Redirige al formulario para editar un Resource (resource/view)
|
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
||||||
if (action.equals("editRedirect") && key != null){
|
if (action == null)
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/view.jsp");
|
action = "";
|
||||||
request.setAttribute("Resource",getResource(key));
|
|
||||||
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
|
||||||
|
|
||||||
//Ya que se quiere editar, el atributo permitirEdicion es verdadero. Este atributo se comprueba en el JSP.
|
String key = request.getParameter("key");
|
||||||
request.setAttribute("editAllowed",true);
|
|
||||||
request.setAttribute("action","Edit");
|
//Redirige al formulario para editar un Resource (resource/view)
|
||||||
try{
|
if (action.equals("editRedirect") && key != null){
|
||||||
dispatcher.forward(request,response);
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/view.jsp");
|
||||||
} catch (javax.servlet.ServletException e){
|
request.setAttribute("Resource",getResource(key));
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
||||||
|
|
||||||
|
//Ya que se quiere editar, el atributo permitirEdicion es verdadero. Este atributo se comprueba en el JSP.
|
||||||
|
request.setAttribute("editAllowed",true);
|
||||||
|
request.setAttribute("action","Edit");
|
||||||
|
try{
|
||||||
|
dispatcher.forward(request,response);
|
||||||
|
} catch (javax.servlet.ServletException e){
|
||||||
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Redirige al formulario para ver un usuario (user/view)
|
||||||
|
else if (action.equals("viewRedirect") && key != null){
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/view.jsp");
|
||||||
|
request.setAttribute("Resource",getResource(key));
|
||||||
|
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
||||||
|
|
||||||
|
//Ya que no quiere editar, el atributo permitirEdicion es falso. Este atributo se comprueba en el JSP.
|
||||||
|
request.setAttribute("editAllowed",false);
|
||||||
|
request.setAttribute("action","View");
|
||||||
|
try{
|
||||||
|
dispatcher.forward(request,response);
|
||||||
|
} catch (javax.servlet.ServletException e){
|
||||||
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//Si no se encontró acción, regresa al inicio
|
||||||
|
else {
|
||||||
|
response.getWriter().println("<html><head><script>window.location.replace(\"../\");</script><body></body></html>");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para ver Recursos.\"}");
|
||||||
|
response.sendRedirect("/e/users");
|
||||||
}
|
}
|
||||||
}
|
} catch (NullPointerException e){
|
||||||
//Redirige al formulario para ver un usuario (user/view)
|
response.sendRedirect("/");
|
||||||
else if (action.equals("viewRedirect") && key != null){
|
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Resources/view.jsp");
|
|
||||||
request.setAttribute("Resource",getResource(key));
|
|
||||||
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
|
||||||
|
|
||||||
//Ya que no quiere editar, el atributo permitirEdicion es falso. Este atributo se comprueba en el JSP.
|
|
||||||
request.setAttribute("editAllowed",false);
|
|
||||||
request.setAttribute("action","View");
|
|
||||||
try{
|
|
||||||
dispatcher.forward(request,response);
|
|
||||||
} catch (javax.servlet.ServletException e){
|
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//Si no se encontró acción, regresa al inicio
|
|
||||||
else {
|
|
||||||
response.getWriter().println("<html><head><script>window.location.replace(\"../\");</script><body></body></html>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package controller.usersManagement.roles;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.Role;
|
import model.Role;
|
||||||
|
|
||||||
@ -22,64 +23,74 @@ import java.io.IOException;
|
|||||||
* Crear un Rol -> con el parametro action = create
|
* Crear un Rol -> con el parametro action = create
|
||||||
* Redireccionar al form para crear un Rol -> parametro action = redirect
|
* Redireccionar al form para crear un Rol -> parametro action = redirect
|
||||||
* Actualizar un Rol -> parametro action = update
|
* Actualizar un Rol -> parametro action = update
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* */
|
* */
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class RolesControllerAdd extends HttpServlet {
|
public class RolesControllerAdd extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
try {
|
||||||
|
|
||||||
//Accion a realizar
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
String action = request.getParameter("action");
|
|
||||||
|
|
||||||
if (action == null)
|
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
||||||
action = "";
|
|
||||||
|
|
||||||
switch (action){
|
//Accion a realizar
|
||||||
//Crea
|
String action = request.getParameter("action");
|
||||||
case "create":
|
|
||||||
|
|
||||||
String name = request.getParameter("roleName");
|
if (action == null)
|
||||||
Boolean status = Boolean.parseBoolean(request.getParameter("roleStatus"));
|
action = "";
|
||||||
|
|
||||||
createRole(name,status,pm);
|
switch (action){
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role created successfully.\"}");
|
//Crea
|
||||||
|
case "create":
|
||||||
|
|
||||||
break;
|
String name = request.getParameter("roleName");
|
||||||
|
Boolean status = Boolean.parseBoolean(request.getParameter("roleStatus"));
|
||||||
|
|
||||||
case "redirect":
|
createRole(name,status,pm);
|
||||||
HttpSession sesion= request.getSession();
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role created successfully.\"}");
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/add.jsp");
|
|
||||||
request.setAttribute("User",UsersControllerView.getUser(sesion.getAttribute("userID").toString()));
|
|
||||||
dispatcher.forward(request, response);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "update":
|
break;
|
||||||
|
|
||||||
Key a = KeyFactory.stringToKey(request.getParameter("key"));
|
case "redirect":
|
||||||
|
HttpSession sesion= request.getSession();
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/add.jsp");
|
||||||
|
request.setAttribute("User",UsersControllerView.getUser(sesion.getAttribute("userID").toString()));
|
||||||
|
dispatcher.forward(request, response);
|
||||||
|
break;
|
||||||
|
|
||||||
Role role1 = pm.getObjectById(Role.class, a);
|
case "update":
|
||||||
|
|
||||||
role1.setName(request.getParameter("roleName"));
|
Key a = KeyFactory.stringToKey(request.getParameter("key"));
|
||||||
role1.setStatus(Boolean.parseBoolean(request.getParameter("roleStatus")));
|
|
||||||
//role1.setImgUrl(userImg);
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role updated successfully.\"}");
|
|
||||||
|
|
||||||
break;
|
Role role1 = pm.getObjectById(Role.class, a);
|
||||||
|
|
||||||
}
|
role1.setName(request.getParameter("roleName"));
|
||||||
|
role1.setStatus(Boolean.parseBoolean(request.getParameter("roleStatus")));
|
||||||
|
//role1.setImgUrl(userImg);
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role editado con éxito.\"}");
|
||||||
|
|
||||||
pm.close();
|
break;
|
||||||
try{
|
|
||||||
response.sendRedirect("/e/roles");
|
}
|
||||||
}
|
|
||||||
//Al redirigr al jsp para crear, se usa RequestDispatcher, y este entra en conflicto con sendRedirect.
|
pm.close();
|
||||||
catch (IllegalStateException e){
|
try{
|
||||||
System.err.println("IllegalStateException: There was a double redirect.");
|
response.sendRedirect("/e/roles");
|
||||||
|
}
|
||||||
|
//Al redirigr al jsp para crear, se usa RequestDispatcher, y este entra en conflicto con sendRedirect.
|
||||||
|
catch (IllegalStateException e){
|
||||||
|
System.err.println("IllegalStateException: There was a double redirect.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/roles.\"}");
|
||||||
|
response.sendRedirect("/e/roles");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package controller.usersManagement.roles;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import model.Role;
|
import model.Role;
|
||||||
|
|
||||||
import javax.jdo.JDOObjectNotFoundException;
|
import javax.jdo.JDOObjectNotFoundException;
|
||||||
@ -16,24 +17,37 @@ import java.io.IOException;
|
|||||||
public class RolesControllerDelete extends HttpServlet {
|
public class RolesControllerDelete extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Key k = KeyFactory.stringToKey(request.getParameter("key"));
|
|
||||||
try{
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
pm.deletePersistent(pm.getObjectById(Role.class, k));
|
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role deleted successfully.\"}");
|
PersistenceManager pm = controller.PMF.get().getPersistenceManager();
|
||||||
} catch (JDOObjectNotFoundException e){
|
|
||||||
System.err.println("Exception catched -> " + e.getMessage());
|
try {
|
||||||
|
Key k = KeyFactory.stringToKey(request.getParameter("key"));
|
||||||
|
try{
|
||||||
|
pm.deletePersistent(pm.getObjectById(Role.class, k));
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"#26a69a\",\"response\":\"Role deleted successfully.\"}");
|
||||||
|
} catch (JDOObjectNotFoundException e){
|
||||||
|
System.err.println("Exception catched -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
response.sendRedirect("/e/roles");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para eliminar un Rol.\"}");
|
||||||
|
response.sendRedirect("/e/roles");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e){
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
response.sendRedirect("/e/roles");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package controller.usersManagement.roles;
|
package controller.usersManagement.roles;
|
||||||
|
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.User;
|
import model.User;
|
||||||
|
|
||||||
@ -15,26 +16,37 @@ import java.io.IOException;
|
|||||||
public class RolesControllerIndex extends HttpServlet {
|
public class RolesControllerIndex extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
//Se usa para revisar si hay una sesion activa
|
|
||||||
HttpSession sesion= request.getSession();
|
|
||||||
|
|
||||||
//Intenta hallar una sesion activa
|
|
||||||
try{
|
try{
|
||||||
User user = UsersControllerView.getUser(sesion.getAttribute("userID").toString());
|
if(AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
if (user == null) throw new NullPointerException("UsersControllerIndex: El usuario recibido es nulo.");
|
|
||||||
|
|
||||||
request.setAttribute("User",user);
|
//Se usa para revisar si hay una sesion activa
|
||||||
request.setAttribute("RoleList",RolesControllerView.getAllRoles());
|
HttpSession sesion= request.getSession();
|
||||||
request.setAttribute("serverResponse",sesion.getAttribute("serverResponse"));
|
|
||||||
sesion.setAttribute("serverResponse","!");
|
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/index.jsp");
|
|
||||||
dispatcher.forward(request,response);
|
|
||||||
|
|
||||||
}
|
//Intenta hallar una sesion activa
|
||||||
//Si no la encuentra, redirige a la pagina inicial.
|
try{
|
||||||
catch (Exception e){
|
User user = UsersControllerView.getUser(sesion.getAttribute("userID").toString());
|
||||||
e.printStackTrace();
|
if (user == null) throw new NullPointerException("UsersControllerIndex: El usuario recibido es nulo.");
|
||||||
response.getWriter().println("<html><head><script>window.location.replace(\"../\")</script></head><body></body></html>");
|
|
||||||
|
request.setAttribute("User",user);
|
||||||
|
request.setAttribute("RoleList",RolesControllerView.getAllRoles());
|
||||||
|
request.setAttribute("serverResponse",sesion.getAttribute("serverResponse"));
|
||||||
|
sesion.setAttribute("serverResponse","!");
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/index.jsp");
|
||||||
|
dispatcher.forward(request,response);
|
||||||
|
|
||||||
|
}
|
||||||
|
//Si no la encuentra, redirige a la pagina inicial.
|
||||||
|
catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
response.getWriter().println("<html><head><script>window.location.replace(\"../\")</script></head><body></body></html>");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para acceder a /e/roles.\"}");
|
||||||
|
response.sendRedirect("/e/");
|
||||||
|
}
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package controller.usersManagement.roles;
|
|||||||
|
|
||||||
import com.google.appengine.api.datastore.Key;
|
import com.google.appengine.api.datastore.Key;
|
||||||
import com.google.appengine.api.datastore.KeyFactory;
|
import com.google.appengine.api.datastore.KeyFactory;
|
||||||
|
import controller.usersManagement.access.AccessControllerView;
|
||||||
import controller.usersManagement.users.UsersControllerView;
|
import controller.usersManagement.users.UsersControllerView;
|
||||||
import model.Role;
|
import model.Role;
|
||||||
|
|
||||||
@ -35,49 +36,60 @@ import java.util.List;
|
|||||||
public class RolesControllerView extends HttpServlet {
|
public class RolesControllerView extends HttpServlet {
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
String action = request.getParameter("action");
|
try {
|
||||||
|
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
|
String action = request.getParameter("action");
|
||||||
|
|
||||||
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
||||||
if (action == null)
|
if (action == null)
|
||||||
action = "";
|
action = "";
|
||||||
|
|
||||||
String key = request.getParameter("key");
|
String key = request.getParameter("key");
|
||||||
|
|
||||||
//Redirige al formulario para editar un Role (role/view)
|
//Redirige al formulario para editar un Role (role/view)
|
||||||
if (action.equals("editRedirect") && key != null){
|
if (action.equals("editRedirect") && key != null){
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/view.jsp");
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/view.jsp");
|
||||||
request.setAttribute("Role",getRole(key));
|
request.setAttribute("Role",getRole(key));
|
||||||
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
||||||
|
|
||||||
//Ya que se quiere editar, el atributo permitirEdicion es verdadero. Este atributo se comprueba en el JSP.
|
//Ya que se quiere editar, el atributo permitirEdicion es verdadero. Este atributo se comprueba en el JSP.
|
||||||
request.setAttribute("editAllowed",true);
|
request.setAttribute("editAllowed",true);
|
||||||
request.setAttribute("action","Edit");
|
request.setAttribute("action","Edit");
|
||||||
try{
|
try{
|
||||||
dispatcher.forward(request,response);
|
dispatcher.forward(request,response);
|
||||||
} catch (javax.servlet.ServletException e){
|
} catch (javax.servlet.ServletException e){
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Redirige al formulario para ver un usuario (user/view)
|
||||||
|
else if (action.equals("viewRedirect") && key != null){
|
||||||
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/view.jsp");
|
||||||
|
request.setAttribute("Role",getRole(key));
|
||||||
|
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
||||||
|
|
||||||
|
//Ya que no quiere editar, el atributo permitirEdicion es falso. Este atributo se comprueba en el JSP.
|
||||||
|
request.setAttribute("editAllowed",false);
|
||||||
|
request.setAttribute("action","View");
|
||||||
|
try{
|
||||||
|
dispatcher.forward(request,response);
|
||||||
|
} catch (javax.servlet.ServletException e){
|
||||||
|
System.err.println("Exception captured -> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//Si no se encontró acción, regresa al inicio
|
||||||
|
else {
|
||||||
|
response.getWriter().println("<html><head><script>window.location.replace(\"../\");</script><body></body></html>");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"No tienes permiso para ver un Rol.\"}");
|
||||||
|
response.sendRedirect("/e/roles");
|
||||||
}
|
}
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
response.sendRedirect("/");
|
||||||
}
|
}
|
||||||
//Redirige al formulario para ver un usuario (user/view)
|
|
||||||
else if (action.equals("viewRedirect") && key != null){
|
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Roles/view.jsp");
|
|
||||||
request.setAttribute("Role",getRole(key));
|
|
||||||
request.setAttribute("UserLogged",UsersControllerView.getUser(request.getSession().getAttribute("userID").toString()));
|
|
||||||
|
|
||||||
//Ya que no quiere editar, el atributo permitirEdicion es falso. Este atributo se comprueba en el JSP.
|
|
||||||
request.setAttribute("editAllowed",false);
|
|
||||||
request.setAttribute("action","View");
|
|
||||||
try{
|
|
||||||
dispatcher.forward(request,response);
|
|
||||||
} catch (javax.servlet.ServletException e){
|
|
||||||
System.err.println("Exception captured -> " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//Si no se encontró acción, regresa al inicio
|
|
||||||
else {
|
|
||||||
response.getWriter().println("<html><head><script>window.location.replace(\"../\");</script><body></body></html>");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,6 @@ public class UsersControllerAdd extends HttpServlet {
|
|||||||
misesion.setMaxInactiveInterval(3600);
|
misesion.setMaxInactiveInterval(3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
serverResponse = "{\"color\": \"#26a69a\",\"response\":\"You are logged in.\"}";
|
|
||||||
|
|
||||||
rutaRedireccion = "/";
|
rutaRedireccion = "/";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -16,11 +16,9 @@ public class UsersControllerIndex extends HttpServlet {
|
|||||||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
//Se usa para revisar si hay una sesion activa
|
//Se usa para revisar si hay una sesion activa
|
||||||
HttpSession sesion= request.getSession();
|
HttpSession sesion= request.getSession();
|
||||||
|
|
||||||
System.out.println("URI de peticion -> " + request.getRequestURI());
|
|
||||||
if (AccessControllerView.checkPermission(sesion.getAttribute("userID").toString(),request.getRequestURI())){
|
if (AccessControllerView.checkPermission(sesion.getAttribute("userID").toString(),request.getRequestURI())){
|
||||||
|
|
||||||
//Intenta hallar una sesion activa
|
//Intenta hallar una sesion activa
|
||||||
@ -36,7 +34,7 @@ public class UsersControllerIndex extends HttpServlet {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to access /users.\"}");
|
request.getSession().setAttribute("serverResponse","{\"color\": \"red\",\"response\":\"You don\\'t have permission to access /users.\"}");
|
||||||
response.sendRedirect("/");
|
response.sendRedirect("/e/");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Si no la encuentra, redirige a la pagina inicial.
|
//Si no la encuentra, redirige a la pagina inicial.
|
||||||
|
@ -22,23 +22,22 @@ public class UsersControllerView extends HttpServlet {
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())) {
|
String action = request.getParameter("action");
|
||||||
|
|
||||||
String action = request.getParameter("action");
|
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
||||||
|
if (action == null)
|
||||||
|
action = "";
|
||||||
|
|
||||||
//Para evitar errores, si no hay ninguna accion, se establece a vacio.
|
if(action.equals("closeSession")){
|
||||||
|
closeSession(request,response);
|
||||||
|
}
|
||||||
|
else if (AccessControllerView.checkPermission(request.getSession().getAttribute("userID").toString(),request.getRequestURI())) {
|
||||||
|
|
||||||
if (action == null)
|
|
||||||
action = "";
|
|
||||||
|
|
||||||
String userID = request.getParameter("userID");
|
String userID = request.getParameter("userID");
|
||||||
|
|
||||||
//Si se quiere cerrar la sesion actual
|
|
||||||
if (action.equals("closeSession")){
|
|
||||||
closeSession(request,response);
|
|
||||||
}
|
|
||||||
//Redirige al formulario para editar un usario (user/view)
|
//Redirige al formulario para editar un usario (user/view)
|
||||||
else if (action.equals("editRedirect") && userID != null){
|
if (action.equals("editRedirect") && userID != null){
|
||||||
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Users/view.jsp");
|
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/View/Users/view.jsp");
|
||||||
request.setAttribute("User",getUser(userID));
|
request.setAttribute("User",getUser(userID));
|
||||||
request.setAttribute("UserLogged",getUser(request.getSession().getAttribute("userID").toString()));
|
request.setAttribute("UserLogged",getUser(request.getSession().getAttribute("userID").toString()));
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -70,6 +70,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesion</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesion</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -69,6 +69,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" onclick="postRedirect('./roles')">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" onclick="postRedirect('./roles')">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -88,16 +89,16 @@
|
|||||||
<div class="nav-content" style="background-color: #3949a3">
|
<div class="nav-content" style="background-color: #3949a3">
|
||||||
<ul class="tabs tabs-transparent">
|
<ul class="tabs tabs-transparent">
|
||||||
<li class="tab"><a href="./roles">Roles</a></li>
|
<li class="tab"><a href="./roles">Roles</a></li>
|
||||||
<li class="tab"><a href="./users">Users</a></li>
|
<li class="tab"><a href="./users">Usuarios</a></li>
|
||||||
<li class="tab"><a href="./resources">Resources</a></li>
|
<li class="tab"><a href="./resources">Recursos</a></li>
|
||||||
<li class="tab active"><a class="active" href="#">Access</a></li>
|
<li class="tab active"><a class="active" href="#">Accesos</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<br />
|
<br />
|
||||||
<span style="font-size: xx-large; font-family: 'Product Sans',Roboto,serif">Access</span>
|
<span style="font-size: xx-large; font-family: 'Product Sans',Roboto,serif">Accesos</span>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -63,6 +63,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -69,6 +69,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -116,10 +117,13 @@
|
|||||||
respDiv.style.backgroundColor = responseData["color"];
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
respDiv.style.maxHeight = "500px";
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
respDiv.style.maxHeight = "0";
|
respDiv.style.maxHeight = "500px";
|
||||||
},1500);
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},50);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -71,6 +71,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -72,7 +72,8 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="whiteLink" href="./users">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
|
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="#">Reportes de Ingresos</a></li>
|
<li class="active"><a class="whiteLink active" href="#">Reportes de Ingresos</a></li>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -72,6 +72,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -68,6 +68,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -117,10 +118,13 @@
|
|||||||
respDiv.style.backgroundColor = responseData["color"];
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
respDiv.style.maxHeight = "500px";
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
respDiv.style.maxHeight = "0";
|
respDiv.style.maxHeight = "500px";
|
||||||
},1500);
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},50);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -68,6 +68,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -118,10 +119,13 @@
|
|||||||
respDiv.style.backgroundColor = responseData["color"];
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
respDiv.style.maxHeight = "500px";
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
respDiv.style.maxHeight = "0";
|
respDiv.style.maxHeight = "500px";
|
||||||
},1500);
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},50);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -72,6 +72,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -67,6 +67,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -89,6 +89,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="#">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="#">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -71,6 +71,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -68,6 +68,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -116,10 +117,13 @@
|
|||||||
respDiv.style.backgroundColor = responseData["color"];
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
respDiv.style.maxHeight = "500px";
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
respDiv.style.maxHeight = "0";
|
respDiv.style.maxHeight = "500px";
|
||||||
},1500);
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},50);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -71,6 +71,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
<li><a class="whiteLink" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
<li class="active"><a class="whiteLink active" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -70,6 +70,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="../roles">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="./">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
@ -116,10 +117,13 @@
|
|||||||
respDiv.style.backgroundColor = responseData["color"];
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
respDiv.style.maxHeight = "500px";
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
respDiv.style.maxHeight = "0";
|
respDiv.style.maxHeight = "500px";
|
||||||
},1500);
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},50);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Log Out</a>
|
<a style="color: black" onclick="postRedirect('../users/view',{action:'closeSession'})">Log Out</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -74,6 +74,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a class="whiteLink" href="../">Inicio</a></li>
|
||||||
<li class="active"><a class="whiteLink active" href="#">Administración de Usuarios</a></li>
|
<li class="active"><a class="whiteLink active" href="#">Administración de Usuarios</a></li>
|
||||||
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
<li><a class="whiteLink" href="../services">Administración de recursos</a></li>
|
||||||
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
<li><a class="whiteLink" href="../reports">Reportes de Ingresos</a></li>
|
||||||
|
186
war/WEB-INF/View/eIndex.jsp
Normal file
186
war/WEB-INF/View/eIndex.jsp
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
<%@ page import="model.User" %>
|
||||||
|
<%--
|
||||||
|
Created by IntelliJ IDEA.
|
||||||
|
User: Fernando
|
||||||
|
Date: 07/06/2018
|
||||||
|
Time: 16:39
|
||||||
|
To change this template use File | Settings | File Templates.
|
||||||
|
--%>
|
||||||
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||||
|
<% User user = (User) request.getAttribute("User");
|
||||||
|
String serverResponse = (String) request.getAttribute("serverResponse");
|
||||||
|
if (serverResponse == null) serverResponse = "!";
|
||||||
|
%>
|
||||||
|
<html lang="es">
|
||||||
|
<head>
|
||||||
|
<title>Area de Empleados - Hotel Services</title>
|
||||||
|
|
||||||
|
<meta name="google-signin-client_id" content="746890482047-c734fgap3p3vb6bdoquufn60bsh2p8l9.apps.googleusercontent.com">
|
||||||
|
|
||||||
|
<script src="https://apis.google.com/js/platform.js" async defer></script>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
|
||||||
|
<link type="text/css" rel="stylesheet" href="../css/Diseno.css">
|
||||||
|
<link type="text/css" rel="stylesheet" href="../css/materialize.min.css">
|
||||||
|
<link type="text/css" rel="stylesheet" href="../css/Elements.css">
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
||||||
|
|
||||||
|
<script src="../js/GlobalJs.js" async defer></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.cards{
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 2px 2px lightgray;
|
||||||
|
background: -webkit-linear-gradient(left, #3949a3 55%, white 90%);
|
||||||
|
}
|
||||||
|
.cards a{
|
||||||
|
text-decoration: underline;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<nav class="nav-extended" style="background-color: #3f51b5">
|
||||||
|
<div class="nav-wrapper" style="max-height: 64px">
|
||||||
|
<a class="whiteLink hide-on-small-only" href="/" style="padding: 0 0 0 20px; font-family: 'Product Sans', Roboto, serif; font-size: xx-large">Hotel Services</a>
|
||||||
|
Empleados
|
||||||
|
<div class="right valign-wrapper" style="padding: 0 0 0 10px; cursor: pointer; min-width: 180px;" onclick="changeUserOptions()">
|
||||||
|
|
||||||
|
<span style="min-width: 80px;">
|
||||||
|
<%= user.getName()%>
|
||||||
|
</span>
|
||||||
|
<img src="<%=user.getImgUrl()%>" alt="" class="circle responsive-img" style="padding: 5px" width="50px">
|
||||||
|
<i class="material-icons">arrow_drop_down</i>
|
||||||
|
|
||||||
|
<div id="userOptions" style="background-color: white; border:solid 2px #67c9b3; position: absolute;
|
||||||
|
width: auto; display: none;">
|
||||||
|
<ul style="color: black">
|
||||||
|
|
||||||
|
<li style="padding: 0 5px;">
|
||||||
|
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
|
<i class="small material-icons">arrow_drop_up</i>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
||||||
|
<li style="max-height: 62px">
|
||||||
|
<a href="https://github.com/Grupo-PW2/Web-Hostal" target="_blank" style="max-height: 62px">
|
||||||
|
<svg style="width: 32px; height: 32px; margin: 20px 0" aria-labelledby="simpleicons-github-icon" roleKey="img" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<title id="simpleicons-github-icon">
|
||||||
|
GitHub icon
|
||||||
|
</title>
|
||||||
|
<path fill="white" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="active"><a class="whiteLink" href="#">Inicio</a></li>
|
||||||
|
<li><a class="whiteLink" href="./roles">Administración de Usuarios</a></li>
|
||||||
|
<li><a class="whiteLink" href="./services">Administración de recursos</a></li>
|
||||||
|
<li><a class="whiteLink" href="./reports">Reportes de Ingresos</a></li>
|
||||||
|
<li>|</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!--<div class="dropdown hide-on-large-only" style="padding: 0 10px; font-weight: bold" onclick="toggleDropdown()">Show Services</div>
|
||||||
|
<div id="dropdownContent">
|
||||||
|
<a href="#" onclick="postRedirect('./roles')">Roles</a>
|
||||||
|
<a href="#" style="background-color: lightgray">Users</a>
|
||||||
|
<a onclick="postRedirect('./resources')">Resources</a>
|
||||||
|
<a onclick="postRedirect('./access')">Access</a>
|
||||||
|
</div>-->
|
||||||
|
|
||||||
|
</div></nav>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<br />
|
||||||
|
<span style="font-size: xx-large; font-family: 'Product Sans',Roboto,serif">Area de Empleados</span>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<%if (!serverResponse.equals("!")){ %>
|
||||||
|
|
||||||
|
<div id="serverResponse">
|
||||||
|
<div style="margin: 10px"></div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var respDiv = document.getElementById("serverResponse");
|
||||||
|
|
||||||
|
var responseData = JSON.parse('<%=serverResponse%>');
|
||||||
|
|
||||||
|
respDiv.style.backgroundColor = responseData["color"];
|
||||||
|
respDiv.innerHTML = "<div style=\"margin: 10px\">" + responseData["response"] + "</div>";
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "500px";
|
||||||
|
setTimeout(function () {
|
||||||
|
respDiv.style.maxHeight = "0";
|
||||||
|
},1500);
|
||||||
|
},300);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<% } %>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div style="padding: 10px 15px">
|
||||||
|
<div class="row cards">
|
||||||
|
<div class="col l9 m9 s8" style="color: white; font-size: large">
|
||||||
|
<span style="font-size: x-large">Administración de Usuarios</span><br />
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<a href="./roles">Roles</a><br/>
|
||||||
|
<a href="./users">Usuarios</a><br/>
|
||||||
|
<a href="./resources">Recursos</a><br/>
|
||||||
|
<a href="./access">Accesos</a><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col l3 m3 s4 right-align">
|
||||||
|
<i class="material-icons" style="font-size: 8rem; color: #3949a3">people</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cards">
|
||||||
|
<div class="col l9 m9 s8" style="color: white; font-size: large">
|
||||||
|
<span style="font-size: x-large">Administración de Recursos</span><br />
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<a href="./services">Servicios</a><br/>
|
||||||
|
<a href="./employees">Empleados</a><br/>
|
||||||
|
<a href="./materials">Materiales</a><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col l3 m3 s4 right-align">
|
||||||
|
<i class="material-icons" style="font-size: 8rem; color: #3949a3">archive</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cards">
|
||||||
|
<div class="col l9 m9 s8" style="color: white; font-size: large">
|
||||||
|
<span style="font-size: x-large">Reportes de Ingresos</span><br />
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<a href="./reports">Total</a><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col l3 m3 s4 right-align">
|
||||||
|
<i class="material-icons" style="font-size: 8rem; color: #3949a3">attach_money</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -292,7 +292,15 @@
|
|||||||
<servlet-name>IncomeReport</servlet-name>
|
<servlet-name>IncomeReport</servlet-name>
|
||||||
<url-pattern>/e/reports</url-pattern>
|
<url-pattern>/e/reports</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>usersManagmentServlet</servlet-name>
|
||||||
|
<servlet-class>controller.usersManagement.index</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>usersManagmentServlet</servlet-name>
|
||||||
|
<url-pattern>/e/</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Controlador para gestionar el comportamiento del menu de inicio -->
|
<!-- Controlador para gestionar el comportamiento del menu de inicio -->
|
||||||
<servlet>
|
<servlet>
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
Developed by:<br />
|
Desarrollado por:<br />
|
||||||
Fernando Araoz, 20173373<br />
|
Fernando Araoz, 20173373<br />
|
||||||
Jose Rodriguez, 20101650<br />
|
Jose Rodriguez, 20101650<br />
|
||||||
Gustavo Turpo, 20173374<br />
|
Gustavo Turpo, 20173374<br />
|
||||||
@ -186,7 +186,7 @@
|
|||||||
<ul style="color: black">
|
<ul style="color: black">
|
||||||
|
|
||||||
<li style="padding: 0 5px;">
|
<li style="padding: 0 5px;">
|
||||||
<a style="color: black" onclick="postRedirect('./users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
<a style="color: black" onclick="postRedirect('./e/users/view',{action:'closeSession'})">Cerrar Sesión</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
<li id="cerrar" style="padding: 0 5px; cursor: pointer">
|
||||||
@ -273,7 +273,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<a class="waves-effect waves-light btn whiteLink indigo darken-1" href="./e/roles"><i class="material-icons left">how_to_reg</i>Empleados</a>
|
<a class="waves-effect waves-light btn whiteLink indigo darken-1" href="./e/"><i class="material-icons left">how_to_reg</i>Empleados</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user