diff --git a/src/com/silverwrist/venice/core/impl/AdminOperationsImpl.java b/src/com/silverwrist/venice/core/impl/AdminOperationsImpl.java index c4cb372..e7cee63 100644 --- a/src/com/silverwrist/venice/core/impl/AdminOperationsImpl.java +++ b/src/com/silverwrist/venice/core/impl/AdminOperationsImpl.java @@ -163,12 +163,11 @@ class AdminOperationsImpl implements AdminOperations base_role = env.getDefaultRole("Global.NewUser"); // Create the user account. - ReturnNewUser rnu = UserContextImpl.createAccount(env,env.getUser().userRemoteAddress(),username, - password,reminder,verify_email,lockout,0,base_role, - description); + ReturnNewUser rnu = UserContextImpl.createAccount(env,env.getRemoteAddress(),username,password,reminder, + verify_email,lockout,0,base_role,description); // Need to create a normal user context here for just a minute to autojoin the communities. - UserContextImpl rc = new UserContextImpl(env); + UserContextImpl rc = new UserContextImpl(env.getGlobalSite(),env); rc.loadNewUser("0.0.0.0",rnu.getUserID(),base_role.getLevel(),username,0,rnu.getCreationDate(), rnu.getCreationDate()); rc.autoJoinCommunities(); diff --git a/src/com/silverwrist/venice/core/impl/CommunityCoreData.java b/src/com/silverwrist/venice/core/impl/CommunityCoreData.java index 1d9feec..d889deb 100644 --- a/src/com/silverwrist/venice/core/impl/CommunityCoreData.java +++ b/src/com/silverwrist/venice/core/impl/CommunityCoreData.java @@ -2109,7 +2109,7 @@ class CommunityCoreData implements CommunityData, PropertyProvider env.getEngine().registerNewCommunity(comm); // create an audit record indicating we were successful - ar = new AuditRecord(AuditRecord.CREATE_COMMUNITY,host_uid,env.getUser().userRemoteAddress(),new_cid, + ar = new AuditRecord(AuditRecord.CREATE_COMMUNITY,host_uid,env.getRemoteAddress(),new_cid, "name=" + name,"alias=" + alias); } // end try diff --git a/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java b/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java index 627b396..e5781a3 100644 --- a/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java @@ -110,7 +110,7 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend logger.debug("CommunityUserContextImpl constructor:ordinary"); this.env = new EnvCommunity(env,this); this.cid = cid; - this.level = env.getUser().realBaseLevel(); + this.level = env.getUserBaseLevel(); this.is_member = false; this.show_admin = false; this.locked = false; @@ -144,7 +144,7 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend logger.debug("setMemberValues(" + String.valueOf(granted_level) + ", " + String.valueOf(member) + ", " + String.valueOf(locked) + ")"); - this.level = Math.max(env.getUser().realBaseLevel(),granted_level); + this.level = Math.max(env.getUserBaseLevel(),granted_level); this.is_member = member; this.show_admin = env.isLevelAdmin(granted_level); this.locked = locked; @@ -1219,7 +1219,7 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend public void sendInvitation(String address, String personal_message) throws AccessError, DataException, EmailException { - if (env.getUser().userIsAnonymous()) + if (env.isAnonymous()) throw new AccessError("You must be logged in to send an invitation."); CommunityData my_comm = getData(); @@ -1245,13 +1245,12 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend // Set the remaining variables and replace them. vars.put("community.alias",my_comm.getAlias()); vars.put("personal",personal_message); - vars.put("fullname",env.getUser().realFullName()); - String uname = env.getUser().realUserName(); - vars.put("username",uname); + vars.put("fullname",env.getUserProps().propGet("fullname")); + vars.put("username",env.getUserName()); msg = StringUtil.replaceAllVariables(msg,vars); // Get a MailSend object, set it up, and send it. - MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUser()); + MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUserProps()); msend.addRecipient(MailSend.RECIP_TO,address); msend.setSubject(subject); msend.setText(msg + "\n"); @@ -1261,7 +1260,7 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend public boolean canSendInvitation() { - if (env.getUser().userIsAnonymous()) + if (env.isAnonymous()) return false; CommunityData d = getDataNE(); if (d==null) @@ -1404,7 +1403,7 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend buf.append("\n\n").append(StringUtil.replaceAllVariables(disklaimer,vars)); // send the mail in the background! - MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUser()); + MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUserProps()); msend.setSubject(subject); msend.setText(buf.toString()); MailerAgent agent = new MailerAgent(msend,mail_list); diff --git a/src/com/silverwrist/venice/core/impl/ConferenceUserContextImpl.java b/src/com/silverwrist/venice/core/impl/ConferenceUserContextImpl.java index 7f7a650..5c7e482 100644 --- a/src/com/silverwrist/venice/core/impl/ConferenceUserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/ConferenceUserContextImpl.java @@ -201,7 +201,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend this.cache = null; this.confdata = cdata; recalcLevel(new_env.getDefaultRole("Conference.Creator").getLevel()); - this.pseud = env.getUser().userDefaultPseud(); + this.pseud = env.getUserProps().propGet("default.pseud"); this.last_read = null; this.last_post = null; @@ -308,7 +308,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend else { // just default everything settings_loaded = false; - pseud = env.getUser().userDefaultPseud(); + pseud = env.getUserProps().propGet("default.pseud"); last_read = null; last_post = null; @@ -771,7 +771,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend public void setDefaultPseud(String val) throws DataException { - if (env.getUser().userIsAnonymous()) + if (env.isAnonymous()) return; // anonymous user can't change pseud if (deleted) throw new DataException("This conference has been deleted."); @@ -824,7 +824,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend public boolean anyUnread() { - if (deleted || env.getUser().userIsAnonymous()) + if (deleted || env.isAnonymous()) return false; Connection conn = null; // pooled database connection Statement stmt = null; @@ -1020,7 +1020,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend } // end if - if (env.getUser().userIsAnonymous()) + if (env.isAnonymous()) return; // anonymous user can't fixseen Connection conn = null; @@ -1383,7 +1383,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend public boolean canAddToHotlist() { - if (env.getUser().userIsAnonymous()) + if (env.isAnonymous()) return false; return !(isInHotlist()); @@ -1620,7 +1620,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend buf.append("\n\n").append(StringUtil.replaceAllVariables(disklaimer,vars)); // send the actual E-mail messages in the background - MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUser()); + MailSend msend = new PersonalMailSend(env.getMailSender(),env.getGlobalSite(),env.getUserProps()); msend.setSubject(subject); msend.setText(buf.toString()); MailerAgent agent = new MailerAgent(msend,rc); @@ -1811,7 +1811,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend public void touchRead(Connection conn) throws SQLException { - if (deleted || env.getUser().userIsAnonymous()) + if (deleted || env.isAnonymous()) return; // anonymous user can't update squat Statement stmt = null; @@ -1855,7 +1855,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend public void touchPost(Connection conn, java.util.Date post_date) throws SQLException { - if (deleted || env.getUser().userIsAnonymous()) + if (deleted || env.isAnonymous()) return; // anonymous user can't update squat Statement stmt = null; diff --git a/src/com/silverwrist/venice/core/impl/PersonalMailSend.java b/src/com/silverwrist/venice/core/impl/PersonalMailSend.java index 45b3498..a3c87f7 100644 --- a/src/com/silverwrist/venice/core/impl/PersonalMailSend.java +++ b/src/com/silverwrist/venice/core/impl/PersonalMailSend.java @@ -22,6 +22,7 @@ import com.silverwrist.venice.core.internals.UserBackend; import com.silverwrist.venice.except.*; import com.silverwrist.venice.svc.internal.GlobalSite; import com.silverwrist.venice.util.MailSend; +import com.silverwrist.venice.util.PropertyProvider; class PersonalMailSend implements MailSend { @@ -38,14 +39,14 @@ class PersonalMailSend implements MailSend *-------------------------------------------------------------------------------- */ - PersonalMailSend(MailSend inner, GlobalSite site, UserBackend user) throws DataException + PersonalMailSend(MailSend inner, GlobalSite site, PropertyProvider user_props) throws DataException { this.inner = inner; this.site = site; try { // set the "From" address in advance - inner.setFrom(user.realFullName(),user.realEmailAddress()); + inner.setFrom(user_props.propGet("fullname"),user_props.propGet("email")); } // end try catch (EmailException ee) @@ -55,8 +56,8 @@ class PersonalMailSend implements MailSend } // end catch StringBuffer buf = new StringBuffer("uid "); - buf.append(user.realUID()).append("; username \"").append(user.realUserName()).append("\"; ip ["); - buf.append(user.userRemoteAddress()).append("]"); + buf.append(user_props.propGet("id")).append("; username \"").append(user_props.propGet("name")); + buf.append("\"; ip [").append(user_props.propGet("ip.address")).append("]"); inner.addHeader("X-Venice-Sender-Info",buf.toString()); String[] headers = StringUtil.splitArray(site.getStockMessage("header-disclaimer"),"\r\n"); for (int i=0; i