mpoeschl 01/07/15 11:34:16
Modified: src/java/org/apache/turbine/flux/modules/actions
FluxAction.java FluxLogin.java FluxLogout.java
src/java/org/apache/turbine/flux/modules/actions/group
FluxGroupAction.java
src/java/org/apache/turbine/flux/modules/actions/permission
FluxPermissionAction.java
src/java/org/apache/turbine/flux/modules/actions/role
FluxRoleAction.java
src/java/org/apache/turbine/flux/modules/actions/user
FluxUserAction.java
src/java/org/apache/turbine/flux/modules/screens
FluxIndex.java FluxScreen.java
src/java/org/apache/turbine/flux/tools FluxTool.java
Log:
fixing imports for moved security classes
Revision Changes Path
1.4 +8 -8
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxAction.java
Index: FluxAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FluxAction.java 2001/07/14 22:46:46 1.3
+++ FluxAction.java 2001/07/15 18:34:12 1.4
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -58,14 +58,14 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateAction;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.util.security.AccessControlList;
+import org.apache.turbine.services.security.util.AccessControlList;
/**
* General Flux action.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxAction
+public class FluxAction
extends TemplateAction
{
/**
@@ -87,7 +87,7 @@
// Grab the Flux Admin role listed in the Flux.properties
// file that is included in the the standard
// TRP file.
- String fluxAdminRole =
+ String fluxAdminRole =
Turbine.getConfiguration().getString("flux.admin.role");
// This should be taken from a config file, this
1.3 +12 -12
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxLogin.java
Index: FluxLogin.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxLogin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FluxLogin.java 2001/07/10 16:50:38 1.2
+++ FluxLogin.java 2001/07/15 18:34:12 1.3
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -57,10 +57,10 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateAction;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.om.security.User;
-import org.apache.turbine.util.security.AccessControlList;
-import org.apache.turbine.util.security.TurbineSecurityException;
-import org.apache.turbine.services.resources.TurbineResources;
+import org.apache.turbine.Turbine;
+import org.apache.turbine.services.security.entity.User;
+import org.apache.turbine.services.security.util.AccessControlList;
+import org.apache.turbine.services.security.util.TurbineSecurityException;
import org.apache.turbine.services.security.TurbineSecurity;
/**
@@ -68,7 +68,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxLogin
+public class FluxLogin
extends TemplateAction
{
public void doPerform( RunData data, TemplateContext context ) throws Exception
@@ -100,12 +100,12 @@
data.setACL(acl);
data.save();
- data.setMessage(TurbineResources.getString("login.welcome"));
+ data.setMessage(Turbine.getConfiguration().getString("login.welcome"));
}
catch ( TurbineSecurityException e )
{
- data.setMessage(TurbineResources.getString("login.error"));
- data.setScreen(TurbineResources.getString("screen.login"));
+ data.setMessage(Turbine.getConfiguration().getString("login.error"));
+ data.setScreen(Turbine.getConfiguration().getString("screen.login"));
}
}
}
1.3 +8 -8
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxLogout.java
Index: FluxLogout.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/FluxLogout.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FluxLogout.java 2001/07/10 16:50:44 1.2
+++ FluxLogout.java 2001/07/15 18:34:12 1.3
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -57,8 +57,8 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateAction;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.util.security.AccessControlList;
-import org.apache.turbine.services.resources.TurbineResources;
+import org.apache.turbine.Turbine;
+import org.apache.turbine.services.security.util.AccessControlList;
/**
* Removes the user from the session and send tehm to the
@@ -66,7 +66,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxLogout
+public class FluxLogout
extends TemplateAction
{
public void doPerform( RunData data, TemplateContext context ) throws Exception
@@ -82,6 +82,6 @@
}
data.setACL(null);
- data.setMessage(TurbineResources.getString("logout.message"));
+ data.setMessage(Turbine.getConfiguration().getString("logout.message"));
}
}
1.4 +12 -12
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/group/FluxGroupAction.java
Index: FluxGroupAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/group/FluxGroupAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FluxGroupAction.java 2001/07/10 16:51:16 1.3
+++ FluxGroupAction.java 2001/07/15 18:34:13 1.4
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -57,19 +57,19 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.om.security.Group;
-import org.apache.turbine.util.security.EntityExistsException;
-import org.apache.turbine.util.security.UnknownEntityException;
-import org.apache.turbine.util.security.GroupSet;
+import org.apache.turbine.services.security.entity.Group;
+import org.apache.turbine.services.security.util.EntityExistsException;
+import org.apache.turbine.services.security.util.UnknownEntityException;
+import org.apache.turbine.services.security.util.GroupSet;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.flux.modules.actions.FluxAction;
/**
* Action to manage groups in Turbine.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxGroupAction
+public class FluxGroupAction
extends FluxAction
{
/**
@@ -114,9 +114,9 @@
{
Group group = TurbineSecurity.getGroup(
data.getParameters().getString("name"));
-
+
data.getParameters().setProperties(group);
-
+
try
{
TurbineSecurity.saveGroup(group);
1.4 +14 -14
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/permission/FluxPermissionAction.java
Index: FluxPermissionAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/permission/FluxPermissionAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FluxPermissionAction.java 2001/07/10 16:51:30 1.3
+++ FluxPermissionAction.java 2001/07/15 18:34:13 1.4
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -56,19 +56,19 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.om.security.Permission;
-import org.apache.turbine.util.security.EntityExistsException;
-import org.apache.turbine.util.security.UnknownEntityException;
-import org.apache.turbine.util.security.PermissionSet;
+import org.apache.turbine.services.security.entity.Permission;
+import org.apache.turbine.services.security.util.EntityExistsException;
+import org.apache.turbine.services.security.util.UnknownEntityException;
+import org.apache.turbine.services.security.util.PermissionSet;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.flux.modules.actions.FluxAction;
/**
* Action to manage permissions in Turbine.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxPermissionAction
+public class FluxPermissionAction
extends FluxAction
{
/**
@@ -83,7 +83,7 @@
data.getParameters().setProperties(permission);
String name = data.getParameters().getString("name");
-
+
try
{
TurbineSecurity.addPermission(permission);
@@ -113,9 +113,9 @@
{
Permission permission = TurbineSecurity.getPermission(
data.getParameters().getString("name"));
-
+
data.getParameters().setProperties(permission);
-
+
try
{
TurbineSecurity.savePermission(permission);
@@ -153,7 +153,7 @@
*/
}
}
-
+
/**
* Implement this to add information to the context.
*
1.4 +21 -21
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/role/FluxRoleAction.java
Index: FluxRoleAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/role/FluxRoleAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FluxRoleAction.java 2001/07/10 16:51:45 1.3
+++ FluxRoleAction.java 2001/07/15 18:34:14 1.4
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -56,18 +56,18 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.om.security.Role;
-import org.apache.turbine.om.security.Permission;
-import org.apache.turbine.util.security.EntityExistsException;
-import org.apache.turbine.util.security.UnknownEntityException;
-import org.apache.turbine.util.security.RoleSet;
-import org.apache.turbine.util.security.PermissionSet;
+import org.apache.turbine.services.security.entity.Role;
+import org.apache.turbine.services.security.entity.Permission;
+import org.apache.turbine.services.security.util.EntityExistsException;
+import org.apache.turbine.services.security.util.UnknownEntityException;
+import org.apache.turbine.services.security.util.RoleSet;
+import org.apache.turbine.services.security.util.PermissionSet;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.flux.modules.actions.FluxAction;
/**
* Action to manager roles in Turbine.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
public class FluxRoleAction extends FluxAction
@@ -110,9 +110,9 @@
{
Role role = TurbineSecurity.getRole(
data.getParameters().getString("name"));
-
+
data.getParameters().setProperties(role);
-
+
try
{
TurbineSecurity.saveRole(role);
@@ -175,18 +175,18 @@
*/
Permission[] permissions = TurbineSecurity.getAllPermissions()
.getPermissionsArray();
-
+
String roleName = role.getName();
-
+
for (int i = 0; i < permissions.length; i++)
{
String permissionName = permissions[i].getName();
String rolePermission = roleName + permissionName;
-
+
String formRolePermission =
data.getParameters().getString(rolePermission);
Permission permission = TurbineSecurity.getPermission(permissionName);
-
-
+
+
if (formRolePermission != null && !rolePermissions.contains(permission))
{
/*
@@ -194,8 +194,8 @@
* contain this permission. So assign the permission to
* the role.
*/
-
- System.out.println("adding " + permissionName + " to " + roleName);
+
+ System.out.println("adding " + permissionName + " to " + roleName);
role.grant(permission);
}
else if (formRolePermission == null &&
rolePermissions.contains(permission))
@@ -210,7 +210,7 @@
}
}
}
-
+
/**
* Implement this to add information to the context.
1.3 +23 -23
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/user/FluxUserAction.java
Index: FluxUserAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/actions/user/FluxUserAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FluxUserAction.java 2001/07/10 16:51:57 1.2
+++ FluxUserAction.java 2001/07/15 18:34:14 1.3
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -58,21 +58,21 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateAction;
import org.apache.turbine.TemplateContext;
-import org.apache.turbine.om.security.User;
-import org.apache.turbine.om.security.Group;
-import org.apache.turbine.om.security.Role;
-import org.apache.turbine.util.security.EntityExistsException;
-import org.apache.turbine.util.security.UnknownEntityException;
-import org.apache.turbine.util.security.AccessControlList;
+import org.apache.turbine.services.security.entity.User;
+import org.apache.turbine.services.security.entity.Group;
+import org.apache.turbine.services.security.entity.Role;
+import org.apache.turbine.services.security.util.EntityExistsException;
+import org.apache.turbine.services.security.util.UnknownEntityException;
+import org.apache.turbine.services.security.util.AccessControlList;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.flux.modules.actions.FluxAction;
/**
* Action to manage users in Turbine.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxUserAction
+public class FluxUserAction
extends FluxAction
{
/**
@@ -96,7 +96,7 @@
if (password == null)
{
password = "";
- }
+ }
// Make sure this account doesn't already exist.
// If the account already exists then alert
@@ -117,11 +117,11 @@
// Set some default date properties, this needs
// to be more rigourous.
Date now = new Date();
-
+
//user.setModifiedDate(now);
user.setCreateDate(now);
user.setLastLogin(new Date(0));
-
+
TurbineSecurity.addUser(user, password);
}
}
@@ -143,7 +143,7 @@
//user.setModifiedDate(now);
user.setCreateDate(now);
user.setLastLogin(new Date(0));
-
+
TurbineSecurity.saveUser(user);
}
@@ -156,7 +156,7 @@
{
User user = TurbineSecurity.getUser(
data.getParameters().getString("username"));
-
+
TurbineSecurity.removeUser(user);
}
@@ -179,11 +179,11 @@
// Grab all the Groups and Roles in the system.
Group[] groups = TurbineSecurity.getAllGroups().getGroupsArray();
Role[] roles = TurbineSecurity.getAllRoles().getRolesArray();
-
+
for (int i = 0; i < groups.length; i++)
{
String groupName = groups[i].getName();
-
+
for (int j = 0; j < roles.length; j++)
{
// In the UserRoleForm.vm we made a checkbox
@@ -194,17 +194,17 @@
// grant the user the role in the group.
String roleName = roles[j].getName();
String groupRole = groupName + roleName;
-
+
String formGroupRole = data.getParameters().getString(groupRole);
-
+
if ( formGroupRole != null && !acl.hasRole(roles[j], groups[i]))
{
TurbineSecurity.grant(user, groups[i], roles[j]);
- }
+ }
else if (formGroupRole == null && acl.hasRole(roles[j], groups[i]))
{
TurbineSecurity.revoke(user, groups[i], roles[j]);
- }
+ }
}
}
}
1.6 +10 -10
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/screens/FluxIndex.java
Index: FluxIndex.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/screens/FluxIndex.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FluxIndex.java 2001/07/14 22:46:47 1.5
+++ FluxIndex.java 2001/07/15 18:34:15 1.6
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -58,14 +58,14 @@
import org.apache.turbine.Turbine;
import org.apache.turbine.TemplateContext;
import org.apache.turbine.TemplateScreen;
-import org.apache.turbine.util.security.AccessControlList;
+import org.apache.turbine.services.security.util.AccessControlList;
/**
* Base screen for secure web access to the storage side of Tambora.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public class FluxIndex
+public class FluxIndex
extends TemplateScreen
{
/**
@@ -102,12 +102,12 @@
* @return True if the user is authorized to access the screen.
* @exception Exception, a generic exception.
*/
- protected boolean isAuthorized( RunData data )
+ protected boolean isAuthorized( RunData data )
throws Exception
{
-
+
String fluxAdminRole =
Turbine.getConfiguration().getString("flux.admin.role");
-
+
boolean isAuthorized = false;
//get acl and check security
@@ -117,7 +117,7 @@
{
data.getTemplateInfo().setScreenTemplate(
Turbine.getConfiguration().getString("template.login"));
-
+
data.setScreen(Turbine.getConfiguration().getString("screen.login"));
isAuthorized = false;
}
1.5 +12 -12
jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/screens/FluxScreen.java
Index: FluxScreen.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/modules/screens/FluxScreen.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FluxScreen.java 2001/07/14 22:46:47 1.4
+++ FluxScreen.java 2001/07/15 18:34:15 1.5
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -58,18 +58,18 @@
import org.apache.turbine.Turbine;
import org.apache.turbine.TemplateContext;
import org.apache.turbine.TemplateScreen;
-import org.apache.turbine.util.security.AccessControlList;
+import org.apache.turbine.services.security.util.AccessControlList;
/**
* Base screen for secure web acces to the storage side of Tambora.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*/
-public abstract class FluxScreen
+public abstract class FluxScreen
extends TemplateScreen
{
private static final Boolean TRUE = new Boolean(true);
-
+
/**
* Overide this to add information to the context.
*
@@ -89,7 +89,7 @@
* @param data Turbine information.
* @exception Exception, a generic exception.
*/
- protected void doBuildTemplate( RunData data )
+ protected void doBuildTemplate( RunData data )
throws Exception
{
TemplateContext context = getTemplateContext( data );
@@ -107,7 +107,7 @@
{
context.put("showFinder", TRUE);
}
-
+
if ( isAuthorized( data ) )
{
@@ -122,7 +122,7 @@
* @return True if the user is authorized to access the screen.
* @exception Exception, a generic exception.
*/
- protected boolean isAuthorized( RunData data )
+ protected boolean isAuthorized( RunData data )
throws Exception
{
boolean isAuthorized = false;
@@ -138,7 +138,7 @@
{
data.setScreenTemplate(
Turbine.getConfiguration().getString("template.login"));
-
+
isAuthorized = false;
}
else if(acl.hasRole(fluxAdminRole))
@@ -158,7 +158,7 @@
data.setLayoutTemplate(
Turbine.getConfiguration().getString("flux.stand.alone.layout"));
}
-
+
isAuthorized = true;
}
1.6 +32 -32
jakarta-turbine-flux/src/java/org/apache/turbine/flux/tools/FluxTool.java
Index: FluxTool.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-flux/src/java/org/apache/turbine/flux/tools/FluxTool.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FluxTool.java 2001/07/14 17:19:36 1.5
+++ FluxTool.java 2001/07/15 18:34:16 1.6
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -57,11 +57,11 @@
import java.util.Vector;
import java.util.Iterator;
import org.apache.turbine.RunData;
-import org.apache.turbine.om.security.Group;
-import org.apache.turbine.om.security.Role;
-import org.apache.turbine.om.security.Permission;
-import org.apache.turbine.om.security.User;
-import org.apache.turbine.util.security.AccessControlList;
+import org.apache.turbine.services.security.entity.Group;
+import org.apache.turbine.services.security.entity.Role;
+import org.apache.turbine.services.security.entity.Permission;
+import org.apache.turbine.services.security.entity.User;
+import org.apache.turbine.services.security.util.AccessControlList;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.services.pull.ApplicationTool;
@@ -73,11 +73,11 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
*/
-public class FluxTool
+public class FluxTool
implements Recyclable, ApplicationTool
{
- /**
- * The object containing request specific data
+ /**
+ * The object containing request specific data
*/
private RunData data;
@@ -100,8 +100,8 @@
* A User object for use within the Flux API.
*/
private User user = null;
+
-
public void init(Object data)
{
this.data = (RunData)data;
@@ -117,7 +117,7 @@
/**
* Constructor does initialization stuff
- */
+ */
public FluxTool()
{
}
@@ -128,12 +128,12 @@
{
if (group == null)
{
- String name = data.getParameters().getString("name");
+ String name = data.getParameters().getString("name");
if ( name == null || name.length() == 0)
{
group = TurbineSecurity.getNewGroup(null);
}
- else
+ else
{
group = TurbineSecurity.getGroup(name);
}
@@ -148,7 +148,7 @@
public Group[] getGroups()
throws Exception
- {
+ {
return TurbineSecurity.getAllGroups().getGroupsArray();
}
@@ -157,12 +157,12 @@
{
if (role == null)
{
- String name = data.getParameters().getString("name");
+ String name = data.getParameters().getString("name");
if ( name == null || name.length() == 0)
{
- role = TurbineSecurity.getNewRole(null);
+ role = TurbineSecurity.getNewRole(null);
}
- else
+ else
{
role = TurbineSecurity.getRole(name);
}
@@ -183,12 +183,12 @@
{
if (permission == null)
{
- String name = data.getParameters().getString("name");
+ String name = data.getParameters().getString("name");
if ( name == null || name.length() == 0)
{
- permission = TurbineSecurity.getNewPermission(null);
+ permission = TurbineSecurity.getNewPermission(null);
}
- else
+ else
{
permission = TurbineSecurity.getPermission(name);
}
@@ -210,12 +210,12 @@
{
if (user == null)
{
- String name = data.getParameters().getString("username");
+ String name = data.getParameters().getString("username");
if ( name == null || name.length() == 0)
{
- user = TurbineSecurity.getUserInstance();
+ user = TurbineSecurity.getUserInstance();
}
- else
+ else
{
user = TurbineSecurity.getUser(name);
}
@@ -233,33 +233,33 @@
* Select all the users and place them in an array
* that can be used within the UserList.vm template.
*/
- public User[] getUsers()
+ public User[] getUsers()
throws Exception
{
Criteria criteria = new Criteria();
-
+
String fieldList = data.getParameters().getString("fieldList");
-
+
if (fieldList != null)
{
/*
* This is completely database centric.
*/
String searchField = data.getParameters().getString("searchField");
-
+
/*
* Does this tie this admin app to a database
* implementation? And our implementation at
* that?
*/
-
+
/*
* How the hell do you make a where name like 'j%'
* type statement with Criteria?
*/
criteria.add(fieldList, (Object) searchField, Criteria.LIKE);
}
-
+
return TurbineSecurity.getUsers(criteria);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]