]> git.sur5r.net Git - contagged/commitdiff
Make it possible to disable private contacts
authorAndy Wettstein <ajw@illinois.edu>
Wed, 3 Dec 2008 12:13:23 +0000 (13:13 +0100)
committerAndy Wettstein <ajw@illinois.edu>
Wed, 3 Dec 2008 12:13:23 +0000 (13:13 +0100)
If you don't want private address books, just set
$conf['privatebook']

darcs-hash:20081203121323-18fff-733cd397a8a4ed5f31a7cf2055457f439f62170e.gz

entry.php
inc/functions.php
inc/template.php
templates/entry_edit.tpl
templates/help.tpl
templates/import_entry.tpl

index a19888ec24375478b608470981bd258629cc6d91..4405991f2b81ec1e24b1e234ee7f5cac2c27c6d7 100644 (file)
--- a/entry.php
+++ b/entry.php
@@ -133,7 +133,7 @@ function _saveData(){
   $now    = time();
   $newdn  = 'uid='.$now;
   if (empty($_REQUEST['type'])) { $_REQUEST['type']='public'; }
-  if($_REQUEST['type'] == 'private'){
+  if($_REQUEST['type'] == 'private' && $conf['privatebook']){
     $newdn .= ', '.$conf['privatebook'].', '.$_SESSION['ldapab']['binddn'];
   }else{
     $newdn .= ', '.$conf['publicbook'];
@@ -231,7 +231,7 @@ function _getUploadData(){
       unlink($file['tmp_name']);
       return $data;
     } else {
-      $smarty->assign('jpegError',$lang['err_wrongFileType']); 
+      $smarty->assign('jpegError',$lang['err_wrongFileType']);
     }
   } else {
     $smarty->assign('jpegError',$lang['err_fileNotUploaded']);
index eb1619ca1cfef566bece5a85e0a93c26c477587a..a5e0631cf46d7dad051abc732773402e9e5364af 100644 (file)
@@ -393,7 +393,7 @@ function ldap_queryabooks($filter,$types){
   ldap_free_result($sr);
 
   // private addressbook
-  if(!empty($_SESSION['ldapab']['binddn'])){
+  if(!empty($_SESSION['ldapab']['binddn']) && $conf['privatebook']){
     $sr      = @ldap_list($LDAP_CON,$conf['privatebook'].
                           ','.$_SESSION['ldapab']['binddn'],
                           $filter,$types);
index 279ca4ca01b713bdc793d8f14c8eefe2a4d15fbd..64d37609b3c20ef73da1a422cf828743786213ac 100644 (file)
@@ -119,7 +119,7 @@ function tpl_markers(){
   $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']) && $conf['privatebook']){
     $sr = @ldap_list($LDAP_CON,
                     $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
                     "ObjectClass=inetOrgPerson",array("marker"));
@@ -183,7 +183,7 @@ function tpl_categories(){
   $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']) && $conf['privatebook']){
     $sr = @ldap_list($LDAP_CON,
                     $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
                     "ObjectClass=OXUserObject",array("OXUserCategories"));
@@ -221,7 +221,7 @@ function tpl_timezone(){
   $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']) && $conf['privatebook']){
     $sr = @ldap_list($LDAP_CON,
                     $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
                     "ObjectClass=OXUserObject",array("OXTimeZone"));
@@ -259,7 +259,7 @@ function tpl_country(){
   $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']) && $conf['privatebook']){
     $sr = @ldap_list($LDAP_CON,
                     $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
                     "ObjectClass=OXUserObject",array("userCountry"));
index 2ea276cbe2294777efdd275be449f748235eb044..39738016fee20a21a8e9715e9d217e64275616fb 100644 (file)
     </td>
   </tr>
 
-  {if $entry.dn == ''}
+  {if $entry.dn == '' && $conf.privatebook}
   <tr>
     <td colspan="2" align="center">
       {$lang.msg_addto}<br />
       </td></tr></table>
     </td>
   </tr>
+  {else}
+      <input type="hidden" name="type" value="public" id="typepublic"/>
   {/if}
 
   <tr>
index f93203ab968be647abfd75d2b7f8faed48ad1c51..f21db2a31d5c6ffcf0223c58151e34f94b6f54f7 100644 (file)
@@ -22,7 +22,7 @@
 
 <h3>Private Addressbook</h3>
 
-{if $binddn}
+{if $binddn && $conf.privatebook}
 <p>To access your personal address data use these settings:</p>
 <dl>
   <dt>LDAP-Server</dt>
index 28ef22eaa02c3a21b14e3c90333764799ee877d9..dd66dfa5a7f592a4e0ac93283e58b651c150b1fd 100644 (file)
         {/foreach}
         <input type="hidden" name="entry[note]" value="{$entry.note|h}" />
         <input type="hidden" name="entry[birthday]" value="{$entry.birthday|h}" />
+       {if $conf.privatebook}
         <button name="type" value="public" class="button">
             <img src="pix/public.png" border="0" width="16" height="16" align="middle" alt="" />{$lang.publicbook}
         </button>
         <button name="type" value="private" class="button">
             <img src="pix/private.png" border="0" width="16" height="16" align="middle" alt="" />{$lang.privatebook}
         </button>
+       {else}
+           <input type="hidden" name="type" value="public" />
+       {/if}
         </form>
     </td>
 </tr>