Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | [CORE][BASE][MODULES] - Major code rewrite to get rid of mid-steps in module loading, improve URL param parsing with a dedicated function, apply changes to our custom modules and set the base skeleton for new module creation. Version update to 0.0.3-alpha. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
7d1a3fe5b03821d8bd5d87c717d4bac7 |
| User & Date: | julcar 2020-09-29 07:47:54.656 |
Context
|
2020-09-29
| ||
| 08:14 | [MODULES] - Fix a bug that did not allowed to save page copies with alike names. check-in: 993dc278c6 user: julcar tags: trunk | |
| 07:47 | [CORE][BASE][MODULES] - Major code rewrite to get rid of mid-steps in module loading, improve URL param parsing with a dedicated function, apply changes to our custom modules and set the base skeleton for new module creation. Version update to 0.0.3-alpha. check-in: 7d1a3fe5b0 user: julcar tags: trunk | |
|
2020-09-26
| ||
| 08:09 | [MODULES] - Fix a little bug in page listing check-in: 7348021f6d user: julcar tags: 0.0.3-alpha, trunk | |
Changes
Changes to core/modules.bas.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - - - - - - - - - - - + - - - - - - - - - - - + - + + - + + + + | #INCLUDE "modules\modules.bi" |
Changes to core/request.bas.
| ︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 | - - - - - - - - - - - - - - - - - - - - - - |
Post = URLDecode(SplitVar(StdinQuery, Arg, CHR(38)))
END FUNCTION
FUNCTION QueryString (Arg AS STRING) AS STRING
QueryString = URLDecode(SplitVar(ENVIRON("QUERY_STRING"), Arg, CHR(38)))
END FUNCTION
|
Changes to core/system.bas.
| ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | + + + + + + + + + + + + + + + + + + + + + + |
KeyParsed = SplitVar (LanguageContent, Key, LINE_ENDING)
IF KeyParsed <> "" THEN
Language = KeyParsed
ELSE
Language = Key
END IF
END FUNCTION
FUNCTION URLParam (Arg AS USHORT) AS STRING
DIM AS USHORT StartPos, NextSlash, Count
DIM AS STRING StrUri, Result
StrUri = ENVIRON("REQUEST_URI")
StartPos = 1
NextSlash = StartPos
Count = 1
DO UNTIL NextSlash = 0
NextSlash = INSTR(StartPos, StrUri, "/")
IF Arg = Count - 1 THEN
Result = MID(StrUri, StartPos, NextSlash - StartPos)
IF INSTR(Result, ".") > 0 THEN
Result = LEFT(Result, INSTR(Result, ".") - 1)
END IF
EXIT DO
END IF
StartPos = NextSlash + 1
Count += 1
LOOP
URLParam = Result
END FUNCTION
FUNCTION CreateURL (Scheme AS STRING) AS STRING
DIM AS STRING ParamValue, Result
DIM AS SHORT Count, StartPos, NextPos
Count = 0
StartPos = 1
NextPos = StartPos
|
| ︙ | |||
58 59 60 61 62 63 64 65 66 67 68 69 70 71 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | + + + + + + + + + + + + + + |
WEND
IF CINT(Settings("site_fancy_url")) THEN
CreateURL = "/" + Result + Settings("site_fancy_url_extension")
ELSE
CreateURL = "?" + Result
END IF
END FUNCTION
FUNCTION GetURLParam (VarName AS STRING = "", ParamIndex AS USHORT = 0) AS STRING
DIM AS STRING Result = ""
IF CINT(Settings("site_fancy_url")) THEN
IF ParamIndex > 0 AND URLParam(ParamIndex) <> "" THEN
Result = URLParam(ParamIndex)
END IF
ELSE
IF QueryString(VarName) <> "" THEN
Result = QueryString(VarName)
END IF
END IF
GetURLParam = Result
END FUNCTION
FUNCTION ServerVars (Key AS STRING) AS STRING
DIM AS STRING SubKey, Value
IF INSTR(Key, "_") > 0 THEN
SubKey = LCASE(MID(Key, 1, INSTR(Key, "_") - 1))
Value = MID(Key, INSTR(Key, "_") + 1, LEN(Key))
ELSE
|
| ︙ |
Changes to iguanacms.bi.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | '################################# Iguana CMS ################################## 'Main include file 'Compile it with FreeBasic => 0.24.0 '############################################################################### #ifdef __FB_WIN32__ CONST AS STRING PATH_DELIMITER = "\" CONST AS STRING LINE_ENDING = CHR(13, 10) #else CONST AS STRING PATH_DELIMITER = "/" CONST AS STRING LINE_ENDING = CHR(10) #endif |
| ︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + + - - | '############################## 'CGI Functions '############################## DECLARE FUNCTION ReadStdin () AS STRING DECLARE FUNCTION Post (Arg AS STRING) AS STRING DECLARE FUNCTION QueryString (Arg AS STRING) AS STRING |
| ︙ | |||
99 100 101 102 103 104 105 | 98 99 100 101 102 103 104 105 106 107 108 109 | + + + + + |
'##############################
'Variables Initialization
'##############################
SettingsContent = ReadFile (DataPath + "settings.txt")
LanguageContent = ReadFile (DataPath + "languages" + PATH_DELIMITER + Settings("site_language") + ".txt")
TplName = Settings("site_template")
HttpHeader = SetContentType("text/html") + CHR(10, 10)
'Windows-only Debug Macro
#macro PrintLog(LogAction)
SHELL("echo " + SystemDate() + "-" + SystemTime() + ":" + LogAction + " >> " + BasePath + "logs\logfile.txt")
#endmacro
|
Changes to index.bas.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + - - - - - - - - - - - - - - + - - - + - - - - - - - - - - - - + + - - - - - - + + - - - - - - - - - - - + + + - - + + + + - - | '################################# Iguana CMS ################################## 'Main application file 'Compile it with FreeBasic => 0.24.0 '############################################################################### |
Changes to modules/admin.bas.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - - - - | 'Admin panel module #INCLUDE "modules.bi" CONST AS STRING ModuleName = "admin" DIM SHARED ModulePath AS STRING ModulePath = "modules" + PATH_DELIMITER + ModuleName + PATH_DELIMITER |
| ︙ | |||
223 224 225 226 227 228 229 | 219 220 221 222 223 224 225 226 227 228 229 | - + + + + |
ELSE
'User is not logged in
Result = "403"
END IF
SiteContent = Result
Result = ""
END SUB
|
Changes to modules/modules.bi.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #INCLUDE "..\iguanacms.bi" #INCLUDE "..\libs\libs.bi" 'Module triggers |
Changes to modules/users.bas.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - - - - | 'Users module file #INCLUDE "modules.bi" CONST AS STRING ModuleName = "users" DIM SHARED ModulePath AS STRING ModulePath = "modules" + PATH_DELIMITER + ModuleName + PATH_DELIMITER |
| ︙ | |||
41 42 43 44 45 46 47 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - - + - - - - + - - | END FUNCTION SUB LoadUsersInterface() DIM AS STRING Action, FileContent, TempContent, SessionFile, Result DIM AS STRING StoredPassword, Salt, NewSalt, UserAlias, UserEmail, UserToken, UserFile DIM AS SHORT SaltLen, TokenLen |
| ︙ | |||
374 375 376 377 378 379 380 | 363 364 365 366 367 368 369 370 371 372 373 374 | + + + + + |
CASE "user"
ReadUserData = SplitVar(UserData, "user_" + Value, LINE_ENDING)
CASE ELSE
ReadUserData = Key
END SELECT
END IF
END FUNCTION
IF ModuleRequest = ModuleName THEN
LoadModule = ProcPtr(LoadUsersInterface)
ModuleVars = ProcPtr(ReadUserData)
END IF
|