phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.31,1.32 cla


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.31,1.32 class.soaccounts.inc.php,1.8,1.9 class.uiaccounts.inc.php,1.36,1.37 class.uicategories.inc.php,1.33,1.34
Date: Sun, 27 Apr 2003 19:16:17 -0400

Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv25418/inc

Modified Files:
        class.boaccounts.inc.php class.soaccounts.inc.php 
        class.uiaccounts.inc.php class.uicategories.inc.php 
Log Message:
update

Index: class.boaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boaccounts.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.boaccounts.inc.php    27 Apr 2003 20:28:34 -0000      1.31
--- class.boaccounts.inc.php    27 Apr 2003 23:16:15 -0000      1.32
***************
*** 18,26 ****
                (
                        'add_group'                             => True,
-                       'add_user'                              => True,
                        'delete_group'                  => True,
                        'delete_user'                   => True,
                        'edit_group'                    => True,
!                       'edit_user'                             => True,
                        'set_group_managers'    => True
                );
--- 18,25 ----
                (
                        'add_group'                             => True,
                        'delete_group'                  => True,
                        'delete_user'                   => True,
                        'edit_group'                    => True,
!                       'save_user'                             => True,
                        'set_group_managers'    => True
                );
***************
*** 97,187 ****
                }
  
-               function delete_group($account_id)
-               {
-                       if 
($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
-                       {
-                               return False;
-                       }
- 
-                       $GLOBALS['phpgw']->db->lock(array
-                               (
-                                       'phpgw_accounts',
-                                       'phpgw_acl'
-                               )
-                       );
- 
-                       $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
- 
-                       @reset($old_group_list);
-                       while($old_group_list && $id = each($old_group_list))
-                       {
-                               
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
-                               
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
-                       }
- 
-                       
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
- 
-                       if (! 
@rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
-                       {
-                               $cd = 38;
-                       }
-                       else
-                       {
-                               $cd = 32;
-                       }
- 
-                       $GLOBALS['phpgw']->accounts->delete($account_id);
-                       $GLOBALS['phpgw']->db->unlock();
-               }
- 
-               function delete_user()
-               {
-                       if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || 
$GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
-                       {
-                               ExecMethod('admin.uiaccounts.list_users');
-                               return False;
-                       }
-                       elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
-                       {
-                               $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())
-                                       {
-                                               $appname = $db->f('app_name');
- 
-                                               if($appname <> 'admin')
-                                               {
-                                                       
$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;
- 
-                               if (! @rmdir($basedir . $lid))
-                               {
-                                       $cd = 34;
-                               }
-                               else
-                               {
-                                       $cd = 29;
-                               }
- 
-                               ExecMethod('admin.uiaccounts.list_users');
-                               return False;
-                       }
-               }
  
                function add_group($values)
--- 96,99 ----
***************
*** 296,353 ****
                }
  
-               function add_user($values)
-               {
-                       if 
($GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
-                       {
-                               return False;
-                       }
- 
-                       if ($GLOBALS['HTTP_POST_VARS']['submit'])
-                       {
-                               $userData = array(
-                                       'account_type'          => 'u',
-                                       'account_lid'           => 
$GLOBALS['HTTP_POST_VARS']['account_lid'],
-                                       'account_firstname'     => 
$GLOBALS['HTTP_POST_VARS']['account_firstname'],
-                                       'account_lastname'      => 
$GLOBALS['HTTP_POST_VARS']['account_lastname'],
-                                       'account_passwd'        => 
$GLOBALS['HTTP_POST_VARS']['account_passwd'],
-                                       'status'                => 
($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
-                                       'account_status'        => 
($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
-                                       'old_loginid'           => 
($GLOBALS['HTTP_GET_VARS']['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
-                                       'account_id'            => 
($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
-                                       'account_passwd_2'      => 
$GLOBALS['HTTP_POST_VARS']['account_passwd_2'],
-                                       'account_groups'        => 
$GLOBALS['HTTP_POST_VARS']['account_groups'],
-                                       'account_permissions'   => 
$GLOBALS['HTTP_POST_VARS']['account_permissions'],
-                                       'homedirectory'         => 
$GLOBALS['HTTP_POST_VARS']['homedirectory'],
-                                       'loginshell'            => 
$GLOBALS['HTTP_POST_VARS']['loginshell'],
-                                       'account_expires_month' => 
$GLOBALS['HTTP_POST_VARS']['account_expires_month'],
-                                       'account_expires_day'   => 
$GLOBALS['HTTP_POST_VARS']['account_expires_day'],
-                                       'account_expires_year'  => 
$GLOBALS['HTTP_POST_VARS']['account_expires_year'],
-                                       'account_expires_never' => 
$GLOBALS['HTTP_POST_VARS']['never_expires']
-                                       /* 'file_space' => 
$GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . 
$GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
-                               );
- 
-                               if (!$errors = $this->validate_user($userData))
-                               {
-                                       $this->so->add_user($userData);
-                                       $GLOBALS['hook_values']['account_lid'] 
= $userData['account_lid'];
-                                       $GLOBALS['hook_values']['account_id'] = 
$userData['account_id'];
-                                       $GLOBALS['hook_values']['new_passwd'] = 
$userData['account_passwd'];
-                                       
$GLOBALS['phpgw']->hooks->process('addaccount');
-                                       
ExecMethod('admin.uiaccounts.list_users');
-                                       return False;
-                               }
-                               else
-                               {
-                                       $ui = createobject('admin.uiaccounts');
-                                       
$ui->create_edit_user($userData['account_id'],$userData,$errors);
-                               }
-                       }
-                       else
-                       {
-                               ExecMethod('admin.uiaccounts.list_users');
-                               return False;
-                       }
-               }
- 
                function edit_group($values)
                {
--- 208,211 ----
***************
*** 515,571 ****
                }
  
!               function edit_user()
                {
!                       if 
($GLOBALS['phpgw']->acl->check('account_access',16,'admin'))
                        {
!                               return False;
!                       }
  
!                       if ($GLOBALS['HTTP_POST_VARS']['submit'])
!                       {
!                               $userData = array(
!                                       'account_lid'           => 
$GLOBALS['HTTP_POST_VARS']['account_lid'],
!                                       'firstname'             => 
$GLOBALS['HTTP_POST_VARS']['account_firstname'],
!                                       'lastname'              => 
$GLOBALS['HTTP_POST_VARS']['account_lastname'],
!                                       'account_passwd'        => 
$GLOBALS['HTTP_POST_VARS']['account_passwd'],
!                                       'status'                => 
($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
!                                       'account_status'        => 
($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
!                                       'old_loginid'           => 
($GLOBALS['HTTP_GET_VARS']['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
!                                       'account_id'            => 
($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
!                                       'account_passwd_2'      => 
$GLOBALS['HTTP_POST_VARS']['account_passwd_2'],
!                                       'account_groups'        => 
$GLOBALS['HTTP_POST_VARS']['account_groups'],
!                                       'account_permissions'   => 
$GLOBALS['HTTP_POST_VARS']['account_permissions'],
!                                       'homedirectory'         => 
$GLOBALS['HTTP_POST_VARS']['homedirectory'],
!                                       'loginshell'            => 
$GLOBALS['HTTP_POST_VARS']['loginshell'],
!                                       'account_expires_month' => 
$GLOBALS['HTTP_POST_VARS']['account_expires_month'],
!                                       'account_expires_day'   => 
$GLOBALS['HTTP_POST_VARS']['account_expires_day'],
!                                       'account_expires_year'  => 
$GLOBALS['HTTP_POST_VARS']['account_expires_year'],
!                                       'account_expires_never' => 
$GLOBALS['HTTP_POST_VARS']['never_expires']
                                        /* 'file_space' => 
$GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . 
$GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
                                );
  
!                               if (!$errors = $this->validate_user($userData))
                                {
!                                       $this->save_user($userData);
!                                       // check if would create a menu
                                        // if we do, we can't return to the 
users list, because
                                        // there are also some other plugins
                                        if 
(!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user'))
                                        {
!                                               
ExecMethod('admin.uiaccounts.list_users');
!                                               return False;
!                                       }
!                                       else
                                        {
!                                               
ExecMethod('admin.uiaccounts.edit_user',$GLOBALS['HTTP_GET_VARS']['account_id']);
!                                               return False;
                                        }
                                }
                                else
                                {
!                                       $ui = createobject('admin.uiaccounts');
!                                       
$ui->create_edit_user($userData['account_id'],$userData,$errors);
                                }
                        }
                }
  
--- 373,497 ----
                }
  
!               function save_user($values)
                {
!                       if (is_array($values))
                        {
!                               if($values['expires_never'])
!                               {
!                                       $values['expires'] = 
$values['account_expires'] = -1;
!                               }
!                               else
!                               {
!                                       $values['expires'] = 
$values['account_expires'] = 
mktime(2,0,0,$values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']);
!                               }
  
!                               $userData = array
!                               (
!                                       'account_type'          => 'u',
!                                       'account_lid'           => 
$values['account_lid'],
!                                       'account_firstname'     => 
$values['account_firstname'],
!                                       'account_lastname'      => 
$values['account_lastname'],
!                                       'account_passwd'        => 
$values['account_passwd'],
!                                       'status'                => 
($values['account_status'] ? 'A' : ''),
!                                       'account_status'        => 
($values['account_status'] ? 'A' : ''),
!                                       'old_loginid'           => 
($values['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
!                                       'account_id'            => 
($values['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
!                                       'account_passwd_2'      => 
$values['account_passwd_2'],
!                                       'account_groups'        => 
$values['account_groups'],
!                                       'account_permissions'   => 
$values['account_permissions'],
!                                       'homedirectory'         => 
$values['homedirectory'],
!                                       'loginshell'            => 
$values['loginshell'],
!                                       'account_expires_month' => 
$values['account_expires_month'],
!                                       'account_expires_day'   => 
$values['account_expires_day'],
!                                       'account_expires_year'  => 
$values['account_expires_year'],
!                                       'account_expires_never' => 
$values['expires'],
!                                                               'expires'       
=> $values['expires'],
!                                               'account_expires'       => 
$values['expires']
                                        /* 'file_space' => 
$GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . 
$GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
                                );
  
!                               if ($values['account_id'])
                                {
!                                       $userData['account_id'] = 
$values['account_id'];
!                                       $this->update_user($userData);
!                                       /* check if would create a menu
                                        // if we do, we can't return to the 
users list, because
                                        // there are also some other plugins
                                        if 
(!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user'))
                                        {
!                                       }*/
!                               }
!                               else
!                               {
!                                       $account_id = 
$this->so->add_user($userData);
!                                       $GLOBALS['hook_values']['account_lid']  
= $userData['account_lid'];
!                                       $GLOBALS['hook_values']['account_id']   
= $account_id; //$userData['account_id'];
!                                       $GLOBALS['hook_values']['new_passwd']   
= $userData['account_passwd'];
!                                       
$GLOBALS['phpgw']->hooks->process('addaccount');
!                               }
!                       }
!               }
! 
!               /* stores the userdata */
!               function update_user($userData)
!               {
!                       $account = 
CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
!                       $account->update_data($userData);
!                       $account->save_repository();
!                       if ($userData['account_passwd'])
!                       {
!                               $auth = CreateObject('phpgwapi.auth');
!                               
$auth->change_password($old_passwd,$userData['account_passwd'],$userData['account_id']);
!                               $GLOBALS['hook_values']['account_id'] = 
$userData['account_id'];
!                               $GLOBALS['hook_values']['old_passwd'] = 
$old_passwd;
!                               $GLOBALS['hook_values']['new_passwd'] = 
$userData['account_passwd'];
!                               
$GLOBALS['phpgw']->hooks->process('changepassword');
!                       }
! 
!                       $apps = 
CreateObject('phpgwapi.applications',array(intval($userData['account_id']),'u'));
! 
!                       $apps->account_id = $userData['account_id'];
!                       if ($_userData['account_permissions'])
!                       {
!                               while($app = 
each($userData['account_permissions'])) 
!                               {
!                                       if($app[1]) 
                                        {
!                                               $apps->add($app[0]);
                                        }
                                }
+                       }
+                       $apps->save_repository();
+ 
+                       $account = 
CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
+                       $allGroups = $account->get_list('groups');
+ 
+                       if ($userData['account_groups'])
+                       {
+                               reset($userData['account_groups']);
+                               while (list($key,$value) = 
each($userData['account_groups']))
+                               {
+                                       $newGroups[$value] = $value;
+                               }
+                       }
+ 
+                       $acl = 
CreateObject('phpgwapi.acl',$userData['account_id']);
+ 
+                       reset($allGroups);
+                       while (list($key,$groupData) = each($allGroups)) 
+                       {
+                               /* print "$key,". $groupData['account_id'] 
."<br>";*/
+                               /* print "$key,". 
$userData['account_groups'][1] ."<br>"; */
+ 
+                               if ($newGroups[$groupData['account_id']]) 
+                               {
+                                       
$acl->add_repository('phpgw_group',$groupData['account_id'],$userData['account_id'],1);
+                               }
                                else
                                {
!                                       
$acl->delete_repository('phpgw_group',$groupData['account_id'],$userData['account_id']);
                                }
                        }
+                       
$GLOBALS['phpgw']->session->delete_cache(intval($userData['account_id']));
                }
  
***************
*** 605,611 ****
                        $group->read_repository();
  
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
                        {
!                               $error[] = lang('no permission to create 
groups');
                        }
  
--- 531,537 ----
                        $group->read_repository();
  
!                       if (!$values['account_id'] && 
$GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
                        {
!                               $error[] = lang('no permission to add groups');
                        }
  
***************
*** 639,681 ****
                 otherwise the error array
                */
!               function validate_user(&$_userData)
                {
!                       $totalerrors = 0;
  
                        /*
!                       if 
($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! 
$allow_long_loginids)
                        {
!                               if (strlen($_userData['account_lid']) > 8) 
                                {
!                                       $error[$totalerrors] = lang('The 
loginid can not be more then 8 characters');
!                                       $totalerrors++;
                                }
                        }
                        */
  
!                       if (!$_userData['account_lid'])
                        {
!                               $error[$totalerrors] = lang('You must enter a 
loginid');
!                               $totalerrors++;
                        }
  
!                       if ($_userData['old_loginid'] != 
$_userData['account_lid']) 
                        {
!                               if 
($GLOBALS['phpgw']->accounts->exists($_userData['account_lid']))
                                {
!                                       $error[$totalerrors] = lang('That 
loginid has already been taken');
!                                       $totalerrors++;
                                }
                        }
  
!                       if ($_userData['account_passwd'] || 
$_userData['account_passwd_2']) 
                        {
!                               if ($_userData['account_passwd'] != 
$_userData['account_passwd_2']) 
                                {
!                                       $error[$totalerrors] = lang('The two 
passwords are not the same');
!                                       $totalerrors++;
                                }
  
!                               $temp_msgbox_data = 
$GLOBALS['phpgw_info']['flags']['msgbox_data'];
                                
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
                                
if(!sanitize($_userData['account_passwd'],'password'))
--- 565,606 ----
                 otherwise the error array
                */
!               function validate_user($values)
                {
!                       if (!$values['account_id'] && 
$GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
!                       {
!                               $error[] = lang('no permission to add users');
!                       }
  
                        /*
!                       if 
($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! 
$values['allow_long_loginids'])
                        {
!                               if (strlen($values['account_lid']) > 8) 
                                {
!                                       $error[] = lang('The loginid can not be 
more then 8 characters');
                                }
                        }
                        */
  
!                       if (!$values['account_lid'])
                        {
!                               $error[] = lang('You must enter a loginid');
                        }
  
!                       if ($values['old_loginid'] != $values['account_lid']) 
                        {
!                               if 
($GLOBALS['phpgw']->accounts->exists($values['account_lid']))
                                {
!                                       $error[] = lang('That loginid has 
already been taken');
                                }
                        }
  
!                       if ($values['account_passwd'] || 
$values['account_passwd_2']) 
                        {
!                               if ($values['account_passwd'] != 
$values['account_passwd_2']) 
                                {
!                                       $error[] = lang('The two passwords are 
not the same');
                                }
  
!                       /*      $temp_msgbox_data = 
$GLOBALS['phpgw_info']['flags']['msgbox_data'];
                                
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
                                
if(!sanitize($_userData['account_passwd'],'password'))
***************
*** 689,727 ****
                                }
                                $GLOBALS['phpgw_info']['flags']['msgbox_data'] 
= $temp_msgbox_data;
!                               unset($temp_msgbox_data);
                        }
  
!                       if (!count($_userData['account_permissions']) && 
!count($_userData['account_groups'])) 
                        {
!                               $error[$totalerrors] = lang('You must add at 
least 1 permission or group to this account');
!                               $totalerrors++;
                        }
  
!                       if ($_userData['account_expires_month'] || 
$_userData['account_expires_day'] || $_userData['account_expires_year'] || 
$_userData['account_expires_never'])
                        {
!                               if($_userData['account_expires_never'])
                                {
!                                       $_userData['expires'] = -1;
!                                       $_userData['account_expires'] = 
$_userData['expires'];
!                               }
!                               else
!                               {
!                                       if (! 
checkdate($_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']))
!                                       {
!                                               $error[$totalerrors] = 
lang('You have entered an invalid expiration date');
!                                               $totalerrors++;
!                                       }
!                                       else
!                                       {
!                                               $_userData['expires'] = 
mktime(2,0,0,$_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']);
!                                               $_userData['account_expires'] = 
$_userData['expires'];
!                                       }
                                }
                        }
-                       else
-                       {
-                               $_userData['expires'] = -1;
-                               $_userData['account_expires'] = 
$_userData['expires'];
-                       }
  
                /*
--- 614,632 ----
                                }
                                $GLOBALS['phpgw_info']['flags']['msgbox_data'] 
= $temp_msgbox_data;
!                               unset($temp_msgbox_data); */
                        }
  
!                       if (!count($values['account_permissions']) && 
!count($values['account_groups'])) 
                        {
!                               $error[] = lang('You must add at least 1 
permission or group to this account');
                        }
  
!                       if ($values['account_expires_month'] || 
$values['account_expires_day'] || $values['account_expires_year'] || 
$values['account_expires_never'])
                        {
!                               if (! 
checkdate($values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']))
                                {
!                                       $error[] = lang('You have entered an 
invalid expiration date');
                                }
                        }
  
                /*
***************
*** 734,742 ****
                */
  
!                       if ($totalerrors == 0)
!                       {
!                               return FALSE;
!                       }
!                       else
                        {
                                return $error;
--- 639,643 ----
                */
  
!                       if (is_array($error))
                        {
                                return $error;
***************
*** 744,808 ****
                }
  
!               /* stores the userdata */
!               function save_user($_userData)
                {
!                       $account = 
CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
!                       $account->update_data($_userData);
!                       $account->save_repository();
!                       if ($_userData['account_passwd'])
                        {
!                               $auth = CreateObject('phpgwapi.auth');
!                               $auth->change_password($old_passwd, 
$_userData['account_passwd'], $_userData['account_id']);
!                               $GLOBALS['hook_values']['account_id'] = 
$_userData['account_id'];
!                               $GLOBALS['hook_values']['old_passwd'] = 
$old_passwd;
!                               $GLOBALS['hook_values']['new_passwd'] = 
$_userData['account_passwd'];
!                               
$GLOBALS['phpgw']->hooks->process('changepassword');
                        }
  
!                       $apps = 
CreateObject('phpgwapi.applications',array(intval($_userData['account_id']),'u'));
  
!                       $apps->account_id = $_userData['account_id'];
!                       if ($_userData['account_permissions'])
                        {
!                               while($app = 
each($_userData['account_permissions'])) 
!                               {
!                                       if($app[1]) 
!                                       {
!                                               $apps->add($app[0]);
!                                       }
!                               }
                        }
-                       $apps->save_repository();
  
!                       $account = 
CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
!                       $allGroups = $account->get_list('groups');
  
!                       if ($_userData['account_groups'])
                        {
!                               reset($_userData['account_groups']);
!                               while (list($key,$value) = 
each($_userData['account_groups']))
!                               {
!                                       $newGroups[$value] = $value;
!                               }
                        }
  
!                       $acl = 
CreateObject('phpgwapi.acl',$_userData['account_id']);
  
!                       reset($allGroups);
!                       while (list($key,$groupData) = each($allGroups)) 
                        {
!                               /* print "$key,". $groupData['account_id'] 
."<br>";*/
!                               /* print "$key,". 
$_userData['account_groups'][1] ."<br>"; */
  
!                               if ($newGroups[$groupData['account_id']]) 
                                {
!                                       
$acl->add_repository('phpgw_group',$groupData['account_id'],$_userData['account_id'],1);
                                }
                                else
                                {
!                                       
$acl->delete_repository('phpgw_group',$groupData['account_id'],$_userData['account_id']);
                                }
                        }
-                       
$GLOBALS['phpgw']->session->delete_cache(intval($_userData['account_id']));
                }
  
--- 645,735 ----
                }
  
! 
!               function delete_group($account_id)
                {
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
                        {
!                               return False;
                        }
  
!                       $GLOBALS['phpgw']->db->lock(array
!                               (
!                                       'phpgw_accounts',
!                                       'phpgw_acl'
!                               )
!                       );
  
!                       $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
! 
!                       @reset($old_group_list);
!                       while($old_group_list && $id = each($old_group_list))
                        {
!                               
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
!                               
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
                        }
  
!                       
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
  
!                       if (! 
@rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
                        {
!                               $cd = 38;
!                       }
!                       else
!                       {
!                               $cd = 32;
                        }
  
!                       $GLOBALS['phpgw']->accounts->delete($account_id);
!                       $GLOBALS['phpgw']->db->unlock();
!               }
  
!               function delete_user()
!               {
!                       if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || 
$GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
                        {
!                               ExecMethod('admin.uiaccounts.list_users');
!                               return False;
!                       }
!                       elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
!                       {
!                               $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())
!                                       {
!                                               $appname = $db->f('app_name');
  
!                                               if($appname <> 'admin')
!                                               {
!                                                       
$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;
! 
!                               if (! @rmdir($basedir . $lid))
                                {
!                                       $cd = 34;
                                }
                                else
                                {
!                                       $cd = 29;
                                }
+ 
+                               ExecMethod('admin.uiaccounts.list_users');
+                               return False;
                        }
                }
  

Index: class.soaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.soaccounts.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.soaccounts.inc.php    2 Jan 2002 14:33:02 -0000       1.8
--- class.soaccounts.inc.php    27 Apr 2003 23:16:15 -0000      1.9
***************
*** 20,26 ****
                function add_user($userData)
                {
!                       $userData['account_expires'] = $userData['expires'];
!                       $GLOBALS['phpgw']->db->lock(
!                               Array(
                                        'phpgw_accounts',
                                        'phpgw_nextid',
--- 20,27 ----
                function add_user($userData)
                {
!                       $GLOBALS['phpgw']->db->lock
!                       (
!                               array
!                               (
                                        'phpgw_accounts',
                                        'phpgw_nextid',

Index: class.uiaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiaccounts.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** class.uiaccounts.inc.php    27 Apr 2003 20:28:34 -0000      1.36
--- class.uiaccounts.inc.php    27 Apr 2003 23:16:15 -0000      1.37
***************
*** 294,298 ****
                                if (is_array($error))
                                {
! 
                                }
                                else
--- 294,298 ----
                                if (is_array($error))
                                {
!                                       $error_list = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
                                else
***************
*** 365,369 ****
                        $account_num = count($account_list);
  
-                       $user_list = '';
                        while (list($key,$entry) = each($account_list))
                        {
--- 365,368 ----
***************
*** 447,450 ****
--- 446,450 ----
                        $data = array
                        (
+                               'msgbox_data'                   => $error_list,
                                'edit_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'account_id'                    => 
$group_info['account_id'],
***************
*** 452,456 ****
                                'value_account_name'    => 
$group_info['account_name'],
                                'lang_include_user'             => lang('select 
users for inclusion'),
-                               'error'                                 => 
(!$_errors?'':$GLOBALS['phpgw']->common->error_list($_errors)),
                                'select_size'                   => 
($account_num < 5?$account_num:5),
                                'user_list'                             => 
$user_list,
--- 452,455 ----
***************
*** 472,482 ****
                function edit_user()
                {
!                       $cd                             = 
get_var('cd',array('GET'));
!                       $account_id             = 
get_var('account_id',array('GET','POST'));
!                       $values                 = 
get_var('values',array('POST'));
!                       $account_groups = 
get_var('account_groups',array('POST'));
!                       $account_apps   = get_var('account_apps',array('POST'));
! 
!                       _debug_array($values);
  
                        if ($values['cancel'] || (!$account_id && 
$GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || ($account_id && 
$GLOBALS['phpgw']->acl->check('account_access',16,'admin')))
--- 471,479 ----
                function edit_user()
                {
!                       $cd                                             = 
get_var('cd',array('GET'));
!                       $account_id                             = 
get_var('account_id',array('GET','POST'));
!                       $values                                 = 
get_var('values',array('POST'));
!                       $account_groups                 = 
get_var('account_groups',array('POST'));
!                       $account_permissions    = 
get_var('account_permissions',array('POST'));
  
                        if ($values['cancel'] || (!$account_id && 
$GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || ($account_id && 
$GLOBALS['phpgw']->acl->check('account_access',16,'admin')))
***************
*** 495,526 ****
                        if ($values['save'])
                        {
                                $error = $this->bo->validate_user($values);
  
                                if (is_array($error))
                                {
! 
                                }
                                else
                                {
!                                       if (is_array($account_groups))
                                        {
!                                               $values['account_groups'] = 
$account_groups;
!                                       }
! 
!                                       if (is_array($account_permissions))
!                                       {
!                                               $values['account_permissions'] 
= $account_permissions;
!                                       }
! 
!                                       if ($values['account_id'])
!                                       {
!                                               $this->bo->edit_user($values);
!                                               $account_id = 
$values['account_id'];
!                                       }
!                                       else
!                                       {
!                                               $this->bo->add_user($values);
!                                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_user'));
                                        }
                                }
                        }
--- 492,519 ----
                        if ($values['save'])
                        {
+                               if (is_array($account_groups))
+                               {
+                                       $values['account_groups'] = 
$account_groups;
+                               }
+ 
+                               if (is_array($account_permissions))
+                               {
+                                       $values['account_permissions'] = 
$account_permissions;
+                               }
+ 
                                $error = $this->bo->validate_user($values);
  
                                if (is_array($error))
                                {
!                                       $error_list = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
                                else
                                {
!                                       if ($account_id)
                                        {
!                                               $values['account_id'] = 
$account_id;
                                        }
+                                       $this->bo->save_user($values);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_users');
                                }
                        }
***************
*** 547,594 ****
                        }
  
!                       if (is_array($_userData))
                        {
                                $userData = Array();
!                               $userData=$_userData;
!                               @reset($userData['account_groups']);
!                               while (list($key, $value) = 
@each($userData['account_groups']))
!                               {
!                                       $userGroups[$key]['account_id'] = 
$value;
!                               }
  
!                               $account = CreateObject('phpgwapi.accounts');
!                               $allGroups = $account->get_list('groups');
                        }
!                       elseif(is_string($_userData) && $_userData=='')
                        {
!                               if($_account_id)
!                               {
!                                       $account = 
CreateObject('phpgwapi.accounts',intval($_account_id),'u');
!                                       $userData = $account->read_repository();
!                                       $userGroups = 
$account->membership($_account_id);
!                               }
!                               else
!                               {
!                                       $account = 
CreateObject('phpgwapi.accounts');
!                                       $userData = Array();
!                                       $userData['status'] = 'A';
!                                       $userGroups = Array();
!                               }
!                               $allGroups = $account->get_list('groups');
! 
!                               if ($userData['expires'] == -1)
!                               {
!                                       $userData['account_expires_month'] = 0;
!                                       $userData['account_expires_day']   = 0;
!                                       $userData['account_expires_year']  = 0;
!                               }
!                               else
!                               {
!                                       /* Change this to be an admin/setup 
setting.  For now, default to expire one week from today. */
!                                       $time_var = time() + (60*60*24*7);
!                                       $userData['account_expires_month'] = 
date('m',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
!                                       $userData['account_expires_day']   = 
date('d',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
!                                       $userData['account_expires_year']  = 
date('Y',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
!                               }
                        }
  
--- 540,571 ----
                        }
  
!                       if($account_id)
                        {
+                               $account = 
CreateObject('phpgwapi.accounts',intval($account_id),'u');
+                               $userData = $account->read_repository();
+                               $userGroups = $account->membership($account_id);
+                       }
+                       else
+                       {
+                               $account = CreateObject('phpgwapi.accounts');
                                $userData = Array();
!                               $userData['status'] = 'A';
!                               $userGroups = Array();
!                       }
!                       $allGroups = $account->get_list('groups');
  
!                       if ($userData['expires'] == -1)
!                       {
!                               $userData['account_expires_month'] = 0;
!                               $userData['account_expires_day']   = 0;
!                               $userData['account_expires_year']  = 0;
                        }
!                       else
                        {
!                               /* Change this to be an admin/setup setting.  
For now, default to expire one week from today. */
!                               $time_var = time() + (60*60*24*7);
!                               $userData['account_expires_month'] = 
date('m',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
!                               $userData['account_expires_day']   = 
date('d',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
!                               $userData['account_expires_year']  = 
date('Y',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
                        }
  
***************
*** 598,605 ****
                                $lang_shell             = lang('login shell');
                                $homedirectory = '<input name="homedirectory" 
value="'
!                                       . 
($_account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$account_lid)
                                        . '">';
                                $loginshell = '<input name="loginshell" value="'
!                                       . 
($_account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
                                        . '">';
                        }
--- 575,582 ----
                                $lang_shell             = lang('login shell');
                                $homedirectory = '<input name="homedirectory" 
value="'
!                                       . 
($account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$account_lid)
                                        . '">';
                                $loginshell = '<input name="loginshell" value="'
!                                       . 
($account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
                                        . '">';
                        }
***************
*** 636,640 ****
                */
  
-                       $groups_select = '';
                        reset($allGroups);
                        while (list($key,$value) = each($allGroups)) 
--- 613,616 ----
***************
*** 645,655 ****
                                        'account_lid'           => 
$value['account_lid']
                                );
  
!                               for ($i=0; $i<count($userGroups); $i++) 
                                {
!                                       /* print 
"Los1:".$userData["account_id"].$userGroups[$i]['account_id']." : 
".$value['account_id']."<br>"; */
!                                       if (@$userGroups[$i]['account_id'] == 
$value['account_id']) 
                                        {
!                                               $group_list[]['selected']   = 
'yes';
                                        }
                                }
--- 621,633 ----
                                        'account_lid'           => 
$value['account_lid']
                                );
+                       }
  
!                       for ($i=0;$i<count($userGroups);$i++)
!                       {
!                               for($j=0;$j<count($group_list);$j++)
                                {
!                                       if ($userGroups[$i]['account_id'] == 
$group_list[$j]['account_id'])
                                        {
!                                               $group_list[$j]['selected'] = 
'yes';
                                        }
                                }
***************
*** 658,662 ****
                        /* create list of available apps */
                        $i = 0;
!                       $apps = 
CreateObject('phpgwapi.applications',$_account_id);
                        $db_perms = $apps->read_account_specific();
  
--- 636,640 ----
                        /* create list of available apps */
                        $i = 0;
!                       $apps = 
CreateObject('phpgwapi.applications',$account_id);
                        $db_perms = $apps->read_account_specific();
  
***************
*** 697,700 ****
--- 675,679 ----
                        $data = array
                        (
+                               'msgbox_data'                   => $error_list,
                                'edit_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$page_params),
                                'lang_lid'                              => 
lang('loginid'),
***************
*** 721,725 ****
                                'account_passwd'                => 
$account_passwd,
                                'account_passwd_2'              => 
$account_passwd_2,
!                               'expires'                               => 
(($userData['expires'] == -1)?'yes':''),
                                'group_list'                    => $group_list,
                                'app_list'                              => 
$app_list
--- 700,704 ----
                                'account_passwd'                => 
$account_passwd,
                                'account_passwd_2'              => 
$account_passwd_2,
!                               'expires_never'                 => 
(($userData['expires'] == -1)?'yes':''),
                                'group_list'                    => $group_list,
                                'app_list'                              => 
$app_list

Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uicategories.inc.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** class.uicategories.inc.php  23 Apr 2003 01:08:32 -0000      1.33
--- class.uicategories.inc.php  27 Apr 2003 23:16:15 -0000      1.34
***************
*** 93,96 ****
--- 93,107 ----
                        );
  
+                       if ($_POST['add'])
+                       {
+                               $link_data['menuaction'] = 
'admin.uicategories.edit';
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+                       }
+ 
+                       if ($_POST['done'])
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.iumainscreen.mainscreen');
+                       }
+ 
                        if ($GLOBALS['appname'])
                        {
***************
*** 212,216 ****
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.edit';
                        $link_data['parent'] = '';
  
--- 223,227 ----
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.index';
                        $link_data['parent'] = '';
  
***************
*** 219,226 ****
                                'lang_add'                              => 
lang('add'),
                                'lang_add_statustext'   => lang('add a 
category'),
!                               'add_url'                               => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_done'                             => 
lang('done'),
!                               'lang_done_statustext'  => lang('return to 
admin mainscreen'),
!                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen')
                        );
  
--- 230,236 ----
                                'lang_add'                              => 
lang('add'),
                                'lang_add_statustext'   => lang('add a 
category'),
!                               'action_url'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_done'                             => 
lang('done'),
!                               'lang_done_statustext'  => lang('return to 
admin mainscreen')
                        );
  
***************
*** 255,265 ****
                        $values                 = 
get_var('values',array('POST'));
  
!                       if ($values['save'])
                        {
!                               if (is_array($values))
!                               {
!                                       $values['cat_id'] = $this->cat_id;
!                                       $values['access'] = 'public';
!                               }
  
                                $error = $this->bo->check_values($values);
--- 265,284 ----
                        $values                 = 
get_var('values',array('POST'));
  
!                       $link_data = array
!                       (
!                               'menuaction'  => 'admin.uicategories.index',
!                               'appname'     => $GLOBALS['appname'],
!                               'global_cats' => $global_cats
!                       );
! 
!                       if ($values['cancel'])
                        {
!                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
!                       }
! 
!                       if ($values['save'] || $values['apply'])
!                       {
!                               $values['cat_id'] = $this->cat_id;
!                               $values['access'] = 'public';
  
                                $error = $this->bo->check_values($values);
***************
*** 271,289 ****
                                {
                                        $this->cat_id = 
$this->bo->save_cat($values);
!                                       $message = lang('Category %1 has been 
saved !',$values['name']);
                                }
                        }
  
!                       if (!$this->cat_id)
!                       {
!                               $function = lang('add category');
!                               $action = 'add';
!                       }
!                       else
                        {
-                               $action = 'edit';
-                               $function = lang('edit category');
                                $cats = 
$this->bo->cats->return_single($this->cat_id);
- 
                                $parent = $cats['parent'];
                        }
--- 290,307 ----
                                {
                                        $this->cat_id = 
$this->bo->save_cat($values);
!                                       if ($values['apply'])
!                                       {
!                                               $message = lang('Category %1 
has been saved !',$values['name']);
!                                       }
!                                       else
!                                       {
!                                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
!                                       }
                                }
                        }
  
!                       if ($this->cat_id)
                        {
                                $cats = 
$this->bo->cats->return_single($this->cat_id);
                                $parent = $cats['parent'];
                        }
***************
*** 291,295 ****
                        if ($GLOBALS['appname'])
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
$function;
                        }
                        else
--- 309,313 ----
                        if ($GLOBALS['appname'])
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
($this->cat_id?lang('edit category'):lang('add category'));
                        }
                        else
***************
*** 309,323 ****
                        }
  
-                       $link_data = array
-                       (
-                               'menuaction'  => 'admin.uicategories.index',
-                               'appname'     => $GLOBALS['appname'],
-                               'global_cats' => $global_cats
-                       );
- 
                        $data = array
                        (
-                               'action'                                        
=> $action,
-                               'done_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_name'                                     
=> lang('name'),
                                'lang_descr'                            => 
lang('description'),
--- 327,332 ----
***************
*** 325,337 ****
                                'old_parent'                            => 
$cats['parent'],
                                'lang_save'                                     
=> lang('save'),
!                               'lang_done'                                     
=> lang('done'),
!                               'lang_delete'                           => 
lang('delete'),
!                               'lang_reset'                            => 
lang('reset'),
                                'value_name'                            => 
$GLOBALS['phpgw']->strip_html($cats['name']),
                                'value_descr'                           => 
$GLOBALS['phpgw']->strip_html($cats['descr']),
                                'message'                                       
=> $message,
!                               'lang_content_statustext'       => lang('Enter 
a description for the category'),
!                               'lang_done_statustext'          => lang('Back 
to the list'),
!                               'lang_save_statustext'          => lang('Save 
the category'),
                                'lang_no_cat'                           => 
lang('no category'),
                                'lang_cat_statustext'           => lang('Select 
the parent category. If this is a main category select NO CATEGORY'),
--- 334,346 ----
                                'old_parent'                            => 
$cats['parent'],
                                'lang_save'                                     
=> lang('save'),
!                               'lang_apply'                            => 
lang('apply'),
!                               'lang_cancel'                           => 
lang('cancel'),
                                'value_name'                            => 
$GLOBALS['phpgw']->strip_html($cats['name']),
                                'value_descr'                           => 
$GLOBALS['phpgw']->strip_html($cats['descr']),
                                'message'                                       
=> $message,
!                               'lang_content_statustext'       => lang('enter 
a description for the category'),
!                               'lang_cancel_statustext'        => lang('leave 
the category untouched and return back to the list'),
!                               'lang_save_statustext'          => lang('save 
the category and return back to the list'),
!                               'lang_apply_statustext'         => lang('save 
the category'),
                                'lang_no_cat'                           => 
lang('no category'),
                                'lang_cat_statustext'           => lang('Select 
the parent category. If this is a main category select NO CATEGORY'),
***************
*** 346,350 ****
                        }
                        $data['edit_url'] = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
-                       $data['delete_url'] = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data));
--- 355,358 ----
***************
*** 355,367 ****
                        $global_cats  = 
get_var('global_cats',array('POST','GET'));
  
-                       if ($GLOBALS['appname'])
-                       {
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
lang('delete category');
-                       }
-                       else
-                       {
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('global categories') . ': ' . lang('delete category');
-                       }
- 
                        $link_data = array
                        (
--- 363,366 ----
***************
*** 371,392 ****
                        );
  
!                       if (!$this->cat_id)
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
  
!                       if (get_var('confirm',array('POST')))
                        {
!                               if (get_var('subs',array('POST')))
                                {
!                                       switch (get_var('subs',array('POST')))
                                        {
                                                case 'move':
                                                        
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
!                                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                                                        break;
                                                case 'drop':
                                                        
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
!                                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                                                        break;
                                                default:
--- 370,391 ----
                        );
  
!                       if ($_POST['cancel'] || !$this->cat_id)
                        {
!                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
  
!                       if ($_POST['delete'])
                        {
!                               if ($_POST['subs'])
                                {
!                                       switch ($_POST['subs'])
                                        {
                                                case 'move':
                                                        
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
!                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                                                        break;
                                                case 'drop':
                                                        
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
!                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                                                        break;
                                                default:
***************
*** 398,402 ****
                                {
                                        $this->bo->delete(array('cat_id' => 
$this->cat_id));
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                                }
                        }
--- 397,401 ----
                                {
                                        $this->bo->delete(array('cat_id' => 
$this->cat_id));
!                                       
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                                }
                        }
***************
*** 404,421 ****
                        
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete'));
  
!                       if ($GLOBALS['appname'])
!                       {
!                               $type = 'noglobalapp';
!                       }
!                       else
!                       {
!                               $type = 'noglobal';
!                       }
  
                        $apps_cats = $this->bo->exists(array('type'             
=> $type,
                                                                                
                'cat_name'      => '',
                                                                                
                'cat_id'        => $this->cat_id));
- 
- 
                        if ($apps_cats)
                        {
--- 403,413 ----
                        
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete'));
  
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
($GLOBALS['appname']?lang($GLOBALS['appname']) . '&nbsp;':'') . lang('global 
categories') . ': ' . lang('delete category');
! 
!                       $type = ($GLOBALS['appname']?'noglobalapp':'noglobal');
  
                        $apps_cats = $this->bo->exists(array('type'             
=> $type,
                                                                                
                'cat_name'      => '',
                                                                                
                'cat_id'        => $this->cat_id));
                        if ($apps_cats)
                        {
***************
*** 444,457 ****
                        $data = array
                        (
!                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_confirm_msg'              => 
$lang_confirm_msg,
!                               'lang_yes'                              => 
lang('yes'),
!                               'subs'                                  => 
$subs,
!                               'lang_sub_select_move'  => 
$lang_sub_select_move,
!                               'lang_sub_select_drop'  => 
$lang_sub_select_drop,
!                               'lang_yes_statustext'   => lang('Delete the 
entry'),
!                               'lang_no_statustext'    => lang('Back to the 
list'),
!                               'lang_no'                               => 
lang('no'),
!                               'lang_error_msg'                => $error_msg
                        );
  
--- 436,448 ----
                        $data = array
                        (
!                               'lang_delete_msg'                       => 
$lang_confirm_msg,
!                               'lang_delete'                           => 
lang('delete'),
!                               'subs'                                          
=> $subs,
!                               'lang_sub_select_move'          => 
$lang_sub_select_move,
!                               'lang_sub_select_drop'          => 
$lang_sub_select_drop,
!                               'lang_delete_statustext'        => lang('delete 
the category'),
!                               'lang_cancel_statustext'        => lang('do NOT 
delete the category and return back to the list'),
!                               'lang_cancel'                           => 
lang('cancel'),
!                               'lang_error_msg'                        => 
$error_msg
                        );
  





reply via email to

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