This topic is locked
[SOLVED]

 Create Login To Authorize Make Changes

5/21/2013 23:54:47
PHPRunner General questions
D
d_gan author

Currently I have a function to check input price by user that shall not lower then cost price of the product. If the user entered the price which is lower it will prompt error invalid price. However I want to allow his supervisor who authorize to set lower by key-in supervisor login without the user log out. I am thinking to set the blocking function to do nothing(null) but I can't find way to get supervisor to login without user log out first on same computer.
Please suggest me some workaround that pop up login to reset this function.

C
cgphp 5/22/2013

It's not an elegant solution but they might use two different browsers on the same computer.

D
d_gan author 5/22/2013

Thank but not the solution for my case.

Sergey Kornilov admin 5/22/2013

Here is an idea of how you can make it work.
You do not want supervisor to actually logon. You just need them to enter username and password to confirm the action.

  1. Create a custom view of the login table.
  2. Enable Add page of this custom view displaying username and password fields there. No other fields are required. Change 'Save' button to read 'Login' and remove all other buttons.
  3. When pricing conflict happens display this Add page in the popup. Here is the article that explains how to achieve this:

    http://xlinesoft.com/blog/2013/04/25/displaying-a-page-in-a-popup-window/
  4. In BeforeAdd event of this custom view do the following:

  • make sure username/password are correct and this user is a supervisor
  • perform the requested action
  • return false to prevent record from being added to the login table
    This is it.