Authenticating Users From Windows Active Directory From PHP Code
I want to authenticate users (defined in an Active Directory Service
running on a Windows 2000 Server machine) from PHP Code running under
Linux (Fedora Core 3 with Kerberos 5 installed). I just want to find
out whether a particular user (with a given username, password
combination) exists or not. Then I will login that user into my
intranet application (developed on PHP under Linux).
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Active Directory / Exchange / Active Directory.
I'm creating an Intranet module for a client (Forum, files upload...etc...etc). This client already has a huge server running on WIN2000 + IIS 4 + Exchange + Microsoft Active directory + proxy and finally PHP 4.03 + MySql. Problem #1 : All passwords are changed every weeks, so I want to be able to import users/pass from Microsoft exchange .... Does anyone have an idea to do such thing with PHP ? Problem #2: I would like that the user logged from the firm's network do not have to log. again when connecting the module. So, is it possible to do such thing ?
Active Users Online
I am trying to keep track of the active users who are online. How would I implement a system of this nature?
Make An Active Users Script In PHP
I'm trying to make an active users script in PHP, not because I need one, because I want to know if i can. I made one that worked with PHP sessions but then it failed to work with people who had cookies turned off. So, now the script i'm using stored the time and users IP in a flat file. Needless to say it doesn't work for a seemingly unknown reason. It's a pretty small script that I heavily commented so I wouldn't get lost. If one of you more experienced PHP gurus can take a look through it real fast and tell me what's wrong and what I could do to fix it that'd be great. Code:
PHP And Active Directory
Via a PHP script (running on a LAMP configuration - PHP with LDAP support), I run queries on the LDAP server of our office (users and arguments). Now, I want to put the result of this query (user information) in a Windows 2003 AD. I use PHP-ldap functions to connect with the domain controller: making connection is no problem, but binding (authenticated, I even tried Domain Administrator credentials) doesn't work... Does anyone has experience with this matter (PHP and AD connection/communucation)?
PHP And Active Directory 2K3
Note: I'm cross-posting the below to nyphp.org as well. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ I've been struggling with an issue for a few months. I am attempting to search Active Directory 2003 via PHP, but am running into an issue searching from the base DN (i.e. 'cn=company,cn=com'). This seems to be somewhat of a known issue with AD2K3. A search at this level always returns: Warning: ldap_search() [function.ldap-search]: Search: Partial results and referral received If I change my base DN to 'ou=someOU,dc=company,dc=com', searches work properly. I was curious to see what would happen at the command line, so I used openldap's ldapsearch function against AD and sure enough I got a bunch of results that were truncated with ldap_result: Can't contact LDAP server Of note: I have a base php class that sets the following options whenever a bind is created (seems to be necessary for searching AD2K3 at all): ldap_set_option($this->_ldap, LDAP_OPT_REFERRALS, 0); ldap_set_option($this->_ldap, LDAP_OPT_PROTOCOL_VERSION, 3); Anyone have any feedback about how to search the base dn of AD2K3?
Active Directory And PHP
Is there anyway to work PHP with Active directory? My intention consist in developing an application that authenticates automatically PHP on W2k3 server.
Active Directory Authentication Via Php.
I'm in a bit of a pickle.. at the company where I recently started work, I discovered that the knowledge base we use sucks, and sucks bad (oh Lotus Notes, how I loathe thee, let me count the ways) So for kicks and giggles, I found a nice "personal notebook" solution on the net called: http://www.tiddlywiki.com/ When this had ballooned into a big, nice knowledge base, I discovered that there's a server-side version of it called cctiddly : So as a test I found a free apache/php/sql solution: - copied the cctiddly into it, and the thing worked! As you can see, up until now, no real programming has been undertaken by me, at this point, I've just been at most playing around with installing plugins into my tiddlywiki. Of course, also, now I'm faced with the ultimate question... what's the best way to authenticate people who want access to the wiki? I've researched a bit, and discovered that you can enable LDAP access via php, so theoretically you can authenticate people through AD... which is excellent! People can just use their usual username and password, no need to remember yet another user/pass, and no need for admin to have to control yet another admin control thingum. So I've been testing this out, browsing through information, and as a test I created this: ------ echo "<h3>LDAP query test #1</h3>"; echo "Connecting ..."; $ldap_host = "localhost"; $ldap_user = "user@domain.is"; $ldap_pass = "password"; $connect = ldap_connect($ldap_host) or die ("No Connection to LDAP server"); // must be a valid LDAP server! echo "connect result is " . $connect . "<br />"; if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Using LDAPv3 <br />"; } else { echo "Failed to set protocol version to 3 <br />"; } if ($connect) { echo "Binding to server..."; $bind=ldap_bind($connect, $ldap_user, $ldap_pass); echo "Bind result is " . $bind . "<br />"; } ---- - Now this works.. if I remove the $ldap_pass in the "$bind=ldap_bind($connect, $ldap_user, $ldap_pass); " line, because then I'm connecting anonymously to the LDAP server... But when I try to authenticate to the server with the password I get this error: "Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Strong(er) authentication required in C:Program Filesxampphtdocs wikiadtest.php on line 21" - which made me go, whu? Now I can't change the settings on the domain controller, as I'm not the sysadmin.. so I need to somehow create a stronger authentication to the server.. now how the hell do I do that? I can't install an SSL certificate, because there isn't one on the server, is there some way for me to make the password meet the bare minimum requirements for a stronger authentication without having to use SSL? An administratoir I know recommended to try to figure out how to use either NTLM or KERBEROS... which is at least perhaps something.
Active Directory And LDAP
I have a php Intranet, and what I would like to do is hit the Active Directory and bring back the Username, FirstName and Lastname from Active Directory and set them to variables, so I can either display them or insert them into a database. A few things to consider, php is installed on the server, but I don't have access to the server to change any settings. This is just a side project and we are blowing up the existing intranet and going with a Content Management System, so the easier the better.
Active Directory Token
My environment is setup like this: Windows Server 2003 Active Directory 2003 IIS 6.0 PHP 5.1.6 When a user tries to hit my system they are prompted for an Active Directory username / password combination. If their information is correct they get to the application. I need to modify the application code to check if the users password is about to expire. IIS can be configured to pass a token to the application. How would I use PHP to read the contents of this token so I can query AD?
Ldap And Php4 With W2k Active Directory
I am trying to get ldap info from a W2K active directory. I have the authentication down, but I want to search on the aa0000000 to get the name associated with the login. Basically I am making a request form that will be used once a year, but need to be sure of the people signing up, use resources already setup, and have one login/pass. Code:
Creating Active Directory User
does anyone already tried to create a user into active directory through php_ldap ? i tried something like this but still don't work :-/ $adduserAD["cn"][0] = "phpldapuser"; $adduserAD["samaccountname"][0] = "guguseli"; $adduserAD["objectclass"][0] = "top"; $adduserAD["objectclass"][1] = "person"; $adduserAD["objectclass"][2] = "organizationalPerson"; $adduserAD["givenname"][0] = "thomas"; $adduserAD["name"][0] = "tester"; $adduserAD["sn"][0] = "btester"; $adduserAD["description"][0] = "TEST-Account ldap"; $adduserAD["title"][0] = "Programm Manager"; ldap_add($ad, "ou=test, dc=my,dc=domain", $adduserAD) or die("error!");
Sorting Active Directory/LDAP Output (Lastname, Firstname)
My company has asked me to put a company directory on our intranet site and I'm trying to use php to extract the users from our active directory server. I've got everything working, however, when the list of users is shown in the output, it seems to display the users in the order their accounts were created, with Administrator obviously being first. What do you think would be the best way to get the list to be sorted by lastname (sn), based on the coding below. usort? ldap_sort? Not really too familiar with using php and ldap or active directory. <?php $ldap_server = "ldap://ourldap"; $auth_user = "user"; $auth_pass = "pass"; // Set the base dn to search the entire directory. $base_dn = "ou=staff, dc=ourldap, dc=com"; // Show People $filter = "(&(objectClass=user)(objectCategory=person)(cn=*))"; // connect to server if (!($connect=@ldap_connect($ldap_server))) { die("Could not connect to ldap server"); } // bind to server if (!($bind=@ldap_bind($connect, $auth_user, $auth_pass))) { die("Unable to bind to server"); }
Internet Explorer 6 Vs 7 : COM Object That Uses ADSI To Reset Active Directory Domain Accounts
Setup: IIS 6 with PHP 5.2.0 We are trying to make a COM object that uses ADSI to reset Active Directory domain accounts. We can get the script to work great in IE7, but anyone stilll using IE6 has problems. We are using authentication (IWA and IIS configured not to allow anonymous) via the browser. I also have the same problem with a simple example script off of php's site (http://us3.php.net/com) <?php $domainObject = new COM("WinNT://Domain"); foreach ($domainObject as $obj) { echo $obj->Name . "<br />"; } ?> In Internet Explorer 6 I just get "Schema". With IE7, I get the full list of objects...
Stop Users Accessing A Directory Through The Url Bar
I've got some free downloads on my site and I want to stop people from downloading them without going through the correct page. Basically all of my downloads are in a directory like so: root/downloads/download category/files I want to stop people from just typing the url of a file into there browser and having the file. I've got a file which counts how many people have downloaded files and re-directs them to the download file. I want this to be the only way someone can access the files.
Adding Users To A .htaccess Protected Directory
Users are usually added to a HTTP authenticated directory through a program called htpasswd. I want to add users to a password protected directory through my PHP script. Is that possible ?
Giving Verification Code To Users By Telephone Them
In some web site for complete registration after afew seconds they call you and a robot tell you a code then you should enter it. If it's conform to code that store on DB your registration is completed. How they can do it? Do i need special software? or not i can program it with PHP?
Phpbb Directory Permissions On Windows?
What should the directory permissions look like on the various folders in a typical phpbb install? I was looking at a server today that had phpbb installed on a box with IIS installed on it and many of the folders had read,write and modify flags set for the IUSR_MACHINENAME account. Im thinking this should be changed to read-only.
.PHP Code Does Not Parse Php5 Apache2 On Windows
Can anyone tell me why .php code is not parsed #For PHP 5: short_open_tag = Off httpd.conf # Add to the end of the LoadModule section LoadModule php5_module "C:/PHP/php5apache2.dll" AddType application/x-httpd-php .php #Add to the end of the AddModule section #AddModule mod_php5.c
Authenticating With Move_uploaded_file
I don't know if this is strictly a PHP thing, but I implemented an upload form on my site and all was well locally but after trying it on my web site I realised it wasn't working because the directories do not have write permissions for 'everyone' which makes the move from the temporary PHP directory to a write restricted directory not work. Obviously chaning it to 777 adds security problems. How do I call the move_uploaded_file or am I missing something?
Authenticating Using OpenID
I used the phpMyID and can successfully login and logout. But how to point so that a particular page requires authentication and if authenticated then only display the page content ....
Authenticating With Sessions - Safe?
I have a web app that uses authentication with sessions by checking that the user's id/pw matches with that found in MySQL. Once the user is logged in, each page checks if that session variable exists (created by login script), if it doesn't, it redirects somewhere else. So it's just checking for the session variable's existence, nothing else.
Cookies - It Is Not Authenticating Correctly
Authenticate system is via cookies, it owns 3 cookies, one with the user name, other with the password and another with the iD. However if change cookie( name ) he changes the user name and lets the same continues navigating with login that wish( and until post goods as if it was other person ) Below it follows the code that I did and that is not working: PHP Code:
Make PHP Find Windows Directory. I Need The Php Equivelant To "%WINDIR%"
I've written a small gui for PHP.ini but I don't know how to make PHP find the windows directory itself. You'll probably understand better when you see the code below. I'm currently using the line: Code: $PHP = new Config ("c:windowsphp.ini",";"); And that works fine but only if PHP.ini is in c:windows. I tried Code: $PHP = new Config ("%WINDIR%php.ini",";"); but that dowsn't work, I need something that finds windows dir. itself, Any ideas? You can see an example of it at http://213.152.46.100/gui/php-config.php (Uses a temp PHP.ini so you can't mess nothing up, feel free to play about with it)
Authenticating Cpanel Stats Page
I am trying to implement a site stats page(using webalizer from cpanel of domain) for the admin section of a site I am developing. The stats are displayed within an iframe. The page is session controlled for security reasons(as its the domains username password itself) Right now I have to use http://username:password@domain.com...izer/index.html I would like to know if its possible to authenticate the username password via php without putting the username/password combination in the url address. I am looking for some direction.
Active Persistent Links And Active Links Both 0
I just installed Apache/MySQL/PHP I'm trying to test if the connection to MySQL is there I know the database works on its own, I checked that when I run phpinfo() I get mysql listed, I'm just wondering if when it says "Active Persistent Links" and "Active Links" both 0 (zero) under "enabled" column, is that fine, meaning configured properly?
Authenticating Name And Password. Not Stopping Invalid Pass's!
I am making (oh boy, theres those scary three words) a news publishing system of my own and I am having problems getting the log in part of the script to work. I save the password and email address in a file called author name.info. The log in page has two forms, author and password. Heres my php code on the authenticating page PHP Code:
Active Row?
I have an sql table with various fields in, one of which is "Active" which is an enum 'y' or 'n'. Basically This table holds different events, of which only 1 may be active at one time. So my question is, is their an easier/better way of doing this kind of thing. At the moment I have to check all rows in the table to find which one has active set to 'y', then if i want to change it, set it to 'n' and set the new row i want active to 'y'.
Active Directoroy With PHP
I have an active directory up and running, i can query against it from the box its on, but when i try and use php to query against it, i dont get anything. It seems to be able to connect, but unable to read the information that is there. Any idea or know where a good tutorial on active directory is? I know that is Microsoft's version of LDAP, but i wondering if there was a special way you had to do things since it is AD.
Active Time
I am wondering if their is a way to have the time update itself without refreshing the page?
Active Sessions
How do I know how many active conecctions are in my server (with PHP)? I've done it with ASP, and it's WAY too easy, so I guess it should be in PHP.
Last Active Field
If i was to make a last active field in a members table in my database and had it update the field every page they went on, would this effect anything like speed? I was just thinking if say 100 people are using it at the same time and it's updating the database EVERYTIME someone clicks on a different part of the site, it may get a bit slow or something? Will this happen or is it fine to do this?
Active Sessions
Can you set up something in sessions that shows who is currently logged in? The forum does it, is that in php?
CMS - Blocking Users From Certain Users
I'm created a content managment system and the only thing I can completed is a login script (most important) and how to use sessions. Right know, how do you make something that you can add a few users, give permissions like he is allowed to add news and reviews but not features, etc? Would I add something on the each page for inserting to see if they have such permissions?
Hightlight Active Link.....
I have this table for links (below), how can I set it up so that whichever section is active then that link is highlighted? PHP Code:
Testing To See If A Page Is Active?
I have a Shoutcast station that is on and off pretty regularly. I'd like to make a "power light" on my website to detect whether the station is on or off. I'm not quite sure what the best language to handle this would be, but I think PHP should be able to do it... The station is basically outputted as a link, like this: http://www.myurl.com:8000/listen.pls If it's on, it pops open the app and goes to town.. If it's off, it gives a "page cannot be displayed error" (I'd like to do something about that, but that's a different story). So basically, I want to query the link, and if it comes back active (or true or 1 or whatever), then it includes a certain graphic; if it's not active (or false or 0 etc.) then it'd include another. I'm thinking it'd be use simple if/else statement, something like this: $radiostatus = *radiostationquery* if ($radiostatus == true) { echo "poweron.gif"; } else { echo "poweroff.gif"; } But I'm not sure what *radiosationquery* would be. Seems like it'd be a pretty simple command. Someone (familiar with coding, but not php) suggested the Get() command might be a way to do it.
Cell Active On The Date
I have a database that has a date such as 2007-12-01 with a inactive colum, what is the best way to have it make that cell active on the date that is in the date cell? So on 2007-12-01 that site would be active.
Make Links Active
Im just wondering if there is anyway to automatically make any urls in my page content, into clickable links. Basically I have a small forum I built, and I want to make any URL the user enters, into a clickable link. So if I had www.google.com as plain text, then it would make it into a clickable link.
Authenticating User Common User Names
I want to create a password protected page with PHP and Mysql. I have 2 groups User and Admin. The respective groups have a common user/password. The user/password are stored in a database. I want to authenticate the user through a login form and not through a pop-up ($PHP_AUTH_USER) way. What I want is, if a user logs in and he moves from one page to another, he should not be asked for validity again. Is this possible only with scripting (without session and $PHP_AUTH...). If yes - how do I keep track of an authorised user and unauthorised user, so that he should not be validated again. Does setting the user variable to global in all the pages do the trick.?
Number Of Current Active Session
anybody knows how to count the number of currently active session? using the current session_save_handler (/tmp and not using any db).
Please Help With This Error: Warning: Unknown(): A Session Is Active.
I've searched high and low for this on the net but stil haven't found an answer. I'm trying to install both postnuke and xoops on a win2k server with php 4.3.3. and mysql installed. Both applications are loading terribly slow. When the page finally has been rendered I got the following error: Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0 Is it a bug in PHP? Has it something to do with the fact that I'm running it at win2k? Since I think it has something to do with sessions, I attach a snapshot of the results for phpinfo() Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path D:programfilesphpsessiondata D:programfilesphpsessiondata session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid Off Off
Adding Fields To Active Tables In MySQL
I have a working PHP script using MySQL tables. I want to expand on an existing table. Is there any reason why I can't create a new field at the bottom of a table that is in use? Since each field is being called by its name it would seem that creating a new field with a unique name wouldn't cause any problems, however, I wanted to be sure before I mess with a live site. I'm still very new to PHP and MySQL so I tend to second guess myself a lot.
Ajax Chat System - Active HTTP Connection?
I am trying to build an ajax chat system. Currently I have it so that when you chat, you upload your message to the database, and each client is polling that database to see if he/she has any new messages. The problem with this is that I poll at 2 second intervals (since connection is not active), and so its not as responsive as I'd like it to be. My question is, is an active HTTP connection possible? How did Meebo or Gmail implement their ajax chat? Can someone point me to a better tool for implementing an active-connection chat, rather than a poll-based one?
Monitor Total User Active Time On Your Website
Any scripts that can be easily modified for this type of facility? I need a script that stores user session time and then adds them to display the total time a user has been active on my website.
How To Automatically Make URLs Posted In A Forum Active Links?
I've been working on modifying a forum script for some time now and its almost ready to go. You can test it at http://www.designlaunchpad.com/forum if you like. The one additional feature I want to implement is the automatic creation of a link when someone posts a URL in their message. Most forums have this, is it that tough to add in? I'm pretty comfortable editing PHP and understanding what is happening where but I suck at authoring it. I checked the manual at php.net and tried searching this forum and google but keep running into dead ends. So can someone offer me some suggestions or point me toward some help?
Old Code Vs New Code - Language Syntax Change?
I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following; I used to use a function as such; if ($REQUEST_METHOD=="POST") { Now I've seen alot of the syntax is if ($_SERVER($REQUEST_METHOD=="POST")) { And referencing variables from the form is as such; $_POST['variable'] Where previously I could reference them in the simple form; $variable Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work?
BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode post I made starts with something in brackets [like this]. This causes a strange thing to happen to the remainder of my post. Removing the brackets makes my post normal. That shows me that I need to escape the brackets. However, a simple backslash does not seem to do the trick i.e. this [wont work] I am not the administrator of the bb forum, just a poster. So I need to know what to do on my end (as opposed to an adiministrator's power to reconfigure, etc.
|