mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-10 18:09:30 -04:00
Fixed migration version check
- Login now checks the current db version against the latest migration available and displays the migration update message before login.
This commit is contained in:
committed by
Steve Ireland
parent
6a9b3342d5
commit
70f49ace6f
@@ -24,8 +24,8 @@ class Login extends BaseController
|
||||
$migration = new MY_Migration(config('Migrations'));
|
||||
$data = [
|
||||
'validation' => Services::validation(),
|
||||
'latest_version' => $migration->is_latest(),
|
||||
'application_version' => $migration->get_current_version()
|
||||
'is_latest' => $migration->is_latest(),
|
||||
'latest_version' => $migration->get_last_migration()
|
||||
];
|
||||
|
||||
if($this->request->getMethod() != 'post')
|
||||
@@ -129,4 +129,4 @@ class Login extends BaseController
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @var object $validation
|
||||
* @var bool $is_latest
|
||||
* @var string $latest_version
|
||||
*/
|
||||
helper('form');
|
||||
?>
|
||||
@@ -47,11 +49,11 @@ helper('form');
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /*if(!$latest_version):*/ //TODO: This needs to be uncommented and fixed. CI4 does the latest version check differently, so we need to create a function that assigns a bool to $latest_version and includes it in view $data ?>
|
||||
<?php if(!$is_latest): ?>
|
||||
<div class="alert alert-info mt-3">
|
||||
<?php echo lang('Login.migration_needed', ['version' => config('OSPOS')->settings['application_version']]) ?>
|
||||
<?php echo lang('Login.migration_needed', ['version' => $latest_version]) ?>
|
||||
</div>
|
||||
<?php /*endif;*/ ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty(config('OSPOS')->settings['login_form']) || 'floating_labels'==(config('OSPOS')->settings['login_form'])): ?>
|
||||
<div class="form-floating mt-3">
|
||||
|
||||
Reference in New Issue
Block a user