phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] admin/inc/class.soaccounts.inc.php, 1.12


From: nomail
Subject: [Phpgroupware-cvs] admin/inc/class.soaccounts.inc.php, 1.12
Date: Thu, 30 Dec 2004 08:38:14 +0100

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

date: 2004/12/30 07:38:14;  author: skwashd;  state: Exp;  lines: +23 -56

Log Message:
new HEAD admin - sans GIFs
=====================================================================
Index: admin/inc/class.soaccounts.inc.php
diff -u admin/inc/class.soaccounts.inc.php:1.11 
admin/inc/class.soaccounts.inc.php:1.12
--- admin/inc/class.soaccounts.inc.php:1.11     Fri Jun 25 08:22:40 2004
+++ admin/inc/class.soaccounts.inc.php  Thu Dec 30 07:38:14 2004
@@ -17,30 +17,11 @@
                {
                }
 
-               function delete_user($id)
-               {
-                       if((int)$id)
-                       {
-                               return $GLOBALS['phpgw']->accounts->delete($id);
-                       }
-                       else
-                       {
-                               return false;
-                       }
-               }
-               
-               function update_user($userData)
-               {
-                       $GLOBALS['phpgw']->accounts->update_data($userData);
-                       $GLOBALS['phpgw']->accounts->save_repository();
-               }
-               
                function add_user($userData)
                {
-                       $GLOBALS['phpgw']->db->lock
-                       (
-                               array
-                               (
+                       $userData['account_expires'] = $userData['expires'];
+                       $GLOBALS['phpgw']->db->lock(
+                               Array(
                                        'phpgw_accounts',
                                        'phpgw_nextid',
                                        'phpgw_preferences',
@@ -48,15 +29,20 @@
                                        'phpgw_acl',
                                        'phpgw_applications',
                                        'phpgw_app_sessions',
-                                       'phpgw_hooks'
+                                       'phpgw_hooks',
+                                       //PB asked for this... im not shure why 
is it causing
+                                       //them problems
+                                       'phpgw_lang'
                                )
                        );
 
-                       $userData['account_id'] = 
$GLOBALS['phpgw']->accounts->create($userData);
+                       $GLOBALS['phpgw']->accounts->account_type = 'u';
+                       $GLOBALS['phpgw']->accounts->create($userData);
 
-                       $apps = 
CreateObject('phpgwapi.applications',array($userData['account_id'],'u'));
-                       $apps->read_installed_apps();
+                       $userData['account_id'] = 
$GLOBALS['phpgw']->accounts->name2id($userData['account_lid']);
 
+                       $apps = 
CreateObject('phpgwapi.applications',$userData['account_id']);
+                       $apps->read_installed_apps();
                        // Read Group Apps
                        if ($userData['account_groups'])
                        {
@@ -79,9 +65,8 @@
 
                        $apps->account_type = 'u';
                        $apps->account_id = $userData['account_id'];
-                       $apps->account_apps = Array(Array());
+                       $apps->data = Array(Array());
 
-/* moved to bo
                        if ($userData['account_permissions'])
                        {
                                @reset($userData['account_permissions']);
@@ -98,45 +83,27 @@
                                }
                        }
                        $apps->save_repository();
-*/
-
-                       
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1);
 
-                       // Assign user to groups
-                       if ($userData['groups'])
+                       if ($userData['changepassword'])
                        {
-                               for ($i=0; $i < count($userData['groups']); 
$i++)
-                               {
-                                       
$GLOBALS['phpgw']->acl->add_repository('phpgw_group',$userData['groups'][$i],$userData['id'],1);
-                               }
+                               
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1);
                        }
-
-/*                     if ($apps_after)
+                       // Assign user to groups
+                       if ($userData['account_groups'])
                        {
-                               $GLOBALS['pref'] = 
CreateObject('phpgwapi.preferences',$userData['account_id']);
-                               
$GLOBALS['phpgw']->hooks->single('add_def_pref','admin');
-                               while ($apps = each($apps_after))
+                               $c_acct_groups = 
count($userData['account_groups']);
+                               for ($i=0;$i<$c_acct_groups;$i++)
                                {
-                                       if (strcasecmp ($apps[0], 'admin') != 0)
-                                       {
-                                               
$GLOBALS['phpgw']->hooks->single('add_def_pref', $apps[1]);
-                                       }
+                                       
$GLOBALS['phpgw']->acl->add_repository('phpgw_group',$userData['account_groups'][$i],$userData['account_id'],1);
+                                       
$GLOBALS['phpgw']->accounts->add_account2Group($userData['account_id'], 
$userData['account_groups'][$i]);
                                }
-                               $GLOBALS['pref']->save_repository(False);
-                       } */
+                       }
 
                        $apps->account_apps = array(array());
                        $apps_after = array(array());
 
                        $GLOBALS['phpgw']->db->unlock();
 
-/*
-                       // start inlcuding other admin tools
-                       while($app = each($apps_after))
-                       {
-                               
$GLOBALS['phpgw']->hooks->single('add_user_data', $value);
-                       }
-*/
                        return $userData['account_id'];
                }
        }




reply via email to

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