11/26/2024 10:26:15 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
SLX 7.2 Web Client code
Posted: 14 Sep 07 11:42 AM
|
I need to change the code behind the Contact Web Access page, but I can not even find the page. Could it be a SLX Dev page only, like we had in the LAN client?
The change I need is to allow the use of a persons email address as their user name. The default code does not allow non-alphanumeric characters like the @. Also the rules for the password are too weak and need to be strengthened.
If I get that to work, I then need to make a modified version available in the Customer Port so the customer can change their own passwords.
|
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 11:53 AM
|
Ive not done any work with Customer Portal in 7.2 but it doesnt look like you have any quickforms to work with - to see the pages for the web portal open Project Explorer in App Architect, expand Portal Manager, and expand Sage Saleslogix Customer Portal. In this node you will find all the pages related to the Customer portal - they will be in c#/asp.net so should be fully customisable (within the frameworks of slx of course..).
Im presuming you know all the pitfalls of building/deploying the new web etc..?
Thanks, Nick |
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 12:01 PM
|
Sorry ignore other post - I thought you were talking about the login page...The webaccess page is located under POrtal Manager\ Sage Saleslogix \Support Files\Smart Parts\Contact in here is webaccess.ascx. I believe this is the one you are after. It has not yet been set up as a quickform for you to edit easily, so right click the file and open - you will have to amend the asp.net code directly...after, save then build/deploy...
thanks nick |
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 12:02 PM
|
Hi Jack,
If you look at the listing of SmartParts on the Contact Details page, you'll notice the SmartPart named WebAccess has "(custom)" listed next to it. This means that it is not a QuickForm SmartPart, but instead an ASCX file. You can locate this ASCX file in the SupportFiles for the portal. In the support files, expand the SmartParts folder, then Contact. You'll see the SmartPart listed as WebAccess.ascx. You can right-click and open it to make any modifications you need. You'll see the asp:TextBox control named "txtWebUserName". I don't however, see anything that restricts the valid/invalid chars there. |
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 12:13 PM
|
OK. I found where it validates the user name. It is in the SaveWebAccess business rule on the contact entity. So changing the ASCX file will not have any effect since the validation happens in the entity. Since this is an OOTB business rule, it is compiled in the Sage.SalesLogix.BusinessRule.dll. If you use Reflector to view the code you'll see the following:
public static void SaveWebAccess(IContact contact, bool enable, string newPassword, string repeatPassword, out string message) { SLXUserService service2 = (SLXUserService) ApplicationContext.Current.Services.Get<IUserService>(); bool flag = service2.UserId.Trim().ToUpper() == "ADMIN"; bool flag2 = false; if (!flag) { User user = service2.GetUser(); if (user != null) { flag2 = user.IsWebAdmin.HasValue ? user.IsWebAdmin.Value : false; } } if (!flag && !flag2) { message = "You do not have permission to change the Web Access options."; } else { string text3; if (!string.IsNullOrEmpty(contact.WebUserName)) { if (IsWebUserNameInUse(contact)) { message = string.Format("The WebUserName '{0}' is already in use.", contact.WebUserName); return; } if (!UserNameHasValidCharacters(contact.WebUserName)) { message = "The user name you supplied contained illegal characters. Please use only the letters a-z and digits 0-9."; return; } } if (!string.IsNullOrEmpty(newPassword) && !string.IsNullOrEmpty(contact.WebUserName)) { string text; if (!IsValidPassword(newPassword, out text)) { message = text; return; } if (string.IsNullOrEmpty(repeatPassword)) { message = "The Repeat New Password value cannot be empty."; return; } if (!newPassword.Equals(repeatPassword)) { message = "The passwords you typed do not match. Please re-enter the new password."; return; } string text2 = SLXEncryption.Encrypt(newPassword, "WTC"); contact.WebPassword = text2; contact.Save(); } WebUserOptionsService service3 = ApplicationContext.Current.Services.Get<IUserOptionsService>() as WebUserOptionsService; if (enable) { text3 = "y"; } else { text3 = "n"; } service3.SetPlatformOption("CONTEXT:webticketcust", "", text3, false, contact.Id.ToString()); message = string.Empty; } }
You'll notice the call to UserNameHasValidCharacters to ensure the name contains only chars & digits. Now, you can disable the code for this business rule (by unchecking the Active checkbox) and add your own using the code above and remove the check for non-alpha chars in the user name and all should work fine. But, the bigger question is....what else might break if you do this? Maybe this is done for a reason and the login screen will choke on non-alpha chars in the name?
Does all that make sense?
-Ryan |
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 2:04 PM
|
Make since...now to see if I can do it is another question. How do you use Reflector? Sounds like something we should have learned in the 7.2 Web class.
There are characters that probably should not be used. What I probably need to do is make a different UserNameHasValidCharacters has valid characters and only add "_- @". This way it would work for most email addresses...add additional characters as required.
Jack |
|
|
| |
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 5:13 PM
|
Reflector is a widely used free tool from Lutz Roeder. This is an essential tool for any .NET developer . It really rocks. You can use it to view code inside of compiled assemblies. I use it all the time to look inside the core Sage assemblies. You can download it here: http://www.aisto.com/roeder/dotnet/ |
|
|
|
Re: SLX 7.2 Web Client code
Posted: 14 Sep 07 5:20 PM
|
The problem, and reason why this didn't compile, is because the code I posted uses method that are found in Sage.SalesLogix.BusinessRules.dll, but your custom business rule is compiled in Sage.SnippetLibrary.CSharp.dll. You either need to remove the functions that are defined in Sage.SalesLogix.BusinessRules.dll with your own, or add a reference to that DLL and associated using statements so you can access those methods from your C# snippet. Hope that makes sense. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|