roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r328484 - /incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java
Date Tue, 25 Oct 2005 21:27:17 GMT
Author: agilliland
Date: Tue Oct 25 14:27:12 2005
New Revision: 328484

URL: http://svn.apache.org/viewcvs?rev=328484&view=rev
Log:
fixing bug mentioned by Will Gorman where you can't create websites when groupblogging.enabled=false


Modified:
    incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java

Modified: incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java?rev=328484&r1=328483&r2=328484&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/website/actions/CreateWebsiteAction.java
Tue Oct 25 14:27:12 2005
@@ -91,12 +91,13 @@
             if (permissions.size() > 0) {
                 // sneaky user trying to get around 1 blog limit that applies
                 // only when group blogging is disabled
-                forward = mapping.findForward("access-denied");
+                return mapping.findForward("access-denied");
             }           
-        } else {
-            request.setAttribute("model", 
-                new CreateWebsitePageModel(request, response, mapping, null));
         }
+        
+        request.setAttribute("model", 
+                new CreateWebsitePageModel(request, response, mapping, null));
+        
         return forward;
     }
     
@@ -131,31 +132,31 @@
                 if (permissions.size() > 0) {
                     // sneaky user trying to get around 1 blog limit that applies
                     // only when group blogging is disabled
-                    forward = mapping.findForward("access-denied");
+                    return mapping.findForward("access-denied");
                 }
-            } else {                   
-                // Need system user to create website
-                roller.setUser(UserData.SYSTEM_USER);
-                HashMap pages = null; //rollerContext.readThemeMacros(form.getTheme());
-                website = mgr.createWebsite(
-                   user, 
-                   pages, 
-                   form.getHandle(), 
-                   form.getName(), 
-                   form.getDescription(), 
-                   form.getEmailAddress(),
-                   form.getTheme(), 
-                   form.getLocale(), 
-                   form.getTimeZone());
-                roller.commit();
-
-                request.setAttribute("model", 
-                   new CreateWebsitePageModel(request, response, mapping, website));  
-
-                msgs.add(ActionMessages.GLOBAL_MESSAGE, 
-                   new ActionMessage("createWebsite.created", form.getHandle()));
-                saveMessages(request, msgs);  
             }
+            
+            // Need system user to create website
+            roller.setUser(UserData.SYSTEM_USER);
+            HashMap pages = null; //rollerContext.readThemeMacros(form.getTheme());
+            website = mgr.createWebsite(
+                    user,
+                    pages,
+                    form.getHandle(),
+                    form.getName(),
+                    form.getDescription(),
+                    form.getEmailAddress(),
+                    form.getTheme(),
+                    form.getLocale(),
+                    form.getTimeZone());
+            roller.commit();
+            
+            request.setAttribute("model",
+                    new CreateWebsitePageModel(request, response, mapping, website));
+            
+            msgs.add(ActionMessages.GLOBAL_MESSAGE,
+                    new ActionMessage("createWebsite.created", form.getHandle()));
+            saveMessages(request, msgs);
         }
         catch (RollerException e)
         {
@@ -164,8 +165,10 @@
             saveErrors(request, errors);          
             mLogger.error("ERROR in createWebsite", e);
         }
+        
         request.setAttribute("model", 
             new CreateWebsitePageModel(request, response, mapping, website));  
+        
         return forward; 
     }
         



Mime
View raw message