Index: trunk/core/units/users/users_event_handler.php
===================================================================
diff -u -N -r4292 -r4358
--- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4292)
+++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4358)
@@ -68,7 +68,7 @@
$this->Application->SetVar('u_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->Application->setVisitField('PortalUserId', $user_id);
-
+
$this_login = (int)$object->getPersistantVar('ThisLogin');
$object->setPersistantVar('LastLogin', $this_login);
$object->setPersistantVar('ThisLogin', adodb_mktime());
@@ -81,6 +81,21 @@
}
$next_template = $this->Application->GetVar('next_template');
+ if ($next_template == '_ses_redirect') {
+ $location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
+ if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_REDIRECT') )
+ {
+ $this->Application->Debugger->appendTrace();
+ echo "Debug output above!!! Proceed to redirect: $a_location
";
+ }
+ else {
+ header('Location: '.$location);
+ }
+ $session =& $this->Application->recallObject('Session');
+ $session->SaveData();
+ exit();
+ }
+
if($next_template) $event->redirect = $next_template;
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
@@ -121,12 +136,12 @@
$sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
-
+
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
-
+
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u_id', -2);
@@ -335,6 +350,12 @@
$object->SetDBField('Status', 0);
break;
}
+
+ /*if ($object->GetDBField('PaidMember') == 1) {
+ $this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
+ $event->redirect = 'in-commerce/checkout/shop_cart';
+ } */
+
}
@@ -607,9 +628,9 @@
{
$this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
$this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
-
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
+
$event->redirect = $this->Application->GetVar('template_success');
}
@@ -771,8 +792,8 @@
}
}
-
-
+
+
/**
* Delete users from groups if their membership is expired
*
@@ -785,12 +806,12 @@
$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();
@@ -805,7 +826,7 @@
$this->Conn->Query($sql);
}
// send pre-expiration reminders: end
-
+
// remove users from groups with expired membership: begin
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup