[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php, 1.22.2.7.2.6
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php, 1.22.2.7.2.6, 1.22.2.7.2.7 class.soaccounts.inc.php, 1.8.2.1.2.2, 1.8.2.1.2.3 class.uiaccounts.inc.php, 1.23.2.9.2.15, 1.23.2.9.2.16 |
Date: |
Mon, 08 Sep 2003 09:26:40 -0400 |
Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv589/admin/inc
Modified Files:
Tag: Version-0_9_16-branch
class.boaccounts.inc.php class.soaccounts.inc.php
class.uiaccounts.inc.php
Log Message:
Adding new contacts backend ... and associated code
Index: class.boaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boaccounts.inc.php,v
retrieving revision 1.22.2.7.2.6
retrieving revision 1.22.2.7.2.7
diff -C2 -r1.22.2.7.2.6 -r1.22.2.7.2.7
*** class.boaccounts.inc.php 7 Sep 2003 09:57:42 -0000 1.22.2.7.2.6
--- class.boaccounts.inc.php 8 Sep 2003 13:26:37 -0000 1.22.2.7.2.7
***************
*** 133,136 ****
--- 133,143 ----
settype($account_id,'integer');
$account_id = get_account_id($accountid);
+
+ //jarg-SOG S
+ $personid = $_POST['person_id'];
+ settype($person_id,'integer');
+ $person_id = $personid;
+ //End
+
// make this information also in hook available
$lid =
$GLOBALS['phpgw']->accounts->id2name($account_id);
***************
*** 323,337 ****
'homedirectory' =>
$_POST['homedirectory'],
'loginshell' =>
$_POST['loginshell'],
! 'account_expires_month' =>
$_POST['account_expires_month'],
! 'account_expires_day' =>
$_POST['account_expires_day'],
! 'account_expires_year' =>
$_POST['account_expires_year'],
! 'account_expires_never' =>
$_POST['never_expires'],
/* 'file_space' =>
$_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
if (!$errors = $this->validate_user($userData))
{
$account_id =
$this->so->add_user($userData);
! if ($userData['anonymous'])
{
$GLOBALS['phpgw']->acl->add_repository('phpgwapi','anonymous',$account_id,1);
--- 330,366 ----
'homedirectory' =>
$_POST['homedirectory'],
'loginshell' =>
$_POST['loginshell'],
! 'account_expires_month' =>
$_POST['account_expires_month'],
! 'account_expires_day' =>
$_POST['account_expires_day'],
! 'account_expires_year' =>
$_POST['account_expires_year'],
! 'account_expires_never' =>
$_POST['never_expires'],
! //jarg-SOG S
! 'domain'
=> $_POST['domain'],
! 'add_addbook' =>
$_POST['add_addbook'],
! 'person_id' =>
$_POST['person_id']
! //End
/* 'file_space' =>
$_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
+ if ($_POST['expires'] !== '' &&
!$_POST['never_expires'])
+ {
+ $jscal =
CreateObject('phpgwapi.jscalendar',False);
+ $userData +=
$jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year');
+ }
if (!$errors = $this->validate_user($userData))
{
+ //jarg-SOG S
+ $this->contacts =
CreateObject('phpgwapi.contacts');
+ $owner =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $type =
$this->contacts->search_contact_type('Persons');
+ $principal = array('owner' => $owner,
+ 'per_prefix' =>
$userData['account_lid'],
+ 'per_first_name' =>
$userData['account_firstname'],
+ 'per_last_name' =>
$userData['account_lastname']);
+ $person_id =
$this->contacts->add_contact($type, $principal);
+ $userData['person_id'] = $person_id;
+ //End
+
$account_id =
$this->so->add_user($userData);
! if ($userData['anonymous'])
{
$GLOBALS['phpgw']->acl->add_repository('phpgwapi','anonymous',$account_id,1);
***************
*** 348,352 ****
$GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname'];
$GLOBALS['phpgw']->hooks->process('addaccount');
!
ExecMethod('admin.uiaccounts.list_users');
return False;
}
--- 377,385 ----
$GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname'];
$GLOBALS['phpgw']->hooks->process('addaccount');
! //jarg-SOG S
!
//ExecMethod('admin.uiaccounts.list_users');
! $ui = createobject('admin.uiaccounts');
!
$ui->create_edit_user($userData['account_id'],$userData);
! //End
return False;
}
***************
*** 494,498 ****
$GLOBALS['phpgw']->session->delete_cache($user_id);
!
// The following sets any default preferences
needed for new applications..
// This is smart enough to know if previous
preferences were selected, use them.
--- 527,531 ----
$GLOBALS['phpgw']->session->delete_cache($user_id);
!
// The following sets any default preferences
needed for new applications..
// This is smart enough to know if previous
preferences were selected, use them.
***************
*** 547,552 ****
$userData = array(
'account_lid' =>
$_POST['account_lid'],
! 'firstname' =>
$_POST['account_firstname'],
! 'lastname' =>
$_POST['account_lastname'],
'account_passwd' =>
$_POST['account_passwd'],
'status' =>
($_POST['account_status'] ? 'A' : ''),
--- 580,585 ----
$userData = array(
'account_lid' =>
$_POST['account_lid'],
! 'account_firstname' =>
$_POST['account_firstname'],
! 'account_lastname' =>
$_POST['account_lastname'],
'account_passwd' =>
$_POST['account_passwd'],
'status' =>
($_POST['account_status'] ? 'A' : ''),
***************
*** 561,571 ****
'homedirectory' =>
$_POST['homedirectory'],
'loginshell' =>
$_POST['loginshell'],
! 'account_expires_month' =>
$_POST['account_expires_month'],
! 'account_expires_day' =>
$_POST['account_expires_day'],
! 'account_expires_year' =>
$_POST['account_expires_year'],
! 'account_expires_never' =>
$_POST['never_expires']
/* 'file_space' =>
$_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
!
if (!$errors = $this->validate_user($userData))
{
--- 594,613 ----
'homedirectory' =>
$_POST['homedirectory'],
'loginshell' =>
$_POST['loginshell'],
! 'account_expires_month' =>
$_POST['account_expires_month'],
! 'account_expires_day' =>
$_POST['account_expires_day'],
! 'account_expires_year' =>
$_POST['account_expires_year'],
! 'account_expires_never' =>
$_POST['never_expires'],
! //jarg-SOG S
! 'domain'
=> $_POST['domain'],
! 'add_addbook' =>
$_POST['add_addbook'],
! 'person_id' =>
$_POST['person_id']
! //End
/* 'file_space' =>
$_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
! if ($_POST['expires'] !== '' &&
!$_POST['never_expires'])
! {
! $jscal =
CreateObject('phpgwapi.jscalendar',False);
! $userData +=
$jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year');
! }
if (!$errors = $this->validate_user($userData))
{
***************
*** 609,613 ****
{
$acl =
CreateObject('phpgwapi.acl',intval($_POST['account_id']));
!
$users =
$GLOBALS['phpgw']->accounts->member($_POST['account_id']);
@reset($users);
--- 651,655 ----
{
$acl =
CreateObject('phpgwapi.acl',intval($_POST['account_id']));
!
$users =
$GLOBALS['phpgw']->accounts->member($_POST['account_id']);
@reset($users);
***************
*** 759,765 ****
--- 801,833 ----
function save_user($_userData)
{
+ //jarg-SOG S
+ $this->contacts = CreateObject('phpgwapi.contacts');
+ $owner = $GLOBALS['phpgw_info']['user']['account_id'];
+ $type = $this->contacts->search_contact_type('Persons');
+ print 'type' . $type;
+
+ $principal = array('owner' => $owner,
+ 'per_prefix' =>
$_userData['account_lid'],
+ 'per_first_name' =>
$_userData['account_firstname'],
+ 'per_last_name' =>
$userData['account_lastname']);
+
+ print 'person_id' . $_userData['person_id'];
+
+ if ($_userData['person_id'] &&
$contacts->exist_contact($_userData['person_id']))
+ {
+ //$contacts->update($_userData['person_id'],
$owner, $fields);
+ }
+ else
+ {
+ print 'vor';
+ $person_id =
$this->contacts->add_contact($type, $principal);
+ $_userData['person_id'] = $person_id;
+ print 'inseret';
+ }
+
$account =
CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
$account->update_data($_userData);
$account->save_repository();
+
if ($_userData['account_passwd'])
{
***************
*** 777,783 ****
if ($_userData['account_permissions'])
{
! while($app =
each($_userData['account_permissions']))
{
! if($app[1])
{
$apps->add($app[0]);
--- 845,851 ----
if ($_userData['account_permissions'])
{
! while($app =
each($_userData['account_permissions']))
{
! if($app[1])
{
$apps->add($app[0]);
***************
*** 802,811 ****
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);
--- 870,879 ----
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);
***************
*** 816,820 ****
}
}
! if ($_userData['anonymous'])
{
$acl->add_repository('phpgwapi','anonymous',$_userData['account_id'],1);
--- 884,888 ----
}
}
! if ($_userData['anonymous'])
{
$acl->add_repository('phpgwapi','anonymous',$_userData['account_id'],1);
***************
*** 824,828 ****
$acl->delete_repository('phpgwapi','anonymous',$_userData['account_id']);
}
! if ($_userData['changepassword'])
{
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1);
--- 892,896 ----
$acl->delete_repository('phpgwapi','anonymous',$_userData['account_id']);
}
! if ($_userData['changepassword'])
{
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1);
Index: class.soaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.soaccounts.inc.php,v
retrieving revision 1.8.2.1.2.2
retrieving revision 1.8.2.1.2.3
diff -C2 -r1.8.2.1.2.2 -r1.8.2.1.2.3
*** class.soaccounts.inc.php 18 May 2003 20:55:40 -0000 1.8.2.1.2.2
--- class.soaccounts.inc.php 8 Sep 2003 13:26:38 -0000 1.8.2.1.2.3
***************
*** 37,41 ****
$userData['account_id'] =
$GLOBALS['phpgw']->accounts->name2id($userData['account_lid']);
!
$apps =
CreateObject('phpgwapi.applications',$userData['account_id']);
$apps->read_installed_apps();
--- 37,41 ----
$userData['account_id'] =
$GLOBALS['phpgw']->accounts->name2id($userData['account_lid']);
!
$apps =
CreateObject('phpgwapi.applications',$userData['account_id']);
$apps->read_installed_apps();
Index: class.uiaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiaccounts.inc.php,v
retrieving revision 1.23.2.9.2.15
retrieving revision 1.23.2.9.2.16
diff -C2 -r1.23.2.9.2.15 -r1.23.2.9.2.16
*** class.uiaccounts.inc.php 7 Sep 2003 09:27:04 -0000 1.23.2.9.2.15
--- class.uiaccounts.inc.php 8 Sep 2003 13:26:38 -0000 1.23.2.9.2.16
***************
*** 9,13 ****
* option) any later version.
*
\**************************************************************************/
- /* $Id$ */
class uiaccounts
--- 9,12 ----
***************
*** 40,48 ****
}
! function row_action($action,$type,$account_id)
{
return '<a
href="'.$GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' =>
'admin.uiaccounts.'.$action.'_'.$type,
! 'account_id' => $account_id
)).'"> '.lang($action).' </a>';
}
--- 39,50 ----
}
! function row_action($action,$type,$account_id,$person_id='')
{
return '<a
href="'.$GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' =>
'admin.uiaccounts.'.$action.'_'.$type,
! 'account_id' => $account_id,
! //jarg-SOG S
! 'person_id' => $person_id
! //End
)).'"> '.lang($action).' </a>';
}
***************
*** 239,243 ****
$total = $GLOBALS['phpgw']->accounts->total;
}
!
$url =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
--- 241,245 ----
$total = $GLOBALS['phpgw']->accounts->total;
}
!
$url =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
***************
*** 259,263 ****
);
$p->set_var($var);
!
if (!
$GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{
--- 261,265 ----
);
$p->set_var($var);
!
if (!
$GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{
***************
*** 314,318 ****
if ($can_delete)
{
!
$p->set_var('row_delete',($GLOBALS['phpgw_info']['user']['userid'] !=
$account['account_lid']?$this->row_action('delete','user',$account['account_id']):' '));
}
else
--- 316,320 ----
if ($can_delete)
{
!
$p->set_var('row_delete',($GLOBALS['phpgw_info']['user']['userid'] !=
$account['account_lid']?$this->row_action('delete','user',$account['account_id'],$account['person_id']):' '));
}
else
***************
*** 450,454 ****
return False;
}
!
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
--- 452,456 ----
return False;
}
!
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
***************
*** 461,467 ****
)
);
$var = Array(
'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.delete_user'),
! 'account_id' => $_GET['account_id']
);
--- 463,473 ----
)
);
+
$var = Array(
'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.delete_user'),
! 'account_id' => $_GET['account_id'],
! //jarg-SOG S
! 'person_id' => $_GET['person_id']
! //End
);
***************
*** 500,504 ****
settype($account_id,'integer');
$account_id =
($_GET['account_id']?$_GET['account_id']:intval($accountid));
!
// todo
// not needed if i use the same file for new groups too
--- 506,510 ----
settype($account_id,'integer');
$account_id =
($_GET['account_id']?$_GET['account_id']:intval($accountid));
!
// todo
// not needed if i use the same file for new groups too
***************
*** 557,561 ****
settype($account_id,'integer');
$account_id = intval($_GET['account_id'] ?
$_GET['account_id'] : $accountid);
!
// todo
// not needed if i use the same file for new users too
--- 563,567 ----
settype($account_id,'integer');
$account_id = intval($_GET['account_id'] ?
$_GET['account_id'] : $accountid);
!
// todo
// not needed if i use the same file for new users too
***************
*** 607,610 ****
--- 613,620 ----
'lang_lastlogin' => lang('Last login'),
'lang_lastloginfrom' => lang('Last login from'),
+ //jarg-SOG S
+ 'lang_add_addbook' => lang('Add to
addressbook'),
+ 'lang_domain' => lang('Domain'),
+ //End
'lang_expires' => lang('Expires')
);
***************
*** 619,622 ****
--- 629,637 ----
$var['account_lastname'] = $userData['lastname'];
+ //jarg-SOG S
+ $var['domain'] = $userData['domain'];
+ $var['add_addbook'] =
$userData['person_id']?' X':' ';
+ //End
+
$acl =
CreateObject('phpgwapi.acl',intval($_GET['account_id']));
$var['anonymous'] =
$acl->check('anonymous',1,'phpgwapi') ? ' X' : ' ';
***************
*** 990,993 ****
--- 1005,1010 ----
$userData['changepassword'] = True;
}
+ $allGroups = $account->get_list('groups');
+
if ($userData['expires'] == -1)
***************
*** 1037,1040 ****
--- 1054,1061 ----
'lang_anonymous' => lang('Anonymous User (not
shown in list sessions)'),
'lang_changepassword' => lang('Can change
password'),
+ //jarg-SOG S
+ 'lang_add_addbook' => lang('Add to
addressbook'),
+ 'lang_domain' => lang('Domain'),
+ //End
'lang_button' =>
($_account_id?lang('Save'):lang('Add'))
/* 'lang_file_space' => lang('File Space') */
***************
*** 1092,1095 ****
--- 1113,1126 ----
$t->set_var($var);
*/
+ //jarg-SOG S
+ $edit_entrie =$GLOBALS['phpgw']->link("/index.php",
+ array(
+ "menuaction" =>
"addressbook.uiaddressbook.edit",
+ "ab_id" =>
$userData['person_id'],
+ "referer"
=>rawurlencode($referer)
+ )
+ );
+ //End
+
$var = Array(
'input_expires' =>
$GLOBALS['phpgw']->common->dateformatorder($_y,$_m,$_d,True),
***************
*** 1103,1108 ****
'changepassword'=> '<input type="checkbox"
name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' :
'').'>',
'account_status' => '<input type="checkbox"
name="account_status" value="A"'.($userData['status']?' checked':'').'>',
! 'account_firstname' => '<input
name="account_firstname" value="' . $userData['firstname'] . '">',
! 'account_lastname' => '<input
name="account_lastname" value="' . $userData['lastname'] . '">',
'account_passwd' => $account_passwd,
'account_passwd_2' => $account_passwd_2,
--- 1134,1145 ----
'changepassword'=> '<input type="checkbox"
name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' :
'').'>',
'account_status' => '<input type="checkbox"
name="account_status" value="A"'.($userData['status']?' checked':'').'>',
! 'account_firstname' => '<input
name="account_firstname" value="' . $userData['account_firstname'] . '">',
! 'account_lastname' => '<input
name="account_lastname" value="' . $userData['account_lastname'] . '">',
! //jarg-SOG S
! 'domain' => '<input name="domain"
value="grupogonher.com">',
! //'add_addbook' => '<input type="checkbox"
name="add_addbook" value="C"' . ($userData['person_id']?' checked>  <a
href=' . $edit_entrie . '>Edit Entrie</a>':'>'),
! 'add_addbook' => $userData['person_id']? '<a
href=' . $edit_entrie . '>Edit Entrie</a>':'',
! 'person_id' => '<input type="hidden"
NAME="person_id" VALUE="' . $userData['person_id'] . '">',
! //End
'account_passwd' => $account_passwd,
'account_passwd_2' => $account_passwd_2,
***************
*** 1127,1137 ****
$groups_select = '';
reset($allGroups);
! while (list($key,$value) = each($allGroups))
{
$groups_select .= '<option value="' .
$value['account_id'] . '"';
! 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'])
{
$groups_select .= ' selected';
--- 1164,1174 ----
$groups_select = '';
reset($allGroups);
! while (list($key,$value) = each($allGroups))
{
$groups_select .= '<option value="' .
$value['account_id'] . '"';
! 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'])
{
$groups_select .= ' selected';
***************
*** 1151,1157 ****
@asort($availableApps);
@reset($availableApps);
! while (list($key,$application) = each($availableApps))
{
! if ($application['enabled'] &&
$application['status'] != 3)
{
$perm_display[$i]['appName'] =
$key;
--- 1188,1194 ----
@asort($availableApps);
@reset($availableApps);
! while (list($key,$application) = each($availableApps))
{
! if ($application['enabled'] &&
$application['status'] != 3)
{
$perm_display[$i]['appName'] =
$key;
***************
*** 1164,1168 ****
$appRightsOutput = '';
// @reset($perm_display);
! for ($i=0;$i<=count($perm_display);$i++)
{
$checked =
((($userData['account_permissions'][$perm_display[$i]['appName']] ||
$db_perms[$perm_display[$i]['appName']]) && $_account_id)?' checked':'');
--- 1201,1205 ----
$appRightsOutput = '';
// @reset($perm_display);
! for ($i=0;$i<=count($perm_display);$i++)
{
$checked =
((($userData['account_permissions'][$perm_display[$i]['appName']] ||
$db_perms[$perm_display[$i]['appName']]) && $_account_id)?' checked':'');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php, 1.22.2.7.2.6, 1.22.2.7.2.7 class.soaccounts.inc.php, 1.8.2.1.2.2, 1.8.2.1.2.3 class.uiaccounts.inc.php, 1.23.2.9.2.15, 1.23.2.9.2.16,
Dave Hall <address@hidden> <=