1 package org.campware.cream.modules.actions; 2 3 42 43 import org.apache.velocity.context.Context; 44 45 import org.apache.turbine.util.RunData; 46 import org.campware.cream.om.CreamUser; 47 48 52 public class PreferencesSQL extends CreamAction 53 { 54 55 63 public void doUpdate(RunData data, Context context) 64 throws Exception 65 { 66 CreamUser entry = new CreamUser(); 67 data.getParameters().setProperties(entry); 68 69 entry.setModified(true); 70 entry.setNew(false); 71 entry.save(); 72 } 73 74 protected boolean isAuthorized( RunData data ) throws Exception 75 { 76 boolean isAuthorized = false; 77 78 if (data.getUser().hasLoggedIn()) 79 { 80 isAuthorized = true; 81 } 82 else 83 { 84 data.setMessage("Sorry, you don't have permission for this operation!"); 85 this.setTemplate( data, "CreamError.vm"); 86 87 isAuthorized = false; 88 } 89 90 return isAuthorized; 91 } 92 93 } 94 | Popular Tags |