Revolution Perenti & Skidz Partz – Primitizer

Hello Everyone for the longest time that our Primitizer version 5 was delayed for almost an year.

for an while we been unable to support our current work in secondlife and most of our vendors was removed due to im was not able to be inworld as much as hoped.

for about month now i been rewriting the Primitizer version 5 adding all the features that i was working on before the project had an slight break.

first off we have removed all lsl related hacks as we now have more memory means we can also have less bytes in the scripts themselves.

our particle system is reintroduced but highly improved over version 2 of the Primitizer as the particles are used for effects but also used in combination with our weather system to generate weather like environment inside your Primitizer

we do plan to release the new version 5 in over the next week first of too everyone in the group then we will officially launch version 5.

also we have been working on another secrect project which i will like to release as soon as we are happy with our scripts, which is xstreet like clone

as we have built an cms which is based on phpnuke as is modded for the use of secondlife, for both magicbox, atm code, and withdraw box which is used in world by the site owners so you be able to create your own xstreet like site.

the scripts themselfs with skidz partz as for the cms this will be downloaded from google code

for any feedback or suggestions please contact Revolution Perenti in secondlife or dazzlecms@hotmail.com

Dazzle CMS Registry System Completed

Hello everyone,

Dazzle cms team here and thought i post some updates as were near the completion of our framework stage, alot of major changes are in progress mostly everything we are creating right now is seperate from dazzle cms

but we manage to come up with an registry system not only that php files, json, xml, ini even serialize functions has built in plugin baseed framework

atm we currently working on extending the framework with an ftp based framework, files and folders, chmod, chown using ftp, sftp or ssh2

so what does this all mean, you can store all settings in files, not only keeps less stored in the database but also makes everything perform faster and php will be able to handle more instances per database connection.

from using this framework from editing config files, to json encoding , xml, ini or even re-encode serialization strings. as soon as all our test cases are complete and functions on this next class  we begin implementing this into our Registry system and we will begin the first change over in the cms

try keep an eye on this blog as we update this regularly

Dazzle CMS Updates

As we are near to the completion of our latest change over well lets first explain whats changed some of you may know this and others may not know this that recently we started implementing an file system so what does this mean to you

that means your arrays that you load settings from your json encoded strings, your ini, xml and even php classes can be read in our filesystem

we have completed the filesystem and we are just testing everything is working as we all know things may of worked when we started this framework but could stop working so we are puttign together some test cases but these are not just there for us to be able to test all the features without the cms

but also show you in simple terms how to use our framework when you start developing modules.

we did release 2 betas last year and i was unhappy with some of the system core for many reasons i did have alot of hardcoded functions until i had x feature i was looking for now i have some of the basic features working my main goal is to get everything that really should be in classes as i really dont like cloning the same function over and over or the system looking like phpnuke in its code so we are going to start code cleanup this will not be an long process at all as we will be building about 5 new frameworks over the next 2 weeks which we hope to be completed and we can ship public betas as i will feel after i changed this that nothing big or major going to change in the files or the database.

as this has been an long process to where i have everything now once the new framework is ready our job will be to rewrite all of the admin modules as alot of these were just backported from phpnuke as the system was inspired by phpnuke, i wanted to keep that feel about the system from an admin point of view so each of these modules will be rewritten complely using out classes for example , using our template engine, any design will go though our template engine, to there will be complete control of every aspect of the system.

even we don’t officially have any modules with the cms as soon as we have our few basic modules news, forums, downloads these were developed in the early beta but no longer work with our current beta so we will have to rewrite alot of these to make them work again and we need to implement some of our web2 features from ajax powered forms .

our goal is to have an cms that’s easy to use , thats built apon php5 easy to anyone to create modules and add new features with very little coding

we even do have plans for an module thats creates features for you with no coding just using our form classes position the forms, textareas we do plan to have the cms released and in the final versions by this summer and plan to enter the cms for google summer of code for 2010

we keep you updated on our progress so you can see whats going on at the dazzle cms development keep an eye on our blog as we will try update this more regularly

PHP Input Filter

We just released our version based on http://www.phpclasses.org/browse/package/2189.html

almost an complete rewrite plus more filters for different types of data

here an example of how to use our version

//creates the object

$filter =& input::get_instance();

// some xss string

$description = ‘<A HREF=”http://www.gohttp://www.google.com/ogle.com/”>XSS</A>’;

// strips the tags or converts them to plain text

$description = $filter->clean($description, ’string’);

please note there is no docs for these scripts as they have been designed for dazzle cms but can work in your projects too.

docs will come later when we give our scripts there own home as this is just our development blog.

all we ask is you give us credit and link us too www.dazzlecms.com

Benefits of Running IIS7.5 Over IIS6 Or Apache

IIS7.5 – The latest and greatest from Microsoft.

IIS7.5 is the latest iteration of the Microsoft’s web server. Formerly know as the Internet Information Server, IIS has come to dominate most of the servers belonging to Fortune 100 companies though Apache remains the market leader overall. According to the latest statistics over a third of all sites are backed by IIS.

Benefits of IIS7.5 over IIS6

IIS7.5 is one of the more significant updates to the IIS platform. The biggest change is the modular nature of the engine. This means that one can configure IIS7.5 to support only features that are needed, adding more as and when necessary. In addition to improving it’s flexibility, this leads to a significant leap in security. For example, you can add modules from scripting and even backward compatibility.

Another significant improvement, is the use of an XML based web.config file (just like in .NET applications) to handle the configuration of the entire server configuration. This leads to improvements in portability, fine tuning as well as ease of access compared with the previous hierarchical metabase storage up until IIS6.

There is also good news for VPN users. IIS7.5 has improved it’s remote management capability by providing secure HTTP connections though you have to enable remote management manually. But that can be good as some viewed the earlier setup as more vulnerable.

Though there are many more improvements, let us look at some reasons why you should an IIS7.5 engine over a more traditional server like Apache.

Benefits of IIS7.5 over Apache

For most people the ability to use PHP scripts on IIS used to deter them from using a Windows platform. Even a hosting provider like Godaddy disallows the use of a PHP based application like Wordpress on a Windows server. However, the latest releases of IIS and especially IIS 7.5 give massive performance improvements while running PHP scripts to the extent that PHP is no longer the sole reason not to choose IIS.

Today more and more site owners are turning to Windows to host their PHP based applications, and Wordpress on windows is picking up a huge following.  Thanks to improvements around PHP and IIS through the cooperative efforts of Zend and Microsoft, PHP performance is much more stable, reliable and faster than it was on earlier versions.

Of course, if you plan to make use of the awesome .NET platform, then IIS 7.5 is your only choice. With the latest release of ASP.NET 3.5 and full support for the MVC framework there has never been a more compelling time to develop applications in .NET. In addition, Microsoft’s Web PI  has made it easier than ever to install all .NET related components. IIS 7.5 has also significantly improved it’s usability interface eschewing the full MMC framework it had earlier.

IIS7.5 also features improved diagnostics capability with advanced error tracking that allows you to trace errors based on the conditions you want IIS to look out for. This could be tracking down timed out pages or other errors through it’s “failed request tracing” capability.

Summary

All in all, this is the time to switch over to a Windows platform if you’ve been sitting on the fence till now. The new security features coupled with the flexibility, ease of use and diagnostics have made IIS 7.5 quite an irresistible choice for those looking to host their web applications.

FTP Servers Being Replaced With Online Services

FTP Servers are still the most popular way to store and transfer large files. As browsers get better suited to dealing with file uploads and downloads, new web services are emerging to replace FTP. Online file transfer and sharing services provide an affordable, easy-to-use alternative to traditional FTP servers.

Why should you consider replacing your FTP server?

1. Easy to Use: Online file transfer sites are easier to use than FTP, can be accessed through a web browser, require no additional downloads and can be accessed from anywhere.

2. More Secure: With most web-based transfer services, passwords are always sent over an encrypted connection.

3. Branded Experience: You can customize the look and style of your file transfer service and upload your company logo for a branded experience.

4. Activity Notifications: Receive notifications when users upload or download files, leave comments, or make any changes to files.

5. View Files Online: With file previews, you can view images and common office documents online without the need to download.

6. Search: Quickly find documents by searching through the title and content of Word documents, PowerPoint files, Spreadsheets, PDF documents and more.

7. Integrate with Your Website: Web-based services can be easily linked to from your existing website to provide a seamless experience to your clients and partners.

8. Manage Users: Controlling access to files is simple and does not require calling the IT department any time you need to add users, remove users, or reset your password.

9. Comments: Post comments on files to leave messages and communicate with other members of the Hub.

10. Version Control: Version history lets you view the history of previous versions, compare them to one another and restore an older document.

PHP 5.2.12 Release Announcement

PHP 5.2.12 Release Announcement

The PHP development team would like to announce the immediate availability of PHP 5.2.12. This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, some of which are security related. All users of PHP 5.2 are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.2.12:

  • Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak. (CVE-2009-3557, Rasmus)
  • Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz Stachowiak. (CVE-2009-3558, Rasmus)
  • Added “max_file_uploads” INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion, identified by Bogdan Calin. (CVE-2009-4017, Ilia)
  • Added protection for $_SESSION from interrupt corruption and improved “session.save_path” check, identified by Stefan Esser. (CVE-2009-4143, Stas)
  • Fixed bug #49785 (insufficient input string validation of htmlspecialchars()). (CVE-2009-4142, Moriyoshi, hello at iwamot dot com)

Key enhancements in PHP 5.2.12 include:

  • Fixed unnecessary invocation of setitimer when timeouts have been disabled. (Arvind Srinivasan)
  • Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)
  • Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() when calling using Reflection. (Felipe)
  • Fixed crash when instantiating PDORow and PDOStatement through Reflection. (Felipe)
  • Fixed memory leak in openssl_pkcs12_export_to_file(). (Felipe)
  • Fixed bug #50207 (segmentation fault when concatenating very large strings on 64bit linux). (Ilia)
  • Fixed bug #50162 (Memory leak when fetching timestamp column from Oracle database). (Felipe)
  • Fixed bug #50006 (Segfault caused by uksort()). (Felipe)
  • Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault). (Felipe)
  • Fixed bug #49174 (crash when extending PDOStatement and trying to set queryString property). (Felipe)
  • Fixed bug #49098 (mysqli segfault on error). (Rasmus)
  • Over 50 other bug fixes.

PHP 5.3.1 Released!

The PHP development team is proud to announce the immediate release of PHP 5.3.1. This is a maintenance release in the 5.3 series, which includes a large number of bug fixes.

Security Enhancements and Fixes in PHP 5.3.1:

  • Added “max_file_uploads” INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion.
  • Added missing sanity checks around exif processing.
  • Fixed a safe_mode bypass in tempnam().
  • Fixed a open_basedir bypass in posix_mkfifo().
  • Fixed bug #50063 (safe_mode_include_dir fails).
  • Fixed bug #44683 (popen crashes when an invalid mode is passed).

Key Bug Fixes in PHP 5.3.1 include:

  • Fixed crash in com_print_typeinfo when an invalid typelib is given.
  • Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() when calling using Reflection.
  • Fixed crash when instantiating PDORow and PDOStatement through Reflection.
  • Fixed bug #49910 (no support for ././@LongLink for long filenames in phar tar support).
  • Fixed bug #49908 (throwing exception in __autoload crashes when interface is not defined).
  • Around 100 other bug fixes

smarty 3

Intended Audience

This article is intended for PHP programmers and HTML designers interested in applying a new technique for web development – PHP templating. Advanced knowledge of PHP programming and HTML is assumed.

Smarty3 Overview

The theoretical web development process is that: first the designer makes the interface, and breaks it down into HTML pieces for the programmer then the programmer implements the PHP business logic into the HTML.

That’s fine in theory, but in practice, from my experience, the client frequently comes with more requirements, or maybe more modifications to the design or to the business logic. When this happens , the HTML is modified (or words rebuilt ) programmer changes the code inside HTML.

The problem with this scenario is that the programmer needs to be on stand-by until the designer completes the layout and the HTML files. Another problem is that if there is a major design change then the programmer will change the code to fit in the new page. And that’s why I recommand Smarty. Smarty is a templating engine for PHP.

You can download it from http://www.smarty.net or svn checkout http://smarty-php.googlecode.com/svn/branches/Smarty3Alpha/

The installation process is very simple. Just read the documentation and follow up the instructions.

So what is Smarty ? Smarty is a set of PHP classes that compile the templates into PHP scripts. Smarty is a template engine and a very useful tool for designers and programmers.
Smarty for Designers

Designers work with HTML files. To work with Smarty, you work with template files. These files are are made up of static content but combined with Smarty mark-up tags. All the template files have a .html or .tpl extension. The Smarty template tags are enclosed within { and } delimiters or custom delimiters which can be defined or bypassed in the class.

Let’s consider the basic structure of a web page. There is a header, a middle part, and a footer. A template file that includes the header and the footer looks like this:

{include file=”header.tpl”}
<form name=”form1″>
Label1 <input type=”text” name=”text1″>
<input type=”submit” value=”submit”>
</form>
{include file=”footer.tpl”}

All the templates should reside in a single template directory. After calling a template for the first time, the compiled template will reside in templates_c.

Smarty language is very poweful. All the variables that come from PHP are identified in Smarty with {$Variable_Name} (we precede them with a $ sign). So if we have a variable in PHP that is called $MyName, then to print it in Smarty you have to write something like:

<html>
<body>
Welcome, {$MyName} <br>
</body>
</html>

The power of Smarty lies also in its flexibility. You can insert IFs and LOOPs into the template. The syntax for IF is:

{if <condition> }
html code
{else}
html code
{/if}

Let’s say you have a dynamic menu based on links. Depending on the link you click, you go to a specific page. So you get from PHP a variable $Menu with a integer value, depending on the page you are. The template looks like :

{if ($Menu == 1) }
Option 1
{else}
<a href=”option1.php”>Option 1</a>
{/if}
{if ($Menu == 2)}
Option 2
{else}
<a href=”option2.php”>Option 2</a>
{/if}

For coding a loop let’s suppose you get an array like the following from PHP :

<table>
<tr
{section name=user loop=$userID}
{if $smarty.section.user.iteration is odd}
bgcolor=#efefef
{else}
bgcolor=#ffffff
{/if}
>
<td> ID = {$userID[user]}  </td>
<td> Name = {$name[user]}     </td>
<td> Address = {$address[user]} </td>
</tr>
{sectionelse}
<tr>
<td>
There is no user.
</td>
</tr>
</section>
</table>

Iteration is an internal counter for Smarty. It helps us to know the current iteration of the section. I use this internal variable to make alternate row colors in the table by checking if current iteration value is odd or not.

An alternative for LOOPS is FOREACH which is used to loop over a single associative array.

<foreach from=$users item=current_user>
Name = {$current_user}
<foreachelse}
No user available.
</foreach>

The main difference between SECTION and FOREACH is that for SECTION you can start from a specific value, and can also set a step for the iteration, whereas for FOREACH you have to loop over all values.
Smarty for Programmers

The advantage for programmers is that they write the code in a PHP file without having to mix the instructions with HTML. Furthermore, if the designer changes the layout of a page the programmer doesn’t have to change the code to suit the new layout since the functionalities won’t change. You do your work in your files, assign to the templates all the values needed to print on the site and go out for a beer. You won’t get phone calls asking you to change a bit of code because the designer changed the layout and now a set of internal errors cropped up.

In the PHP file you need to include the Smarty class require ‘Smarty.class.php’. After that you need to instantiate the smarty with $smarty = new Smarty.

To assign a variable to the template you need to $smarty->assign(‘UserName’, ‘John Doe’). After everything is finished you call the method to display the template $smarty->display(‘index.tpl’).

A sample code looks like this (index.php) :

<?php
require ‘Smarty.class.php’;
$smarty = new Smarty;

$smarty->assign(‘Username’, ‘John Doe’);
$smarty->display(‘index.tpl’);
?>

The template (index.tpl) looks like this:

<html>
<body>
Welcome {$Username}
</body>
</html>

You can also create an array in PHP an pass it to the template:

$tmp = array ( ‘UID’=> ‘10′,  &’Name’ => ‘John Doe’, ‘Address’=>’Home address’);
$smarty->assign(‘info’, $tmp);

Sample Script

This script connects to a local database and select all the products from the ‘Products’ table. Then it passes all the values to the template, which prints them on the screen.

INDEX.PHP

<?php
require ‘Smarty.class.php’;
$smarty = new Smarty;

$hostname = “localhost”;
$dbUser = “sqluser”;
$dbPass = “sqlpass”;
$dbName = “sqldb”;
// connect to the database
$conn = mysql_connect($hostname, $dbUser, $dbPass) or die(“Cannot connect to the database”);

mysql_select_db($dbName);

$sql = “SELECT product_id, info FROM products ORDER BY product_id ASC”;
// get all the products from the table
$res = mysql_query($sql);
$results = array();
$i=0;
while ($row=mysql_fetch_array($res)) {
$tmp = array(
‘product_id’ => $r['product_id'],
‘info’=> $r['info']
);
$results[$i++] = $tmp;
}
// pass the results to the template
$smarty->assign(‘results’, $results);
// load the template
$smarty->display(‘index.tpl’);
?>

INDEX.TPL

<html>
<body>
Here’s a table with the results: <br>
<table cellpadding=1 cellspacing=0 border=0 width=100%>
{section name=nr loop=$results}
<tr {if $smarty.section.nr.iteration is odd} bgcolor=”#efefef”{/if}>
<td width=15%>
<nobr><a href=&#8221;show-product.php?id={$results[nr].product_id}”>Press here</a>

<td width=29%><a href=”show.php?id={$results[nr].prodID}”
{popup inarray=$smarty.section.nr.iteration}
>{$results[nr].info}</a></td>
</tr>

{sectionelse}
<tr><td align=”center”><br><b>no product </b> <br> </td></tr>
{/section}

</table>

<br>

Here’s a select with the results: <br>
<select name=”mys”>
{section name=nr loop=$results}
<option value=”{$results[nr].product_id}”>{$results[nr].info}</option>
{/section}
</select>

</body>
</html>
Summary

Smarty is a great tool for both designers and developers. By using Smarty you can reduce the site development and maintenance times. If you are a developer you no longer need to mix PHP code with HTML code. Just take care of business logic and leave the HTML to the designer.

svn + apache2

Many of my developers work from windows including myself. Creating secure access over ssh and svn (svn+ssh://)
using Zend studio and svn (subversion plugin for zend) was the initial idea, from a quick pass over subversion, but once svnserver was up and running and I tried it, this wasn’t as simple. There are several articles on integrating subversion, ssh and windows. None of the solutions looked simple or elegant. And wide open unsecured traffic was not acceptable.

I determined best practice pointed us to subversion access through web_dav_svn -> web_dav -> apache2 (https://). This brought authentication away from centralized auth and allowed fine grained control over the access granted via htpasswd and .htaccess files. It allowed us to restrict unsecured access and redirect http to https, and encrypt using SSL. It kept us from having to work ssh onto windows for each developer, instead we could have a simple eclipse/subclipse plugin access demonstrated and from that point they were able to customize on their own.

What I wanted was:

* untar subversion-1.6.6 and subversion-deps-1.6.6 in /apps/src (they layer over each other)
* first build and install the -deps apr and apr-util into /apps/local
* then build apache2 against /usr/local/apr and /usr/local/apr-util
* install apache2
* build and install serf
* remove serf, apr, and apr-util subdirectories and source code from within subversion-1.6.6
* build 1.6.6 against apxs in apache, without Berkeley DB, without neon, and specifying /usr/local/apr, /usr/local/apr-util, and /usr/local/serf
* install and test

process

* create subdirectory /apps/src, place all tarballs in this directory
* untar subversion & subversion-deps version 1.6.6 (these tar onto each other)
* cd subversion-1.6.6/apr
* ./configure –prefix=/usr/local/subversion/apr
* make && make install
* cd ../apr-util
* ./configure –prefix=/usr/local/subversion/apr-util –with-apr=/usr/local/subversion/apr
* make && make install
* cd ../neon
* ./configure –prefix=/usr/local/subversion/neon
*
* apache2: untar httpd-2.2.14
* ./configure –prefix=/usr/local/subversion/apache –enable-dav –enable-dav-fs –enable-dav-lock –enable-expires –enable-headers –enable-info –enable-logio –enable-proxy –enable-rewrite –enable-unique-id –with-apr=/usr/local/subversion/apr –with-apr-util=/usr/local/subversion/apr-util –enable-so –enable-mods-shared=all
* make && make install

This way apache2 builds against apr and apr-util compatible with subversion 1.6.6
and then build subversion against it as well..
* ln -s /apps/apache2_2.2.14 /apps/apache2
* compile and install serf
* ./configure –-prefix=/usr/local/subversion/serf –with-apr=/usr/local/subversion/apr –with-apr-util=/usr/local/subversion/apr-util
* make && make install
* remove serf, pr and apr-util from subversion

compile subversion

./configure –prefix=/apps/svn –with-ssl –with-libs=/usr/local/ssl –without-berkeley-db –with-apxs=/apps/apache2/bin/apxs –with-openssl=/usr/local/ssl –without-neon –with-serf=/usr/local/serf –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util

make && make install

test:

/usr/local/subversion/svn/bin/svnadmin create /usr/local/subversion/repository

chown subversion:subversion /usr/local/subversion

chown -Rv subversion.subversion /usr/local/subversion

root@dedicated[/bin] $

no core dump…

ONWARD to configure and test apache2 and subversion…
httpd.conf:

* change all references to apache2_2.2.14 to apache2 (makes the httpd.conf generic rather than subject to needing a migration after a point release upgrade…)
* change port 80 to a non-priveliged port (8080)
* check for
o LoadModule dav_module modules/mod_dav.so
o LoadModule dav_module modules/mod_dav.so
o LoadModule ssl_module modules/mod_ssl.so
* add in ServerName hostname.domain.com:8443 Some of the apache level sanity validation requires a statement of the local host.
* add in SSL stuff (this IS httpd from source – the default httpd.conf had the ssl-module load statement, but no explicit SSL configuration

#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

# =================================================
# SSL/TLS settings
# =================================================

Listen 0.0.0.0:8080
Listen 0.0.0.0:8443

SSLEngine on
#SSLOptions +StrictRequire

#<Directory />
# SSLRequireSSL
#</Directory>

SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM

SSLMutex file:/apps/apache2/logs/ssl_mutex

SSLRandomSeed startup file:/dev/urandom 1024
SSLRandomSeed connect file:/dev/urandom 1024

SSLSessionCache shm:/apps/apache2/logs/ssl_cache_shm
SSLSessionCacheTimeout 600

SSLPassPhraseDialog builtin
SSLCertificateFile /apps/apache2/conf/ssl.crt/server.crt
SSLCertificateKeyFile /apps/apache2/conf/ssl.key/server.key

SSLVerifyClient none
SSLProxyEngine off

<IfModule mime.c>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
</IfModule>

* create ssl certificate (self-signed). I installed in /apps/apache2/conf/ssl.crt and ssl.key, naming the .crt and ,key files for the server hostname and then symbolically linking them to the generic “server.crt” and “server.key”.
* restart apache2 and test https://host:8443/ – you should get the “It works!” apache test page, thus validating the SSL certificate and setup from a browser level
*
* parent directory for svn

<Location /svn>
DAV svn
SVNParentPath /apps/repos
</Location>