Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Nov 21, 7:37 PM

in-portal

Index: branches/unlabeled/unlabeled-1.76.2/admin/install/inportal_data.sql
===================================================================
--- branches/unlabeled/unlabeled-1.76.2/admin/install/inportal_data.sql (nonexistent)
+++ branches/unlabeled/unlabeled-1.76.2/admin/install/inportal_data.sql (revision 8121)
@@ -0,0 +1,228 @@
+INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
+INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
+
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.ADD', 'lu_PermName_Category.Add_desc', 'lu_PermName_Category.Add_error', 'In-Portal');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.DELETE', 'lu_PermName_Category.Delete_desc', 'lu_PermName_Category.Delete_error', 'In-Portal');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 'lu_PermName_Category.AddPending_desc', 'lu_PermName_Category.AddPending_error', 'In-Portal');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.MODIFY', 'lu_PermName_Category.Modify_desc', 'lu_PermName_Category.Modify_error', 'In-Portal');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'ADMIN', 'lu_PermName_Admin_desc', 'lu_PermName_Admin_error', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'LOGIN', 'lu_PermName_Login_desc', 'lu_PermName_Admin_error', 'Front');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.ITEM', 'lu_PermName_Debug.Item_desc', '', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.LIST', 'lu_PermName_Debug.List_desc', '', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.INFO', 'lu_PermName_Debug.Info_desc', '', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'PROFILE.MODIFY', 'lu_PermName_Profile.Modify_desc', '', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'SHOWLANG', 'lu_PermName_ShowLang_desc', '', 'Admin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'FAVORITES', 'lu_PermName_favorites_desc', 'lu_PermName_favorites_error', 'In-Portal');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'SYSTEM_ACCESS.READONLY', 'la_PermName_SystemAccess.ReadOnly_desc', 'la_PermName_SystemAccess.ReadOnly_error', 'Admin');
+
+INSERT INTO Permissions VALUES (DEFAULT, 'LOGIN', 12, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:browse.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:advanced_view.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:reviews.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_categories.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_categories.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:users.view', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_list.advanced:ban', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_list.advanced:send_email', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.advanced:send_email', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.advanced:manage_permissions', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_users.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_users.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:reports.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:log_summary.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:searchlog.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:searchlog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sessionlog.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sessionlog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:visits.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:visits.delete', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:modules.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.advanced:approve', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.advanced:decline', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:tag_library.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.delete', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:set_primary', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:import', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:export', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:tools.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:backup.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:restore.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:export.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:main_import.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sql_query.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sql_query.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:server_info.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:help.view', 11, 1, 1, 0);
+
+INSERT INTO SearchConfig VALUES ('Category', 'NewItem', 0, 1, 'lu_fielddesc_category_newitem', 'lu_field_newitem', 'In-Portal', 'la_text_category', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'PopItem', 0, 1, 'lu_fielddesc_category_popitem', 'lu_field_popitem', 'In-Portal', 'la_text_category', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'HotItem', 0, 1, 'lu_fielddesc_category_hotitem', 'lu_field_hotitem', 'In-Portal', 'la_text_category', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'MetaDescription', 0, 1, 'lu_fielddesc_category_metadescription', 'lu_field_metadescription', 'In-Portal', 'la_text_category', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'ParentPath', 0, 1, 'lu_fielddesc_category_parentpath', 'lu_field_parentpath', 'In-Portal', 'la_text_category', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'ResourceId', 0, 1, 'lu_fielddesc_category_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_category', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'CreatedById', 0, 1, 'lu_fielddesc_category_createdbyid', 'lu_field_createdbyid', 'In-Portal', 'la_text_category', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'CachedNavbar', 0, 1, 'lu_fielddesc_category_cachednavbar', 'lu_field_cachednavbar', 'In-Portal', 'la_text_category', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'CachedDescendantCatsQty', 0, 1, 'lu_fielddesc_category_cacheddescendantcatsqty', 'lu_field_cacheddescendantcatsqty', 'In-Portal', 'la_text_category', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'MetaKeywords', 0, 1, 'lu_fielddesc_category_metakeywords', 'lu_field_metakeywords', 'In-Portal', 'la_text_category', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'Priority', 0, 1, 'lu_fielddesc_category_priority', 'lu_field_priority', 'In-Portal', 'la_text_category', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'Status', 0, 1, 'lu_fielddesc_category_status', 'lu_field_status', 'In-Portal', 'la_text_category', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'EditorsPick', 0, 1, 'lu_fielddesc_category_editorspick', 'lu_field_editorspick', 'In-Portal', 'la_text_category', 6, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'CreatedOn', 0, 1, 'lu_fielddesc_category_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_category', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'Description', 1, 1, 'lu_fielddesc_category_description', 'lu_field_description', 'In-Portal', 'la_text_category', 4, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'Name', 1, 1, 'lu_fielddesc_category_name', 'lu_field_name', 'In-Portal', 'la_text_category', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'ParentId', 0, 1, 'lu_fielddesc_category_parentid', 'lu_field_parentid', 'In-Portal', 'la_text_category', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lu_field_categoryid', 'In-Portal', 'la_text_category', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lu_field_modified', 'In-Portal', 'la_text_category', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lu_field_modifiedbyid', 'In-Portal', 'la_text_category', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', -1, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Login', -1, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', -1, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', -1, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', -1, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', -1, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', -1, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', -1, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', -1, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', -1, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'State', -1, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'City', -1, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', -1, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', -1, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', -1, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', -1, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', -1, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', -1, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>Category WHERE Status=1 ', NULL, 'la_prompt_ActiveCategories', '0', '1');
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>PortalUser WHERE Status=1 ', NULL, 'la_prompt_ActiveUsers', '0', '1');
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>UserSession', NULL, 'la_prompt_CurrentSessions', '0', '1');
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) as CategoryCount FROM <%prefix%>Category', NULL, 'la_prompt_TotalCategories', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ActiveCategories FROM <%prefix%>Category WHERE Status = 1', NULL, 'la_prompt_ActiveCategories', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS PendingCategories FROM <%prefix%>Category WHERE Status = 2', NULL, 'la_prompt_PendingCategories', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS DisabledCategories FROM <%prefix%>Category WHERE Status = 0', NULL, 'la_prompt_DisabledCategories', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS NewCategories FROM <%prefix%>Category WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Category_DaysNew"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewCategories', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) FROM <%prefix%>Category WHERE EditorsPick = 1', NULL, 'la_prompt_CategoryEditorsPick', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_NewestCategoryDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_LastCategoryUpdate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS TotalUsers FROM <%prefix%>PortalUser', NULL, 'la_prompt_TopicsUsers', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ActiveUsers FROM <%prefix%>PortalUser WHERE Status = 1', NULL, 'la_prompt_UsersActive', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS PendingUsers FROM <%prefix%>PortalUser WHERE Status = 2', NULL, 'la_prompt_UsersPending', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS DisabledUsers FROM <%prefix%>PortalUser WHERE Status = 0', NULL, 'la_prompt_UsersDisabled', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>PortalUser', NULL, 'la_prompt_NewestUserDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( Country ) ) FROM <%prefix%>PortalUser WHERE LENGTH(Country) > 0', NULL, 'la_prompt_UsersUniqueCountries', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( State ) ) FROM <%prefix%>PortalUser WHERE LENGTH(State) > 0', NULL, 'la_prompt_UsersUniqueStates', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS TotalUserGroups FROM <%prefix%>PortalGroup', NULL, 'la_prompt_TotalUserGroups', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS BannedUsers FROM <%prefix%>PortalUser WHERE IsBanned = 1', NULL, 'la_prompt_BannedUsers', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS NonExipedSessions FROM <%prefix%>UserSession WHERE Status = 1', NULL, 'la_prompt_NonExpiredSessions', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ThemeCount FROM <%prefix%>Theme', NULL, 'la_prompt_ThemeCount', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS RegionsCount FROM <%prefix%>Language', NULL, 'la_prompt_RegionsCount', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:sql_action sql="SHOW+TABLES" action="COUNT" field="*"%>', NULL, 'la_prompt_TablesCount', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" field="Rows"%>', NULL, 'la_prompt_RecordsCount', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:custom_action sql="empty" action="SysFileSize"%>', NULL, 'la_prompt_SystemFileSize', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" format_as="file" field="Data_length"%>', NULL, 'la_prompt_DataSize', 0, 2);
+
+INSERT INTO StylesheetSelectors VALUES (169, 8, 'Calendar''s selected days', '.calendar tbody .selected', 'a:0:{}', '', 1, 'font-weight: bold;\r\nbackground-color: #9ED7ED;\r\nborder: 1px solid #83B2C5;', 0);
+INSERT INTO StylesheetSelectors VALUES (118, 8, 'Data grid row', 'td.block-data-row', 'a:0:{}', '', 2, 'border-bottom: 1px solid #cccccc;', 48);
+INSERT INTO StylesheetSelectors VALUES (81, 8, '"More" link', 'a.link-more', 'a:0:{}', '', 2, 'text-decoration: underline;', 64);
+INSERT INTO StylesheetSelectors VALUES (88, 8, 'Block data, separated rows', 'td.block-data-grid', 'a:0:{}', '', 2, 'border: 1px solid #cccccc;', 48);
+INSERT INTO StylesheetSelectors VALUES (42, 8, 'Block Header', 'td.block-header', 'a:4:{s:5:"color";s:16:"rgb(0, 159, 240)";s:9:"font-size";s:4:"20px";s:11:"font-weight";s:6:"normal";s:7:"padding";s:3:"5px";}', 'Block Header', 1, 'font-family: Verdana, Helvetica, sans-serif;', 0);
+INSERT INTO StylesheetSelectors VALUES (76, 8, 'Navigation bar menu', 'tr.head-nav td', 'a:0:{}', '', 1, 'vertical-align: middle;', 0);
+INSERT INTO StylesheetSelectors VALUES (48, 8, 'Block data', 'td.block-data', 'a:2:{s:9:"font-size";s:5:"12px;";s:7:"padding";s:3:"5px";}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (78, 8, 'Body main style', 'body', 'a:0:{}', '', 1, 'padding: 0px; \r\nbackground-color: #ffffff; \r\nfont-family: arial, verdana, helvetica; \r\nfont-size: small;\r\nwidth: auto;\r\nmargin: 0px;', 0);
+INSERT INTO StylesheetSelectors VALUES (58, 8, 'Main table', 'table.main-table', 'a:0:{}', '', 1, 'width: 770px;\r\nmargin: 0px;\r\n/*table-layout: fixed;*/', 0);
+INSERT INTO StylesheetSelectors VALUES (79, 8, 'Block: header of data block', 'span.block-data-grid-header', 'a:0:{}', '', 1, 'font-family: Arial, Helvetica, sans-serif;\r\ncolor: #009DF6;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\nbackground-color: #E6EEFF;\r\npadding: 6px;\r\nwhite-space: nowrap;', 0);
+INSERT INTO StylesheetSelectors VALUES (64, 8, 'Link', 'a', 'a:0:{}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (46, 8, 'Product title link', 'a.link-product1', 'a:0:{}', 'Product title link', 1, 'color: #62A1DE;\r\nfont-size: 14px;\r\nfont-weight: bold;\r\nline-height: 20px;\r\npadding-bottom: 10px;', 0);
+INSERT INTO StylesheetSelectors VALUES (75, 8, 'Copy of Main path link', 'table.main-path td a:hover', 'a:0:{}', '', 1, 'color: #ffffff;', 0);
+INSERT INTO StylesheetSelectors VALUES (160, 8, 'Current item in navigation bar', '.checkout-step-current', 'a:0:{}', '', 1, 'color: #A20303;\r\nfont-weight: bold;', 0);
+INSERT INTO StylesheetSelectors VALUES (51, 8, 'Right block data', 'td.right-block-data', 'a:1:{s:9:"font-size";s:4:"11px";}', '', 2, 'padding: 7px;\r\nbackground: #e3edf6 url("/in-commerce4/themes/default/img/bgr_login.jpg") repeat-y scroll left top;\r\nborder-bottom: 1px solid #64a1df;', 48);
+INSERT INTO StylesheetSelectors VALUES (67, 8, 'Pagination bar: text', 'table.block-pagination td', 'a:3:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"12px";s:11:"font-weight";s:6:"normal";}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (45, 8, 'Category link', 'a.subcat', 'a:0:{}', 'Category link', 1, 'color: #2069A4', 0);
+INSERT INTO StylesheetSelectors VALUES (68, 8, 'Pagination bar: link', 'table.block-pagination td a', 'a:3:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:5:"12px;";s:11:"font-weight";s:6:"normal";}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (69, 8, 'Product description in product list', '.product-list-description', 'a:2:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"12px";}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (73, 8, 'Main path link', 'table.main-path td a', 'a:0:{}', '', 1, 'color: #d5e231;', 0);
+INSERT INTO StylesheetSelectors VALUES (83, 8, 'Product title link in list (shopping cart)', 'a.link-product-cart', 'a:0:{}', 'Product title link', 1, 'color: #18559C;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
+INSERT INTO StylesheetSelectors VALUES (72, 8, 'Main path block text', 'table.main-path td', 'a:0:{}', '', 1, 'color: #ffffff;\r\nfont-size: 10px;\r\nfont-weight: normal;\r\npadding: 1px;\r\n', 0);
+INSERT INTO StylesheetSelectors VALUES (61, 8, 'Block: header of data table', 'td.block-data-grid-header', 'a:6:{s:4:"font";s:28:"Arial, Helvetica, sans-serif";s:5:"color";s:7:"#009DF6";s:9:"font-size";s:4:"12px";s:11:"font-weight";s:4:"bold";s:16:"background-color";s:7:"#E6EEFF";s:7:"padding";s:3:"6px";}', '', 1, 'white-space: nowrap;\r\npadding-left: 10px;\r\n/*\r\nbackground-image: url(/in-commerce4/themes/default/img/bullet1.gif);\r\nbackground-position: 10px 12px;\r\nbackground-repeat: no-repeat;\r\n*/', 0);
+INSERT INTO StylesheetSelectors VALUES (65, 8, 'Link in product list additional row', 'td.product-list-additional a', 'a:1:{s:5:"color";s:7:"#8B898B";}', '', 2, '', 64);
+INSERT INTO StylesheetSelectors VALUES (55, 8, 'Main table, left column', 'td.main-column-left', 'a:0:{}', '', 1, 'width:180px;\r\nborder: 1px solid #62A1DE;\r\nborder-top: 0px;', 0);
+INSERT INTO StylesheetSelectors VALUES (70, 8, 'Product title link in list (category)', 'a.link-product-category', 'a:0:{}', 'Product title link', 1, 'color: #18559C;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
+INSERT INTO StylesheetSelectors VALUES (66, 8, 'Pagination bar block', 'table.block-pagination', 'a:0:{}', '', 1, '', 0);
+INSERT INTO StylesheetSelectors VALUES (49, 8, 'Bulleted list inside block', 'td.block-data ul li', 'a:0:{}', '', 1, ' list-style-image: url(/in-commerce4/themes/default/img/bullet2.gif);\r\n margin-bottom: 10px;\r\n font-size: 11px;', 0);
+INSERT INTO StylesheetSelectors VALUES (87, 8, 'Cart item input form element', 'td.cart-item-atributes input', 'a:0:{}', '', 1, 'border: 1px solid #7BB2E6;', 0);
+INSERT INTO StylesheetSelectors VALUES (119, 8, 'Data grid row header', 'td.block-data-row-hdr', 'a:0:{}', 'Used in order preview', 2, 'background-color: #eeeeee;\r\nborder-bottom: 1px solid #dddddd;\r\nborder-top: 1px solid #cccccc;\r\nfont-weight: bold;', 48);
+INSERT INTO StylesheetSelectors VALUES (82, 8, '"More" link image', 'a.link-more img', 'a:0:{}', '', 2, 'text-decoration: none;\r\npadding-left: 5px;', 64);
+INSERT INTO StylesheetSelectors VALUES (63, 8, 'Additional info under product description in list', 'td.product-list-additional', 'a:5:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"11px";s:11:"font-weight";s:6:"normal";s:10:"border-top";s:18:"1px dashed #8B898B";s:13:"border-bottom";s:18:"1px dashed #8B898B";}', '', 2, '', 48);
+INSERT INTO StylesheetSelectors VALUES (43, 8, 'Block', 'table.block', 'a:2:{s:16:"background-color";s:7:"#E3EEF9";s:6:"border";s:17:"1px solid #64A1DF";}', 'Block', 1, 'border: 0; \r\nmargin-bottom: 1px;\r\nwidth: 100%;', 0);
+INSERT INTO StylesheetSelectors VALUES (84, 8, 'Cart item cell', 'td.cart-item', 'a:0:{}', '', 1, 'background-color: #F6FAFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 4px;', 0);
+INSERT INTO StylesheetSelectors VALUES (57, 8, 'Main table, right column', 'td.main-column-right', 'a:0:{}', '', 1, 'width:220px;\r\nborder: 1px solid #62A1DE;\r\nborder-top: 0px;', 0);
+INSERT INTO StylesheetSelectors VALUES (161, 8, 'Block for sub categories', 'td.block-data-subcats', 'a:0:{}', '', 2, ' background: #FFFFFF\r\nurl(/in-commerce4/themes/default/in-commerce/img/bgr_categories.jpg);\r\n background-repeat: no-repeat;\r\n background-position: top right;\r\nborder-bottom: 5px solid #DEEAFF;\r\npadding-left: 10px;', 48);
+INSERT INTO StylesheetSelectors VALUES (77, 8, 'Left block header', 'td.left-block-header', 'a:0:{}', '', 2, 'font-family : verdana, helvetica, sans-serif;\r\ncolor : #ffffff;\r\nfont-size : 12px;\r\nfont-weight : bold;\r\ntext-decoration : none;\r\nbackground-color: #64a1df;\r\npadding: 5px;\r\npadding-left: 7px;', 42);
+INSERT INTO StylesheetSelectors VALUES (80, 8, 'Right block data - text', 'td.right-block-data td', 'a:1:{s:9:"font-size";s:5:"11px;";}', '', 2, '', 48);
+INSERT INTO StylesheetSelectors VALUES (53, 8, 'Right block header', 'td.right-block-header', 'a:0:{}', '', 2, 'font-family : verdana, helvetica, sans-serif;\r\ncolor : #ffffff;\r\nfont-size : 12px;\r\nfont-weight : bold;\r\ntext-decoration : none;\r\nbackground-color: #64a1df;\r\npadding: 5px;\r\npadding-left: 7px;', 42);
+INSERT INTO StylesheetSelectors VALUES (85, 8, 'Cart item cell with attributes', 'td.cart-item-attributes', 'a:0:{}', '', 1, 'background-color: #E6EEFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 4px;\r\ntext-align: center;\r\nvertical-align: middle;\r\nfont-size: 12px;\r\nfont-weight: normal;', 0);
+INSERT INTO StylesheetSelectors VALUES (86, 8, 'Cart item cell with name', 'td.cart-item-name', 'a:0:{}', '', 1, 'background-color: #F6FAFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 3px;', 0);
+INSERT INTO StylesheetSelectors VALUES (47, 8, 'Block content of featured product', 'td.featured-block-data', 'a:0:{}', '', 1, 'font-family: Arial,Helvetica,sans-serif;\r\nfont-size: 12px;', 0);
+INSERT INTO StylesheetSelectors VALUES (56, 8, 'Main table, middle column', 'td.main-column-center', 'a:0:{}', '', 1, '\r\n', 0);
+INSERT INTO StylesheetSelectors VALUES (50, 8, 'Product title link in list', 'a.link-product2', 'a:0:{}', 'Product title link', 1, 'color: #62A1DE;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
+INSERT INTO StylesheetSelectors VALUES (71, 8, 'Main path block', 'table.main-path', 'a:0:{}', '', 1, 'background: #61b0ec url("/in-commerce4/themes/default/img/bgr_path.jpg") repeat-y scroll left top;\r\nwidth: 100%;\r\nmargin-bottom: 1px;\r\nmargin-right: 1px; \r\nmargin-left: 1px;', 0);
+INSERT INTO StylesheetSelectors VALUES (62, 8, 'Block: columns header for data table', 'table.block-no-border th', 'a:6:{s:4:"font";s:28:"Arial, Helvetica, sans-serif";s:5:"color";s:7:"#18559C";s:9:"font-size";s:4:"11px";s:11:"font-weight";s:4:"bold";s:16:"background-color";s:7:"#B4D2EE";s:7:"padding";s:3:"6px";}', '', 1, 'text-align: left;', 0);
+INSERT INTO StylesheetSelectors VALUES (59, 8, 'Block without border', 'table.block-no-border', 'a:0:{}', '', 1, 'border: 0px; \r\nmargin-bottom: 10px;\r\nwidth: 100%;', 0);
+INSERT INTO StylesheetSelectors VALUES (74, 8, 'Main path language selector cell', 'td.main-path-language', 'a:0:{}', '', 1, 'vertical-align: middle;\r\ntext-align: right;\r\npadding-right: 6px;', 0);
+INSERT INTO StylesheetSelectors VALUES (171, 8, 'Calendar''s highlighted day', '.calendar tbody .hilite', 'a:0:{}', '', 1, 'background-color: #f6f6f6;\r\nborder: 1px solid #83B2C5 !important;', 0);
+INSERT INTO StylesheetSelectors VALUES (175, 8, 'Calendar''s days', '.calendar tbody .day', 'a:0:{}', '', 1, 'text-align: right;\r\npadding: 2px 4px 2px 2px;\r\nwidth: 2em;\r\nborder: 1px solid #fefefe;', 0);
+INSERT INTO StylesheetSelectors VALUES (170, 8, 'Calendar''s weekends', '.calendar .weekend', 'a:0:{}', '', 1, 'color: #990000;', 0);
+INSERT INTO StylesheetSelectors VALUES (173, 8, 'Calendar''s control buttons', '.calendar .calendar_button', 'a:0:{}', '', 1, 'color: black;\r\nfont-size: 12px;\r\nbackground-color: #eeeeee;', 0);
+INSERT INTO StylesheetSelectors VALUES (174, 8, 'Calendar''s day names', '.calendar thead .name', 'a:0:{}', '', 1, 'background-color: #DEEEF6;\r\nborder-bottom: 1px solid #000000;', 0);
+INSERT INTO StylesheetSelectors VALUES (172, 8, 'Calendar''s top and bottom titles', '.calendar .title', 'a:0:{}', '', 1, 'color: #FFFFFF;\r\nbackground-color: #62A1DE;\r\nborder: 1px solid #107DC5;\r\nborder-top: 0px;\r\npadding: 1px;', 0);
+INSERT INTO StylesheetSelectors VALUES (60, 8, 'Block header for featured product', 'td.featured-block-header', 'a:0:{}', '', 2, '\r\n', 42);
+INSERT INTO StylesheetSelectors VALUES (54, 8, 'Right block', 'table.right-block', 'a:0:{}', '', 2, 'background-color: #E3EEF9;\r\nborder: 0px;\r\nwidth: 100%;', 43);
+INSERT INTO StylesheetSelectors VALUES (44, 8, 'Block content', 'td.block-data-big', 'a:0:{}', 'Block content', 1, ' background: #DEEEF6\r\nurl(/in-commerce4/themes/default/img/menu_bg.gif);\r\n background-repeat: no-repeat;\r\n background-position: top right;\r\n', 0);
+
+INSERT INTO Stylesheets VALUES (8, 'Default', 'In-Portal Default Theme', '', 1124952555, 1);
+
+INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.0.2', 1, 0, '', 0, '1054738405');
Property changes on: branches/unlabeled/unlabeled-1.76.2/admin/install/inportal_data.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.76
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php
===================================================================
--- branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (revision 8121)
@@ -0,0 +1,742 @@
+<?php
+
+class kUnitConfigReader extends kBase {
+
+ /**
+ * Configs readed
+ *
+ * @var Array
+ * @access private
+ */
+ var $configData=Array();
+ var $configFiles=Array();
+
+ var $CacheExpired = false;
+
+ var $prefixFiles = array();
+
+ var $ProcessAllConfigs = false;
+ var $FinalStage = false;
+ var $StoreCache = false;
+ var $AfterConfigProcessed = array();
+
+ /**
+ * Scan kernel and user classes
+ * for available configs
+ *
+ * @access protected
+ */
+ function Init($prefix,$special)
+ {
+ parent::Init($prefix,$special);
+ }
+
+ function CacheParsedData()
+ {
+ $event_manager =& $this->Application->recallObject('EventManager');
+ $aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
+
+ $config_vars = Array(
+ 'SessionTimeout',
+ 'SessionCookieName',
+ 'SessionReferrerCheck',
+ 'CookieSessions',
+ 'UseCronForRegularEvent',
+ 'User_GuestGroup',
+ 'User_LoggedInGroup',
+ 'SessionTimeout',
+ 'UseModRewrite',
+ 'UseOutputCompression',
+ 'OutputCompressionLevel',
+ );
+
+ foreach ($config_vars as $var) {
+ $this->Application->ConfigValue($var);
+ }
+
+ $cache = Array(
+ 'Factory.Files' => $this->Application->Factory->Files,
+ 'Factory.realClasses' => $this->Application->Factory->realClasses,
+ 'Factory.Dependencies' => $this->Application->Factory->Dependencies,
+ 'ConfigReader.prefixFiles' => $this->prefixFiles,
+ 'EventManager.buildEvents' => $event_manager->buildEvents,
+ 'EventManager.beforeRegularEvents' => $event_manager->beforeRegularEvents,
+ 'EventManager.afterRegularEvents' => $event_manager->afterRegularEvents,
+ 'EventManager.beforeHooks' => $event_manager->beforeHooks,
+ 'EventManager.afterHooks' => $event_manager->afterHooks,
+ 'TagsAggregator.data' => $aggregator->_Array,
+
+ // the following caches should be reset based on admin interaction (adjusting config, enabling modules etc)
+ 'Application.Caches.ConfigVariables' => $this->Application->Caches['ConfigVariables'],
+ 'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
+ 'Application.ConfigHash' => $this->Application->ConfigHash,
+ 'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
+ 'Application.ModuleInfo' => $this->Application->ModuleInfo,
+ );
+
+ $conn =& $this->Application->GetADODBConnection();
+ $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("configs_parsed", '.$conn->qstr(serialize($cache)).', '.adodb_mktime().')');
+ $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')');
+ unset($this->configFiles);
+ }
+
+ function RestoreParsedData()
+ {
+ $conn =& $this->Application->GetADODBConnection();
+ $data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
+ if ($data && $data['Cached'] > 0 ) {
+ $cache = unserialize($data['Data']);
+ $this->Application->Factory->Files = $cache['Factory.Files'];
+ $this->Application->Factory->realClasses = $cache['Factory.realClasses'];
+ $this->Application->Factory->Dependencies = $cache['Factory.Dependencies'];
+ $this->prefixFiles = $cache['ConfigReader.prefixFiles'];
+
+ $event_manager =& $this->Application->recallObject('EventManager');
+ $event_manager->buildEvents = $cache['EventManager.buildEvents'];
+ $event_manager->beforeRegularEvents = $cache['EventManager.beforeRegularEvents'];
+ $event_manager->afterRegularEvents = $cache['EventManager.afterRegularEvents'];
+ $event_manager->beforeHooks = $cache['EventManager.beforeHooks'];
+ $event_manager->afterHooks = $cache['EventManager.afterHooks'];
+
+ $aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
+ $aggregator->_Array = $cache['TagsAggregator.data'];
+
+ $this->Application->ConfigHash = $cache['Application.ConfigHash'];
+
+ $this->Application->Caches['ConfigVariables'] = $cache['Application.ConfigCacheIds'];
+ $this->Application->ConfigCacheIds = $cache['Application.ConfigCacheIds'];
+
+ $this->Application->ReplacementTemplates = $cache['Application.ReplacementTemplates'];
+
+ $this->Application->ModuleInfo = $cache['Application.ModuleInfo'];
+
+ return true;
+
+ }
+ else return false;
+ }
+
+ function ResetParsedData($include_sections = false)
+ {
+ $conn =& $this->Application->GetADODBConnection();
+ $conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
+
+ if ($include_sections) {
+ $conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"');
+ }
+ }
+
+ function scanModules($folderPath, $cache = true)
+ {
+ if (defined('IS_INSTALL') && IS_INSTALL && !defined('FORCE_CONFIG_CACHE')) {
+ // disable config caching during installation
+ $cache = false;
+ }
+
+ if ($cache) {
+ $restored = $this->RestoreParsedData();
+ if ($restored) return;
+ }
+
+ $this->ProcessAllConfigs = true;
+
+ $this->includeConfigFiles($folderPath, $cache);
+ $this->ParseConfigs();
+
+ // tell AfterConfigRead to store cache if neede
+ // can't store it here beacuse AfterConfigRead needs ability to change config data
+ $this->StoreCache = $cache;
+ }
+
+ function findConfigFiles($folderPath)
+ {
+ // if FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted
+ $reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/';
+ $folderPath = preg_replace($reg_exp, '', $folderPath, 1); // this make sense, since $folderPath may NOT contain FULL_PATH
+
+ $fh = opendir(FULL_PATH.$folderPath);
+ while (($sub_folder = readdir($fh))) {
+ $full_path = FULL_PATH.$folderPath.'/'.$sub_folder;
+ if ($this->isDir($full_path)) {
+ //the following is to exclude OLD, not removed files when upgrading to 'core'
+ if (preg_match('/^\/kernel\/kernel4\//', $folderPath) || ($folderPath == '/kernel/units' && file_exists(FULL_PATH.$this->getConfigName('/core/units/'.$sub_folder)))) {
+ continue;
+ }
+ if (file_exists(FULL_PATH.$this->getConfigName($folderPath.'/'.$sub_folder))) {
+ $this->configFiles[] = $this->getConfigName($folderPath.'/'.$sub_folder);
+ }
+ $this->findConfigFiles($full_path);
+
+ // if (filemtime($full_path) > $cached) { }
+
+ }
+ }
+ }
+
+ function includeConfigFiles($folderPath, $cache = true)
+ {
+ $this->Application->refreshModuleInfo();
+
+ $conn =& $this->Application->GetADODBConnection();
+ $data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"');
+ if ($cache && $data) {
+ $this->configFiles = unserialize($data['Data']);
+ shuffle($this->configFiles);
+ $files_cached = $data['Cached'];
+ }
+ else {
+ $this->findConfigFiles($folderPath); // search from base directory
+ }
+
+ foreach ($this->configFiles as $filename)
+ {
+ $prefix = $this->PreloadConfigFile($filename);
+ if (!$prefix) {
+ trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR);
+ }
+ }
+ }
+
+ /**
+ * Process all read config files - called ONLY when there is no cache!
+ *
+ */
+ function ParseConfigs()
+ {
+ $prioritized_configs = array();
+ foreach ($this->configData as $prefix => $config) {
+ if (isset($config['ConfigPriority'])) {
+ $prioritized_configs[$prefix] = $config['ConfigPriority'];
+ continue;
+ }
+ $this->parseConfig($prefix);
+ }
+
+ foreach ($this->configData as $prefix => $config) {
+ $this->ProcessDependencies($prefix);
+ $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
+ $clones = $this->postProcessConfig($prefix, 'Clones', 'prefix');
+ }
+
+ asort($prioritized_configs);
+ foreach ($prioritized_configs as $prefix => $priority) {
+ $this->parseConfig($prefix);
+ }
+ }
+
+ function AfterConfigRead()
+ {
+// if (!$this->ProcessAllConfigs) return ;
+ $this->FinalStage = true;
+ foreach ($this->configData as $prefix => $config) {
+ if (in_array($prefix, $this->AfterConfigProcessed)) continue;
+ $this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') );
+ $this->AfterConfigProcessed[] = $prefix;
+ }
+ if ($this->StoreCache) $this->CacheParsedData();
+ }
+
+ /**
+ * Register nessasary classes
+ * This method should only process the data which is cached!
+ *
+ * @param string $prefix
+ * @access private
+ */
+ function parseConfig($prefix)
+ {
+ $config =& $this->configData[$prefix];
+ $event_manager =& $this->Application->recallObject('EventManager');
+
+ $register_classes = getArrayValue($config,'RegisterClasses');
+ if (!$register_classes) $register_classes = Array();
+ $class_params=Array('ItemClass','ListClass','EventHandlerClass','TagProcessorClass');
+ foreach($class_params as $param_name)
+ {
+ if ( !(isset($config[$param_name]) ) ) continue;
+ $config[$param_name]['pseudo'] = $this->getPrefixByParamName($param_name,$prefix);
+ $register_classes[] = $config[$param_name];
+ }
+
+ foreach($register_classes as $class_info)
+ {
+ $require_classes = getArrayValue($class_info, 'require_classes');
+ if ($require_classes) {
+ if (!is_array($require_classes)) {
+ $require_classes = array($require_classes);
+ }
+ if (!isset($config['_Dependencies'][$class_info['class']])) {
+ $config['_Dependencies'][$class_info['class']] = array();
+ }
+ $config['_Dependencies'][$class_info['class']] = array_merge($config['_Dependencies'][$class_info['class']], $require_classes);
+ }
+ $this->Application->registerClass(
+ $class_info['class'],
+ $config['BasePath'].'/'.$class_info['file'],
+ $class_info['pseudo']/*,
+ getArrayValue($class_info, 'require_classes')*/
+ );
+ if (getArrayValue($class_info, 'build_event')) {
+ $event_manager->registerBuildEvent($class_info['pseudo'],$class_info['build_event']);
+ }
+ }
+
+ $regular_events = getArrayValue($config, 'RegularEvents');
+ if($regular_events)
+ {
+ foreach($regular_events as $short_name => $regular_event_info)
+ {
+ $event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'] );
+ }
+ }
+
+ $hooks = getArrayValue($config, 'Hooks');
+ if (is_array($hooks) && count($hooks) > 0) {
+ foreach ($hooks as $hook) {
+ if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == $config['ParentPrefix']) {
+ trigger_error('Depricated Hook Usage [prefix: <b>'.$config['Prefix'].'</b>; do_prefix: <b>'.$hook['DoPrefix'].'</b>] use <b>#PARENT#</b> as <b>HookToPrefix</b> value, where HookToPrefix is same as ParentPrefix', E_USER_NOTICE);
+ }
+
+ if ($hook['HookToPrefix'] == '') {
+ $hook['HookToPrefix'] = $config['Prefix']; // new: set hooktoprefix to current prefix if not set
+ }
+
+ if (isset($config['ParentPrefix'])) {
+ // new: allow to set hook to parent prefix what ever it is
+ if ($hook['HookToPrefix'] == '#PARENT#') {
+ $hook['HookToPrefix'] = $config['ParentPrefix'];
+ }
+
+ if ($hook['DoPrefix'] == '#PARENT#') {
+ $hook['DoPrefix'] = $config['ParentPrefix'];
+ }
+ }
+ elseif ($hook['HookToPrefix'] == '#PARENT#' || $hook['DoPrefix'] == '#PARENT#') {
+ continue; // we need parent prefix but it's not set !
+ }
+
+ $do_prefix = $hook['DoPrefix'] == '' ? $config['Prefix'] : $hook['DoPrefix'];
+
+ if ( !is_array($hook['HookToEvent']) ) {
+ $hook_events = Array( $hook['HookToEvent'] );
+ }
+ else {
+ $hook_events = $hook['HookToEvent'];
+ }
+ foreach ($hook_events as $hook_event) {
+ $this->Application->registerHook($hook['HookToPrefix'], $hook['HookToSpecial'], $hook_event, $hook['Mode'], $do_prefix, $hook['DoSpecial'], $hook['DoEvent'], $hook['Conditional']);
+ }
+ }
+ }
+
+ if ( is_array(getArrayValue($config, 'AggregateTags')) ) {
+ foreach ($config['AggregateTags'] as $aggregate_tag) {
+ if (isset($config['ParentPrefix'])) {
+ if ($aggregate_tag['AggregateTo'] == $config['ParentPrefix']) {
+ trigger_error('Depricated Aggregate Tag Usage [prefix: <b>'.$config['Prefix'].'</b>; AggregateTo: <b>'.$aggregate_tag['AggregateTo'].'</b>] use <b>#PARENT#</b> as <b>AggregateTo</b> value, where AggregateTo is same as ParentPrefix', E_USER_NOTICE);
+ }
+
+ if ($aggregate_tag['AggregateTo'] == '#PARENT#') {
+ $aggregate_tag['AggregateTo'] = $config['ParentPrefix'];
+ }
+ }
+ $aggregate_tag['LocalPrefix'] = $config['Prefix'];
+ $this->Application->registerAggregateTag($aggregate_tag);
+ }
+ }
+
+ if (isset($config['ReplacementTemplates']) && $config['ReplacementTemplates']) {
+ // replacement templates defined in this config
+ $this->Application->ReplacementTemplates = array_merge_recursive2($this->Application->ReplacementTemplates, $config['ReplacementTemplates']);
+ }
+
+ if ( $this->Application->isDebugMode(false) && constOn('DBG_VALIDATE_CONFIGS') && isset($config['TableName']) ) {
+ $this->ValidateConfig($prefix);
+ }
+ }
+ function ValidateConfig($prefix)
+ {
+ global $debugger;
+ $config =& $this->configData[$prefix];
+ $tablename = $config['TableName'];
+ $float_types = Array ('float', 'double', 'numeric');
+ $conn =& $this->Application->GetADODBConnection();
+
+ $table_found = $conn->Query('SHOW TABLES LIKE "'.$tablename.'"');
+ if (!$table_found) {
+ // config present, but table missing, strange
+ $debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Table <strong>$tablename</strong> missing, but prefix <b>".$config['Prefix']."</b> requires it!");
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ return ;
+ }
+ $res = $conn->Query('DESCRIBE '.$tablename);
+ $config_link = $debugger->getFileLink(FULL_PATH.$this->prefixFiles[$config['Prefix']], 1, $config['Prefix']);
+ $error_messages = Array (
+ 'field_not_found' => 'Field <strong>%s</strong> exists in the database, but <strong>is not defined</strong> in config',
+ 'default_missing' => 'Default value for field <strong>%s</strong> not set in config',
+ 'not_null_error1' => 'Field <strong>%s</strong> is NOT NULL in the database, but is not configured as not_null or required',
+ 'not_null_error2' => 'Field <strong>%s</strong> is described as NOT NULL in config, but <strong>does not have DEFAULT value</strong>',
+ 'not_null_error3' => 'Field <strong>%s</strong> is described as <strong>NOT NULL in config</strong>, but is <strong>NULL in db</strong>',
+ 'invalid_default' => '<strong>Default value</strong> for field %s<strong>%s</strong> not sync. to db (in config = %s, in db = %s)',
+ 'type_missing' => '<strong>Type definition</strong> for field <strong>%s</strong> missing in config',
+ );
+ $config_errors = Array ();
+ $tablename = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', '\\1', $tablename); // remove table prefix
+
+ foreach ($res as $field) {
+ $f_name = $field['Field'];
+
+ if (getArrayValue($config, 'Fields')) {
+ if (preg_match('/l[\d]+_[\w]/', $f_name)) {
+ // skip multilingual fields
+ continue;
+ }
+ if (!array_key_exists ($f_name, $config['Fields'])) {
+ $config_errors[] = sprintf($error_messages['field_not_found'], $f_name);
+ }
+ else {
+ if (is_numeric($field['Default'])) {
+ $field['Default'] = preg_match('/[\.,]/', $field['Default']) ? (float)$field['Default'] : (int)$field['Default'];
+ }
+
+ $options = $config['Fields'][$f_name];
+ $default_missing = false;
+ if (!array_key_exists('default', $options)) {
+ $config_errors[] = sprintf($error_messages['default_missing'], $f_name);
+ $default_missing = true;
+ }
+ if ($field['Null'] != 'YES') {
+ // field is NOT NULL in database (MySQL5 for null returns "NO", but MySQL4 returns "")
+ if ( $f_name != $config['IDField'] && !isset($options['not_null']) && !isset($options['required']) ) {
+ $config_errors[] = sprintf($error_messages['not_null_error1'], $f_name);
+ }
+ if (isset($options['not_null']) && $options['not_null'] && !isset($options['default']) ) {
+ $config_errors[] = sprintf($error_messages['not_null_error2'], $f_name);
+ }
+ }
+ else {
+ if (isset($options['not_null']) && $options['not_null']) {
+ $config_errors[] = sprintf($error_messages['not_null_error3'], $f_name);
+ }
+ }
+ if (!array_key_exists('type', $options)) {
+ $config_errors[] = sprintf($error_messages['type_missing'], $f_name);
+ }
+ if (!$default_missing) {
+ if ($f_name == $config['IDField'] && $options['type'] != 'string' && $options['default'] !== 0) {
+ $config_errors[] = sprintf($error_messages['invalid_default'], '<span class="debug_error">IDField</span> ', $f_name, $this->varDump($options['default']), $this->varDump($field['Default']));
+ }
+ else if ($options['default'] != '#NOW#' && $field['Default'] !== $options['default'] && !in_array($options['type'], $float_types)) {
+ $config_errors[] = sprintf($error_messages['invalid_default'], '', $f_name, $this->varDump($options['default']), $this->varDump($field['Default']));
+ }
+ }
+ }
+ }
+ }
+ if ($config_errors) {
+ $error_prefix = '<strong class="debug_error">Config Error'.(count($config_errors) > 1 ? 's' : '').': </strong> for prefix <strong>'.$config_link.'</strong> ('.$tablename.') in unit config:<br />';
+ $config_errors = $error_prefix.'&nbsp;&nbsp;&nbsp;'.implode('<br />&nbsp;&nbsp;&nbsp;', $config_errors);
+ $debugger->appendHTML($config_errors);
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ }
+ }
+
+ function varDump($value)
+ {
+ return '<strong>'.var_export($value, true).'</strong> of '.gettype($value);
+
+ }
+
+ function ProcessDependencies($prefix)
+ {
+ $config =& $this->configData[$prefix];
+ $deps = getArrayValue($config, '_Dependencies');
+ if (!$deps) return ;
+
+ foreach ($deps as $real_class => $requires) {
+ foreach ($requires as $class) {
+ $this->Application->registerDependency($real_class, $class);
+ }
+ }
+ unset($config['_Dependencies']);
+ }
+
+ function postProcessConfig($prefix, $config_key, $dst_prefix_var)
+ {
+ $main_config =& $this->configData[$prefix];
+ $sub_configs = getArrayValue($main_config, $config_key);
+ if (!$sub_configs) {
+ return array();
+ }
+ unset($main_config[$config_key]);
+
+ $processed = array();
+ foreach ($sub_configs as $sub_prefix => $sub_config) {
+ if ($config_key == 'AggregateConfigs' && !isset($this->configData[$sub_prefix])) {
+ $this->loadConfig($sub_prefix);
+ }
+ $sub_config['Prefix'] = $sub_prefix;
+ $this->configData[$sub_prefix] = array_merge_recursive2($this->configData[$$dst_prefix_var], $sub_config);
+
+ // when merging empty array to non-empty results non-empty array, but empty is required
+ foreach ($sub_config as $sub_key => $sub_value) {
+ if (!$sub_value) {
+ unset($this->configData[$sub_prefix][$sub_key]);
+ }
+ }
+ if ($config_key == 'Clones') {
+ $this->prefixFiles[$sub_prefix] = $this->prefixFiles[$prefix];
+ }
+
+ $this->postProcessConfig($sub_prefix, $config_key, $dst_prefix_var);
+ if ($config_key == 'AggregateConfigs') {
+ $processed = array_merge($this->postProcessConfig($sub_prefix, 'Clones', 'prefix'), $processed);
+ }
+ elseif ($this->ProcessAllConfigs) {
+ $this->parseConfig($sub_prefix);
+ }
+ array_push($processed, $sub_prefix);
+ }
+
+ if (!$prefix) {
+ // configs, that used only for cloning & not used ifself
+ unset($this->configData[$prefix]);
+ }
+ return array_unique($processed);
+ }
+
+ function PreloadConfigFile($filename)
+ {
+ $config_found = file_exists(FULL_PATH.$filename) && $this->configAllowed($filename);
+
+ if( defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PROFILE_INCLUDES') )
+ {
+ if ( in_array($filename, get_required_files()) ) return;
+ global $debugger;
+ if($config_found) {
+ $file = FULL_PATH.$filename;
+ $debugger->ProfileStart('inc_'.crc32($file), $file);
+ include_once($file);
+ $debugger->ProfileFinish('inc_'.crc32($file));
+ $debugger->profilerAddTotal('includes', 'inc_'.crc32($file));
+ }
+ }
+ else
+ {
+ if ($config_found) include_once(FULL_PATH.$filename);
+ }
+
+ if ($config_found) {
+ if (isset($config) && $config) {
+ // config file is included for 1st time -> save it's content for future processing
+ $prefix = isset($config['Prefix']) ? $config['Prefix'] : '';
+
+ preg_match('/\/(.*)\//U', $filename, $rets);
+ $config['ModuleFolder'] = $rets[1];
+ $config['BasePath'] = dirname(FULL_PATH.$filename);
+ if (isset($config['AdminTemplatePath'])) {
+ // append template base folder for admin templates path of this prefix
+ $module_templates = $rets[1] == 'core' ? 'in-portal/' : $rets[1].'/';
+ $config['AdminTemplatePath'] = $module_templates.$config['AdminTemplatePath'];
+ }
+ $this->configData[$prefix] = $config;
+ $this->prefixFiles[$prefix] = $filename;
+ return $prefix;
+ }
+ elseif ($prefix = array_search($filename, $this->prefixFiles)) {
+ // attempt is made to include config file twice or more, but include_once prevents that,
+ // but file exists on hdd, then it is already saved to all required arrays, just return it's prefix
+ return $prefix;
+ }
+ }
+ return 'dummy';
+ }
+
+ function loadConfig($prefix)
+ {
+ if (!isset($this->prefixFiles[$prefix])) {
+ if ($this->Application->isDebugMode()) $this->Application->Debugger->appendTrace();
+ trigger_error('Configuration file for prefix <b>'.$prefix.'</b> is unknown', E_USER_ERROR);
+ return ;
+ }
+ $file = $this->prefixFiles[$prefix];
+ $prefix = $this->PreloadConfigFile($file);
+
+ $clones = $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
+ $clones = array_merge($this->postProcessConfig($prefix, 'Clones', 'prefix'), $clones);
+
+ if ($this->FinalStage) {
+ array_unshift($clones, $prefix);
+ $clones = array_unique($clones);
+ foreach ($clones as $a_prefix) {
+ $this->Application->HandleEvent( new kEvent($a_prefix.':OnAfterConfigRead') );
+ }
+ }
+ }
+
+ /**
+ * Reads unit (specified by $prefix)
+ * option specified by $option
+ *
+ * @param string $prefix
+ * @param string $name
+ * @param mixed $default
+ * @return string
+ * @access public
+ */
+ function getUnitOption($prefix, $name, $default = false)
+ {
+ if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
+ if (!isset($this->configData[$rets[1]])) {
+ $this->loadConfig($rets[1]);
+ }
+ $ret = isset($this->configData[$rets[1]][$name][$rets[2]]) ? $this->configData[$rets[1]][$name][$rets[2]] : false;
+// $ret = getArrayValue($this->configData, $rets[1], $name, $rets[2]);
+ }
+ else {
+ if (!isset($this->configData[$prefix])) {
+ $this->loadConfig($prefix);
+ }
+ $ret = isset($this->configData[$prefix][$name]) ? $this->configData[$prefix][$name] : false;
+// $ret = getArrayValue($this->configData, $prefix, $name);
+ }
+ return $ret === false ? $default : $ret;
+ }
+
+ /**
+ * Read all unit with $prefix options
+ *
+ * @param string $prefix
+ * @return Array
+ * @access public
+ */
+ function getUnitOptions($prefix)
+ {
+ if (!isset($this->configData[$prefix])) {
+ $this->loadConfig($prefix);
+ }
+
+ return $this->configData[$prefix];
+ }
+
+ /**
+ * Set's new unit option value
+ *
+ * @param string $prefix
+ * @param string $name
+ * @param string $value
+ * @access public
+ */
+ function setUnitOption($prefix, $name, $value)
+ {
+ if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
+ if (!isset($this->configData[$rets[1]])) {
+ $this->loadConfig($rets[1]);
+ }
+ $this->configData[$rets[1]][$name][$rets[2]] = $value;
+ }
+ else {
+ if (!isset($this->configData[$prefix])) {
+ $this->loadConfig($prefix);
+ }
+ $this->configData[$prefix][$name] = $value;
+ }
+
+ }
+
+ function getPrefixByParamName($paramName,$prefix)
+ {
+ $pseudo_class_map=Array(
+ 'ItemClass'=>'%s',
+ 'ListClass'=>'%s_List',
+ 'EventHandlerClass'=>'%s_EventHandler',
+ 'TagProcessorClass'=>'%s_TagProcessor'
+ );
+ return sprintf($pseudo_class_map[$paramName],$prefix);
+ }
+
+ /**
+ * Get's config file name based
+ * on folder name supplied
+ *
+ * @param string $folderPath
+ * @return string
+ * @access private
+ */
+ function getConfigName($folderPath)
+ {
+ return $folderPath.'/'.basename($folderPath).'_config.php';
+ }
+
+ /**
+ * is_dir ajustment to work with
+ * directory listings too
+ *
+ * @param string $folderPath
+ * @return bool
+ * @access private
+ */
+ function isDir($folderPath)
+ {
+ $base_name = basename($folderPath);
+ $ret = !( $base_name == '.' || $base_name == '..' );
+ return $ret && is_dir($folderPath);
+ }
+
+ /**
+ * Checks if config file is allowed for includion (if module of config is installed)
+ *
+ * @param string $config_path relative path from in-portal directory
+ */
+ function configAllowed($config_path)
+ {
+ if (defined('IS_INSTALL') && IS_INSTALL) {
+ // at installation start no modules in db and kernel configs could not be read
+ return true;
+ }
+
+ if (preg_match('#/plugins/|/core#', $config_path)) {
+ return true;
+ }
+
+ $module_found = false;
+ if (!$this->Application->ModuleInfo) return false;
+
+ foreach($this->Application->ModuleInfo as $module_name => $module_info)
+ {
+ $module_path = '/'.$module_info['Path'];
+ if (preg_match('/^'.preg_quote($module_path, '/').'/', $config_path)) {
+ // if (substr($config_path, 0, strlen($module_path)) == $module_path) {
+ // config file path starts with module folder path
+ $module_found = true;
+ break;
+ }
+ }
+ return $module_found;
+ }
+
+ /**
+ * Returns true if config exists and is allowed for reading
+ *
+ * @param string $prefix
+ * @return bool
+ */
+ function prefixRegistred($prefix)
+ {
+ return isset($this->prefixFiles[$prefix]) ? true : false;
+ }
+
+ function iterateConfigs($callback_function, $params)
+ {
+ $this->includeConfigFiles(MODULES_PATH); //make sure to re-read all configs
+ $this->AfterConfigRead();
+
+ foreach ($this->configData as $prefix => $config_data) {
+ $callback_function[0]->$callback_function[1]($prefix, $config_data, $params);
+ }
+ }
+
+}
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.76
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.76.2/core/units/users/users_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.76.2/core/units/users/users_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.76.2/core/units/users/users_event_handler.php (revision 8121)
@@ -0,0 +1,1207 @@
+<?php
+
+ class UsersEventHandler extends kDBEventHandler
+ {
+ /**
+ * Allows to override standart permission mapping
+ *
+ */
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+ $permissions = Array(
+ // admin
+ 'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
+ 'OnUpdateRootPassword' => Array('self' => true), // because setting to logged in user only
+
+ // front
+ 'OnRefreshForm' => Array('self' => true),
+
+ 'OnForgotPassword' => Array('self' => true),
+ 'OnResetPassword' => Array('self' => true),
+ 'OnResetPasswordConfirmed' => Array('self' => true),
+
+ 'OnSubscribeQuery' => Array('self' => true),
+ 'OnSubscribeUser' => Array('self' => true),
+
+ 'OnRecommend' => Array('self' => true),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Shows only admins when required
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ($event->Special == 'admins') {
+ $object->addFilter('primary_filter', 'ug.GroupId = 11');
+ }
+
+ if ($event->Special == 'regular') {
+ $object->addFilter('primary_filter', 'ug.GroupId <> 11');
+ }
+
+ if (!$this->Application->IsAdmin()) {
+ $object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
+ }
+ }
+
+
+ /**
+ * Checks permissions of user
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
+ // permission is checked in OnLogin event directly
+ return true;
+ }
+
+ if (!$this->Application->IsAdmin()) {
+ $user_id = $this->Application->RecallVar('user_id');
+ $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
+
+ if ($event->Name == 'OnCreate' && $user_id == -2) {
+ // "Guest" can create new users
+ return true;
+ }
+
+ if ($event->Name == 'OnUpdate' && $user_id > 0) {
+ $user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
+ foreach ($items_info as $id => $field_values) {
+ if ($id != $user_id) {
+ // registered users can update their record only
+ return false;
+ }
+
+ $user_dummy->Load($id);
+ $status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
+
+ if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
+ // not active user is not allowed to update his record (he could not activate himself manually)
+ return false;
+ }
+
+ if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
+ // user can't change status by himself
+ return false;
+ }
+ }
+ return true;
+ }
+
+ if ($event->Name == 'OnUpdate' && $user_id <= 0) {
+ // guests are not allowed to update their record, because they don't have it :)
+ return false;
+ }
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ function OnSessionExpire()
+ {
+ $this->Application->resetCounters('UserSession');
+
+ if ($this->Application->IsAdmin()) {
+ $this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
+ }
+
+ if ($this->Application->GetVar('admin') == 1) {
+ $session_admin =& $this->Application->recallObject('Session.admin');
+ /* @var $session_admin Session */
+ if (!$session_admin->LoggedIn()) {
+ // front-end session created from admin session & both expired
+ $this->Application->DeleteVar('admin');
+ $this->Application->Redirect('index', Array('expired' => 1), '', 'admin/index.php');
+ }
+ }
+ $get = $this->Application->HttpQuery->getRedirectParams();
+ $t = $this->Application->GetVar('t');
+ $get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
+ $this->Application->Redirect($t ? $t : 'index', $get);
+ }
+
+ /**
+ * Checks user data and logs it in if allowed
+ *
+ * @param kEvent $event
+ */
+ function OnLogin(&$event)
+ {
+ // persistent session data after login is not refreshed, because redirect will follow in any case
+ $prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
+ $object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
+ $password = $this->Application->GetVar('password');
+
+ $invalid_pseudo = $this->Application->IsAdmin() ? 'la_invalid_password' : 'lu_invalid_password';
+
+ if(!$password)
+ {
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
+ $event->status = erFAIL;
+ return false;
+ }
+
+ $email_as_login = $this->Application->ConfigValue('Email_As_Login');
+ list($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
+ $login_value = $this->Application->GetVar($submit_field);
+
+ // process "Save Username" checkbox
+ if ($this->Application->IsAdmin()) {
+ $save_username = $this->Application->GetVar('cb_save_username') ? $login_value : '';
+ $this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration
+ $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
+ }
+
+ if ($this->Application->IsAdmin() && ($login_value == 'root') || ($login_value == 'super-root')) {
+ // logging in "root" (admin only)
+ $super_admin = ($login_value == 'super-root') && $this->verifySuperAdmin();
+ $login_value = 'root';
+
+ $root_password = $this->Application->ConfigValue('RootPass');
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ $test = $password_formatter->EncryptPassword($password, 'b38');
+ if ($root_password != $test) {
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
+ $event->status = erFAIL;
+ return false;
+ }
+ elseif ($this->checkLoginPermission($login_value)) {
+ $user_id = -1;
+ $object->Load($user_id);
+ $object->SetDBField('Login', $login_value);
+
+ $session =& $this->Application->recallObject('Session');
+ $session->SetField('PortalUserId', $user_id);
+// $session->SetField('GroupList', implode(',', $groups) );
+ $this->Application->SetVar('u.current_id', $user_id);
+ $this->Application->StoreVar('user_id', $user_id);
+
+ if ($super_admin) {
+ $this->Application->StoreVar('super_admin', 1);
+ }
+
+ $this->processLoginRedirect($event, $password);
+ return true;
+ }
+ else {
+ $object->SetError('ValidateLogin', 'invalid_license', 'la_invalid_license');
+ $event->status = erFAIL;
+ return false;
+ }
+ }
+
+ /*$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
+ $user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );*/
+
+ $sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (Email = %1$s OR Login = %1$s) AND (Password = MD5(%2$s))';
+ $user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
+
+ if ($user_id) {
+ $object->Load($user_id);
+ if ($object->GetDBField('Status') == STATUS_ACTIVE) {
+ $groups = $object->getMembershipGroups(true);
+ if(!$groups) $groups = Array();
+ array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
+ $this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
+
+ if ($this->checkLoginPermission($login_value)) {
+ $session =& $this->Application->recallObject('Session');
+ $session->SetField('PortalUserId', $user_id);
+ $session->SetField('GroupList', implode(',', $groups) );
+ $this->Application->SetVar('u.current_id', $user_id);
+ $this->Application->StoreVar('user_id', $user_id);
+
+ $this_login = (int)$object->getPersistantVar('ThisLogin');
+ $object->setPersistantVar('LastLogin', $this_login);
+ $object->setPersistantVar('ThisLogin', adodb_mktime());
+ }
+ else {
+ $object->Load(-2);
+ $object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
+ $event->status = erFAIL;
+ }
+
+ $this->processLoginRedirect($event, $password);
+ }
+ else {
+ $event->redirect = $this->Application->GetVar('pending_disabled_template');
+ }
+ }
+ else
+ {
+ $object->SetID(-2);
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
+ $event->status = erFAIL;
+ }
+
+ $event->SetRedirectParam('pass', 'm');
+ }
+
+ /**
+ * Checks that user is allowed to use super admin mode
+ *
+ * @return bool
+ */
+ function verifySuperAdmin()
+ {
+ $sa_mode = isset($GLOBALS['debugger']) && $GLOBALS['debugger']->ipMatch(defined('SA_IP') ? SA_IP : '');
+ return $sa_mode || $this->Application->isDebugMode();
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param string $user_name
+ * @return bool
+ */
+ function checkLoginPermission($user_name)
+ {
+ $ret = true;
+ if ($this->Application->IsAdmin()) {
+ $modules_helper =& $this->Application->recallObject('ModulesHelper');
+ if ($user_name != 'root') {
+ // root is virtual user, so allow him to login to admin in any case
+ $ret = $this->Application->CheckPermission('ADMIN', 1);
+ }
+ $ret = $ret && $modules_helper->checkLogin();
+ }
+ else {
+ $ret = $this->Application->CheckPermission('LOGIN', 1);
+ }
+ return $ret;
+ }
+
+ /**
+ * Process all required data and redirect logged-in user
+ *
+ * @param kEvent $event
+ */
+ function processLoginRedirect(&$event, $password)
+ {
+ $prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
+ $object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
+
+ $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() && constOn('DBG_REDIRECT') )
+ {
+ $this->Application->Debugger->appendTrace();
+ echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
+ }
+ 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);
+ }
+
+ $sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
+ $sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
+ $this->Application->resetCounters('UserSession');
+ }
+
+ /**
+ * Called when user logs in using old in-portal
+ *
+ * @param kEvent $event
+ */
+ function OnInpLogin(&$event)
+ {
+ $sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
+ $sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
+
+ if ($event->redirect && is_string($event->redirect)) {
+ // some real template specified instead of true
+ $this->Application->Redirect($event->redirect, $event->redirect_params);
+ }
+ }
+
+ /**
+ * Called when user logs in using old in-portal
+ *
+ * @param kEvent $event
+ */
+ function OnInpLogout(&$event)
+ {
+ $sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
+ $sync_manager->performAction('LogoutUser');
+ }
+
+ function OnLogout(&$event)
+ {
+ $sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
+ $sync_manager->performAction('LogoutUser');
+
+ $session =& $this->Application->recallObject('Session');
+ $session->SetField('PortalUserId', -2);
+ $this->Application->SetVar('u.current_id', -2);
+ $this->Application->StoreVar('user_id', -2);
+ $object =& $this->Application->recallObject('u.current', null, Array('skip_autoload' => true));
+ $object->Load(-2);
+
+ $this->Application->DestroySession();
+
+ $group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
+ $session->SetField('GroupList', $group_list);
+ $this->Application->StoreVar('UserGroups', $group_list);
+
+ if ($this->Application->ConfigValue('UseJSRedirect')) {
+ $event->SetRedirectParam('js_redirect', 1);
+ }
+
+ $this->Application->resetCounters('UserSession');
+ $event->SetRedirectParam('pass', 'm');
+ }
+
+ /**
+ * Prefill states dropdown with correct values
+ *
+ * @param kEvent $event
+ * @access public
+ */
+ function OnPrepareStates(&$event)
+ {
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->PopulateStates($event, 'State', 'Country');
+
+ $object =& $event->getObject();
+
+ if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true);
+ $object->setLogin();
+ }
+
+ /**
+ * Redirects user after succesfull registration to confirmation template (on Front only)
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ $is_subscriber = $this->Application->GetVar('IsSubscriber');
+ if(!$is_subscriber)
+ {
+ $object =& $event->getObject();
+
+ $ug_table = TABLE_PREFIX.'UserGroup';
+ if ($object->mode == 't') {
+ $ug_table = $this->Application->GetTempName($ug_table, 'prefix:'.$event->Prefix);
+ }
+
+ $sql = 'UPDATE '.$ug_table.'
+ SET PrimaryGroup = 0
+ WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
+ $this->Conn->Query($sql);
+
+ // set primary group to user
+ if ($this->Application->IsAdmin() && $this->Application->GetVar('user_group')) {
+ // while in admin you can set any group for new users
+ $group_id = $this->Application->GetVar('user_group');
+ }
+ else {
+ $group_id = $this->Application->ConfigValue('User_NewGroup');
+ }
+
+ $sql = 'REPLACE INTO '.$ug_table.'(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
+ $this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
+ }
+ }
+
+ /**
+ * Login user if possible, if not then redirect to corresponding template
+ *
+ * @param kEvent $event
+ */
+ function autoLoginUser(&$event)
+ {
+ $object =& $event->getObject();
+ $this->Application->SetVar('u.current_id', $object->GetID() );
+
+ if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto'))
+ {
+ $email_as_login = $this->Application->ConfigValue('Email_As_Login');
+ list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
+
+ $this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
+ $this->Application->SetVar('password', $object->GetDBField('Password_plain') );
+
+ $event->CallSubEvent('OnLogin');
+ }
+ }
+
+
+ /**
+ * When creating user & user with such email exists then force to use OnUpdate insted of ?
+ *
+ * @param kEvent $event
+ */
+ function OnSubstituteSubscriber(&$event)
+ {
+ $ret = false;
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
+ if($items_info)
+ {
+ list($id, $field_values) = each($items_info);
+ $user_email = isset($field_values['Email']) ? $field_values['Email'] : false;
+ if($user_email)
+ {
+ // check if is subscriber
+ $verify_user =& $this->Application->recallObject('u.verify', null, Array('skip_autoload' => true) );
+ $verify_user->Load($user_email, 'Email');
+ if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
+ {
+ $items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
+ $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
+ $ret = true;
+ }
+ }
+ }
+
+ if( isset($event->MasterEvent) )
+ {
+ $event->MasterEvent->setEventParam('is_subscriber_only', $ret);
+ }
+ else
+ {
+ $event->setEventParam('is_subscriber_only', $ret);
+ }
+ }
+
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ * @return bool
+ */
+ function isSubscriberOnly(&$event)
+ {
+ $event->CallSubEvent('OnSubstituteSubscriber');
+ $is_subscriber = false;
+ if( $event->getEventParam('is_subscriber_only') )
+ {
+ $is_subscriber = true;
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $this->OnUpdate($event);
+ if($event->status == erSUCCESS)
+ {
+ $this->OnAfterItemCreate($event);
+ $object->SendEmailEvents();
+ if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
+ }
+ }
+ return $is_subscriber;
+ }
+
+ /**
+ * Creates new user
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
+
+ if( !$this->isSubscriberOnly($event) )
+ {
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->CheckStateField($event, 'State', 'Country');
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object kDBItem */
+ if ($this->Application->ConfigValue('User_Password_Auto')) {
+ $pass = makepassword4(rand(5,8));
+ $object->SetField('Password', $pass);
+ $object->SetField('VerifyPassword', $pass);
+ $this->Application->SetVar('user_password',$pass);
+ }
+ parent::OnCreate($event);
+
+ $this->Application->SetVar('u.current_id', $object->getID() ); // for affil:OnRegisterAffiliate after hook
+
+ $this->setNextTemplate($event);
+
+ if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
+ {
+ $object->SendEmailEvents();
+ $this->autoLoginUser($event);
+ }
+ }
+ }
+
+ /**
+ * Set's new user status based on config options
+ *
+ * @param kEvent $event
+ */
+ function setUserStatus(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
+ // 1 - Instant, 2 - Not Allowed, 3 - Pending
+
+ switch ($new_users_allowed)
+ {
+ case 1: // Instant
+ $object->SetDBField('Status', 1);
+ $next_template = $this->Application->GetVar('registration_confirm_template');
+ if($next_template) $event->redirect = $next_template;
+ break;
+
+ case 3: // Pending
+ $next_template = $this->Application->GetVar('registration_confirm_pending_template');
+ if($next_template) $event->redirect = $next_template;
+ $object->SetDBField('Status', 2);
+ break;
+
+ case 2: // Not Allowed
+ $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';
+ } */
+
+ }
+
+
+
+
+ /**
+ * Set's new unique resource id to user
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $email_as_login = $this->Application->ConfigValue('Email_As_Login');
+ $object =& $event->getObject();
+ if ($email_as_login) {
+ $object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
+ }
+
+ }
+
+ /**
+ * Set's new unique resource id to user
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemValidate(&$event)
+ {
+ $object =& $event->getObject();
+ $resource_id = $object->GetDBField('ResourceId');
+ if (!$resource_id)
+ {
+ $object->SetDBField('ResourceId', $this->Application->NextResourceId() );
+ }
+ }
+
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnRecommend(&$event){
+
+ $friend_email = $this->Application->GetVar('friend_email');
+ $friend_name = $this->Application->GetVar('friend_email');
+
+ // used for error reporting only -> rewrite code + theme (by Alex)
+ $object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
+
+ if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $friend_email))
+ {
+ $send_params = array();
+ $send_params['to_email']=$friend_email;
+ $send_params['to_name']=$friend_name;
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $email_event = &$this->Application->EmailEventUser('SITE.SUGGEST', $user_id, $send_params);
+
+ if ($email_event->status == erSUCCESS){
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = $this->Application->GetVar('template_success');
+ }
+ else {
+// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+// $event->redirect = $this->Application->GetVar('template_fail');
+
+ $object->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
+ $object->FieldErrors['Email']['pseudo'] = 'send_error';
+ $event->status = erFAIL;
+ }
+ }
+ else {
+ $object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
+ $object->FieldErrors['Email']['pseudo'] = 'invalid_email';
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Saves address changes and mades no redirect
+ *
+ * @param kEvent $event
+ */
+ function OnUpdateAddress(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+ if($id > 0) $object->Load($id);
+ $object->SetFieldsFromHash($field_values);
+ $object->setID($id);
+ $object->Validate();
+ }
+
+ $event->redirect = false;
+ }
+
+ function OnSubscribeQuery(&$event)
+ {
+ $user_email = $this->Application->GetVar('subscriber_email');
+ if ( preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email) ){
+
+ $object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
+
+ $this->Application->StoreVar('SubscriberEmail', $user_email);
+
+ if( $object->Load(array('Email'=>$user_email)) ){
+ $group_info = $this->GetGroupInfo($object->GetID());
+ $event->redirect = $this->Application->GetVar($group_info ? 'unsubscribe_template' : 'subscribe_template');
+ }
+ else {
+ $event->redirect = $this->Application->GetVar('subscribe_template');
+ $this->Application->StoreVar('SubscriberEmail', $user_email);
+ }
+ }
+ else {
+ // used for error reporting only -> rewrite code + theme (by Alex)
+ $object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
+ $object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
+ $object->FieldErrors['SubscribeEmail']['pseudo'] = 'invalid_email';
+ $event->status = erFAIL;
+ }
+ //subscribe_query_ok_template
+ }
+
+ function OnSubscribeUser(&$event){
+
+ $object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
+
+ $user_email = $this->Application->RecallVar('SubscriberEmail');
+
+ if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email)){
+ $this->RemoveRequiredFields($object);
+ if($object->Load(array('Email'=>$user_email))){
+
+ $group_info = $this->GetGroupInfo($object->GetID());
+
+ if ($group_info){
+ if ($event->getEventParam('no_unsubscribe')) return;
+
+ if ($group_info['PrimaryGroup']){
+ // delete user
+ $object->Delete();
+ }
+ else {
+ $this->RemoveSubscriberGroup($object->GetID());
+ }
+
+ $event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
+
+ }
+ else {
+ $this->AddSubscriberGroup($object->GetID(), 0);
+ $event->redirect = $this->Application->GetVar('subscribe_ok_template');
+ }
+
+
+ }
+ else {
+
+ $object->SetField('Email', $user_email);
+ $object->SetField('Login', $user_email);
+ $object->SetDBField('dob', 1);
+ $object->SetDBField('dob_date', 1);
+ $object->SetDBField('dob_time', 1);
+ $ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
+ $object->SetDBField('ip', $ip);
+
+ $this->Application->SetVar('IsSubscriber', 1);
+
+ if ($object->Create()) {
+
+ $this->AddSubscriberGroup($object->GetID(), 1);
+ $event->redirect = $this->Application->GetVar('subscribe_ok_template');
+ }
+
+ $this->Application->SetVar('IsSubscriber', 0);
+ }
+ }
+ else {
+ // error handling here
+ $event->redirect = $this->Application->GetVar('subscribe_fail_template');
+ }
+
+
+ }
+
+ function AddSubscriberGroup($user_id, $is_primary){
+
+ $group_id = $this->Application->ConfigValue('User_SubscriberGroup');
+ $sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
+ $this->Conn->Query( sprintf($sql, $user_id, $group_id) );
+ $this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id);
+ $this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id);
+
+ }
+
+ function RemoveSubscriberGroup($user_id){
+
+ $group_id = $this->Application->ConfigValue('User_SubscriberGroup');
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
+ $this->Conn->Query($sql);
+ $this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id);
+ $this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
+
+ }
+
+ function GetGroupInfo($user_id){
+
+ $group_info = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'UserGroup
+ WHERE PortalUserId='.$user_id.'
+ AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup'));
+ return $group_info;
+
+ }
+
+ function OnForgotPassword(&$event)
+ {
+ $user_object = &$this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
+
+ // used for error reporting only -> rewrite code + theme (by Alex)
+ $user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
+
+ $username = $this->Application->GetVar('username');
+ $email = $this->Application->GetVar('email');
+ $found = false;
+ $allow_reset = true;
+
+ if( strlen($username) )
+ {
+ if( $user_object->Load(array('Login'=>$username)) )
+ $found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
+ }
+ else if( strlen($email) )
+ {
+ if( $user_object->Load(array('Email'=>$email)) )
+ $found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
+ }
+
+ if( $user_object->isLoaded() )
+ {
+ $PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
+ $PwRequestTime = $user_object->GetDBField('PwRequestTime');
+ $PassResetTime = $user_object->GetDBField('PassResetTime');
+ //$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
+ $MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
+
+ $allow_reset = (strlen($PwResetConfirm) ?
+ adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
+ adodb_mktime() > $PassResetTime + $MinPwResetDelay);
+ }
+
+ if($found && $allow_reset)
+ {
+ $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');
+ }
+ else
+ {
+ if(!strlen($username) && !strlen($email))
+ {
+ $user_current_object->ErrorMsgs['forgotpw_nodata'] = $this->Application->Phrase('lu_ferror_forgotpw_nodata');
+ $user_current_object->FieldErrors['Login']['pseudo'] = 'forgotpw_nodata';
+ $user_current_object->FieldErrors['Email']['pseudo'] = 'forgotpw_nodata';
+ }
+ else
+ {
+ if($allow_reset)
+ {
+ if( strlen($username) ){
+ $user_current_object->ErrorMsgs['unknown_username'] = $this->Application->Phrase('lu_ferror_unknown_username');
+ $user_current_object->FieldErrors['Login']['pseudo']='unknown_username';
+ }
+ if( strlen($email) ){
+ $user_current_object->ErrorMsgs['unknown_email'] = $this->Application->Phrase('lu_ferror_unknown_email');
+ $user_current_object->FieldErrors['Email']['pseudo']='unknown_email';
+ }
+ }
+ else
+ {
+ $user_current_object->ErrorMsgs['reset_denied'] = $this->Application->Phrase('lu_ferror_reset_denied');
+ if( strlen($username) ){
+ $user_current_object->FieldErrors['Login']['pseudo']='reset_denied';
+ }
+ if( strlen($email) ){
+ $user_current_object->FieldErrors['Email']['pseudo']='reset_denied';
+ }
+ }
+ }
+
+ if($user_current_object->FieldErrors){
+ $event->redirect = false;
+ }
+ }
+
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnResetPassword(&$event){
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+
+ if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
+
+ $this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
+ $event->redirect = $this->Application->GetVar('template_success');
+
+ $mod_object =& $this->Application->recallObject('mod.'.'In-Commerce');
+ $m_cat_id = $mod_object->GetDBField('RootCat');
+ $event->SetRedirectParam('pass', 'm');
+ //$event->SetRedirectParam('m_cat_id', $m_cat_id);
+ $this->Application->SetVar('m_cat_id', $m_cat_id);
+
+
+ }
+
+ }
+
+ function OnResetPasswordConfirmed(&$event)
+ {
+ $passed_key = $this->Application->GetVar('user_key');
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+
+ // used for error reporting only -> rewrite code + theme (by Alex)
+ $user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));// TODO: change theme too
+
+ if (strlen(trim($passed_key)) == 0) {
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = false;
+
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ }
+
+
+ if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
+ {
+ $exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
+ $user_object->SetDBField("PwResetConfirm", '');
+ $user_object->SetDBField("PwRequestTime", 0);
+ if ( $exp_time > adodb_mktime() )
+ {
+ //$m_var_list_update['codevalidationresult'] = 'lu_resetpw_confirm_text';
+ $newpw = makepassword4();
+
+ $this->Application->StoreVar('password', $newpw);
+
+ $user_object->SetDBField("Password",$newpw);
+ $user_object->SetDBField("PassResetTime", adodb_mktime());
+ $user_object->SetDBField("PwResetConfirm", '');
+ $user_object->SetDBField("PwRequestTime", 0);
+ $user_object->Update();
+
+ $this->Application->SetVar('ForgottenPassword', $newpw);
+
+ $email_event_user = &$this->Application->EmailEventUser('INCOMMERCEUSER.PSWD', $user_object->GetDBField('PortalUserId'));
+ $email_event_admin = &$this->Application->EmailEventAdmin('INCOMMERCEUSER.PSWD');
+
+ $this->Application->DeleteVar('ForgottenPassword');
+
+ if ($email_event_user->status == erSUCCESS){
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = $this->Application->GetVar('template_success');
+ }
+
+ $user_object->SetDBField("Password",md5($newpw));
+ $user_object->Update();
+
+ } else {
+ $user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
+ $event->redirect = false;
+
+ }
+ } else {
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ $event->redirect = false;
+
+ }
+ }
+
+ function OnUpdate(&$event)
+ {
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->CheckStateField($event, 'State', 'Country');
+
+ parent::OnUpdate($event);
+
+ $this->setNextTemplate($event);
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function setNextTemplate(&$event)
+ {
+ if( !$this->Application->IsAdmin() )
+ {
+ $event->redirect_params['opener'] = 's';
+ $object =& $event->getObject();
+ if($object->GetDBField('Status') == STATUS_ACTIVE)
+ {
+ $next_template = $this->Application->GetVar('next_template');
+ if($next_template) $event->redirect = $next_template;
+ }
+ }
+ }
+
+
+
+ /**
+ * Delete users from groups if their membership is expired
+ *
+ * @param kEvent $event
+ */
+ function OnCheckExpiredMembership(&$event)
+ {
+ // send pre-expiration reminders: begin
+ $pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
+ $sql = 'SELECT PortalUserId, GroupId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
+
+ $skip_clause = $event->getEventParam('skip_clause');
+ if ($skip_clause) {
+ $sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
+ }
+
+ $records = $this->Conn->Query($sql);
+ if ($records) {
+ $conditions = Array();
+ foreach ($records as $record) {
+ $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
+ $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
+ $conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
+ }
+ $sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
+ SET ExpirationReminderSent = 1
+ WHERE '.implode(' OR ', $conditions);
+ $this->Conn->Query($sql);
+ }
+ // send pre-expiration reminders: end
+
+ // remove users from groups with expired membership: begin
+ $sql = 'SELECT PortalUserId
+ FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $user_ids = $this->Conn->GetCol($sql);
+ if ($user_ids) {
+ foreach ($user_ids as $id) {
+ $email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
+ $email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
+ }
+ }
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
+ $this->Conn->Query($sql);
+ // remove users from groups with expired membership: end
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnRefreshForm(&$event)
+ {
+ $event->redirect = false;
+ $item_info = $this->Application->GetVar($event->Prefix_Special);
+ list($id, $fields) = each($item_info);
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $object->setID($id);
+ $object->IgnoreValidation = true;
+ $object->SetFieldsFromHash($fields);
+ }
+
+ /**
+ * Sets persistant variable
+ *
+ * @param kEvent $event
+ */
+ function OnSetPersistantVariable(&$event)
+ {
+ $object =& $event->getObject();
+
+ $field = $this->Application->GetVar('field');
+ $value = $this->Application->GetVar('value');
+ $object->setPersistantVar($field, $value);
+
+ $force_tab = $this->Application->GetVar('SetTab');
+ if ($force_tab) {
+ $this->Application->StoreVar('force_tab', $force_tab);
+ }
+ }
+
+ /**
+ * Overwritten to return user from order by special .ord
+ *
+ * @param kEvent $event
+ */
+ function getPassedId(&$event)
+ {
+ if ($event->Special == 'ord') {
+ $order =& $this->Application->recallObject('ord');
+ return $order->GetDBField('PortalUserId');
+ }
+ return parent::getPassedID($event);
+ }
+
+ /**
+ * Allows to change root password
+ *
+ * @param kEvent $event
+ */
+ function OnUpdateRootPassword(&$event)
+ {
+ $user_id = $this->Application->RecallVar('user_id');
+ if ($user_id != -1) {
+ // not "root" can't change root's password via this event
+ return false;
+ }
+
+ // put salt to user's config
+ $field_options = $this->Application->getUnitOption($event->Prefix.'.RootPassword', 'Fields');
+ $field_options['salt'] = 'b38';
+ $this->Application->setUnitOption($event->Prefix.'.RootPassword', 'Fields', $field_options);
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object UsersItem */
+
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
+ if ($items_info) {
+ list ($id, $field_values) = each($items_info);
+ $this->RemoveRequiredFields($object);
+ $object->SetDBField('RootPassword', $this->Application->ConfigValue('RootPass'));
+ $object->SetFieldsFromHash($field_values);
+ $status = $object->Validate();
+ if ($status) {
+ // validation on, password match too
+ $fields_hash = Array (
+ 'VariableValue' => $object->GetDBField('RootPassword')
+ );
+ $conf_table = $this->Application->getUnitOption('conf', 'TableName');
+ $this->Conn->doUpdate($fields_hash, $conf_table, 'VariableName = "RootPass"');
+ $event->SetRedirectParam('opener', 'u');
+ }
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
+ }
+ }
+ }
+
+ /**
+ * Apply some special processing to
+ * object beeing recalled before using
+ * it in other events that call prepareObject
+ *
+ * @param Object $object
+ * @param kEvent $event
+ * @access protected
+ */
+ function prepareObject(&$object, &$event)
+ {
+ parent::prepareObject($object, $event);
+
+ if (!$this->Application->IsAdmin()) {
+ if ($this->Application->RecallVar('register_captcha_code')) return ;
+ $captcha_helper =& $this->Application->recallObject('CaptchaHelper');
+ /* @var $captcha_helper kCaptchaHelper */
+ $this->Application->StoreVar('register_captcha_code', $captcha_helper->GenerateCaptchaCode());
+ }
+ }
+
+ /**
+ * Apply custom processing to item
+ *
+ * @param kEvent $event
+ */
+ function customProcessing(&$event, $type)
+ {
+ if ($event->Name == 'OnCreate' && $type == 'before') {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ // if auto password has not been set already - store real one - to be used in email events
+ if (!$this->Application->GetVar('user_password')) {
+ $this->Application->SetVar('user_password', $object->GetDirtyField('Password'));
+ $object->SetDBField('Password_plain', $object->GetDirtyField('Password'));
+ }
+
+ // Validate captcha image if it's requried
+ if ($this->Application->ConfigValue('RegistrationCaptcha') && $object->GetDBField('Captcha') != $this->Application->RecallVar('register_captcha_code')) {
+ $object->SetError('Captcha', 'captcha_error', 'lu_captcha_error');
+ $captcha_helper =& $this->Application->recallObject('CaptchaHelper');
+ /* @var $captcha_helper kCaptchaHelper */
+ $this->Application->StoreVar('register_captcha_code', $captcha_helper->GenerateCaptchaCode());
+ }
+
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.76.2/core/units/users/users_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.76
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline