Mercurial Hosting > nabble
changeset 19:18cf4872fd7f
remove anonymous posting
line wrap: on
line diff
--- a/src/nabble/model/Anonymous.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/model/Anonymous.java Fri May 29 22:58:25 2020 -0600 @@ -23,10 +23,6 @@ private String name; private final SiteImpl site; - static String newCookie(Site site) { - return "a" + nextId(site); - } - Anonymous(SiteImpl site,String cookie, String name) { if( site == null ) throw new NullPointerException("site is null");
--- a/src/nabble/model/Site.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/model/Site.java Fri May 29 22:58:25 2020 -0600 @@ -49,7 +49,6 @@ public int getUserCount(String cnd); public Person getAnonymous(String cookie, String name); - public String newAnonymousCookie(); public Person getPerson(String id); public void addTag(Node node,User user,String label);
--- a/src/nabble/model/SiteImpl.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/model/SiteImpl.java Fri May 29 22:58:25 2020 -0600 @@ -464,10 +464,6 @@ return new Anonymous(this,cookie,name); } - public String newAnonymousCookie() { - return Anonymous.newCookie(this); - } - public Person getPerson(String id) { int i = id.indexOf(Anonymous.SEPERATOR); if( i == -1 )
--- a/src/nabble/modules/naml/mobile.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/modules/naml/mobile.naml Fri May 29 22:58:25 2020 -0600 @@ -137,7 +137,6 @@ </then> <else> <n.catch_exception. id="save-block"> - <n.handle_anonymous_submit/> <n.check_antispam_submit bypass="preview"/> <n.check_recent_post_limit/> <n.create_child_of_page_node commit="[n.not.is_preview/]">
--- a/src/nabble/modules/poll/poll.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/modules/poll/poll.naml Fri May 29 22:58:25 2020 -0600 @@ -26,7 +26,6 @@ <n.permission_row permission = "[n.create_poll_permission/]" description="[t]Who can create polls.[/t]" - anyone_cell = "" administrators_cell = "true" /> </override_macro>
--- a/src/nabble/view/lib/Jtp.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/lib/Jtp.java Fri May 29 22:58:25 2020 -0600 @@ -53,42 +53,6 @@ private Jtp() {} // never - public static Person getVisitor(HttpServletRequest request, HttpServletResponse response) - throws ServletException - { - Person visitor = getUser(request,response); - if( visitor != null ) - return visitor; - return getOrCreateAnonymous(request,response); - } - - private static Person getAnonymous(HttpServletRequest request) { - String anonymousId = ServletUtils.getCookieValue(request, ANONYMOUS_COOKIE_ID); - if (anonymousId == null) - return null; - String anonymousName = ServletUtils.getCookieValue(request, ANONYMOUS_COOKIE_NAME); - return getSite(request).getAnonymous(anonymousId, anonymousName == null? null : HtmlUtils.urlDecode(anonymousName)); - } - - private static Person getOrCreateAnonymous(HttpServletRequest request, HttpServletResponse response) - throws ServletException - { - Person anonymous = getAnonymous(request); - if (anonymous == null) { - Site site = getSiteNotNull(request); - String cookie = site.newAnonymousCookie(); - anonymous = site.getAnonymous(cookie,null); - ServletUtils.setCookie(request, response, ANONYMOUS_COOKIE_ID, cookie, true, null); - } - return anonymous; - } - - public static User getUser(HttpServletRequest request, HttpServletResponse response) - throws ServletException - { - return getUser(request); - } - public static User getUser(HttpServletRequest request) throws ServletException { @@ -597,7 +561,7 @@ // should be removed public static boolean authorizeForRead(String key,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { Node node = getSiteNotNull(request).getNode( Long.parseLong(key) ); - User user = getUser(request,response); + User user = getUser(request); if( user==null ) { login("You must login to view " + node.getSubject(), request, response); return false; @@ -909,7 +873,7 @@ // permissions hacks - private static boolean can(Person person,String macro,Node node) { + private static boolean can(User person,String macro,Node node) { Template template = node.getSite().getTemplate( macro, BasicNamespace.class, NabbleNamespace.class, UserNamespace.class ); @@ -922,36 +886,36 @@ return sw.toString().equals("true"); } - public static boolean canBeEditedBy(Node node,Person person) { + public static boolean canBeEditedBy(Node node,User person) { return can(person,"can_edit",node); } - public static boolean canBeRemovedBy(Node node,Person person) { + public static boolean canBeRemovedBy(Node node,User person) { return can(person,"can_move",node); } - public static boolean canBeDeletedBy(Node node,Person person) { + public static boolean canBeDeletedBy(Node node,User person) { return can(person,"can_delete",node); } - public static boolean canBeViewedBy(Node node,Person person) { + public static boolean canBeViewedBy(Node node,User person) { return can(person,"can_view",node); } - public static boolean canMove(Node node,Person person) { + public static boolean canMove(Node node,User person) { return can(person,"can_move",node); } - public static boolean canAssign(Node node,Person person) { + public static boolean canAssign(Node node,User person) { return can(person,"can_be_assigned_to",node); } - public static boolean canChangePostDateOf(Node node,Person person) { + public static boolean canChangePostDateOf(Node node,User person) { return can(person,"can_change_post_date_of",node); } - public static boolean isSiteAdmin(Site site,Person person) { - return person instanceof User && site.getRootNode().getOwner().equals(person); // for now + public static boolean isSiteAdmin(Site site,User person) { + return site.getRootNode().getOwner().equals(person); // for now } public static final String CACHED = "cached";
--- a/src/nabble/view/lib/NabbleErrorHandler.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/lib/NabbleErrorHandler.java Fri May 29 22:58:25 2020 -0600 @@ -74,7 +74,7 @@ } else { homeLink = Jtp.link(site.getRootNode()); hasTweaks = site.getCustomTweaks().size() > 0; - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); isAdmin = user != null && (site.getRootNode().getOwner().equals(user) || Permissions.isInGroup(user, "Administrators")); }
--- a/src/nabble/view/lib/NabbleErrorHandler.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/lib/NabbleErrorHandler.jtp Fri May 29 22:58:25 2020 -0600 @@ -74,7 +74,7 @@ } else { homeLink = Jtp.link(site.getRootNode()); hasTweaks = site.getCustomTweaks().size() > 0; - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); isAdmin = user != null && (site.getRootNode().getOwner().equals(user) || Permissions.isInGroup(user, "Administrators")); } %>
--- a/src/nabble/view/lib/Permissions.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/lib/Permissions.java Fri May 29 22:58:25 2020 -0600 @@ -218,37 +218,31 @@ } public static final String ANYONE_GROUP = "Anyone"; - public static final String REGISTERED_GROUP = "Registered"; public static final String AUTHOR_GROUP = "Authors"; public static final String ADMINISTRATORS_GROUP = "Administrators"; - public static List<String> getPersonGroups(Person person) { - List<String> groups; - if (person instanceof User) { - User user = (User) person; - groups = getGroups((User) person); - if (user.isRegistered()) - groups.add(REGISTERED_GROUP); - } else { - groups = new ArrayList<String>(); - } + public static List<String> getPersonGroups(User user) { + if( user==null || !user.isRegistered() ) + return new ArrayList<String>(); + List<String> groups = getGroups(user); groups.add(ANYONE_GROUP); return groups; } - public static boolean hasPermission(Node permissionNode,Node targetNode,Person person,String permission) { + public static boolean hasPermission(Node permissionNode,Node targetNode,User user,String permission) { Person owner = targetNode.getOwner(); Site site = permissionNode.getSite(); permissionNode = getPermissionNode(permissionNode,permission); if( permissionNode == null && !siteHasPermission(site,permission) ) return false; String s = "label='permission:" + encode(permission) + ":"; - List<String> groups = getPersonGroups(person); - if( owner.equals(person) ) + List<String> groups = getPersonGroups(user); + if( owner.equals(user) ) groups.add(AUTHOR_GROUP); for( String group : groups ) { - if( site.hasTags(permissionNode,null, s + encode(group) + "'" ) ) + if( site.hasTags(permissionNode,null, s + encode(group) + "'" ) ) { return true; + } } return false; } @@ -279,8 +273,6 @@ if( node == null && !siteHasPermission(site,permission) ) return Collections.emptyList(); if (hasPermission(site, node, ANYONE_GROUP,permission)) - return site.getUsers(null); - else if (hasPermission(site, node, REGISTERED_GROUP,permission)) return site.getUsers("registered is not null"); String labelStart = "permission:" + encode(permission) + ":"; int i = labelStart.length(); @@ -320,31 +312,32 @@ } }; - public static boolean canBeViewedByPerson(Node node,Person person) { - if( person instanceof User ) { - User user = (User)person; + public static boolean canBeViewedByPerson(Node node,User user) { + if( user != null ) { if( isSysAdmin(user) ) return true; if( isInGroup(user,ADMINISTRATORS_GROUP) ) return true; } - if( node.getSite().getRootNode().getOwner().equals(person) ) + if( node.getSite().getRootNode().getOwner().equals(user) ) return true; Node permissionNode = node.getApp(); if( permissionNode==null ) permissionNode = node.getSite().getRootNode(); - return hasPermission(permissionNode,node,person,VIEW_PERMISSION); + return hasPermission(permissionNode,node,user,VIEW_PERMISSION); } - public static final Filter<Node> canBeViewedByPersonFilter(final Person person) { + public static final Filter<Node> canBeViewedByPersonFilter(final User user) { return new Filter<Node>() { public boolean ok(Node node) { - return canBeViewedByPerson(node,person); + return canBeViewedByPerson(node,user); } }; } public static Node getPrivateNode(Node node) { +//System.out.println("qqqqqq getPrivateNode"); +//if(true) return node; node = getPermissionNode(node,VIEW_PERMISSION); return node==null || hasPermission(node.getSite(),node,ANYONE_GROUP,VIEW_PERMISSION) ? null : node; } @@ -481,12 +474,12 @@ ); } - public static boolean hasSitePermission(Site site,Person person,String permission) { + public static boolean hasSitePermission(Site site,User user,String permission) { String labelStart = sitePermissionLabel(site,permission); if( labelStart == null ) return false; String s = "label='" + labelStart + ":"; - List<String> groups = getPersonGroups(person); + List<String> groups = getPersonGroups(user); for( String group : groups ) { if( site.hasTags(null,null, s + encode(group) + "'" ) ) return true; @@ -509,24 +502,6 @@ ); } - public static List<User> getUsersWithSitePermission(Site site,String permission) { - String labelStart = sitePermissionLabel(site,permission); - if (labelStart == null) - return Collections.emptyList(); - if (hasSitePermission(site,ANYONE_GROUP,permission)) - return site.getUsers(null); - else if (hasSitePermission(site,REGISTERED_GROUP,permission)) - return site.getUsers("registered is not null"); - labelStart += ":"; - int i = labelStart.length(); - return site.findTagUsers( - "node_id is null and user_id is not null and label in (" - + "select 'group:' || substring(label," + (i+1) + ") from tag where node is null and user_id is null and label like '" + labelStart + "%'" - +")" - ); - } - - private static final ListenerList<Site> groupChangeListeners = new ListenerList<Site>(); public static void addGroupChangeListener(final Listener<Site> listener) {
--- a/src/nabble/view/naml/change_permissions.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/change_permissions.naml Fri May 29 22:58:25 2020 -0600 @@ -48,7 +48,6 @@ <n.add_permission permission="[n.current_permission/]"/> <n.user_groups.> <n.add.anyone_group/> - <n.add.registered_group/> <n.add.members_group/> <n.add.administrators_group/> <n.add.authors_group/> @@ -73,7 +72,6 @@ <n.add_site_permission permission="[n.current_permission/]"/> <n.user_groups.> <n.add.anyone_group/> - <n.add.registered_group/> <n.add.members_group/> <n.add.administrators_group/> <n.loop.permission_field. group="[n.current_group/]" permission="[n.current_permission/]"> @@ -150,7 +148,6 @@ <th class="medium-border-color"></th> <th class="medium-border-color"></th> <n.permission_group_heading.anyone_group/> - <n.permission_group_heading.registered_group/> <n.permission_group_heading.administrators_group/> <n.permission_group_heading.members_group/> <n.permission_group_heading.authors_group/> @@ -218,13 +215,11 @@ <n.permission_row permission = "[n.show_group_members_permission/]" description="[t]Which groups allow members to be listed[/t]" - anyone_cell = "" authors_cell = "" /> <n.permission_row permission = "[n.unrestricted_posting_permission/]" description="[t]Who can post any content without restriction (including javascript code, <object> and <style> tags, etc.). [b]Security Warning[/b]: Allow this option only for users that you really trust.[/t]" - anyone_cell = "" authors_cell = "" /> <n.permission_row @@ -253,7 +248,6 @@ </n.permission_row_field.> </td> <n.permission_td cell="[n.anyone_cell/]" group="[n.anyone_group/]" permission="[n.permission/]" /> - <n.permission_td cell="[n.registered_cell/]" group="[n.registered_group/]" permission="[n.permission/]" /> <n.permission_td cell="[n.administrators_cell/]" group="[n.administrators_group/]" permission="[n.permission/]" /> <n.permission_td cell="[n.members_cell/]" group="[n.members_group/]" permission="[n.permission/]" /> <n.permission_td cell="[n.authors_cell/]" group="[n.authors_group/]" permission="[n.permission/]" /> @@ -278,7 +272,6 @@ </n.permission_row_field.> </td> <n.site_permission_td cell="[n.anyone_cell/]" group="[n.anyone_group/]" permission="[n.permission/]" /> - <n.site_permission_td group="[n.registered_group/]" permission="[n.permission/]" /> <n.site_permission_td cell="[n.administrators_cell/]" group="[n.administrators_group/]" permission="[n.permission/]" /> <n.site_permission_td group="[n.members_group/]" permission="[n.permission/]" /> <td></td>
--- a/src/nabble/view/naml/change_user_groups.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/change_user_groups.naml Fri May 29 22:58:25 2020 -0600 @@ -48,9 +48,8 @@ </div> <n.form.> <table> - <n.fixed_group_row name="[n.anyone_group/]" tip="[t]All users belong to this group[/t]"/> <n.if.page_user.is_registered> - <then><n.fixed_group_row name="[n.registered_group/]" tip="[t]Users that completed the registration process[/t]"/></then> + <then><n.fixed_group_row name="Anyone" tip="[t]Users that completed the registration process[/t]"/></then> </n.if.page_user.is_registered> <n.if.page_user.is_authenticated>
--- a/src/nabble/view/naml/create_sub_app.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/create_sub_app.naml Fri May 29 22:58:25 2020 -0600 @@ -11,7 +11,6 @@ </then> <else> <n.catch_exception. id="save-block"> - <n.handle_anonymous_submit/> <n.create_child_of_page_node> <subject><n.subject_field.value/></subject> <message><n.message_field.value/></message> @@ -56,20 +55,6 @@ <n.form.> <n.type_field.hidden/> - <n.if.not.visitor.is_registered> - <then> - <div class="field-box light-border-color"> - <div class="second-font field-title"><t>Your Name</t></div> - <div class="weak-color"> - <n.if.is_null.visitor.name> - <then.anonymous_name_field.input size="30" /> - <else.visitor.name/> - </n.if.is_null.visitor.name> - </div> - </div> - </then> - </n.if.not.visitor.is_registered> - <div class="field-box light-border-color"> <div class="second-font field-title"><t>Name</t></div> <div class="weak-color">
--- a/src/nabble/view/naml/people.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/people.naml Fri May 29 22:58:25 2020 -0600 @@ -99,7 +99,7 @@ <macro name="visible_users_list" dot_parameter="do" requires="node_page"> <n.if.is_null.people_filter> <then> - <n.if.page_node.allows_showing_members_of.registered_group> + <n.if.page_node.allows_showing_members_of.anyone_group> <then> <n.site_users. start="0" length="99999" filter="[n.registered_filter/]"> <n.filter_by.current_user.not.is_banned/> @@ -121,7 +121,7 @@ </n.if.next_element> </n.available_groups.> </else> - </n.if.page_node.allows_showing_members_of.registered_group> + </n.if.page_node.allows_showing_members_of.anyone_group> </then> <else> <!-- get the filtered group --> @@ -165,9 +165,9 @@ <div class="nowrap float-left" style="margin-bottom:.3em"> <b><t>Filter by group</t></b> <select id="filter"> - <n.if.page_node.allows_showing_members_of.registered_group> + <n.if.page_node.allows_showing_members_of.anyone_group> <then.select_option value="[n.page_node.people_path/]" text="[t]Registered Users[/t]"/> - </n.if.page_node.allows_showing_members_of.registered_group> + </n.if.page_node.allows_showing_members_of.anyone_group> <n.available_groups.loop.> <n.select_option value="[n.page_node.people_path.current_group/]" selectedValue="[n.page_node.people_path.people_filter/]" text="[n.current_group/]"/> @@ -185,7 +185,7 @@ <macro name="available_groups" dot_parameter="do" requires="node_page"> <n.page_node.groups_with_permission. permission="[n.show_group_members_permission/]"> - <n.remove.registered_group/> + <n.remove.anyone_group/> <n.sort/> <n.do/> </n.page_node.groups_with_permission.>
--- a/src/nabble/view/naml/permissions.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/permissions.naml Fri May 29 22:58:25 2020 -0600 @@ -1,5 +1,5 @@ <macro name="current_permission_version"> - standard-6 + standard-7 </macro> <macro name="update_default_permissions"> @@ -16,7 +16,7 @@ <n.add_site_permission permission="[n.manage_banned_users_permission/]" group="[n.administrators_group/]" /> <n.add_permission permission="[n.manage_pinned_topics_permission/]" group="[n.administrators_group/]" /> <n.add_permission permission="[n.manage_locked_topics_permission/]" group="[n.administrators_group/]" /> - <n.add_permission permission="[n.show_group_members_permission/]" group="[n.registered_group/]" /> + <n.add_permission permission="[n.show_group_members_permission/]" group="[n.anyone_group/]" /> <n.add_permission permission="[n.show_group_members_permission/]" group="[n.administrators_group/]" /> <n.add_permission permission="[n.show_group_members_permission/]" group="[n.members_group/]" /> </n.set_default_permissions.> @@ -30,10 +30,6 @@ Members </macro> -<macro name="registered_user_groups"> - <n.anyone_group/>,<n.registered_group/> -</macro> - <macro name="edit_app_permission"> Edit_app </macro> @@ -219,9 +215,6 @@ <n.if.local_user.is_banned> <then.throw_template_exception name="banned"/> </n.if.local_user.is_banned> - <n.if.both condition1="[n.local_node.is_associated_with_mailing_list_archive/]" condition2="[n.not.local_user.is_authenticated/]"> - <then.throw_template_exception name="no_anonymous"/> - </n.if.both> <n.if.local_node.is_app> <then.if.not.local_user.has_permission node="[n.local_node/]" permission_node="[n.local_node/]" permission="[n.create_topic_permission/]" > <then.if.local_user.is_anonymous> @@ -240,7 +233,7 @@ </macro> <macro name="any_registered_user_can_create_topics" requires="node"> - <n.groups_have_permission groups="[n.registered_user_groups/]" permission="[n.create_topic_permission/]" /> + <n.groups_have_permission groups="[n.anyone_group/]" permission="[n.create_topic_permission/]" /> </macro> <macro name="only_members_can_create_topics" requires="node">
--- a/src/nabble/view/naml/reply.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/reply.naml Fri May 29 22:58:25 2020 -0600 @@ -27,7 +27,6 @@ </then> <else> <n.catch_exception. id="save-block"> - <n.handle_anonymous_submit/> <n.check_antispam_submit bypass="preview"/> <n.check_recent_post_limit/> <n.create_child_of_page_node commit="[n.not.is_preview/]"> @@ -132,16 +131,12 @@ </macro> <macro name="reply_form"> - <n.if.not.visitor.is_registered> - <then.anonymous_name_control/> - </n.if.not.visitor.is_registered> - <n.subject_control/> <n.message_control/> - <n.if.either condition1="[n.not.visitor.is_registered/]" condition2="[n.visitor.has_too_many_posts/]"> + <n.if.visitor.has_too_many_posts> <then.captcha_control/> - </n.if.either> + </n.if.visitor.has_too_many_posts> </macro> <macro name="remember_new_node" requires="node_editor"> @@ -234,18 +229,6 @@ </n.extra_fields.> </macro> -<macro name="anonymous_name_control"> - <div class="field-box light-border-color"> - <div class="second-font field-title"><t>Your Name</t></div> - <div class="weak-color"> - <n.if.is_null.visitor.name> - <then.anonymous_name_field.input size="30" tabindex="0" /> - <else.visitor.name/> - </n.if.is_null.visitor.name> - </div> - </div> -</macro> - <macro name="captcha_control"> <n.captcha_div/> </macro> @@ -261,10 +244,6 @@ <n.both condition1="[n.is_post/]" condition2="[n.topic_node.visitor_is_subscribed/]" /> </macro> -<macro name="anonymous_name_field" dot_parameter="do"> - <n.field. name="anonymous_name"><n.do/></n.field.> -</macro> - <macro name="type_field" dot_parameter="do"> <n.field. name="type"><n.do/></n.field.> </macro> @@ -664,17 +643,6 @@ </n.send_subscription_email> </macro> -<macro name="handle_anonymous_submit" requires="node_page"> - <n.if.visitor.is_anonymous> - <then> - <n.if.not.is_preview> - <then.check_captcha/> - </n.if.not.is_preview> - <n.set_anonymous_name name="[n.anonymous_name_field.value/]" /> - </then> - </n.if.visitor.is_anonymous> -</macro> - <macro name="check_recent_post_limit" requires="node_page"> <n.if.visitor.has_too_many_posts> <then.check_captcha/>
--- a/src/nabble/view/naml/topic.naml Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/naml/topic.naml Fri May 29 22:58:25 2020 -0600 @@ -1605,7 +1605,7 @@ <macro name="is_locked_topic" requires="node"> <n.both> <condition1.node_has_permission.reply_permission /> - <condition2.not.groups_have_permission groups="[n.registered_user_groups/]" permission="[n.reply_permission/]" /> + <condition2.not.groups_have_permission groups="[n.anyone_group/]" permission="[n.reply_permission/]" /> </n.both> </macro>
--- a/src/nabble/view/web/app/Addons.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/app/Addons.java Fri May 29 22:58:25 2020 -0600 @@ -102,7 +102,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect(site.getBaseUrl() + Jtp.loginPath(site,null,response.encodeURL("/forum/Addons.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/app/Addons.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/app/Addons.jtp Fri May 29 22:58:25 2020 -0600 @@ -102,7 +102,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect(site.getBaseUrl() + Jtp.loginPath(site,null,response.encodeURL("/forum/Addons.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/app/Languages.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/app/Languages.java Fri May 29 22:58:25 2020 -0600 @@ -49,7 +49,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect(site.getBaseUrl() + Jtp.loginPath(site,null,response.encodeURL("/forum/Addons.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/app/Languages.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/app/Languages.jtp Fri May 29 22:58:25 2020 -0600 @@ -49,7 +49,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect(site.getBaseUrl() + Jtp.loginPath(site,null,response.encodeURL("/forum/Addons.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/catalog/ChangeParent.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ChangeParent.java Fri May 29 22:58:25 2020 -0600 @@ -47,8 +47,8 @@ if (forum == null) return; - Person visitor = Jtp.getVisitor(request, response); - boolean isSiteAdmin = visitor instanceof User && Permissions.isInGroup((User) visitor, Permissions.ADMINISTRATORS_GROUP); + User visitor = Jtp.getUser(request); + boolean isSiteAdmin = Permissions.isInGroup( visitor, Permissions.ADMINISTRATORS_GROUP ); boolean allowed = Jtp.canBeRemovedBy(forum,visitor); if (!allowed) { @@ -91,7 +91,7 @@ out.print( (Jtp.hideNull(url)) ); out.print( "\"/>\r\n </div>\r\n\r\n " ); boolean isDisabled = !isSiteAdmin || currentParent == null || !Jtp.canBeDeletedBy(forum,visitor); - out.print( "\r\n <div class=\"second-font field-title\">\r\n <input type=\"radio\" " ); + out.print( "\r\n <div class=\"second-font field-title\">\r\n ChangeParent.jtp <input type=\"radio\" " ); out.print( (isDisabled?"disabled":"") ); out.print( " id=\"merge\" name=\"option\" value=\"merge\" " ); out.print( ("merge".equals(option)? "checked='y'" : "") ); @@ -210,7 +210,7 @@ } } - private static String merge(Node app, Person visitor, boolean isSiteAdmin, HttpServletResponse response) + private static String merge(Node app, User visitor, boolean isSiteAdmin, HttpServletResponse response) throws IOException, ServletException { if (isSiteAdmin || Jtp.canBeDeletedBy(app,visitor)) { @@ -236,7 +236,7 @@ } } - private static String deleteRoot(Node app, Person visitor, HttpServletResponse response) + private static String deleteRoot(Node app, User visitor, HttpServletResponse response) throws IOException, ServletException { if (Jtp.canBeDeletedBy(app,visitor)) {
--- a/src/nabble/view/web/catalog/ChangeParent.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ChangeParent.jtp Fri May 29 22:58:25 2020 -0600 @@ -47,8 +47,8 @@ if (forum == null) return; - Person visitor = Jtp.getVisitor(request, response); - boolean isSiteAdmin = visitor instanceof User && Permissions.isInGroup((User) visitor, Permissions.ADMINISTRATORS_GROUP); + User visitor = Jtp.getUser(request); + boolean isSiteAdmin = Permissions.isInGroup( visitor, Permissions.ADMINISTRATORS_GROUP ); boolean allowed = Jtp.canBeRemovedBy(forum,visitor); if (!allowed) { @@ -128,7 +128,7 @@ <% boolean isDisabled = !isSiteAdmin || currentParent == null || !Jtp.canBeDeletedBy(forum,visitor); %> <div class="second-font field-title"> - <input type="radio" <%=isDisabled?"disabled":""%> id="merge" name="option" value="merge" <%="merge".equals(option)? "checked='y'" : ""%>/> + ChangeParent.jtp <input type="radio" <%=isDisabled?"disabled":""%> id="merge" name="option" value="merge" <%="merge".equals(option)? "checked='y'" : ""%>/> <label for="merge" <%=isDisabled?"class='weak-color'":""%>>Merge into <%=Jtp.parentName(forum)%></label> <%=isDisabled? "<span class='disabled important'>/ Not Applicable</span>":""%> </div> @@ -238,7 +238,7 @@ } } - private static String merge(Node app, Person visitor, boolean isSiteAdmin, HttpServletResponse response) + private static String merge(Node app, User visitor, boolean isSiteAdmin, HttpServletResponse response) throws IOException, ServletException { if (isSiteAdmin || Jtp.canBeDeletedBy(app,visitor)) { @@ -264,7 +264,7 @@ } } - private static String deleteRoot(Node app, Person visitor, HttpServletResponse response) + private static String deleteRoot(Node app, User visitor, HttpServletResponse response) throws IOException, ServletException { if (Jtp.canBeDeletedBy(app,visitor)) {
--- a/src/nabble/view/web/catalog/ChangePinOrder.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ChangePinOrder.java Fri May 29 22:58:25 2020 -0600 @@ -4,7 +4,7 @@ import fschmidt.util.servlet.AuthorizingServlet; import nabble.model.Node; import nabble.model.NodeIterator; -import nabble.model.Person; +import nabble.model.User; import nabble.model.Site; import nabble.view.lib.Jtp; import nabble.view.lib.Shared; @@ -47,7 +47,7 @@ boolean pinnedThreads = "threads".equals(what); String title = pinnedThreads? "Pinned Threads" : "Manage " + Jtp.childName(forum, true); - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); if (!Jtp.canBeEditedBy(forum,visitor)) { Jtp.login("Only administrators can proceed in this area.", request, response);
--- a/src/nabble/view/web/catalog/ChangePinOrder.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ChangePinOrder.jtp Fri May 29 22:58:25 2020 -0600 @@ -4,7 +4,7 @@ import fschmidt.util.servlet.AuthorizingServlet; import nabble.model.Node; import nabble.model.NodeIterator; -import nabble.model.Person; +import nabble.model.User; import nabble.model.Site; import nabble.view.lib.Jtp; import nabble.view.lib.Shared; @@ -47,7 +47,7 @@ boolean pinnedThreads = "threads".equals(what); String title = pinnedThreads? "Pinned Threads" : "Manage " + Jtp.childName(forum, true); - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); if (!Jtp.canBeEditedBy(forum,visitor)) { Jtp.login("Only administrators can proceed in this area.", request, response);
--- a/src/nabble/view/web/catalog/ExportConfirmation.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ExportConfirmation.java Fri May 29 22:58:25 2020 -0600 @@ -41,7 +41,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); boolean allowed = Jtp.canBeRemovedBy(node,user); if (!allowed) { Jtp.login("Only administrators can proceed in this area.", request, response); @@ -50,7 +50,7 @@ String url = request.getParameter("url"); if (url == null || !Export.isValidExportServer(url)) { - logger.error("Invalid export URL: ["+url+"] referer="+request.getHeader("referer")+" user="+Jtp.getUser(request,response)+" user-agent="+request.getHeader("user-agent")); + logger.error("Invalid export URL: ["+url+"] referer="+request.getHeader("referer")+" user="+Jtp.getUser(request)+" user-agent="+request.getHeader("user-agent")); return; }
--- a/src/nabble/view/web/catalog/ExportConfirmation.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/ExportConfirmation.jtp Fri May 29 22:58:25 2020 -0600 @@ -41,7 +41,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); boolean allowed = Jtp.canBeRemovedBy(node,user); if (!allowed) { Jtp.login("Only administrators can proceed in this area.", request, response); @@ -50,7 +50,7 @@ String url = request.getParameter("url"); if (url == null || !Export.isValidExportServer(url)) { - logger.error("Invalid export URL: ["+url+"] referer="+request.getHeader("referer")+" user="+Jtp.getUser(request,response)+" user-agent="+request.getHeader("user-agent")); + logger.error("Invalid export URL: ["+url+"] referer="+request.getHeader("referer")+" user="+Jtp.getUser(request)+" user-agent="+request.getHeader("user-agent")); return; }
--- a/src/nabble/view/web/catalog/SetPin.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/catalog/SetPin.java Fri May 29 22:58:25 2020 -0600 @@ -3,7 +3,7 @@ import fschmidt.util.servlet.AuthorizingServlet; import nabble.model.ModelHome; import nabble.model.Node; -import nabble.model.Person; +import nabble.model.User; import nabble.view.lib.Jtp; import javax.servlet.ServletException; @@ -26,7 +26,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); Node node = Jtp.getSiteNotNull(request).getNode(Jtp.getLong(request, "node")); if (!Jtp.canBeRemovedBy(node,visitor)) {
--- a/src/nabble/view/web/embed/EmbedOptions.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/embed/EmbedOptions.java Fri May 29 22:58:25 2020 -0600 @@ -4,7 +4,7 @@ import fschmidt.util.servlet.AuthorizingServlet; import nabble.model.ModelHome; import nabble.model.Node; -import nabble.model.Person; +import nabble.model.User; import nabble.model.Site; import nabble.view.lib.EmbedUtils; import nabble.view.lib.Jtp; @@ -46,7 +46,7 @@ boolean isForum = node.getKind() == Node.Kind.APP; - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); boolean allowed = Jtp.canBeEditedBy(node,visitor); if (!allowed && isForum) {
--- a/src/nabble/view/web/embed/EmbedOptions.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/embed/EmbedOptions.jtp Fri May 29 22:58:25 2020 -0600 @@ -4,7 +4,7 @@ import fschmidt.util.servlet.AuthorizingServlet; import nabble.model.ModelHome; import nabble.model.Node; -import nabble.model.Person; +import nabble.model.User; import nabble.model.Site; import nabble.view.lib.EmbedUtils; import nabble.view.lib.Jtp; @@ -46,7 +46,7 @@ boolean isForum = node.getKind() == Node.Kind.APP; - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); boolean allowed = Jtp.canBeEditedBy(node,visitor); if (!allowed && isForum) {
--- a/src/nabble/view/web/forum/ChangeDomainName.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/ChangeDomainName.java Fri May 29 22:58:25 2020 -0600 @@ -37,7 +37,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect("http://" + Jtp.getDefaultBaseUrl(site) + Jtp.loginPath(site,null,response.encodeURL("/forum/ChangeDomainName.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/forum/ChangeDomainName.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/ChangeDomainName.jtp Fri May 29 22:58:25 2020 -0600 @@ -37,7 +37,7 @@ return; } - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { response.sendRedirect("http://" + Jtp.getDefaultBaseUrl(site) + Jtp.loginPath(site,null,response.encodeURL("/forum/ChangeDomainName.jtp?site="+site.getId())) ); return;
--- a/src/nabble/view/web/forum/Permalink.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/Permalink.java Fri May 29 22:58:25 2020 -0600 @@ -4,7 +4,7 @@ import fschmidt.util.servlet.ServletUtils; import nabble.model.ModelHome; import nabble.model.Node; -import nabble.model.Person; +import nabble.model.User; import nabble.model.Site; import nabble.view.lib.Jtp; import nabble.view.lib.TopicView; @@ -94,7 +94,7 @@ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Node Not Found"); return; } - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); String postIdS = request.getParameter("post"); Node post = postIdS == null? root : site.getNode(Long.parseLong(postIdS));
--- a/src/nabble/view/web/forum/SearchNamespace.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/SearchNamespace.java Fri May 29 22:58:25 2020 -0600 @@ -54,7 +54,7 @@ this.node = node; this.servletNs = servletNs; postQuery = new NodeSearcher.Builder(node); - User currentUser = Jtp.getUser(servletNs.request,servletNs.response); + User currentUser = Jtp.getUser(servletNs.request); postQuery.setCurrentUser(currentUser); }
--- a/src/nabble/view/web/forum/UploadFile.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadFile.java Fri May 29 22:58:25 2020 -0600 @@ -20,7 +20,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadFile.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadFile.jtp Fri May 29 22:58:25 2020 -0600 @@ -20,7 +20,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadFile2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadFile2.java Fri May 29 22:58:25 2020 -0600 @@ -27,7 +27,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadFile2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadFile2.jtp Fri May 29 22:58:25 2020 -0600 @@ -27,7 +27,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadImage.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadImage.java Fri May 29 22:58:25 2020 -0600 @@ -21,7 +21,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadImage.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadImage.jtp Fri May 29 22:58:25 2020 -0600 @@ -21,7 +21,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload a file.",request,response); return;
--- a/src/nabble/view/web/forum/UploadImage2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadImage2.java Fri May 29 22:58:25 2020 -0600 @@ -34,7 +34,7 @@ { JtpContext jtpContext = (JtpContext)getServletContext().getAttribute(JtpContext.attrName); jtpContext.setTimeLimit(request,0L); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload an image.",request,response); return;
--- a/src/nabble/view/web/forum/UploadImage2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/forum/UploadImage2.jtp Fri May 29 22:58:25 2020 -0600 @@ -34,7 +34,7 @@ { JtpContext jtpContext = (JtpContext)getServletContext().getAttribute(JtpContext.attrName); jtpContext.setTimeLimit(request,0L); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to upload an image.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Subscribe.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Subscribe.java Fri May 29 22:58:25 2020 -0600 @@ -32,7 +32,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Subscribe.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Subscribe.jtp Fri May 29 22:58:25 2020 -0600 @@ -32,7 +32,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Subscribe2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Subscribe2.java Fri May 29 22:58:25 2020 -0600 @@ -24,7 +24,7 @@ { PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Subscribe2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Subscribe2.jtp Fri May 29 22:58:25 2020 -0600 @@ -24,7 +24,7 @@ { PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/SubscribeDefaults.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/SubscribeDefaults.java Fri May 29 22:58:25 2020 -0600 @@ -28,7 +28,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/SubscribeDefaults.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/SubscribeDefaults.jtp Fri May 29 22:58:25 2020 -0600 @@ -28,7 +28,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/SubscribeToMailingList.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/SubscribeToMailingList.java Fri May 29 22:58:25 2020 -0600 @@ -41,7 +41,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to subscribe to mailing list.", request, response);
--- a/src/nabble/view/web/mailing_list/SubscribeToMailingList.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/SubscribeToMailingList.jtp Fri May 29 22:58:25 2020 -0600 @@ -41,7 +41,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to subscribe to mailing list.", request, response);
--- a/src/nabble/view/web/mailing_list/Unsubscribe.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Unsubscribe.java Fri May 29 22:58:25 2020 -0600 @@ -24,7 +24,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to unsubscribe from a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Unsubscribe.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Unsubscribe.jtp Fri May 29 22:58:25 2020 -0600 @@ -24,7 +24,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to unsubscribe from a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Unsubscribe2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Unsubscribe2.java Fri May 29 22:58:25 2020 -0600 @@ -26,7 +26,7 @@ { PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/Unsubscribe2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/Unsubscribe2.jtp Fri May 29 22:58:25 2020 -0600 @@ -26,7 +26,7 @@ { PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to be able to subscribe to a list.",request,response); return;
--- a/src/nabble/view/web/mailing_list/UnsubscribeFromMailingList.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/UnsubscribeFromMailingList.java Fri May 29 22:58:25 2020 -0600 @@ -30,7 +30,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to unsubscribe from a mailing list.", request, response);
--- a/src/nabble/view/web/mailing_list/UnsubscribeFromMailingList.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/mailing_list/UnsubscribeFromMailingList.jtp Fri May 29 22:58:25 2020 -0600 @@ -30,7 +30,7 @@ protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to unsubscribe from a mailing list.", request, response);
--- a/src/nabble/view/web/template/NabbleNamespace.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/NabbleNamespace.java Fri May 29 22:58:25 2020 -0600 @@ -539,10 +539,6 @@ out.print( Permissions.ANYONE_GROUP ); } - @Command public void registered_group(IPrintWriter out,Interpreter interp) { - out.print( Permissions.REGISTERED_GROUP ); - } - @Command public void authors_group(IPrintWriter out,Interpreter interp) { out.print( Permissions.AUTHOR_GROUP ); } @@ -950,6 +946,19 @@ */ + public static final CommandSpec debug = new CommandSpec.Builder() + .dotParameter("text") + .outputtedParameters() + .build() + ; + + @Command public void debug(IPrintWriter out,Interpreter interp) { + interp.setEncoder(Encoder.TEXT); + String text = interp.getArgString("text"); + System.out.println(text); + } + + public static final CommandSpec log = new CommandSpec.Builder() .dotParameter("text") .outputtedParameters()
--- a/src/nabble/view/web/template/NamlEditor.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/NamlEditor.java Fri May 29 22:58:25 2020 -0600 @@ -42,7 +42,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { simpleLoginPage("You must login to edit the NAML code of this application.", request, response); return; @@ -281,7 +281,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); boolean isSiteAdmin = user != null && Permissions.isInGroup(user, Permissions.ADMINISTRATORS_GROUP); boolean isSysAdmin = user != null && Permissions.isSysAdmin(user); if ((isSiteAdmin || isSysAdmin) && "POST".equals(request.getMethod())) { @@ -305,7 +305,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { resultPage("You are not logged in as an administrator.", request, response); return;
--- a/src/nabble/view/web/template/NamlEditor.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/NamlEditor.jtp Fri May 29 22:58:25 2020 -0600 @@ -42,7 +42,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { simpleLoginPage("You must login to edit the NAML code of this application.", request, response); return; @@ -821,7 +821,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); boolean isSiteAdmin = user != null && Permissions.isInGroup(user, Permissions.ADMINISTRATORS_GROUP); boolean isSysAdmin = user != null && Permissions.isSysAdmin(user); if ((isSiteAdmin || isSysAdmin) && "POST".equals(request.getMethod())) { @@ -845,7 +845,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { resultPage("You are not logged in as an administrator.", request, response); return;
--- a/src/nabble/view/web/template/NodeNamespace.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/NodeNamespace.java Fri May 29 22:58:25 2020 -0600 @@ -110,7 +110,7 @@ if( Jtp.isCached(servletNsUtils.request(interp),servletNsUtils.response(interp)) ) { return Permissions.canBeViewedByParentViewersFilter; } else { - return Permissions.canBeViewedByPersonFilter(servletNsUtils.visitor(interp)); + return Permissions.canBeViewedByPersonFilter(servletNsUtils.visitorUser(interp)); } } @@ -641,7 +641,7 @@ if( Jtp.isCached(servletNsUtils.request(interp),servletNsUtils.response(interp)) ) { out.print( Permissions.canBeViewedByParentViewers(node()) ); } else { - out.print( Permissions.canBeViewedByPerson(node(),servletNsUtils.visitor(interp)) ); + out.print( Permissions.canBeViewedByPerson(node(),servletNsUtils.visitorUser(interp)) ); } }
--- a/src/nabble/view/web/template/ServletNamespace.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/ServletNamespace.java Fri May 29 22:58:25 2020 -0600 @@ -74,7 +74,7 @@ if( visitorNs == null ) { if(Jtp.isCached(request,response) ) throw new RuntimeException("can't get visitor on cached page"); - Person visitor = Jtp.getVisitor(request, response); + Person visitor = Jtp.getUser(request); visitorNs = new UserNamespace(visitor); } return visitorNs; @@ -214,7 +214,7 @@ @Command public void set_visitor_online(IPrintWriter out,Interpreter interp) throws ServletException { - Person visitor = Jtp.getVisitor(request, response); + User visitor = Jtp.getUser(request); OnlineStatus.setOnline(request, visitor, site()); }
--- a/src/nabble/view/web/template/UserNamespace.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/template/UserNamespace.java Fri May 29 22:58:25 2020 -0600 @@ -41,8 +41,10 @@ private User userR; public UserNamespace(Person person) { +/* if( person == null ) throw new NullPointerException("person is null"); +*/ this.personR = person; this.userR = person instanceof User ? (User)person : null; } @@ -57,8 +59,6 @@ } public User user() { - if( !isUser() ) - return null; return userR; } @@ -190,7 +190,7 @@ NodeNamespace nodeNs = interp.getArgAsNamespace(NodeNamespace.class,"node"); NodeNamespace permissionNodeNs = interp.getArgAsNamespace(NodeNamespace.class,"permission_node"); String perm = interp.getArgString("permission"); - out.print( Permissions.hasPermission(permissionNodeNs.node(),nodeNs.node(),person(),perm) ); + out.print( Permissions.hasPermission(permissionNodeNs.node(),nodeNs.node(),user(),perm) ); } public static final CommandSpec has_site_permission = new CommandSpec.Builder() @@ -200,7 +200,7 @@ @Command public void has_site_permission(IPrintWriter out,Interpreter interp) { String perm = interp.getArgString("permission"); - out.print( Permissions.hasSitePermission(NabbleNamespace.current().site(),person(),perm) ); + out.print( Permissions.hasSitePermission(NabbleNamespace.current().site(),user(),perm) ); } public static final CommandSpec owns = new CommandSpec.Builder() @@ -237,7 +237,7 @@ public static final CommandSpec groups = CommandSpec.DO; @Command public void groups(IPrintWriter out,ScopedInterpreter<NabbleNamespace.GroupList> interp) { - List<String> groups = Permissions.getPersonGroups(person()); + List<String> groups = Permissions.getPersonGroups(user()); Object block = interp.getArg(new NabbleNamespace.GroupList(groups),"do"); out.print(block); }
--- a/src/nabble/view/web/user/Advanced.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/Advanced.java Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your settings.",request,response); return;
--- a/src/nabble/view/web/user/Advanced.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/Advanced.jtp Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your settings.",request,response); return;
--- a/src/nabble/view/web/user/Advanced2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/Advanced2.java Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your settings.",request,response); return;
--- a/src/nabble/view/web/user/Advanced2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/Advanced2.jtp Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your settings.",request,response); return;
--- a/src/nabble/view/web/user/ChangeAvatar.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeAvatar.java Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user==null) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/ChangeAvatar.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeAvatar.jtp Fri May 29 22:58:25 2020 -0600 @@ -19,7 +19,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user==null) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/ChangeAvatar2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeAvatar2.java Fri May 29 22:58:25 2020 -0600 @@ -54,7 +54,7 @@ jtpContext.setTimeLimit(request,0L); PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to change your avatar.", request, response); return; @@ -232,7 +232,7 @@ either by pressing F5 or using location.reload(true). */ PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) return; Jtp.dontCache(response);
--- a/src/nabble/view/web/user/ChangeAvatar2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeAvatar2.jtp Fri May 29 22:58:25 2020 -0600 @@ -59,7 +59,7 @@ jtpContext.setTimeLimit(request,0L); PrintWriter out = response.getWriter(); String context = request.getContextPath(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) { Jtp.login("You must login to change your avatar.", request, response); return; @@ -304,7 +304,7 @@ either by pressing F5 or using location.reload(true). */ PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if (user == null) return; Jtp.dontCache(response);
--- a/src/nabble/view/web/user/ChangeEmail.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeEmail.java Fri May 29 22:58:25 2020 -0600 @@ -29,7 +29,7 @@ Site site = Jtp.getSiteNotNull(request); User user = site.getUser(userId); - User visitor = Jtp.getUser(request,response); + User visitor = Jtp.getUser(request); boolean isAllowed = user.equals(visitor) || Permissions.isInGroup(visitor, Permissions.ADMINISTRATORS_GROUP); if (visitor == null || !isAllowed) { Jtp.login("You must login to change your email.",request,response);
--- a/src/nabble/view/web/user/ChangeEmail.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeEmail.jtp Fri May 29 22:58:25 2020 -0600 @@ -29,7 +29,7 @@ Site site = Jtp.getSiteNotNull(request); User user = site.getUser(userId); - User visitor = Jtp.getUser(request,response); + User visitor = Jtp.getUser(request); boolean isAllowed = user.equals(visitor) || Permissions.isInGroup(visitor, Permissions.ADMINISTRATORS_GROUP); if (visitor == null || !isAllowed) { Jtp.login("You must login to change your email.",request,response);
--- a/src/nabble/view/web/user/ChangeEmail2.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeEmail2.java Fri May 29 22:58:25 2020 -0600 @@ -18,7 +18,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/ChangeEmail2.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ChangeEmail2.jtp Fri May 29 22:58:25 2020 -0600 @@ -18,7 +18,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/EditProfile.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/EditProfile.java Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to edit your profile.",request,response); return;
--- a/src/nabble/view/web/user/EditProfile.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/EditProfile.jtp Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to edit your profile.",request,response); return;
--- a/src/nabble/view/web/user/OnlineStatus.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/OnlineStatus.java Fri May 29 22:58:25 2020 -0600 @@ -3,7 +3,6 @@ import fschmidt.util.servlet.ServletUtils; import nabble.model.Executors; import nabble.model.ModelHome; -import nabble.model.Person; import nabble.model.Site; import nabble.model.User; import nabble.view.lib.Jtp; @@ -30,11 +29,10 @@ /** Maps a site ID to a map (Person-Source-ID > last time) */ private static final Map<Long, Map<String, Long>> sitesMap = new HashMap<Long, Map<String, Long>>(); - public static void setOnline(HttpServletRequest request, Person visitor, Site site) { - setOnline(request,visitor.getSearchId(),site); - } - - private static void setOnline(HttpServletRequest request, String sourceId, Site site) { + public static void setOnline(HttpServletRequest request, User user, Site site) { + if( user==null ) + return; + String sourceId = user.getSearchId(); synchronized(sitesMap) { Map<String, Long> map = sitesMap.get(site.getId()); if (map == null) { @@ -47,7 +45,7 @@ } } - public static boolean isOnline(Person visitor, Site site) { + public static boolean isOnline(User visitor, Site site) { return isOnline(visitor.getSearchId(),site); }
--- a/src/nabble/view/web/user/RemoveAccount.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/RemoveAccount.java Fri May 29 22:58:25 2020 -0600 @@ -20,7 +20,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user==null) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/RemoveAccount.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/RemoveAccount.jtp Fri May 29 22:58:25 2020 -0600 @@ -20,7 +20,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if (user==null) { Jtp.login("You must login to change your email.",request,response); return;
--- a/src/nabble/view/web/user/ResetPassword.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ResetPassword.java Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - if ( Jtp.getUser(request,response) != null ) { + if ( Jtp.getUser(request) != null ) { Jtp.logout(request,response); } String email = request.getParameter("email");
--- a/src/nabble/view/web/user/ResetPassword.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/ResetPassword.jtp Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - if ( Jtp.getUser(request,response) != null ) { + if ( Jtp.getUser(request) != null ) { Jtp.logout(request,response); } String email = request.getParameter("email");
--- a/src/nabble/view/web/user/SendEmail.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/SendEmail.java Fri May 29 22:58:25 2020 -0600 @@ -36,7 +36,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to send an email.",request,response); return;
--- a/src/nabble/view/web/user/SendEmail.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/SendEmail.jtp Fri May 29 22:58:25 2020 -0600 @@ -36,7 +36,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request,response); + User user = Jtp.getUser(request); if( user==null ) { Jtp.login("You must login to send an email.",request,response); return;
--- a/src/nabble/view/web/user/UserPendingNodes.java Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/UserPendingNodes.java Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if ( user == null ) { Jtp.login("You must register/login to edit your profile.", request, response);
--- a/src/nabble/view/web/user/UserPendingNodes.jtp Sun Feb 02 09:04:59 2020 -0700 +++ b/src/nabble/view/web/user/UserPendingNodes.jtp Fri May 29 22:58:25 2020 -0600 @@ -25,7 +25,7 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); - User user = Jtp.getUser(request, response); + User user = Jtp.getUser(request); if ( user == null ) { Jtp.login("You must register/login to edit your profile.", request, response);