Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Nov 11, 7:29 AM

in-portal

Index: branches/unlabeled/unlabeled-1.62.2/admin/install/inportal_schema.sql
===================================================================
--- branches/unlabeled/unlabeled-1.62.2/admin/install/inportal_schema.sql (nonexistent)
+++ branches/unlabeled/unlabeled-1.62.2/admin/install/inportal_schema.sql (revision 6139)
@@ -0,0 +1,753 @@
+CREATE TABLE BanRules (
+ RuleId int(11) NOT NULL auto_increment,
+ RuleType tinyint(4) NOT NULL default '0',
+ ItemField varchar(255) default NULL,
+ ItemVerb tinyint(4) NOT NULL default '0',
+ ItemValue varchar(255) NOT NULL default '',
+ ItemType int(11) NOT NULL default '0',
+ Priority int(11) NOT NULL default '0',
+ Status tinyint(4) NOT NULL default '1',
+ ErrorTag varchar(255) default NULL,
+ PRIMARY KEY (RuleId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Category (
+ CategoryId int(11) NOT NULL auto_increment,
+ `Type` int(11) NOT NULL default '0',
+ ParentId int(11) NOT NULL default '0',
+ Name varchar(255) NOT NULL default '',
+ l1_Name varchar(255) NOT NULL default '',
+ l2_Name varchar(255) NOT NULL default '',
+ l3_Name varchar(255) NOT NULL default '',
+ l4_Name varchar(255) NOT NULL default '',
+ l5_Name varchar(255) NOT NULL default '',
+ Filename varchar(255) NOT NULL default '',
+ AutomaticFilename tinyint(3) unsigned NOT NULL default '1',
+ Description text NOT NULL,
+ l1_Description text NOT NULL,
+ l2_Description text NOT NULL,
+ l3_Description text NOT NULL,
+ l4_Description text NOT NULL,
+ l5_Description text NOT NULL,
+ CreatedOn int(11) NOT NULL default '0',
+ EditorsPick tinyint(4) NOT NULL default '0',
+ `Status` tinyint(4) NOT NULL default '0',
+ Pop tinyint(4) default NULL,
+ Priority int(11) NOT NULL default '0',
+ MetaKeywords varchar(255) default NULL,
+ CachedDescendantCatsQty int(11) default NULL,
+ CachedNavbar text NOT NULL,
+ l1_CachedNavbar text NOT NULL,
+ l2_CachedNavbar text NOT NULL,
+ l3_CachedNavbar text NOT NULL,
+ l4_CachedNavbar text NOT NULL,
+ l5_CachedNavbar text NOT NULL,
+ CreatedById int(11) NOT NULL default '0',
+ ResourceId int(11) default NULL,
+ ParentPath text NOT NULL,
+ NamedParentPath text NOT NULL,
+ MetaDescription varchar(255) default NULL,
+ HotItem int(11) NOT NULL default '2',
+ NewItem int(11) NOT NULL default '2',
+ PopItem int(11) NOT NULL default '2',
+ Modified int(11) NOT NULL default '0',
+ ModifiedById int(11) NOT NULL default '0',
+ CategoryTemplate varchar(255) NOT NULL default '',
+ CachedCategoryTemplate varchar(255) NOT NULL default '',
+ PRIMARY KEY (CategoryId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY ParentId (ParentId),
+ KEY Modified (Modified),
+ KEY Priority (Priority),
+ KEY sorting (Name,Priority),
+ KEY Filename (Filename(5)),
+ KEY l1_Name (l1_Name(5)),
+ KEY l2_Name (l2_Name(5)),
+ KEY l3_Name (l3_Name(5)),
+ KEY l4_Name (l4_Name(5)),
+ KEY l5_Name (l5_Name(5)),
+ KEY l1_Description (l1_Description(5)),
+ KEY l2_Description (l2_Description(5)),
+ KEY l3_Description (l3_Description(5)),
+ KEY l4_Description (l4_Description(5)),
+ KEY l5_Description (l5_Description(5))
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE CategoryItems (
+ `CategoryId` int(11) NOT NULL default '0',
+ `ItemResourceId` int(11) NOT NULL default '0',
+ `PrimaryCat` tinyint(4) NOT NULL default '0',
+ `ItemPrefix` varchar(50) NOT NULL default '',
+ `Filename` varchar(255) NOT NULL default '',
+ UNIQUE KEY `CategoryId` (`CategoryId`,`ItemResourceId`),
+ KEY `PrimaryCat` (`PrimaryCat`),
+ KEY `ItemPrefix` (`ItemPrefix`),
+ KEY `Filename` (`Filename`(4))
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ConfigurationAdmin (
+ VariableName varchar(80) NOT NULL default '',
+ heading varchar(255) default NULL,
+ prompt varchar(255) default NULL,
+ element_type varchar(20) NOT NULL default '',
+ validation varchar(255) default NULL,
+ ValueList text default NULL,
+ DisplayOrder double NOT NULL default '0',
+ GroupDisplayOrder double NOT NULL default '0',
+ Install int(11) NOT NULL default '1',
+ PRIMARY KEY (VariableName)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ConfigurationValues (
+ VariableId int(11) NOT NULL auto_increment,
+ VariableName varchar(255) NOT NULL default '',
+ VariableValue varchar(255) default NULL,
+ ModuleOwner varchar(20) default 'In-Portal',
+ Section varchar(255) NOT NULL default '',
+ PRIMARY KEY (VariableId),
+ UNIQUE KEY VariableName (VariableName)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE CountCache (
+ ListType int(11) NOT NULL default '0',
+ ItemType int(11) NOT NULL default '-1',
+ Value int(11) NOT NULL default '0',
+ CountCacheId int(11) NOT NULL auto_increment,
+ LastUpdate int(11) NOT NULL default '0',
+ ExtraId varchar(50) default NULL,
+ TodayOnly tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (CountCacheId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE CustomField (
+ CustomFieldId int(11) NOT NULL auto_increment,
+ Type int(11) NOT NULL default '0',
+ FieldName varchar(255) NOT NULL default '',
+ FieldLabel varchar(40) default NULL,
+ Heading varchar(60) default NULL,
+ Prompt varchar(60) default NULL,
+ ElementType varchar(50) NOT NULL default '',
+ ValueList varchar(255) default NULL,
+ DisplayOrder int(11) NOT NULL default '0',
+ OnGeneralTab tinyint(4) NOT NULL default '0',
+ IsSystem tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (CustomFieldId),
+ KEY Type (Type)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE EmailMessage (
+ EmailMessageId int(10) NOT NULL auto_increment,
+ Template longtext,
+ MessageType enum('html','text') NOT NULL default 'text',
+ LanguageId int(11) NOT NULL default '0',
+ EventId int(11) NOT NULL default '0',
+ PRIMARY KEY (EmailMessageId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE EmailQueue (
+ Subject text NOT NULL,
+ toaddr text NOT NULL,
+ fromaddr text NOT NULL,
+ message blob,
+ headers blob,
+ queued timestamp NOT NULL
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE EmailSubscribers (
+ EmailMessageId int(11) NOT NULL default '0',
+ PortalUserId int(11) NOT NULL default '0'
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Events (
+ EventId int(11) NOT NULL auto_increment,
+ Event varchar(40) NOT NULL default '',
+ Enabled int(11) NOT NULL default '1',
+ FromUserId int(11) NOT NULL default '0',
+ Module varchar(40) NOT NULL default '',
+ Description varchar(255) NOT NULL default '',
+ Type int(11) NOT NULL default '0',
+ PRIMARY KEY (EventId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Favorites (
+ FavoriteId int(11) NOT NULL auto_increment,
+ PortalUserId int(11) NOT NULL default '0',
+ ResourceId int(11) NOT NULL default '0',
+ ItemTypeId int(11) NOT NULL default '0',
+ Modified int(11) NOT NULL default '0',
+ PRIMARY KEY (FavoriteId),
+ UNIQUE KEY main (PortalUserId,ResourceId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE IdGenerator (
+ lastid int(11) default NULL
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Images (
+ ImageId int(11) NOT NULL auto_increment,
+ ResourceId int(11) NOT NULL default '0',
+ Url varchar(255) NOT NULL default '',
+ Name varchar(255) NOT NULL default '',
+ AltName varchar(255) default NULL,
+ ImageIndex int(11) NOT NULL default '0',
+ LocalImage tinyint(4) NOT NULL default '1',
+ LocalPath varchar(240) NOT NULL default '',
+ Enabled int(11) NOT NULL default '1',
+ DefaultImg int(11) NOT NULL default '0',
+ ThumbUrl varchar(255) default NULL,
+ Priority int(11) NOT NULL default '0',
+ ThumbPath varchar(255) default NULL,
+ LocalThumb tinyint(4) NOT NULL default '0',
+ SameImages tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (ImageId),
+ KEY ResourceId (ResourceId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ItemRating (
+ RatingId int(11) NOT NULL auto_increment,
+ IPAddress varchar(255) NOT NULL default '',
+ CreatedOn double NOT NULL default '0',
+ RatingValue int(11) NOT NULL default '0',
+ ItemId int(11) NOT NULL default '0',
+ PRIMARY KEY (RatingId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ItemReview (
+ ReviewId int(11) NOT NULL auto_increment,
+ CreatedOn double NOT NULL default '0',
+ ReviewText longtext NOT NULL,
+ IPAddress varchar(255) NOT NULL default '',
+ ItemId int(11) NOT NULL default '0',
+ CreatedById int(11) NOT NULL default '0',
+ ItemType tinyint(4) NOT NULL default '0',
+ Priority int(11) NOT NULL default '0',
+ Status tinyint(4) NOT NULL default '0',
+ TextFormat int(11) NOT NULL default '0',
+ Module varchar(255) NOT NULL default '',
+ PRIMARY KEY (ReviewId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ItemTypes (
+ ItemType int(11) NOT NULL default '0',
+ Module varchar(50) NOT NULL default '',
+ Prefix varchar(20) NOT NULL default '',
+ SourceTable varchar(100) NOT NULL default '',
+ TitleField varchar(50) default NULL,
+ CreatorField varchar(255) NOT NULL default '',
+ PopField varchar(255) default NULL,
+ RateField varchar(255) default NULL,
+ LangVar varchar(255) NOT NULL default '',
+ PrimaryItem int(11) NOT NULL default '0',
+ EditUrl varchar(255) NOT NULL default '',
+ ClassName varchar(40) NOT NULL default '',
+ ItemName varchar(50) NOT NULL default '',
+ PRIMARY KEY (ItemType),
+ KEY Module (Module)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Language (
+ LanguageId int(11) NOT NULL auto_increment,
+ PackName varchar(40) NOT NULL default '',
+ LocalName varchar(40) NOT NULL default '',
+ Enabled int(11) NOT NULL default '0',
+ PrimaryLang int(11) NOT NULL default '0',
+ IconURL varchar(255) default NULL,
+ DateFormat varchar(50) NOT NULL default '',
+ TimeFormat varchar(50) NOT NULL default '',
+ InputDateFormat varchar(50) NOT NULL default '',
+ InputTimeFormat varchar(50) NOT NULL default '',
+ DecimalPoint char(2) NOT NULL default '.',
+ ThousandSep char(1) NOT NULL default ',',
+ Charset varchar(20) NOT NULL default '',
+ UnitSystem tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (LanguageId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Modules (
+ Name varchar(255) NOT NULL default '',
+ Path varchar(255) NOT NULL default '',
+ Var varchar(10) NOT NULL default '',
+ Version varchar(10) NOT NULL default '',
+ Loaded tinyint(4) NOT NULL default '1',
+ LoadOrder tinyint(4) NOT NULL default '0',
+ TemplatePath varchar(255) NOT NULL default '',
+ RootCat int(11) NOT NULL default '0',
+ BuildDate double NOT NULL default '0',
+ PRIMARY KEY (Name)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PermCache (
+ PermCacheId int(11) NOT NULL auto_increment,
+ CategoryId int(11) NOT NULL default '0',
+ PermId int(11) NOT NULL default '0',
+ ACL varchar(255) NOT NULL default '',
+ DACL varchar(255) NOT NULL default '',
+ PRIMARY KEY (PermCacheId),
+ KEY CategoryId (CategoryId),
+ KEY PermId (PermId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PermissionConfig (
+ PermissionConfigId int(11) NOT NULL auto_increment,
+ PermissionName varchar(30) NOT NULL default '',
+ Description varchar(255) NOT NULL default '',
+ ErrorMessage varchar(255) NOT NULL default '',
+ ModuleId varchar(20) NOT NULL default '0',
+ PRIMARY KEY (PermissionConfigId),
+ KEY PermissionName (PermissionName)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Permissions (
+ PermissionId int(11) NOT NULL auto_increment,
+ Permission varchar(255) NOT NULL default '',
+ GroupId int(11) default '0',
+ PermissionValue int(11) NOT NULL default '0',
+ Type tinyint(4) NOT NULL default '0',
+ CatId int(11) NOT NULL default '0',
+ PRIMARY KEY (PermissionId),
+ UNIQUE KEY PermIndex (Permission,GroupId,CatId,Type)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PersistantSessionData (
+ PortalUserId int(11) NOT NULL default '0',
+ VariableName varchar(255) NOT NULL default '',
+ VariableValue text NOT NULL,
+ PRIMARY KEY (PortalUserId,VariableName),
+ KEY UserId (PortalUserId),
+ KEY VariableName (VariableName)
+)
+# --------------------------------------------------------
+
+CREATE TABLE Phrase (
+ Phrase varchar(255) NOT NULL default '',
+ Translation text NOT NULL default '',
+ PhraseType int(11) NOT NULL default '0',
+ PhraseId int(11) NOT NULL auto_increment,
+ LanguageId int(11) NOT NULL default '0',
+ LastChanged int(10) unsigned NOT NULL default '0',
+ LastChangeIP varchar(15) NOT NULL default '',
+ Module varchar(30) NOT NULL default '',
+ PRIMARY KEY (PhraseId),
+ KEY LanguageId (LanguageId),
+ INDEX Phrase_Index (Phrase)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PhraseCache (
+ Template varchar(40) NOT NULL default '',
+ PhraseList text NOT NULL,
+ CacheDate int(11) NOT NULL default '0',
+ ThemeId int(11) NOT NULL default '0',
+ StylesheetId int(10) unsigned NOT NULL default '0',
+ ConfigVariables text,
+ PRIMARY KEY (Template)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PortalGroup (
+ GroupId int(11) NOT NULL auto_increment,
+ Name varchar(255) NOT NULL default '',
+ Description varchar(255) default NULL,
+ CreatedOn double NOT NULL default '0',
+ System tinyint(4) NOT NULL default '0',
+ Personal tinyint(4) NOT NULL default '0',
+ Enabled tinyint(4) NOT NULL default '1',
+ ResourceId int(11) NOT NULL default '0',
+ PRIMARY KEY (GroupId),
+ UNIQUE KEY Name (Name),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY Personal (Personal),
+ KEY Enabled (Enabled)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE PortalUser (
+ PortalUserId int(11) NOT NULL auto_increment,
+ Login varchar(255) default NULL,
+ `Password` varchar(255) default NULL,
+ FirstName varchar(255) default NULL,
+ LastName varchar(255) default NULL,
+ Company varchar(255) NOT NULL default '',
+ Email varchar(255) NOT NULL default '',
+ CreatedOn double NOT NULL default '0',
+ Phone varchar(20) default NULL,
+ Fax varchar(255) NOT NULL default '',
+ Street varchar(255) default NULL,
+ Street2 varchar(255) NOT NULL default '',
+ City varchar(20) default NULL,
+ State varchar(20) NOT NULL default '',
+ Zip varchar(20) default NULL,
+ Country varchar(20) NOT NULL default '',
+ ResourceId int(11) NOT NULL default '0',
+ `Status` tinyint(4) NOT NULL default '2',
+ Modified int(11) NOT NULL default '0',
+ dob double NOT NULL default '0',
+ tz int(11) default NULL,
+ ip varchar(20) default NULL,
+ IsBanned tinyint(1) NOT NULL default '0',
+ PassResetTime bigint(20) default NULL,
+ PwResetConfirm varchar(255) default NULL,
+ PwRequestTime bigint(25) default NULL,
+ MinPwResetDelay int(11) NOT NULL default '1800',
+ PRIMARY KEY (PortalUserId),
+ UNIQUE KEY ResourceId (ResourceId),
+ UNIQUE KEY Login (Login),
+ KEY CreatedOn (CreatedOn)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Relationship (
+ RelationshipId int(11) NOT NULL auto_increment,
+ SourceId int(11) default NULL,
+ TargetId int(11) default NULL,
+ SourceType tinyint(4) NOT NULL default '0',
+ TargetType tinyint(4) NOT NULL default '0',
+ Type int(11) NOT NULL default '0',
+ Enabled int(11) NOT NULL default '1',
+ Priority int(11) NOT NULL default '0',
+ PRIMARY KEY (RelationshipId),
+ KEY RelSource (SourceId),
+ KEY RelTarget (TargetId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SearchConfig (
+ TableName varchar(40) NOT NULL default '',
+ FieldName varchar(40) NOT NULL default '',
+ SimpleSearch tinyint(4) NOT NULL default '0',
+ AdvancedSearch tinyint(4) NOT NULL default '0',
+ Description varchar(255) default NULL,
+ DisplayName varchar(80) default NULL,
+ ModuleName varchar(20) default NULL,
+ ConfigHeader varchar(255) default NULL,
+ DisplayOrder int(11) NOT NULL default '0',
+ SearchConfigId int(11) NOT NULL auto_increment,
+ Priority int(11) NOT NULL default '0',
+ FieldType varchar(20) NOT NULL default 'text',
+ ForeignField TEXT,
+ JoinClause TEXT,
+ IsWhere text,
+ IsNotWhere text,
+ ContainsWhere text,
+ NotContainsWhere text,
+ CustomFieldId int(11) default NULL,
+ PRIMARY KEY (SearchConfigId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SearchLog (
+ SearchLogId int(11) NOT NULL auto_increment,
+ Keyword varchar(255) NOT NULL default '',
+ Indices bigint(20) NOT NULL default '0',
+ SearchType int(11) NOT NULL default '0',
+ PRIMARY KEY (SearchLogId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE IgnoreKeywords (
+ keyword varchar(20) NOT NULL default '',
+ PRIMARY KEY (keyword)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SessionData (
+ SessionKey varchar(50) NOT NULL default '',
+ VariableName varchar(255) NOT NULL default '',
+ VariableValue text NOT NULL,
+ PRIMARY KEY (SessionKey,VariableName),
+ KEY SessionKey (SessionKey),
+ KEY VariableName (VariableName)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SpamControl (
+ ItemResourceId int(11) NOT NULL default '0',
+ IPaddress varchar(20) NOT NULL default '',
+ Expire double NOT NULL default '0',
+ PortalUserId int(11) NOT NULL default '0',
+ DataType varchar(20) default NULL
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE StatItem (
+ StatItemId int(11) NOT NULL auto_increment,
+ Module varchar(20) NOT NULL default '',
+ ValueSQL varchar(255) default NULL,
+ ResetSQL varchar(255) default NULL,
+ ListLabel varchar(255) NOT NULL default '',
+ Priority int(11) NOT NULL default '0',
+ AdminSummary int(11) NOT NULL default '0',
+ PRIMARY KEY (StatItemId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Theme (
+ ThemeId int(11) NOT NULL auto_increment,
+ Name varchar(40) NOT NULL default '',
+ Enabled int(11) NOT NULL default '1',
+ Description varchar(255) default NULL,
+ PrimaryTheme int(11) NOT NULL default '0',
+ CacheTimeout int(11) NOT NULL default '0',
+ StylesheetId INTEGER(10) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (ThemeId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ThemeFiles (
+ FileId int(11) NOT NULL auto_increment,
+ ThemeId int(11) NOT NULL default '0',
+ FileName varchar(255) NOT NULL default '',
+ FilePath varchar(255) NOT NULL default '',
+ Description varchar(255) default NULL,
+ FileType int(11) NOT NULL default '0',
+ PRIMARY KEY (FileId),
+ KEY theme (ThemeId),
+ KEY FileName (FileName),
+ KEY FilePath (FilePath)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE UserGroup (
+ PortalUserId int(11) NOT NULL default '0',
+ GroupId int(11) NOT NULL default '0',
+ MembershipExpires int(10) unsigned default NULL,
+ PrimaryGroup tinyint(4) NOT NULL default '1',
+ ExpirationReminderSent tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (PortalUserId,GroupId),
+ KEY GroupId (GroupId),
+ KEY PrimaryGroup (PrimaryGroup)
+)
+
+# --------------------------------------------------------
+
+
+
+CREATE TABLE UserSession (
+ SessionKey varchar(50) NOT NULL default '',
+ CurrentTempKey varchar(50) default NULL,
+ PrevTempKey varchar(50) default NULL,
+ LastAccessed double NOT NULL default '0',
+ PortalUserId varchar(255) NOT NULL default '',
+ Language varchar(255) NOT NULL default '',
+ Theme varchar(255) NOT NULL default '',
+ GroupId int(11) NOT NULL default '0',
+ IpAddress varchar(20) NOT NULL default '0.0.0.0',
+ Status int(11) NOT NULL default '1',
+ GroupList varchar(255) default NULL,
+ tz int(11) default NULL,
+ PRIMARY KEY (SessionKey),
+ KEY UserId (PortalUserId),
+ KEY LastAccessed (LastAccessed)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SuggestMail (
+ email varchar(255) NOT NULL default '',
+ sent double,
+ PRIMARY KEY (email)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE SysCache (
+ SysCacheId int(11) NOT NULL auto_increment,
+ Name varchar(255) NOT NULL default '',
+ Value mediumtext,
+ Expire double NOT NULL default '0',
+ Module varchar(20) default NULL,
+ Context varchar(255) default NULL,
+ GroupList varchar(255) NOT NULL default '',
+ PRIMARY KEY (SysCacheId),
+ KEY Name (Name)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE TagLibrary (
+ TagId int(11) NOT NULL auto_increment,
+ name varchar(255) NOT NULL default '',
+ description text,
+ example text,
+ scope varchar(20) NOT NULL default 'global',
+ PRIMARY KEY (TagId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE TagAttributes (
+ AttrId int(11) NOT NULL auto_increment,
+ TagId int(11) NOT NULL default '0',
+ Name varchar(255) NOT NULL default '',
+ AttrType varchar(20) default NULL,
+ DefValue varchar(255) default NULL,
+ Description TEXT,
+ Required int(11) NOT NULL default '0',
+ PRIMARY KEY (AttrId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE EmailLog (
+ EmailLogId int(11) NOT NULL auto_increment,
+ fromuser varchar(200) default NULL,
+ addressto varchar(255) default NULL,
+ subject varchar(255) default NULL,
+ timestamp bigint(20) default '0',
+ event varchar(100) default NULL,
+ PRIMARY KEY (EmailLogId)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE ImportScripts (
+ is_id smallint(5) unsigned NOT NULL auto_increment,
+ is_Module varchar(50) NOT NULL default '',
+ is_string_id varchar(10) NOT NULL default '',
+ is_script varchar(100) NOT NULL default '',
+ is_label varchar(255) NOT NULL default '',
+ is_field_prefix varchar(50) NOT NULL default '',
+ is_requred_fields varchar(255) NOT NULL default '',
+ is_enabled tinyint(1) unsigned NOT NULL default '0',
+ is_type varchar(10) NOT NULL default '',
+ PRIMARY KEY (is_id)
+)
+
+# --------------------------------------------------------
+
+CREATE TABLE Cache (
+ VarName varchar(255) NOT NULL default '',
+ Data longtext,
+ Cached int(11) default NULL,
+ LifeTime int(11) NOT NULL default '-1',
+ PRIMARY KEY (VarName),
+ KEY Cached (Cached)
+)
+# --------------------------------------------------------
+CREATE TABLE StylesheetSelectors (
+ SelectorId int(11) NOT NULL auto_increment,
+ StylesheetId int(11) NOT NULL default '0',
+ Name varchar(255) NOT NULL default '',
+ SelectorName varchar(255) NOT NULL default '',
+ SelectorData text NOT NULL,
+ Description text NOT NULL,
+ Type tinyint(4) NOT NULL default '0',
+ AdvancedCSS text NOT NULL,
+ ParentId int(11) NOT NULL default '0',
+ PRIMARY KEY (SelectorId)
+)
+# --------------------------------------------------------
+CREATE TABLE Stylesheets (
+ StylesheetId int(11) NOT NULL auto_increment,
+ Name varchar(255) NOT NULL default '',
+ Description varchar(255) NOT NULL default '',
+ AdvancedCSS text NOT NULL,
+ LastCompiled int(10) unsigned NOT NULL default '0',
+ Enabled int(11) NOT NULL default '0',
+ PRIMARY KEY (StylesheetId)
+)
+# --------------------------------------------------------
+
+CREATE TABLE StdDestinations (
+ DestId int(11) NOT NULL auto_increment,
+ DestType int(11) NOT NULL default '0',
+ DestParentId int(11) default NULL,
+ DestName varchar(255) NOT NULL default '',
+ DestAbbr char(3) NOT NULL default '',
+ DestAbbr2 char(2) default '',
+ PRIMARY KEY (DestId)
+)
+# --------------------------------------------------------
+CREATE TABLE Visits (
+ VisitId int(11) NOT NULL auto_increment,
+ VisitDate int(10) unsigned NOT NULL default '0',
+ Referer varchar(255) NOT NULL default '',
+ IPAddress varchar(15) NOT NULL default '',
+ AffiliateId int(10) unsigned NOT NULL default '0',
+ PortalUserId int(11) NOT NULL default '0',
+ PRIMARY KEY (VisitId),
+ KEY PortalUserId (PortalUserId),
+ KEY AffiliateId (AffiliateId)
+)
+# --------------------------------------------------------
+CREATE TABLE ImportCache (
+ CacheId int(11) NOT NULL auto_increment,
+ CacheName varchar(255) NOT NULL default '',
+ VarName int(11) NOT NULL default '0',
+ VarValue text NOT NULL,
+ PRIMARY KEY (CacheId),
+ KEY CacheName (CacheName),
+ KEY VarName (VarName)
+)
+# --------------------------------------------------------
+CREATE TABLE PortalUserCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+)
+# --------------------------------------------------------
+CREATE TABLE CategoryCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+)
+# --------------------------------------------------------
Property changes on: branches/unlabeled/unlabeled-1.62.2/admin/install/inportal_schema.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.62
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php (revision 6139)
@@ -0,0 +1,917 @@
+<?php
+
+class kMainTagProcessor extends TagProcessor {
+
+ function Init($prefix, $special, $event_params = null)
+ {
+ parent::Init($prefix, $special, $event_params);
+
+ $actions =& $this->Application->recallObject('kActions');
+ $actions->Set('t', $this->Application->GetVar('t'));
+ $actions->Set('sid', $this->Application->GetSID());
+ $actions->Set('m_opener', $this->Application->GetVar('m_opener') );
+ }
+
+ /**
+ * Used to handle calls where tag name
+ * match with existing php function name
+ *
+ * @param Tag $tag
+ * @return string
+ */
+ function ProcessTag(&$tag)
+ {
+ if ($tag->Tag=='include') $tag->Tag='MyInclude';
+ return parent::ProcessTag($tag);
+ }
+
+ /**
+ * Base folder for all template includes
+ *
+ * @param Array $params
+ * @return string
+ */
+ function TemplatesBase($params)
+ {
+ if ($this->Application->IsAdmin()) {
+ $module = isset($params['module']) ? $params['module'] : 'kernel';
+ $path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', THEMES_PATH); // remove leading slash + substitute module
+ }
+ else {
+ $path = substr(THEMES_PATH, 1);
+ }
+ return $this->Application->BaseURL().$path;
+ }
+
+ /**
+ * Creates <base href ..> HTML tag for all templates
+ * affects future css, js files and href params of links
+ *
+ * @return string
+ * @access public
+ */
+ function Base_Ref($params)
+ {
+ return '<base href="'.$this->TemplatesBase($params).'/" />';
+ }
+
+ /**
+ * Returns base url for web-site
+ *
+ * @return string
+ * @access public
+ */
+ function BaseURL()
+ {
+ return $this->Application->BaseURL();
+ }
+
+ function ProjectBase($params)
+ {
+ return $this->Application->BaseURL();
+ }
+
+ /*function Base($params)
+ {
+ return $this->Application->BaseURL().$params['add'];
+ }*/
+
+ /**
+ * Used to create link to any template.
+ * use "pass" paramter if "t" tag to specify
+ * prefix & special of object to be represented
+ * in resulting url
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function T($params)
+ {
+ //by default link to current template
+ $t = $this->SelectParam($params, 't,template');
+ unset($params['t']);
+ unset($params['template']);
+ $prefix=isset($params['prefix']) ? $params['prefix'] : ''; unset($params['prefix']);
+ $index_file = isset($params['index_file']) ? $params['index_file'] : null; unset($params['index_file']);
+
+ return $this->Application->HREF($t, $prefix, $params, $index_file);
+ }
+
+ function Link($params)
+ {
+ if (isset($params['template'])) {
+ $params['t'] = $params['template'];
+ unset($params['template']);
+ }
+ if (!isset($params['pass']) && !isset($params['no_pass'])) $params['pass'] = 'm';
+ if (isset($params['no_pass'])) unset($params['no_pass']);
+
+ if( $this->Application->GetVar('admin') ) $params['admin'] = 1;
+
+ return $this->T($params);
+ }
+
+ function Env($params)
+ {
+ $t = $params['template'];
+ unset($params['template']);
+ return $this->Application->BuildEnv($t, $params, 'm', null, false);
+ }
+
+ function FormAction($params)
+ {
+ return $this->Application->ProcessParsedTag('m', 't', array_merge($params, Array('pass'=>'all,m' )) );
+ }
+
+ /*// NEEDS TEST
+ function Config($params)
+ {
+ return $this->Application->ConfigOption($params['var']);
+ }
+
+ function Object($params)
+ {
+ $name = $params['name'];
+ $method = $params['method'];
+
+ $tmp =& $this->Application->recallObject($name);
+ if ($tmp != null) {
+ if (method_exists($tmp, $method))
+ return $tmp->$method($params);
+ else
+ echo "Method $method does not exist in object ".get_class($tmp)." named $name<br>";
+ }
+ else
+ echo "Object $name does not exist in the appliaction<br>";
+ }*/
+
+ /**
+ * Tag, that always returns true.
+ * For parser testing purposes
+ *
+ * @param Array $params
+ * @return bool
+ * @access public
+ */
+ function True($params)
+ {
+ return true;
+ }
+
+ /**
+ * Tag, that always returns false.
+ * For parser testing purposes
+ *
+ * @param Array $params
+ * @return bool
+ * @access public
+ */
+ function False($params)
+ {
+ return false;
+ }
+
+ /**
+ * Returns block parameter by name
+ *
+ * @param Array $params
+ * @return stirng
+ * @access public
+ */
+ function Param($params)
+ {
+ //$parser =& $this->Application->recallObject('TemplateParser');
+ $res = $this->Application->Parser->GetParam($params['name']);
+ if ($res === false) $res = '';
+ if (isset($params['plus']))
+ $res += $params['plus'];
+ return $res;
+ }
+
+ function DefaultParam($params)
+ {
+ foreach ($params as $key => $val) {
+ if ($this->Application->Parser->GetParam($key) === false) {
+ $this->Application->Parser->SetParam($key, $val);
+ }
+ }
+ }
+
+ /**
+ * Gets value of specified field from specified prefix_special and set it as parser param
+ *
+ * @param Array $params
+ */
+ /*function SetParam($params)
+ {
+ // <inp2:m_SetParam param="custom_name" src="cf:FieldName"/>
+ list($prefix_special, $field_name) = explode(':', $params['src']);
+
+ $object =& $this->Application->recallObject($prefix_special);
+ $name = $this->SelectParam($params, 'param,name,var');
+
+ $this->Application->Parser->SetParam($name, $object->GetField($field_name) );
+ }*/
+
+ /**
+ * Compares block parameter with value specified
+ *
+ * @param Array $params
+ * @return bool
+ * @access public
+ */
+ function ParamEquals($params)
+ {
+ //$parser =& $this->Application->recallObject('TemplateParser');
+ $name = $this->SelectParam($params, 'name,var,param');
+ $value = $params['value'];
+ return ($this->Application->Parser->GetParam($name) == $value);
+ }
+
+ /*function PHP_Self($params)
+ {
+ return $HTTP_SERVER_VARS['PHP_SELF'];
+ }
+ */
+
+ /**
+ * Returns session variable value by name
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function Recall($params)
+ {
+ $ret = $this->Application->RecallVar( $this->SelectParam($params,'name,var,param') );
+ $ret = ($ret === false && isset($params['no_null'])) ? '' : $ret;
+ if( getArrayValue($params,'special') || getArrayValue($params,'htmlchars')) $ret = htmlspecialchars($ret);
+
+ if ( getArrayValue($params, 'urlencode') ) $ret = urlencode($ret);
+
+ return $ret;
+ }
+
+ // bad style to store something from template to session !!! (by Alex)
+ // Used here only to test how session works, nothing more
+ function Store($params)
+ {
+ //echo"Store $params[name]<br>";
+ $name = $params['name'];
+ $value = $params['value'];
+ $this->Application->StoreVar($name,$value);
+ }
+
+ /**
+ * Sets application variable value(-s)
+ *
+ * @param Array $params
+ * @access public
+ */
+ function Set($params)
+ {
+ foreach ($params as $param => $value) {
+ $this->Application->SetVar($param, $value);
+ }
+ }
+
+ /**
+ * Increment application variable
+ * specified by number specified
+ *
+ * @param Array $params
+ * @access public
+ */
+ function Inc($params)
+ {
+ $this->Application->SetVar($params['param'], $this->Application->GetVar($params['param']) + $params['by']);
+ }
+
+ /**
+ * Retrieves application variable
+ * value by name
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function Get($params)
+ {
+ $ret = $this->Application->GetVar($this->SelectParam($params, 'name,var,param'), '');
+ return getArrayValue($params, 'htmlchars') ? htmlspecialchars($ret) : $ret;
+ }
+
+ /**
+ * Retrieves application constant
+ * value by name
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function GetConst($params)
+ {
+ return defined($this->SelectParam($params, 'name,const')) ? constant($this->SelectParam($params, 'name,const,param')) : '';
+ }
+
+ /**
+ * Retrieves configuration variable value by name
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function GetConfig($params)
+ {
+ $config_name = $this->SelectParam($params, 'name,var');
+ $ret = $this->Application->ConfigValue($config_name);
+ if( getArrayValue($params, 'escape') ) $ret = addslashes($ret);
+ return $ret;
+ }
+
+ function ConfigEquals($params)
+ {
+ $option = $this->SelectParam($params, 'name,option,var');
+ return $this->Application->ConfigValue($option) == getArrayValue($params, 'value');
+ }
+
+ /**
+ * Creates all hidden fields
+ * needed for kernel_form
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function DumpSystemInfo($params)
+ {
+ $actions =& $this->Application->recallObject('kActions');
+ $actions->Set('t', $this->Application->GetVar('t') );
+
+ $params = $actions->GetParams();
+ $o='';
+ foreach ($params AS $name => $val)
+ {
+ $o .= "<input type='hidden' name='$name' id='$name' value='$val'>\n";
+ }
+ return $o;
+ }
+
+ function GetFormHiddens($params)
+ {
+ $sid = $this->Application->GetSID();
+ $t = $this->SelectParam($params, 'template,t');
+ unset($params['template']);
+ $env = $this->Application->BuildEnv($t, $params, 'm', null, false);
+ $o = '';
+ if ( $this->Application->RewriteURLs() )
+ {
+ $session =& $this->Application->recallObject('Session');
+ if ($session->NeedQueryString()) {
+ $o .= "<input type='hidden' name='sid' id='sid' value='$sid'>\n";
+ }
+ }
+ else {
+ $o .= "<input type='hidden' name='env' id='env' value='$env'>\n";
+ }
+ return $o;
+ }
+
+ function Odd_Even($params)
+ {
+ $odd = $params['odd'];
+ $even = $params['even'];
+ if (!isset($params['var'])) {
+ $var = 'odd_even';
+ }
+ else {
+ $var = $params['var'];
+ }
+
+ if ($this->Application->GetVar($var) == 'even') {
+ if (!isset($params['readonly']) || !$params['readonly']) {
+ $this->Application->SetVar($var, 'odd');
+ }
+ return $even;
+ }
+ else {
+ if (!isset($params['readonly']) || !$params['readonly']) {
+ $this->Application->SetVar($var, 'even');
+ }
+ return $odd;
+ }
+ }
+
+ /**
+ * Returns phrase translation by name
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function Phrase($params)
+ {
+ // m:phrase name="phrase_name" default="Tr-alala" updated="2004-01-29 12:49"
+ if (array_key_exists('default', $params)) return $params['default']; //backward compatibility
+ $translation = $this->Application->Phrase($this->SelectParam($params, 'label,name,title'));
+ if (getArrayValue($params, 'escape')) {
+ $translation = htmlspecialchars($translation);
+ $translation = str_replace('\'', '&#39;', $translation);
+ $translation = addslashes($translation);
+ }
+ return $translation;
+ }
+
+ // for tabs
+ function is_active($params)
+ {
+ $test_templ = $this->SelectParam($params, 'templ,template,t');
+ if ( !getArrayValue($params,'allow_empty') )
+ {
+ $if_true=getArrayValue($params,'true') ? $params['true'] : 1;
+ $if_false=getArrayValue($params,'false') ? $params['false'] : 0;
+ }
+ else
+ {
+ $if_true=$params['true'];
+ $if_false=$params['false'];
+ }
+
+ if ( preg_match("/^".str_replace('/', '\/', $test_templ)."/", $this->Application->GetVar('t'))) {
+ return $if_true;
+ }
+ else {
+ return $if_false;
+ }
+ }
+
+ function IsNotActive($params)
+ {
+ return !$this->is_active($params);
+ }
+
+ function IsActive($params)
+ {
+ return $this->is_active($params);
+ }
+
+ function is_t_active($params)
+ {
+ return $this->is_active($params);
+ }
+
+ function CurrentTemplate($params)
+ {
+ return $this->is_active($params);
+ }
+
+ /**
+ * Checks if session variable
+ * specified by name value match
+ * value passed as parameter
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function RecallEquals($params)
+ {
+ $name = $this->SelectParam($params, 'name,var');
+ $value = $params['value'];
+ return ($this->Application->RecallVar($name) == $value);
+ }
+
+ /**
+ * Checks if application variable
+ * specified by name value match
+ * value passed as parameter
+ *
+ * @param Array $params
+ * @return bool
+ * @access public
+ */
+ function GetEquals($params)
+ {
+ $name = $this->SelectParam($params, 'var,name,param');
+ $value = $params['value'];
+ if ($this->Application->GetVar($name) == $value) {
+ return 1;
+ }
+ }
+
+ /**
+ * Includes template
+ * and returns it's
+ * parsed version
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function MyInclude($params)
+ {
+ $BlockParser =& $this->Application->makeClass('TemplateParser');
+// $BlockParser->SetParams($params);
+ $parser =& $this->Application->Parser;
+ $this->Application->Parser =& $BlockParser;
+
+ $t = $this->SelectParam($params, 't,template,block,name');
+ $t = eregi_replace("\.tpl$", '', $t);
+
+ if (!$t) {
+ trigger_error('Template name not specified in <b>&lt;inp2:m_include .../&gt;</b> tag', E_USER_ERROR);
+ }
+
+ $res = $BlockParser->ParseTemplate( $t, 1, $params, isset($params['is_silent']) ? 1 : 0 );
+
+ if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) {
+ if ($block_no_data = getArrayValue($params, 'block_no_data')) {
+ $res = $BlockParser->Parse(
+ $this->Application->TemplatesCache->GetTemplateBody($block_no_data, getArrayValue($params, 'is_silent') ),
+ $t
+ );
+ }
+ else {
+ $res = '';
+ }
+ }
+ $this->Application->Parser =& $parser;
+ $this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
+ return $res;
+ }
+
+ function ModuleInclude($params)
+ {
+ $ret = '';
+ $block_params = array_merge($params, Array('is_silent' => 2)); // don't make fatal errors in case if template is missing
+ $current_template = $this->Application->GetVar('t');
+ $skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
+ foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
+ $module_key = strtolower($module_name);
+
+ if ($module_name == 'In-Portal') {
+ $module_prefix = '';
+ }
+ else {
+ $module_prefix = $this->Application->IsAdmin() ? $module_key.'/' : $module_data['TemplatePath'].'/';
+ }
+
+ $block_params['t'] = $module_prefix.$this->SelectParam($params, $module_key.'_template,'.$module_key.'_t,template,t');
+ if ($block_params['t'] == $current_template || in_array($module_data['Var'], $skip_prefixes)) continue;
+
+ $no_data = $this->SelectParam($params, $module_key.'_block_no_data,block_no_data');
+ if ($no_data) {
+ $block_params['block_no_data'] = $module_prefix.'/'.$no_data;
+ }
+ $ret .= $this->MyInclude($block_params);
+ }
+ return $ret;
+ }
+
+ function ModuleEnabled($params)
+ {
+ return $this->Application->isModuleEnabled( $params['module'] );
+ }
+
+ /*function Kernel_Scripts($params)
+ {
+ return '<script type="text/javascript" src="'.PROTOCOL.SERVER_NAME.BASE_PATH.'/kernel3/js/grid.js"></script>';
+ }*/
+
+
+ /*function GetUserPermission($params)
+ {
+ // echo"GetUserPermission $params[name]";
+ if ($this->Application->RecallVar('user_type') == 1)
+ return 1;
+ else {
+ $perm_name = $params[name];
+ $aPermissions = unserialize($this->Application->RecallVar('user_permissions'));
+ if ($aPermissions)
+ return $aPermissions[$perm_name];
+ }
+ }*/
+
+
+ /**
+ * Set's parser block param value
+ *
+ * @param Array $params
+ * @access public
+ */
+ function AddParam($params)
+ {
+ $parser =& $this->Application->Parser; // recallObject('TemplateParser');
+ foreach ($params as $param => $value) {
+ $this->Application->SetVar($param, $value);
+ $parser->SetParam($param, $value);
+ $parser->AddParam('/\$'.$param.'/', $value);
+ }
+ }
+
+ /*function ParseToVar($params)
+ {
+ $var = $params['var'];
+ $tagdata = $params['tag'];
+ $parser =& $this->Application->Parser; //recallObject('TemplateParser');
+ $res = $this->Application->ProcessTag($tagdata);
+
+ $parser->SetParam($var, $res);
+ $parser->AddParam('/\$'.$var.'/', $res);
+ return '';
+ }*/
+
+ /*function TagNotEmpty($params)
+ {
+ $tagdata = $params['tag'];
+ $res = $this->Application->ProcessTag($tagdata);
+ return $res != '';
+ }*/
+
+ /*function TagEmpty($params)
+ {
+ return !$this->TagNotEmpty($params);
+ }*/
+
+ /**
+ * Parses block and returns result
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function ParseBlock($params)
+ {
+ $parser =& $this->Application->Parser; // recallObject('TemplateParser');
+ return $parser->ParseBlock($params);
+ }
+
+ function RenderElement($params)
+ {
+ return $this->ParseBlock($params);
+ }
+
+ function RenderElements($params)
+ {
+ if (!isset($params['elements']) || !$params['elements']) return;
+ $elements = explode(',',$params['elements']);
+ if (isset($params['skip']) && $params['skip']) {
+ $tmp_skip = explode(',',$params['skip']);
+ foreach ($tmp_skip as $elem) {
+ $skip[] = trim($elem);
+ }
+ }
+ else {
+ $skip = array();
+ }
+ unset($params['elements']);
+ $o = '';
+ foreach ($elements as $an_element)
+ {
+ $cur = trim($an_element);
+ if (in_array($cur,$skip)) continue;
+ $pass_params = $params;
+ $pass_params['name'] = $cur;
+ $o .= $this->ParseBlock($pass_params);
+ }
+ return $o;
+
+ }
+
+ /**
+ * Checks if debug mode is on
+ *
+ * @return bool
+ * @access public
+ */
+ function IsDebugMode()
+ {
+ return $this->Application->isDebugMode();
+ }
+
+ function MassParse($params)
+ {
+ $qty = $params['qty'];
+ $block = $params['block'];
+ $mode = $params['mode'];
+
+ $o = '';
+ if ($mode == 'func') {
+ $func = create_function('$params', '
+ $o = \'<tr>\';
+ $o.= \'<td>a\'.$params[\'param1\'].\'</td>\';
+ $o.= \'<td>a\'.$params[\'param2\'].\'</td>\';
+ $o.= \'<td>a\'.$params[\'param3\'].\'</td>\';
+ $o.= \'<td>a\'.$params[\'param4\'].\'</td>\';
+ $o.= \'</tr>\';
+ return $o;
+ ');
+ for ($i=1; $i<$qty; $i++) {
+ $block_params['param1'] = rand(1, 10000);
+ $block_params['param2'] = rand(1, 10000);
+ $block_params['param3'] = rand(1, 10000);
+ $block_params['param4'] = rand(1, 10000);
+ $o .= $func($block_params);
+ }
+ return $o;
+ }
+
+ $block_params['name'] = $block;
+
+ for ($i=0; $i<$qty; $i++) {
+ $block_params['param1'] = rand(1, 10000);
+ $block_params['param2'] = rand(1, 10000);
+ $block_params['param3'] = rand(1, 10000);
+ $block_params['param4'] = rand(1, 10000);
+ $block_params['passed'] = $params['passed'];
+ $block_params['prefix'] = 'm';
+
+ $o.= $this->Application->ParseBlock($block_params, 1);
+ }
+ return $o;
+ }
+
+ function LoggedIn($params)
+ {
+ return $this->Application->LoggedIn();
+ }
+
+ /**
+ * Allows to check if permission exists directly in template and perform additional actions if required
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function CheckPermission($params)
+ {
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ return $perm_helper->TagPermissionCheck($params, 'm_CheckPermission');
+ }
+
+ /**
+ * Checks if user is logged in and if not redirects it to template passed
+ *
+ * @param Array $params
+ */
+ function RequireLogin($params)
+ {
+ $t = $this->Application->GetVar('t');
+ if ($next_t = getArrayValue($params, 'next_template')) {
+ $t = $next_t;
+ }
+
+ // check by permissions: begin
+ if ((isset($params['perm_event']) && $params['perm_event']) ||
+ (isset($params['perm_prefix']) && $params['perm_prefix']) ||
+ (isset($params['permissions']) && $params['permissions'])) {
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ $perm_status = $perm_helper->TagPermissionCheck($params, 'm_RequireLogin');
+ if (!$perm_status) {
+ list($redirect_template, $redirect_params) = $perm_helper->getPermissionTemplate($params);
+ $this->Application->Redirect($redirect_template, $redirect_params);
+ }
+ else {
+ return ;
+ }
+ }
+ // check by permissions: end
+
+ // check by configuration value: begin
+ $condition = getArrayValue($params, 'condition');
+ if (!$condition) {
+ $condition = true;
+ }
+ else {
+ if (substr($condition, 0, 1) == '!') {
+ $condition = !$this->Application->ConfigValue(substr($condition, 1));
+ }
+ else {
+ $condition = $this->Application->ConfigValue($condition);
+ }
+ }
+ // check by configuration value: end
+
+ // check by belonging to group: begin
+ $group = $this->SelectParam($params, 'group');
+ $group_access = true;
+ if ($group) {
+ $conn =& $this->Application->GetADODBConnection();
+ $group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
+ if ($group_id) {
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ $group_access = in_array($group_id, $groups);
+ }
+ }
+ // check by belonging to group: end
+
+ if ((!$this->Application->LoggedIn() || !$group_access) && $condition) {
+ if ( $this->Application->LoggedIn() && !$group_access) {
+ $this->Application->Redirect( $params['no_group_perm_template'], Array('next_template'=>$t) );
+ }
+
+ $redirect_params = Array('next_template' => $t);
+ $session_expired = $this->Application->GetVar('expired');
+ if ($session_expired) {
+ $redirect_params['expired'] = $session_expired;
+ }
+ $this->Application->Redirect($params['login_template'], $redirect_params);
+ }
+ }
+
+ function IsMember($params)
+ {
+ $group = getArrayValue($params, 'group');
+ $conn =& $this->Application->DB;
+ $group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
+ if ($group_id) {
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ $group_access = in_array($group_id, $groups);
+ }
+ return $group_access;
+ }
+
+ /**
+ * Checks if SSL is on and redirects to SSL URL if needed
+ * If SSL_URL is not defined in config - the tag does not do anything
+ * If for_logged_in_only="1" exits if user is not logged in.
+ * If called without params forces https right away. If called with by_config="1" checks the
+ * Require SSL setting from General Config and if it is ON forces https
+ *
+ * @param unknown_type $params
+ */
+ function CheckSSL($params)
+ {
+ $ssl = $this->Application->ConfigValue('SSL_URL');
+ if (!$ssl) return; //SSL URL is not set - no way to require SSL
+
+ $require = false;
+
+ if (isset($params['mode']) && $params['mode'] == 'required') {
+ $require = true;
+ if (isset($params['for_logged_in_only']) && $params['for_logged_in_only'] && !$this->Application->LoggedIn()) {
+ $require = false;
+ }
+
+ if (isset($params['condition'])) {
+ if (!$this->Application->ConfigValue($params['condition'])) {
+ $require = false;
+ }
+ }
+ }
+
+ $http_query =& $this->Application->recallObject('HTTPQuery');
+ $pass = $http_query->getRedirectParams();
+
+ if ($require) {
+ if (PROTOCOL == 'https://') {
+ $this->Application->SetVar('__KEEP_SSL__', 1);
+ return;
+ }
+ $this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 1)));
+ }
+ else {
+ if (PROTOCOL == 'https://' && $this->Application->ConfigValue('Force_HTTP_When_SSL_Not_Required')) {
+ if ($this->Application->GetVar('__KEEP_SSL__')) return;
+ $pass = array('pass'=>'m', 'm_cat_id'=>0);
+ $this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 0)));
+ }
+ }
+ }
+
+ function ConstOn($params)
+ {
+ $name = $this->SelectParam($params,'name,const');
+ return constOn($name);
+ }
+
+ function SetDefaultCategory($params)
+ {
+ $module_name = $params['module'];
+ $module =& $this->Application->recallObject('mod.'.$module_name);
+ $this->Application->SetVar('m_cat_id', $module->GetDBField('RootCat') );
+ }
+
+ function XMLTemplate($params)
+ {
+ define('DBG_SKIP_REPORTING', 1);
+ $lang =& $this->Application->recallObject('lang.current');
+ header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
+ }
+
+ function RootCategoryName($params)
+ {
+ $root_phrase = $this->Application->ConfigValue('Root_Name');
+ return $this->Application->Phrase($root_phrase);
+ }
+
+ function AttachFile($params)
+ {
+ $email_object =& $this->Application->recallObject('kEmailMessage');
+ $path = FULL_PATH.'/'.$params['path'];
+ if (file_exists($path)) {
+ $email_object->attachFile($path);
+ }
+ }
+}
Property changes on: branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.62
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline