From 5b8a879df72126f2e55836504c39b984c6bc2fb2 Mon Sep 17 00:00:00 2001 From: jengo Date: Tue, 5 Sep 2000 03:05:32 +0000 Subject: [PATCH] Removing the session->loginid references --- calendar/day.php | 8 +------- calendar/edit_entry.php | 17 ++++++++--------- calendar/edit_entry_handler.php | 6 +++--- calendar/inc/functions.inc.php | 8 ++++---- calendar/search.php | 9 ++++----- calendar/view.php | 7 +++---- calendar/week.php | 12 ++++++------ 7 files changed, 29 insertions(+), 38 deletions(-) diff --git a/calendar/day.php b/calendar/day.php index e74502f467..148e99c708 100644 --- a/calendar/day.php +++ b/calendar/day.php @@ -81,13 +81,7 @@
session->firstname) || strlen($phpgw->session->lastname)) { - if (strlen($phpgw->session->firstname)) - echo $phpgw->session->firstname . " "; - if (strlen($phpgw->session->lastname)) - echo $phpgw->session->lastname . " "; - } else - echo $phpgw->session->loginid; + echo $phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]); ?>
diff --git a/calendar/edit_entry.php b/calendar/edit_entry.php index 0b6fd4c039..3477bf353f 100755 --- a/calendar/edit_entry.php +++ b/calendar/edit_entry.php @@ -21,15 +21,15 @@ if ($id > 0) { $can_edit = false; $phpgw->db->query("SELECT cal_id FROM webcal_entry_user WHERE cal_login=" - . "'" . $phpgw->session->loginid . "' AND cal_id = $id"); + . "'" . $phpgw_info["user"]["userid"] . "' AND cal_id = $id"); $phpgw->db->next_record(); if ($phpgw->db->f("cal_id") > 0) $can_edit = true; $phpgw->db->query("SELECT cal_create_by, cal_date, cal_time, cal_mod_date, " - . "cal_mod_time, cal_duration, cal_priority, cal_type, " - . "cal_access, cal_name, cal_description FROM webcal_entry " - . "WHERE cal_id=$id"); + . "cal_mod_time, cal_duration, cal_priority, cal_type, " + . "cal_access, cal_name, cal_description FROM webcal_entry " + . "WHERE cal_id=$id"); $phpgw->db->next_record(); $year = (int)($phpgw->db->f(1) / 10000); @@ -259,8 +259,8 @@ function validate_and_submit() { // This will cause problems if there are more then 13 permissions. // The permissions class needs to be updated to handle this. $phpgw->db->query("select loginid, lastname, firstname from accounts where " - . "status !='L' and loginid != '" . $phpgw->session->loginid . "' and " - . "permissions like '%:calendar:%' order by lastname,firstname,loginid"); + . "status !='L' and loginid != '" . $phpgw_info["user"]["userid"] . "' and " + . "permissions like '%:calendar:%' order by lastname,firstname,loginid"); if ($phpgw->db->num_rows() > 50) $size = 15; @@ -287,7 +287,7 @@ function validate_and_submit() { } echo "session->loginid ."\">" + . $phpgw_info["user"]["userid"] ."\">" . "\n"; ?> @@ -403,8 +403,7 @@ function validate_and_submit() { 0) { - echo "session->id - . "&id=$id\" onClick=\"return confirm('" + echo "link("delete.php","id=$id") . "\" onClick=\"return confirm('" . lang_calendar("Are you sure\\nyou want to\\ndelete this entry ?") . "');\">" . lang_common("Delete") . "
"; } diff --git a/calendar/edit_entry_handler.php b/calendar/edit_entry_handler.php index 6f5906367c..f8a32e2cd3 100755 --- a/calendar/edit_entry_handler.php +++ b/calendar/edit_entry_handler.php @@ -126,7 +126,7 @@ if (! $error) { $sql = "INSERT INTO webcal_entry (cal_create_by, cal_date, " . "cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, " . "cal_access, cal_type, cal_name, cal_description ) " . - "VALUES ('" . $phpgw->session->loginid . "', "; + "VALUES ('" . $phpgw_info["user"]["userid"] . "', "; $date = mktime(0,0,0,$month,$day,$year); $sql .= date("Ymd", $date) . ", "; @@ -170,13 +170,13 @@ if (! $error) { for ($i = 0; $i < count($participants); $i++) { // Rewrite $sql = "INSERT INTO webcal_entry_user (cal_id,cal_login,cal_status ) " - . "VALUES ($id, '" . $participants[$i] . "', 'A')"; + . "VALUES ($id, '" . $participants[$i] . "', 'A')"; $phpgw->db->query($sql); } if (count($participants) == 0) $phpgw->db->query("insert into webcal_entry_user (cal_id,cal_login,cal_status" - . ") values ($id,'" . $phpgw->session->loginid . "','A' )"); + . ") values ($id,'" . $phpgw_info["user"]["userid"] . "','A' )"); } if (strlen($rpt_type) || ! strcmp($rpt_type,'none') == 0) { diff --git a/calendar/inc/functions.inc.php b/calendar/inc/functions.inc.php index cad55e5437..7d421ad305 100755 --- a/calendar/inc/functions.inc.php +++ b/calendar/inc/functions.inc.php @@ -386,7 +386,7 @@ function month_name ( $m ) { . "FROM webcal_entry, webcal_entry_repeats, webcal_entry_user " . "WHERE webcal_entry.cal_id = webcal_entry_repeats.cal_id " . "AND webcal_entry.cal_id = webcal_entry_user.cal_id " - . "AND webcal_entry_user.cal_login = '" . $phpgw->session->loginid . "' " + . "AND webcal_entry_user.cal_login = '" . $phpgw_info["user"]["userid"] . "' " . "AND webcal_entry.cal_type='M'"; $phpgw->db->query($sql); @@ -461,7 +461,7 @@ function month_name ( $m ) { . "ON webcal_entry_groups.cal_id=webcal_entry.cal_id " . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " . "AND webcal_entry.cal_type != 'M' " - . "AND (webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' " . sql_search_calendar() . ") " . "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time"; } else { @@ -472,7 +472,7 @@ function month_name ( $m ) { . "FROM webcal_entry, webcal_entry_user, webcal_entry_groups " . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " . "AND webcal_entry.cal_type != 'M' AND " - . "(webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . "(webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' " . " AND webcal_entry.cal_id=webcal_entry_user.cal_id OR " . "(webcal_entry_groups.cal_id=webcal_entry.cal_id " . sql_search_calendar() . ")) ORDER " @@ -632,7 +632,7 @@ function month_name ( $m ) { . "ON webcal_entry_groups.cal_id=webcal_entry.cal_id " . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " . "AND webcal_entry.cal_type != 'M' " - . "AND (webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' " . sql_search_calendar() . ") " . "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time"; diff --git a/calendar/search.php b/calendar/search.php index 693f9095fa..53c1e23286 100755 --- a/calendar/search.php +++ b/calendar/search.php @@ -19,8 +19,7 @@ if (! $keywords) { // If we reach this it becuase they didn't search for anything, // attempt to send them back to where they where. - Header("Location: $from?sessionid=" . $phpgw->session->id . "&date=$date" - . "month=$month&day=$day&year=$year"); + Header("Location: " . $phpgw->link($from,"date=$datemonth=$month&day=$day&year=$year")); } include("../header.inc.php"); @@ -49,11 +48,11 @@ $sql = "SELECT DISTINCT webcal_entry.cal_id, webcal_entry.cal_name, " . "webcal_entry.cal_date,webcal_entry_repeats.cal_type " . "FROM webcal_entry, webcal_entry_user, webcal_entry_repeats, " - . "webcal_entry_groups WHERE (UPPER(webcal_entry.cal_name) LIKE UPPER('%" + . "webcal_entry_groups WHERE (UPPER(webcal_entry.cal_name) LIKE UPPER('%" . $words[$i] . "%') OR UPPER(webcal_entry.cal_description) " . "LIKE UPPER('%" . $words[$i] . "%')) AND (webcal_entry_user.cal_login = '" - . $phpgw->session->loginid. "' OR (webcal_entry.cal_access='public' " - . sql_search_calendar() . ")) ORDER BY cal_date"; + . $phpgw_info["user"]["userid"] . "' OR (webcal_entry.cal_access='public' " + . sql_search_calendar() . ")) ORDER BY cal_date"; $phpgw->db->query($sql); while ($phpgw->db->next_record()) { diff --git a/calendar/view.php b/calendar/view.php index 800fbf6336..668e8b1431 100755 --- a/calendar/view.php +++ b/calendar/view.php @@ -191,10 +191,9 @@

session->loginid == $create_by) { - echo "session->id . "&id=$id\">" - . lang_common("Edit") . "
\nsession->id . "&id=$id\" onClick=\"return confirm('" + if ($phpgw_info["user"]["userid"] == $create_by) { + echo "link("edit_entry.php","id=$id") . "\">" + . lang_common("Edit") . "
\nlink("delete.php","id=$id") . "\" onClick=\"return confirm('" . lang_calendar("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.") . "');\">" . lang_common("Delete") . "
\n"; } ?> diff --git a/calendar/week.php b/calendar/week.php index 274fe1d6e6..b8c311b059 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -77,7 +77,7 @@ - +session->id - . "&year=$nextyear&month=$nextmonth&day=$nextday\">>>"; + echo ""; } ?> @@ -135,7 +135,7 @@ session->loginid); + $repeated_events = read_repeated_events($phpgw_info["user"]["userid"]); $today = mktime(2,0,0,date("m"), date("d"), date("Y")); for ($j = 0; $j < 7; $j++) { @@ -148,7 +148,7 @@ else echo "BGCOLOR=\"$CELLBG\">"; - print_date_entries($date,$hide_icons,$phpgw->session->id); + print_date_entries($date,$hide_icons,$phpgw_info["user"]["sessionid"]); echo "\n"; }
<<&year=&month=&day="><< "> db->query("SELECT lastname, firstname FROM accounts WHERE loginid='" - . $phpgw->session->loginid . "'"); + . $phpgw_info["user"]["userid"]. "'"); echo "
\n"; if ($phpgw->db->next_record()) { if (strlen($phpgw->db->f(0)) || strlen($phpgw->db->f(1))) { @@ -113,8 +113,8 @@
link("week.php","&year=$nextyear&month=$nextmonth&day=$nextday") + . "\">>>