From 9d323346b3720678dffaf0eddcf3523a63cfcda2 Mon Sep 17 00:00:00 2001 From: jengo Date: Fri, 3 Nov 2000 20:07:57 +0000 Subject: [PATCH] Merged in patch for vcard support --- addressbook/add.php | 13 +++++++++---- addressbook/index.php | 2 +- addressbook/view.php | 8 +++++--- admin/inc/accounts_ldap.inc.php | 18 +----------------- admin/inc/accounts_sql.inc.php | 25 +++++++------------------ admin/newaccount.php | 22 ++++++++++++++++++++++ 6 files changed, 45 insertions(+), 43 deletions(-) diff --git a/addressbook/add.php b/addressbook/add.php index d8f75ae96f..67ad457076 100755 --- a/addressbook/add.php +++ b/addressbook/add.php @@ -12,15 +12,20 @@ /* $Id$ */ - if ($submit) { + if ($submit || $AddVcard) { $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); } $phpgw_info["flags"]["currentapp"] = "addressbook"; include("../header.inc.php"); - - if ($add_email) { - list($fields["lastname"],$fields["firstname"]) = explode(" ", $name); + + + if ($AddVcard){ + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . + "/addressbook/vcardin.php")); + } + else if ($add_email) { + list($fields["firstname"],$fields["lastname"]) = explode(" ", $name); $fields["email"] = $add_email; form("","add.php","Add",$fields); } else if (! $submit && ! $add_email) { diff --git a/addressbook/index.php b/addressbook/index.php index 099b03ac69..a517f1e929 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -99,7 +99,7 @@ "> - '; diff --git a/addressbook/view.php b/addressbook/view.php index aa427dbf28..1771de24d5 100755 --- a/addressbook/view.php +++ b/addressbook/view.php @@ -23,8 +23,7 @@ Header("Location: " . $phpgw->link("index.php")); } - if ($filter != "private") - { + if ($filter != "private") { $filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access"); } @@ -78,12 +77,12 @@ if ($access != "private" && $access != "public") { echo lang("Group access") . " - " . $phpgw->accounts->convert_string_to_names_access($access); } else { - echo $access; } echo "
"; ?> + + diff --git a/admin/inc/accounts_ldap.inc.php b/admin/inc/accounts_ldap.inc.php index 6db8bf4ae4..aaff4c72c0 100644 --- a/admin/inc/accounts_ldap.inc.php +++ b/admin/inc/accounts_ldap.inc.php @@ -161,25 +161,9 @@ @ldap_close($ldap); + add_default_preferences($account_info["account_id"]); $phpgw->db->lock(array("accounts","preferences")); - $phpgw->common->preferences_add($account_info["loginid"],"maxmatchs","common","15"); - $phpgw->common->preferences_add($account_info["loginid"],"theme","common","default"); - $phpgw->common->preferences_add($account_info["loginid"],"tz_offset","common","0"); - $phpgw->common->preferences_add($account_info["loginid"],"dateformat","common","m/d/Y"); - $phpgw->common->preferences_add($account_info["loginid"],"timeformat","common","12"); - $phpgw->common->preferences_add($account_info["loginid"],"lang","common","en"); - $phpgw->common->preferences_add($account_info["loginid"],"company","addressbook","True"); - $phpgw->common->preferences_add($account_info["loginid"],"lastname","addressbook","True"); - $phpgw->common->preferences_add($account_info["loginid"],"firstname","addressbook","True"); - - // Even if they don't have access to the calendar, we will add these. - // Its better then the calendar being all messed up, they will be deleted - // the next time the update there preferences. - $phpgw->common->preferences_add($account_info["loginid"],"weekstarts","calendar","Monday"); - $phpgw->common->preferences_add($account_info["loginid"],"workdaystarts","calendar","9"); - $phpgw->common->preferences_add($account_info["loginid"],"workdayends","calendar","17"); - while ($permission = each($account_info["permissions"])) { if ($phpgw_info["apps"][$permission[0]]["enabled"]) { $phpgw->accounts->add_app($permission[0]); diff --git a/admin/inc/accounts_sql.inc.php b/admin/inc/accounts_sql.inc.php index 3a6a1045cb..92f263efa1 100755 --- a/admin/inc/accounts_sql.inc.php +++ b/admin/inc/accounts_sql.inc.php @@ -72,23 +72,6 @@ $phpgw->db->lock(array("accounts","preferences")); - $phpgw->common->preferences_add($account_info["loginid"],"maxmatchs","common","15"); - $phpgw->common->preferences_add($account_info["loginid"],"theme","common","default"); - $phpgw->common->preferences_add($account_info["loginid"],"tz_offset","common","0"); - $phpgw->common->preferences_add($account_info["loginid"],"dateformat","common","m/d/Y"); - $phpgw->common->preferences_add($account_info["loginid"],"timeformat","common","12"); - $phpgw->common->preferences_add($account_info["loginid"],"lang","common","en"); - $phpgw->common->preferences_add($account_info["loginid"],"company","addressbook","True"); - $phpgw->common->preferences_add($account_info["loginid"],"lastname","addressbook","True"); - $phpgw->common->preferences_add($account_info["loginid"],"firstname","addressbook","True"); - - // Even if they don't have access to the calendar, we will add these. - // Its better then the calendar being all messed up, they will be deleted - // the next time the update there preferences. - $phpgw->common->preferences_add($account_info["loginid"],"weekstarts","calendar","Monday"); - $phpgw->common->preferences_add($account_info["loginid"],"workdaystarts","calendar","9"); - $phpgw->common->preferences_add($account_info["loginid"],"workdayends","calendar","17"); - while ($permission = each($account_info["permissions"])) { if ($phpgw_info["apps"][$permission[0]]["enabled"]) { $phpgw->accounts->add_app($permission[0]); @@ -102,6 +85,12 @@ . "','" . $phpgw->accounts->add_app("",True) . "','" . $account_info["groups"] . "','A',0)"; $phpgw->db->query($sql); + + $phpgw->db->query("select account_id from accounts where account_lid='" + . $account_info["loginid"] . "'"); + $phpgw->db->next_record(); + add_default_preferences($phpgw->db->f("account_id")); + $phpgw->db->unlock(); $sep = $phpgw->common->filesystem_separator(); @@ -206,7 +195,7 @@ $phpgw->db->query("delete from addressbook where ab_owner='$account_id'"); $phpgw->db->query("delete from accounts where account_lid='$account_id'"); - $phpgw->common->preferences_delete("all",$lid); + $phpgw->common->preferences_delete("all",$account_id); $phpgw->db->unlock(); diff --git a/admin/newaccount.php b/admin/newaccount.php index 713575653f..44b2655561 100755 --- a/admin/newaccount.php +++ b/admin/newaccount.php @@ -19,6 +19,28 @@ include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_" . $phpgw_info["server"]["auth_type"] . ".inc.php"); + function add_default_preferences($account_id) + { + global $phpgw; + + $phpgw->common->preferences_add($account_id,"maxmatchs","common","15"); + $phpgw->common->preferences_add($account_id,"theme","common","default"); + $phpgw->common->preferences_add($account_id,"tz_offset","common","0"); + $phpgw->common->preferences_add($account_id,"dateformat","common","m/d/Y"); + $phpgw->common->preferences_add($account_id,"timeformat","common","12"); + $phpgw->common->preferences_add($account_id,"lang","common","en"); + $phpgw->common->preferences_add($account_id,"company","addressbook","True"); + $phpgw->common->preferences_add($account_id,"lastname","addressbook","True"); + $phpgw->common->preferences_add($account_id,"firstname","addressbook","True"); + + // Even if they don't have access to the calendar, we will add these. + // Its better then the calendar being all messed up, they will be deleted + // the next time the update there preferences. + $phpgw->common->preferences_add($account_id,"weekstarts","calendar","Monday"); + $phpgw->common->preferences_add($account_id,"workdaystarts","calendar","9"); + $phpgw->common->preferences_add($account_id,"workdayends","calendar","17"); + } + if ($submit) { $totalerrors = 0;
@@ -91,6 +90,9 @@ echo $phpgw->common->check_owner($owner,"edit.php","Edit","ab_id=$ab_id"); ?> + ">Vcard + ">Done