fix uno import by disabling for now

This commit is contained in:
redmatrix 2016-02-05 23:45:16 -08:00
parent a5c111ef4f
commit 021584d782
2 changed files with 10 additions and 1 deletions

View File

@ -484,7 +484,7 @@ function identity_basic_export($channel_id, $items = false) {
// use constants here as otherwise we will have no idea if we can import from a site
// with a non-standard platform and version.
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION);
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => UNO );
$r = q("select * from channel where channel_id = %d limit 1",
intval($channel_id)

View File

@ -109,6 +109,9 @@ function import_account(&$a, $account_id) {
return;
}
if(UNO)
return;
if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
$v1 = substr($data['compatibility']['database'],-4);
$v2 = substr(DB_UPDATE_VERSION,-4);
@ -116,6 +119,12 @@ function import_account(&$a, $account_id) {
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
notice($t);
}
if(array_key_exists('server_role',$data['compatibility'])
&& $data['compatibility']['server_role'] != UNO) {
notice( t('Server platform is not compatible. Operation not permitted.') . EOL);
return;
}
}
// import channel