diff options
Diffstat (limited to 'mod/import.php')
-rw-r--r-- | mod/import.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/mod/import.php b/mod/import.php index 72d8f92e9..02e71233a 100644 --- a/mod/import.php +++ b/mod/import.php @@ -9,11 +9,12 @@ require_once('include/identity.php'); require_once('include/import.php'); -function import_post(&$a) { +function import_account(&$a, $account_id) { - $account_id = get_account_id(); - if(! $account_id) + if(! $account_id){ + logger("import_account: No account ID supplied"); return; + } $max_identities = account_service_class_fetch($account_id,'total_identities'); $max_friends = account_service_class_fetch($account_id,'total_channels'); @@ -122,12 +123,12 @@ function import_post(&$a) { if(array_key_exists('channel',$data)) { if($completed < 1) { - $channel = import_channel($data['channel']); + $channel = import_channel($data['channel'], $account_id); } else { $r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1", - intval(get_account_id()), + intval($account_id), dbesc($channel['channel_guid']) ); if($r) @@ -165,7 +166,7 @@ function import_post(&$a) { if($data['photo']) { require_once('include/photo/photo_driver.php'); - import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],get_account_id(),$channel['channel_id']); + import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],$account_id,$channel['channel_id']); } if(is_array($data['profile'])) @@ -334,7 +335,7 @@ function import_post(&$a) { unset($abook['abook_id']); unset($abook['abook_rating']); unset($abook['abook_rating_text']); - $abook['abook_account'] = get_account_id(); + $abook['abook_account'] = $account_id; $abook['abook_channel'] = $channel['channel_id']; if(! array_key_exists('abook_blocked',$abook)) { $abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0); @@ -493,6 +494,15 @@ function import_post(&$a) { } +function import_post(&$a) { + + $account_id = get_account_id(); + if(! $account_id) + return; + + import_account($a, $account_id); +} + function import_content(&$a) { if(! get_account_id()) { |