Example #1
0
<?php

require_once 'system/config/constants.php';
require_once 'system/sys_lib/getset.php';
require_once 'system/includes/oauth/OAuth.class.php';
$getset = new GetSet();
//New OAuth with received request code
$oauth = new OAuth($getset->header("code"));
//URL to request auth token
$oauth->authURL('https://app.firmafon.dk/api/v2/token');
//URL for auth callback
$oauth->callbackURL(FIRMAFON_CALLBACK_URL);
//Client/App ID
$oauth->appID(APPLICATION_ID);
//App secret
$oauth->secret(APPLICATION_SECRET);
//Send auth request
if ($oauth->auth()) {
    //print "Success!";
    header("Location: index.php?load=Firmafon&token=" . $oauth->get_token());
} else {
    //print "Nooo..!";
    $oauth->message();
}
Example #2
0
//Includes
require_once 'system/includes/system/Menus.class.php';
require_once 'system/includes/system/Modules.class.php';
require_once 'system/includes/system/Users.class.php';
require_once 'system/includes//system/Settings.class.php';
require_once 'system/includes/system/SendMail.class.php';
require_once 'system/includes/crm/StoresDataLoader.class.php';
$getset = new GetSet();
$db = new MS_SQL(DB_HOST, DB_USER, DB_PASS, DB_DB);
$settings = new Settings($db);
$settings->load();
$levels = $settings->group("access_level");
//Set layout standard value
$getset->setStandardValue("layout", "main");
//Save "load" id and layout to session
$getset->setSession("layout", $getset->header("layout"));
//Create menus. Load with level 0
$sys_users = new Users($db, $getset, $levels);
$sys_menu = new Menus($db, $sys_users->level());
$getset->setStandardValue("load", $sys_menu->menuIdByName("CRM"));
//Test if string has been sent as load value
//fint id of load if string
if (!is_numeric($getset->header("load"))) {
    $load_id = $sys_menu->menuIdByName($getset->header("load"));
} else {
    $load_id = $getset->header("load");
}
$getset->setSession("load", $load_id);
$sys_mods = new Modules($db, $getset->header("load"));
?>
Example #3
0
require_once 'system/config/config.php';
require_once 'system/sys_lib/getset.php';
require_once 'system/sys_lib/mssql.class.php';
require_once 'system/includes/system/Menus.class.php';
require_once 'system/includes/system/Modules.class.php';
require_once 'system/includes/system/MessageFactory.class.php';
require_once 'system/includes/system/POS_API.class.php';
require_once 'system/includes/crm/StoresDataLoader.class.php';
define("API_TYPE_JSON", "json");
$getset = new GetSet();
$db = new MS_SQL(DB_HOST, DB_USER, DB_PASS, DB_DB);
$sys_mods = new Modules($db, 0);
//Handles a new request
//Data in header is store_id=int & pos_num=int
switch ($getset->header("type")) {
    case API_TYPE_JSON:
        $modItem = $sys_mods->get_Unassigned($getset->header("load"));
        $modPath = 'toolbox/' . $modItem['package_folder'] . '/' . $modItem['module_folder'] . '/' . $modItem['module_index'];
        //Test for file
        //Dump err message if not found.
        if (is_file($modPath)) {
            require_once $modPath;
        } else {
            print "Module not found![" . $getset->header("load") . "][" . $modPath . "]";
        }
        break;
    default:
        new POS_API($db, $getset);
        break;
}
Example #4
0
require_once 'system/config/config.php';
require_once 'system/sys_lib/getset.php';
require_once 'system/sys_lib/mssql.class.php';
require_once 'system/includes/system/Menus.class.php';
require_once 'system/includes/system/Modules.class.php';
require_once 'system/includes/system/SendMail.class.php';
require_once 'system/includes/system/MessageFactory.class.php';
require_once 'system/includes/crm/StoresDataLoader.class.php';
$getset = new GetSet();
$db = new MS_SQL(DB_HOST, DB_USER, DB_PASS, DB_DB);
//Create menus. Load with level 0
$sys_menu = new Menus($db, 0);
$sys_mods = new Modules($db, 0);
//Test if string has been sent as load value
//fint id of load if string
if (!is_numeric($getset->header("load"))) {
    $load_id = $sys_menu->menuIdByName($getset->header("load"));
} else {
    $load_id = $getset->header("load");
}
$getset->setSession("load", $load_id);
$modItem = $sys_mods->get_FromId($load_id);
$modPath = 'toolbox/' . $modItem['package_folder'] . '/' . $modItem['module_folder'] . '/' . $modItem['module_index'];
//Test for file
//Dump err message if not found.
if (is_file($modPath)) {
    require_once $modPath;
} elseif ($getset->header("phpinfo") != null) {
    print phpinfo();
} else {
    print "Module not found![" . $load_id . "][" . $modPath . "]";