-<?
- require_once('init.php');
- ldap_login();
-
- $users = get_users();
-
- //select template to use
- if (empty($_REQUEST['mode'])) { $_REQUEST['mode']='show'; }
- if( $_SESSION['ldapab']['username'] &&
- ($_REQUEST['mode']=='edit' || $_REQUEST['mode']=='copy')){
- $template='entry_edit.tpl';
- }elseif($_REQUEST['mode']=='vcf'){
- $template='entry_vcf.tpl';
- }else{
- $template='entry_show.tpl';
- }
-
- if (empty($_REQUEST['dn'])) {
- $dn = "";
- }else{
- $dn = $_REQUEST['dn'];
- #$dn = 'cn=bar foo, ou=contacts, o=cosmocode, c=de';
- }
-
- //save data if asked for
- if($_SESSION['ldapab']['username'] && !empty($_REQUEST['save']) && $_REQUEST['save']){
- // prepare special data
- $_REQUEST['entry']['photo'] = _getUploadData();
- $_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
- unset($_REQUEST['entry']['markers']);
-
- foreach(array_keys($_REQUEST['entry']) as $field){
- if($FIELDS['_'.$field]){
- // entry has to be handled as array -> clean it up (trim, unique, sort)
- $_REQUEST['entry'][$field] = array_map('trim',$_REQUEST['entry'][$field]);
- $_REQUEST['entry'][$field] = array_unique($_REQUEST['entry'][$field]);
- $_REQUEST['entry'][$field] = array_filter($_REQUEST['entry'][$field]);
- natcasesort($_REQUEST['entry'][$field]);
- }
- }
- $dn = _saveData();
+<?php
+require_once('inc/init.php');
+ldap_login();
+
+$users = get_users();
+
+//select template to use
+if (empty($_REQUEST['mode'])) { $_REQUEST['mode']='show'; }
+if( $_SESSION['ldapab']['username'] &&
+ ($_REQUEST['mode']=='edit' || $_REQUEST['mode']=='copy')){
+ $template='entry_edit.tpl';
+}elseif($_REQUEST['mode']=='vcf'){
+ $template='entry_vcf.tpl';
+}elseif($_REQUEST['mode']=='map'){
+ $template='entry_map.tpl';
+}else{
+ $template='entry_show.tpl';
+}
+
+if (empty($_REQUEST['dn'])) {
+ $dn = "";
+}else{
+ $dn = $_REQUEST['dn'];
+ #$dn = 'cn=bar foo, ou=contacts, o=cosmocode, c=de';
+}
+
+//save data if asked for
+if($_SESSION['ldapab']['username'] && !empty($_REQUEST['save']) && $_REQUEST['save']){
+ // prepare special data
+ $_REQUEST['entry']['photo'] = _getUploadData();
+ $_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
+ unset($_REQUEST['entry']['markers']);
+
+ foreach(array_keys($_REQUEST['entry']) as $field){
+ if($FIELDS['_'.$field]){
+ // entry has to be handled as array -> clean it up (trim, unique, sort)
+ $_REQUEST['entry'][$field] = array_map('trim',$_REQUEST['entry'][$field]);
+ $_REQUEST['entry'][$field] = array_unique($_REQUEST['entry'][$field]);
+ $_REQUEST['entry'][$field] = array_filter($_REQUEST['entry'][$field]);
+ natcasesort($_REQUEST['entry'][$field]);
+ }