Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Differentiate disabled users from those who have not yet activated View modes: 
User avatar
Member
Member
joeh42 - 5/1/2012 4:27:10 PM
   
Differentiate disabled users from those who have not yet activated
How does the 'Users delete non activated user' scheduled task differentiate disabled users from those who have not yet activated?

On my site, not all users have [CMS_UserSettings].[UserActivationDate] populated, so that is not sufficient critieria for me to differentiate the two.

Thanks!
Joe

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/2/2012 12:41:56 AM
   
RE:Differentiate disabled users from those who have not yet activated
Hello.

Internally, this scheduled task selects all users assigned to the given site, which fulfills following where condition:

// Build where condition
string where = "UserEnabled = '0' AND (UserWaitingForApproval IS NULL OR UserWaitingForApproval = '0') AND @DeleteDateTime > UserCreated";

Where @DeleteDateTime parameters is DateTime.Now.AddDays(-deleteAfter) and „deleteAfter“ value is taken from settings:

int deleteAfter = SettingsProvider.SettingsKeyProvider.GetIntValue(siteName + ".CMSDeleteNonActivatedUserAfter");

So, the important column is „UserCreated.“

Best Regards,
Radek Macalik

User avatar
Member
Member
Chanan - 5/2/2012 12:48:03 PM
   
RE:Differentiate disabled users from those who have not yet activated
That doesn't look right. That would cause any user that is disabled at anytime to be deleted.

Shouldn't it be something along the lines:

int deleteAfter = SettingsProvider.SettingsKeyProvider.GetIntValue(siteName + ".CMSDeleteNonActivatedUserAfter");

int deleteAfterPlusOne = deleteAfter + 1;

SQL:
@DeleteDateTime parameters is CreateDate.AddDays(deleteAfter)
@DeleteDatePlusOneTime parameters is CreateDate.AddDays(deleteAfterPlusOne)

WHERE ... GetTime() Between @DeleteDateTime AND @DeleteDatePlusOneTime

(Pseudo Code)




User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/3/2012 4:12:14 AM
   
RE:Differentiate disabled users from those who have not yet activated
Hello.

It is taken from the source code of the given class directly. If you have full source code, you can check it. Of course, it is not everything; there are some other conditions and settings.

Anyway, you can delete this pre-defined task and write custom one, with any custom code or functionality you wish to have.

Best Regards,
Radek Macalik

User avatar
Member
Member
Chanan - 5/3/2012 6:05:39 AM
   
RE:Differentiate disabled users from those who have not yet activated
I know I can write another one. I am just pointing out that if that is the code that is running, then it should be updated as it will remove user that have been disabled a long time after they were created which is not the purpose of that task.

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/3/2012 7:45:10 AM
   
RE:Differentiate disabled users from those who have not yet activated
Hello.

I see. The purpose of this task is different. It is mentioned for deleting users, who never been enabled, because of they never confirmed registration. In such a case there is not a problem.

However, I understand your point and I did submit it as a bug, so we will consider the change. Thank you.

Best Regards,
Radek Macalik

User avatar
Certified Developer v6
Certified Developer v6
hoppe - 11/5/2012 12:58:59 PM
   
RE:Differentiate disabled users from those who have not yet activated
Hi Radek,

Can you let us know if this change will be implemented?

If it has been already implemented, can you let us know what version it was implemented in?

If it hasn't, is it planned for a specific hotfix or version?

Thanks,
Joe

User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/9/2012 6:56:18 AM
   
RE:Differentiate disabled users from those who have not yet activated
Hello.

It should have been already fixed in KCMS 6.0. As our hotfix files are cumulative, please apply the latest hotfix for KCMS 6.0. Thank you.

Best Regards,
Radek Macalik