phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] fudforum/inc class.ufud.inc.php,1.1.1.1.2.4


From: ceb
Subject: [Phpgroupware-cvs] fudforum/inc class.ufud.inc.php,1.1.1.1.2.4
Date: Tue, 14 Jun 2005 18:28:00 +0200

Update of fudforum/inc

Modified Files:
     Branch: Version-0_9_16-branch
            class.ufud.inc.php lines: +22 -11

Log Message:
fix for delete user

====================================================
Index: fudforum/inc/class.ufud.inc.php
diff -u fudforum/inc/class.ufud.inc.php:1.1.1.1.2.3 
fudforum/inc/class.ufud.inc.php:1.1.1.1.2.4
--- fudforum/inc/class.ufud.inc.php:1.1.1.1.2.3 Fri Jul 16 08:46:27 2004
+++ fudforum/inc/class.ufud.inc.php     Tue Jun 14 16:28:57 2005
@@ -21,6 +21,7 @@
                        'new_passwd' => //
                        'location' => 'addaccount')
                */
+
                function __get_email($id)
                {
                        $preferences = CreateObject('phpgwapi.preferences', 
$id);
@@ -96,33 +97,43 @@
                        $GLOBALS['phpgw']->db->query("UPDATE phpgw_fud_users 
SET name='{$name}', email='{$email}', login='{$login}', alias='{$alias}', 
users_opt={$status} WHERE phpgw_id={$row['account_id']}");
                }

-               function del_account($row)
+               function del_account($row = 0)
                {
-                       if(! 
@is_readable($GLOBALS['phpgw_info']['server']['files_dir'] . 
"/fudforum/include/GLOBALS.php") )
+                       $account_id = intval($_POST['account_id']);
+
+                       if(! 
@is_readable($GLOBALS['phpgw_info']['server']['files_dir'] . 
'/fudforum/include/GLOBALS.php') )
                        {
                                //not installed properly
                                return true;
                        }
-
-                       if(!is_array($row))
+
+                       /* this doesnt work at all. $GLOBALS['hook_values'] is 
empty and $row is not an array */
+                       /*if(!is_array($row))
                        {
                                print_r($GLOBALS['hook_values']); // empty ????
                                $row['account_id'] = 
$GLOBALS['hook_values']['account_id'];
-                       }
+                       }*/
+
                        define('plain_page', 1);
-                       require($GLOBALS['phpgw_info']['server']['files_dir'] . 
"/fudforum/include/GLOBALS.php");
+                       require($GLOBALS['phpgw_info']['server']['files_dir'] . 
'/fudforum/include/GLOBALS.php');

                        fud_use('db.inc');
                        fud_use('private.inc');
                        fud_use('users_reg.inc');
-                       fud_use('users_adm.inc', true);
+                       fud_use('users_adm.inc',True);

-                       $id = q_singleval("SELECT id FROM phpgw_fud_users WHERE 
phpgw_id=".$row['account_id']);
-                       if ($id) {
+                       //$id = q_singleval("SELECT id FROM phpgw_fud_users 
WHERE phpgw_id=".$row['account_id']);
+
+                       $GLOBALS['phpgw']->db->query('SELECT id from 
phpgw_fud_users WHERE phpgw_id=' . $account_id);
+                       $GLOBALS['phpgw']->db->next_record();
+                       $id = intval($GLOBALS['phpgw']->db->f('id'));
+
+                       if ($id)
+                       {
                                usr_delete($id);
                        }
                }
-
+
                function edit_account()
                {
                        // available vars...
@@ -131,7 +142,7 @@
                        $passwd = $GLOBALS['hook_values']['new_passwd'];
                        $fname  = $GLOBALS['hook_values']['account_firstname'];
                        $lname  = $GLOBALS['hook_values']['account_lastname'];
-
+
                        $name = addslashes($fname.' '.$lname);
                        $email = addslashes($this->__get_email($id));
                        $login = $lid;






reply via email to

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