Cheetah
modules
cheetah
facebook_connect
classes
ChFaceBookConnectDb.php
Go to the documentation of this file.
1
<?
php
2
8
ch_import
(
'ChWsbConnectDb'
);
9
10
class
ChFaceBookConnectDb
extends
ChWsbConnectDb
11
{
15
function
__construct
(&$oConfig)
16
{
17
parent::__construct($oConfig);
18
}
19
26
function
_processBigNumber
($mValue)
27
{
28
return
preg_replace(
'/[^0-9]/'
,
''
, $mValue);
29
}
30
37
function
getProfileId
($iFbUid)
38
{
39
$iFbUidCopy = (int) $iFbUid;
40
$iFbUid = $this ->
_processBigNumber
($iFbUid);
41
42
43
//-- handle 64 bit number on 32bit system ( will need remove it in a feature version)--//
44
if
($iFbUidCopy != $iFbUid) {
45
//update id
46
$sQuery =
"UPDATE `{$this -> sTablePrefix}accounts` SET `fb_profile` = '{$iFbUid}'
47
WHERE `fb_profile` = '{$iFbUidCopy}'"
;
48
49
$this ->
query
($sQuery);
50
}
51
//--
52
53
//-- new auth method --//
54
$sQuery =
"SELECT `id_profile` FROM `{$this -> sTablePrefix}accounts` WHERE
55
`fb_profile` = '{$iFbUid}' LIMIT 1"
;
56
57
$iProfileId
= $this ->
getOne
($sQuery);
58
//--
59
60
return
$iProfileId
;
61
}
62
70
function
saveRemoteId
(
$iProfileId
, $iFbUid)
71
{
72
$iFbUid = $this ->
_processBigNumber
($iFbUid);
73
$iProfileId
= (int)
$iProfileId
;
74
75
$sQuery =
"REPLACE INTO `{$this -> sTablePrefix}accounts`
76
SET `id_profile` = {$iProfileId}, `fb_profile` = '{$iFbUid}'"
;
77
78
$this ->
query
($sQuery);
79
}
80
87
function
deleteRemoteAccount
(
$iProfileId
)
88
{
89
$iProfileId
= (int)
$iProfileId
;
90
$sQuery =
"DELETE FROM `{$this -> sTablePrefix}accounts`
91
WHERE `id_profile` = {$iProfileId}"
;
92
93
$this ->
query
($sQuery);
94
}
95
}
ChFaceBookConnectDb\getProfileId
getProfileId($iFbUid)
Definition:
ChFaceBookConnectDb.php:37
ChWsbConnectDb
Definition:
ChWsbConnectDb.php:11
ChFaceBookConnectDb\_processBigNumber
_processBigNumber($mValue)
Definition:
ChFaceBookConnectDb.php:26
ch_import
ch_import($sClassName, $aModule=array())
Definition:
utils.inc.php:1218
php
ChFaceBookConnectDb\saveRemoteId
saveRemoteId($iProfileId, $iFbUid)
Definition:
ChFaceBookConnectDb.php:70
ChWsbDb\query
query($sQuery, $aBindings=[])
Definition:
ChWsbDb.php:386
ChWsbDb\getOne
getOne($sQuery, $aBindings=[], $iIndex=0)
Definition:
ChWsbDb.php:263
ChFaceBookConnectDb
Definition:
ChFaceBookConnectDb.php:11
ChFaceBookConnectDb\__construct
__construct(&$oConfig)
Definition:
ChFaceBookConnectDb.php:15
ChFaceBookConnectDb\deleteRemoteAccount
deleteRemoteAccount($iProfileId)
Definition:
ChFaceBookConnectDb.php:87
$iProfileId
if( $sMembersList) $iProfileId
Definition:
communicator.php:29
Generated by
1.8.20