phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: chat body.php,1.6,1.6.2.1 channels.php,1.12,1.12


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: chat body.php,1.6,1.6.2.1 channels.php,1.12,1.12.2.1 index.php,1.18,1.18.2.1 load.php,1.9,1.9.2.1 messages.php,1.6,1.6.2.1 sendmsg.php,1.7,1.7.2.1 users.php,1.10,1.10.2.1
Date: Sun, 21 Apr 2002 14:29:53 -0400

Update of /cvsroot/phpgroupware/chat
In directory subversions:/tmp/cvs-serv22990/chat

Modified Files:
      Tag: Version-0_9_14-branch
        body.php channels.php index.php load.php messages.php 
        sendmsg.php users.php 
Log Message:
Fixes for GNBU Bug #100763.

Index: body.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/body.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** body.php    19 Nov 2001 05:03:35 -0000      1.6
--- body.php    21 Apr 2002 18:29:50 -0000      1.6.2.1
***************
*** 1,28 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Chat                                                   
   *
!       * http://www.phpgroupware.org                                           
   *
!       * This application written by Joseph Engo <address@hidden>         *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'currentapp' => 'chat',
!               'noheader'   => True,
!               'nonavbar'   => True
!       );
!       include('../header.inc.php');
! ?>
! <html>
!       <head></head>
!       <FRAMESET ROWS="*,130" BORDER="0" SCROLLING="NO">
!               <?php echo '<FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/messages.php',"channel=$channel&action=$action&location=$location")
 . '" NAME="messages">';
!               echo '<FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/sendmsg.php',"channel=$channel&location=$location&user2=$user2")
 . '" NAME="sendmsg" SCROLLING="NO">';?>
!       </FRAMESET>
! </html>
--- 1,28 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Chat                                                   
   *
!       * http://www.phpgroupware.org                                           
   *
!       * This application written by Joseph Engo <address@hidden>         *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'currentapp' => 'chat',
!               'noheader'   => True,
!               'nonavbar'   => True
!       );
!       include('../header.inc.php');
! ?>
! <html>
!       <head></head>
!       <FRAMESET ROWS="*,130" BORDER="0" SCROLLING="NO">
!               <?php echo '<FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/messages.php','channel='.$channel.'&action='.$action.'&location='.$location)
 . '" NAME="messages">';
!               echo '<FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/sendmsg.php','channel='.$channel.'&location='.$location.'&user2='.$user2)
 . '" NAME="sendmsg" SCROLLING="NO">';?>
!       </FRAMESET>
! </html>

Index: channels.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/channels.php,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -r1.12 -r1.12.2.1
*** channels.php        21 Nov 2001 00:34:34 -0000      1.12
--- channels.php        21 Apr 2002 18:29:50 -0000      1.12.2.1
***************
*** 13,21 ****
        /* $Id$ */
  
-       if (! $sessionid) 
-       {
-               Header('Location: ../login.php');
-       }
- 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'chat',
--- 13,16 ----
***************
*** 34,41 ****
        $size = $GLOBALS['phpgw']->db->nf();
  
!       $GLOBALS['phpgw']->db->query("SELECT account_lid AS group_name FROM 
phpgw_accounts where account_type = 'g'");
!       $GLOBALS['phpgw']->db->next_record();
! 
!       $size = $size + $GLOBALS['phpgw']->db->nf();
        if (($size == 0) || ($size == 1))
        {
--- 29,34 ----
        $size = $GLOBALS['phpgw']->db->nf();
  
!       $groups = $GLOBALS['phpgw']->accounts->membership();
!       $size = $size + count($groups);
        if (($size == 0) || ($size == 1))
        {
***************
*** 53,61 ****
        echo '<select name="channel" size="' . $size . '">' . "\n";
  
!       for ($i = 0; $i < $GLOBALS['phpgw']->db->nf(); $i++)
        {
!               echo '<option value="' . $GLOBALS['phpgw']->db->f('group_name') 
. '">' . $GLOBALS['phpgw']->db->f('group_name');
!               $GLOBALS['phpgw']->db->next_record();
!       }       
        $GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_chat_privatechat 
WHERE (user1='$loginid' OR user2='$loginid') AND (closed!='1' AND 
messagetype='0')");
        $GLOBALS['phpgw']->db->next_record();
--- 46,54 ----
        echo '<select name="channel" size="' . $size . '">' . "\n";
  
!       while(list($key,$group_info) = each($groups))
        {
!               echo '<option 
value="'.$group_info['account_name'].'">'.$group_info['account_name']."\n";
!       }
! 
        $GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_chat_privatechat 
WHERE (user1='$loginid' OR user2='$loginid') AND (closed!='1' AND 
messagetype='0')");
        $GLOBALS['phpgw']->db->next_record();

Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/index.php,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -r1.18 -r1.18.2.1
*** index.php   21 Nov 2001 00:34:34 -0000      1.18
--- index.php   21 Apr 2002 18:29:50 -0000      1.18.2.1
***************
*** 14,22 ****
  
        /* Is this really needed, eh? */
-       if (! $sessionid)
-       {
-               Header('Location: ../login.php');
-       }
- 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp'              => 'chat',
--- 14,17 ----
***************
*** 73,77 ****
      if (value != "")
      {
!       chatwin=window.open("<?php echo 
$GLOBALS['phpgw']->link('/chat/load.php'); echo 
(isset($GLOBALS['phpgw_info']['server']['usecookies']) && 
$GLOBALS['phpgw_info']['server']['usecookies']?'?':'&'); 
?>"+"channel="+value,"Chat","width=640,height=480,toolbar=no,scrollbars=yes,resizable=yes");
      }
    }
--- 68,72 ----
      if (value != "")
      {
!       chatwin=window.open("<?php echo 
$GLOBALS['phpgw']->link('/chat/load.php'); echo 
(isset($GLOBALS['phpgw_info']['server']['usecookies']) && 
$GLOBALS['phpgw_info']['server']['usecookies']?'?':'&'); 
?>channel="+value,"Chat","width=640,height=480,toolbar=no,scrollbars=yes,resizable=yes");
      }
    }
***************
*** 87,97 ****
          <select name="channel" size="4" onChange="chatwindow();">
  <?php
!       $GLOBALS['phpgw']->db->query("SELECT account_lid AS group_name FROM 
phpgw_accounts WHERE account_type='g'");
!       $GLOBALS['phpgw']->db->next_record();
! 
!       for ($i = 0; $i < $GLOBALS['phpgw']->db->nf(); $i++)
        {
!               echo '          <option value="' . 
$GLOBALS['phpgw']->db->f('group_name') . '">' . 
$GLOBALS['phpgw']->db->f('group_name')."\n";
!               $GLOBALS['phpgw']->db->next_record();
        }
  
--- 82,89 ----
          <select name="channel" size="4" onChange="chatwindow();">
  <?php
!       $groups = $GLOBALS['phpgw']->accounts->membership();
!       while(list($key,$group_info) = each($groups))
        {
!               echo '          <option 
value="'.$group_info['account_name'].'">'.$group_info['account_name']."\n";
        }
  

Index: load.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/load.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** load.php    21 Nov 2001 00:34:34 -0000      1.9
--- load.php    21 Apr 2002 18:29:50 -0000      1.9.2.1
***************
*** 13,22 ****
        /* $Id$ */
  
-       /* Mmmm, leftovers... */
-       if (! $sessionid) 
-       {
-               Header('Location: ../login.php');
-       }
- 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'chat',
--- 13,16 ----
***************
*** 26,29 ****
--- 20,27 ----
        include('../header.inc.php');
  
+       $channel = 
(@$GLOBALS['HTTP_GET_VARS']['channel']?$GLOBALS['HTTP_GET_VARS']['channel']:$GLOBALS['HTTP_POST_VARS']['channel']);
+       $action = 
(@$GLOBALS['HTTP_GET_VARS']['action']?$GLOBALS['HTTP_GET_VARS']['action']:$GLOBALS['HTTP_POST_VARS']['action']);
+       $location = 
(@$GLOBALS['HTTP_GET_VARS']['location']?$GLOBALS['HTTP_GET_VARS']['location']:$GLOBALS['HTTP_POST_VARS']['location']);
+ 
        if ($channel == '')
        {
***************
*** 74,80 ****
  
        echo '  <FRAMESET COLS="130,*,126" FRAMEBORDER="0">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/channels.php',"channel=$newchannel&location=$location")
 . '" NAME="static" SCROLLING="AUTO">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/body.php',"channel=$newchannel&action=$action&location=$location&user2=$user2")
 . '" NAME="body">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/users.php',"channel=$newchannel&location=$location")
 . '" NAME="users" SCROLLING="AUTO">' . "\n";
        echo "  </FRAMESET>\n";
        echo "</html>\n";
--- 72,78 ----
  
        echo '  <FRAMESET COLS="130,*,126" FRAMEBORDER="0">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/channels.php','channel='.$newchannel.'&location='.$location)
 . '" NAME="static" SCROLLING="AUTO">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/body.php','channel='.$newchannel.'&action='.$action.'&location='.$location.'&user2='.$user2)
 . '" NAME="body">' . "\n";
!       echo '    <FRAME SRC="' . 
$GLOBALS['phpgw']->link('/chat/users.php','channel='.$newchannel.'&location='.$location)
 . '" NAME="users" SCROLLING="AUTO">' . "\n";
        echo "  </FRAMESET>\n";
        echo "</html>\n";

Index: messages.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/messages.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** messages.php        19 Nov 2001 05:03:35 -0000      1.6
--- messages.php        21 Apr 2002 18:29:50 -0000      1.6.2.1
***************
*** 36,44 ****
        {
                $GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_chat_messages 
WHERE channel='$channel' AND timesent>'" . 
$GLOBALS['phpgw_info']["user"]["logintime"]. "' ORDER BY timesent");
!               $GLOBALS['phpgw']->db->next_record();
!               for ($i = 0; $i < $GLOBALS['phpgw']->db->nf(); $i++)
                {
                        echo '<font color="blue">' . 
$GLOBALS['phpgw']->db->f('loginid') . ' (' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('timesent'),'H:i.s')
 . '):  </font><font color="red">' . $GLOBALS['phpgw']->db->f('message') . 
'</font><br>';
-                       $GLOBALS['phpgw']->db->next_record();
                }
        }
--- 36,42 ----
        {
                $GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_chat_messages 
WHERE channel='$channel' AND timesent>'" . 
$GLOBALS['phpgw_info']["user"]["logintime"]. "' ORDER BY timesent");
!               while($GLOBALS['phpgw']->db->next_record())
                {
                        echo '<font color="blue">' . 
$GLOBALS['phpgw']->db->f('loginid') . ' (' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('timesent'),'H:i.s')
 . '):  </font><font color="red">' . $GLOBALS['phpgw']->db->f('message') . 
'</font><br>';
                }
        }
***************
*** 46,54 ****
        {
                $GLOBALS['phpgw']->db->query("SELECT * FROM 
phpgw_chat_privatechat WHERE (user1='$loginid' AND user2='$user2') OR 
(user1='$user2' AND user2='$loginid') ORDER BY timesent");
!               $GLOBALS['phpgw']->db->next_record();
!               for ($i = 0; $i < $GLOBALS['phpgw']->db->nf(); $i++)
                {
                        echo '<font color="blue">' . 
$GLOBALS['phpgw']->db->f('sentby') . ' (' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('timesent'),'H:i.s')
 . '):  </font><font color="red">' . $GLOBALS['phpgw']->db->f('message') . 
'</font><br>';
-                       $GLOBALS['phpgw']->db->next_record();
                }               
        }
--- 44,50 ----
        {
                $GLOBALS['phpgw']->db->query("SELECT * FROM 
phpgw_chat_privatechat WHERE (user1='$loginid' AND user2='$user2') OR 
(user1='$user2' AND user2='$loginid') ORDER BY timesent");
!               while($GLOBALS['phpgw']->db->next_record())
                {
                        echo '<font color="blue">' . 
$GLOBALS['phpgw']->db->f('sentby') . ' (' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('timesent'),'H:i.s')
 . '):  </font><font color="red">' . $GLOBALS['phpgw']->db->f('message') . 
'</font><br>';
                }               
        }

Index: sendmsg.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/sendmsg.php,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** sendmsg.php 19 Nov 2001 05:03:35 -0000      1.7
--- sendmsg.php 21 Apr 2002 18:29:50 -0000      1.7.2.1
***************
*** 21,28 ****
--- 21,33 ----
  
        $loginid = $GLOBALS['phpgw_info']['user']['userid'];
+       $channel = 
(@$GLOBALS['HTTP_GET_VARS']['channel']?$GLOBALS['HTTP_GET_VARS']['channel']:$GLOBALS['HTTP_POST_VARS']['channel']);
+       $action = 
(@$GLOBALS['HTTP_GET_VARS']['action']?$GLOBALS['HTTP_GET_VARS']['action']:$GLOBALS['HTTP_POST_VARS']['action']);
+       $location = 
(@$GLOBALS['HTTP_GET_VARS']['location']?$GLOBALS['HTTP_GET_VARS']['location']:$GLOBALS['HTTP_POST_VARS']['location']);
+ 
  //    $date=date("YmdHis");
  
        if ($action=='post')
        {
+               $datetime = createobject('phpgwapi.datetime');
                if ($location=='public')
                {
***************
*** 31,35 ****
                                ."timesent) values ('$channel',"
                                ."'$loginid','" . addslashes($message)."','1','"
!                       . time() . "')");
                }
                else
--- 36,40 ----
                                ."timesent) values ('$channel',"
                                ."'$loginid','" . addslashes($message)."','1','"
!                       . $datetime->gmtnow . "')");
                }
                else
***************
*** 40,45 ****
                                . "timesent) values ('$loginid',"
                                . "'$channel','$loginid','" . 
addslashes($message)."','1','"
!                               . time() . "')");
!                       $GLOBALS['phpgw']->db->query("INSERT INTO 
phpgw_chat_privatechat (user1, user2, sentby, message, messagetype, timesent) 
VALUES ('$loginid','$channel','$loginid','$message','1','" . time() . "')");    
                
                }
        }
--- 45,50 ----
                                . "timesent) values ('$loginid',"
                                . "'$channel','$loginid','" . 
addslashes($message)."','1','"
!                               . $datetime->gmtnow . "')");
!                       $GLOBALS['phpgw']->db->query("INSERT INTO 
phpgw_chat_privatechat (user1, user2, sentby, message, messagetype, timesent) 
VALUES ('$loginid','$channel','$loginid','$message','1','" . $datetime->gmtnow 
. "')");                 
                }
        }

Index: users.php
===================================================================
RCS file: /cvsroot/phpgroupware/chat/users.php,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -r1.10 -r1.10.2.1
*** users.php   19 Nov 2001 05:03:35 -0000      1.10
--- users.php   21 Apr 2002 18:29:50 -0000      1.10.2.1
***************
*** 13,21 ****
        /* $Id$ */
  
-       if (! $sessionid)
-       {
-               Header('Location: ../login.php');
-       }
- 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'chat',
--- 13,16 ----
***************
*** 25,29 ****
        include('../header.inc.php');
  
!       $GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_sessions ORDER BY 
session_lid");
  
        $size = $GLOBALS['phpgw']->db->nf();
--- 20,24 ----
        include('../header.inc.php');
  
!       $GLOBALS['phpgw']->db->query('SELECT * FROM phpgw_sessions ORDER BY 
session_lid');
  
        $size = $GLOBALS['phpgw']->db->nf();
***************
*** 45,52 ****
  
  <?php
!       $GLOBALS['phpgw']->db->query("select * from phpgw_sessions ORDER BY 
session_lid");
!       while ($GLOBALS['phpgw']->db->next_record())
        {
!               echo '<option value="' . 
$GLOBALS['phpgw']->db->f('session_lid') . '">' . 
$GLOBALS['phpgw']->db->f('session_lid');
        }
  ?>
--- 40,53 ----
  
  <?php
!       $GLOBALS['phpgw']->db->query('select distinct session_lid from 
phpgw_sessions ORDER BY session_lid');
!       while($GLOBALS['phpgw']->db->next_record())
        {
!               $user_name = $GLOBALS['phpgw']->db->f('session_lid');
!               if(strpos($user_name,'@'))
!               {
!                       $name = explode('@',$user_name);
!                       $user_name = $name[0];
!               }
!               echo '<option value="' . $user_name . '">' . $user_name."\n";
        }
  ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]