Letractively / lightblog

Automatically exported from code.google.com/p/lightblog
Other
0 stars 0 forks source link

Consolidate portions of LightBlog #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now there are some repetitive actions in some files that should be 
addressed.

For example, Sources/ProcessAJAX.php, Sources/ProcessBrowser.php and index.php 
call session_start. This really ought to be done in Core.php.

Another example is that config.php is included before Core.php is included. 
Core.php should automatically include config.php.

There is also the use of $_SESSION['csrf_token'], this value really ought to be 
encapsulated within a function so in case the source of the csrf token (or 
perhaps generation of the token if it, for some reason, is not set) is 
completely transparent to the developer.

Consolidating these things will make LightBlog much easier to manage.

If this sounds like a good idea, I am not sure when you would want this type of 
consolidation to begin.

(when consolidating, it may also be a good idea to prevent any viewing of 
source files directly, by creating a constant INLB [or the like] and then in 
files included they would check for the constant but stop execution if it isn't 
found)

Original issue reported on code.google.com by ian.aldr...@gmail.com on 20 Jun 2012 at 8:27

GoogleCodeExporter commented 9 years ago
$_SESSION['csrf_token'] can be called from userinfo('csrf_token') or 
get_userinfo('csrf_token'), although I've just recently starting doing this.

I agree with the other statements. I think I used to have such a constant; not 
sure what happened to it.

Original comment by soren121@outlook.com on 20 Jun 2012 at 8:29

GoogleCodeExporter commented 9 years ago
Alrighty then. Once you start getting more of the new control panel finished, I 
will start some consolidation. While I am in there, I will replace 
$_SESSION['csrf_token'] with the userinfo alternative.

(and do the INLB thing as well)

Original comment by ian.aldr...@gmail.com on 20 Jun 2012 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by soren121@outlook.com on 22 Jun 2012 at 7:16

GoogleCodeExporter commented 9 years ago

Original comment by ian.aldr...@gmail.com on 13 Aug 2012 at 8:06

GoogleCodeExporter commented 9 years ago
All of those consolidation suggestions have been implemented.

Original comment by soren121@outlook.com on 14 Aug 2012 at 11:41