Skip to content

Version Migrations

Scott Hansen edited this page Nov 4, 2017 · 5 revisions

Migrating Between Versions

v0.1.x → v0.2 and higher

The core/database/db_config.ini file no longer exists and has been moved to the config.ini file. The new file is structured as follows:

; This configuration file is used to configure the settings
; for the system

[database]
host = 10.11.12.21
port = 5432
user = postgres
pass = [Actual Password]
dbname = New_DB

[ldap]
host = 10.11.12.27
port = 389
user_domain = @thecpca.com

Windows Configuration

Uncomment this line in your php.ini file configuration

...
extension=php_ldap.dll          ;uncomment this line 
...

Also copy PHP's libsasl.dll into Apache's bin/ directory. After you do this, make sure to restart your server.

GNU/Linux Configuration

Any devs on Linux will have to perform a workaround. If you're doing a pull request, make sure to change the login.php file back to normal. You'll have to use the old login page, just replace the login code on login.php with the code below.

<?php

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $_SESSION['username'] = $_POST['username'];
    $_SESSION['role'] = Role::Superuser;
    header('Location: ' . BASEURL . '/dashboard');
    die();
} else if (isset($_SESSION['username'])) {
    header('Location: ' . BASEURL . '/dashboard');
}

$hideMenu = true;
include('header.php');

?>

<div class="page-wrapper">
    <div class="jumbotron form-wrapper">
        <form class="form" method="post" action="/login">
            <label for="username">Username</label>
            <input class="form-control username" type="text" name="username">
            <label for="password">Password</label>
            <input class="form-control password" type="password" name="password">
            <div class="form-footer submit">
                <button type="submit" class="btn cpca">Submit</button>
            </div>
        </form>
    </div>
</div>

<?php

include('footer.php');

v0.3.1 → v0.3.2 and higher

The Role.php class has changed it's constant variables to implement a different permission system. If you did not log out before you updated to the new version you still have an old role set in your session. If you get the error redirected you too many times. then you have an old/invalid role.

To fix this either:

  1. clear your browser history
  2. restart your server
  3. destroy the session
    • add session_destroy() to the top of login.php
    • navigate to /login
    • remove session_destroy() from login.php