[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.32
From: |
nomail |
Subject: |
[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.32 |
Date: |
Sun, 23 May 2004 06:37:26 -0000 |
Update of /sync/inc
Modified Files:
Branch:
class.bo_sync.inc.php
date: 2004/04/29 19:30:47; author: mkaemmerer; state: Exp; lines: +9 -6
Log Message:
- fixed SwitchUser
=====================================================================
Index: sync/inc/class.bo_sync.inc.php
diff -u sync/inc/class.bo_sync.inc.php:1.31 sync/inc/class.bo_sync.inc.php:1.32
--- sync/inc/class.bo_sync.inc.php:1.31 Wed Apr 28 18:21:03 2004
+++ sync/inc/class.bo_sync.inc.php Thu Apr 29 19:30:47 2004
@@ -78,21 +78,24 @@
function AuthenticateSyncDevice($URI, $username, $password)
{
$deviceid = $this->so->GetDevice($URI, $username, $password);
- $phpgw_accountid = $this->so->GetAccountIDfromUsername($username,
$password);
if ($deviceid >= 0)
{
// device already exists
$ret = $deviceid;
- } else {
- // compare to phpGW username/password -> add device, if user exists
- if ($GLOBALS['phpgw']->auth->authenticate($username, $password,
'text'))
+ } else
+ {
+ // compare to phpGW username/password -> add device, if user exists
+ if ($GLOBALS['phpgw']->auth->authenticate($username, $password,
'text'))
{
+ $account = CreateObject('phpgwapi.accounts');
+ $phpgw_accountid = $account->name2id($username);
$ret = $this->so->AddDevice($phpgw_accountid, $URI, $username,
$password);
} else {
// no user, no device -> return error
$ret = -1;
}
}
+
// switch user if device is authorized and the user is different from
current one
if (($ret >= 0) and ($phpgw_accountid <>
$GLOBALS['phpgw_info']['user']['account_id']))
{
@@ -285,7 +288,7 @@
function SwitchUser($deviceid)
{
$AccountID = $this->so->GetAccountID($deviceid);
-
+
switch ($GLOBALS['phpgw_info']['server']['auth_type']) {
case "ldap":
$account = CreateObject('phpgwapi.accounts', $AccountID, 'u');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.32,
nomail <=