locked
Prevent System Date change RRS feed

  • Question

  • How can I prevent a user to change the system date of a PC. My program wants to restrict a user to launch it for a certain date.

    Thank you and God bless you

    Wednesday, June 25, 2014 1:23 AM

Answers

  • If you need to do it for user/computer privilege, look at the following link    http://www.sevenforums.com/tutorials/113557-date-time-allow-prevent-users-groups-changing.html

    If you want to do it from inside your program/application, add a privilege and keep track of who has which privilege as well as the value. Then, when the user select a specific menu option you will first validate that the user has privileges for it.

    Wednesday, June 25, 2014 1:51 AM

All replies

  • If you need to do it for user/computer privilege, look at the following link    http://www.sevenforums.com/tutorials/113557-date-time-allow-prevent-users-groups-changing.html

    If you want to do it from inside your program/application, add a privilege and keep track of who has which privilege as well as the value. Then, when the user select a specific menu option you will first validate that the user has privileges for it.

    Wednesday, June 25, 2014 1:51 AM
  • Thank you Benny for Helping.

    God bless your heart

    Rolly

    Wednesday, June 25, 2014 2:31 AM
  • Benny is right, this can only be restricted on the OS level and not in any single application.

    Anyway, restricting this to users, which are in the administrator group, they could a) remove their restriction and b) change the system date and c) restrict themselves again.

    If you have internet connection you can always verify system time with a time you get back from eg google.com

    loXmlHttp = Createobject("MSXML2.XMLHTTP") loXmlHttp.Open("HEAD", "https://www.google.com/?q=",.F.) loXmlHttp.Send() Do While loXmlHttp.readyState <>4 DoEvents Enddo ? loXmlHttp.getResponseHeader("Date")

    If you have a SQL Server connection open, do SQLExec(conhandle,"Select getdate()","curDateTime")

    Or use FTIME() from a file you create in a server share (instead of locally).

    All this/any of this could be done to verify the system time is set correctly. If you can't reach out to anything external there is no way to verify, though.

    Bye, Olaf.


    Olaf Doschke - TMN Systemberatung GmbH

    http://www.tmn-systemberatung.de

    Tuesday, July 1, 2014 6:08 AM