Menu

Random Phoo Image

Random Phoo Image

Search

Category Cloud

Releaselog | RLSLOG.net

MonsterQuest S04E06 HDTV XviD-MONSTEROUS
Binverse - get 14 days of free Usenet access!
Ugly Betty S04E16 All the Worlds a Stage HDTV XviD-FQM
Ugly Americans S01E01 Pilot HDTV XviD-FQM
UFO Extraterrestrials Gold Edition-SKiDROW

www.VCDQuality.com Klip

Stone Bros (2009) *XviD* - DVDRIP - aAF - 03/18/2010
Survival Of The Dead (2009) *COMPLETE* *PAL* - DVDRIP - GOREHOUNDS - 03/18/2010
Alvin And The Chipmunks The Squeakquel *PROPER* *NTSC* - DVDRIP - USi - 03/18/2010
Couples Retreat MULTiSUBS *PAL* - DVDRIP - NEBULA - 03/18/2010
High Society S01E02 *HDTV* *XviD* - TV - 2HD - 03/18/2010

My GPS lost itself

Yeah! Mike Doughty ao vivo...aqui vamos nos! ;o))
Who should get laid off?
Ainda sobre os premios a gestores publicos e afins...
Entao foi assim que aconteceu...
Dolphin Bubbles: An Amazing Behavior

lms.ispgaya|pt ::: noticias

Novo site!
Vice do major acusado de burlar idosa com terreno
Oh k, tenho de admitir.
The Dears - Who Are You, Defenders of the Universe?
First-Person Shooter Modified For Fire Drill Simulation

Slashdot

Berners-Lee Calls For Government Data Transparency
Filming For the Hobbit Begins In July
YouTube's Bandwidth Bill May be Zero
MP3 Player Tax Proposed In Canada
I Want My GTV

Neowin.net

A glimpse into what Metro UI could have looked like
Google, Intel and Sony to launch Google TV
Neowin: Now hiring driven and motivated writers
Microsoft: people don't need copy and paste in Windows Phone 7
TechSpot: Customize Your Windows 7 Start Menu Button

Blog Archives

coding

pedro | funny stuff, coding | 20.10.07 | Comment on this

Vou deixar aqui uma função que pode dar jeito a alguém, visto que numa pesquisa por alto no Google não encontrei nada funcional e simples, por isso pesquisei (nunca tinha trabalhado com LDAP em php) e criei esta pequena função que devolve em binary o campo "jpegPhoto", para que assim seja possível criar a imagem.

function ldap_info_jpg($username)
{
        $ldapserver = "ldap.exemplo.com";
        $ds = ldap_connect($ldapserver);
        if ($ds) {
                //Alterar a var $dn para o dn do vosso ldap, aqui fica um exemplo:
                $dn = "uid=".$username.",ou=Users,dc=ispgaya,dc=pt";

                $filter="(objectClass= *)";
                $justthese = array("jpegphoto");

                $sr=ldap_read($ds, $dn, $filter, $justthese);
                if (ldap_count_entries($ds, $sr)==FALSE) {
                        return -2;
                        ldap_close($ds);
                } else {
                        $entry = ldap_first_entry($ds, $sr);
                        $binary = ldap_get_values_len($ds, $entry, "jpegphoto");
                        if ($binary==FALSE) {
                                return -3;
                                ldap_close($ds);
                        } else {
                                return $binary[0];
                                ldap_close($ds);
                        }
                }
        } else {
                return -1;
        }
}

Para quem quiser este código juntamente com um ficheiro para verem o output, podem fazer o download aqui.

pedro | coding | 18.10.07 | Comment on this
Online Visitors:6 Today Visitors:68 Total Visitors:54860