| Révision précédenteDernière révision |
— | entreprises-ng [2014/09/15 12:02] – athimel |
---|
| <php> |
| |
| echo "<script src=\"https://code.jquery.com/jquery-1.11.1.min.js\"></script>"; |
| echo "<style type=\"text/css\">"; |
| echo "img.map { width: auto; height: 60px; margin-right: 5px; float: right; }"; |
| echo ".company-card { display: inline-block; width: 400px; min-height: 100px; margin: 1em; padding: 1em; border: 1px solid #AAA; text-align: left; box-shadow: 1px 1px 12px #aaa; vertical-align: text-top; }"; |
| echo ".company-card h1 { margin:0px !important; padding:0px; border-bottom: 0px !important; text-transform: none !important; font-size: 18px !important; display: inline-block; }"; |
| echo ".company-card img.logo { width: auto; height: 60px; margin-right: 5px; float: right; }"; |
| echo ".company-card img.icon { width: 8px; height: auto; margin-right: 5px; }"; |
| echo ".company-card p { overflow: hidden; }"; |
| echo "</style>"; |
| |
| echo "<img class=\"map\" src=\"http://www.openstreetmap.org/assets/osm_logo-22e0795e896eaaa60c12e013715004f1.png\" title=\"Visualiser sur une carte\"/>"; |
| |
| </php> |
| |
| |
| <php> |
| |
| |
| require "Net/LDAP2.php"; |
| |
| $config = array ( |
| 'binddn' => 'uid=web,ou=sysaccounts,o=code-lutin,ou=companies,o=libre-entreprise ', |
| 'bindpw' => 'ne6vdAbD', |
| 'basedn' => 'o=libre-entreprise', |
| 'host' => 'ldaps://ldap.libre-entreprise.org', |
| 'port' => '636', |
| ); |
| |
| $ldap = Net_LDAP2::connect($config); |
| |
| if (PEAR::isError($ldap)) { |
| die('Could not connect to LDAP-server: '.$ldap->getMessage()); |
| } |
| |
| $search = $ldap->search( |
| 'ou=companies,o=libre-entreprise', |
| '(&(objectClass=leorganization)(userClass=Libre-entreprise))' |
| ); |
| if (PEAR::isError($search)) { |
| die($search->getMessage() . "\n"); |
| } |
| |
| |
| foreach($entry = $search->entries() as $entry) { |
| |
| $activity = $entry -> getValue('leWorkingCategory'); |
| $name = $entry -> getValue('cn'); |
| |
| echo "<img src=\"data:image/png;base64,". base64_encode($entry -> getValue('jpegPhoto'))."\"/>"; |
| } |
| |
| $ldap -> done(); |
| </php> |