[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] addressbook/inc/hook_deleteaccount.inc.php admi...
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] addressbook/inc/hook_deleteaccount.inc.php admi... |
Date: |
Tue, 05 Sep 2006 10:53:09 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: vmailmgr
Changes by: Dave Hall <skwashd> 06/09/05 10:53:09
Modified files:
addressbook/inc: hook_deleteaccount.inc.php
admin/inc : hook_deleteaccount.inc.php
calendar/inc : hook_deleteaccount.inc.php
calendar/inc : hook_deleteaccount.inc.php
infolog/inc : hook_deleteaccount.inc.php
notes/inc : hook_deleteaccount.inc.php
preferences/inc: hook_deleteaccount.inc.php
projects/inc : hook_deleteaccount.inc.php
todo/inc : hook_deleteaccount.inc.php
inc : hook_deleteaccount.inc.php
Log message:
fix globals and do some basic checks/sanitizing
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/addressbook/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/admin/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/notes/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/preferences/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/projects/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/todo/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/vmailmgr/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
Patches:
Index: addressbook/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- addressbook/inc/hook_deleteaccount.inc.php 15 May 2005 13:34:30 -0000
1.8
+++ addressbook/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:08 -0000
1.9
@@ -10,17 +10,17 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.8 2005/05/15 13:34:30 skwashd
Exp $ */
+ /* $Id: hook_deleteaccount.inc.php,v 1.9 2006/09/05 10:53:08 skwashd
Exp $ */
$contacts = CreateObject('phpgwapi.contacts');
- if(intval($_POST['new_owner'])==0)
+ if ( (int) $_POST['new_owner'] == 0 )
{
$contacts->delete_all(intval($_POST['account_id']));
}
else
{
-
$contacts->change_owner(intval($_POST['account_id']),intval($_POST['new_owner']));
-
$contacts->change_owner_others(intval($_POST['account_id']),intval($_POST['new_owner']));
+ $contacts->change_owner($_POST['account_id'],
$_POST['new_owner']);
+ $contacts->change_owner_others($_POST['account_id'],
$_POST['new_owner']);
}
?>
Index: admin/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- admin/inc/hook_deleteaccount.inc.php 14 Feb 2006 08:48:21 -0000
1.6
+++ admin/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:08 -0000
1.7
@@ -10,14 +10,14 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.6 2006/02/14 08:48:21 skwashd
Exp $ */
+ /* $Id: hook_deleteaccount.inc.php,v 1.7 2006/09/05 10:53:08 skwashd
Exp $ */
- if($GLOBALS['HTTP_POST_VARS']['account_id'])
+ if ( isset($_POST['account_id']) && (int) $_POST['account_id'] )
{
-
$GLOBALS['phpgw']->accounts->delete($GLOBALS['HTTP_POST_VARS']['account_id']);
+ $GLOBALS['phpgw']->accounts->delete($_POST['account_id']);
$GLOBALS['phpgw']->db->lock(Array('phpgw_acl'));
- $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE
acl_location='" . $GLOBALS['HTTP_POST_VARS']['account_id']
- . "' OR
acl_account=".$GLOBALS['HTTP_POST_VARS']['account_id'],__LINE__,__FILE__);
+ $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE
acl_location='" . (int) $_POST['account_id'] . "'"
+ . ' OR acl_account=' . (int) $POST['account_id'],
__LINE__, __FILE__);
$GLOBALS['phpgw']->db->unlock();
}
?>
Index: calendar/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- calendar/inc/hook_deleteaccount.inc.php 23 Oct 2005 12:57:16 -0000
1.8
+++ calendar/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:08 -0000
1.9
@@ -9,20 +9,20 @@
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.8 2005/10/23 12:57:16 skwashd
Exp $ */
+ /* $Id: hook_deleteaccount.inc.php,v 1.9 2006/09/05 10:53:08 skwashd
Exp $ */
// Delete all records for a user
- if(intval($_POST['new_owner']) == 0)
+ if ( (int) $_POST['new_owner'] == 0 )
{
ExecMethod('calendar.bocalendar.delete_calendar',
intval($_POST['account_id']));
}
else
{
ExecMethod('calendar.bocalendar.change_owner',
- Array(
- 'old_owner' => intval($_POST['account_id']),
- 'new_owner' => intval($_POST['new_owner'])
- )
- );
+ Array
+ (
+ 'old_owner' => $_POST['account_id'],
+ 'new_owner' => $_POST['new_owner']
+ ));
}
?>
Index: calendar/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.8
retrieving revision 1.10
diff -u -b -r1.8 -r1.10
--- calendar/inc/hook_deleteaccount.inc.php 23 Oct 2005 12:57:16 -0000
1.8
+++ calendar/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.10
@@ -9,20 +9,20 @@
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.8 2005/10/23 12:57:16 skwashd
Exp $ */
+ /* $Id: hook_deleteaccount.inc.php,v 1.10 2006/09/05 10:53:09 skwashd
Exp $ */
// Delete all records for a user
- if(intval($_POST['new_owner']) == 0)
+ if ( (int)$_POST['new_owner'] == 0)
{
- ExecMethod('calendar.bocalendar.delete_calendar',
intval($_POST['account_id']));
+ ExecMethod('calendar.bocalendar.delete_calendar',
$_POST['account_id']);
}
else
{
ExecMethod('calendar.bocalendar.change_owner',
- Array(
- 'old_owner' => intval($_POST['account_id']),
- 'new_owner' => intval($_POST['new_owner'])
- )
- );
+ array
+ (
+ 'old_owner' => $_POST['account_id'],
+ 'new_owner' => $_POST['new_owner']
+ ));
}
?>
Index: infolog/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- infolog/inc/hook_deleteaccount.inc.php 5 Jan 2005 22:07:58 -0000
1.3
+++ infolog/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.4
@@ -8,13 +8,10 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.3 2005/01/05 22:07:58 ceb Exp $
*/
+ /* $Id: hook_deleteaccount.inc.php,v 1.4 2006/09/05 10:53:09 skwashd
Exp $ */
// Delete all records for a user
$info = CreateObject('infolog.soinfolog');
-
-
$info->change_delete_owner(intval($GLOBALS['HTTP_POST_VARS']['account_id']),
- intval($GLOBALS['HTTP_POST_VARS']['new_owner']));
-
+ $info->change_delete_owner($_POST['account_id'], $_POST['new_owner']);
unset($info);
?>
Index: notes/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- notes/inc/hook_deleteaccount.inc.php 28 Apr 2005 18:33:52 -0000
1.3
+++ notes/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.4
@@ -5,24 +5,21 @@
* @copyright Copyright (C) 2000-2002,2005 Free Software Foundation,
Inc. http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package notes
- * @version $Id: hook_deleteaccount.inc.php,v 1.3 2005/04/28 18:33:52
powerstat Exp $
+ * @version $Id: hook_deleteaccount.inc.php,v 1.4 2006/09/05 10:53:09
skwashd Exp $
*/
// Delete all records for a user
- $table_locks = Array('phpgw_notes');
- $db2 = $GLOBALS['phpgw']->db;
- $db2->lock($table_locks);
+ $db =& $GLOBALS['phpgw']->db;
+ $db->lock(array('phpgw_notes'));
- $new_owner = intval(get_var('new_owner',Array('POST')));
- $account_id = intval(get_var('account_id',Array('POST')));
- if($new_owner==0)
+ if ( (int) $_POST['new_owner'] == 0 )
{
- $db2->query('DELETE FROM phpgw_notes WHERE
note_owner='.$account_id,__LINE__,__FILE__);
+ $db->query('DELETE FROM phpgw_notes WHERE note_owner='. (int)
$_POST['account_id'], __LINE__, __FILE__);
}
else
{
- $db2->query('UPDATE phpgw_notes SET note_owner='.$new_owner
- . ' WHERE note_owner='.$account_id,__LINE__,__FILE__);
+ $db->query('UPDATE phpgw_notes SET note_owner=' . (int)
$_POST['new_owner']
+ . ' WHERE note_owner=' . (int) $_POST['account_id'],
__LINE__, __FILE__);
}
- $db2->unlock();
+ $db->unlock();
?>
Index: preferences/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- preferences/inc/hook_deleteaccount.inc.php 17 Apr 2005 15:14:31 -0000
1.6
+++ preferences/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.7
@@ -6,14 +6,12 @@
* @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package preferences
- * @version $Id: hook_deleteaccount.inc.php,v 1.6 2005/04/17 15:14:31
powerstat Exp $
+ * @version $Id: hook_deleteaccount.inc.php,v 1.7 2006/09/05 10:53:09
skwashd Exp $
*/
// Delete all records for a user
- $table_locks = Array('phpgw_preferences');
-
- $GLOBALS['phpgw']->db->lock($table_locks);
- $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_preferences WHERE
preference_owner='.$GLOBALS['HTTP_POST_VARS']['account_id'],__LINE__,__FILE__);
+ $GLOBALS['phpgw']->db->lock('phpgw_preferences');
+ $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_preferences WHERE
preference_owner=' . (int) $_POST['account_id'],__LINE__,__FILE__);
$GLOBALS['phpgw']->db->unlock();
Index: projects/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- projects/inc/hook_deleteaccount.inc.php 9 Apr 2005 22:36:30 -0000
1.7
+++ projects/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.8
@@ -6,19 +6,19 @@
* @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package projects
- * @version $Id: hook_deleteaccount.inc.php,v 1.7 2005/04/09 22:36:30
ceb Exp $
+ * @version $Id: hook_deleteaccount.inc.php,v 1.8 2006/09/05 10:53:09
skwashd Exp $
* $Source:
/cvsroot/phpgroupware/projects/inc/hook_deleteaccount.inc.php,v $
*/
// Delete all records for a user
$pro = CreateObject('projects.boprojects');
- if(intval($_POST['new_owner']) == 0)
+ if ( (int)$_POST['new_owner'] == 0)
{
- $pro->delete_project(intval($_POST['account_id']),0,'account');
+ $pro->delete_project( (int)$_POST['account_id'],0,'account');
}
else
{
-
$pro->change_owner(intval($_POST['account_id']),intval($_POST['new_owner']));
+ $pro->change_owner( (int)$_POST['account_id'], (int)
$_POST['new_owner']);
}
?>
Index: todo/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- todo/inc/hook_deleteaccount.inc.php 10 May 2005 15:48:57 -0000 1.4
+++ todo/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000 1.5
@@ -7,24 +7,23 @@
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package todo
* @subpackage hooks
- * @version $Id: hook_deleteaccount.inc.php,v 1.4 2005/05/10 15:48:57
powerstat Exp $
+ * @version $Id: hook_deleteaccount.inc.php,v 1.5 2006/09/05 10:53:09
skwashd Exp $
*/
// Delete all records for a user
- $table_locks = Array('phpgw_todo');
- $db2 = $GLOBALS['phpgw']->db;
- $db2->lock($table_locks);
+ $db =& $GLOBALS['phpgw']->db;
+ $db->lock('phpgw_todo');
$new_owner = intval(get_var('new_owner',Array('POST')));
$account_id = intval(get_var('account_id',Array('POST')));
if($new_owner==0)
{
- $db2->query('DELETE FROM phpgw_todo WHERE
todo_owner='.$account_id,__LINE__,__FILE__);
+ $db->query('DELETE FROM phpgw_todo WHERE todo_owner=' . (int)
$_POST['account_id'], __LINE__, __FILE__);
}
else
{
- $db2->query('UPDATE phpgw_todo SET todo_owner='.$new_owner
- . ' WHERE todo_owner='.$account_id,__LINE__,__FILE__);
+ $db->query('UPDATE phpgw_todo SET todo_owner=' . (int)
$_POST['new_owner']
+ . ' WHERE todo_owner=' . (int) $_POST['account_id'],
__LINE__, __FILE__);
}
- $db2->unlock();
+ $db->unlock();
?>
Index: vmailmgr/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/vmailmgr/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- vmailmgr/inc/hook_deleteaccount.inc.php 2 May 2002 01:29:52 -0000
1.2
+++ vmailmgr/inc/hook_deleteaccount.inc.php 5 Sep 2006 10:53:09 -0000
1.3
@@ -10,16 +10,16 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_deleteaccount.inc.php,v 1.2 2002/05/02 01:29:52 seek3r Exp
$ */
+ /* $Id: hook_deleteaccount.inc.php,v 1.3 2006/09/05 10:53:09 skwashd
Exp $ */
// Delete matching vmailmgr user account
- if ($GLOBALS['hook_values']['account_id'] == 0)
+ if ( (int) $GLOBALS['hook_values']['account_id'] == 0)
{
$account_lid = $GLOBALS['hook_values']['account_lid'];
}
else
{
- $account_lid =
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['hook_values']['account_id']);
+ $account_lid =
$GLOBALS['phpgw']->accounts->id2lid($GLOBALS['hook_values']['account_id']);
}
$GLOBALS['phpgw']->vmailmgr = CreateObject('vmailmgr.vmailmgr');
$returnvals = $GLOBALS['phpgw']->vmailmgr->vdeluser($account_lid)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] addressbook/inc/hook_deleteaccount.inc.php admi...,
Dave Hall <=