diff options
author | zotlabs <mike@macgirvin.com> | 2018-05-01 20:29:07 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-05-01 20:29:07 -0700 |
commit | 7a55ead97db94284146612364b8ce1c59de8771f (patch) | |
tree | ae2226660ee56eafdc8d2d0a95884ed89b2dbb19 /include/import.php | |
parent | cd200ee7064159e4bc253fefe04ddf6ba25d4dde (diff) | |
download | volse-hubzilla-7a55ead97db94284146612364b8ce1c59de8771f.tar.gz volse-hubzilla-7a55ead97db94284146612364b8ce1c59de8771f.tar.bz2 volse-hubzilla-7a55ead97db94284146612364b8ce1c59de8771f.zip |
new feature (post 3.4): allow a different username to be used when importing.
Diffstat (limited to 'include/import.php')
-rw-r--r-- | include/import.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/import.php b/include/import.php index 0d3fb8c32..ae6a0ab6a 100644 --- a/include/import.php +++ b/include/import.php @@ -14,7 +14,7 @@ require_once('include/perm_upgrade.php'); * @param int $seize * @return boolean|array */ -function import_channel($channel, $account_id, $seize) { +function import_channel($channel, $account_id, $seize, $newname = '') { if(! array_key_exists('channel_system',$channel)) { $channel['channel_system'] = (($channel['channel_pageflags'] & 0x1000) ? 1 : 0); @@ -30,6 +30,11 @@ function import_channel($channel, $account_id, $seize) { $channel['channel_hash'] = make_xchan_hash($channel['channel_guid'],$channel['channel_guid_sig']); + if($newname) { + $channel['channel_address'] = $newname; + } + + // Check for duplicate channels $r = q("select * from channel where (channel_guid = '%s' or channel_hash = '%s' or channel_address = '%s' ) limit 1", |