how to reset login & concurrent session counter

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
nyukuri
User
Posts: 123

how to reset login & concurrent session counter

Post by nyukuri »

Hello,

  1. at present, only an Administrator can reset the login counter or concurrent session counter. Is it possible to give just these specific rights to someone with another UserLevel, without that person having full admin rights?

  2. if solution 1 is not possible, how can I edit myself the 'memo' field where those counters are registered? I am thinking of a Row_CustomAction that would edit the 'memo' field correctly. I can reset those counters by simply deleting the field content, but I'd prefer to know how to correctly edit it so that the other information is not lost, something like the following:

function Row_CustomAction($action, $row) {
if ($action == "reset_login_counter")
{
ew_Execute("UPDATE staff SET memo = '' WHERE id = ".$row['id']); // memo deleted... but how to just MODIFY it correctly?
}
}

A correct 2. answer I'd even prefer, as I could put that Row_CustomAction also in another table, not only the user table.

Thank you for your help!
Nyukuri


mobhar
User
Posts: 11703

Post by mobhar »

There is a good example in "employees" table of demo project. You may simply refer to the generated Employees List page.

In addition, you may see some related functions under "cUserProfile" class in the generated "phpfn13.php" (assume you are using version 2017). There are "RemoveUser" and "ResetConcurrentUser" functions that belong to that class that you can use to reset login and concurrent session counter.


Post Reply