Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Aug 17, 12:46 AM

in-portal

Index: trunk/kernel/admin_templates/incs/header.tpl
===================================================================
--- trunk/kernel/admin_templates/incs/header.tpl (revision 3373)
+++ trunk/kernel/admin_templates/incs/header.tpl (revision 3374)
@@ -1,49 +1,49 @@
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">-->
<html>
<head>
<title>In-Commerce</title>
<meta http-equiv="content-type" content="text/html; charset=<inp2:lang_GetCharset/>">
<meta name="keywords" content="...">
<meta name="description" content="...">
<meta name="robots" content="all">
<meta name="copyright" content="Copyright &#174; 2005 Test, Inc">
<meta name="author" content="Intechnic Inc.">
<inp2:m_base_ref/>
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
-<link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" media="screen" />
+<link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
<script language="javascript" src="incs/is.js"></script>
<script language="javascript" src="incs/script.js"></script>
<script language="javascript" src="incs/in-portal.js"></script>
<script language="javascript" src="incs/toolbar.js"></script>
<script language="javascript" src="incs/grid.js"></script>
<script language="javascript" src="incs/tabs.js"></script>
<script language="javascript">
var t = '<inp2:m_get param="t"/>';
var popups = '1';
var multiple_windows = '1';
var main_title = '<inp2:m_GetConfig var="Site_Name" escape="1"/>';
var tpl_changed = 0;
var base_url = '<inp2:m_BaseURL/>';
var img_path = "img/";
</script>
</head>
<inp2:m_include t="incs/blocks"/>
<inp2:m_include t="incs/in-portal"/>
<inp2:m_if prefix="m" function="GetEquals" var="nobody" value="yes" inverse="inverse"/>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" <inp2:m_get param="body_properties"/>>
<inp2:m_endif/>
<inp2:m_ParseBlock name="kernel_form"/>
<inp2:m_if prefix="m" function="IsDebugMode"/>
<a href="javascript:self.location.reload()">Reload frame</a>&nbsp;||&nbsp;<a href="javascript:toggleDebugLayer()">Show debugger</a>
<inp2:m_endif/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/header.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/admin/login.php
===================================================================
--- trunk/admin/login.php (revision 3373)
+++ trunk/admin/login.php (revision 3374)
@@ -1,133 +1,136 @@
<?php
$pathtoimage = $pathtoroot . $admin."/images";
if (function_exists("admin_language"))
{
$login_text = admin_language("la_Login");
$login_button = admin_language("la_Login");
$username_text = admin_language("la_Text_Login");
$password_title = admin_language("la_prompt_Password");
$cancel_button = admin_language("la_Cancel");
}
else
{
$login_text = "Login";
$login_button = "Login";
$username_text = "Username";
$password_title = "Password";
$cancel_button = "Cancel";
}
if( !function_exists('GetVar') )
{
function GetVar($name)
{
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false;
}
}
//echo "<pre>"; print_r($objSession); echo "</pre>";
if ( GetVar('expired') == 1 && GetVar('logout') != 1) {
if (function_exists("admin_language")) {
$login_error = admin_language("la_text_sess_expired");
}
else {
$login_error = "Session Expired";
}
}
if( function_exists('GetRegionalOption') )
{
$charset = GetRegionalOption('Charset');
}
else
{
$charset == 'iso-8859-1';
}
print<<<END
<html>
<head>
<script language="JavaScript">
function redirect()
{
window.name = 'redirect';
- var i = 0;
- //var a_parent = window.parent;
- while (i < 10) {
- if (window.parent.name == 'main_frame') break;
- a_parent = window.parent;
- i++;
- }
- page = a_parent.location.href + '?expired=1';
- if (i < 10)
- setTimeout('a_parent.location.href=page',100);
+ var i = 0;
+// var a_parent = window.parent;
+ while (i < 10)
+ {
+ if (window.parent.name == 'main_frame') break;
+ a_parent = window.parent;
+ i++;
+ }
+ page = a_parent.location.href + '?expired=1';
+ if (i < 10)
+ {
+ setTimeout('a_parent.location.href=page',100);
+ }
}
</script>
<title>In-Portal :: Administration Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=$charset">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<link rel="stylesheet" href="include/style.css" type="text/css">
<META http-equiv="Pragma" content="no-cache">
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="document.form1.login.focus();">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td valign="middle" align="center">
<div align="center">
<img title="In-portal" src="images/globe.gif" width="84" height="91" border="0">
<img title="In-portal" src="images/logo.gif" width="150" height="91" border="0"><br>
<form name="form1" method="post" action="index.php" target="_top">
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="222" height="30">
<tr>
<td align="right" valign="top" class="tablenav" width ="220" nowrap height=30 background="images/tabnav_left.jpg">
<span style="float: left;">
<img src="icons/icon24_lock_login.gif" width="16" height="22" alt="" border="0" align="absmiddle"> $login_text
</span>
<a href="help/manual.pdf"><img src="images/blue_bar_help.gif" border="0"></a>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#F0F0F0">
<table cellpadding="4" cellspacing="0" border="0">
<tr bgcolor="#F0F0F0">
<td class="text">$username_text</td>
<td><input type="text" name="login" class="text"></td>
</tr>
<tr bgcolor="#F0F0F0">
<td class="text">$password_title</td>
<td><input type="password" name="password" class="text"></td>
</tr>
<tr bgcolor="#F0F0F0">
<td colspan="2">
<div align="left">
<input type="submit" name="submit" value="$login_button" class="button">
<input type="reset" name="Cancel" value="$cancel_button" class="button">
<input type=hidden name="adminlogin" value="1" />
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<br>
<p class="error">
$login_error</p>
</td>
</tr>
</table>
<script>
var a_parent = window.parent;
redirect();
</script>
</body>
</html>
END;
exit();
?>
\ No newline at end of file
Property changes on: trunk/admin/login.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/core/kernel/event_manager.php
===================================================================
--- trunk/core/kernel/event_manager.php (revision 3373)
+++ trunk/core/kernel/event_manager.php (revision 3374)
@@ -1,366 +1,366 @@
<?php
define('hBEFORE', 1);
define('hAFTER', 2);
define('reBEFORE', 1);
define('reAFTER', 2);
class kEventManager extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Cache of QueryString parameters
* from config, that are represented
* in enviroment variable
*
* @var Array
*/
var $queryMaps=Array();
/**
* Build events registred for
* pseudo classes. key - pseudo class
* value - event name
*
* @var Array
* @access private
*/
var $buildEvents=Array();
/**
* Events, that should be run before parser initialization
*
* @var Array
*/
var $beforeRegularEvents = Array();
/**
* Events, that should be run after parser initialization
*
* @var Array
*/
var $afterRegularEvents = Array();
/**
* Holds before hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $beforeHooks=Array();
/**
* Holds after hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $afterHooks = Array();
function kEventManager()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Set's new enviroment parameter mappings
* between their names as application vars
*
* @param Array $new_query_maps
* @access public
*/
function setQueryMaps($new_query_maps)
{
$this->queryMaps=$new_query_maps;
}
/**
* Registers new regular event
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
* @param int $type before or after regular event
*/
function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE)
{
if($type == reBEFORE)
{
$this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
else
{
$this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
}
function registerBuildEvent($pseudo_class,$build_event_name)
{
$this->buildEvents[$pseudo_class]=$build_event_name;
}
/**
* Returns build event by pseudo class
* name if any defined in config
*
* @param string $pseudo_class
* @return kEvent
* @access public
*/
function &getBuildEvent($pseudo_class)
{
$false = false;
if( !isset($this->buildEvents[$pseudo_class]) ) return $false;
$event = new kEvent();
$event->Name=$this->buildEvents[$pseudo_class];
$event->MasterEvent=null;
return $event;
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
*/
function HandleEvent(&$event)
{
if( !$this->Application->prefixRegistred($event->Prefix) )
{
trigger_error('Prefix <b>'.$event->Prefix.'</b> not registred (requested event <b>'.$event->Name.'</b>)', E_USER_NOTICE);
return false;
}
-
+
if (!$event->SkipBeforeHooks) {
$this->processHooks($event, hBEFORE);
if ($event->status == erFATAL) return true;
}
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
$event_handler->processEvent($event);
if ($event->status == erFATAL) return true;
if (!$event->SkipAfterHooks) {
$this->processHooks($event, hAFTER);
}
return true;
}
-
+
function ProcessRequest()
{
$this->processOpener();
// 1. get events from $_POST
$events=$this->Application->GetVar('events');
if($events===false) $events=Array();
// 2. if nothing there, then try to find them in $_GET
if($this->queryMaps && !$events)
{
// if we got $_GET type submit (links, not javascript)
foreach($this->queryMaps as $prefix_special => $query_map)
{
$query_map=array_flip($query_map);
if(isset($query_map['event']))
{
$events[$prefix_special]=$this->Application->GetVar($prefix_special.'_event');
}
}
$actions = $this->Application->GetVar('do');
if ($actions) {
list($prefix, $event_name) = explode('_', $actions);
$events[$prefix] = $event_name;
}
}
$passed = explode(',', $this->Application->GetVar('passed'));
foreach($events as $prefix_special => $event_name)
{
if(!$event_name) continue;
if( is_array($event_name) )
{
$event_name = key($event_name);
$events[$prefix_special] = $event_name;
$this->Application->SetVar($prefix_special.'_event', $event_name);
}
$event = new kEvent();
$event->Name=$event_name;
$event->Prefix_Special=$prefix_special;
$prefix_special=explode('.',$prefix_special);
$event->Prefix=$prefix_special[0];
array_push($passed, $prefix_special[0]);
$event->Special=isset($prefix_special[1])?$prefix_special[1]:'';
$event->redirect_params = Array('opener'=>'s', 'pass'=>'all');
$event->redirect = true;
$this->HandleEvent($event);
if($event->status==erSUCCESS && ($event->redirect === true || strlen($event->redirect) > 0) )
{
$this->Application->Redirect($event->redirect, $event->redirect_params, null, $event->redirect_script);
}
}
$this->Application->SetVar('events', $events);
$this->Application->SetVar('passed', implode(',', $passed));
}
function processOpener()
{
$opener_action=$this->Application->GetVar('m_opener');
$opener_stack=$this->Application->RecallVar('opener_stack');
$opener_stack=$opener_stack?unserialize($opener_stack):Array();
switch($opener_action)
{
case 'r': // "reset" opener stack
$opener_stack=Array();
break;
case 'd': // "down/push" new template to opener stack, deeplevel++
if ($this->Application->GetVar('front')) {
array_push($opener_stack, '../'.$this->Application->RecallVar('last_template') );
}
else {
array_push($opener_stack, $this->Application->RecallVar('last_template') );
}
break;
case 'u': // "up/pop" last template from opener stack, deeplevel--
array_pop($opener_stack);
break;
default: // "s/0," stay on same deep level
break;
}
$this->Application->SetVar('m_opener','s');
$this->Application->StoreVar('opener_stack',serialize($opener_stack));
}
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
if( !$this->Application->getUnitOptions($hookto_prefix) )
{
if($this->Application->isDebugMode())
{
trigger_error('Prefix <b>'.$hookto_prefix.'</b> doesn\'t exist when trying to hook from <b>'.$do_prefix.':'.$do_event.'</b>', E_USER_WARNING);
}
return;
}
$hookto_prefix_special = rtrim($hookto_prefix.'.'.$hookto_special, '.');
if ($mode == hBEFORE) {
$this->beforeHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
elseif ($mode == hAFTER) {
$this->afterHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
*/
function processHooks(&$event, $mode)
{
if ($mode == hBEFORE) {
$mode_hooks =& $this->beforeHooks;
}
else {
$mode_hooks =& $this->afterHooks;
}
if ( $hooks = getArrayValue($mode_hooks, strtolower($event->Prefix_Special.'.'.$event->Name)) ) {
foreach($hooks as $hook)
{
$prefix_special = rtrim($hook['DoPrefix'].'_'.$hook['DoSpecial'],'_');
if( $hook['Conditional'] && !$this->Application->GetVar($prefix_special) ) continue;
$hook_event = new kEvent( Array('name'=>$hook['DoEvent'],'prefix'=>$hook['DoPrefix'],'special'=>$hook['DoSpecial']) );
$hook_event->MasterEvent =& $event;
$this->HandleEvent($hook_event);
}
}
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('events['.$prefix_special.']',$event_name);
}
/**
* Run registred regular events with specified event type
*
* @param int $event_type
*/
function RunRegularEvents($event_type = reBEFORE)
{
$events_source = ($event_type == reBEFORE) ? $this->beforeRegularEvents : $this->afterRegularEvents;
/*if(rand(0, 100) < 90)
{
return;
}*/
$sql = 'SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = %s';
$event_last_runs = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr('RegularEventRuns') ) );
$event_last_runs = $event_last_runs ? unserialize($event_last_runs) : Array();
foreach($events_source as $short_name => $event_data)
{
$event_last_run = getArrayValue($event_last_runs, $short_name);
if($event_last_run && $event_last_run > adodb_mktime() - $event_data['RunInterval'])
{
continue;
}
else
{
$event = new kEvent($event_data['EventName']);
$event->redirect = false;
$this->Application->HandleEvent($event);
$event_last_runs[$short_name] = adodb_mktime();
}
}
$sql = 'REPLACE INTO '.TABLE_PREFIX.'Cache (VarName,Data,Cached) VALUES (%s,%s,%s)';
$this->Conn->Query( sprintf($sql, $this->Conn->qstr('RegularEventRuns'), $this->Conn->qstr(serialize($event_last_runs)), adodb_mktime() ) );
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/event_manager.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.14
\ No newline at end of property

Event Timeline