Package com.claymus.site

Source Code of com.claymus.site.Error401

package com.claymus.site;

import com.claymus.ClaymusMain;
import com.claymus.UserData;
import com.claymus.UserRole;
import com.claymus.site.module.content.ContentType;

@SuppressWarnings("serial")
public class Error401 extends ContentType {

  @Override
  public String getName() {
    return "Error 401";
  }

  @Override
  protected String getHTML() {
    ClaymusMain.getResponse().setStatus(401);

    String html = "";

    UserRole userRole = UserData.getUser().getRole();
    if(userRole.equals(UserData.getGuestRole())) {
      html += "<div class='claymus-h1'>Login Required !!!</div>";

      html += "<div class='claymus-t1'>";
      html += "<p><a href='" + UserData.getLoginURL() + "'>Login</a> is required to view content of this page.</p>";
      html += "</div>";
    } else {
      html += "<div class='claymus-h1'>Insufficient Permissions !!!</div>";

      html += "<div class='claymus-t1'>";
      html += "<p>You don't have permission to view content of this page.</p>";
      html += "</div>";
    }

    return html;
  }

}
TOP

Related Classes of com.claymus.site.Error401

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.