function __destruct()
 {
     if ($this->bitCacheSaveRequired && class_config::getInstance()->getConfig('resourcecaching') == true) {
         class_apc_cache::getInstance()->addValue(__CLASS__ . "classes", $this->arrClassCache);
         file_put_contents($this->strObjectsCacheFile, serialize($this->arrClassCache));
     }
 }
Beispiel #2
0
 public function __destruct()
 {
     //save cache to apc
     if ($this->bitSaveToCacheRequired) {
         $this->objApcCache->addValue("templateSessionCacheTemplate", $this->arrCacheTemplates, class_config::getInstance()->getConfig("templatecachetime"));
         $this->objApcCache->addValue("templateSessionCacheTemplateSections", $this->arrCacheTemplateSections, class_config::getInstance()->getConfig("templatecachetime"));
     }
 }
 /**
  * internal destructor
  */
 function __destruct()
 {
     if (self::$bitCacheSaveRequired && class_config::getInstance()->getConfig('resourcecaching') == true) {
         class_apc_cache::getInstance()->addValue("reflection", self::$arrAnnotationsCache);
         file_put_contents(self::$strAnnotationsCacheFile, serialize(self::$arrAnnotationsCache));
         self::$bitCacheSaveRequired = false;
     }
 }
Beispiel #4
0
 public function __destruct()
 {
     //save texts to session
     if ($this->bitSaveToCache) {
         class_apc_cache::getInstance()->addValue("textSessionCache", $this->arrTexts, class_config::getInstance()->getConfig("textcachetime"));
         class_apc_cache::getInstance()->addValue("textSessionFallbackCache", $this->arrFallbackTextEntrys, class_config::getInstance()->getConfig("textcachetime"));
     }
 }
Beispiel #5
0
 /**
  * Returns instances for each configured ldap source
  *
  * @return class_ldap[]
  */
 public static function getAllInstances()
 {
     if (self::$arrInstances == null) {
         $intI = 0;
         while (is_array(class_config::getInstance("ldap.php")->getConfig($intI))) {
             self::$arrInstances[$intI] = new class_ldap($intI);
             $intI++;
         }
     }
     return self::$arrInstances;
 }
 /**
  * Stores the currently cached entries back to the filesystem - if required.
  */
 public function __destruct()
 {
     if ($this->bitCacheSaveRequired && class_config::getInstance()->getConfig('resourcecaching') == true) {
         class_apc_cache::getInstance()->addValue(__CLASS__ . "templates", $this->arrTemplates);
         class_apc_cache::getInstance()->addValue(__CLASS__ . "foldercontent", $this->arrFoldercontent);
         class_apc_cache::getInstance()->addValue(__CLASS__ . "langfiles", $this->arrLangfiles);
         file_put_contents($this->strTemplatesCacheFile, serialize($this->arrTemplates));
         file_put_contents($this->strFoldercontentCacheFile, serialize($this->arrFoldercontent));
         file_put_contents($this->strFoldercontentLangFile, serialize($this->arrLangfiles));
     }
 }
 public function getSystemParameter()
 {
     $strHeaderName = class_config::readPlainConfigsFromFilesystem("https_header");
     $strHeaderValue = strtolower(class_config::readPlainConfigsFromFilesystem("https_header_value"));
     $arrSystemParameter = array();
     $arrSystemParameter["SCHEME"] = isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https" : "http";
     $arrSystemParameter["HOSTNAME"] = $_SERVER['SERVER_NAME'];
     $strRequestUri = $_SERVER['REQUEST_URI'];
     $path_parts = pathinfo($strRequestUri);
     $arrSystemParameter["URLPATHNAME"] = $path_parts['dirname'];
     if ($arrSystemParameter["URLPATHNAME"][0] == "/") {
         $arrSystemParameter["URLPATHNAME"] = uniSubstr($arrSystemParameter["URLPATHNAME"], 1);
     }
     return $arrSystemParameter;
 }
 /**
  * Returns the contents of the info-block
  *
  * @return mixed
  */
 public function getArrContent()
 {
     $objLang = class_carrier::getInstance()->getObjLang();
     $arrReturn = array();
     $arrTables = class_carrier::getInstance()->getObjDB()->getTables(true);
     $intSizeData = 0;
     $intSizeIndex = 0;
     switch (class_config::getInstance()->getConfig("dbdriver")) {
         case "mysqli":
         case "mysql":
             foreach ($arrTables as $arrTable) {
                 if (isset($arrTable["Data_length"])) {
                     $intSizeData += $arrTable["Data_length"];
                 }
                 if (isset($arrTable["Index_length"])) {
                     $intSizeIndex += $arrTable["Index_length"];
                 }
             }
             $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo();
             $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]);
             $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]);
             $arrReturn[] = array($objLang->getLang("datenbankclient", "system"), $arrInfo["dbclient"]);
             $arrReturn[] = array($objLang->getLang("datenbankverbindung", "system"), $arrInfo["dbconnection"]);
             $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables));
             $arrReturn[] = array($objLang->getLang("groessegesamt", "system"), bytesToString($intSizeData + $intSizeIndex));
             $arrReturn[] = array($objLang->getLang("groessedaten", "system"), bytesToString($intSizeData));
             break;
         case "postgres":
             $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo();
             $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]);
             $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]);
             $arrReturn[] = array($objLang->getLang("datenbankclient", "system"), $arrInfo["dbclient"]);
             $arrReturn[] = array($objLang->getLang("datenbankverbindung", "system"), $arrInfo["dbconnection"]);
             $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables));
             $arrReturn[] = array($objLang->getLang("groessegesamt", "system"), bytesToString($intSizeData + $intSizeIndex));
             $arrReturn[] = array($objLang->getLang("groessedaten", "system"), bytesToString($intSizeData));
             break;
         default:
             $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo();
             $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]);
             $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]);
             $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables));
             break;
     }
     return $arrReturn;
 }
Beispiel #9
0
 protected function setUp()
 {
     $this->arrTestStartDate = gettimeofday();
     if (!defined("_block_config_db_loading_")) {
         define("_block_config_db_loading_", true);
     }
     if (!defined("_autotesting_")) {
         define("_autotesting_", true);
     }
     if (!defined("_autotesting_sqlite_checks_")) {
         if (class_config::getInstance("config.php")->getConfig("dbdriver") == "sqlite3") {
             class_db::getInstance()->_pQuery("PRAGMA journal_mode = MEMORY", array());
         }
         define("_autotesting_sqlite_checks_", true);
     }
     class_carrier::getInstance()->flushCache(class_carrier::INT_CACHE_TYPE_APC | class_carrier::INT_CACHE_TYPE_DBQUERIES);
     parent::setUp();
 }
Beispiel #10
0
 /**
  * Constructor
  */
 private function __construct()
 {
     $this->objConfig = class_config::getInstance();
     //Load the defined db-driver
     $strDriver = $this->objConfig->getConfig("dbdriver");
     if ($strDriver != "%%defaultdriver%%") {
         //build a class-name & include the driver
         $strClassname = "class_db_" . $strDriver;
         if (class_exists($strClassname)) {
             $this->objDbDriver = new $strClassname();
         } else {
             throw new class_exception("db-driver " . $strClassname . " could not be loaded", class_exception::$level_FATALERROR);
         }
     } else {
         //Do not throw any exception here, otherwise an endless loop will exit with an overloaded stack frame
         //throw new class_exception("No db-driver defined!", class_exception::$level_FATALERROR);
     }
 }
Beispiel #11
0
<?
	//START OUR USER SESSION
		session_start();
	//INCLUDE BASE
		require 'includes/functions_common.php';
		require 'scripts/fck/fckeditor.php';
		require 'class/class_config.php';			
		require 'class/class_adminuser.php';			
		require 'class/class_db.php';	
		require 'class/class_time.php';
	//CREATE OUR CONFIG
		$cfg = new class_config();
	//CREATE OUR DATABASE
		$db = new class_db($cfg->db_host,$cfg->db_name,$cfg->db_user,$cfg->db_pass);
	//CONNECT TO OUR DATABASE
		$database_connection = $db->DB_CONNECT();
	//CHECK TO SEE IF THE BOOTY IS INSTALLED CORRECTLY
	if($cfg->check_install()){
		//GRAB PID - TELLS US WHAT MODULE WE ARE WORKING WITH
			if(!isset($_REQUEST['pid'])){
				$pid = 1;
			}else{
				$pid = $_REQUEST['pid'];
			}
		//GRAB CID - TELLS US WHAT SECTION OF THE MODULE WE ARE WORKING WITH
			if(!isset($_REQUEST['cid'])){
				$cid = 0;
			}else{
				$cid = $_REQUEST['cid'];
			}
		//GRAB THEID IF THERE IS ANY
 /**
  * Saves the memberships passed by param
  *
  * @return string "" in case of success
  * @permissions edit
  */
 protected function actionSaveMembership()
 {
     $objUser = new class_module_user_user($this->getSystemid());
     $objUsersources = new class_module_user_sourcefactory();
     $objSourcesytem = $objUsersources->getUsersource($objUser->getStrSubsystem());
     $arrGroups = $objSourcesytem->getAllGroupIds();
     $arrUserGroups = $objUser->getArrGroupIds();
     //validate possible blocked groups
     $objConfig = class_config::getInstance("blockedgroups.php");
     $arrBlockedGroups = explode(",", $objConfig->getConfig("blockedgroups"));
     //Searching for groups to enter
     foreach ($arrGroups as $strSingleGroup) {
         $objGroup = new class_module_user_group($strSingleGroup);
         //skipped for blocked groups, those won't be updated
         if (!$this->isGroupEditable($objGroup)) {
             continue;
         }
         if ($this->getParam($strSingleGroup) != "") {
             //add the user to this group
             if (!in_array($strSingleGroup, $arrUserGroups)) {
                 $objGroup->getObjSourceGroup()->addMember($objUser->getObjSourceUser());
             } else {
                 //user is already in the group, remove the marker
                 foreach ($arrUserGroups as $strKey => $strValue) {
                     if ($strValue == $strSingleGroup) {
                         $arrUserGroups[$strKey] = null;
                     }
                 }
             }
         }
     }
     //check, if the current user is member of the admin-group.
     //if not, remain the admin-group as-is
     if (!class_carrier::getInstance()->getObjSession()->isSuperAdmin()) {
         $intKey = array_search(class_module_system_setting::getConfigValue("_admins_group_id_"), $arrUserGroups);
         if ($intKey !== false) {
             $arrUserGroups[$intKey] = null;
         }
         foreach ($arrBlockedGroups as $strOneGroup) {
             $intKey = array_search($strOneGroup, $arrUserGroups);
             if ($intKey !== false) {
                 $arrUserGroups[$intKey] = null;
             }
         }
     }
     //loop the users' list in order to remove unwanted relations
     foreach ($arrUserGroups as $strValue) {
         if (validateSystemid($strValue)) {
             $objGroup = new class_module_user_group($strValue);
             $objGroup->getObjSourceGroup()->removeMember($objUser->getObjSourceUser());
         }
     }
     if ($this->getParam("folderview")) {
         $this->adminReload(class_link::getLinkAdminHref($this->getArrModule("modul"), "list", "&peClose=1&blockAction=1"));
     } else {
         $this->adminReload(class_link::getLinkAdminHref($this->getArrModule("modul"), "list"));
     }
 }
Beispiel #13
0
 /**
  * Managing access to the config object. Use ONLY this method to
  * get an instance!
  *
  * @return class_config
  */
 public function getObjConfig()
 {
     //Do we have to generate the object?
     if ($this->objConfig == null) {
         $this->objConfig = class_config::getInstance();
         //Loading the config-Files
         //Invocation removed, all configs from database
         //$this->objConfig->loadConfigsFilesystem();
     }
     return $this->objConfig;
 }
Beispiel #14
0
    rawIncludeError(_corepath_ . "/module_system/system/functions.php");
}
//Exception-Handler
if (!@(include_once _corepath_ . "/module_system/system/class_exception.php")) {
    rawIncludeError("global exception handler");
}
//register global exception handler for exceptions thrown but not catched (bad style ;) )
@set_exception_handler(array("class_exception", "globalExceptionHandler"));
//Include the logging-engine
if (!@(include_once _corepath_ . "/module_system/system/class_logger.php")) {
    rawIncludeError("logging engine");
}
//---The Path on web-------------------------------------------------------------------------------------
require_once _corepath_ . "/module_system/system/class_config.php";
$strHeaderName = class_config::readPlainConfigsFromFilesystem("https_header");
$strHeaderValue = strtolower(class_config::readPlainConfigsFromFilesystem("https_header_value"));
if (strpos($_SERVER['SCRIPT_FILENAME'], "/debug/")) {
    //Determine the current path on the web
    $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']);
    define("_webpath_", saveUrlEncode(substr_replace($strWeb, "", strrpos($strWeb, "/"))));
} else {
    //Determine the current path on the web
    $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "localhost") . $_SERVER['SCRIPT_NAME']);
    define("_webpath_", saveUrlEncode($strWeb));
}
//---Include Section 2-----------------------------------------------------------------------------------
//load module-ids
bootstrapIncludeModuleIds();
//---Auto-Loader for classes-----------------------------------------------------------------------------
require_once _corepath_ . "/module_system/system/class_classloader.php";
spl_autoload_register(array(class_classloader::getInstance(), "loadClass"));
 /**
  * Returns all content-providers as configured in the /config/packagemanager.php file.
  *
  * @return interface_packagemanager_contentprovider[]
  */
 public function getContentproviders()
 {
     $objConfig = class_config::getInstance("packagemanager.php");
     $strProvider = $objConfig->getConfig("contentproviders");
     $arrProviders = explode(",", $strProvider);
     $arrReturn = array();
     foreach ($arrProviders as $strOneProvider) {
         $strOneProvider = trim($strOneProvider);
         if ($strOneProvider != "") {
             $arrReturn[] = new $strOneProvider();
         }
     }
     return $arrReturn;
 }
 public function testStaticReader()
 {
     $this->assertEquals(class_config::readPlainConfigsFromFilesystem("https_header"), "HTTPS");
 }
 /**
  * Returns a input-file element
  *
  * @param string $strName
  * @param string $strTitle
  * @param string $strClass
  *
  * @return string
  */
 public function formInputUpload($strName, $strTitle = "", $strClass = "")
 {
     $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "input_upload");
     $arrTemplate = array();
     $arrTemplate["name"] = $strName;
     $arrTemplate["title"] = $strTitle;
     $arrTemplate["class"] = $strClass;
     $objText = class_carrier::getInstance()->getObjLang();
     $arrTemplate["maxSize"] = $objText->getLang("max_size", "mediamanager") . " " . bytesToString(class_config::getInstance()->getPhpMaxUploadSize());
     return $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID);
 }
Beispiel #18
0
<?php

session_start();
$conn = mysql_connect("@mysql_host@", "@mysql_username@", "@mysql_password@");
mysql_select_db("@database_name@") or die(mysql_error());
$hashcode = "app2023113pre2014";
$db_prefix = "app_";
$url_i = str_replace("install", "", getcwd());
define('APP_PATH', '@server_domain@');
define('APP_WEBSITE', '@server_domain@');
define('CLASSES_PATH', 'app_classes');
define('ROOT', '@root@');
define('DB_PREFIX', "app_");
$version = "V.2.0";
$date = date("Y-m-d");
require_once ROOT . '/app_classes/module_users.inc';
require_once ROOT . '/app_classes/module_config.inc';
$config = new class_config();
require_once ROOT . "/languages_data/" . $config->get_value('language');
$logged = new class_users($_SESSION[unique]);
$host = $_SERVER['HTTP_HOST'];
$self = $_SERVER['PHP_SELF'];
$ip = $_SERVER['REMOTE_ADDR'];
Beispiel #19
0
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*   $Id$                                     *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| Checks the connection to the configured ldap servers                          |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
$intI = 0;
foreach (class_ldap::getAllInstances() as $objOneLdap) {
    $arrCfg = class_config::getInstance("ldap.php")->getConfig($objOneLdap->getIntCfgNr());
    echo "Connecting to ldap at " . $arrCfg["ldap_server"] . "\n";
    echo "Searching for bind-user " . $arrCfg["ldap_bind_username"] . "\n";
    $arrUser = $objOneLdap->getUserdetailsByName($arrCfg["ldap_bind_username"]);
    var_dump($arrUser);
    echo "Loading user by DN\n";
    $arrUser = $objOneLdap->getUserDetailsByDN($arrUser[0]["identifier"]);
    var_dump($arrUser);
    //    echo "Loading groups for user\n";
    //    var_dump($objOneLdap->getMembersOfGroup("CN=Entwickler,OU=Gruppen,DC=ad,DC=artemeon,DC=int"));
    //    var_dump($objOneLdap->getNumberOfGroupMembers("CN=Entwickler,OU=Gruppen,DC=ad,DC=artemeon,DC=int"));
}
echo "\n\n";
echo "+-------------------------------------------------------------------------------+\n";
echo "| (c) www.kajona.de                                                             |\n";
echo "+-------------------------------------------------------------------------------+\n";
 /**
  * Validates whether the current module/element is removable or not.
  * This is the place to trigger special validations and consistency checks going
  * beyond the common metadata-dependencies.
  *
  * @return bool
  */
 public function isRemovable()
 {
     return uniStrpos(class_config::getInstance()->getConfig("loginproviders"), "ldap") === false;
 }
 /**
  * Removes marks from the text
  * @return void
  */
 private function clearmarks()
 {
     $arrMarks = class_config::getInstance("search_blacklist.php")->getConfig("marks_list");
     $this->setText(uniStrReplace($arrMarks, "", html_entity_decode($this->getText())));
 }