Appendix G. Upgrade your code to myPHPNuke 1.8.8_8

Table of Contents

Why should I need this appendix?
Security check in your script.
Check visitor type

Why should I need this appendix?

myPHPNuke 1.8.8 is a fine piece of artwork bringing together a lot of features into one complete package and one install. However, this fine piece of software isn't really artwork under the hood. Although is is very stable, the source code is a mess, caused by all the pieces that we glued together. Version 1.8.8_8 doesn't solve all the different code styles but at least strives to give you a better code frame for security and (re-)usage of global information. Besides this, a number of new security features are introduced that might influence your code.

In this appendix, we will list all the special coding issues that you might come across when you are familiar with pre-1.8.8_8 code and security.

Security check in your script.

Security check in every script that you want to use. This is for check against intrusion attempts.

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
			

Check visitor type

You often want to make a difference between anonymous visitors, registered and logged in users and admins. If you use the is_user() function, you get a return value of TRUE when you are dealing with a logged in user. If you use the is_admin() function, you get a return value of TRUE when you are dealing with a logged in admin. When both are false, you are dealing with an anonymous visitor. Remember that an admin can be logged in as admin and still use the portal as anonymous visitor.

User Contributed Notes
upgrade_your_code.php
Add Note Add Note About Notes
There are no user contributed notes for this page.
Last updated: Mon, 28 Apr 2008 - 16:48:02