Base solution for your next web application

Activities of "JapNolt"

I would like to have separate password complexity settings for the host vs tenants, namely I want the host to have a high complexity (with maybe 2FA) but the tenants would have the default password complexity, which is not as high.

Currently in the framework, if the host sets a high complexity, then every tenant also has a high complexity unless the tenant changes it.

I want to track when certain clients (desktop clients) connect/disconnect from SignalR. I want to log each connect/disconnect in a database table. The question is specifically about writing to the database from inside an event. Can anybody think of a problem with doing it this way? Db contention, etc. Is there a preferred/better way?

using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.RealTime;
using MyProject.Timeline;

namespace MyProject.RealTimeCommand
{
    public class ClientStateWatcher : ISingletonDependency
    {
        private readonly IOnlineClientManager _onlineClientManager;
        private readonly IRepository<ClientStatus, long> _clientStatusRepository;

        public ClientStateWatcher(
                IOnlineClientManager onlineClientManager
                , IRepository<ClientStatus, long> clientStatusRepository
            )
        {
            _onlineClientManager = onlineClientManager;
            _clientStatusRepository = clientStatusRepository;
        }

        public void Initialize()
        {
            _onlineClientManager.ClientConnected += _onlineClientManager_ClientConnected;
            _onlineClientManager.ClientDisconnected += _onlineClientManager_ClientDisconnected;
        }

        private void _onlineClientManager_ClientConnected(object sender, OnlineClientEventArgs e)
        {
            TrackClientStatusChange(e.Client, true);
        }

        private void _onlineClientManager_ClientDisconnected(object sender, OnlineClientEventArgs e)
        {
            TrackClientStatusChange(e.Client, false);
        }

        private void TrackClientStatusChange(IOnlineClient onlineClient, bool connected)
        {
            if ((string)onlineClient.Properties.GetValueOrDefault(OccConsts.HttpHeader_ClientType) == "DesktopClient")
            {
            _clientStatusRepository.Insert(
                new ClientStatus
                {
                    Status = connected ? ConnectionState.ConnectedOrSignedIn : ConnectionState.DisconnectedOrSignedOut,
                    CreatorUserId = onlineClient.UserId,
                    TenantId = onlineClient.TenantId.Value
                });
            }
        }
    }
}
Question

We were having an issue where we would make a change to a css class for an element and after deploying the code the changes did not show unless you did a Ctrl + F5 to prevent loading from the cache.

We discovered the index.html file was being cached which was why we did not see our changes when doing a typical refresh. We found a fix which involves modifying the web.config file to not cache the index.html file like this:

<location path="index.html">
<system.webServer>
  <staticContent>
    <clientCache cacheControlMode="DisableCache" cacheControlMaxAge="0.00:00:00" />
  </staticContent>
    <httpProtocol>
        <customHeaders>
            <add name="Cache-Control" value="no-cache, no-store, must-revalidate" />
            <add name="Pragma" value="no-cache" />
            <add name="Expires" value="-1" />
        </customHeaders>
    </httpProtocol>  
</system.webServer>
</location>

This seems to work, however I was wondering if you have any guidance if this is a recommended practice, or is there a better way to prevent the caching of the index.html file?

Question

I would like to see a user-based licensing model similar to viewtopic.php?t=3369. The tenant would purchase x number of licenses of a certain edition. Those licenses would then be assigned to users up to the number purchased. Something very similar to Microsoft Office 365.

Any plans to do something like this?

@JustinP Were you able to implement a per-user licensing model? What about the recurring payment system?

@ismcagdas

I re-downloaded a new demo project off the AspNetZero site and it worked correctly. So I compared the Abp dll versions and the new dll were at 3.3.0 in the sample whereas my project was at 3.2.5. I've upgraded those dll's in my project and the problem went away. So problem resolved by updating Abp Framework dlls.

BTW, is there a blog, email list, or something like that so I can keep track when new versions of the project are released?

Clock.Provider.Kind = UTC input.StartDate.Kind = Local

@ismcagdas My experience is the same as yours. Hmmmmm.....Ahhh, but the query inputs in the app service come in as "local time", which are then executed as is.

BTW, in my original post, my offset calculations were incorrect. Your UI is sending the correct query parameter values but the backend is converting them back to local. Instead they shouldn't be converted back to local but should remain in UTC.

We are using ASP.Net Core and Angular project. We've set the project to use the UTC Clock Provider. The examples I'm going to give use the built-in Audit Logs. I've patterned some of my other data grids and filters off of this and they're suffering the same problem.

All audit logs in the db is being saved as UTC time. When shown in the Angular UI, the audit logs are showing correctly in the TimeZone that the user has selected (in my case EST, which is GMT -5). This is all good. But when the user selects a date range to filter the audit logs, the dates sent are the "local time".

So if the user selects to show audit logs from 2018/01/26, the filters are sent to the backend as 2018/01/26 00:00:00 - 2018/01/26 23:59:59. When the data is returned, there could be some audit logs with a date of 2016/01/25 which is not what the user would expect. Instead, the date range that is sent to the app service should be in UTC which in my case would be 2018/01/25 19:00:00 - 2018/01/26 18:59:59.

Am I missing some config on the Angular side or is the date range picker not being initialized correctly with the time zone offset?

In addition to our web site we have a WPF client application for our users. We want them to be able to sign up from our client app, and we would like to require re-captcha.

The problem is I can't figure out how to display a re-captcha in our client app so I can send a code along with the request to register an account. I have tried to load a page in the WPF web browser control but the re-captcha doesn't display in the page (when it does in a browser).

Would you be able to help me figure out a way to get a re-captcha code that I could send along with my request to register an account?

Showing 41 to 50 of 57 entries