public static NPCContributor GetContributor(NeoVersionedAppUser AppVAU, object[] args) { NPCContributor results = NPCContributor.Null(); byte[] encodedContributorname = (byte[])args[0]; if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("GetContributor.encodedContributorname", encodedContributorname); } NPCContributor uc = FindContributor(AppVAU, encodedContributorname); if (NeoTrace.INFO) { NPCContributor.LogExt("GetContributor.uc", uc); } results = uc; if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("GetContributor.results", results); } return(results); }
private static NPCContributor FindContributor(NeoVersionedAppUser AppVAU, byte[] encodedContributorname) { if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("FindContributor.encodedContributorname", encodedContributorname); } NPCContributor result = NPCContributor.GetElement(AppVAU, DOMAINUCD, encodedContributorname); if (NeoTrace.ARGSRESULTS) { NPCContributor.LogExt("FindContributor.result", result); } return(result); }
static readonly byte[] DOMAINUCD = "UCD".AsByteArray(); // User Credentials Directory (UCD) public static NPCContributor CreateContributor(NeoVersionedAppUser AppVAU, object[] args) { NPCContributor results = NPCContributor.Null(); byte[] encodedContributorname = (byte[])args[0]; if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("AddContributor.encodedContributorname", encodedContributorname); } byte[] encodedPassword = (byte[])args[1]; if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("AddContributor.encodedPassword", encodedPassword); } NPCContributor uc = FindContributor(AppVAU, encodedContributorname); if (NPCContributor.IsMissing(uc)) // add the unique new user { if (NeoTrace.INFO) { NPCContributor.LogExt("AddContributor.missing", uc); } uc = NPCContributor.New(encodedContributorname, encodedPassword); NPCContributor.PutElement(uc, AppVAU, DOMAINUCD, encodedContributorname); if (NeoTrace.INFO) { NPCContributor.LogExt("AddContributor.added", uc); } } else { if (NeoTrace.INFO) { NPCContributor.LogExt("AddContributor.exists", uc); } } results = uc; if (NeoTrace.ARGSRESULTS) { NeoTrace.Trace("AddContributor.results", results); } return(results); }