Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Jul 20, 6:30 AM

in-portal

Index: trunk/kernel/units/categories/categories_config.php
===================================================================
--- trunk/kernel/units/categories/categories_config.php (revision 4674)
+++ trunk/kernel/units/categories/categories_config.php (revision 4675)
@@ -1,222 +1,222 @@
<?php
$config = Array(
'Prefix' => 'c',
'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'CategoryLink',
'LocalTagName' => 'CategoryLink',
),
),
'IDField' => 'CategoryId',
'StatusField' => Array('Status'),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_cat_pending.gif',
'label' => 'la_tab_Categories',
'js_url' => "set_persistant_var('Category_View', 41, 'advanced_view', '#url#')",
'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'category', 'pass' => 'm'),
'status' => STATUS_PENDING,
),
),
'TableName' => TABLE_PREFIX.'Category',
'ViewMenuPhrase' => 'la_text_Categories',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'),
'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'),
'new_titlefield' => Array('c' => '!la_title_New_Category!'),
),
'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
'category_items'=> Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Items!"),
'tree_site' => Array('format' => '!la_selecting_categories!'),
),
- 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'custom' => 'in-portal:configuration_custom'),
+ 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'),
'Sections' => Array(
// "Structure & Data" section
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'catalog',
'label' => 'la_tab_Browse',
'url' => Array('index_file' => 'browse.php', 'pass' => 'm'),
'late_load' => Array('t' => 'xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array('index_file' => 'advanced_view.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
- 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'),
+ 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
),
'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'SubItems' => Array('c-cdata', 'c-perm'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
)
),
'Fields' => Array
(
'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Filename' => Array('type' => 'string','not_null' => '1','default' => ''),
'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'),
'EditorsPick' => Array('type' => 'int','default' => ''),
'Status' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Pop' => Array('type' => 'int','default' => ''),
'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
'MetaKeywords' => Array('type' => 'string','default' => ''),
'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''),
'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ResourceId' => Array('type' => 'int','default' => ''),
'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'MetaDescription' => Array('type' => 'string','default' => ''),
'HotItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'NewItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'PopItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
),
'VirtualFields' => Array(
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_cat.gif'),
'Fields' => Array(
'Name' => Array( 'width'=>150, 'title'=>'la_col_Title', 'data_block'=>'category_td' ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_Category',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/kernel/units/users/users_config.php
===================================================================
--- trunk/kernel/units/users/users_config.php (revision 4674)
+++ trunk/kernel/units/users/users_config.php (revision 4675)
@@ -1,267 +1,267 @@
<?php
$config = Array(
'Prefix' => 'u',
'ItemClass' => Array('class'=>'UsersItem','file'=>'users_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'UsersEventHandler','file'=>'users_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'UsersTagProcessor','file'=>'users_tag_processor.php','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo' => 'UsersSyncronizeManager', 'class' => 'UsersSyncronizeManager', 'file' => 'users_syncronize.php', 'build_event' => ''),
),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPrepareStates',
),
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'affil',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCheckAffiliateAgreement'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnSubstituteSubscriber',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'RegularEvents' => Array(
'membership_expiration' => Array('EventName' => 'OnCheckExpiredMembership', 'RunInterval' => 1800, 'Type' => reAFTER),
),
'IDField' => 'PortalUserId',
'StatusField' => Array('Status'),
'TitleField' => 'Login',
'ItemType' => 6, // used for custom fields only (on user's case)
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_user_pending.gif',
'label' => 'la_Text_Users',
'js_url' => "set_persistant_var('User_View', 4, 'users/users_list', '#url#')",
'url' => Array('t' => 'users/users_list', 'index_file' => 'users/user_list.php', 'pass' => 'm'),
'status' => STATUS_PENDING,
),
),
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('u'=>'!la_title_Adding_User!'),
'edit_status_labels' => Array('u'=>'!la_title_Editing_User!'),
'new_titlefield' => Array('u'=>'!la_title_New_User!'),
),
'users_list' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#)"),
'users_edit' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_General!"),
'users_select' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"),
'tree_users' => Array('format' => '!la_section_overview!'),
),
- 'PermSection' => Array('main' => 'in-portal:user_list', 'custom' => 'in-portal:user_custom'),
+ 'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'),
'Sections' => Array(
'in-portal:users' => Array(
'parent' => 'in-portal:root',
'icon' => 'community',
'label' => 'la_tab_Community',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:user_list' => Array(
'parent' => 'in-portal:users',
'icon' => 'users',
'label' => 'la_tab_User_List',
'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', 'advanced:add_favorite', 'advanced:remove_favorite',),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_users' => Array(
'parent' => 'in-portal:users',
'icon' => 'users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array(
'parent' => 'in-portal:users',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
- 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Users', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'),
+ 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array(
'parent' => 'in-portal:users',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array(
'parent' => 'in-portal:users',
'icon' => 'banlist',
'label' => 'la_tab_BanList',
'url' => Array('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit'),
'priority' => 6,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'PortalUser',
'ListSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ItemSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Login' => 'asc'),
)
),
'SubItems' => Array('addr', 'u-cdata', 'u-ug', 'fav'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'PrimaryGroup' => 'g.Name',
),
),
'Fields' => Array
(
'PortalUserId' => Array(),
'Login' => Array('type' => 'string', 'unique'=>Array('Login'), 'default' => '','required'=>1, 'error_msgs' => Array('unique'=>'!lu_user_already_exist!')),
'Password' => Array('type' => 'string', 'formatter' => 'kPasswordFormatter', 'encryption_method' => 'md5', 'verify_field' => 'VerifyPassword', 'skip_empty' => 1, 'default' => md5('') ),
'FirstName' => Array('type' => 'string','default' => ''),
'LastName' => Array('type' => 'string','default' => ''),
'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/', 'unique'=>Array('Email'), 'not_null' => '1', 'required'=>1, 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!') ),
'CreatedOn' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => '1' ),
'Phone' => Array('type' => 'string','default' => ''),
'Fax' => Array('type' => 'string','not_null' => '1','default' => ''),
'Street' => Array('type' => 'string','default' => ''),
'Street2' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'City' => Array('type' => 'string','default' => ''),
'State' => Array('formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'Zip' => Array('type' => 'string','default' => ''),
'Country' => Array('formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
'Modified' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1', 'default' => '#NOW#' ),
'dob' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'not_null' => '1', 'default' => '', 'required'=>1),
'tz' => Array('type' => 'int','default' => ''),
'ip' => Array('type' => 'string','default' => ''),
'IsBanned' => Array('type' => 'int','not_null' => '1','default' => '0'),
'PassResetTime' => Array('type' => 'int','default' => ''),
'PwResetConfirm' => Array('type' => 'string','default' => ''),
'PwRequestTime' => Array('type' => 'int','default' => ''),
'MinPwResetDelay' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array('300' => '5', '600' => '10', '900' => '15', '1800' => '30', '3600' => '60'), 'use_phrases' => 0, 'not_null' => '1', 'default' => 30),
),
'VirtualFields' => Array(
'ValidateLogin' => Array('type'=>'string','default'=>''),
'SubscribeEmail' => Array('type'=>'string','default'=>''),
'PrimaryGroup' => Array('type' => 'string', 'default' => ''),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array(
'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_checkbox_td'),
'LastName' => Array( 'title'=>'la_col_LastName'),
'FirstName' => Array( 'title'=>'la_col_FirstName'),
'Email' => Array( 'title'=>'la_col_Email'),
'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
),
),
'UserSelector' => Array(
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array(
'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_radio_td'),
'LastName' => Array( 'title'=>'la_col_LastName'),
'FirstName' => Array( 'title'=>'la_col_FirstName'),
'Email' => Array( 'title'=>'la_col_Email'),
'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/users/users_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.27
\ No newline at end of property
+1.28
\ No newline at end of property
Index: trunk/kernel/units/email_events/email_events_event_handler.php
===================================================================
--- trunk/kernel/units/email_events/email_events_event_handler.php (revision 4674)
+++ trunk/kernel/units/email_events/email_events_event_handler.php (revision 4675)
@@ -1,274 +1,276 @@
<?php
class EmailEventsEventsHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnFrontOnly' => Array('self' => 'edit'),
- 'OnSaveSelected' => Array('self' => 'add|edit'),
+ 'OnSaveSelected' => Array('self' => 'view'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$module = $this->Application->GetVar('module');
$module = explode(':', $module, 2);
+
if (count($module) == 1) {
$main_prefix = $this->Application->findModule('Name', $module[0], 'Var');
}
else {
$exceptions = Array('Category' => 'c', 'Users' => 'u');
$main_prefix = $exceptions[ $module[1] ];
}
$section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection');
+
$event->setEventParam('PermSection', $section);
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'module') {
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
}
/**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
*/
function OnFrontOnly(&$event)
{
$ids = implode(',', $this->StoreSelectedIDs($event));
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET Enabled = 2
WHERE EventId IN ('.$ids.')';
$this->Conn->Query($sql);
}
/**
* Sets selected user to email events selected
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event){
$email_event = $event->getEventParam('EmailEventName');
if( strpos($email_event, '_') !== false )
{
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
$to_user_id = $event->getEventParam('EmailEventToUserId');
$email_event_type = $event->getEventParam('EmailEventType');
$this->Application->setUnitOption('emailmessages', 'AutoLoad', false);
$message_object = &$this->Application->recallObject('emailmessages');
$event_table = $this->Application->getUnitOption('emailevents', 'TableName');
$event_object = &$event->getObject();
$event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
$event_id = $event_object->GetDBField('EventId');
$from_user_id = $event_object->GetDBField('FromUserId');
$type = $event_object->GetDBField('Type');
$enabled = $event_object->GetDBField('Enabled');
$direct_send_params = $event->getEventParam('DirectSendParams');
if ($enabled == 0) return; // disabled event
if ($enabled == 2 && $this->Application->IsAdmin() ) return; // event only for front-end
if ($type == 1){
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
/*
if (!($to_user_id > 0) && !$direct_send_params){
// if we can not determine recepient we will not send email
return;
}
*/
//Parse Message Template
$message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
$message_type = $message_object->GetDBField('MessageType');
// add footer: begin
$sql = 'SELECT em.Template
FROM '.$message_object->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$message_object->GetDBField('LanguageId').' AND e.Event = "COMMON.FOOTER"';
$footer = explode("\n\n", $this->Conn->GetOne($sql));
$footer = $message_object->GetDBField('MessageType') == 'text' ? strip_tags($footer[1]) : $footer[1];
$message_template = $message_object->GetDBField('Template')."\r\n".$footer;
// add footer: end
$email_object = &$this->Application->recallObject('kEmailMessage');
$email_object->Clear();
$old_autoload = $this->Application->getUnitOption('u', 'AutoLoad');
$this->Application->setUnitOption('u', 'AutoLoad', false);
$from_user_object = &$this->Application->recallObject('u.-email'.$from_user_id);
$from_user_object->Load($from_user_id);
// here if we don't have from_user loaded, it takes a default user from config values
if ( $from_user_object->IsLoaded() ) {
$from_user_email = $from_user_object->GetDBField('Email');
$from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
}
else {
$from_user_email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
$to_user_object = &$this->Application->recallObject('u.-email'.$to_user_id);
$to_user_object->Load($to_user_id);
$to_user_email = $to_user_object->GetDBField('Email');
$to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
$this->Application->setUnitOption('u', 'AutoLoad', $old_autoload);
if($direct_send_params){
$to_user_email = ( $direct_send_params['to_email'] ? $direct_send_params['to_email'] : $to_user_email );
$to_user_name = ( $direct_send_params['to_name'] ? $direct_send_params['to_name'] : $to_user_name );
$from_user_email = ( $direct_send_params['from_email'] ? $direct_send_params['from_email'] : $from_user_email);
$from_user_name = ( $direct_send_params['from_name'] ? $direct_send_params['from_name'] : $from_user_name );
$message_body_additional = $direct_send_params['message'];
}
$to_user_email = $to_user_email ? $to_user_email : $this->Application->ConfigValue('Smtp_AdminMailFrom');
$this->Application->makeClass('Template');
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params;
$direct_send_params['message_text'] = $message_body_additional;
$this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_send_params);
$message_template = str_replace('<inp:touser _Field', '<inp2:u_Field name', $message_template);
$message_template = $this->Application->Parser->Parse($message_template, 'email_template', 0);
$this->Application->Parser->Params = $parser_params;
$message_template = str_replace("\r", "", $message_template);
list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
$email_object->setFrom($from_user_email, $from_user_name);
$email_object->setTo($to_user_email, $to_user_name);
$email_object->setSubject('Mail message');
$email_object->setHeaders($message_headers);
if ($message_type == 'html'){
$email_object->setHTMLBody($message_body);
}
else {
$email_object->setTextBody($message_body);
}
$smtp_object = &$this->Application->recallObject('kSmtpClient');
$smtp_server = $this->Application->ConfigValue('Smtp_Server');
$smtp_port = $this->Application->ConfigValue('Smtp_Port');
$smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
if ($smtp_authenticate){
$smtp_user = $this->Application->ConfigValue('Smtp_User');
$smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
}else{
$smtp_user = '';
$smtp_pass = '';
}
if ($smtp_server){
if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}else{
if($email_object->send()){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}
if ($event->status == erSUCCESS){
if (!$from_user_name) {
$from_user_name = strip_tags( $this->Application->ConfigValue('Site_Name') );
}
$sql = 'INSERT INTO '.TABLE_PREFIX.'EmailLog SET
fromuser = '.$this->Conn->qstr($from_user_name.' ('.$from_user_email.')').',
addressto = '.$this->Conn->qstr($to_user_name.' ('.$to_user_email.')').',
subject = '.$this->Conn->qstr($email_object->Subject).',
timestamp = UNIX_TIMESTAMP(),
event = '.$this->Conn->qstr($email_event);
$this->Conn->Query($sql);
}
return $event;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/email_events/email_events_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property
Index: trunk/admin/config/edit_config.php
===================================================================
--- trunk/admin/config/edit_config.php (revision 4674)
+++ trunk/admin/config/edit_config.php (nonexistent)
@@ -1,107 +0,0 @@
-<?php
-
-// new startup: begin
-define('REL_PATH', 'admin/config');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_login();
-
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot.$value."admin/include/parser.php";
- if(file_exists($path))
- {
- //echo "<!-- $path -->";
- @include_once($path);
- }
-}
-
-//Set Section
-$section = $_GET["section"];
-$module = $_GET["module"];
-//echo $module." - ".$section."<br>\n";
-//Set Environment Variable
-$envar = "env=" . BuildEnv()."&section=$section&module=$module";
- $objCatToolBar = new clsToolBar();
- $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","if(SubmitFunc) { config_submit('edit_config'); } else document.edit_config.submit();","tool_select.gif");
- $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","history.back();","tool_cancel.gif");
-
-
-$sec = $objSections->GetSection($section);
-$ParentSection = $sec->Get("parent");
-$ParentSec = $objSections->GetSection($ParentSection);
-$ParentUrl = $ParentSec->URL();
-if($ParentSec->Get("parent"))
-{
- //$SubmitUrl = $ParentUrl."&section=$section&module=$module";
- $SubmitUrl = $ParentUrl;
- //echo "Submitting Parent ($ParentUrl) to: $SubmitUrl <br>\n";
-}
-else
- $SubmitUrl = $_SERVER['PHP_SELF']."?".$envar;
-
-
-$title = '';
-int_header($objCatToolBar,NULL,$title);
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-<form name="edit_config" ID="edit_config" action="<?php echo $SubmitUrl; ?>" method=POST>
-<?php
-$objAdmin = new clsConfigAdmin($module,$section);
-$objAdmin->Clear();
-$objAdmin->LoadItems(TRUE);
-
-$headings = $objAdmin->GetHeadingList();
-
-for($i=0;$i<=count($headings);$i++)
-{
- $h = $headings[$i];
- if(strlen($h))
- {
- int_subsection_title(prompt_language($h));
- $Items = $objAdmin->GetHeadingItems($h);
- foreach($Items as $c)
- {
- print "<tr ".int_table_color_ret().">\n";
- print " <td width=\"60%\" valign=\"top\"><span class=\"text\">".$c->GetPrompt();
-
- if( IsDebugMode() )
- {
- echo '<br /><span class="small">['.$c->DisplayOrder.'] '.$c->name.'</span>';
- }
-
- print "</span></td>\n";
- print " <td nowrap>".$c->ItemFormElement()."</TD>";
- if(is_object($c->NextItem))
- {
- $n = $c->NextItem;
- print " <td>".$n->ItemFormElement()."</TD>";
- }
- else
- print " <td><span class=\"text\">&nbsp;</span></td>\n";
- print "</tr>\n";
- }
- }
-}
-?>
- <tr <?php int_table_color(); ?>>
- <td colspan="4">
- <input type="hidden" name="Action" value="m_config_edit">
- <input type="hidden" name="module" value="<?php echo $module; ?>">
- <input type="hidden" name="section" value="<?php echo $section; ?>">
- </td>
- </tr>
-</FORM></TABLE>
-<?php
-int_footer();
-?>
Property changes on: trunk/admin/config/edit_config.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.9
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/config/config_general.php
===================================================================
--- trunk/admin/config/config_general.php (revision 4674)
+++ trunk/admin/config/config_general.php (nonexistent)
@@ -1,104 +0,0 @@
-<?php
-
-// new startup: begin
-define('REL_PATH', 'admin/config');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/include/toolbar.php");
-
-$section = 'in-portal:configure';
-
-//Set Environment Variable
-$envar = "env=" . BuildEnv();
-
-if(strlen($_GET["module"])==0)
-{
- $config_module="In-Portal";
-}
-else
-{
- $config_module=$_GET["module"];
-}
-if(strlen($_GET["section"])==0)
-{
- $config_section="System";
-}
-else
-{
- $config_section=$_GET["section"];
-}
-int_header();
-?>
-<form name="configuration" action="config_general.php?env=<?php echo BuildEnv(); ?>" method=POST>
-<INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_config_update">
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<tr>
- <?php
- $adodbConnection = &GetADODBConnection();
- $sql="SELECT DISTINCT(Section) FROM ".GetTablePrefix()."ConfigurationValues WHERE ModuleOwner='$config_module'";
- $rs = $adodbConnection->Execute($sql);
- while($rs & !$rs->EOF)
- {
- if($rs->fields["Section"]==$config_section)
- {
- $divleftimage=$imagesURL."/divider_left_sel.gif";
- $tab_bg="#E9D4CE";
-
- $divrightimage=$imagesURL."/divider_sel_right.gif";
- }
- else
- {
- $divleftimage=$imagesURL."/divider_dn.gif";
- $tab_bg="#E0E0DA";
- $divrightimage=$imagesURL."/divider_right.gif";
- }
- $url="config_general.php?env=$envar&module=$config_module&section=".$rs->fields["Section"];
- ?>
- <td width="19" height="21" class="divider_tab"><img src="<?php print $divleftimage; ?>" border="0" width="20" height="20" onClick="confirm_submit('configuration'); "></td>
- <td nowrap class="divider_tab" STYLE="background-color:<?php echo $tab_bg; ?>;"><A HREF="<?php echo $url; ?>"><?php echo $rs->fields["Section"]; ?></A></td>
- <td width="19" height="21" class="divider_tab"><img src="<?php print $divrightimage; ?>" border="0" width="20" height="20"></td>
- </A>
- <?php
- $rs->moveNext();
- }
- ?>
- <TD width="100%" align="right"><B><?php echo $config_module; ?></B></TD>
- </tr>
-</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <tr class="subsectiontitle">
- <td colspan=3><?php echo $config_module."::".$config_section; ?>
- </TD>
- </tr>
-
-<?php
- $sql = "SELECT * FROM ".GetTablePrefix()."ConfigurationValues WHERE ModuleOwner='$config_module' AND Section='$config_section' AND Prompt IS NOT NULL";
- $rs = $adodbConnection->Execute($sql);
- while($rs & !$rs->EOF)
- {
- echo "<tr ". int_table_color_ret()."> ";
- echo "<TD>".$rs->fields["Prompt"]."</TD>";
- echo "<TD><input type=text size=40 NAME=\"".$rs->fields["VariableName"]."\" VALUE=\"".$rs->fields["VariableValue"]."\"></TD>";
- echo "<TD>".$rs->fields["Description"]."</TD>";
- echo "</TR>\n";
- $rs->moveNext();
- }
-?>
- <tr <?php int_table_color(); ?>>
- <td colspan="3">
- <input type="hidden" name="Action" value="<?php echo $action; ?>">
- <input type="submit" name="submit" value="Save" class="button">
- <input type="reset" name="submit2" value="Reset" class="button">
- <input type="button" name="submit3" value="Cancel" class="button" onclick="history.back();">
- </td>
- </tr>
-</table>
-</form>
-<?php int_footer(); ?>
-
Property changes on: trunk/admin/config/config_general.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/config/module_email.php
===================================================================
--- trunk/admin/config/module_email.php (revision 4674)
+++ trunk/admin/config/module_email.php (nonexistent)
@@ -1,324 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/config');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_login();
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditItems);
-
-//$objEditItems = new clsPhraseList();
-//$objEditItems->SourceTable = $objSession->GetEditTable("Language");
-
-/* -------------------------------------- Section configuration ------------------------------------------- */
-$section = $_GET["section"];
-$sec = $objSections->GetSection($section);
-
-$module = $_GET["module"];
-$envar = "env=" . BuildEnv()."&module=$module&section=$section";
-
-//$title = prompt_language("la_Text_Configuration")." - '".$module."' - ".prompt_language("la_tab_EmailEvents");
-
-$SortFieldVar = "Event_LV_SortField";
-$SortOrderVar = "Event_LV_SortOrder";
-$DefaultSortField = "Description";
-$PerPageVar = "Perpage_Event";
-$CurrentPageVar = "Page_Event";
-$CurrentFilterVar = "EmailEvent_View";
-
-$ListForm = "language";
-$CheckClass = "EmailChecks";
-
-
-//echo $envar."<br>\n";
-/* ------------------------------------- Configure the toolbar ------------------------------------------- */
-$objListToolBar = new clsToolBar();
-$objListToolBar->Set("section",$section);
-$objListToolBar->Set("load_menu_func","");
-$objListToolBar->Set("CheckClass","EmailChecks");
-$objListToolBar->Set("CheckClass",$CheckClass);
-$objListToolBar->Set("CheckForm",$ListForm);
-
-$listImages = array();
-
-/*
-$objListToolBar->Add("email_edit", "la_ToolTip_Edit","#","if (EmailChecks.itemChecked()) swap('email_edit','toolbar/tool_edit_f2.gif');",
- "if (EmailChecks.itemChecked()) swap('email_edit', 'toolbar/tool_edit.gif');",
- "EmailChecks.check_submit('email_edit', '');",
- "tool_edit.gif");
-$listImages[] = "EmailChecks.addImage('email_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
-*/
-
-$EditVar = "env=".BuildEnv();
-
-$objListToolBar->Add("email_user", "la_ToolTip_Email_UserSelect","#","if (EmailChecks.itemChecked()) swap('email_user','toolbar/tool_usertogroup_f2.gif');",
- "if (EmailChecks.itemChecked()) swap('email_user', 'toolbar/tool_usertogroup.gif');",
- "OpenUserSelector('EventId',$CheckClass,'".$EditVar."&Selector=radio&destform=userpopup&destfield=FromUserId&IdField=PortalUserId&dosubmit=1');",
- "tool_usertogroup.gif",TRUE,TRUE);
-
-$listImages[] = "EmailChecks.addImage('email_user','$imagesURL/toolbar/tool_usertogroup.gif','$imagesURL/toolbar/tool_usertogroup_f3.gif',1); ";
-
-$objListToolBar->Add("email_enable", "la_ToolTip_Email_Enable","#","if (EmailChecks.itemChecked()) swap('email_enable','toolbar/tool_approve_f2.gif');",
- "if (EmailChecks.itemChecked()) swap('email_enable', 'toolbar/tool_approve.gif');",
- "EmailChecks.check_submit('module_email', 'm_emailevent_enable');",
- "tool_approve.gif",FALSE,TRUE);
-
-$listImages[] = "EmailChecks.addImage('email_enable','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); ";
-
-$objListToolBar->Add("email_disable", "la_ToolTip_Email_Disable","#","if (EmailChecks.itemChecked()) swap('email_disable','toolbar/tool_deny_f2.gif');",
- "if (EmailChecks.itemChecked()) swap('email_disable', 'toolbar/tool_deny.gif');",
- "EmailChecks.check_submit('module_email', 'm_emailevent_disable');",
- "tool_deny.gif",FALSE,TRUE);
-
-$listImages[] = "EmailChecks.addImage('email_disable','$imagesURL/toolbar/tool_deny.gif','$imagesURL/toolbar/tool_deny_f3.gif',1); ";
-
-$objListToolBar->Add("email_front", "la_ToolTip_Email_FrontOnly","#","if (EmailChecks.itemChecked()) swap('email_front','toolbar/tool_frontend_mail_f2.gif');",
- "if (EmailChecks.itemChecked()) swap('email_front', 'toolbar/tool_frontend_mail.gif');",
- "EmailChecks.check_submit('module_email', 'm_emailevent_frontonly');",
- "tool_frontend_mail.gif",FALSE,TRUE);
-
-$listImages[] = "EmailChecks.addImage('email_front','$imagesURL/toolbar/tool_frontend_mail.gif','$imagesURL/toolbar/tool_frontend_mail_f3.gif',1); ";
-
-
-$objListToolBar->Add("divider");
-
-$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
- "swap('viewmenubutton', 'toolbar/tool_view.gif');",
- "ShowViewMenu();","tool_view.gif");
-
-
-$objListToolBar->AddToInitScript($listImages);
-$objListToolBar->AddToInitScript("fwLoadMenus();");
-
-$objEvents = new clsEventList();
-//$objEvents->SourceTable = $objSession->GetEditTable("Events");
-
-$order = trim($objConfig->Get("Event_LV_SortField")." ".$objConfig->Get("Event_LV_SortOrder"));
-
-$SearchWords = $objSession->GetVariable("EmailEventSearchWord");
-$where = "(Module='$module')";
-if(strlen($SearchWords))
- $where .= ' AND '.$objEvents->AdminSearchWhereClause($SearchWords);
-
-/* ----------------------------------------- Set the View Filter ---------------------------------------- */
-$ViewNormal=1;
-$Bit_Disabled=2;
-$Bit_Enabled=1;
-$Bit_FrontOnly=4;
-$Bit_All = 7;
-$FilterLabels[0] = admin_language("la_Text_Enabled");
-$FilterLabels[1] = admin_language("la_Text_Disabled");
-$FilterLabels[2] = admin_language("la_Text_FrontOnly");
-
-/* determine current view menu settings */
-$MsgView = $objConfig->Get("EmailEvent_View");
-
-$ViewNormal=0;
-
-if(!is_numeric($MsgView))
-{
- $MsgView = $Bit_All; //Set all bits ON
- $MsgFilter = "";
-}
-unset($Status);
-$Status = array();
-
-if($MsgView & $Bit_Disabled)
- $Status[] = 0;
-
-if($MsgView & $Bit_Enabled)
- $Status[] = 1;
-
-if($MsgView & $Bit_FrontOnly)
- $Status[] = 2;
-
-if(count($Status)>0)
-{
- $MsgFilter = "Enabled IN (".implode(",",$Status).")";
-}
-else
- $MsgFilter = "Enabled = -1";
-
-$UserTable = GetTablePrefix()."PortalUser";
-$EventTable = GetTablePrefix()."Events";
-$MessageTable = GetTablePrefix()."EmailMessage";
-
-$sql = "SELECT e.Description as Description, e.Module as Module, e.EventId as EventId, ";
-$sql .="ELT(e.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")."','".admin_language("la_Text_FrontOnly")." ') as EmailStatus, ";
-$sql .="ELT(e.Type+1,'".admin_language("la_Text_User")." ','".admin_language("la_Text_Admin")." ') as EventType, ";
-$sql .="u.Login as FromUser FROM $EventTable as e LEFT JOIN $UserTable as u ON (e.FromUserId=u.PortalUserId) WHERE $where ";
-if(strlen($MsgFilter))
- $sql .= "AND $MsgFilter ";
-
-if(strlen(trim($objConfig->Get($SortFieldVar))))
-{
- $order = " ORDER BY ".$objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar);
-}
-else
- $order = "";
-
-if($objConfig->Get($CurrentPageVar)>0)
-{
- $objEvents->Page = $objConfig->Get($CurrentPageVar);
-}
-
-if($objConfig->Get($PerPageVar)>0)
-{
- $objListView->PerPage = $objConfig->Get($PerPageVar);
-}
-
-$sql .= $order." ";
-
-if($objSession->HasSystemPermission("DEBUG.LIST"))
- echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
-
-$objListView = new clsListView($objListToolBar);
-$objListView->CurrentPageVar = $CurrentPageVar;
-$objListView->PerPageVar = $PerPageVar;
-$objListView->extra_env = '&module='.GetVar('module').'&section='.GetVar('section');
-
-$objEvents->Query_Item($sql, $objListView->GetLimitSQL() );
-//$itemcount = TableCount($objEvents->SourceTable, $where, 0);
-$itemcount = QueryCount($sql);
-
-$objListView->SetListItems($objEvents);
-$objListView->IdField = "EventId";
-
-$order = $objConfig->Get($PerPageVar);
-
-$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"Description");
-//$objListView->ColumnHeaders->Add("Module",admin_language("la_prompt_Module"),1,0,$order,"width=\"10%\"","Email_LV_SortField","Email_LV_SortOrder","Module");
-$objListView->ColumnHeaders->Add("EventType",admin_language("la_prompt_Type"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EventType");
-$objListView->ColumnHeaders->Add("EmailStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EmailStatus");
-$objListView->ColumnHeaders->Add("FromUser",admin_language("la_prompt_FromUser"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"FromUser");
-
-$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar));
-
-$objListView->PrintToolBar = FALSE;
-$objListView->checkboxes = TRUE;
-$objListView->CheckboxName = "itemlist[]";
-$objListView->SearchBar = TRUE;
-$objListView->SearchKeywords = $SearchWords;
-$objListView->SearchAction="m_emailevent_search";
-
-$objListView->TotalItemCount = 20; // $itemcount;
-
-$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,
- $CurrentFilterVar,$MsgView,$Bit_All);
-
-foreach($FilterLabels as $Bit=>$Label)
-{
- $objListView->AddViewMenuFilter($Label,$Bit);
-}
-
-for($i=0;$i<count($objEvents->Items);$i++)
-{
- $e =& $objEvents->GetItemRefByIndex($i);
- $e->Set("Description",prompt_language($e->Get("Description")));
-}
-$filter = false; // always initialize variables before use
-if($objSession->GetVariable("EmailEventSearchWord") != '') {
- $filter = true;
-}
-else {
- if ($MsgView != $Bit_All) {
- $filter = true;
- }
-}
-
-$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
-if( !isset($title) ) $title = '';
-int_header($objListToolBar,NULL, $title,NULL,$h);
-if ($filter) { ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<form name="language" ID="language" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar;?>" method=POST>
-<table cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
-<tbody>
-<?php
- print $objListView->PrintList();
-?>
- <input type="hidden" NAME="section" VALUE="<?php echo $section; ?>">
- <input type="hidden" name="Action" value="m_email_edit">
- <input type="hidden" name="LangEditStatus" VALUE="0">
-</FORM>
-<FORM>
-<TR <?php int_table_color(); ?> >
- <td colspan="3">
- </td>
-</tr>
-</FORM>
-</TABLE>
-
-<!-- CODE FOR VIEW MENU -->
-<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="list_search">
-</FORM>
-
-<FORM NAME="popup" METHOD="POST" ACTION="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" ID="popup">
-<INPUT TYPE="HIDDEN" NAME="MessageId" value="">
-<INPUT TYPE="HIDDEN" NAME="LanguageId" value="">
-<INPUT TYPE="HIDDEN" NAME="Enabled" value="">
-<INPUT TYPE="HIDDEN" NAME="Template" value="">
-<INPUT TYPE="HIDDEN" NAME="MessageType" value="">
-<INPUT TYPE="HIDDEN" NAME="Subscribed" value="">
-<INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_emailevent_edit">
-</FORM>
-
-<FORM NAME="userpopup" METHOD="POST" ACTION="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" ID="userpopup">
-<INPUT TYPE="HIDDEN" NAME="EventId" value="">
-<INPUT TYPE="HIDDEN" NAME="FromUserId" value="">
-<INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_emailevent_user">
-</FORM>
-
-<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
-<script>
-initSelectiorContainers();
-<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
-</script>
-<?php int_footer(); ?>
Property changes on: trunk/admin/config/module_email.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.13
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/core/units/categories/categories_config.php
===================================================================
--- trunk/core/units/categories/categories_config.php (revision 4674)
+++ trunk/core/units/categories/categories_config.php (revision 4675)
@@ -1,222 +1,222 @@
<?php
$config = Array(
'Prefix' => 'c',
'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'CategoryLink',
'LocalTagName' => 'CategoryLink',
),
),
'IDField' => 'CategoryId',
'StatusField' => Array('Status'),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_cat_pending.gif',
'label' => 'la_tab_Categories',
'js_url' => "set_persistant_var('Category_View', 41, 'advanced_view', '#url#')",
'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'category', 'pass' => 'm'),
'status' => STATUS_PENDING,
),
),
'TableName' => TABLE_PREFIX.'Category',
'ViewMenuPhrase' => 'la_text_Categories',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'),
'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'),
'new_titlefield' => Array('c' => '!la_title_New_Category!'),
),
'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
'category_items'=> Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Items!"),
'tree_site' => Array('format' => '!la_selecting_categories!'),
),
- 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'custom' => 'in-portal:configuration_custom'),
+ 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'),
'Sections' => Array(
// "Structure & Data" section
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'catalog',
'label' => 'la_tab_Browse',
'url' => Array('index_file' => 'browse.php', 'pass' => 'm'),
'late_load' => Array('t' => 'xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array('index_file' => 'advanced_view.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
- 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'),
+ 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
),
'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'SubItems' => Array('c-cdata', 'c-perm'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
)
),
'Fields' => Array
(
'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Filename' => Array('type' => 'string','not_null' => '1','default' => ''),
'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'),
'EditorsPick' => Array('type' => 'int','default' => ''),
'Status' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Pop' => Array('type' => 'int','default' => ''),
'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
'MetaKeywords' => Array('type' => 'string','default' => ''),
'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''),
'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ResourceId' => Array('type' => 'int','default' => ''),
'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'MetaDescription' => Array('type' => 'string','default' => ''),
'HotItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'NewItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'PopItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
),
'VirtualFields' => Array(
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_cat.gif'),
'Fields' => Array(
'Name' => Array( 'width'=>150, 'title'=>'la_col_Title', 'data_block'=>'category_td' ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_Category',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/core/units/users/users_config.php
===================================================================
--- trunk/core/units/users/users_config.php (revision 4674)
+++ trunk/core/units/users/users_config.php (revision 4675)
@@ -1,267 +1,267 @@
<?php
$config = Array(
'Prefix' => 'u',
'ItemClass' => Array('class'=>'UsersItem','file'=>'users_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'UsersEventHandler','file'=>'users_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'UsersTagProcessor','file'=>'users_tag_processor.php','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo' => 'UsersSyncronizeManager', 'class' => 'UsersSyncronizeManager', 'file' => 'users_syncronize.php', 'build_event' => ''),
),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPrepareStates',
),
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'affil',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCheckAffiliateAgreement'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnSubstituteSubscriber',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'RegularEvents' => Array(
'membership_expiration' => Array('EventName' => 'OnCheckExpiredMembership', 'RunInterval' => 1800, 'Type' => reAFTER),
),
'IDField' => 'PortalUserId',
'StatusField' => Array('Status'),
'TitleField' => 'Login',
'ItemType' => 6, // used for custom fields only (on user's case)
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_user_pending.gif',
'label' => 'la_Text_Users',
'js_url' => "set_persistant_var('User_View', 4, 'users/users_list', '#url#')",
'url' => Array('t' => 'users/users_list', 'index_file' => 'users/user_list.php', 'pass' => 'm'),
'status' => STATUS_PENDING,
),
),
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('u'=>'!la_title_Adding_User!'),
'edit_status_labels' => Array('u'=>'!la_title_Editing_User!'),
'new_titlefield' => Array('u'=>'!la_title_New_User!'),
),
'users_list' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#)"),
'users_edit' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_General!"),
'users_select' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"),
'tree_users' => Array('format' => '!la_section_overview!'),
),
- 'PermSection' => Array('main' => 'in-portal:user_list', 'custom' => 'in-portal:user_custom'),
+ 'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'),
'Sections' => Array(
'in-portal:users' => Array(
'parent' => 'in-portal:root',
'icon' => 'community',
'label' => 'la_tab_Community',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:user_list' => Array(
'parent' => 'in-portal:users',
'icon' => 'users',
'label' => 'la_tab_User_List',
'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', 'advanced:add_favorite', 'advanced:remove_favorite',),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_users' => Array(
'parent' => 'in-portal:users',
'icon' => 'users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array(
'parent' => 'in-portal:users',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
- 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Users', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'),
+ 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array(
'parent' => 'in-portal:users',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array(
'parent' => 'in-portal:users',
'icon' => 'banlist',
'label' => 'la_tab_BanList',
'url' => Array('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit'),
'priority' => 6,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'PortalUser',
'ListSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ItemSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Login' => 'asc'),
)
),
'SubItems' => Array('addr', 'u-cdata', 'u-ug', 'fav'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'PrimaryGroup' => 'g.Name',
),
),
'Fields' => Array
(
'PortalUserId' => Array(),
'Login' => Array('type' => 'string', 'unique'=>Array('Login'), 'default' => '','required'=>1, 'error_msgs' => Array('unique'=>'!lu_user_already_exist!')),
'Password' => Array('type' => 'string', 'formatter' => 'kPasswordFormatter', 'encryption_method' => 'md5', 'verify_field' => 'VerifyPassword', 'skip_empty' => 1, 'default' => md5('') ),
'FirstName' => Array('type' => 'string','default' => ''),
'LastName' => Array('type' => 'string','default' => ''),
'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/', 'unique'=>Array('Email'), 'not_null' => '1', 'required'=>1, 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!') ),
'CreatedOn' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => '1' ),
'Phone' => Array('type' => 'string','default' => ''),
'Fax' => Array('type' => 'string','not_null' => '1','default' => ''),
'Street' => Array('type' => 'string','default' => ''),
'Street2' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'City' => Array('type' => 'string','default' => ''),
'State' => Array('formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'Zip' => Array('type' => 'string','default' => ''),
'Country' => Array('formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
'Modified' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1', 'default' => '#NOW#' ),
'dob' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'not_null' => '1', 'default' => '', 'required'=>1),
'tz' => Array('type' => 'int','default' => ''),
'ip' => Array('type' => 'string','default' => ''),
'IsBanned' => Array('type' => 'int','not_null' => '1','default' => '0'),
'PassResetTime' => Array('type' => 'int','default' => ''),
'PwResetConfirm' => Array('type' => 'string','default' => ''),
'PwRequestTime' => Array('type' => 'int','default' => ''),
'MinPwResetDelay' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array('300' => '5', '600' => '10', '900' => '15', '1800' => '30', '3600' => '60'), 'use_phrases' => 0, 'not_null' => '1', 'default' => 30),
),
'VirtualFields' => Array(
'ValidateLogin' => Array('type'=>'string','default'=>''),
'SubscribeEmail' => Array('type'=>'string','default'=>''),
'PrimaryGroup' => Array('type' => 'string', 'default' => ''),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array(
'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_checkbox_td'),
'LastName' => Array( 'title'=>'la_col_LastName'),
'FirstName' => Array( 'title'=>'la_col_FirstName'),
'Email' => Array( 'title'=>'la_col_Email'),
'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
),
),
'UserSelector' => Array(
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array(
'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_radio_td'),
'LastName' => Array( 'title'=>'la_col_LastName'),
'FirstName' => Array( 'title'=>'la_col_FirstName'),
'Email' => Array( 'title'=>'la_col_Email'),
'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.27
\ No newline at end of property
+1.28
\ No newline at end of property
Index: trunk/core/units/email_events/email_events_event_handler.php
===================================================================
--- trunk/core/units/email_events/email_events_event_handler.php (revision 4674)
+++ trunk/core/units/email_events/email_events_event_handler.php (revision 4675)
@@ -1,274 +1,276 @@
<?php
class EmailEventsEventsHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnFrontOnly' => Array('self' => 'edit'),
- 'OnSaveSelected' => Array('self' => 'add|edit'),
+ 'OnSaveSelected' => Array('self' => 'view'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$module = $this->Application->GetVar('module');
$module = explode(':', $module, 2);
+
if (count($module) == 1) {
$main_prefix = $this->Application->findModule('Name', $module[0], 'Var');
}
else {
$exceptions = Array('Category' => 'c', 'Users' => 'u');
$main_prefix = $exceptions[ $module[1] ];
}
$section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection');
+
$event->setEventParam('PermSection', $section);
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'module') {
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
}
/**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
*/
function OnFrontOnly(&$event)
{
$ids = implode(',', $this->StoreSelectedIDs($event));
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET Enabled = 2
WHERE EventId IN ('.$ids.')';
$this->Conn->Query($sql);
}
/**
* Sets selected user to email events selected
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event){
$email_event = $event->getEventParam('EmailEventName');
if( strpos($email_event, '_') !== false )
{
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
$to_user_id = $event->getEventParam('EmailEventToUserId');
$email_event_type = $event->getEventParam('EmailEventType');
$this->Application->setUnitOption('emailmessages', 'AutoLoad', false);
$message_object = &$this->Application->recallObject('emailmessages');
$event_table = $this->Application->getUnitOption('emailevents', 'TableName');
$event_object = &$event->getObject();
$event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
$event_id = $event_object->GetDBField('EventId');
$from_user_id = $event_object->GetDBField('FromUserId');
$type = $event_object->GetDBField('Type');
$enabled = $event_object->GetDBField('Enabled');
$direct_send_params = $event->getEventParam('DirectSendParams');
if ($enabled == 0) return; // disabled event
if ($enabled == 2 && $this->Application->IsAdmin() ) return; // event only for front-end
if ($type == 1){
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
/*
if (!($to_user_id > 0) && !$direct_send_params){
// if we can not determine recepient we will not send email
return;
}
*/
//Parse Message Template
$message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
$message_type = $message_object->GetDBField('MessageType');
// add footer: begin
$sql = 'SELECT em.Template
FROM '.$message_object->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$message_object->GetDBField('LanguageId').' AND e.Event = "COMMON.FOOTER"';
$footer = explode("\n\n", $this->Conn->GetOne($sql));
$footer = $message_object->GetDBField('MessageType') == 'text' ? strip_tags($footer[1]) : $footer[1];
$message_template = $message_object->GetDBField('Template')."\r\n".$footer;
// add footer: end
$email_object = &$this->Application->recallObject('kEmailMessage');
$email_object->Clear();
$old_autoload = $this->Application->getUnitOption('u', 'AutoLoad');
$this->Application->setUnitOption('u', 'AutoLoad', false);
$from_user_object = &$this->Application->recallObject('u.-email'.$from_user_id);
$from_user_object->Load($from_user_id);
// here if we don't have from_user loaded, it takes a default user from config values
if ( $from_user_object->IsLoaded() ) {
$from_user_email = $from_user_object->GetDBField('Email');
$from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
}
else {
$from_user_email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
$to_user_object = &$this->Application->recallObject('u.-email'.$to_user_id);
$to_user_object->Load($to_user_id);
$to_user_email = $to_user_object->GetDBField('Email');
$to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
$this->Application->setUnitOption('u', 'AutoLoad', $old_autoload);
if($direct_send_params){
$to_user_email = ( $direct_send_params['to_email'] ? $direct_send_params['to_email'] : $to_user_email );
$to_user_name = ( $direct_send_params['to_name'] ? $direct_send_params['to_name'] : $to_user_name );
$from_user_email = ( $direct_send_params['from_email'] ? $direct_send_params['from_email'] : $from_user_email);
$from_user_name = ( $direct_send_params['from_name'] ? $direct_send_params['from_name'] : $from_user_name );
$message_body_additional = $direct_send_params['message'];
}
$to_user_email = $to_user_email ? $to_user_email : $this->Application->ConfigValue('Smtp_AdminMailFrom');
$this->Application->makeClass('Template');
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params;
$direct_send_params['message_text'] = $message_body_additional;
$this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_send_params);
$message_template = str_replace('<inp:touser _Field', '<inp2:u_Field name', $message_template);
$message_template = $this->Application->Parser->Parse($message_template, 'email_template', 0);
$this->Application->Parser->Params = $parser_params;
$message_template = str_replace("\r", "", $message_template);
list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
$email_object->setFrom($from_user_email, $from_user_name);
$email_object->setTo($to_user_email, $to_user_name);
$email_object->setSubject('Mail message');
$email_object->setHeaders($message_headers);
if ($message_type == 'html'){
$email_object->setHTMLBody($message_body);
}
else {
$email_object->setTextBody($message_body);
}
$smtp_object = &$this->Application->recallObject('kSmtpClient');
$smtp_server = $this->Application->ConfigValue('Smtp_Server');
$smtp_port = $this->Application->ConfigValue('Smtp_Port');
$smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
if ($smtp_authenticate){
$smtp_user = $this->Application->ConfigValue('Smtp_User');
$smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
}else{
$smtp_user = '';
$smtp_pass = '';
}
if ($smtp_server){
if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}else{
if($email_object->send()){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}
if ($event->status == erSUCCESS){
if (!$from_user_name) {
$from_user_name = strip_tags( $this->Application->ConfigValue('Site_Name') );
}
$sql = 'INSERT INTO '.TABLE_PREFIX.'EmailLog SET
fromuser = '.$this->Conn->qstr($from_user_name.' ('.$from_user_email.')').',
addressto = '.$this->Conn->qstr($to_user_name.' ('.$to_user_email.')').',
subject = '.$this->Conn->qstr($email_object->Subject).',
timestamp = UNIX_TIMESTAMP(),
event = '.$this->Conn->qstr($email_event);
$this->Conn->Query($sql);
}
return $event;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/email_events/email_events_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property

Event Timeline