Exemple #1
0
 function loadHelpers($helperNames, $path = "*", $type = "include_once")
 {
     if (is_array($helperNames)) {
         foreach ($helperNames as $x => $a) {
             $b = loadHelpers($a);
         }
     } else {
         $cachePath = _metaCache("HELPERS", $helperNames);
         if (!$cachePath || !file_exists($cachePath)) {
             $helperPath = helper_exists($helperNames);
         } else {
             $helperPath = $cachePath;
         }
         if (file_exists($helperPath)) {
             if ($type == "require_once") {
                 require_once $helperPath;
             } elseif ($type == "require") {
                 require $helperPath;
             } elseif ($type == "include_once") {
                 include_once $helperPath;
             } else {
                 include $helperPath;
             }
         } else {
             trigger_logikserror("Helper Not Found :: " . $helperNames, E_LOGIKS_ERROR, 404);
         }
     }
 }
Exemple #2
0
function saveFeedback()
{
    $feedback = array('name' => '', 'email' => '', 'subject' => '', 'message' => '', 'userid' => $_SESSION['SESS_USER_ID'], 'blocked' => 'false', 'dtoc' => date('Y-m-d H:i:s'), 'dtoe' => date('Y-m-d H:i:s'));
    foreach ($feedback as $k => $v) {
        if (isset($_POST[$k])) {
            $feedback[$k] = trim($_POST[$k]);
        }
    }
    $sql = _db()->_insertQ1('feedbacks', $feedback);
    $res = _dbQuery($sql);
    $id = _db()->insert_id();
    if ($res) {
        _dbFree($res);
        //send email to admin
        $mailto = "*****@*****.**";
        $mailfrom = "*****@*****.**";
        $feedback_content = array("name" => $_REQUEST['name'], "email" => $_REQUEST['email'], "subject" => $_REQUEST['subject'], "message" => $_REQUEST['message']);
        $template = _template("feedback_admin", $profile);
        loadHelpers('email');
        sendMail($mailto, " Feedback", $template, $mailfrom);
        return "success";
    } else {
        return "error";
    }
}
 public static function setUpBeforeClass()
 {
     if (!defined("PAGE")) {
         define("PAGE", "test1/test2");
     }
     if (!defined("WEBDOMAIN")) {
         define("WEBDOMAIN", "default");
     }
     loadHelpers("urltools");
 }
 public function setUp()
 {
     parent::setUp();
     if (!defined("APPROOT")) {
         define("APPROOT", __DIR__ . "/apps/default/");
     }
     if (!defined("APPS_USERDATA_FOLDER")) {
         define("APPS_USERDATA_FOLDER", "userdata/");
     }
     if (!defined("APPS_CONFIG_FOLDER")) {
         define("APPS_CONFIG_FOLDER", "config/");
     }
     loadHelpers("pathfuncs");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("pwdhash");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("browser");
 }
Exemple #7
0
}
$allSites = explode(",", $d1['sites']);
if ($d1['sites'] == "*") {
    $allSites = getAccessibleSitesArray();
}
if (count($allSites) > 0) {
    $_SESSION['SESS_ACCESS_SITES'] = $allSites;
} else {
    relink("No Accessible Site Found For Your UserID");
}
if (!in_array($domain, $allSites)) {
    relink("Sorry, You [UserID] do not have access to requested site.", $domain);
}
$_ENV['AUTH-DATA'] = array_merge($data, $d1);
$_ENV['AUTH-DATA'] = array_merge($_ENV['AUTH-DATA'], $d2);
loadHelpers("mobility");
$_ENV['AUTH-DATA']['device'] = getUserDeviceType();
$_ENV['AUTH-DATA']['client'] = _server("REMOTE_ADDR");
if (isset($_POST['persistant']) && $_POST['persistant'] == "true") {
    $_ENV['AUTH-DATA']['persistant'] = "true";
} else {
    $_ENV['AUTH-DATA']['persistant'] = "false";
}
$_ENV['AUTH-DATA']['sitelist'] = $allSites;
checkBlockedUser($data, $domain);
checkBlacklists($data, $domain, $dbLink, $userid);
initializeLogin($userid, $domain, $dbLogLink);
//All Functions Required By Authentication System
function relink($msg, $domain)
{
    $_SESSION['SESS_ERROR_MSG'] = $msg;
 public function setUp()
 {
     parent::setUp();
     loadHelpers("formatprint");
 }
Exemple #9
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
checkServiceSession();
loadHelpers("pwdhash");
if (!isset($_REQUEST["type"])) {
    $_REQUEST["type"] = "";
}
if ($_REQUEST["type"] == "dialog") {
    printDialog();
} elseif ($_REQUEST["type"] == "change") {
    changePWD();
} elseif ($_REQUEST["type"] == "generate") {
    loadHelpers("pwdgen");
    $pwd = generatePasswordY(getConfig("PWD_MIN_LENGTH"), 3);
    echo $pwd;
}
exit;
function changePWD()
{
    $userid = $_SESSION["SESS_USER_ID"];
    $tbl = _dbtable("users", true);
    $sql1 = "SELECT pwd FROM {$tbl} WHERE userid='{$userid}'";
    $r = _dbQuery($sql1, true);
    $ra = _dbData($r);
    if (!isset($ra[0])) {
        $q = array("code" => "1", "msg" => "Error In Changing Password (1).");
        echo json_encode($q);
        exit;
Exemple #10
0
function printHeader($ftype, $format, $fname = "file")
{
    if (strtolower($ftype) == "download") {
        $cntrl = true;
    } else {
        $cntrl = false;
    }
    $format = strtolower($format);
    loadHelpers("mimes");
    header("Cache-Control: private");
    header("Pragma: no-cache");
    header("Content-Type: " . getMimeTypeFor($format));
    if ($cntrl) {
        header("Content-Transfer-Encoding: binary");
        header("Content-Description: File Transfer");
        header("Content-Disposition: attachment; filename={$fname}.{$format}");
        header("Content-Type: application/zip");
    }
}
Exemple #11
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
//checkServiceSession();
if (strlen(getConfig("MAIL_ENGINE")) <= 0) {
    LoadConfigFile(ROOT . "config/mail.cfg", "CONFIG");
}
$f2 = APPROOT . getConfig("APPS_CONFIG_FOLDER") . "mail.cfg";
if (file_exists($f2)) {
    LoadConfigFile($f2, "CONFIG");
}
loadHelpers("email");
if (defined("APPS_CACHE_FOLDER")) {
    $destination_path = APPROOT . APPS_CACHE_FOLDER . "mails/";
} else {
    $destination_path = ROOT . CACHE_FOLDER . "mails/";
}
$maxFileSize = "4000000";
$attach = null;
$target_path = "";
$fileSize = -1;
if (!file_exists($destination_path)) {
    mkdir($destination_path, 0777, true);
}
if (!file_exists($destination_path)) {
    //echo "Cache Path Not Found. Can't Send Attachments<br/>";
}
if (isset($_POST['mailto'])) {
    $to = $_POST['mailto'];
 public function setUp()
 {
     parent::setUp();
     loadHelpers("mimes");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("cookies");
     loadHelpers("mobility");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("countries");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("string");
 }
 public function setUp()
 {
     parent::setUp();
     //define("APPROOT",__DIR__."/apps/default/");
     loadHelpers("pathfuncs");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("listarray");
 }
 public function setUp()
 {
     parent::setUp();
     loadHelpers("email");
 }
Exemple #19
0
    require_once 'bootlogiks.php';
    logiksRequestPreboot();
    include_once 'commons.php';
    require_once 'configurator.php';
    loadConfigs([ROOT . "config/basic.cfg", ROOT . "config/php.cfg", ROOT . "config/system.cfg", ROOT . "config/developer.cfg", ROOT . "config/errorlog.cfg", ROOT . "config/security.cfg", ROOT . "config/folders.cfg", ROOT . "config/others.cfg", ROOT . "config/xtras.cfg", ROOT . "config/framework.cfg", ROOT . "config/appPage.cfg"]);
    define('SiteLocation', 'http' . (isset($GLOBALS['LOGIKS']["_SERVER"]['HTTPS']) ? 's' : '') . '://' . "{$GLOBALS['LOGIKS']["_SERVER"]['HTTP_HOST']}/" . InstallFolder);
    if (PRINT_PHP_HEADERS) {
        header("X-Powered-By: " . Framework_Title . " [" . Framework_Site . "]", false);
    }
    require_once ROOT . "api/libs/errorLogs/boot.php";
    LogiksConfig::fixPHPINIConfigs();
    logiksRequestBoot();
    include_once ROOT . "api/libs/logiksCache/boot.php";
    include_once ROOT . "api/libs/loaders/boot.php";
    include_once ROOT . "api/system.php";
    include_once ROOT . "api/security.php";
    include_once ROOT . "api/app.php";
    include_once ROOT . "api/libs/logiksUser/boot.php";
    include_once ROOT . "api/libs/logiksTemplate/boot.php";
    include_once ROOT . "api/libs/logiksPages/boot.php";
    loadHelpers(array("urltools", "hooks", "mobility", "outputbuffer", "shortfuncs"));
    $initialized = true;
    runHooks("postinit");
    $_SESSION['SESS_ACTIVE_SITE'] = SITENAME;
    if (!defined("APPS_NAME")) {
        define("APPS_NAME", getConfig("APPS_NAME"));
    }
    if (!defined("APPS_VERS")) {
        define("APPS_VERS", getConfig("APPS_VERS"));
    }
}
Exemple #20
0
<?php

/*
 * This centralizes the logout operation
 *
 * Author: Bismay Kumar Mohapatra bismay4u@gmail.com
 * Author: Kshyana Prava kshyana23@gmail.com
 * Version: 1.0
 */
define('ROOT', dirname(__FILE__) . '/');
ini_set('display_errors', 'On');
//Start the flow
require_once 'api/initialize.php';
loadHelpers('cookies');
$domain = SITENAME;
if (isset($_REQUEST['site'])) {
    $domain = $_REQUEST['site'];
} elseif (isset($_SESSION['SESS_LOGIN_SITE'])) {
    $domain = $_SESSION['SESS_LOGIN_SITE'];
}
loadLogiksApp($domain);
$relink = "";
if (isset($_REQUEST['relink'])) {
    $relink = $_REQUEST['relink'];
}
// $dbLogLink=LogDB::singleton()->getLogDBCon();
// $q1=$dbLogLink->_updateQ("lgks_log_login",
// 		array('logout_time'=>date('Y-m-d H:i:s'), 'status'=>'LOGGED OUT'),
// 		array(
// 			"user"=>$_SESSION['SESS_USER_ID'],
// 			"status"=>"LOGGED IN",
Exemple #21
0
logiksRequestPreboot();
include_once SERVICE_ROOT . "ServiceAuthEngine.inc";
include_once SERVICE_ROOT . "api.php";
include_once ROOT . "api/configurator.php";
loadConfigs([ROOT . "config/basic.cfg", ROOT . "config/php.cfg", ROOT . "config/system.cfg", ROOT . "config/developer.cfg", ROOT . "config/services.cfg", ROOT . "config/errorlog.cfg", ROOT . "config/security.cfg", ROOT . "config/others.cfg", ROOT . "config/xtras.cfg", ROOT . "config/folders.cfg"]);
LogiksConfig::fixPHPINIConfigs();
define('SiteLocation', 'http' . (_server('HTTPS') ? 's' : '') . '://' . "{_server('HTTP_HOST')}/" . InstallFolder);
require_once ROOT . "api/libs/errorLogs/boot.php";
logiksServiceBoot();
header("X-Powered-By: Logiks [http://openlogiks.org]", false);
header("SESSION-KEY:" . session_id(), false);
header("Access-Control-Allow-Origin:*");
//Origin
//Access-Control-Allow-Methods:OPTIONS,GET,POST,PUT,DELETE
//Access-Control-Allow-Headers:Content-Type, Authorization, X-Requested-With
//header("Access-Control-Allow-Headers", "access-control-allow-origin, accept, access-control-allow-methods, access-control-allow-headers, x-random-shit");
//header("X-Powered-By: ".Framework_Title." [".Framework_Site."]",false);
//print_r($GLOBALS['LOGIKS']["_SERVER"]);exit();
include_once ROOT . "api/libs/logiksCache/boot.php";
include_once ROOT . "api/libs/loaders/boot.php";
include_once ROOT . "api/system.php";
include_once ROOT . "api/security.php";
include_once ROOT . "api/app.php";
include_once ROOT . "api/libs/logiksUser/boot.php";
include_once ROOT . "api/libs/logiksTemplate/boot.php";
include_once SERVICE_ROOT . "ServiceController.inc";
_envData("SESSION", 'SERVICE', true);
_envData("SESSION", 'SESS_ACTIVE_SITE', SITENAME);
ini_set("error_reporting", getConfig("SERVICE_ERROR_REPORTING"));
loadHelpers(array("urltools", "hooks", "mobility", "formatprint", "shortfuncs"));
runHooks("serviceInit");
Exemple #22
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
session_check(true);
_css(array("jquery.tagit"));
_js(array("jquery.tagit", "validator", "jquery.form.min"));
loadHelpers('uicomponents');
loadModule("editor");
loadEditor("cleditor");
if (isset($_REQUEST['refid'])) {
    loadModuleLib('api', 'api');
    $apiDetails = getApiDetails($_REQUEST['refid']);
} else {
    $apiDetails['editable'] = true;
}
if ($apiDetails['editable'] == 'true') {
    ?>
<style>
.cleditorMain {
	height: auto !important;
}
</style>
<div class="container-fluid">
	<div class="row">
		<div class="col-lg-12">

			<form  name="apiForm" id="apiForm" class='apiForm' onsubmit="return validateForm('#apiForm');">
				<input type="hidden" name="id" id="id" value="<?php 
    if (isset($apiDetails['id'])) {
 public static function setUpBeforeClass()
 {
     define("PAGE", "test1/test2");
     loadHelpers("urltools");
 }
Exemple #24
0
<?php

/*
 * This class contains the all User related functionalities
 * 
 * Author: Bismay Kumar Mohapatra bismay4u@gmail.com
 * Version: 1.0
 */
if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
if (!function_exists("getUserList")) {
    loadHelpers("pwdhash");
    function getUserAvatar($params)
    {
        if (is_array($params)) {
            if (isset($params['avatar'])) {
                if (strpos("#" . $params['avatar'], "http://") || strpos("#" . $params['avatar'], "https://")) {
                    return $params['avatar'];
                } elseif (isset($params['avatar_type'])) {
                    return _service("avatar") . "&authorid={$data['avatar']}&method={$data['avatar_type']}";
                } elseif (is_numeric($data['avatar'])) {
                    return _service("avatar") . "&authorid={$data['avatar']}&method=photoid";
                } else {
                    return _service("avatar") . "&authorid={$data['avatar']}&method=email";
                }
            } elseif (isset($params['userid'])) {
                $params = $params['userid'];
            } else {
                return loadMedia("images/user.png");
            }
Exemple #25
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
checkServiceSession();
if (!isset($_REQUEST['datatype'])) {
    $_REQUEST['datatype'] = "json";
}
loadHelpers(array("sqlprint", "sqlsrc"));
loadModuleLib("reports", "jqgrid");
if ($_REQUEST['action'] == "load") {
    $src = "";
    $id = "";
    $tbl = "";
    if (isset($_REQUEST['sqlsrc'])) {
        $src = $_REQUEST['sqlsrc'];
    }
    if (isset($_REQUEST['sqlid'])) {
        $id = $_REQUEST['sqlid'];
    }
    if (isset($_REQUEST['sqltbl'])) {
        $tbl = $_REQUEST['sqltbl'];
    }
    if (!isset($_REQUEST['page'])) {
        $_REQUEST['page'] = "1";
    }
    if (!isset($_REQUEST['rows'])) {
        $_REQUEST['rows'] = "30";
    }
    if (!isset($_REQUEST['sidx'])) {
Exemple #26
0
if (!function_exists("getLocales")) {
    function getLocales()
    {
        include_once ROOT . API_FOLDER . "helpers/countries.php";
        $arr = array();
        $o = getLocaleList();
        foreach ($o as $a => $b) {
            foreach ($b as $e => $r) {
                $arr[$r] = strtolower($a);
            }
        }
        return $arr;
    }
}
if (!function_exists("getLoaderLayouts")) {
    function getLoaderLayouts()
    {
        $arr = array();
        $f = ROOT . PAGES_FOLDER . "loading/";
        $fs = scandir($f);
        unset($fs[0]);
        unset($fs[1]);
        foreach ($fs as $a => $b) {
            $arr[$b] = "loading/" . $b;
        }
        return $arr;
    }
}
if (!function_exists("getPrettyPageLinkStyles")) {
    loadHelpers("prettylink");
}
Exemple #27
0
<?php

/*
 * This centralizes all the system level functions.
 *
 * Author: Bismay Kumar Mohapatra bismay4u@gmail.com
 * Author: Kshyana Prava kshyana23@gmail.com
 * Version: 1.0
 */
if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
if (!function_exists("getRequestTime")) {
    loadHelpers("pathfuncs");
    function redirectTo($relink = null, $carryForwardQuery = true)
    {
        echo "<h5>Redirecting To Application ...</h5>";
        if (substr($relink, 0, 7) == "http://" || substr($relink, 0, 8) == "https://") {
            header("Location:{$relink}");
        } else {
            $relink = getPrettyLink($relink);
            header("Location:{$relink}");
        }
        exit;
    }
    //Quick hack to delete the cookies at runtime and impact tthe system as well.
    function deleteCookies($name)
    {
        setcookie($name, "", time() - 1000000000);
        if (isset($_COOKIE[$name])) {
            unset($_COOKIE[$name]);
Exemple #28
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadHelpers("mimes");
//http://localhost/projects/logiks3/services/?scmd=viewfile&type=view&loc=local&file=z.pdf
//http://localhost/projects/logiks3/services/?scmd=viewfile&type=view&loc=dbfile&dbtbl=do_files&file=1
//http://localhost/projects/logiks3/services/?scmd=viewfile&type=view&loc=dbdoc&dbtbl=doc_crew&file=1
if (isset($_REQUEST['file'])) {
    if (!isset($_REQUEST['loc'])) {
        $_REQUEST['loc'] = "local";
    }
    if (!isset($_REQUEST['type'])) {
        $type = "view";
    } else {
        $type = $_REQUEST['type'];
    }
    if (strtolower($_REQUEST['loc']) == "local") {
        $filename = findMedia($_REQUEST['file']);
        if (file_exists($filename)) {
            if (is_readable($filename)) {
                printHeader($filename, $type);
                printVFile($filename);
                exit;
            } else {
                displayLocalImage("images/forbidden.png", "view");
            }
        } else {
            displayLocalImage("images/warning.png", "view");
        }
Exemple #29
0
 }
 if (isset($_REQUEST["i"])) {
     $i = $_REQUEST["i"];
 } else {
     $i = 0;
 }
 if (isset($_REQUEST["l"])) {
     $l = $_REQUEST["l"];
 } else {
     $l = 1000;
 }
 if (isset($_REQUEST["form"])) {
     $formCols = $_REQUEST["form"];
 }
 if (strlen($where) > 0) {
     loadHelpers("sqlsrc");
     $where = parseSQLWhere($where);
 }
 $colArr = explode(",", $cols);
 $col = $colArr[0];
 $sys = false;
 if (strpos("#" . $tbl, "lgks") == 1) {
     $sys = true;
     if (strlen($where) > 0) {
         $where .= "site='" . SITENAME . "' AND {$where}";
     } else {
         $where .= "site='" . SITENAME . "'";
     }
 }
 if (strlen($formCols) > 0) {
     $cols = $cols . "," . $formCols;