Index: trunk/core/kernel/startup.php
===================================================================
diff -u -r3576 -r3863
--- trunk/core/kernel/startup.php (.../startup.php) (revision 3576)
+++ trunk/core/kernel/startup.php (.../startup.php) (revision 3863)
@@ -27,9 +27,7 @@
global $rootURL;
echo 'In-Portal is probably not installed, or configuration file is missing.
';
echo 'Please use the installation script to fix the problem.
';
- if ( !preg_match('/admin/', __FILE__) ) $ins = '/admin';
-
- echo 'Go to installation script
';
+ echo 'Go to installation script
';
flush();
exit;
}
Index: trunk/core/kernel/application.php
===================================================================
diff -u -r3858 -r3863
--- trunk/core/kernel/application.php (.../application.php) (revision 3858)
+++ trunk/core/kernel/application.php (.../application.php) (revision 3863)
@@ -477,7 +477,7 @@
{
if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
{
- $GLOBALS['debugger']->appendMemoryUsage('Application before Run:');
+ $this->Debugger->appendMemoryUsage('Application before Run:');
}
if (!$this->RequestProcessed) $this->ProcessRequest();
@@ -501,14 +501,14 @@
if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
{
- $GLOBALS['debugger']->appendMemoryUsage('Application before Parsing:');
+ $this->Debugger->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->Parse( $template_cache->GetTemplateBody($t), $t );
if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
{
- $GLOBALS['debugger']->appendMemoryUsage('Application after Parsing:');
+ $this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
@@ -528,7 +528,7 @@
{
if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') )
{
- $GLOBALS['debugger']->appendMemoryUsage('Application before Done:');
+ $this->Debugger->appendMemoryUsage('Application before Done:');
}
if( $this->GetVar('admin') )
@@ -796,12 +796,12 @@
// because this template closes the popup and we don't need popup mark here anymore
$params['m_opener'] = 's';
}
-
+
if( substr($t, -4) == '.tpl' ) $t = substr($t, 0, strlen($t) - 4 );
if ( $this->IsAdmin() && $prefix == '') $prefix = '/admin';
if ( $this->IsAdmin() && $prefix == '_FRONT_END_') $prefix = '';
- $index_file = isset($index_file) ? $index_file : (defined('INDEX_FILE') ? INDEX_FILE : basename($_SERVER['SCRIPT_NAME']));
+ $index_file = isset($index_file) ? $index_file : (defined('INDEX_FILE') ? INDEX_FILE : basename($_SERVER['PHP_SELF']));
if( isset($params['index_file']) )
{
@@ -1675,6 +1675,18 @@
{
return $this->InitDone && (count($this->ModuleInfo) > 0);
}
+
+ /**
+ * Retuns true if module is enabled
+ *
+ * @param string $module_name
+ * @return bool
+ */
+ /*function isModuleEnabled($module_name)
+ {
+ return getArrayValue($this->ModuleInfo, $module_name, 'Loaded');
+
+ }*/
}
Index: trunk/core/kernel/globals.php
===================================================================
diff -u -r3543 -r3863
--- trunk/core/kernel/globals.php (.../globals.php) (revision 3543)
+++ trunk/core/kernel/globals.php (.../globals.php) (revision 3863)
@@ -304,7 +304,7 @@
* @param unknown_type $post
* @return unknown
*/
- function curl_post($url, $post)
+ function curl_post($url, $post, $headers=null)
{
if( is_array($post) )
{
@@ -314,13 +314,19 @@
}
$ch = curl_init($url);
+
+ if (!is_null($headers)) {
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+ }
+
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER, PROTOCOL.SERVER_NAME);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$ret = curl_exec($ch);
curl_close($ch);
@@ -394,7 +400,7 @@
{
return round(($pounds + ($ounces / 16)) * POUND_TO_KG, 5);
}
-
+
/**
* Formats file/memory size in nice way
*
@@ -423,7 +429,7 @@
$return .= ' '.$suffix;
return $return;
}
-
+
/**
* Enter description here...
*
Index: trunk/core/kernel/utility/temp_handler.php
===================================================================
diff -u -r3845 -r3863
--- trunk/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 3845)
+++ trunk/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 3863)
@@ -27,7 +27,15 @@
var $CopiedTables = Array();
+
/**
+ * IDs of newly cloned items (key - prefix.special, value - array of ids)
+ *
+ * @var Array
+ */
+ var $savedIDs = Array();
+
+ /**
* Description
*
* @var kDBConnection
@@ -49,6 +57,11 @@
$this->MasterTable = $tables['TableName'];
}
+ function saveID($prefix, $special = '', $id = null)
+ {
+ $this->savedIDs[$prefix.($special ? '.' : '').$special][] = $id;
+ }
+
/**
* Get temp table name
*
@@ -173,18 +186,15 @@
function CloneItems($prefix, $special, $ids, $master=null, $foreign_key=null, $parent_prefix = null)
{
if (!isset($master)) $master = $this->Tables;
- if( strpos($prefix,'.') !== false ) list($prefix,$special) = explode('.', $prefix, 2);
- $prefix_special = rtrim($prefix.'.'.$special, '.');
+ // recalling by different name, because we may get kDBList, if we recall just by prefix
+ if (!preg_match('/(.*)-item$/', $special)) {
+ $special .= '-item';
+ }
+
+ $object =& $this->Application->recallObject($prefix.'.'.$special, $prefix, Array('skip_autoload' => true));
- //recalling by different name, because we may get kDBList, if we recall just by prefix
- $recall_prefix = $prefix_special.($special ? '' : '.').'-item';
- $this->Application->setUnitOption($prefix, 'AutoLoad', false);
-
- $object =& $this->Application->recallObject($recall_prefix, $prefix);
-
- foreach ($ids as $id)
- {
+ foreach ($ids as $id) {
$mode = 'create';
if ( $cloned_ids = getArrayValue($this->AlreadyProcessed, $master['TableName']) ) {
// if we have already cloned the id, replace it with cloned id and set mode to update
@@ -206,20 +216,21 @@
}
if ($mode == 'create') {
- $this->RaiseEvent('OnBeforeClone', $master['Prefix'], Array($object->GetId()), $foreign_key);
+ $this->RaiseEvent('OnBeforeClone', $master['Prefix'], $special, Array($object->GetId()), $foreign_key);
}
$res = $mode == 'update' ? $object->Update() : $object->Create();
- if( $res )
+ if ($res)
{
if ( $mode == 'create' && is_array( getArrayValue($master, 'ForeignKey')) ) {
// remember original => clone mapping for dual ForeignKey updating
$this->AlreadyProcessed[$master['TableName']][$id] = $object->GetId();
}
if($object->mode == 't') $object->setTempID();
if ($mode == 'create') {
- $this->RaiseEvent('OnAfterClone', $master['Prefix'], Array($object->GetId()), $foreign_key, array('original_id' => $id) );
+ $this->RaiseEvent('OnAfterClone', $master['Prefix'], $special, Array($object->GetId()), $foreign_key, array('original_id' => $id) );
+ $this->saveID($master['Prefix'], $special, $object->GetID());
}
if ( is_array(getArrayValue($master, 'SubTables')) ) {
@@ -248,11 +259,13 @@
$parent_key = $object->GetDBField($parent_key_field);
- $this->CloneItems($sub_table['Prefix'], '', $sub_ids, $sub_table, $parent_key, $master['Prefix']);
+ $this->CloneItems($sub_table['Prefix'], $special, $sub_ids, $sub_table, $parent_key, $master['Prefix']);
}
}
}
}
+
+ return $this->savedIDs[$prefix.($special ? '.' : '').$special];
}
function DeleteItems($prefix, $special, $ids, $master=null, $foreign_key=null)
@@ -339,7 +352,7 @@
$query = 'SELECT '.$master['IdField'].' FROM '.$master['TableName'].'
WHERE '.$key_field.' IN ('.$ids.')';
if (isset($master['Constrain'])) $query .= ' AND '.$master['Constrain'];
- $this->RaiseEvent( 'OnAfterCopyToTemp', $master['Prefix'], $this->Conn->GetCol($query) );
+ $this->RaiseEvent( 'OnAfterCopyToTemp', $master['Prefix'], '', $this->Conn->GetCol($query) );
}
if ( getArrayValue($master, 'SubTables') ) {
@@ -435,7 +448,7 @@
// delete all ids from live table - for MasterTable ONLY!
// because items from Sub Tables get deteleted in CopySubTablesToLive !BY ForeignKey!
if ($master['TableName'] == $this->MasterTable) {
- $this->RaiseEvent( 'OnBeforeDeleteFromLive', $master['Prefix'], $current_ids );
+ $this->RaiseEvent( 'OnBeforeDeleteFromLive', $master['Prefix'], '', $current_ids );
$query = 'DELETE FROM '.$master['TableName'].' WHERE '.$master['IdField'].' IN ('.join(',', $current_ids).')';
$this->Conn->Query($query);
@@ -446,7 +459,7 @@
foreach($current_ids AS $id)
{
- $this->RaiseEvent( 'OnBeforeCopyToLive', $master['Prefix'], Array($id) );
+ $this->RaiseEvent( 'OnBeforeCopyToLive', $master['Prefix'], '', Array($id) );
//reset negative ids to 0, so autoincrement in live table works fine
if($id < 0)
@@ -470,7 +483,7 @@
$this->Conn->Query($query);
$insert_id = $id_to_copy == 0 ? $this->Conn->getInsertID() : $id_to_copy;
- $this->RaiseEvent( 'OnAfterCopyToLive', $master['Prefix'], Array($insert_id), null, array('temp_id' => $id) );
+ $this->RaiseEvent( 'OnAfterCopyToLive', $master['Prefix'], '', Array($insert_id), null, array('temp_id' => $id) );
$this->UpdateForeignKeys($master, $insert_id, $id);
@@ -489,7 +502,7 @@
elseif( !in_array($table_sig, $this->CopiedTables) && ($this->FinalRefs[$table_sig] == $master['TableId']) ) { //If current master doesn't have sub-tables - we could use mass operations
// We don't need to delete items from live here, as it get deleted in the beggining of the method for MasterTable
// or in parent table processing for sub-tables
- $this->RaiseEvent('OnBeforeCopyToLive', $master['Prefix'], $current_ids);
+ $this->RaiseEvent('OnBeforeCopyToLive', $master['Prefix'], '', $current_ids);
// reset ALL negative IDs to 0 so it get inserted into live table with autoincrement
$query = 'UPDATE '.$this->GetTempName($master['TableName']).'
@@ -563,7 +576,7 @@
WHERE '.$foreign_key_field.' IN ('.join(',', $foreign_keys).')';
if (isset($sub_table['Constrain'])) $query .= ' AND '.$sub_table['Constrain'];
- $this->RaiseEvent( 'OnBeforeDeleteFromLive', $sub_table['Prefix'], $this->Conn->GetCol($query) );
+ $this->RaiseEvent( 'OnBeforeDeleteFromLive', $sub_table['Prefix'], '', $this->Conn->GetCol($query) );
$query = 'DELETE FROM '.$sub_table['TableName'].'
WHERE '.$foreign_key_field.' IN ('.join(',', $foreign_keys).')';
@@ -576,11 +589,16 @@
}
}
- function RaiseEvent($name, $prefix, $ids, $foreign_key = null, $add_params = null)
+ function RaiseEvent($name, $prefix, $special, $ids, $foreign_key = null, $add_params = null)
{
- if ( !is_array($ids) ) return;
- $event = new kEvent( Array('name'=>$name, 'prefix'=>$prefix, 'special'=>'') );
- if( isset($foreign_key) ) $event->setEventParam('foreign_key', $foreign_key);
+ if ( !is_array($ids) ) return ;
+
+ $event_key = $prefix.($special ? '.' : '').$special.':'.$name;
+ $event = new kEvent($event_key);
+ if (isset($foreign_key)) {
+ $event->setEventParam('foreign_key', $foreign_key);
+ }
+
foreach($ids as $id)
{
$event->setEventParam('id', $id);
Index: trunk/kernel/units/users/users_event_handler.php
===================================================================
diff -u -r3834 -r3863
--- trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 3834)
+++ trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 3863)
@@ -771,33 +771,30 @@
}
}
+
+
+ /**
+ * Delete users from groups if their membership is expired
+ *
+ * @param kEvent $event
+ */
function OnCheckExpiredMembership(&$event)
{
- $sql = 'SELECT PortalUserId FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.adodb_mktime();
- $user_ids = $this->Conn->GetCol($sql);
- if(is_array($user_ids) && count($user_ids) > 0)
- {
- foreach($user_ids as $id)
- {
- $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
- $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
- }
- }
- $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.adodb_mktime();
- $this->Conn->Query($sql);
-
+ // send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
- $sql = 'SELECT PortalUserId, GroupId FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.$pre_expiration.'
- AND ExpirationReminderSent = 0';
- $res = $this->Conn->Query($sql);
- if(is_array($res) && count($res) > 0)
- {
+ $sql = 'SELECT PortalUserId, GroupId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
+
+ $skip_clause = $event->getEventParam('skip_clause');
+ if ($skip_clause) {
+ $sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
+ }
+
+ $records = $this->Conn->Query($sql);
+ if ($records) {
$conditions = Array();
- foreach($res as $record)
- {
+ foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
@@ -807,6 +804,23 @@
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
+ // send pre-expiration reminders: end
+
+ // remove users from groups with expired membership: begin
+ $sql = 'SELECT PortalUserId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $user_ids = $this->Conn->GetCol($sql);
+ if ($user_ids) {
+ foreach ($user_ids as $id) {
+ $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
+ $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
+ }
+ }
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $this->Conn->Query($sql);
+ // remove users from groups with expired membership: end
}
/**
Index: trunk/core/units/users/users_event_handler.php
===================================================================
diff -u -r3834 -r3863
--- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 3834)
+++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 3863)
@@ -771,33 +771,30 @@
}
}
+
+
+ /**
+ * Delete users from groups if their membership is expired
+ *
+ * @param kEvent $event
+ */
function OnCheckExpiredMembership(&$event)
{
- $sql = 'SELECT PortalUserId FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.adodb_mktime();
- $user_ids = $this->Conn->GetCol($sql);
- if(is_array($user_ids) && count($user_ids) > 0)
- {
- foreach($user_ids as $id)
- {
- $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
- $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
- }
- }
- $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.adodb_mktime();
- $this->Conn->Query($sql);
-
+ // send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
- $sql = 'SELECT PortalUserId, GroupId FROM '.TABLE_PREFIX.'UserGroup
- WHERE MembershipExpires IS NOT NULL AND MembershipExpires < '.$pre_expiration.'
- AND ExpirationReminderSent = 0';
- $res = $this->Conn->Query($sql);
- if(is_array($res) && count($res) > 0)
- {
+ $sql = 'SELECT PortalUserId, GroupId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
+
+ $skip_clause = $event->getEventParam('skip_clause');
+ if ($skip_clause) {
+ $sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
+ }
+
+ $records = $this->Conn->Query($sql);
+ if ($records) {
$conditions = Array();
- foreach($res as $record)
- {
+ foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
@@ -807,6 +804,23 @@
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
+ // send pre-expiration reminders: end
+
+ // remove users from groups with expired membership: begin
+ $sql = 'SELECT PortalUserId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $user_ids = $this->Conn->GetCol($sql);
+ if ($user_ids) {
+ foreach ($user_ids as $id) {
+ $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
+ $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
+ }
+ }
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $this->Conn->Query($sql);
+ // remove users from groups with expired membership: end
}
/**
Index: trunk/core/units/general/my_application.php
===================================================================
diff -u -r3543 -r3863
--- trunk/core/units/general/my_application.php (.../my_application.php) (revision 3543)
+++ trunk/core/units/general/my_application.php (.../my_application.php) (revision 3863)
@@ -1,5 +1,5 @@
registerClass('kCatDBList',MODULES_PATH.'/kernel/units/general/cat_dblist.php');
$this->registerClass('kCatDBEventHandler',MODULES_PATH.'/kernel/units/general/cat_event_handler.php');
$this->registerClass('kCatDBTagProcessor',MODULES_PATH.'/kernel/units/general/cat_tag_processor.php');
-
+
$this->registerClass('InpDBEventHandler', MODULES_PATH.'/kernel/units/general/inp_db_event_handler.php', 'kDBEventHandler');
$this->registerClass('InpTempTablesHandler',MODULES_PATH.'/kernel/units/general/inp_temp_handler.php','kTempTablesHandler');
$this->registerClass('InpCustomFieldsHelper',MODULES_PATH.'/kernel/units/general/custom_fields.php','InpCustomFieldsHelper');
$this->registerClass('kCountryStatesHelper',MODULES_PATH.'/kernel/units/general/country_states.php','CountryStatesHelper');
$this->registerClass('kBracketsHelper',MODULES_PATH.'/kernel/units/general/brackets.php','BracketsHelper');
+ $this->registerClass('kXMLHelper',MODULES_PATH.'/kernel/units/general/xml_helper.php','kXMLHelper');
}
-
+
function getUserGroups($user_id)
{
switch($user_id)
Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl
===================================================================
diff -u -r3597 -r3863
--- trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 3597)
+++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 3863)
@@ -236,8 +236,8 @@
-
-
@@ -251,12 +251,12 @@
-
+
Index: trunk/kernel/units/general/my_application.php
===================================================================
diff -u -r3543 -r3863
--- trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 3543)
+++ trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 3863)
@@ -1,5 +1,5 @@
registerClass('kCatDBList',MODULES_PATH.'/kernel/units/general/cat_dblist.php');
$this->registerClass('kCatDBEventHandler',MODULES_PATH.'/kernel/units/general/cat_event_handler.php');
$this->registerClass('kCatDBTagProcessor',MODULES_PATH.'/kernel/units/general/cat_tag_processor.php');
-
+
$this->registerClass('InpDBEventHandler', MODULES_PATH.'/kernel/units/general/inp_db_event_handler.php', 'kDBEventHandler');
$this->registerClass('InpTempTablesHandler',MODULES_PATH.'/kernel/units/general/inp_temp_handler.php','kTempTablesHandler');
$this->registerClass('InpCustomFieldsHelper',MODULES_PATH.'/kernel/units/general/custom_fields.php','InpCustomFieldsHelper');
$this->registerClass('kCountryStatesHelper',MODULES_PATH.'/kernel/units/general/country_states.php','CountryStatesHelper');
$this->registerClass('kBracketsHelper',MODULES_PATH.'/kernel/units/general/brackets.php','BracketsHelper');
+ $this->registerClass('kXMLHelper',MODULES_PATH.'/kernel/units/general/xml_helper.php','kXMLHelper');
}
-
+
function getUserGroups($user_id)
{
switch($user_id)
Index: trunk/kernel/include/modules.php
===================================================================
diff -u -r3576 -r3863
--- trunk/kernel/include/modules.php (.../modules.php) (revision 3576)
+++ trunk/kernel/include/modules.php (.../modules.php) (revision 3863)
@@ -553,14 +553,13 @@
function _ModuleLicensed($name)
{
global $i_Keys, $objConfig, $pathtoroot;
- $vars = parse_portal_ini($pathtoroot."config.php");
+ $vars = parse_portal_ini($pathtoroot.'config.php');
- // globalize vars from config
- while($key = key($vars))
- {
- $GLOBALS["g_".$key] = current($vars);
- next($vars);
+ // globalize vars from config (theese vars are already present, why to do this again?)
+ foreach ($vars as $config_key => $config_value) {
+ $GLOBALS['g_'.$config_key] = $config_value;
}
+
$lic = base64_decode($GLOBALS['g_License']);
_ParseLicense($lic);
Index: trunk/kernel/include/debugger.php
===================================================================
diff -u -r3825 -r3863
--- trunk/kernel/include/debugger.php (.../debugger.php) (revision 3825)
+++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 3863)
@@ -2,5 +2,157 @@
if( !class_exists('Debugger') )
{
include_once KERNEL_PATH.'/utility/debugger.php';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
?>
\ No newline at end of file