-
December 12th, 2005, 08:54 AM
#16
Registered User
One more thing: in case you don't have a PHP IDE application, I strongly suggest you use one, it makes troubleshooting much easier - ex forgot a ';' somewhere or some brackets not closed. I love PHP Designer (freeware).
Protected by Glock. Don't mess with me!
-
December 13th, 2005, 01:37 AM
#17
Re: Function
Thanks for your advice about the IDE, the function
ldap_get_logonhours
doesn't seems to work properly it resets everything and returns only " 0 "s
-
April 28th, 2015, 11:23 AM
#18
I know this thread is super old but I'm having the same issue as uchi. Anyone ever figure this out? And if so, can anyone show me an example of the $hrs variable that goes into the ldap_get_logonhours array?
Thanks!
-
April 28th, 2015, 01:50 PM
#19
Anyone out there looking for an answer here's what I figured out:
$eighthourchunks = str_split($hourshex, 2);
foreach ($eighthourchunks as $chunk){
$i++;
$bytes .= strrev(sprintf('%08d',decbin(hexdec('0x' . $chunk))));
}
$bytesbegin = substr($bytes, 0, 5);
$bytesend = substr($bytes, 5);
$bytes_tz_corrected = $bytesend . $bytesbegin;
$daysarr = str_split($bytes_tz_corrected, 24);
$dowMap = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
$i = 0;
foreach ($daysarr as $day){
echo $dowMap[$i];
echo ' : ' . $day . '<br>';
$i++;
}
-
May 11th, 2015, 02:09 PM
#20
Hopefully I don't piss too many people off for tacking on to this post.. It just seemed like a good idea to keep this all together.
So I took the data generated from my last post and created a table. I then used javascript to control that table to recreate functionality similar to what we are all used to seeing in Active Directory where the blue cells represent permitted hours and the gray ones are blocked off hours. Javascript then uses AJAX with post method to return the binary data back to php and php uses pack("C", bindec(strrev($chunk))) in a foreach loop to format it correctly for active directory. My only problem is that I intermittently get the error "Server unwilling to perform 53" and I think it's due to the formatting I'm using. Is there something I should tack on to pack("C", bindec(strrev($chunk))) for it to consistently work?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks