Posted: April 10th, 2008 | Author: David Schultz | Filed under: active directory, how to, ldap, php, tech | No Comments »
If you are like most companies out there, your IT department probably has everyone signing on to a Microsoft Active Directory domain. Wouldn’t it be nice to support single sign on, avoid all those seperate username/passwords littered across your intranet & save yourself some database programming? Here’s how.
First things first, you’ll need to make sure you have LDAP support installed. You can double check this by creating a php info page:
echo phpinfo();

If you run this page & see the LDAP support in there, you are good to go. If not, you’ll need to recompile PHP with ldap support by adding the –with-ldap[=DIR] option to the configure options. For sake of brevity i’ll assume you understand how to make an HTML login form. Once you have created this, you will want to capture the username & password that the user submits. Now you’ll need to connect to the ldap server:
session_start(); #make sure this is at the top of your PHP file.
$adServer = "127.0.0.1"; #replace with your AD server ip/hostname
$ldapconn = ldap_connect($adServer)
or $this->msg = "Could not connect to LDAP server.";
Now that we’re connected, you can attempt to authenticate the username/password submitted, which will return a boolean value:
$ldaprdn = $adServer . "\\" . $_POST["email"];
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $_POST["password"]);
if ($ldapbind) {
$msg = "Successfully Authenticated";
$_SESSION['email'] = $email;
$_SESSION['password'] = $password;
return true;
} else {
$msg = “Invalid email address / password”;
return false;
}
Now that you have stored the authenticated username/password in the users session data, you just need to run this same script before each page loads as you would with mysql user authentication.
From my experience, half the battle was getting my app to talk to the AD server, so best to be clear with your IT guys as to what you are attempting & what you need to minimize frustration . This was a pretty quick overview, so if you have any questions feel free to drop a comment and i will be happy to help. You can also check out the great documentation @ php.net.
Posted: March 28th, 2008 | Author: David Schultz | Filed under: cool, google, tech | No Comments »
This is pretty crazy. How would you feel if this was your car? Definitely some interesting things starting to turn up on Google Streetmaps these days.
View Larger Map
Posted: March 11th, 2008 | Author: David Schultz | Filed under: cool, music, tech | No Comments »

I have been trying to find an easy to use drum synth for quite some time now for my home studio. The thing that has been really frustrating for me is drums. With the tools i have now, I pretty much had to write my music around the short list of drum loops i had available. However, this past weekend a friend of mine who is on the bleeding edge of all this stuff introduced me to Addictive Drums. This is the best drum plugin i have seen ever - bar none, and here’s why:
- It’s MIDI not loops, so any drum beat imaginable is possible
- The samples used for each element of the kit are the most authentic I’ve ever heard
- The control you have over each part of the drum is amazing (pitch / compression / EQ…)
This is going to make it a whole lot easier for me to come up with sketch ideas for my band.
Posted: March 4th, 2008 | Author: David Schultz | Filed under: apple, coding, tech, troubleshooting | 5 Comments »
I am in a situation at my office where i need a few static routes to reach external webservers. I had this working in 10.4 thanks to the tip over @ Macosxhints however after upgrading to Leopard my routes didn’t seem to get added to my routing table. I called Apple support this morning and they had no idea and actually said they don’t support this sort of thing either. Google searches came up dry however i figured out via a few terminal commands you can get it working manually. Here’s how. Pop open Terminal, and type:
su
You’ll then need to enter your root password. Strangely this didn’t work for me at first. If you have this problem too, open up Directory Utility (apps/utilities) and then click on ‘edit’ and ‘enable root user’.
Once you have root access, you can create your static routes, here is the command:
route add –net 192.168.5.0 10.0.1.5
192.168.5.0 is the network i’m trying to reach, via the gateway 10.0.1.5.
Update: Recently this stopped working for me, not sure if it was an OSX update or something with our internal network. In any case, this solved the problem for me:
sudo route add -net 192.168.5.0/24 10.0.1.5
Posted: February 19th, 2008 | Author: David Schultz | Filed under: apple, cool, marketing, tech | No Comments »

For the technically savvy crowd with iPhones/iPod Touch’s, what a great way to add some fun to the Starbucks experience. Combined with this feature you’ll be sure to see me ordering a Tazo Chai latte on my iPod Touch in the near future.
Posted: January 9th, 2008 | Author: David Schultz | Filed under: funny, marketing, tech | No Comments »
This made me laugh pretty hard, i could relate to so much of this.
10 reasons we’re doomed, CES Edition
Posted: November 13th, 2007 | Author: David Schultz | Filed under: annoying, hosting, tech | 1 Comment »
mysitespace.com. I’m just gonna say it: these guys are absolute retards. I won’t get into all the issues i’ve had with them over the past year or so, but suffice it to say i’ve had 2 clients & my own personal website affected by their incompetent service. I am tired of getting frantic phone calls from one of my clients @ 6:45 in the morning because their HTTP & Email services are completely down so i decided to do a little blog post warning folks to stay away from these guys. I’m not the only one:
By the way, it took me about 5 mins of google searching to find those posts.
Posted: November 6th, 2007 | Author: David Schultz | Filed under: annoying, apple, funny, tech | No Comments »
Uh, Really?
Check out this post funny post on the Consumerist about how a Qwest support employee called Macs obsolete.
I thought Qwest was obsolete!
Posted: October 13th, 2007 | Author: David Schultz | Filed under: apple, hosting, tech | Tags: apple, hosting, ipod | No Comments »
Site was down for a few days this week. I’ve been using http://www.mysitespace.com for website hosting, but recently they have become really unreliable. Moved over to Godaddy and got the 80 cent discount from Diggnation (thanks Kevin). Lost all my old posts as you can see.
So i’ve been playing with my Ipod Touch for the past weeks, and i gotta say this is the most amazing media player i’ve ever used - period. It’s not for everyone, it’s pricey & the 16GB storage limit might turn some people off, but the internet connectivity is unreal. I love being able to hop on any open wifi hotspot and check my email, IM, download songs from itunes music store all for FREE - no need for a hundred dollar data plan from Rogers or Bell.
Recent Comments