06c8041b3a10e4f56b274b7243b5d250d416db8d
integrate-login-page.md
| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | +#Integrate Your Login Page |
|
| 2 | + |
|
| 3 | +Izenda Reports ships with a sample login page, login.aspx, which is ready for customization. To learn how to customize your login.aspx, click [[here|Controlling user logins and login customization]] . During the login process, your login page will need to set the user name and admin status. Once the user information is obtained from the login page, we check what company the user belongs to and make settings changes based upon this. The setting that is used to set per-user settings is the ``PostLogin()`` method, and it should be called from your login page after setting the username and admin status but before you redirect to Izenda Reports. |
|
| 4 | + |
|
| 5 | +```csharp |
|
| 6 | +public override void PostLogin() |
|
| 7 | + |
|
| 8 | +{ |
|
| 9 | + |
|
| 10 | + //Set connection string per-tenant |
|
| 11 | + |
|
| 12 | + AdHocSettings.SqlServerConnectionString= |
|
| 13 | + |
|
| 14 | + GetConnectionStringByCompany(); |
|
| 15 | + |
|
| 16 | + |
|
| 17 | + //Set the stored reports file folder path per-tenant |
|
| 18 | + |
|
| 19 | + AdHocSettings.ReportsPath="\\" GetUserCompany() "\\" |
|
| 20 | + |
|
| 21 | + GetUserDepartment(); |
|
| 22 | + |
|
| 23 | + |
|
| 24 | + //Set table and view access |
|
| 25 | + |
|
| 26 | + AdHocSettings.VisibleDataSources = GetTables(GetUserRole); |
|
| 27 | + |
|
| 28 | + |
|
| 29 | + //Set all other settings |
|
| 30 | + |
|
| 31 | + AdHocSettings.ShowAdminButton = GetAdminStatus(); |
|
| 32 | + |
|
| 33 | + AdHocSettings.ShowModifyButton = GetAdminStatus(); |
|
| 34 | + |
|
| 35 | + |
|
| 36 | + if (GetUserCompany()=="AcmeWidget") |
|
| 37 | + |
|
| 38 | + { |
|
| 39 | + |
|
| 40 | + //Acme Widget wanted some custom settings that no other |
|
| 41 | + |
|
| 42 | + //company wanted so we put them here |
|
| 43 | + |
|
| 44 | + AdHocSettings.Formats["Currency"] = "{0:#,###.##}"; |
|
| 45 | + |
|
| 46 | + |
|
| 47 | + //Acme Widget wanted custom roles so we |
|
| 48 | + |
|
| 49 | + //set settings for custom roles you define |
|
| 50 | + |
|
| 51 | + |
|
| 52 | + if (GetUserRole()=="PowerUser") |
|
| 53 | + |
|
| 54 | + { |
|
| 55 | + |
|
| 56 | + AdHocSettings.ShowModifyButton=true; |
|
| 57 | + |
|
| 58 | + AdHocSettings.AllowDeletingReports=false; |
|
| 59 | + |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | +} //end postlogin |
|
| 65 | +``` |
|
| ... | ... | \ No newline at end of file |