} // checkLogin public static bool DeleteUser(WebPortalUser user) { if (user.uid > -1) { WebPortalUserDB db = new WebPortalUserDB(); return(db.DeleteUser(user)); } return(false); }
/// <summary> /// sets an extended value field for the user in the database. /// This is useful for applications that need to extend the amount of information /// gathered for a user. The extendedInfo area provides a common place to store /// that extended information. /// </summary> /// <param name="key">the case insensitive key for the information. eg: "fullname"</param> /// <param name="val">the value to set the extended information to</param> public bool saveExtendedInfo(string key, string val) { if (key.Length > 255) { //throw new Exception("Extended info key must be less than 255 characters: "+key); return(false); } if (val.Length > 1024) { // throw new Exception("Extended info value must be less than 1024 characters: "+val); return(false); } WebPortalUserDB db = new WebPortalUserDB(); bool b = db.setExtendedInfo(this, key, val); if (b) { ExtendedInfoCached = false; } return(b); }
public static WebPortalUserRole Fetch(int roleId) { WebPortalUserDB db = new WebPortalUserDB(); return(db.FetchUserRole(roleId)); }
/// <summary> /// gets a specified user role for a given role's name. Returns null if none found. /// </summary> /// <param name="name">the case insensitive role name</param> /// <returns>the WebPortalUserRole object found, or NULL if not found</returns> public static WebPortalUserRole Fetch(string name) { WebPortalUserDB db = new WebPortalUserDB(); return(db.FetchUserRole(name)); }
/// <summary> /// deletes an Extended Info key=>value pair in the database /// </summary> /// <param name="key"></param> /// <returns></returns> public bool DeleteExtendedInfo(string key) { WebPortalUserDB db = new WebPortalUserDB(); return(db.removeExtendedInfo(this, key)); }
/// <summary> /// gets all of the extended info key=>value pairs currently set for the user from the database /// </summary> /// <returns></returns> public NameValueCollection FetchAllExtendedInfo() { WebPortalUserDB db = new WebPortalUserDB(); return(db.getAllExtendedInfo(this)); }
/// <summary> /// gets an Extended value field for the user. /// This is useful for applications that need to extend the amount of information /// gathered for a user. The extendedInfo area provides a common place to store /// that extended information. /// </summary> /// <param name="key">the case insensitive key for the information. eg: "FullName"</param> /// <param name="notFoundValue">the value to return if the key is not found for the user</param> /// <returns>the value associated with the key, or the notFoundValue if the key is not found for the user.</returns> public string FetchExtendedInfo(string key, string notFoundValue) { WebPortalUserDB db = new WebPortalUserDB(); return(db.getExtendedInfo(this, key, notFoundValue)); }