phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] admin/inc/class.boaccounts.inc.php, 1.33


From: nomail
Subject: [Phpgroupware-cvs] admin/inc/class.boaccounts.inc.php, 1.33
Date: Wed, 23 Jun 2004 16:59:45 +0200

Update of /admin/inc
Modified Files:
        Branch: 
          class.boaccounts.inc.php

date: 2004/06/23 14:59:45;  author: fipsfuchs;  state: Exp;  lines: +31 -35

Log Message:
you are able to delete an account now
=====================================================================
Index: admin/inc/class.boaccounts.inc.php
diff -u admin/inc/class.boaccounts.inc.php:1.32 
admin/inc/class.boaccounts.inc.php:1.33
--- admin/inc/class.boaccounts.inc.php:1.32     Sun Apr 27 23:16:15 2003
+++ admin/inc/class.boaccounts.inc.php  Wed Jun 23 14:59:45 2004
@@ -683,54 +683,50 @@
                        $GLOBALS['phpgw']->db->unlock();
                }
 
-               function delete_user()
+               function delete_user($id, $newowner)
                {
-                       if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || 
$GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
+                       
if($GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
                        {
                                ExecMethod('admin.uiaccounts.list_users');
                                return False;
                        }
-                       elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
+                       
+                       $account_id = get_account_id( (int) $id );
+
+                       $db = $GLOBALS['phpgw']->db;
+                       $db->query('SELECT app_name,app_order FROM 
phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
+                       if($db->num_rows())
                        {
-                               $accountid = 
$GLOBALS['HTTP_POST_VARS']['account_id'];
-                               settype($account_id,'integer');
-                               $account_id = get_account_id($accountid);
-                               $lid = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
-                               $db = $GLOBALS['phpgw']->db;
-                               $db->query('SELECT app_name,app_order FROM 
phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
-                               if($db->num_rows())
+                               while($db->next_record())
                                {
-                                       while($db->next_record())
-                                       {
-                                               $appname = $db->f('app_name');
+                                       $appname = $db->f('app_name');
 
-                                               if($appname <> 'admin')
-                                               {
-                                                       
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
-                                               }
+                                       if($appname != 'admin' && $appname != 
'preferences')
+                                       {
+                                               
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
                                        }
                                }
+                       }
 
-                               
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
-                               
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
-
-                               $GLOBALS['hook_values']['account_id'] = 
$account_id;
-                               
$GLOBALS['phpgw']->hooks->process('deleteaccount');
-
-                               $basedir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
+                       
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
+                       
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
 
-                               if (! @rmdir($basedir . $lid))
-                               {
-                                       $cd = 34;
-                               }
-                               else
-                               {
-                                       $cd = 29;
-                               }
+                       $GLOBALS['hook_values']['account_id'] = $account_id;
+                       $GLOBALS['phpgw']->hooks->process('deleteaccount');
 
-                               ExecMethod('admin.uiaccounts.list_users');
-                               return False;
+                       //<??[+_+]??
+                       $basedir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
+                       $lid = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
+                       if (! @rmdir($basedir . $lid))
+                       {
+                               $cd = 34;
+                       }
+                       else
+                       {
+                               $cd = 29;
                        }
+                       //<??[+_+]??
+                       return $this->so->delete_user($account_id);
                }
 
                function load_group_users($account_id)




reply via email to

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