Merge https://github.com/redmatrix/hubzilla into pending_merge
This commit is contained in:
commit
179730e485
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require_once('include/menu.php');
|
require_once('include/menu.php');
|
||||||
|
|
||||||
function import_channel($channel) {
|
function import_channel($channel, $account_id) {
|
||||||
|
|
||||||
if(! array_key_exists('channel_system',$channel)) {
|
if(! array_key_exists('channel_system',$channel)) {
|
||||||
$channel['channel_system'] = (($channel['channel_pageflags'] & 0x1000) ? 1 : 0);
|
$channel['channel_system'] = (($channel['channel_pageflags'] & 0x1000) ? 1 : 0);
|
||||||
@ -48,7 +48,7 @@ function import_channel($channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unset($channel['channel_id']);
|
unset($channel['channel_id']);
|
||||||
$channel['channel_account_id'] = get_account_id();
|
$channel['channel_account_id'] = $account_id;
|
||||||
$channel['channel_primary'] = (($seize) ? 1 : 0);
|
$channel['channel_primary'] = (($seize) ? 1 : 0);
|
||||||
|
|
||||||
if($channel['channel_pageflags'] & PAGE_ALLOWCODE) {
|
if($channel['channel_pageflags'] & PAGE_ALLOWCODE) {
|
||||||
@ -72,7 +72,7 @@ function import_channel($channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
|
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
|
||||||
intval(get_account_id()),
|
intval($account_id),
|
||||||
$channel['channel_guid'] // Already dbesc'd
|
$channel['channel_guid'] // Already dbesc'd
|
||||||
);
|
);
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
@ -83,7 +83,7 @@ function import_channel($channel) {
|
|||||||
// reset
|
// reset
|
||||||
$channel = $r[0];
|
$channel = $r[0];
|
||||||
|
|
||||||
set_default_login_identity(get_account_id(),$channel['channel_id'],false);
|
set_default_login_identity($account_id,$channel['channel_id'],false);
|
||||||
logger('import step 1');
|
logger('import step 1');
|
||||||
$_SESSION['import_step'] = 1;
|
$_SESSION['import_step'] = 1;
|
||||||
ref_session_write(session_id(), serialize($_SESSION));
|
ref_session_write(session_id(), serialize($_SESSION));
|
||||||
|
@ -123,12 +123,12 @@ function import_account(&$a, $account_id) {
|
|||||||
if(array_key_exists('channel',$data)) {
|
if(array_key_exists('channel',$data)) {
|
||||||
|
|
||||||
if($completed < 1) {
|
if($completed < 1) {
|
||||||
$channel = import_channel($data['channel']);
|
$channel = import_channel($data['channel'], $account_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
|
$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'])
|
dbesc($channel['channel_guid'])
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
@ -166,7 +166,7 @@ function import_account(&$a, $account_id) {
|
|||||||
|
|
||||||
if($data['photo']) {
|
if($data['photo']) {
|
||||||
require_once('include/photo/photo_driver.php');
|
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']))
|
if(is_array($data['profile']))
|
||||||
@ -335,7 +335,7 @@ function import_account(&$a, $account_id) {
|
|||||||
unset($abook['abook_id']);
|
unset($abook['abook_id']);
|
||||||
unset($abook['abook_rating']);
|
unset($abook['abook_rating']);
|
||||||
unset($abook['abook_rating_text']);
|
unset($abook['abook_rating_text']);
|
||||||
$abook['abook_account'] = get_account_id();
|
$abook['abook_account'] = $account_id;
|
||||||
$abook['abook_channel'] = $channel['channel_id'];
|
$abook['abook_channel'] = $channel['channel_id'];
|
||||||
if(! array_key_exists('abook_blocked',$abook)) {
|
if(! array_key_exists('abook_blocked',$abook)) {
|
||||||
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0);
|
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0);
|
||||||
|
Reference in New Issue
Block a user