Saludos a todos
Alguien sabra como ocultar la fecha o como hacer que no se pueda cambiar la fecha del sistema
es que me estan metiendo gol algunos usuarios cambiando las fechas.
Gracias a todos de antemano.
Function datahorateste()
Local oWeb, cWeb, cData
IF IsInternet()
oWeb := WebConnect():New()
cWeb := oWeb:Open( "http://www.SEU_SITE/datahora.php" )
If Left(alltrim(cWeb),8) # dtos(date())
If Val(Alltrim(Left(cWeb,8))) # 0
cData:= subs(alltrim(cWeb),7,2)+"/"+Subs(alltrim(cWeb),5,2)+"/"+Left(alltrim(cWeb),4)
If MsgYesNo("A data do computador parece desatualizado."+CRLF+CRLF+"Data Internet (SEU_SITE.com.br/datahora.php)"+CRLF+cData+CRLF+CRLF+"Data Local (seu computador)"+CRLF+Dtoc(Date())+CRLF+CRLF+"Deseja ajustar data/hora?", "Informativo!")
MsgRun( "Ajustando data e hora...", "Espere um momento", { || ajustadatahora(cData) } )
Endif
Endif
Endif
Endif
Return nil
*-------------------------------------------------------------------------------------------
Function ajustadatahora(cData)
MYRUN( "date "+cData )
SicronizaHora() // Sicroniza Hora
Return nil
//------------------------------------------------------------------------------------------
//net time /setsntp:"a.st1.ntp.br"
//net stop w32time
//net start w32time
Function SicronizaHora()
Local Serv_a := "'a.st1.ntp.br'",;
Serv_b := "'b.st1.ntp.br'",;
Serv_c := "'c.st1.ntp.br'",;
Serv_d := "'d.st1.ntp.br'",;
Serva := "'a.ntp.br'",;
Servb := "'b.ntp.br'",;
Servc := "'c.ntp.br'",;
Servgps := "'gps.ntp.br'", Time1:=Time()
// Spain es.pool.ntp.org
// server 0.es.pool.ntp.org
// server 1.es.pool.ntp.org
// server 2.es.pool.ntp.org
// server 3.es.pool.ntp.org
MYRUN( "net time /setsntp:"+&Serv_a+" && net stop w32time && net start w32time" )
Return nil
//------------------------------------------------------------------------------------------
Function MYRUN( cComando )
Local oShell, RET
oShell := CreateObject( "WScript.Shell" )
RET := oShell:Run( "%comspec% /c " + cComando, 0, .T. )
oShell := NIL
Return iif( RET = 0, .T., .F. )
//------------------------------------------------------------------------------------------
// conteudo do datahora.php // criar com bloco de notas e pôr no SEU_SITE
//------------------------------------------------------------------------------------------
<?php echo(date("Ymd;His")); ?>
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 77 guests