Working on converting the account_lid owner fields to account_id

This commit is contained in:
jengo 2000-10-25 21:09:00 +00:00
parent 1baf88c4c3
commit b33d3e05c4
11 changed files with 42 additions and 38 deletions

View File

@ -36,7 +36,7 @@
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
. "ab_state,ab_zip,ab_bday,"
. "ab_notes,ab_company_id) values ('" . $phpgw_info["user"]["userid"] . "','$access','"
. "ab_notes,ab_company_id) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
. addslashes($firstname). "','"
. addslashes($lastname) . "','"
. addslashes($title) . "','"
@ -59,7 +59,7 @@
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
. "ab_state,ab_zip,ab_bday,"
. "ab_notes,ab_company) values ('" . $phpgw_info["user"]["userid"] . "','$access','"
. "ab_notes,ab_company) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
. addslashes($firstname). "','"
. addslashes($lastname) . "','"
. addslashes($title) . "','"

View File

@ -27,7 +27,7 @@
$phpgw->db->query("select ab_owner from addressbook where ab_id='$ab_id'");
$phpgw->db->next_record();
if ($phpgw->db->f("ab_owner") != $phpgw_info["user"]["userid"])
if ($phpgw->db->f("ab_owner") != $phpgw_info["user"]["account_id"])
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/"));
?>
@ -43,8 +43,8 @@
//exit;
} else {
$phpgw->db->query("delete from addressbook where ab_owner='" . $phpgw_info["user"]["userid"]
. "' and ab_id='$ab_id'");
$phpgw->db->query("delete from addressbook where ab_owner='" . $phpgw_info["user"]["account_id"]
. "' and ab_id='$ab_id'");
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/",
"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
}

View File

@ -27,7 +27,7 @@
if (! $submit) {
$phpgw->db->query("SELECT * FROM addressbook WHERE ab_owner='"
. $phpgw_info["user"]["userid"] . "' AND ab_id=$ab_id");
. $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id");
$phpgw->db->next_record();
$fields = array('ab_id' => $phpgw->db->f("ab_id"),
@ -59,7 +59,7 @@
} else {
$bday = $bday_month . "/" . $bday_day . "/" . $bday_year;
if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups);
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
@ -82,7 +82,7 @@
. "', ab_notes='" . addslashes($notes)
. "', ab_company_id='" . addslashes($company)
. "', ab_access='" . addslashes($access)
. "' WHERE ab_owner='" . $phpgw_info["user"]["userid"] . "' AND ab_id=$ab_id";
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
} else {
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
. "', ab_firstname='". addslashes($firstname)
@ -103,7 +103,7 @@
. "', ab_notes='" . addslashes($notes)
. "', ab_company='" . addslashes($company)
. "', ab_access='" . addslashes($access)
. "' WHERE ab_owner='" . $phpgw_info["user"]["userid"] . "' AND ab_id=$ab_id";
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
}
$phpgw->db->query($sql);

View File

@ -37,11 +37,11 @@
if ($filter != "none") {
$filtermethod = " ab_access like '%,$filter,%' ";
} else {
$filtermethod = " (ab_owner='" . $phpgw_info["user"]["userid"] ."' OR ab_access='public' "
$filtermethod = " (ab_owner='" . $phpgw_info["user"]["account_id"] ."' OR ab_access='public' "
. $phpgw->accounts->sql_search("ab_access") . " ) ";
}
} else {
$filtermethod = " ab_owner='" . $phpgw_info["user"]["userid"] . "' ";
$filtermethod = " ab_owner='" . $phpgw_info["user"]["account_id"] . "' ";
}
if ($query) {

View File

@ -21,12 +21,12 @@
}
if (! $totalerrors) {
$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["userid"],"addressbook");
$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"addressbook");
while ($pref = each($ab_selected)) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],$pref[0],"addressbook","addressbook_" . $pref[1]);
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],$pref[0],"addressbook","addressbook_" . $pref[1]);
}
if ($mainscreen_showbirthdays) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showbirthdays","addressbook");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"mainscreen_showbirthdays","addressbook");
}
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
}
@ -72,7 +72,7 @@
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
?>
<tr bgcolor="<?php echo $tr_color; ?>">
<td colspan="2"><?php echo lang("show current users on navigation bar"); ?></td>
<td colspan="2"><?php echo lang("show birthday reminders on main screen"); ?></td>
<td><input type="checkbox" name="mainscreen_showbirthdays" value="True"<?php if ($phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) echo " checked"; ?>></td>
</tr>
<tr>

View File

@ -29,11 +29,11 @@
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
$phpgw->db->query("SELECT * FROM addressbook as a, customers as c WHERE a.ab_company_id = c.company_id "
. "AND ab_id=$ab_id AND (ab_owner='"
. $phpgw_info["user"]["userid"] . "' $filtermethod)");
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
} else {
$phpgw->db->query("SELECT * FROM addressbook "
. "WHERE ab_id=$ab_id AND (ab_owner='"
. $phpgw_info["user"]["userid"] . "' $filtermethod)");
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
}
$phpgw->db->next_record();

View File

@ -153,6 +153,7 @@
// If they changed there loginid, we need to change the owner in ALL
// tables to reflect on the new one
if ($lid != $account_info["loginid"]) {
/*
change_owner("","preferences","preference_owner",$account_info["loginid"],$lid);
change_owner("addressbook","addressbook","ab_owner",$account_info["loginid"],$lid);
change_owner("todo","todo","todo_owner",$account_info["loginid"],$lid);
@ -160,6 +161,7 @@
change_owner("","sessions","session_lid",$account_info["loginid"],$lid);
change_owner("calendar","webcal_entry","cal_create_by",$account_info["loginid"],$lid);
change_owner("calendar","webcal_entry_user","cal_login",$account_info["loginid"],$lid);
*/
if ($lid != $n_loginid) {
$sep = $phpgw->common->filesystem_separator();
@ -194,7 +196,7 @@
$lid = $phpgw->db->f(0);
$i = 0;
$phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$lid'");
$phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$account_id'");
while ($phpgw->db->next_record()) {
$cal_id[$i] = $phpgw->db->f("cal_id");
echo "<br>" . $phpgw->db->f("cal_id");
@ -211,12 +213,12 @@
$phpgw->db->query("delete from webcal_entry_groups where cal_id='$cal_id[$i]'");
}
$phpgw->db->query("delete from webcal_entry where cal_create_by='$lid'");
$phpgw->db->query("delete from webcal_entry_user where cal_login='$lid'");
$phpgw->db->query("delete from webcal_entry where cal_create_by='$account_id'");
$phpgw->db->query("delete from webcal_entry_user where cal_login='$account_id'");
$phpgw->db->query("delete from todo where todo_owner='$lid'");
$phpgw->db->query("delete from addressbook where ab_owner='$lid'");
$phpgw->db->query("delete from accounts where account_lid='$lid'");
$phpgw->db->query("delete from todo where todo_owner='$account_id'");
$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);

View File

@ -16,13 +16,13 @@
include("../header.inc.php");
if ($submit) {
$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["userid"],"calendar");
$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"weekdaystarts","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"workdaystarts","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"workdayends","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"weekdaystarts","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"workdaystarts","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"workdayends","calendar");
if ($mainscreen_showevents) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showevents","calendar");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"mainscreen_showevents","calendar");
}
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
exit;

View File

@ -6,6 +6,8 @@
- Moved E-Mail preferences into its own section.
- When changing NNTP servers, now deletes newsgroups and users_newsgroups.
- Applied Patch #102089 - scrollbars for addressbook when composing email. Thanks jaggdedge <jaggdedge@users.sourceforge.net>
- owner fields are now working off account_id instead of account_lid
- Fixed time format on calendar preferences.
[0.9.2] - Fixed sorting bug in currentusers.php
- Cleaned up error reporting and form in newaccount.php

View File

@ -18,7 +18,7 @@
if ($ntheme) {
$theme = $ntheme;
$phpgw->common->preferences_update($phpgw_info["user"]["userid"],"theme","common");
$phpgw->common->preferences_update($phpgw_info["user"]["account_id"],"theme","common");
Header("location: " . $phpgw->link("changetheme.php"));
exit;
}

View File

@ -153,7 +153,7 @@
<?php
} else {
$phpgw->common->preferences_delete("byappnotheme",$phpgw_info["user"]["userid"],"common");
$phpgw->common->preferences_delete("byappnotheme",$phpgw_info["user"]["account_id"],"common");
// If they don't have permissions to the headlines,
// we don't need to lock the table.
@ -163,20 +163,20 @@
$phpgw->db->lock("preferences");
}
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"maxmatchs","common");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"tz_offset","common");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"dateformat","common");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"timeformat","common");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"lang","common");
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"default_app","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"maxmatchs","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"tz_offset","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"dateformat","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"timeformat","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"lang","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"default_app","common");
if ($navbar_text) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"navbar_text","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"navbar_text","common");
}
if ($phpgw_info["user"]["apps"]["admin"]) {
if ($show_currentusers) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"show_currentusers","common");
$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"show_currentusers","common");
}
}