Jump to content

countnikon

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

countnikon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I would add another field in there that is a unique userID.  That would solve the problem real quick if you don't have very many records yet.
  2. I haven't tried that before but here is the PHP Manual Page for that with lots of developers notes http://us3.php.net/ocibindbyname Maybe this will help.
  3. Man, it sounds like you need a whole search application built.
  4. Yes.  Zend Core is completely free.  No worries.  ;)
  5. http://www.zend.com/products/zend_core/zend_core_for_oracle Uninstall your PHP and install this.  It is what I used and it works great.
  6. Install Zend Core for Oracle. Thats what I did and it works fine. http://www.zend.com/products/zend_core/zend_core_for_oracle Getting PHP and Oracle to work on Linux was a pain. What version of Oracle are you going to use? That will determine what version is necessary.
  7. http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf Oracle released this and I've been using like a Bible.
  8. That is for Windows though.  I'm doing this on Linux
  9. Here is Zend's anser to the problem: Hello Michael, What you will have to do is download the PHP 5.0.5 PHP binaries from php.net, extract them, locate the mysql.so file and copy it into the extension directory for Zend Core for Oracle, and then manually enable it via the php.ini file(extension=mysql.so). That will require a restart. This is not supported as it involves the use of a 3rd party driver. Newer versions of Zend Core for Oracle already come with the MySQL extension(disabled by default) and all you have to do is enable it. Please don't hesitate to contact us with any additional questions. ----------------------------------------------------------- Thank you for contacting Zend Support Center.
  10. I'm trying to get the Oracle Instant Client working with PHP on FC4.  All the guides I see say that you need to reinstall PHP.  However, I still need MySQL on this server for certain internal applications that we don't want to use oracle for.  Does anybody know an easy way around this?  I really need to be able to run both.
  11. I am a programmer for a Gas Compressor Manufacturer.  I work with PHP, MySQL, AJAX, Oracle, and BaaN 4GL.  Currently I'm developing a sorta E-Commerce site, and building custom web applications to display information to people easier than in our ERP system. 
  12. I built this class for LDAP authentication and Schema Searches.  I thought you all might like it.  It also handle more than one OU which all the LDAP classes I've seen do not handle.  Here it is for what it's worth. [code] <?PHP /* ****************************************************************************************** LDAP Class                                                                                Class Created 7-5-06                                                                      This class allows for LDAP searches and authentication against AD.                        You can use a foreach loop in your code that calls this class to display all entries      ------------------------------------------------------------------------------------------ Example LDAP Search.                                                                      ------------------------------------------------------------------------------------------ $ouArray = array('acct','sales','purchasing','exec','it');                                        $ldap = new ldap("dc.domain.com","389","dc=domain,dc=com");  $ldap->ldapConn();                                                                        $bind=$ldap->ldapBind("ldapuser","ldappass");                                          if($bind==false)                                                                            echo "Bind Failed<br>"; //This goes as follows //ldapSearch('what you want to pull','self explanitory','your ou array','what you are searching against') //you can search against anything in the schema.                                                                $description = $ldap->ldapSearch("description","$usrname",$ouArray,"samaccountname");    if($description)                                                                          {                                                                                          foreach($description as $output)                                                            $company=$output;                                                                    }                                                                                        ------------------------------------------------------------------------------------------ Example Ldap Authenticate                                                                ------------------------------------------------------------------------------------------ $usrname=$_POST['usrname'];                                                              $pass=$_POST['pass'];                                                                    $ldap = new ldap("dc.domain.com","389","dc=domain-systems,dc=com");  $ldap->ldapConn();                                                                        $auth = $ldap->ldapAuthenticate("$usrname","$pass");                                      if($auth)                                                                                  echo "Successful Authentication<br>";                                                  else                                                                                        echo "Authentication Failed.";                                                          ------------------------------------------------------------------------------------------ Modifications                                                                            ------------------------------------------------------------------------------------------ ****************************************************************************************** */ class ldap {   var $ldapConn; //ldap connection storage variable   var $ldapBind; //ldap bind storage variable   var $entries;  //ldap entries variable   var $ldapLookupUser;   var $ldapLookupPass;   var $server;   var $port;   var $by;   var $search;   var $baseDN;   //Function to create the ldap object   function ldap($server,$port,$baseDN)   {     $this->server=$server; //sets the dc server     $this->port=$port; //sets the port to connect to AD     $this->baseDN=$baseDN; //Sets the base DN for LDAP searches   }   //connects to the AD server   function ldapConn()   {     //connects to AD server     $this->ldapConn = @ldap_connect($this->server,$this->port);     return $this->ldapConn;   }   //Binds to the AD server so you can do lookups against it   function ldapBind($ldapLookupUser,$ldapLookupPass)   {     if(@ldap_bind($this->ldapConn,$ldapLookupUser,$ldapLookupPass))     {   $this->ldapBind = @ldap_bind($this->ldapconn,$ldapLookupUser,$ldapLookupPass);   //returns true if you are able to bind   return true; }     else       return false;   }   //Authenticates a User against AD   function ldapAuthenticate($usrname,$password)   {     if(@ldap_bind($this->ldapConn,$username,$password))       return true;     else       return false;   }   //Searches the ldap schema   function ldapSearch($by,$search,$ous,$searchby)   {     $c=0;     foreach($ous as $ou) //This foreach loop allows the searching through multiple OU's'     {       /*This line searches the AD Schema.        It is setup so that you can search for any schema item by any schema item.       */   $read=ldap_search($this->ldapConn,"ou=$ou,$this->baseDN", "$searchby=*$search*");   //This line reads in the entries for output       $entries = ldap_get_entries($this->ldapConn, $read);       //Loops through the entries and puts them in the array values       for ($i=0; $i<$entries["count"]; $i++)       {         if($entries[$i][$by][0])           $values[$c]=$entries[$i][$by][0];         $c++;       } }     return $values; //returns the values of the search   } } ?> [/code]
  13. What I always do is this: [code] <?PHP if(!isset($_COOKIE['whatever']))   header( "Location: http://blah.com/index.php" ); ?> [/code]
  14. Hello Everybody, I'm having trouble with this class I'm making for doing LDAP authentication and Lookups.  However, I cannot output my results.  Can somebody shed some light on this please? [code] <?PHP class ldap {   var $ldapconn; //ldap connection storage variable   var $ldap_bind; //ldap bind storage variable   var $entries;  //ldap entries variable   var $dc = "my dc server";   var $port = 389;   var $ldapLookupUser = "ldaplookupuser";   var $ldapLookupPass = "ldaplookup pass";     function ldapConn()   {     $this->ldapconn = @ldap_connect($dc,$port);   }   function ldapBind()   {     $this->ldap_bind = @ldap_bind($this->ldapconn,$ldapLookupUser,$ldapLookupPass);   }   function ldapAuthenticate()   {     if(@ldap_bind($this->ldapconn,$username,$password))       return true;     else       return false;   }   function ldapSearch($by,$search,$ou)   {     $read = @ldap_search($this->ldapconn, "ou=$ou,dc=mydc,dc=net", "samaccountname=*$search*");     $entries = @ldap_get_entries($this->ldapconn, $read);     for ($i=0; $i<$entries["count"]; $i++)     {       if($entries[$i][$by][0])         $values = $values.$entries[$i][$by][0];     }     return $values;   } } $ldap = new ldap; $ldap->ldapConn(); $ldap->ldapBind(); $results = $ldap->ldapSearch("mail","myusrname","myou"); echo $results; ?> [/code] I know the ldap searches are working because it is not erroring out anymore.  Any help would be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.