Page 1 of 1

Which parameter counts users web-logins

Posted: Thu Oct 26, 2023 4:49 pm
by Broemmelhaus
In domain->General Setting-> Password Security we have activate the Option "Need to change the password on the first logon".

Which parameter causes the question for a new Password at the first login?
I've logged in with an FTP-Client first time and in the user account statistic the counter shows 1 login.
After that I logged in using a web browser and the prompt for password-change pops up.

So it looks, as if there is a special parameter for counting the users web-logins, but I couldn't find the right.
Thank you for your help!

Best regards
Meik

Re: Which parameter counts users web-logins

Posted: Fri Oct 27, 2023 12:11 am
by FTP
OK, it depends on the last login IP, if the last login IP is empty, then logged in web client user will be forced to change his password. You can use this Lua API to reset the last login IP: c_ResetUserLoginIP("DomainName", "UserName")

Re: Which parameter counts users web-logins

Posted: Fri Oct 27, 2023 4:20 am
by Broemmelhaus
Thanks! That makes sense and is exactly what I was looking for.

Re: Which parameter counts users web-logins

Posted: Fri Oct 27, 2023 5:44 am
by Broemmelhaus
One last additional question:
If I see it correctly, this is the "last_loginip"-value that is being allocated/deleted in the user account.
Is it possible to change the value manually?

Our workflow involves deleting all users and then creating them again. If we do this with function "Need to change the password on the first logon" activated, all users will have to repeatedly assign new passwords. We would simply read out the login value from the existing ones and insert them again. So that only new and not yet logged in users receive the request to change their password. It probably sounds strange, but that's how it is :-)

Re: Which parameter counts users web-logins

Posted: Fri Nov 03, 2023 7:55 am
by Broemmelhaus
It's cleared up. I hadn't thought that the value could simply be written to the user account:

local str_user = c_GetUser(domain,username)
str_user.last_loginip = '123.123.123.123'
AddUser(domain,str_user)

Thank you again for your support!

Re: Which parameter counts users web-logins

Posted: Fri Nov 03, 2023 12:30 pm
by Broemmelhaus
My previous entry was wrong. The value cannot be changed via the AddUser. Apparently I found no way to set this value manually.
I would be very grateful if someone could tell me if and how I can set the value manually.

Best regards
Meik

Re: Which parameter counts users web-logins

Posted: Fri Nov 03, 2023 2:53 pm
by FTP
You can't set the attribute "last_loginip", it is a read-only attribute.

And you can't edit the user account like that, you should handle it like this:

Code: Select all

	local user = c_GetUser(strDomain,strUsername)

	for k,v in pairs(user) do
		if type(v) == "boolean" then
			if v == true then
				user[k] = 1
			else
				user[k] = 0
			end
		end
	end

	...
	AddUser(strDomain, user)