function ajax_settags($dn,$tags){
global $conf;
global $LDAP_CON;
- if(!$conf[extended]) return;
+ if(!$conf['extended']) return;
$tags = explode(',',$tags);
$tags = array_map('trim',$tags);
function ajax_taglookup($tag){
global $conf;
global $LDAP_CON;
- if(!$conf[extended]) return;
+ if(!$conf['extended']) return;
$search = ldap_filterescape($tag);
$filter = "(&(objectClass=contactPerson)(marker=$search*))";
<?
+ // LDAP URL; if set, takes precedence over ldapserver and ldapport
+ #$conf['ldapurl'] = 'ldaps://ldap.example.com/';
+
// Which LDAP Server to use?
- $conf[ldapserver] = 'ldap';
+ $conf['ldapserver'] = 'ldap';
// Which LDAP Port Server to use? (389 is standard, 636 for ssl)
- $conf[ldapport] = 389;
+ $conf['ldapport'] = 389;
// What is the root dn on this Server?
- $conf[ldaprootdn] = 'o=cosmocode, c=de';
+ $conf['ldaprootdn'] = 'o=cosmocode, c=de';
// Where are the user Accounts stored?
- $conf[usertree] = 'ou=people, '.$conf[ldaprootdn];
+ $conf['usertree'] = 'ou=people, '.$conf['ldaprootdn'];
// How to match users? %u is replaced by the given login
- $conf[userfilter] = '(&(uid=%u)(objectClass=posixAccount))';
+ $conf['userfilter'] = '(&(uid=%u)(objectClass=posixAccount))';
// Use these values to bind to the ldap directory when not logged in (leave blank for anonymous bind)
- $conf[anonbinddn] = '';
- $conf[anonbindpw] = '';
+ $conf['anonbinddn'] = '';
+ $conf['anonbindpw'] = '';
// Which language to use (see lang directory)
- $conf[lang] = 'en';
+ $conf['lang'] = 'en';
// Where to store public contacts?
- $conf[publicbook] = 'ou=contacts, '.$conf[ldaprootdn];
+ $conf['publicbook'] = 'ou=contacts, '.$conf['ldaprootdn'];
- // Where to store private contacts (relative to $conf[usertree])
- $conf[privatebook] = 'ou=contacts';
+ // Where to store private contacts (relative to $conf['usertree'])
+ $conf['privatebook'] = 'ou=contacts';
// Should the additional schema ldapab.schema be used? (0|1)
// Note: openxchange and extended are currently exclusive, do not use both at the same time!
- $conf[extended] = 1;
+ $conf['extended'] = 1;
// Should we use some parts of the openxchange.schema? (0|1)
// Note: openxchange and extended are currently exclusive, do not use both at the same time!
- $conf[openxchange] = 0;
+ $conf['openxchange'] = 0;
// Should we try to login using the username and password provided by httpd? (0|1)
- $conf[httpd_auth] = 0;
+ $conf['httpd_auth'] = 0;
// Dateformat for birthdays when using extended schema
// see http://www.php.net/manual/en/function.strftime.php
- #$conf[dateformat] = '%Y/%m/%d';
- $conf[dateformat] = '%d.%m.%Y';
+ #$conf['dateformat'] = '%Y/%m/%d';
+ $conf['dateformat'] = '%d.%m.%Y';
// Force recompilation of smarty templates?
- $conf[smartycompile] = 0;
+ $conf['smartycompile'] = 0;
?>
$users = get_users();
//select template to use
- if( $_SESSION[ldapab][username] &&
- ($_REQUEST[mode]=='edit' || $_REQUEST[mode]=='copy')){
+ if( $_SESSION['ldapab']['username'] &&
+ ($_REQUEST['mode']=='edit' || $_REQUEST['mode']=='copy')){
$template='entry_edit.tpl';
- }elseif($_REQUEST[mode]=='vcf'){
+ }elseif($_REQUEST['mode']=='vcf'){
$template='entry_vcf.tpl';
}else{
$template='entry_show.tpl';
}
- $dn = $_REQUEST[dn];
+ $dn = $_REQUEST['dn'];
#$dn = 'cn=bar foo, ou=contacts, o=cosmocode, c=de';
//save data if asked for
- if($_SESSION[ldapab][username] && $_REQUEST[save]){
+ if($_SESSION['ldapab']['username'] && $_REQUEST['save']){
// prepare special data
$_REQUEST['entry']['jpegPhoto'][]=_getUploadData();
$_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
}
if(empty($dn)){
- if(!$_REQUEST[mode]=='edit'){
+ if(!$_REQUEST['mode']=='edit'){
$smarty->assign('error','No dn was given');
$template = 'error.tpl';
}
- }elseif($_REQUEST[del]){
+ }elseif($_REQUEST['del']){
_delEntry($dn);
}elseif(!_fetchData($dn)){
$smarty->assign('error',"The requested entry '$dn' was not found");
tpl_timezone();
tpl_country();
//display templates
- if($_REQUEST[mode]=='vcf'){
+ if($_REQUEST['mode']=='vcf'){
$entry = $smarty->get_template_vars('entry');
- $filename = $entry[givenname].'_'.$entry[name].'.vcf';
+ $filename = $entry['givenname'].'_'.$entry['name'].'.vcf';
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-type: text/x-vcard; name=\"$filename\"; charset=utf-8");
$smarty->display($template);
$entry = $result[0];
//remove dn from entry when copy
- if($_REQUEST[mode] == 'copy'){
- $entry[dn]='';
+ if($_REQUEST['mode'] == 'copy'){
+ $entry['dn']='';
}
//assign entry to template:
print '</pre>';*/
// make username from dn for manager:
- $smarty->assign('managername',$users[$entry[manager][0]]);
+ $smarty->assign('managername',$users[$entry['manager'][0]]);
return true;
}
/**
- * saves the data from $_REQUEST[entry] to the LDAP directory
+ * saves the data from $_REQUEST['entry'] to the LDAP directory
*
* returns given or constructed dn
*/
global $conf;
$entries = namedentries();
$entries['mail']='mail'; //special field mail isn't in entries so we add it here
- if($conf[extended]){
+ if($conf['extended']){
$entries['marker']='marker'; //same for marker inextended schema
}
- $entry = $_REQUEST[entry];
- $dn = $_REQUEST[dn];
+ $entry = $_REQUEST['entry'];
+ $dn = $_REQUEST['dn'];
//construct new dn
$now = time();
$newdn = 'uid='.$now;
- if($_REQUEST[type] == 'private'){
- $newdn .= ', '.$conf[privatebook].', '.$_SESSION[ldapab][binddn];
+ if($_REQUEST['type'] == 'private'){
+ $newdn .= ', '.$conf['privatebook'].', '.$_SESSION['ldapab']['binddn'];
}else{
- $newdn .= ', '.$conf[publicbook];
+ $newdn .= ', '.$conf['publicbook'];
}
- $entry[cn] = $entry[givenname].' '.$entry[name];;
+ $entry['cn'] = $entry['givenname'].' '.$entry['name'];;
$entry = prepare_ldap_entry($entry);
/*
if(empty($dn)){
//new entry
- $entry[uid][] = $now;
+ $entry['uid'][] = $now;
$r = ldap_add($LDAP_CON,$newdn,$entry);
tpl_ldaperror();
return $newdn;
}else{
// in extended mode we have to make sure the right classes are set
- if($conf[extended]){
+ if($conf['extended']){
ldap_store_objectclasses($dn,array('inetOrgPerson','contactPerson'));
}
// in openxchange mode we have to make sure the right classes are set
- if ($conf[openxchange]){
+ if ($conf['openxchange']){
ldap_store_objectclasses($dn,array('inetOrgPerson','OXUserObject'));
}
//modify entry (touches only our attributes)
* gets the binary data from an uploaded file
*/
function _getUploadData(){
- $file = $_FILES[photoupload];
+ $file = $_FILES['photoupload'];
- if (is_uploaded_file($file[tmp_name])) {
- if(preg_match('=image/p?jpe?g=',$file[type])){
- $fh = fopen($file[tmp_name],'r');
- $data = fread($fh,$file[size]);
+ if (is_uploaded_file($file['tmp_name'])) {
+ if(preg_match('=image/p?jpe?g=',$file['type'])){
+ $fh = fopen($file['tmp_name'],'r');
+ $data = fread($fh,$file['size']);
fclose($fh);
- unlink($file[tmp_name]);
+ unlink($file['tmp_name']);
return $data;
}
}
*/
function smarty_std(){
global $smarty;
- $smarty->assign('USER',$_SESSION[ldapab][username]);
+ $smarty->assign('USER',$_SESSION['ldapab']['username']);
}
/**
global $conf;
global $LDAP_CON;
- //create global connection to LDAP if nessessary
+ //create global connection to LDAP if necessary
if(!$LDAP_CON){
- $LDAP_CON = ldap_connect($conf[ldapserver],$conf[ldapport]);
+ if (!empty($conf['ldapurl'])){
+ $LDAP_CON = ldap_connect($conf['ldapurl']);
+ }else{
+ $LDAP_CON = ldap_connect($conf['ldapserver'],$conf['ldapport']);
+ }
if(!$LDAP_CON){
die("couldn't connect to LDAP server");
}
if(empty($dn)){
//anonymous bind to lookup users
//blank binddn or blank bindpw will result in anonymous bind
- if(!ldap_bind($LDAP_CON,$conf[anonbinddn],$conf[anonbindpw])){
+ if(!ldap_bind($LDAP_CON,$conf['anonbinddn'],$conf['anonbindpw'])){
die("can not bind for user lookup");
}
}
//get dn for given user
- $filter = str_replace('%u',$user,$conf[userfilter]);
- $sr = ldap_search($LDAP_CON, $conf[usertree], $filter);;
+ $filter = str_replace('%u',$user,$conf['userfilter']);
+ $sr = ldap_search($LDAP_CON, $conf['usertree'], $filter);;
$result = ldap_get_entries($LDAP_CON, $sr);
if($result['count'] != 1){
set_session('','','');
global $conf;
$rand = rand();
- $_SESSION[ldapab][username] = $user;
- $_SESSION[ldapab][binddn] = $dn;
- $_SESSION[ldapab][password] = $pass;
- $_SESSION[ldapab][browserid] = auth_browseruid();
+ $_SESSION['ldapab']['username'] = $user;
+ $_SESSION['ldapab']['binddn'] = $dn;
+ $_SESSION['ldapab']['password'] = $pass;
+ $_SESSION['ldapab']['browserid'] = auth_browseruid();
// (re)set the persistant auth cookie
if($user == ''){
function namedentries($flip=false){
global $conf;
- $entries[dn] = 'dn';
- $entries[sn] = 'name';
- $entries[givenName] = 'givenname';
- $entries[title] = 'title';
- $entries[o] = 'organization';
- $entries[physicalDeliveryOfficeName] = 'office';
- $entries[postalAddress] = 'street';
- $entries[postalCode] = 'zip';
- $entries[l] = 'location';
- $entries[telephoneNumber] = 'phone';
- $entries[facsimileTelephoneNumber] = 'fax';
- $entries[mobile] = 'mobile';
- $entries[pager] = 'pager';
- $entries[homePhone] = 'homephone';
- $entries[homePostalAddress] = 'homestreet';
- $entries[jpegPhoto] = 'photo';
- $entries[labeledURI] = 'url';
- $entries[description] = 'note';
- $entries[manager] = 'manager';
- $entries[cn] = 'displayname';
-
- if($conf[extended]){
- $entries[anniversary] = 'anniversary';
+ $entries['dn'] = 'dn';
+ $entries['sn'] = 'name';
+ $entries['givenName'] = 'givenname';
+ $entries['title'] = 'title';
+ $entries['o'] = 'organization';
+ $entries['physicalDeliveryOfficeName'] = 'office';
+ $entries['postalAddress'] = 'street';
+ $entries['postalCode'] = 'zip';
+ $entries['l'] = 'location';
+ $entries['telephoneNumber'] = 'phone';
+ $entries['facsimileTelephoneNumber'] = 'fax';
+ $entries['mobile'] = 'mobile';
+ $entries['pager'] = 'pager';
+ $entries['homePhone'] = 'homephone';
+ $entries['homePostalAddress'] = 'homestreet';
+ $entries['jpegPhoto'] = 'photo';
+ $entries['labeledURI'] = 'url';
+ $entries['description'] = 'note';
+ $entries['manager'] = 'manager';
+ $entries['cn'] = 'displayname';
+
+ if($conf['extended']){
+ $entries['anniversary'] = 'anniversary';
}
- if($conf[openxchange]){
- $entries[mailDomain] = 'domain';
- $entries[userCountry] = 'country';
- $entries[birthDay] = 'birthday';
- $entries[IPPhone] = 'ipphone';
- $entries[OXUserCategories] = 'categories';
- $entries[OXUserInstantMessenger] = 'instantmessenger';
- $entries[OXTimeZone] = 'timezone';
- $entries[OXUserPosition] = 'position';
- $entries[relClientCert] = 'certificate';
+ if($conf['openxchange']){
+ $entries['mailDomain'] = 'domain';
+ $entries['userCountry'] = 'country';
+ $entries['birthDay'] = 'birthday';
+ $entries['IPPhone'] = 'ipphone';
+ $entries['OXUserCategories'] = 'categories';
+ $entries['OXUserInstantMessenger'] = 'instantmessenger';
+ $entries['OXTimeZone'] = 'timezone';
+ $entries['OXUserPosition'] = 'position';
+ $entries['relClientCert'] = 'certificate';
}
if($flip){
global $conf;
//check dateformat
- if(!preg_match('/\d\d\d\d-\d\d-\d\d/',$in[anniversary])){
- $in[anniversary]='';
+ if(!preg_match('/\d\d\d\d-\d\d-\d\d/',$in['anniversary'])){
+ $in['anniversary']='';
}
$entries = namedentries(true);
}
//standard Objectclass
- $out[objectclass][] = 'inetOrgPerson';
- if($conf[extended]){
- $out[objectclass][] = 'contactPerson';
+ $out['objectclass'][] = 'inetOrgPerson';
+ if($conf['extended']){
+ $out['objectclass'][] = 'contactPerson';
}
- if($conf[openxchange]){
- $out[objectclass][] = 'OXUserObject';
+ if($conf['openxchange']){
+ $out['objectclass'][] = 'OXUserObject';
}
return clear_array($out);
global $conf;
global $LDAP_CON;
- $sr = ldap_list($LDAP_CON,$conf[usertree],"ObjectClass=inetOrgPerson");
+ $sr = ldap_list($LDAP_CON,$conf['usertree'],"ObjectClass=inetOrgPerson");
$result = ldap_get_binentries($LDAP_CON, $sr);
if(count($result)){
foreach ($result as $entry){
- if(!empty($entry[sn][0])){
- $users[$entry[dn]] = $entry[givenName][0]." ".$entry[sn][0];
+ if(!empty($entry['sn'][0])){
+ $users[$entry['dn']] = $entry['givenName'][0]." ".$entry['sn'][0];
}
}
}
$sr = ldap_search($LDAP_CON,$dn,"objectClass=*",array('objectClass'));
$result = ldap_get_binentries($LDAP_CON, $sr);
- $set = $result[0][objectClass];
- $set = array_unique_renumber(array_merge($set,$classes));
- $add[objectClass] = $set;
+ $set = $result[0]['objectClass'];
+ $set = array_unique_renumber(array_merge((array)$set,(array)$classes));
+ $add['objectClass'] = $set;
$r = @ldap_mod_replace($LDAP_CON,$dn,$add);
tpl_ldaperror();
}
// return merged results
- return array_merge($result1,$result2);
+ return array_merge((array)$result1,(array)$result2);
}
/**
require_once('init.php');
ldap_login();
- $dn = $_REQUEST[dn];
+ $dn = $_REQUEST['dn'];
$sr = ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)',array('jpegPhoto'));
if(!ldap_count_entries($LDAP_CON,$sr)){
require_once('xml.php');
ldap_login();
- if(! $_SESSION[ldapab][username] ){
+ if(! $_SESSION['ldapab']['username'] ){
header("Location: login.php");
exit;
}
require_once('Contact_Vcard_Parse.php');
ldap_login();
- if(! $_SESSION[ldapab][username] ){
+ if(! $_SESSION['ldapab']['username'] ){
header("Location: login.php");
exit;
}
$ldapfilter = _makeldapfilter();
//check public addressbook
- $sr = ldap_list($LDAP_CON,$conf[publicbook],$ldapfilter);
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],$ldapfilter);
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
$ldapfilter);
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
// select entry template
if($_REQUEST['export'] == 'csv'){
}
$list = '';
- if(count($result)==1 && $_REQUEST[search]){
+ if(count($result)==1 && $_REQUEST['search']){
//only one result on a search -> display page
- header("Location: entry.php?dn=".$result[0][dn]);
+ header("Location: entry.php?dn=".$result[0]['dn']);
exit;
}elseif(count($result)){
$keys = array_keys($result);
$smarty->display('export_list_csv.tpl');
}else{
//save location in session
- $_SESSION[ldapab][lastlocation]=$_SERVER["REQUEST_URI"];
+ $_SESSION['ldapab']['lastlocation']=$_SERVER["REQUEST_URI"];
header('Content-Type: text/html; charset=utf-8');
$smarty->display('list.tpl');
*/
function _namesort($a,$b){
global $result;
- $x = $result[$a][sn][0].$result[$a][givenName][0];
- $y = $result[$b][sn][0].$result[$b][givenName][0];
+ $x = $result[$a]['sn'][0].$result[$a]['givenName'][0];
+ $y = $result[$b]['sn'][0].$result[$b]['givenName'][0];
return(strcasecmp($x,$y));
}
$org = ldap_filterescape($_REQUEST['org']);
$marker = ldap_filterescape($_REQUEST['marker']);
$categories = ldap_filterescape($_REQUEST['categories']);
- $_SESSION[ldapab][filter] = $_REQUEST['filter'];
+ $_SESSION['ldapab']['filter'] = $_REQUEST['filter'];
if(empty($filter)) $filter='a';
if(!empty($marker)){
<?
require_once('config.php');
- require_once('lang/'.$conf[lang].'.php');
+ require_once('lang/'.$conf['lang'].'.php');
require_once('functions.php');
require_once('template.php');
require_once('smarty/Smarty.class.php');
$smarty->compile_dir = './cache';
$smarty->use_sub_dirs = 0;
$smarty->template_dir = './templates';
- $smarty->force_compile = $conf[smartycompile];
+ $smarty->force_compile = $conf['smartycompile'];
?>
<?
-$lang[ldapab] = 'Das LDAP Adressbuch';
+$lang['ldapab'] = 'Das LDAP Adressbuch';
-$lang[name] = 'Name';
-$lang[givenname] = 'Vorname';
-$lang[title] = 'Titel';
-$lang[organization] = 'Firma';
-$lang[office] = 'Abteilung';
-$lang[street] = 'Straße, Nr.';
-$lang[zip] = 'Postleitzahl';
-$lang[location] = 'Ort';
-$lang[phone] = 'Telefon';
-$lang[fax] = 'FAX';
-$lang[mobile] = 'Handy';
-$lang[pager] = 'Pieper';
-$lang[homephone] = 'Telefon (priv.)';
-$lang[homestreet] = 'Adresse (priv.)';
-$lang[photo] = 'Foto';
-$lang[url] = 'Webseite';
-$lang[note] = 'Notizen';
-$lang[mail] = 'E-Mail';
-$lang[manager] = 'Key Account';
+$lang['name'] = 'Name';
+$lang['givenname'] = 'Vorname';
+$lang['title'] = 'Titel';
+$lang['organization'] = 'Firma';
+$lang['office'] = 'Abteilung';
+$lang['street'] = 'Straße, Nr.';
+$lang['zip'] = 'Postleitzahl';
+$lang['location'] = 'Ort';
+$lang['phone'] = 'Telefon';
+$lang['fax'] = 'FAX';
+$lang['mobile'] = 'Handy';
+$lang['pager'] = 'Pieper';
+$lang['homephone'] = 'Telefon (priv.)';
+$lang['homestreet'] = 'Adresse (priv.)';
+$lang['photo'] = 'Foto';
+$lang['url'] = 'Webseite';
+$lang['note'] = 'Notizen';
+$lang['mail'] = 'E-Mail';
+$lang['manager'] = 'Key Account';
-$lang[anniversary] = 'Geburtstag';
-$lang[marker] = 'Tags';
-$lang[tagcloud] = 'Alle verwendeten Tags, alphabetisch sortiert. Häufig verwendete Tags werden größer dargestellt.';
+$lang['anniversary'] = 'Geburtstag';
+$lang['marker'] = 'Tags';
+$lang['tagcloud'] = 'Alle verwendeten Tags, alphabetisch sortiert. Häufig verwendete Tags werden größer dargestellt.';
-$lang[business] = 'Geschäftlich';
-$lang[private] = 'Privat';
-$lang[extended] = 'Zusätzliche Infos';
+$lang['business'] = 'Geschäftlich';
+$lang['private'] = 'Privat';
+$lang['extended'] = 'Zusätzliche Infos';
-$lang[delphoto] = 'Vorhandenes Foto löschen';
+$lang['delphoto'] = 'Vorhandenes Foto löschen';
-$lang[notloggedin] = 'Nicht angemeldet';
-$lang[loggedinas] = 'Angemeldet als';
-$lang[login] = 'Anmelden';
-$lang[logout] = 'Abmelden';
-$lang[edit] = 'Bearbeiten';
-$lang[show] = 'Anzeigen';
-$lang['new'] = 'Neu';
-$lang['delete'] = 'Löschen';
-$lang['copy'] = 'Kopieren';
-$lang[csvexport] = 'CSV';
-$lang[vcfexport] = 'VCard';
-$lang[vcfimport] = 'Import';
-$lang[search] = 'Suchen';
-$lang[submit] = 'Absenden';
-$lang[help] = 'Hilfe';
-$lang[select] = 'Auswählen';
-$lang[orgs] = 'Firmen';
-$lang[upload] = 'Hochladen';
+$lang['notloggedin'] = 'Nicht angemeldet';
+$lang['loggedinas'] = 'Angemeldet als';
+$lang['login'] = 'Anmelden';
+$lang['logout'] = 'Abmelden';
+$lang['edit'] = 'Bearbeiten';
+$lang['show'] = 'Anzeigen';
+$lang['new'] = 'Neu';
+$lang['delete'] = 'Löschen';
+$lang['copy'] = 'Kopieren';
+$lang['csvexport'] = 'CSV';
+$lang['vcfexport'] = 'VCard';
+$lang['vcfimport'] = 'Import';
+$lang['search'] = 'Suchen';
+$lang['submit'] = 'Absenden';
+$lang['help'] = 'Hilfe';
+$lang['select'] = 'Auswählen';
+$lang['orgs'] = 'Firmen';
+$lang['upload'] = 'Hochladen';
-$lang[publicbook] = 'Öffentliches Adressbuch';
-$lang[privatebook] = 'Privates Adressbuch';
+$lang['publicbook'] = 'Öffentliches Adressbuch';
+$lang['privatebook'] = 'Privates Adressbuch';
-$lang[username] = 'Benutzername';
-$lang[password] = 'Passwort';
-$lang[remember] = 'Auf diesem Computer angemeldet bleiben';
+$lang['username'] = 'Benutzername';
+$lang['password'] = 'Passwort';
+$lang['remember'] = 'Auf diesem Computer angemeldet bleiben';
-$lang[msg_login] = 'Bitte melden sie sich an!';
-$lang[msg_loginfail] = 'Anmeldung fehlgeschlagen!';
-$lang[msg_reallydel] = 'Eintrag wirklich löschen?';
-$lang[msg_addto] = 'Zu welchem Adressbuch soll der Eintrag hinzugefügt werden?';
-$lang[msg_jpegonly] = 'Nur JPEG';
-$lang[msg_dateformat] = 'JJJJ-MM-TT';
-$lang[msg_uploadvcf] = 'Upload VCard File';
-$lang[msg_tagsep] = 'Durch Komma getrennt';
+$lang['msg_login'] = 'Bitte melden sie sich an!';
+$lang['msg_loginfail'] = 'Anmeldung fehlgeschlagen!';
+$lang['msg_reallydel'] = 'Eintrag wirklich löschen?';
+$lang['msg_addto'] = 'Zu welchem Adressbuch soll der Eintrag hinzugefügt werden?';
+$lang['msg_jpegonly'] = 'Nur JPEG';
+$lang['msg_dateformat'] = 'JJJJ-MM-TT';
+$lang['msg_uploadvcf'] = 'Upload VCard File';
+$lang['msg_tagsep'] = 'Durch Komma getrennt';
-$lang[err_noentries] = 'Keine Einträge';
-$lang[err_ldap] = 'Der LDAP Server lieferte folgende Fehlermeldungen';
+$lang['err_noentries'] = 'Keine Einträge';
+$lang['err_ldap'] = 'Der LDAP Server lieferte folgende Fehlermeldungen';
?>
<?
-$lang[ldapab] = 'The LDAP address book';
+$lang['ldapab'] = 'The LDAP address book';
-$lang[name] = 'Last Name';
-$lang[givenname] = 'First Name';
-$lang[title] = 'Title';
-$lang[organization] = 'Company';
-$lang[office] = 'Office';
-$lang[street] = 'Street No.';
-$lang[zip] = 'Postal Code';
-$lang[location] = 'City';
-$lang[phone] = 'Phone';
-$lang[fax] = 'FAX';
-$lang[mobile] = 'Mobile';
-$lang[pager] = 'Pager';
-$lang[homephone] = 'Phone (priv.)';
-$lang[homestreet] = 'Address (priv.)';
-$lang[photo] = 'Picture';
-$lang[url] = 'Website';
-$lang[note] = 'Notes';
-$lang[mail] = 'E-Mail';
-$lang[manager] = 'Key Account';
+$lang['name'] = 'Last Name';
+$lang['givenname'] = 'First Name';
+$lang['title'] = 'Title';
+$lang['organization'] = 'Company';
+$lang['office'] = 'Office';
+$lang['street'] = 'Street No.';
+$lang['zip'] = 'Postal Code';
+$lang['location'] = 'City';
+$lang['phone'] = 'Phone';
+$lang['fax'] = 'FAX';
+$lang['mobile'] = 'Mobile';
+$lang['pager'] = 'Pager';
+$lang['homephone'] = 'Phone (priv.)';
+$lang['homestreet'] = 'Address (priv.)';
+$lang['photo'] = 'Picture';
+$lang['url'] = 'Website';
+$lang['note'] = 'Notes';
+$lang['mail'] = 'E-Mail';
+$lang['manager'] = 'Key Account';
-$lang[anniversary] = 'Birthday';
-$lang[marker] = 'Tags';
-$lang[tagcloud] = 'All used tags, sorted alphabetically. Frequently used tags are shown bigger.';
+$lang['anniversary'] = 'Birthday';
+$lang['marker'] = 'Tags';
+$lang['tagcloud'] = 'All used tags, sorted alphabetically. Frequently used tags are shown bigger.';
-$lang[business] = 'Business';
-$lang[private] = 'Private';
-$lang[extended] = 'Additional Information';
+$lang['business'] = 'Business';
+$lang['private'] = 'Private';
+$lang['extended'] = 'Additional Information';
-$lang[delphoto] = 'Delete existing photo';
+$lang['delphoto'] = 'Delete existing photo';
-$lang[notloggedin] = 'Not logged in';
-$lang[loggedinas] = 'Logged in as';
-$lang[login] = 'Log in';
-$lang[logout] = 'Log out';
-$lang[edit] = 'Edit';
-$lang[show] = 'Show';
-$lang['new'] = 'New';
-$lang['delete'] = 'Delete';
-$lang['copy'] = 'Copy';
-$lang[csvexport] = 'CSV';
-$lang[vcfexport] = 'VCard';
-$lang[vcfimport] = 'Import';
-$lang[search] = 'Search';
-$lang[submit] = 'Send';
-$lang[help] = 'Help';
-$lang[select] = 'Select';
-$lang[orgs] = 'Companies';
-$lang[upload] = 'Upload';
+$lang['notloggedin'] = 'Not logged in';
+$lang['loggedinas'] = 'Logged in as';
+$lang['login'] = 'Log in';
+$lang['logout'] = 'Log out';
+$lang['edit'] = 'Edit';
+$lang['show'] = 'Show';
+$lang['new'] = 'New';
+$lang['delete'] = 'Delete';
+$lang['copy'] = 'Copy';
+$lang['csvexport'] = 'CSV';
+$lang['vcfexport'] = 'VCard';
+$lang['vcfimport'] = 'Import';
+$lang['search'] = 'Search';
+$lang['submit'] = 'Send';
+$lang['help'] = 'Help';
+$lang['select'] = 'Select';
+$lang['orgs'] = 'Companies';
+$lang['upload'] = 'Upload';
-$lang[publicbook] = 'Public Addressbook';
-$lang[privatebook] = 'Private Addressbook';
+$lang['publicbook'] = 'Public Addressbook';
+$lang['privatebook'] = 'Private Addressbook';
-$lang[username] = 'Username';
-$lang[password] = 'Password';
-$lang[remember] = 'Stay logged in on this computer';
+$lang['username'] = 'Username';
+$lang['password'] = 'Password';
+$lang['remember'] = 'Stay logged in on this computer';
-$lang[msg_login] = 'Please log in!';
-$lang[msg_loginfail] = 'Log in failed!';
-$lang[msg_reallydel] = 'Really delete entry?';
-$lang[msg_addto] = 'Select address book to which the entry should be added:';
-$lang[msg_jpegonly] = 'JPEG only';
-$lang[msg_dateformat] = 'YYYY-MM-DD';
-$lang[msg_uploadvcf] = 'Upload VCard File';
-$lang[msg_tagsep] = 'Comma separated';
+$lang['msg_login'] = 'Please log in!';
+$lang['msg_loginfail'] = 'Log in failed!';
+$lang['msg_reallydel'] = 'Really delete entry?';
+$lang['msg_addto'] = 'Select address book to which the entry should be added:';
+$lang['msg_jpegonly'] = 'JPEG only';
+$lang['msg_dateformat'] = 'YYYY-MM-DD';
+$lang['msg_uploadvcf'] = 'Upload VCard File';
+$lang['msg_tagsep'] = 'Comma separated';
-$lang[err_noentries] = 'No entries';
-$lang[err_ldap] = 'The LDAP server returned the following errors';
+$lang['err_noentries'] = 'No entries';
+$lang['err_ldap'] = 'The LDAP server returned the following errors';
-$lang[openxchange] = 'Xchange Information';
-$lang[moreopenxchange] = 'Xchange Information Cont\'d';
-$lang[instantmessenger] = 'Inst Msg';
-$lang[categories] = 'Categories';
-$lang[birthday] = 'Birthday';
-$lang[domain] = 'Mail Domain';
-$lang[country] = 'Country';
-$lang[certificate] = 'x.509 Cert';
-$lang[timezone] = 'Time Zone';
-$lang[position] = 'Position';
-$lang[ipphone] = 'IP Phone';
+$lang['openxchange'] = 'Xchange Information';
+$lang['moreopenxchange'] = 'Xchange Information Cont\'d';
+$lang['instantmessenger'] = 'Inst Msg';
+$lang['categories'] = 'Categories';
+$lang['birthday'] = 'Birthday';
+$lang['domain'] = 'Mail Domain';
+$lang['country'] = 'Country';
+$lang['certificate'] = 'x.509 Cert';
+$lang['timezone'] = 'Time Zone';
+$lang['position'] = 'Position';
+$lang['ipphone'] = 'IP Phone';
?>
<?
require_once('init.php');
- $msg = $lang[msg_login];
- if(isset($_REQUEST[username])){
- if (do_ldap_bind($_REQUEST[username],$_REQUEST[password])){
+ $msg = $lang['msg_login'];
+ if(isset($_REQUEST['username'])){
+ if (do_ldap_bind($_REQUEST['username'],$_REQUEST['password'])){
//forward to next page
- if(!empty($_SESSION[ldapab][lastlocation])){
- header('Location: '.$_SESSION[ldapab][lastlocation]);
+ if(!empty($_SESSION['ldapab']['lastlocation'])){
+ header('Location: '.$_SESSION['ldapab']['lastlocation']);
}else{
header('Location: index.php');
}
exit;
}else{
- $msg = $lang[msg_loginfail];;
+ $msg = $lang['msg_loginfail'];;
}
}
function tag_cloud(){
global $conf;
global $LDAP_CON;
- if(!$conf[extended]) return;
+ if(!$conf['extended']) return;
$result = ldap_queryabooks('(objectClass=contactPerson)','marker');
global $lang;
global $conf;
- $smarty->assign('user',$_SESSION[ldapab][username]);
- $smarty->assign('binddn',$_SESSION[ldapab][binddn]);
- if(!empty($_SESSION[ldapab][lastlocation])){
- $smarty->assign('home',$_SESSION[ldapab][lastlocation]);
+ if(empty($_SESSION['ldapab']['username'])){
+ $_SESSION['ldapab']['username'] = '';
+ }
+ if(empty($_SESSION['ldapab']['binddn'])){
+ $_SESSION['ldapab']['binddn'] = '';
+ }
+
+ $smarty->assign('user',$_SESSION['ldapab']['username']);
+ $smarty->assign('binddn',$_SESSION['ldapab']['binddn']);
+ if(!empty($_SESSION['ldapab']['lastlocation'])){
+ $smarty->assign('home',$_SESSION['ldapab']['lastlocation']);
}else{
$smarty->assign('home','index.php');
}
$smarty->assign('conf',$conf);
$smarty->assign('lang',$lang);
- $smarty->assign('dfexample',$dfexample);
+ //$smarty->assign('dfexample',$dfexample);
}
/**
//set the type
$out['dn'] = normalize_dn($out['dn']);
- $conf[publicbook] = normalize_dn($conf[publicbook]);
+ $conf['publicbook'] = normalize_dn($conf['publicbook']);
if($out['dn']){
- if(strstr($out['dn'],$conf[publicbook])){
- $out[type] = 'public';
+ if(strstr($out['dn'],$conf['publicbook'])){
+ $out['type'] = 'public';
}else{
- $out[type] = 'private';
+ $out['type'] = 'private';
}
}
//mail entries are handled special
$out['mail'] = $in['mail'];
- if ($conf[extended]){
+ if ($conf['extended']){
//handle marker special in extended mode
$out['marker'] = $in['marker'];
if(is_array($in['marker'])) $out['markers'] = join(', ',$in['marker']);
}
- if ($conf[openxchange]){
+ if ($conf['openxchange']){
//handle categories special in openxchange mode
$out['categories'] = $in['OXUserCategories'];
}
global $LDAP_CON;
global $smarty;
- if(!$conf[extended]) return;
+ if(!$conf['extended']) return;
$markers = array();
- $sr = ldap_list($LDAP_CON,$conf[publicbook],"ObjectClass=inetOrgPerson",array("marker"));
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=inetOrgPerson",array("marker"));
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
"ObjectClass=inetOrgPerson",array("marker"));
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
if(count($result)){
foreach ($result as $entry){
$orgs = array();
- $sr = ldap_list($LDAP_CON,$conf[publicbook],"ObjectClass=inetOrgPerson",array("o"));
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=inetOrgPerson",array("o"));
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
"ObjectClass=inetOrgPerson",array("o"));
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
if(count($result)){
foreach ($result as $entry){
- if(!empty($entry[o][0])){
- array_push($orgs, $entry[o][0]);
+ if(!empty($entry['o'][0])){
+ array_push($orgs, $entry['o'][0]);
}
}
}
global $LDAP_CON;
global $smarty;
- if(!$conf[openxchange]) return;
+ if(!$conf['openxchange']) return;
$categories = array();
- $sr = ldap_list($LDAP_CON,$conf[publicbook],"ObjectClass=OXUserObject",array("OXUserCategories"));
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=OXUserObject",array("OXUserCategories"));
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
"ObjectClass=OXUserObject",array("OXUserCategories"));
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
if(count($result)){
foreach ($result as $entry){
global $LDAP_CON;
global $smarty;
- if(!$conf[openxchange]) return;
+ if(!$conf['openxchange']) return;
$timezone = array();
- $sr = ldap_list($LDAP_CON,$conf[publicbook],"ObjectClass=OXUserObject",array("OXTimeZone"));
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=OXUserObject",array("OXTimeZone"));
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
"ObjectClass=OXUserObject",array("OXTimeZone"));
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
if(count($result)){
foreach ($result as $entry){
global $LDAP_CON;
global $smarty;
- if(!$conf[openxchange]) return;
+ if(!$conf['openxchange']) return;
$country = array();
- $sr = ldap_list($LDAP_CON,$conf[publicbook],"ObjectClass=OXUserObject",array("userCountry"));
+ $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=OXUserObject",array("userCountry"));
$result1 = ldap_get_binentries($LDAP_CON, $sr);
//check users private addressbook
- if(!empty($_SESSION[ldapab][binddn])){
+ if(!empty($_SESSION['ldapab']['binddn'])){
$sr = @ldap_list($LDAP_CON,
- $conf[privatebook].','.$_SESSION[ldapab][binddn],
+ $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
"ObjectClass=OXUserObject",array("userCountry"));
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
- $result = array_merge($result1,$result2);
+ $result = array_merge((array)$result1,(array)$result2);
if(count($result)){
foreach ($result as $entry){