DooPHP IRC channel


IF statement supported in DooView

Announcements of project releases, site news, security advisories, etc.

IF statement supported in DooView

Postby admin » Wed Aug 05, 2009 7:45 pm

DooView now supports if statement. Please check out the source from the latest trunk (revision 14).
If and ElseIF statement supported in DooView .
Functions used in the conditional statement must be registered in template_tags.php or else the malicious function call will be change to: function_deny()

Usage:
Code: Select all
<!-- if {{MyVar}}==888 -->


With function
Code: Select all
<!-- if {{checkVar(MyVar)}} -->


And you can do all the normal things such as:
Code: Select all
<!-- if {{isGender(gender, 'female')}}==true && {{age}}>=14 -->
<!-- if {{isAdmin(user)}}==true && ({{age}}>=14 || {{age}}<54)-->
etc.


Try using a function that is not registered in template_tags, the function will be converted into function_deny and you can handle it in template_tags
Code: Select all
<!-- if unlink('asdasd.txt') -->
<!-- if unlink       (  'asdasd.txt' ) && {{age}}>20-->


In the latest app folder, 'function_deny', 'isset', 'empty' are registered by default since they are used commonly in IF statements

The syntax is
Code: Select all
<!-- if -->
<!-- elseif -->
<!-- else -->
<!-- endif-->


Details at
http://code.google.com/p/doophp/source/detail?r=14

* Slight update in the latest trunk r15
admin
Site Admin
 
Posts: 17
Joined: Thu Jul 16, 2009 10:48 pm

Return to Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron