Skip to content
Snippets Groups Projects
Commit bd6b48e0 authored by Aditya's avatar Aditya
Browse files

previous load (load history)

parent 1eea79e6
No related branches found
No related tags found
No related merge requests found
<?php
include_once 'includes/Session.class.php';
include_once 'includes/Mic.class.php';
include_once 'includes/User.class.php';
include_once 'includes/Database.class.php';
include_once 'includes/UserSession.class.php';
global $__site_config;
// global $__base_path;
//Note: Change this path if you run this code outside lab.
/*
Note: Location of configuration
in lab : /home/user/phtogramconfig.json
in server: /var/www/photogramconfig.json
*/
$__site_config_path = dirname(is_link($_SERVER['DOCUMENT_ROOT']) ? readlink($_SERVER['DOCUMENT_ROOT']) : $_SERVER['DOCUMENT_ROOT']).'/photogramconfig.json';
$__site_config = file_get_contents($__site_config_path);
// $__base_path = get_config('base_path');
Session::start();
function get_config($key, $default=null)
{
global $__site_config;
$array = json_decode($__site_config, true);
if (isset($array[$key])) {
return $array[$key];
} else {
return $default;
}
}
function load_template($name)
{
include $_SERVER['DOCUMENT_ROOT'] . get_config('base_path'). "_templates/$name.php"; //not consistant.
}
function validate_credentials($username, $password)
{
if ($username == "sibi@selfmade.ninja" and $password == "password") {
return true;
} else {
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment