Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = "select Username, Password, Enabled, Stream+0, Events+0, Control+0, Monitors+0, System+0, MonitorIds from Users where Enabled = 1";
- foreach ( dbFetchAll( $sql ) as $user )
- {
- $now = time();
- for ( $i = 0; $i < 2; $i++, $now -= (60*60) ) // Try for last two hours
- {
- $time = localtime( $now );
- $authKey = ZM_AUTH_HASH_SECRET.$user['Username'].$user['Password'].$remoteAddr.$time[2].$time[3].$time[4].$time[5];
- $authHash = md5( $authKey );
- if ( $auth == $authHash )
- {
- return( $user );
- }
- }
- }
Add Comment
Please, Sign In to add comment