Jump to content

gavinr98

New Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

gavinr98's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I turned on error reporting and don't get any errors. I was able to add some additional tests to the script and when doing so it always returns "null" and does not determine what group the users is in. Here is the new code I am using... any help would be appreciated. <?php ini_set('display_errors', 1); error_reporting (E_ALL); $arguments = getopt("u"); echo grouptestfull($arguments['u']); function grouptestfull($user) { require_once(dirname(__FILE__) . '/adLDAP.php'); $adldap = new adLDAP(); try { $ldap_db = new adLDAP(); } catch (adLDAPException $e) { echo $e; exit(); } // clear the flags $validhr = false; $validinf = false; $validroot = false; //check group if(($ldap_db->user_ingroup($user,"SD.HR", true))) { echo "\nvalidhr\n"; $validhr = true; } if(($ldap_db->user_ingroup($user,"SD.INF", true))) { echo "\nvalidinf\n"; $validinf = true; } if(($ldap_db->user_ingroup($user,"SD.ROOT", true))) { echo "\nvalidroot\n"; $validroot = true; } //sort and return highest lvl group membership if ($validroot) { return "validroot"; echo "validroot"; //for testing only } else { echo "GOT HERE1"; //for testing only if ($validinf) { return "validinf"; echo "validinf"; //for testing only } else { if ($validhr) { ; return "validhr"; echo "Validhr"; //for testing only } else { echo "null"; //for testing only return ""; } } } } echo "GOT HERE2"; //for testing only ?>
  2. Thanks for the reply, I tried that and still does not seem to work. The code was given to me by someone so not sure why it was done this way. Any suggestions on making this work would be great.
  3. Hello, I was given some php code to use for an online company directory and need some help. I am not very good at PHP so any help would be appreciated. I have several php pages that are working fine however the part that is not working is the group membership lookup. The way this works is I have a wordpress plugin that authenticates the user to Active Directory when they login to the site it checks for the group that the users belongs to, the part that is not working is when they login it does not check what group they belong to and just logs them in as a regular user even if they are part of the group... attached is the code, on page1 I have removed a lot of the code which is working correctly, the part that does not is the line that calls page2... any help would be great. 18041_.php 18042_.php
  4. Hope someone can help me with this. Here is what I am trying to do... I am using a wordpress plugin that authenticates to Active Directory, however when the user logs in I need the php page to check for the group the user belongs to and if they are part of a particular group they will have certain access on the site. Here is the part of the code that I am using which does not seem to work, when they login it does not detect the group that they are in... $str = shell_exec('./grouptestfull.php -u'.$LoggedInUsername); calls grouptestfull.php which is this... #!/usr/bin/php -q <?php /* Version 1 - inital version */ error_reporting(0); $arguments = getopt("u:"); //print_r($arguments); print $arguments['u']; //print grouptestfull($loggedinusersusername); echo grouptestfull($arguments['u']); function grouptestfull($gtfusernamein) { // clear the flags $validhr = false; $validinf = false; $validroot = false; //print "username as receved by function ".$gtfusernamein."<br>"; $gtfusername = ""; $gtfusername = $gtfusernamein.""; //print "processed username ".$gtfusername."<br><hr>"; include("adLDAP.php"); try { $gtfadldapedit = new adLDAP(); } catch (adLDAPException $e) { echo $e; exit(); } //check group membership if(($gtfadldapedit->user_ingroup($gtfusername."","SD.HR"))) { $validhr = true; } if(($gtfadldapedit->user_ingroup($gtfusername."","SD.INF"))) { $validinf = true; } if(($gtfadldapedit->user_ingroup($gtfusername."","SD.ROOT"))) { $validroot = true; } //sort and return highest lvl group membership if ($validroot) { return "validroot"; } else { if ($validinf) { return "validinf"; } if ($validhr) { return "validhr"; } else { //return ""; } } } ?> I get no errors in the php error log, but just can't figure out why this is not working. Thanks
  5. PHP version is 5.2.17, this was installed the same time Apache was installed using the php 5.2.17-win32-vc6-86.msi installer.
  6. So it appears that Apache is crashing when it launches the php_ldap.dll, this is why all the browsers are returning an error... Faulting application name: httpd.exe, version: 2.2.22.0, time stamp: 0x4f242d7a Faulting module name: php_ldap.dll, version: 5.2.17.17, time stamp: 0x4d25fc30 Exception code: 0xc00000fd Fault offset: 0x00013782 Faulting process id: 0x1b4c Faulting application start time: 0x01cd06be4075321e Faulting application path: C:\Apache\bin\httpd.exe Faulting module path: C:\PHP\ext\php_ldap.dll Report Id: 7fb0a9fe-72b1-11e1-af19-c42c033174a0 Do you think this an issue with PHP or the actual php script that is running?
  7. I have been working on a Company Directory that uses PHP, Apache, Wordpress and Active Directory. The directory has been working perfectly for the last few months and all of a sudden I get the following errors... This error is from Chrome... No data received Unable to load the webpage because the server sent no data. Here are some suggestions: Reload this webpage later. Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. This error is from IE Failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error This error is from Firefox The connection was reset The connection to the server was reset while the page was loading. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web. The site is built within wordpress, using an Active Directory plugin for authentication to the site. You can load the site without logging in and all the users and their information show up fine, the second I login to the site I get these errors and nothing ever loads. Not sure what has happened but if anyone has any ideas as what might be causing this It would be greatly appreciated. Thanks
  8. Thank you so much for the help, everything is working now. Thanks Gavin...
  9. Hello, I am having a problem with displaying images for captcha on my site, I found out that my hosting company requires me to use a php.ini file to turn on GD so the image displays. I have tried to use several php.ini files and nothing seems to work, can anyone help with a sample php.ini that only enables GD and does not affect any of the other pages. Below is what I entered in the php.ini and the image still does not display... any help on this is appreciated. extension=php_gd2.dll Thanks Gavin...
×
×
  • 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.