]> www.vanbest.org Git - lootjes-play/commitdiff
Added security to admin pages
authorJan-Pascal van Best <janpascal@vanbest.org>
Mon, 27 Feb 2012 14:15:46 +0000 (15:15 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Mon, 27 Feb 2012 14:15:46 +0000 (15:15 +0100)
app/controllers/Partys.java
app/controllers/Security.java [new file with mode: 0644]
app/controllers/Users.java
conf/application.conf
conf/messages
conf/routes

index a47fa8405b3933c4a2a25096256207711758644a..5e06fdd8237e954516094609bd5b1532a081ce3d 100644 (file)
@@ -2,6 +2,7 @@ package controllers;
  
 import play.*;
 import play.mvc.*;
+
+@With(Secure.class) 
 public class Partys extends CRUD {    
 }
diff --git a/app/controllers/Security.java b/app/controllers/Security.java
new file mode 100644 (file)
index 0000000..f3224f6
--- /dev/null
@@ -0,0 +1,11 @@
+package controllers;
+import models.*;
+public class Security extends Secure.Security {
+        
+    static boolean authenticate(String username, String password) {
+        return User.connect(username, password) != null;
+    }
+    
+}
index 29f4dd3c2859a48156a3ee71ca962f34802c4e3c..907e997e570e2c03fff0edfd2b3e30db8e9a3f87 100644 (file)
@@ -2,6 +2,8 @@ package controllers;
  
 import play.*;
 import play.mvc.*;
+
+
+@With(Secure.class) 
 public class Users extends CRUD {    
 }
index 5629d1c3b62147048a5a1dd13c97c575930f9385..56bc829263e25292202a29ce7988de6411cf5a10 100644 (file)
@@ -221,4 +221,4 @@ blog.title=Yet another blog
 blog.baseline=We will write about nothing
 
 # Import the secure module
-module.secure=${play.path}/modules/secure
+module.secure=${play.path}/modules/secure
index b51f29459d17443a3ba2cae152f2c732d36f93a7..0e07937bcb3dd1f1a51998d7ff7f28607ed4cc75 100644 (file)
@@ -1,3 +1,4 @@
 # You can specialize this file for each language.
 # For example, for French create a messages.fr file
 #
+Partys=Parties
index 24c4663e409bdcc23705159e3ac6d0ca069ed1bc..800e660c0ddde421115d1d10f41e347fefbb2a14 100644 (file)
@@ -12,7 +12,7 @@ GET     /party/{id}                           Application.showParty
 *      /admin/                                   module:crud
 
 # Import Secure routes
-# geen gezicht *       /                                       module:secure
+*       /                                       module:secure
 
 # Ignore favicon requests
 GET     /favicon.ico                            404