FlashNuke Doc v070724
FlashNuke Doc v070724
Project Documentation
Questa opera è stata rilasciata sotto la licenza Creative Commons Attribuzione-Condividi allo stesso modo 2.5
Italia. Per leggere una copia della licenza visita il sito web http://creativecommons.org/licenses/publicdomain/ o
spedisci una lettera a Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
FlashNuke: The Flash CMS
Index
INDEX ......................................................................................................................................................................................... 2
Release Notes
None, yet
Always more webmasters are not satisfied by their HTML sites. The most important problems they complain about
are transfer load, user-friendship and graphical appeal. When a user1 navigates a standard HTML site, every action
consists in loading a new page from the server. In most cases, the server is overloaded by processing thousands of
lines of code that do not significantly change the page appearance. For example, an RSS reader embedded in the
page will, at every click, load the external RSS feed and parse it using XML. Some advanced scripts cache the RSS files
into the database, but when the feed is not often updated this still causes a overhead to the database. The server
has to transfer all the HTML code (we suppose images and CSS style sheets to be cached) of the page even to just
display a single short error message to the user.
On 2003, a guy nicknamed Raulken was chatting with Antonio Anzivino, and they talked about the possibility to
move his web portal from HTML to Flash to increase the graphical appeal and the performance of the whole website.
The project did actually start in early 2004, but was stopped because of various reasons, including the one that the
program Macromedia Flash MX was not suitable to develop RIAs easily. Now that Adobe acquired Macromedia (4)
and developed a platform to build RIAs using Flash, the scenario changed and, as we will see in the requirements
analysis, the development cost of this program will be heavily reduced.
As for the first draft, we have opted in for Open Source distribution and releasing under the GNU GPL 2.0 license.
Due to the differences between standard software development models and Open Source software development
model, we are not planning to examine costs and resources for development. Open Source software usually follows
the release early, release often philosophy, meaning that during the development phase many alpha or beta version
will be released at developers discretion. Also, when the development team is not large and the project is not yet
popular, no roadmap is decided. Everyone can discuss the project documentation and participate to the develop-
ment phase.
1
With the word user we mean the person that, using a web browser on a device connected to the Internet (a desktop PC, a lap-
top, etc), has access to the website and is able to browse it
Distributed under Creative Commons 2.5 BY-SA IT Page 10
FlashNuke: The Flash CMS
1.2. References
1. Wikipedia, the free encyclopedia. Content Management System. Wikipedia. [Online] [Cited: 14 April 2007.]
http://en.wikipedia.org/wiki/Content_management_system.
3. Wikipedia, the free encyclopedia. Rich Internet Application. Wikipedia. [Online] [Cited: 14 April 2007.]
http://en.wikipedia.org/wiki/Rich_Internet_application.
4. Adobe Corporation. Adobe Acquired Macromedia. Adobe Corporation Website. [Online] 5 December 2005.
http://www.adobe.com/aboutadobe/pressroom/pressreleases/200512/120505AdobeAcquiresMacromedia.html.
6. Wikipedia, the free encyclopedia. Skin. Wikipedia. [Online] [Cited: 14 April 2007.]
http://en.wikipedia.org/wiki/Skin_%28computing%29.
7. W3C: World Wide Web Consortium. Resource Description Framework. World Wide Web Consortium. [Online]
http://www.w3.org/RDF/.
8. —. W3C Semantic Web Activity. World Wide Web Consortium. [Online] 2001. http://www.w3.org/2001/sw/.
9. Wikipedia, the free encyclopedia. Plugin. Wikipedia. [Online] [Cited: 15 April 2007.]
http://en.wikipedia.org/wiki/Plugin.
10. W3C: World Wide Web Consortium. Web Accessibility Initiative. World Wide Web Consortium. [Online]
http://www.w3.org/WAI/.
11. Wikipedia, the free encyclopedia. Brute force attack. Wikipedia. [Online]
http://en.wikipedia.org/wiki/Brute_force_attack.
13. Internet Engineering Task Force. RFC 2822 Internet Message Format. IETF. [Online]
http://tools.ietf.org/html/rfc2822.
14. Wikipedia, the free encyclopedia. Stylesheet. Wikipedia. [Online] [Cited: 8 May 2007.]
http://en.wikipedia.org/wiki/Stylesheet.
19. W3C: World Wide Web Consortium. Web Services. [Online] 2002. http://www.w3.org/2002/ws/.
20. Widenius, Michael "Monty" and Axmark, David. MySQL Reference Manual: Documentation from the Source.
s.l. : O'Reilly, 2002. ISBN 0596002653.
23. Wikipedia, the free encyclopedia. Globally Unique Identifier. Wikipedia. [Online]
http://en.wikipedia.org/wiki/Globally_Unique_Identifier.
24. W3C: World Wide Web Consortium. W3C XHTML2 Working Group Home Page. World Wide Web Consortium.
[Online] http://www.w3.org/MarkUp/.
25. Wikipedia, the free encyclopiedia. Advanced Javascript And XML. Wikipedia. [Online]
http://en.wikipedia.org/wiki/Ajax_%28programming%29.
26. W3C: World Wide Web Consortium. P3P: The Platform for Privacy Preferences. World Wide Web Consortium.
[Online] http://www.w3.org/P3P/.
32. Wikipedia, the free encyclopedia. Digital signature. Wikipedia. [Online] [Cited: 25 April 2007.]
http://en.wikipedia.org/wiki/Digital_signature.
After listing the requirements, the main problem will be decomposed in sub-problems, the technical feasibility will
be evaluated by code-prototyping some features, and a development plan for all the subprojects will be done
The program is a Content Management System based on Adobe Flash platform, used for building web portals of
any size. We define a web site as a portal when it offers different services within the same interface. The reference
model is the Open Source PHP-based CMS PHP-Nuke (5) by Francisco Burzi.
The interface, like PHP-Nuke’s, is built-up by blocks and modules. A block is a small component displayed on the side
of the interface, that provides useless information or access to site services to the user. Some examples of common
blocks: last topics on Forums, login, summary of private messages, etc. A module is an application component that is
displayed in the middle of the interface, taking as most space as possible on the screen. An example module is a Fo-
rum, where the user can browse topics written by other people, reply to them or open a new topic.
The CMS must support multiple languages. A default language can be set, and the recommended language to dis-
play may be detected analyzing the client.
For every action that involves a navigation action (such as browsing images), if it has a sense, a direct link must be
generated in order to bookmark the page or provide direct access to the specific func-
tion/document/message/image/whatever to other users. An example of direct link could be
http://tempurl.org/news?id=254102. Such a link can automatically display a news article on the user interface.
Users may register to the website or browse anonymously. Each registered user is identified by a unique user name,
and can authenticate himself using an alphanumerical password or a digital signature. He must provide a valid email
address to the system, but it’s a choice of the Administrator4 to require the confirmation of the email address. Each
user has a profile that stores some basic information, like displayed name, avatar, biography, date of birth, etc. The
user must have the ability to delete his profile and all information related to him (except logs) from the website data
base, in order to fit the requirements of most strict privacy laws, like Italian law 196/2003 that explicitly requires this
feature.
Users may choose to let the system back their session state up. This means that, when the user closes the browser
windows and enters the site again, after login he may be offered to restore the status of the website as it was left
the first time.
The website Administrator may nominate other Administrators among the registered users, and may decide access
policies for the site, including:
Which modules can be accessed (and which block can be viewed) by anonymous users
Which modules can be accessed (and which block can be viewed) by registered users
Which components may be administered by a specific Administrator
If the whole website may be administered by a specific Administrator
Each module has to be able to provide Administrators a specific Control Panel that can be accessed by the website
main Administration Panel. Each control panel has responsibility over its component’s features and configuration.
The following is the installation procedure for new components. It has been designed to be the most simple:
2
With the word webmaster, we mean the person or the organization that owns the website and is able to create, edit and de-
lete files on the server that hosts the website itself
3
We will assume that the words skin and theme are synonyms
4
With the word administrator, we mean the user that is authorized to make changes to the website. Often the webmaster is an
administrator too, but he may elect other administrator without electing them webmasters
Distributed under Creative Commons 2.5 BY-SA IT Page 13
FlashNuke: The Flash CMS
1. The Administrator uploads onto the server, using FTP or a similar protocol, all the files belonging to the com-
ponent into an appropriate directory for the component
2. The Administrator, with his own credentials, enters the Control Panel and selects the new component to in-
stall
3. The system checks the digital signature of the component, and, if the user confirms, execute a specific in-
stallation script included in the component that configures it for first execution
It is a security requirement that the access to the data source is differentiated according to the privileges of the user
who is logged in. If he is not an Administrator, the data source must be accessed only using default stored proce-
dures. Else it can be accessed directly with its standard interface. This prevents some common attacks based on
sending bad input data that sometimes allow the cracker to get Admin privileges over the site.
When a user interacts with the portal (i.e. clicks on a command button), the request may be processed real-time
(synchronous request) or delayed (asynchronous request). The difference is that the asynchronous request is proc-
essed, together with other pending asynchronous requests, after 10 seconds (or a different interval configured by
the Administrator) by the first request or when a synchronous request is made. Here is an example: at a certain time
the user is writing a message for the Forums, and a block showing last Forum topics is displayed on the side. The
block just repeatedly requests for the last 10 topics posted, and it will reasonably use the asynchronous request
method. If it takes more than 10 seconds to the user to write a message and press the Submit button, a number of
updates will be done. When he finally posts the message, both the update request and the message posting request
(which is reasonably synchronous) are processed.
Another requirement is that multiple component requests can be processed in parallel for better performance.
When a component (or the core program) is unable to handle an error condition, that error has to be logged on the
server. Administrators can view the error log with full details on the error, and, up to their choice, report the error to
the development team through Internet, so they can examine the data and try to fix bugs.
Downloading a file from the server must be done only using a specific server-side script that fetches the file from a
read-protected directory, without allowing direct linking to the protected element. An option has to allow the Ad-
ministrator to prohibit direct linking to the download script from external sites.
It must also have a generator of RSS/RDF (7) feeds according to Semantic Web (8) specifications. Components must
use the main feed engine to provide specific feeds for their features (i.e. pictures in the gallery).
The final release of the application, however, should provide as many features as possible to allow the webmaster to
run a complete portal without having to develop the components himself. These are at complete discretion of the
developers and the analysts. Everyone in the community may recommend us new features and components to in-
clude in the official release.
Also, Rich Internet Applications based on Adobe Flash technology require a separate development for the client and
the server side, unlike classic scripting languages such PHP or ASP.NET that generate client code dynamically. The
Adobe Flex framework provides a development model that suits the needs of Rich Internet Applications, which inter-
faces remind the one of operating systems’ Graphical User Interface (GUI). The server side of the program can be
developed using any scripting language that runs over HTTP or even, thanks to Flex capabilities, with a dedicated
TCP/IP application. Whatever the choice is, a common protocol must be defined before implementing the client and
the server side.
The data source can be built up with various techniques: dedicated data files on server, XML repository and SQL da-
tabase are the most common. The SQL database is the easiest way to store data without wasting time projecting a
brand new program for storing data. More, PL/SQL stored procedures fit the requirement that if the user has no
admin privileges, the component cannot access the database directly running arbitrary SQL queries.
The error reporting feature requires the development team to build, and not necessarily distribute, a software sys-
tem that receives and stores all error reports that can be used by developers for debugging purposes. This system
must be developed as a separate project, independently from FlashNuke but using a common protocol.
We will define that protocol when implementing the client side. Design and development of the error reporting sys-
tem will be done separately during FlashNuke main components’ development.
2.3.1.Normal Requirements
The following requirements have been explicitly requested among the user requirements.
A default module, chosen by the Administrators, is loaded when the user enters the website.
Skins have to be installed in a dedicated directory. The server scans for themes and produces the user a list. How-
ever, a default skin is displayed when the site is loaded.
5
Core: the part of the application that only provides support to the features of FlashNuke, but no specific feature. Exactly like
the kernel in an operating system. Both client and server have a core.
Distributed under Creative Commons 2.5 BY-SA IT Page 16
FlashNuke: The Flash CMS
2.3.1.4. RN004: Multilanguage interface
The interface must support multiple languages. Simply all the text must change according to selected language. A de-
fault language can be selected by Administrators. However, they can enable the user to change the language manu-
ally or allow FlashNuke to automatically detect users’ favourite language. Components must be translatable.
Anonymous user: a user that entered the site and has not logged in (yet)
Registered user: a user that has authenticated
Partial Administrator: a registered user that has Administrator privileges only on some components
Supreme Administrator: a registered user that has Administrator privileges over all components and Flash-
Nuke main settings. We will generally call Administrators both partial and supreme ones. Specific differences
will be mentioned when needed
In order to change a user’s access level (electing or revoking an Administrator), a user must have Supreme Adminis-
trator or Partial Administrator over Users privileges.
Supreme Administrators can decide which access level is required to access a component.
Site configuration: general parameters of the website, like site name, administrator email, default language,
default theme, enable or disable email verification
User management: list of registered users, profile editing, privileges management
Blocks management: disposition of blocks, access level
Modules management: default module setting, access level
Components management: installation and removal of components
6
Sometimes we will refer to is as Control Panel
Distributed under Creative Commons 2.5 BY-SA IT Page 17
FlashNuke: The Flash CMS
The user navigates the website and finds an interesting topic on the Forums about a problem a friend of him had.
With HTML websites, the user just copies the URL address in his browser’s address bar to paste it into a chat window
or email client. Or he can just bookmark it using web browser’s Favourites feature for personal reference. With
Flash-based websites, the URL never changes since a single SWF file (inside an HTML container) is loaded and the
browser is never affected by actions done by the user on the Flash movie.
FlashNuke must provide the possibility to translate a URL address into a state of the SWF movie considered as a fea-
ture. As for the example provided in the user requirements specifications, a URL like
http://tempurl.org/news?id=254102 must load the News module and display the article ID 254102. No specific tem-
plate has been defined yet.
We define Synchronous Request a server request, that usually returns information to the interface, that is done
when it is generated.
We define, instead, Asynchronous Request a server request that is postponed to be processed after a maximum de-
lay of 10 seconds (the Administrator may change the maximum delay) or when a Synchronous Request is generated.
Direct linking is a problem for many webmasters, because people use to provide others (for example on their blogs)
the direct link to a file, consuming server’s bandwidth and often causing economic damage. Webmasters, even if dis-
tributing their files publicly, prefer that the user first displays a page containing the effective download link and
maybe some advertising. Other times, files must be kept private, away from unwanted visitors: often the user is re-
quired to register first, before downloading!
7
A direct link is a hotlink that points directly to the file where it’s stored on the server. It causes immediate download of the file
8
They can be the attachments of a forum topic, or pictures in a gallery
Distributed under Creative Commons 2.5 BY-SA IT Page 18
FlashNuke: The Flash CMS
FlashNuke download manager must be configurable to optionally check that the user is not coming from an external
website.
In order to allow other developers to code for the FlashNuke platform, a comprehensive documentation on how to
create new components that will run within a FlashNuke-based portal and interact with other components installed.
Such documentation must be published in the form of a Software Development Kit (SDK), including all source files
needed to compile new components.
In this case, an alternate version of the website must be provided. This Accessible version must show the same con-
tent as the Flash version, but with no Javascript support, no Flash and simple graphics to enhance readability (10).
The website must require a minimum set of personal data in order to work properly. Other information must
be optional
The user must be informed a priori10 about what data is collected by the system and how it’s used. Examples
include system logs, newsletters and showing everyone on the home page that the user is connected
The user must opt-in. Nothing can be done with personal data without prior user explicit consent. For exam-
ple, the user’s email address may not be shared with marketing partners unless he gave explicit consent to
receive newsletters
After opting-in, the user must be able to opt-out. He must be able to refuse any more treatment of his per-
sonal data and delete them (including his whole account) from the system
The software must protect personal data against theft
The webmaster should always act as he’s directly responsible, as a custodian, of users’ personal data
9
This expression is often used in medical environment. However, it has a similar meaning in market and legal environments.
Here it simply means that the user who’s being provided a service is informed about what’s being done with his personal data
and the traces left by himself before accepting the service provision
10
Before the data is collected
Distributed under Creative Commons 2.5 BY-SA IT Page 19
FlashNuke: The Flash CMS
must guide the webmaster step-by-step and configure FlashNuke for the first usage, including the setting of the Ad-
ministrator account that will be used to configure the website.
This script should use a web interface, because it’s not often possible (particularly under Windows) to directly access
the server’s command shell
The Error Log, instead, is used to track error conditions that prevent regular usage of the website in order to find out
the cause of the error (often a bug in the system).
The need of this feature has been suggested by the experience of a webmaster that, using Mambo CMS, is never
able to check and restore connectivity to his SQL DBMS when it goes offline, because Mambo displays a generic error
message. He needs to contact technical support or use SSH to fix the problem (sometimes due to table corruption).
At a System Domain Model abstraction level, we have found that the only actor in the FlashNuke environment is the
user as we have defined it previously. The user, however, may obtain a specific role according to his access level.
Roles are hereditary, as shown in the diagram.
It must be noticed that the use cases that we’re describing here are general use cases made with the interaction of
the user with the basic system.
Each new component will add new use cases to each role a user can have.
Log In
Download a file
«extends»«extends»
«extends»
Digital Signature
Password login
login
Restore session
state
Change Password
«uses»
Registered User
«uses»
«extends» «extends»
Change Signature Revoke Signature
Edit own profile
and preferences
«extends»
Log Out
Edit another
«uses» user's profile
Save session state
File Administrator User Administrator «extends»
«extends»
Ban user
Change
configuration
«extends»
Manage components
Administrator Install component
«extends»
Uninstall component
Before being able to login, a user (who is still not identified) has to register to the website, choosing a unique user-
name and providing at least his email address.
In order to be an Administrator, a registered user must be explicitly nominated Administrator by a Supreme Adminis-
trator, with the only exception of the user that installs FlashNuke, who is automatically nominated Administrator.
The Administrator role may be revoked at any time by other Supreme Administrators.
Name:
Actors:
Brief Description:
Pre-conditions:
Event flow:
o
Post-conditions:
Related use cases:
11
We described the URL Rewriting in RN007
12
The module initialization phase will be analyzed when examining the client design and the communication system. For now,
we won’t care about it
13
We will refer to component loading as just downloading the required files from the server, without displaying the component,
which is in an non-initialized state
14
After a component is initialized with appropriate data, it can be effectively displayed. The user notices the component has
been loaded only when it’s displayed.
Distributed under Creative Commons 2.5 BY-SA IT Page 25
FlashNuke: The Flash CMS
o The browser is redirected to the Flash GUI using a special URL to restore the system state
o The Flash GUI is initialized (UC001 executed) and the previous software state is restored with the
same exact content of the Accessible version
Post-conditions (#2): the Flash GUI is loaded
Related use cases: UC001
15
The accessible version must not support themes.
Distributed under Creative Commons 2.5 BY-SA IT Page 26
FlashNuke: The Flash CMS
The module is initialized to its initial state with the data obtained from the server
The module is displayed
o Alternate (module initialized to a specific state)
The user activates a use case (in another component) that requires loading the module
The module previously displayed is unloaded
The new module is loaded
FlashNuke processes (server-side) the specific request and obtains data to use for module
initialization
The module is initialized to a specific state according to the data
The module is displayed
Post-conditions: the new module is ready for use
Related use cases: none
16
To understand what this means, imagine loading the list of articles in a News module, or the list of Forums in a Forum module
17
In this case, we mean an instance of the User class, as we will define later. We apologize for the ambiguity
Distributed under Creative Commons 2.5 BY-SA IT Page 27
FlashNuke: The Flash CMS
o UC006 proceeds
Post-conditions: the event flow of UC006 is affected
Related use cases: UC006
18
We may use the synonym sign up instead of registration
19
Even if the physical person acting as the user is a Registered User because he owns an account, the system doesn’t know his
identity yet and treats him as an anonymous user
20
In order to avoid complicating the specifications, we force a user to change his login method to a new password. A new digital
signature can be chosen later
Distributed under Creative Commons 2.5 BY-SA IT Page 28
FlashNuke: The Flash CMS
Post-conditions: the password for that user is changed
Related use cases: UC006
21
The exact set of displayed components, each one in a specific state. For example, if the user was displaying Forum topic #XXX
before leaving the website, FlashNuke will display that topic again
Distributed under Creative Commons 2.5 BY-SA IT Page 30
FlashNuke: The Flash CMS
o IF verification fails, the use case terminates in error and an error message is displayed
o ELSE the system changes user digital signature
Post-conditions: the user will have to use the new digital signature to login
Related use cases: UC014, UC016
It is important to notice now that in this Class Diagram we have two classes that implement an interface without
having different sets of methods: in UML, this is usually wrong, but we did it for a conceptual reason. Blocks and
Modules are different entities: even if we found that they can be said to be generically Components, Modules are in-
terface elements thought to provide real interaction and concrete services to the user, and Blocks are physically
smaller than modules because they just provide information and assistance to the user.
More, the Microsoft Visio 2007 we used to build the Class Diagram forced us to include some data types in the dia-
gram even for conventional reasons, like the Image class. We won’t care of the implementation now, but we in-
cluded it in order to associate those data types to class properties and methods
We will list each class and then analyze all of its properties, methods, associations and responsibilities. For some
classes, we will produce a State Diagram for better understanding the class behaviour.
User
* Theme
+Username : String
+Name : String
#Password : String
-Header
#Signature : DigitalSignature
-Footer
#Email : String
-Stylesheet
+Avatar : Image 0..1
+LastLogin : Timestamp +Load()
#LastHost : Host * +Change(in NewTheme : Theme)
#LastIP +SetDefault()
+About : String
+Biography : String
+Member +DateOfBirth : Date Language 1..*
+Authenticate(in username : String, in password : String) +Name
+Authenticate(in username : String, in SignedCode : String) +Code
* +LogOut() * 0..1
#UpdateProfile()
+ViewProfile()
#ConfirmEmail()
Session
#ChangeEmailAddress(in newMail : String)
#ChangePassword(in newPassword : String) +Started : Timestamp
#ChangeSignature(in newSignature : DigitalSignature) +InactivityTime : Integer
1 *
-RevokeKey() +ViewState
+AddToGroup(in group : UserGroup) * +Save()
+RemoveFromGroup(in group : UserGroup) +Load()
1
+EditAvatar(in NewImage : Image) +Login()
1..* +RecoverLostPassword(in username : String) +Logout()
«struct»Host
* +Hostname 1
+IPAddress
PartialAdministrator *
*
#AdministerComponent(in Component : Component) 1
0..1
SystemLog SystemEvent
BannedUserList Singleton -Time : Timestamp
+ViewLog() 1 *
+Ban(in User : User, in LastHostToo : Boolean)
SupremeAdministrator +Ban(in Host : Host)
+Unban(in User : User, in BannedHostToo : Boolean)
+Unban(in Host : Host)
#ChangeConfiguration()
#ViewLog() : SystemLog Singleton
#ManageComponents()
ErrorLog SystemError
-Component : Component
+ReportAllErrors() -TechnicalInfo
+Report()
1
*
2.5.1.1. Properties
2.5.1.1.1. Name: String <PK>
The name of the component. Works as unique identifier for each component category.
It is important to understand that a specific component may include features that, for technical reasons, require reg-
istration.
2.5.1.2. Methods
2.5.1.2.1. Constructor
The constructor for this class is an unusual kind of constructor. We are working at a System Domain Model level, so
no execution of code is expected. So we define the constructor for a component its physical upload into the compo-
nents’ directory.
Only the webmaster can run the constructor (since having access to server’s file system)
2.5.1.2.2. Load()
This method is used to load a component onto the Graphical User Interface (GUI). This method initializes the com-
ponent and displays it to the user. The user will then be able to use the component the way it’s designed to. This is
similar to a constructor, but as we will see in detail, the Component constructor is the physical upload of the files.
Every user with appropriate privileges can run this method after the module is installed.
2.5.1.2.3. Unload()
This method is called when the component is to be hidden from displaying, for example when changing the set of
displayed blocks or when changing the displayed module. Substantially, it works like a destructor method because an
unloading component must destroy all temporary data instantiated and free memory, but the real component de-
structor is its physical deletion from the server.
2.5.1.2.4. Install()
This method is used to install the component. Installing a component means doing the necessary actions to get it
ready for first execution. In many software systems, the installation of a component may require the unpacking of
the installation package, the copying of files to appropriate directories, and the registration of the component into
the system so other components can notice its presence.
The installation process requires the checking of the digital signature with the CheckDigitalSignature() method. The
Administrator is required to confirm the installation after viewing signature details.
2.5.1.2.5. Uninstall()
This method is used to uninstall a component. Uninstalling a component means removing it and every element cre-
ated by it from the system. The system itself is then put into a state like the component was never installed. It gen-
erally requires the cancelling of the system registration process that the installation did, and the deletion of the files
that were created during the installation and/or the execution of the component.
Only the Supreme Administrator can run this method on installed components.
2.5.1.2.7. Administer()
This method is the main Administration method for the component. It allows an Administrator to control the behav-
iour of the module, or to perform operations that require high privileges. Each component must override this
method to provide real administration functions, such as topic lock on Forums, or picture deletion on Picture Galler-
ies.
Only the component’s Administrators and the Supreme Administrators may call this method, using their Administer-
Component() method.
2.5.1.2.8. Destructor
As for the constructor, we here define the Destructor as the physical deletion of all the files related to the compo-
nent, after it’s been uninstalled.
Uninstall
Unload
In order to better understand the common behaviour of all components, we created a UML State Diagram that
shows the global states of a component, either Block or Module.
The components exits from its initial state when the installation is executed.
2.5.1.3.2. Installed
When the component is in this state, it is ready to be loaded by the user who is browsing the website, if he has ap-
propriate access level.
2.5.1.3.3. Loaded
The component is loaded and ready to provide its services to the user. This is a special composite state. Every com-
ponent can be in any specific state when it’s loaded. For example, a Picture Gallery module, while loaded, may be in
the state where the user is displaying the list of categories, or a specific picture, or be in upload mode, etc. This is,
then, an abstract state that every single component must extend.
A block is a component, so the Block class inherits from the Component class. The Block class, at the System Domain
Model abstraction level, does not provide further methods. However, single blocks may provide specific service with
related methods. So each block would be an instance of a class that inherits from this one.
A module is a component, so the Module class inherits from the Component class. The Module class, at the System
Domain Model abstraction level, does not provide further methods. However, single modules may provide specific
service with related methods. So each module would be an instance of a class that inherits from this one.
2.5.3.1.2. FeedGenerator
A Module may be composed by a number of Feed Generators
2.7.3.1.1. UserGroup
A Module may create and manage a number of groups
News Module
o Latest news
o Most popular news ever
Forum Module:
o Index of sub-forums
o Latest topics (global)
o Latest topics (forum-specific)
Picture Gallery Module:
o Random pictures
o Index of categories/albums
o Latest pictures (global)
o Latest picture (album-specific/category-specific)
2.5.4.1. Methods
2.5.4.1.1. GenerateFeed():XMLDocument
This method generates an XML document containing the RDF/RSS feed requested. The generation of the feed is
done using the module’s specific methods, so no explicit responsibly is shown in this document
Everyone can use this method. It is usually invoked by RSS readers installed on clients.
The XMLDocument data type must be either defined at programming language level, or manually implemented in
FlashNuke if the platform does not provide XML APIs.
Before continuing, it should be noticed that the Generic User, depicted as an actor in the Use Case Analysis, is not
represented by any class in the system. A Generic User may be anonymous22. Even if the Generic User is an impor-
tant entity in the system, so we simply say the following:
The empty instance is usually represented by the null value in programming languages. The Anonymous user has a
special property: it refers to more than one physical user. Due to its definition and properties, the Anonymous user
cannot be banned or be member of a group.
2.5.5.1. Properties
2.5.5.1.1. Username: String <PK>
The username identifies the user. This is a primary key, so it’s a unique identifier. Apart from the obvious require-
ment that two users cannot have the same username, no specific requirement on allowed characters or length has
been defined yet. They will depend on the platform requirements.
This field is protected: it cannot be publicly visible for obvious security reasons, but can be accessed by the login
method.
This field is optional, as we will see now for the Digital Signature.
The DigitalSignature data type must be defined at programming language development, or else it must be manually
implemented.
This property is not publicly accessible for privacy reasons. However, it can be used to send emails to the user with a
specific method.
22
A user that is using the website without registering is considered anonymous. It can be any person in the world
Distributed under Creative Commons 2.5 BY-SA IT Page 43
FlashNuke: The Flash CMS
2.5.5.1.5. Avatar: Image
The Avatar is a small image representing the user. It is optional, and, if set, allows the system to display an image
near the username (for example, in Forum messages).
The Image data type must be supported at programming language level, or an alternate way to implement avatars
must be found by developers.
2.5.5.2. Methods
2.5.5.2.1. Constructor
The constructor for the user class is called during the sign up process. A new entry of the user class is created and
stored in the data source.
For detailed information on the signature verification algorithm, consult our Digital Signature reference.
2.5.5.2.4. LogOut()
This method is used to terminate a registered user’s work session. This is used for security reasons to prevent other
people using the same machine to act as the user that was logged in.
This method can be called only by Registered Users on themselves, or by User Administrators on other users.
2.5.5.2.6. ViewProfile()
This method shows the profile of a user.
2.5.5.2.7. ConfirmEmail()
This method executes the email confirmation process required to activate a new user’s account. Details on the email
confirmation will be found in the Software Project Document.
This method can be invoked only by Registered Users on themselves, with the exception of User Administrators, that
can call the method on anyone without having to confirm the email address.
2.5.5.2.11. RevokeKey()
This is a method used to revoke a user’s signature. It is similar to the digital signature login, but is used when a user
that was using a digital signature wants to change his signature or switch to password by setting a new one.
This method can be called by the group’s founder or by the user on himself.
This method can be invoked only by Registered Users on themselves, or by User Administrators on any Registered
User. This method may be called within the EditProfile() method.
2.5.5.2.15. Destructor
The destructor for the user class is called in the following two cases: the user deletes his own account, or when an
Administrator deletes another user’s account.
All data associated to the target user is deleted from the system.
Banned by Admin
Banned Confirmed
Unbanned by Admin
2.5.5.3.2. Unconfirmed
A user is in the Unconfirmed state when he has completed the sign up process but not yet the email confirmation.
The user can’t log in or do anything else. As the user enters this state (it is not shown in the diagram), a timer is
started. When it reaches 24 hours of count, the sign up process is cancelled an the destructor is called. The user may
retry the email confirmation process and reset the timer. When the email confirmation succeeds, the user finally
goes in the Confirmed state at the default entry point.
The user exits this state by logging out or by being promoted Administrator.
The user exits this state by logging in or by being revoked Administrator privileges.
When in this state, the user becomes an instance of the PartialAdministrator class.
The user exits this state by logging out or by being revoked Administrator privileges.
2.5.5.3.4. Banned
In this state, the user is banned and won’t be able to log in any more, until unbanned by an Administrator. When a
banned user tries to log in, the system should log the hostname from where the user attempted the log in and ban
that too to prevent registering with other accounts.
A user may exit this state only by Admin action: either the Administrator unbans him, or deletes his account com-
pletely.
2.5.5.4.2. Language
A user may select one language to display FlashNuke in during his work session. If none is selected, default is used
2.5.5.4.5. BannedUserList
A user may be or not in the Banned User List
2.5.5.4.6. File
A user may upload a number of files
2.5.5.4.7. Theme
A user may have at best one theme to display during his work session. If not selected, the default theme for the por-
tal is used
However, we did not model the first two kind of privileges. In order to do so, we assume the system is built with a
FileManager module (not the FileManager class, which is used for physical management) and a UserManager mod-
ule, or better that the File and User Administration functions will be provided under the form of a loosely-coupled
module, which will be an important part of final release.
2.5.6.1. Methods
2.5.6.1.1. AdministerComponent(Component: Component)
This method allows the Administrator to use a component’s Administration functions. Simply, this method is used to
call administrative methods on the provided component. The Administrator must have Administrative privileges over
the component in order to use this method.
2.5.7.1. Methods
2.5.7.1.1. ChangeConfiguration()
This method allows the Administrator to display and change website’s global settings, including the site name, the
website email address (the sender that will be used in messages, i.e. [email protected]), default theme and lan-
guage. The full list of website settings will be made later, during the project phase.
2.5.7.1.3. ManageComponents()
This method allows the Administrator to manage components. It implements UC024, and is used to call component-
specific install/uninstall methods.
There are three special groups we won’t mention, and will be implicitly instanced in the system: the group that
represents every user of the system (registered or not), the group that includes all registered users and the one that
includes all the Administrators.
2.5.8.1. Properties
2.5.8.1.1. Name
This defines the name of the group. For groups created by users, this must be a unique property
2.5.8.2. Methods
2.5.8.2.1. Constructor
The constructor creates the module.
2.5.8.2.4. Destructor
The destructor deletes the group.
It can be called only by the group founder, or by a User Administrator if the founder is a user.
2.5.9.1.2. Code
This represents the two-letter ISO 639 code for the language. For example, it stands for Italian language, and el for
Greek language.
2.5.9.2.2. User
A language may be chosen as default language by a number of users
2.5.10.1. Properties
2.5.10.1.1. Name: String <PK>
This is the theme’s canonical name. It is used as unique identifier. We will define the allowed character set when im-
plementing the Theme Manager.
2.5.10.1.2. Header
This represents the theme’s header. Header, as described in RN001, is what is displayed on the top of the interface.
It usually contains a logo, or a quick-navigation menu. It’s up to the creativity of the artist to design a header that is
both attractive and useful to navigation.
2.5.10.1.3. Footer
This represents the theme’s footer. Footer, as described in RN001, is what is displayed on the bottom if the inter-
face. It usually contains a copyright notice for the theme, together with the author’s email address.
2.5.10.1.4. Stylesheet
The stylesheet (14) is used to describe how GUI elements have to be displayed, according to their nature or usage.
This is a programming language-dependent feature. Details for the stylesheet will be mentioned during the client
project phase.
2.5.10.2. Methods
2.5.10.2.1. Constructor
Due to the plug-in nature of themes, the constructor for this class is the physical upload of its files into the system’s
directories.
23
We already said that the terms skin and theme are synonyms in software visual design environment
Distributed under Creative Commons 2.5 BY-SA IT Page 51
FlashNuke: The Flash CMS
2.5.10.2.2. Load()
This method loads a theme for the GUI. Elements will be displayed using the rules of the stylesheet, and header and
footer will be initialized.
This method is called by the GUI when loading, or by the Change() method.
This method can be called by any user, and uses the Load() method of the new theme to load.
2.5.10.2.4. SetDefault()
This method sets a theme as default for the current user. In particular, this method creates or edit a link between
the theme object and an instance of the User class. If the user never selected a default theme, the link is created,
else the old link is broken and the new is created instead of that.
2.5.10.2.5. Destructor
As for the constructor, the destructor for this class is the deletion of files from theme’s directory.
2.5.11.1. Properties
2.5.11.1.1. Name
This represents the file’s canonical name, including its extension.
2.5.11.1.2. Type
This represents the file type. Examples are audio files in MP3 format (.mp3), image in SVG format (.svg), BitTorrent
Metadata files (.torrent)
24
Since the name is a primary key for the theme, the NewTheme parameter could instead be a string instead of an instance of
the Theme class, but this has no importance yet
25 64
Terabytes. 1TB = 1024GB. Then 16TB = 2 B = a very large file
Distributed under Creative Commons 2.5 BY-SA IT Page 52
FlashNuke: The Flash CMS
2.5.11.2. Methods
2.5.11.2.1. Constructor
The constructor is invoked during the upload of the file. It places the file into an appropriate directory on the server
and registers the file into the File Manager
2.5.11.2.2. Delete()
This method deletes the file from the system. It aliases the destructor.
This method may be called by the File Administrator, the uploader of the file or by the system, by request of the
module from where it was uploaded.
2.5.11.2.3. Destructor
This method is aliased by the Delete() method.
2.5.11.3.2. User
A file may have been uploaded by a user or not
2.5.11.3.3. Module
A file may have been uploaded from within a module. This link is used to inherit the module access level. For exam-
ple, if the file has been uploaded within the Download module, it inherits the access level for the module when it
changes; so it will be accessible by all the users that can access the module if not differently specified.
2.5.11.3.4. UserGroup
A file may be downloaded by a group of users. Users with the same privileges level are considered as groups (for ex-
ample, all registered users)
2.5.12.1. Methods
2.5.12.1.1. Upload(NewFile)
This method is used to upload a new file into the system. This method uses the file provided by the client and the
constructor of the File class to upload and register a new file.
26
It has nothing to see with the Component class
Distributed under Creative Commons 2.5 BY-SA IT Page 53
FlashNuke: The Flash CMS
2.5.12.1.4. SetProperties(File: File, NewProperties)
2.5.13.1. Properties
2.5.13.1.1. Started: Timestamp
This property indicates when the session started, and is used to compute inactivity time.
2.5.13.1.3. ViewState
This property contains a snapshot of the state of FlashNuke interface. It includes the currently displayed module and
its internal view state, the current displayed blocks and their respective view states. It is used for saving & restoring
the session.
2.5.13.2. Methods
2.5.13.2.1. Constructor
A new session is constructed each time a user enters the website. The constructor sets the Started property to the
system time.
2.5.13.2.2. Save()
This method saves the current session’s View State permanently on the data source. It will be restorable in a future
time by the same user when logging in.
This method can be called only by Registered Users on their own sessions.
2.5.13.2.3. Load()
This method loads a previously saved session for the current user. The View State is restored.
This method can be called only by Registered Users on their own sessions.
2.5.13.2.4. Login()
This method is used by an anonymous user to log in. This method simply creates the link with the User class.
We have omitted the parameters for this method for simplicity reasons.
2.5.13.2.5. Logout()
This method is used by registered users to log out. This method simply breaks the link with the User class.
There is only one problem with the destructor: as we will see later, each System Event, or Error, in the log, is linked
to the work session. Destroying the session causes the break of the logic link between the classes. There are two
possible solutions to that: the first one is to first save a permanent backup copy of the session class inside the log, so
the class won’t ever be reusable but will be browsed by Administrators; the second one, the one we chose, is to
automatically log the host and the user instead of the whole session.
2.5.13.3.2. Host
A session may be associated to only one host
2.5.13.3.3. SystemEvent
During a session, a number of System Events may be logged. A single session may cause the logging of many events
2.5.14.1. Members
2.5.14.1.1. IPAddress: String
This represents the IP Address of the host in its network form. It is a string that must match the IPv4 or IPv6 address
pattern.
A user registered
A failed login attempt for an Administrator account
Installation of a component (or its uninstallation)
New forum created
New picture gallery created
27
In web environment, when the user leaves the website, unlike what happens with classic applications, the server is not no-
ticed of it. So it’s actually impossible to detect when the user actually leaves the website. Moreover, we must consider the pos-
sibility that the remote client crashes, leaving the session open forever
28
A host is, by definition, a terminal connected to a network, no matter of its nature or role
Distributed under Creative Commons 2.5 BY-SA IT Page 55
FlashNuke: The Flash CMS
2.5.15.1. Methods
2.5.15.1.1. VewLog()
This method shows the log to the current user. Showing the log means showing the list of events that occurred since
when the website opened, ordering them from the most recent to the oldest.
A failed login attempt is not an error, because the system is prepared to that event
In case the requested file is not available for download (the file system returns an error, like File Not Found),
but it’s expected to be there, an error condition is signalled and logged
The user tries to display a private message, but the message body is not present in the data source: this is
another error
Errors are similar to system events. The Error Log has a special feature more than the System Log: it can report er-
rors to the development team. This feature, which implements RE008, is useful for debugging purposes. The devel-
opment team, analyzing the reports coming from many users, may reconstruct the conditions that lead the software
to an error and try to find a solution to that problem.
As for the SystemLog class, this one is accessible only by Supreme Administrators.
2.5.16.1. Methods
2.5.16.1.1. ReportAllErrors()
This method cycles over all the errors stored in the log and reports each of them to the designated development
team.
There is no destructor for this class, because the log cannot be erased for security reasons.
2.5.17.2. Methods
2.5.17.2.1. Constructor
The constructor is called when the system, or a component, wants to write an entry to the log. The constructor in-
serts the new object inside the System Log.
2.5.18.1. Properties
2.5.18.1.1. Component: Component
This property points to the component that generated the error. If not set, this means that the error was generated
internally by the system.
2.5.18.1.2. TechnicalInfo
This property contains all the technical info that were saved when the error was generated, and that can be useful to
debuggers. These information may contain a brief description, the value of some variables, etc.
The data type for this property must be enough free that a large variety of information may be stored inside it, with
no limitations.
2.5.18.2. Methods
2.5.18.2.1. Report()
This method reports the error to the development team of the component that generated it (or to the FlashNuke
Development team if the error was internal).
This method may be called only by a User Administrator29. This method cannot be used on a user that has been al-
ready banned.
This method may be called by a User Administrator, or by the system itself. This method cannot be used on a host
that has been already banned.
This method may be called only by a User Administrator. This method cannot be used on a user that is not banned.
This method may be called only by a User Administrator, or by its overloaded version. This method cannot be used
on a host that is not banned.
2.5.19.2.2. Host
The Banned User List is composed by a number of Host
29
Reminder: the Supreme Administrator, since inheriting from the User Administrator, which is an instance of Partial Adminis-
trator, has the same power. We won’t explicitly mention it anymore
Distributed under Creative Commons 2.5 BY-SA IT Page 58
FlashNuke: The Flash CMS
3. System Design Document (SSD)
Each web application requires a data source to store permanent data in. This may be designed internally or exter-
nally to the server application. If external, a common interface (better if standardized) must be cho-
sen/implemented.
We have decided to opt in for a three-tier architecture. The architecture is composed by the client, the server and
the data base. Client and server will be developed independently, after defining the communication protocol. We
will use a standard system for data base.
Client: the client side, because of the specific requirement, will run on the Adobe Flash platform and will re-
quire the final user to install Adobe Flash Player 9 on his browser, whatever it is.
Server: the server side of the program can be built using any scripting language or framework available, in-
cluding PHP (15), Java (16) and .NET Framework (17). We have chosen Microsoft .NET Framework 2.0, as it
allows development in VB.NET, C# and VJ# languages. A single application can be written even with all three
languages. Software developed for the .NET Framework, thanks to the Mono Project (18), can run on oper-
ating systems different from Microsoft Windows, but there may be some portability issues. More, .NET
Framework allows an easy development of the Accessible Version using ASP.NET
Communication protocol: we chose the SOAP protocol for the Web Services (19), as we thought it’s the
most simple way to implement Remote Procedure Calls (RPCs) in web environment. As we have discussed so
far, most of the actions done by the user on the interface results in an RPC.
The global system structure is the following: (for simplicity, the error reporting service is omitted)
.NET Framework
Web Browser
Client side
Programming languages developers know the importance of running custom code at run-time, and various solutions
are available. We will analyze them in detail.
Client: when running an Adobe Flash program (.swf), there may be the need to load a class that has never
been declared before from a file that is external to the assembly. Adobe Flex natively supports Flash libraries
files (.swc), but dynamic links with the module files must be done before compiling the application. Flex
Framework, however, includes a getClassByName() function that is used to create an instance of a class the
name of which is unknown at development time, and a control called SWFLoader that allows dynamic load
of SWF files at runtime. Unfortunately, the SWFLoader loads the target SWF file as a movie, executing its de-
fault code. The parent movie (the one that loads the target) may however run code from the child movie as
it’s an instance of a class (21). Anyway, in order to prove the feasibility of this requirement (loading an SWF
file which name is unknown at compile-time) we have produced a prototype that can be used as template by
coders.
Server: since each component may have a server-side part, and this is in the 90% of cases, even the server
must be able to run custom code at runtime. Assuming we will be using .NET Framework, the Reflection is
the key feature to run custom code. In order to use reflection, an assembly containing the target class must
be created separately from the main assembly (possibly as a DLL Class Library), then the program will use a
system call to load a specific class at runtime from that DLL. We have produced a prototype to prove the fea-
sibility. It can be used as a template by coders.
Data source: the data source must be able to expand in order to store data from new components, such as
Forum topics and messages, or news articles. Assuming we will be using a SQL DBMS, the addition of new
tables is done with a simple SQL query, as for the deletion.
30
We are talking about the general concept of module in programming languages, not FlashNuke modules!
Distributed under Creative Commons 2.5 BY-SA IT Page 61
FlashNuke: The Flash CMS
Can a stylesheet be changed at runtime? Or does it require reloading the program?
Does loading a stylesheet from a main application affect the dynamically loaded child components?
Programming this way may be uncomfortable when using visual editors, and may force the developer to use direct
code editing. However, there is no need to produce a prototype.
The only problem linked by the multilanguage support happens in the following two situations: the webmaster in-
stalls a component not written in the language the website is running, or the development of a components pro-
ceeds unlike its translation (not all a component’s string messages are available in a certain language). For both
cases, we must define the following development rules:
Each component must be developed at least in English, or at least it must have a default language (but we
insist for English)
IF a certain desired language is not available within the component, the default language is used
IF a string is not translated, the string in the default language is displayed
The digital signature login, however, is a bit tricky to analyze. It requires a browser supporting digital certificates:
Internet Explorer and Mozilla Firefox do support digital certificates, but the same can’t be said for other browsers.
Client-side support for digital signature is made using Javascript. Flex supports calling Javascript methods (there’s an
entire chapter of documentation about it: we will cite only the ExternalInterface API), so a Flex application can actu-
ally apply a digital signature, generate a private key and extract a public key.
The server-side part of the script is easy: assuming we will be using .NET, there is a class that verifies digital signa-
tures using .NET cryptography engine. Else a verification function can be implemented following algorithm specifica-
tions.
The problem is with the Accessible version: since client actions are driven by Javascript code, and we refused to use
Javascript client-side for compatibility reasons, the Accessible version won’t support signature login, or will else re-
quire a Javascript-compliant browser to perform this authentication.
The avatars must not exceed 128x128px or they can cause display problems.
This requirement is feasible, but may violate the Accessibility criteria. A code template should be produced to help
developers
In order to let an Administrator operate anytime and from anywhere on the website, an Administrator panel has to
be built within the website’s user interface. The Admin functionality becomes available only when the user that logs
in has Administrator privileges. Other access attempts made by other users must be prevented and blocked.
The Administrator panel requires the implementation of the client interface and the server-side support for the ac-
tions done by the client. Admin modules may behave the same way as user modules, with the difference that every
action must be checked to prevent unauthorized access.
This requirement is feasible. However, the client-server protocol needs to consider the particular security needs of
the Administration panel
Search engines can be fooled by URLs that point to a different page for every content (for example
http://tempurl.org/news-054.html and http://tempurl.org/news-064.html, and this is the technique that is used to
pretend those pages are made manually by the web designer. The problem is that those HTML files do not actually
exist on the server, and it will be very server-overloading to create a new file for each page that must be linked. The
solution is to tell the server that, for a certain pattern, a correspondence with another effectively working URL exists.
The server must then interpret a certain URL pattern another way. Assuming we will use .NET Framework 2.0, a spe-
cial web.config directive works this way: it can actually rewrite URL in order to process a single file or maybe even an
instance of the HttpHandler class. The problem is that a Flash movie is always initialized at its start point by the Flash
Player.
The solution we found combines the usage of server-side scripting and client-side Javascript. Simply the server-side
script (i.e. Default.aspx file) generates a client code that contains not only the Flash Player instance linked to the
FlashNuke main SWF file, but a server-generated Javascript code that can be used by FlashNuke’s Flex APIs to obtain
data, like the module that has to be displayed and its initial state. The module itself may still access the Javascript
code and obtain its initial state without being passed any parameter.
We have generated no code yet, but all the information we provided is sufficient to prove the feasibility of this re-
quirement. However, we still want to include some pseudo-code to make an example:
//Now the client side initializes Flash Player. FlashNuke, when rendering com-
ponents, does something like this
if module != null {
mod = load the module whose name is in the module variable
mod.requireInitialState = true;
} else {
mod = load default module
}
//The module, since the flag to require an initial state is true, expects an ID
parameter
displayNews(id);
There are two main possibilities for packaging and uploading components: the first one requires the webmaster, af-
ter downloading the package from the Internet, to unpack it and upload the files in the components’ directory (in
order to avoid problems, each component should be installed in a separated directory); the second one requires the
webmaster to upload the compressed package into a temporary directory (or even letting FlashNuke fetch the file
directly from the Internet) and then, as first installation step, let the system uncompress the files.
Both ways are feasible, but the second one requires the implementation of a compression library. Since we’re work-
ing in Open Source environment, there is the possibility to integrate an existing library into the project, like the
SharpZipLib Project for .NET.
The installation requires a digital signature check of the package. Assuming we’ll be using .NET, the Assembly class
provides a method to check a DLL’s digital signature. This may check only the server-side part of the component,
leaving the client-side at risk of alteration.
At a System Domain Model analysis, we have found that no information, maybe except users’ public information, is
interesting enough to implement a feed for it, but, as we analyzed, modules are the ones that produce feeds for
their data, like news and pictures. The options are two: either each module has its own feed generator, independent
from the rest of the program, or a central feed generator is implemented, and it then uses the module’s feed gen-
erator to obtain the data to display.
The second solution is the one that we chose for ease of programming.
Anyway, it is required that feed elements have a specific URL. This does not directly require the implementation of
URL Rewriting, but, as we saw in the analysis of that requirement, it is important that FlashNuke can be initialized to
a specific state by the URL.
It would be recommended, for search engines performance, to use Accessible Version URLs in feeds. For example,
the Invision Power Board (22) forum script automatically forces search engines to index its lo-fi version, which is
read-only and accessible. From there, users access the hi-fi version which is the full version of the board.
First of all, it requires FlashNuke to globally manage all the files available for download: a unique archive for all files
must be implemented inside the data source. Each file must be uniquely identified, i.e. by a numerical ID or a GUID
We need now to define those policies once for all. First of all, when a component is accessible only by Registered Us-
ers or Administrators, its files should inherit the component’s access level: if the Forum is globally inaccessible by
anonymous users, downloading files attached to messages should be allowed only to Registered Users; however, if a
forum31 is accessible to moderators only, the file cannot just be accessible to Registered Users; when sending a file
over a Private Message, its content should be visible only to the recipient (or maybe the sender too, if a history of
sent messages is kept). In the second case, since we’re talking about a small group of people, the most simple solu-
tion would be of simply not implementing additional protection, trusting that the members of the group won’t share
the secret file with anyone else; in the third case, it’s up to the two users involved in the communication to keep the
file secret if they want.
The alternate solution is to implement an additional security layer where each file has its specific download policy
(even using authorization tickets: what happens in large-scale download websites that manage terabytes of data and
need to provide a minimum-quality bandwidth to users). This can be useful against the history function of browsers
installed on public machines. This, however, may introduce the concept of group of users, that FlashNuke must
manage globally. For example, the Forum module uses FlashNuke core to create the group of moderators, or the
group of users that can access forum #X and then manages users according to the Moderator/Administrator’s needs.
A user32 may then be member of many groups (or just none) at the same time. A file could be then downloaded by:
The technical problem with download managers is server overloading. Our experience teaches us that using a script
that fetches a file from disk and then sends it to the client is extremely memory-consuming, especially for large files.
The script must then be optimized in order to save memory and/or limit concurrent transfers.
The implementation of this download mechanism also requires the implementation of an upload mechanism. The
feasibility analysis must be focused on the analysis of the possibility of uploading files using a Flash interface, since
file upload using HTML is a common practice. This requirement will still be feasible, because if upload can’t be per-
formed using Flash the alternate way would be of opening a pop-up window for HTML upload.
That’s not the case of Flex, which implements the FileReference class. This class is designed to allow file upload using
HTTP POST method. It then requires a server-side script that accepts incoming files via HTTP POST and stores them.
31
When we use the expression the Forum, we mean the global Forum module installed in FlashNuke. When we use the expres-
sion a forum (possibly using lower case), we mean an area inside the Forum grouping a number of topics in a specific discussion
area
32
Of course we mean a Registered User
Distributed under Creative Commons 2.5 BY-SA IT Page 66
FlashNuke: The Flash CMS
The system must be designed to support the execution of unknown components, in the meaning that the services
those components provide are unknown at development-time. This is what RN002 basically requires. However, that
requirement does not consider that it’s imperative to distribute the documentation to the general public.
The best form in which that documentation should be distributed is the Software Development Kit (SDK). The SDK,
carrying comprehensive examples and code templates, not only provides the developer the classes and the inter-
faces required to build new software, but helps him understand FlashNuke’s architecture in order to fully use all the
software’s features.
Web accessibility refers to the practice of making Web pages accessible to people using a
wide range of user agent software and devices, not just standard Web browsers. This is espe-
cially important for people with disabilities such as visual impairment. In order to access the
Web, some users require special software or devices in addition to a standard web browser,
or specially designed web browsers. Design for accessibility is a sub-category of good design
for usability.
Visual: Visual impairments including blindness, various common types of low vision
and poor eyesight, various types of colour blindness;
Motor/Mobility: e.g. difficulty or inability to use the hands, including tremors, muscle
slowness, loss of fine muscle control, etc., due to conditions such as Parkinson's Dis-
ease, muscular dystrophy, cerebral palsy, stroke;
Wikipedia, however, does not cite in that article the technical need of a user who’s using a user agent that doesn’t
support some advanced technologies like Flash, Javascript, etc. Since we’re working with Flash, the main problem is
not to force the user to install the Adobe Flash Player, either because his browser/operating system doesn’t support
it or just because he doesn’t want to. Even if this is the case of a very reduced percentage of users, this must be kept
in count.
In order to make a Flash-based website accessible, the only way is to actually develop a separate website, all based
on HTML (possibly XHTML (24) for compatibility with all modern browsers that strictly follow W3C standards), with
simple graphics and no use of Javascript tricks.
Developing the alternate website using the AJAX (25) technology is not recommended because it massively uses
Javascript which could be a problem for elder user agents.
The Accessible version must provide the same services provided by the Flash version. Since FlashNuke is based on
loosely-coupling its components, an alternate version must be developed for each component. Assuming we will use
.NET Framework, the Accessible version can be built using ASP.NET and may require the development of a single
Web Control for each component.
This requirement is feasible. However, it affects RE001 because the Accessible version needs to run loosely-
coupled components
However, browsing a website cannot always be completely anonymous, because both technical and security rea-
sons. The technical reason is based on the nature of Internet protocols and the fact that a user’s activity is monitored
and logged at least by his Internet Service Provider (ISP). The security reason stands on the server that hosts the
website. HTTP servers always maintain a log of web activities to help system administrator prevent, discover and re-
pair the consequences of an attack.
In order to defend user’s privacy, a set of options to define the level of information that can be automatically col-
lected and stored by the system must be implemented, together with an information method that automatically in-
forms the user about the particular situation.
More than working on user interface to clearly inform the final user about privacy condition, the Platform for Pri-
vacy Preferences (26) (P3P) can be implemented in FlashNuke to aid browsers. It is then important, and under the
sole responsibility of the webmaster, that what’s stated in the privacy information document does actually reflect
the website’s behaviour.
This requirement is feasible, and requires developers to study P3P specifications for the implementation
Other programs, in fact, require the webmaster to upload the files, then edit the configuration files, set directory
permissions, run the DB SQL script and some manual queries to set the Administrator account up.
This requirement is feasible, and can be developed at a later time than the portal
It has no sense to distribute a fully working web portal that doesn’t actually do… anything!! After the development
of FlashNuke core, developers may put their efforts (and spend their precious time) building the default compo-
nents.
We have identified the following as the most important modules for a general-audience CMS:
Site news
Forum
Picture Gallery
File Download area
FAQs
Private Messages33
Custom Home Page
…and also the following blocks (some of them don’t actually require a fully engineered project, because every inex-
perienced programmer may build them up in a single day of work)
Last news
Last forum topics
Last downloads
Last pictures/Random pictures
Quote of the day
Calendar and Clock
People Birthdays
RSS Reader34
Weather
Stock Market watcher
This requirement is obviously feasible. It requires the completion of FlashNuke core and Components SDK
33
Actually, private messages between users, as for inter-process messages in operating systems, are a basic feature that is gen-
erally managed directly by the operating system. Even if we knew the importance of private messages from the beginning, we
also knew that it’s possible to develop this feature as a separate module. However, since the private messages module will be
included in the final release, it can be considered as a system feature
34
It display RSS feeds from external sources
Distributed under Creative Commons 2.5 BY-SA IT Page 69
FlashNuke: The Flash CMS
3.4.18. RE006: System and Error Log
The system log can be built inside the data source. For every action that should be logged (for example, the nomina-
tion of an Administrator), an entry is written onto the log. All actions are time stamped, and are associate to the user
that did the action and the IP address he was using.
The system log can include the error log. The Administrators may consult the error log and, if necessary, report one
or more errors to the development team of either FlashNuke or the component that generated the error.
Each error must then be identified in order that multiple reports regarding the same error are considered as a single
error. Multiple reports, however, should not be discarded because they are often very helpful to discover hidden
bugs. Anyway, all the aspects of the Error Reporting feature will be shown in RE008.
Each component should be able to write entries into the Log, and those should be visible to component’s Adminis-
trators more than Supreme Administrators. For example, the lock of a Forum topic is an event that should be logged
to prevent moderator abuse.
The development team, using a special program, will monitor reports coming from websites and will analyze the
problem trying to identify and solve the problem. Direct contact with webmaster and open discussions on Forums
are efficient tools in these cases. However, the development of the server-side of the error reporting system is com-
pletely up to every development team, which is not required to distribute the program.
FlashNuke Core team should still develop and distribute the error reporting server to simplify the work of other
teams.
This feature requires each error to be uniquely identified for traceability purposes!
This requirement is feasible, but it’s enough complex as a brand new project. We will deal only with the client side
in this documentation
As long as possible, FlashNuke functionality should be restored using a web interface. First of all, there’s no need to
use Flash in this case, and HTML with poor graphic design is enough to fit an emergency situation’s needs.
The main problem is login: since the data source is unavailable, an alternate (but still secure) method has to be
found. A password is the best choice, because digital signatures may be unsupported by some browsers, and/or the
Administrator may not have the signature with him if in a public place. The big problem is with eavesdropping, and
there is nothing to do with that, more than changing the password often, except using en encrypted connection,
such as SSL. Using one-way cryptography is useless against eavesdropping.
A good solution would be to mark the password with a timestamp and encrypt the result with a one-way algorithm:
if they match the current time and the server’s password, then login succeeds.
The emergency password must be stored in a file on the server that absolutely must not be accessible via HTTP GET:
this is the weakest ring of the chain!! Directories must be protected against browsing!
Using a SQL DBMS, we want FlashNuke to run on MySQL, Oracle, MS SQL Server, etc. without sensing the difference
and without recompiling.
This requirement is feasible, because an abstraction layer can be used on the server-side script to mask DBMS-
specific calls. For example, the .NET Framework provides a set of virtual classes in the System.Data namespace, that
are inherited by DBMS-specific classes and drivers. Even if ODBC (like JDBC for Java) is a valid method to completely
abstract the DBMS platform, the usage of the specific DBMS driver is preferred.
However, using .NET Framework, there is a big problem with SQL stored procedures: for a strange reason, the syntax
between MySQL and MS SQL Server is different because of a “@” character, and also the class to execute stored
procedure cannot be instantiated by the connection class, but its constructor must be called manually, forcing to
implement a switch statement. All the problems related to the data source abstraction will be faced during the
server development.
This requirement is feasible, but may need attention during server development
However, the really sensitive data that should be protected are passwords: both inside the data source, where a
hacker could penetrate using an exploit, and also over the connection.
In order to protect the Internet connection, the best way is to use a protected channel like SSL. However, not all the
servers support SSL. An implementation of a cryptographic algorithm may be done “manually” by developers (since
we’re using ActionScript 3.0), but this solution is totally uncomfortable. Since the weak ring of the chain are pass-
words, we can focus on them only and leave the rest unencrypted.
The password must then be one-way encrypted, i.e. using MD5 (27) algorithm, into the data source, and the login
procedure must be designed in order to not transmit neither the full password nor its encrypted version over the
connection, but transmitting a code that
It must be noticed that the Accessible version requires some Javascript to implement such login procedure, and we
refused to use Javascript for compatibility reasons. A compromise would be of implementing this feature for brows-
ers that support Javascript. Dynamically, a plain-text or a secure authentication is performed if the browser supports
Javascript or not.
However, the most important aspect of groups is that they can be created by modules to manage internal require-
ments, such as access levels. So, there will be two kind of groups: those for which the founder/administrator is a
user, and those for which the founder/administrator is a module.
3.5. Responsibilities
As for every distributed software, we need to define the specific responsibilities for each subsystem in FlashNuke.
We already said the FlashNuke is a Rich Internet Application, built on a platform which is specifically designed for
those applications. As for every Internet application, which is designed to be used by the general public, particular
attention must be paid to security and robustness. However, the paradigm of RIAs is to leave the hard work to the
client, if possible.
Flash Client: the client is responsible of providing user interaction through a Graphical User Interface and re-
quest data from the server. As for the RIA paradigm, if some operations are very CPU or network intensive,
they should be performed by the client to not overload the server. For example, parsing an external RSS feed
should be done by the Flash client, not by the server. However, not every operation can be performed by the
client in order to prevent manipulation of data. For example, the server cannot trust a client calculating the
arithmetic media of ratings for a news article, since the final result could be easily faked.
HTML Client: the HTML client operates when the Accessible Version is used. This must provide only an es-
sential set of services to the user, necessary to provide the most important features to client that do not
support Flash (including assistive technologies), and sufficient to make the user not suffer the particular
condition. Since Javascript cannot be used in this version, all the computational work must be done by the
server. The HTML client is only responsible to request the server with the new pages to display.
Server35: the server has to provide the client with the data needed for processing. Since running over HTTP,
transactions are always initiated by the client. Data is exchanged through the SOAP protocol, and everything
received from the client must be intensively checked in order to avoid manumission. For example, the server
must validate the login credentials at every request prior to accepting it, but it must avoid consuming exces-
sive CPU time. The server is also responsible of managing the website’s database. When running the Acces-
sible Version, the server is responsible of generating the user interface too.
DBMS: the DBMS is responsible of storing permanent data, which is needed by the server for processing.
35
Including only the processing logic, not the client files that are transferred when user enters the website
Distributed under Creative Commons 2.5 BY-SA IT Page 73
FlashNuke: The Flash CMS
3.6.1. Components: storage, identification and Administration
As we have defined previously, Blocks and Modules are components. They can be installed in FlashNuke at any time
and dynamically loaded as shown in the ParentChild example. Components have to communicate with the server,
exchanging data.
First of all, we need to clarify Components can not only be installed by the webmaster, but can be brought with the
system to provide basic work features. For example, the Administration Panel with the Website Configuration must
be included in the basic system package. There is no reason to deny considering the Administration Panel itself as a
Module, since we want to display it in place of the currently-displayed module. This means that the Compo-
nent.Administer() method mentioned in System Domain Model level class diagram will result in actually displaying a
new module on screen.
More than the Administration Panel, some components, like the login block, are vital to the system. In order to fit an
implicit extensibility requirement, we need to be open to all possibilities and so we define the following kind of com-
ponents:
We already said that each component is uniquely identified by its name. There is only one channel of communication
between the client and the server: each request, coming from any component, is routed through a single server pro-
cedure. To allow parallelism (and save some server resources, for reasons we will explain later), multiple requests
are routed at the same time through the same channel. We also said that components’ files reside inside specific di-
rectories on server’s file system.
Each component will be stored inside a directory with the name of the component, that will
work as identifier. All the components will have their directories stored inside a Components/
subdirectory of the website. A file inside the module, called manifest.xml, will store basic in-
formation on the component, including a tag that determines if that’s a block or a module.
The client-side script will be compiled at least in Default.swf, while the server-side script will
be compiled at least in Default.dll, with a set of functions to be used by the server for interac-
tion.
Since the Administration controls are executed under special circumstances, and must receive
special attention to protection, we will separate the channels of communication. A compo-
nent’s name, over the Admin channel, refers to the Administration Panel of that component, if
present. The client-side of the admin script must be compiled at least into Admin.swf.
System-internal components are referred by their names, which cannot be used for compo-
nents (for example, if the login block is called LoginBlock, a LoginBlock/ directory is ignored;
however, a loginblock directory may be theorically considered as a separate component)
36
We haven’t defined any yet
Distributed under Creative Commons 2.5 BY-SA IT Page 74
FlashNuke: The Flash CMS
All file and directory names must be considered case sensitive.
Since not every file system supports case sensitive names, but we need to develop for every platform, developers
must code presuming the file system is case sensitive, but must choose directory names in order to not collide with
existing ones. For example, if a module called Gallery is present, developers of the gallery must refer to it with capi-
tal G, but other developers should not distribute their alternate picture gallery as GaLLerY.
We paid attention to case sensitivity because FlashNuke will mostly run on Windows, which is not case sensitive, but
is designed to run on UNIX using the Mono Framework, and UNIX is case sensitive.
3.6.2. Avatars
FlashNuke can associate a user to a picture (the so called Avatar (28)) representing him.
Supported formats for pictures are all the ones supported by Adobe Flash. Images must not
be larger than 128x128 pixels to avoid display problems. A default avatar, representing an
unknown user, is assigned to users that didn’t select a personal avatar. Each theme may
override the default avatar to combine its look with the global graphic appearance.
The preferred format is PNG. The user is allowed to choose an avatar from a default gallery
(included in the release) or to upload a custom avatar to the server, but the Administrator
may choose the options to enable. External linking is disabled for privacy reasons (external
images may be associated to scripts that are able to track down the user who’s displaying them).
SWF avatars are not allowed for security reasons. A Flash avatar, even if fantastic-looking, may carry dangerous
scripts within it.
We have decided the following to permit easier handling of data sent over the network:
Components may obviously include other files, such as images/icons, inside their directories.
37 64
The long type is, by definition, an integer represented on 64 bits (8 bytes). From 0 to approx. 2
38
In web environment, reading permissions means that the files inside the directory can be accessed using their relative URL. If
a file is not readable, the server returns error 403 - Forbidden
39
Usually this flag is not required by Internet Information Services for DLLs
Distributed under Creative Commons 2.5 BY-SA IT Page 75
FlashNuke: The Flash CMS
o Avatars/: contains the avatars of users. [R/W40]
[A lot of images]
Custom/: this directory holds custom avatars. [R/W]
[UID.xxx]: avatars are renamed to User ID
o Components/: stores components
[A Component]: stores the files for the component. [R/X]
Accessible.dll: Accessible Version script for component
Default.swf: main client file for component
Default.dll: main server file for component
manifest.xml: contains information on the component
o Files/: stores files [W]
[GUID]: each file is renamed to its identifier when uploaded
o Storage/: this directory is used by components as a writable space to create and store internal files
(for example, logs or caches). [W]
[Component name]: each component stores files under a directory named like itself.
Private: this directory is write-only, and used for private files. [W]
Public: this directory stores files that can be read from HTTP. [R/W]
o Themes/: directory for themes
[A Theme]/41: this directory stores a single theme. Its name identifies the theme itself. R
o Accessible.aspx: this file loads the Accessible version of FlashNuke
o Engine.asmx: this file is the main Web Service script
o Default.aspx: this files holds the HTML container of FlashNuke
o Default.swf: this file contains FlashNuke Core Client
o Download.aspx: this script allows downloading a file42
o Global.asax: default ASP.NET global class file. Required by the platform
o web.config: default ASP.NET configuration file. Required by the platform
When executing a server request, the client always sends the Session ID to the server. If the
session is inactive (i.e. timeout), the server returns an error and refuses the entire request. The
client, both in this case and when it’s first loaded, requests a new Session ID to the server. Af-
ter obtaining it, a login may be performed sending the Session ID and the credentials. After
that, the Session ID will be used to maintain the user session state: the server will store the
association between the UID and the SID. For security reasons, the server must compare the
current IP address of the remote client to the one associated to the session to prevent attacks
40
We made this directory writable in order to create an Avatar Management component to add and delete avatars from com-
mon gallery
41
Before defining the content of the theme’s directory, we need to deeply study Flex theming. We don’t have such information
yet, but we will deal with this during client development
42
Instead of using an ASP.NET page, it can be considered to map the Download.aspx file to an instance of the HTTPHandler class
Distributed under Creative Commons 2.5 BY-SA IT Page 76
FlashNuke: The Flash CMS
3.6.6. Error handling, logging and naming
We define an error an exception thrown by FlashNuke or one of its components that cannot be handled by the sys-
tem. For example, when the program tries to access the database but a table is damaged an exception is thrown and
it cannot be handled, resulting in an error. Instead, following the example of the paragraph above, if the server re-
fuses the current SID, the program automatically requests a new one to the server and the execution is resumed,
and that doesn’t result in an error.
When FlashNuke throws an exception from inside its code, that exception should be identified by a unique 32-bit
hexadecimal value with the following convention:
The first 24 bits identify the package that generated the exception (for example: Core Client, Core Server,
News Client, News Server, Core Accessible, Forum Accessible), and the other 8 the specific exception
o Class 000000 represents Core Client (0x000 to 0x0FF)
o Class 00000A represents Core of Accessible Version (0xA00 to 0xAFF)
o Class 00000F represents Core Server (0xF00 to 0xFFF)
For example, a PermissionDeniedException returned when trying to use administrative features may have code
0xF53A.
When the error is logged, its instance should be identified by a GUID (23). This allows easier reporting and tracking
by the debug team when using the Error Reporting service43.
Notice: we said that an exception is marked by a unique identifier. This is intended for an easier track down of the
error. The identifier must be associated not to the instance of the exception, neither to its class, but to the part of
code where it’s generated. In the above example, the PermissionDeniedException has code 0xF53A when thrown
from the server-side of administrative panel, but when it’s returned due to an invalid operation in the News module
(i.e. rate an article again), it may have code 0xA457C, where [0xA4000-0xA4FFF] is the class associated to the server-
side of News module.
Because of this, proper documentation must be produced to track exceptions and their origin points. A full list of
known exceptions must be included in documentation. If possible, an online Knowledge Base (29) under the form of
a wiki (30) should be created in order to allow cooperative development of documentation
43
It’s just necessary that an exception has a unique ID only within the website it has been generated at. When we will build the
Error Reporting Service, we will automatically distinguish exceptions with the same GUID sent by different websites
Distributed under Creative Commons 2.5 BY-SA IT Page 77
FlashNuke: The Flash CMS
Default language: determines the default language to use when rendering the portal
Default theme: determines the default theme displayed, if no choice is made by the user
Require email confirmation: if enabled, all users that want to register must validate the email address (con-
fimed opt-in)
4.2.1. IDictionary
A dictionary is a name-value collection in which every item is accessed through an alphanumerical key. Dictionaries
are basically different from arrays. In arrays and matrixes, a single item is accessed by using its physical position in
the ordered list of items (this includes multi-dimensional arrays, which are basically arrays in arrays).
Dictionaries are more flexible than regular classes: this because dictionaries are random-access. The key, unlike the
property of a class, may be the value of a string variable, and such subject to runtime change. When trying to access
an unknown key, the programming language deals with the error situation either by returning a null value or by
throwing an exceptions.
Dictionaries are also known as Associative Arrays. VB.NET, C# and AS3 implement dictionaries and the IDictionary
interface. The XML-Serializability is granted since XML syntax is basically a dictionary. Programming languages have
internal serialization/deserialization functions that transform the key into the tag’s name and then encode the value
in XML (if the value is an atomic type, like Integer or String, it’s included in the markup, else the serialization is recur-
sive).
<name>John</name>
44
In this example, we assume that the gender value is an enumerative data type. As we will see below, enumerative types may
be serialized at programming language’s discretion
Distributed under Creative Commons 2.5 BY-SA IT Page 79
FlashNuke: The Flash CMS
<surname>Doe</surname>
<gender>0</gender>
<age>36</age>45
4.2.2. IUser
The IUser interface is used to represent a registered user in FlashNuke. It is composed by the following properties:
For privacy reasons, some fields must be left null except in rare cases. For example, the IPAddress and Hostname
fields must be visible only to Administrators.
When the username is set to null, the object represent the Anonymous user.
4.2.3. AccessPolicy
After logging in, the client interface must be rebuilt in order to show the components for the user’s level of privi-
leges. All active components must be informed of the log in.
4.3.1.1. Parameters
None
45
An alternate syntax to <name>val</name> is <name value=”val”>
46
Password and public key must always be null, except in the SignUp method for registering a new user. In this case only one
must be set. Having these parameters in the class helps simplifying the SignUp method
Distributed under Creative Commons 2.5 BY-SA IT Page 80
FlashNuke: The Flash CMS
4.3.1.2. Exceptions
4.3.1.2.1. BannedUserException
This exception is thrown when the IP Address is banned. The client shows the error message, and it will be pre-
vented to perform any action.
4.3.2.1. Parameters
4.3.2.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.2.2. Exceptions
4.3.2.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and trying the login again (if the user
used the private key, signing must be performed again with the new SID).
4.3.2.2.2. InvalidArgumentException
This exception is thrown when either the username or email address are registered, or when one or more parame-
ters are incorrect. It depends on the exception code:
00000F24: one or more invalid arguments (check error message for details). For example, both password
and public key set
00000F25: User already registered
00000F26: Email already registered
4.3.2.2.3. PermissionDeniedException
This exception is thrown if the current user is not Anonymous.
47
The client may invoke the GetUserInfo method and check if it returns a null value
Distributed under Creative Commons 2.5 BY-SA IT Page 81
FlashNuke: The Flash CMS
4.3.2.2.4. BannedUserException
This exception is thrown when the IP address of the current user is banned. The client shows the error message, and
the server logs the attempted operation.
The login method, other than the SID, also requires the username and the authentication code to perform the op-
eration. If it succeeds, the system updates the database with the new data about the current session, and returns a
IUser object containing the data of the currently logged in user. If the authentication fails, a LoginException is thrown
4.3.3.1. Parameters
4.3.3.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
In order to prevent eavesdropping attack, the password must never be transmitted in clear. Using SSL, as we said
many times, is the best option. But we also said that SSL is CPU-intensive and is not generally available within cheap
or free hosting services. The best option is to transmit the MD5 hash of the password (the encoding is done by the
client itself). The hash is then compared to the hashed password stored on the server, and login succeeds only if they
coincide. However, security analysts will highlight the weakness of this method to man-in-the-middle attacks, since
the MD5 hash doesn’t change with sessions. We won’t show another option that uses changing codes but is weak at
registration time. In future versions of FlashNuke, when not using SSL, we will consider encrypting the password with
a server key.
When using digital signature (which is the best login method), the code is set to the base64-encoded signed SID and
transmitted to the server. Signing the SID means using the private key to decrypt the SID itself. The result is encoded
in base64 format. The server decodes the base64 code and decrypts it using the stored public key. If the result coin-
cides with the SID the login succeeds.
Of course, the SID must be active and associated to the user’s IP Address. This grants the security of the authentica-
tion process.
4.3.3.2.2. LoginException
The LoginException is thrown when the login fails. Usually, login fails when username or password/signature are in-
correct. However, this exception can still be thrown in case of inconsistency: if the session corresponds to a logged in
user, he must first log out before logging in with other credentials. In this case, the exception code reveals the cause
of the error. Here are the codes:
This exception can’t actually be handled. An error message must be displayed and the user must try to log in again.
However, the presence of the AC code means there is a bug in the system. In this case, when the exception is thrown
the event must be logged in the Error Log.
4.3.3.2.3. BannedUserException
This exception is thrown when the user that tried logging in is banned. This usually happens when a banned user
tries to log in from a different computer. The client shows the error message, and the server logs the login attempt
while the IP Address is added to the banlist.
Actually, this exception should be thrown only after verifying user credentials in order to avoid problems with mis-
typing the username.
4.3.4.1. Parameters
4.3.4.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.4.2. Exceptions
4.3.4.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method. There is no need to log out again.
4.3.4.2.2. BannedUserException
This exception is thrown when the IP address of the current user is banned. The client shows the error message, and
the server logs the attempted operation.
This method works in Admin mode when the uid parameter is set. In this case, the modifications will be applied to
the target user. Else, the user is editing his own profile.
4.3.5.1. Parameters
4.3.5.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.5.2. Exceptions
4.3.5.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.5.2.2. BannedUserException
This exception is thrown when the IP address of the current user is banned. The client shows the error message, and
the server logs the attempted operation.
4.3.5.2.3. InvalidArgumentException
This exception is thrown when one or more parameters are invalid and can’t be saved. Parameter validity, such as
email address format [email protected] should be always verified client-side. However, in order to prevent at-
tacks by hacked clients, the server must re-check the validity of all the values inserted by the user.
4.3.5.2.4. PermissionDeniedException
This exception is thrown when a non-admin user tries to edit someone else’s profile (uid parameter set), or when the
current user is anonymous.
48
The user profile editing panel will also deal with profile/preferences of components using runtime-loaded panels. Then the re-
sults are encapsulated into the payload object. The server will use component call-backs to store new information
Distributed under Creative Commons 2.5 BY-SA IT Page 84
FlashNuke: The Flash CMS
word/signature. This method can be also used by an Administrator to delete someone else’s account. In this case,
the authentication is required for confirmation. The method deletes all the traces of the user from the system except
logs, and the action itself is logged in the System log.
4.3.6.1. Parameters
4.3.6.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.6.2. Exceptions
4.3.6.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.6.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.6.2.3. LoginException
This exception is thrown when the confirmation fails because of wrong password/signature.
4.3.6.2.4. PermissionDeniedException
This exception is thrown when a non-admin user tries to delete someone else’s account (uid parameter set), or when
the current user is anonymous.
4.3.7.1. Parameters
4.3.7.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.7.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.7.2.3. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
The return value is a dictionary where each key under the components key is a component and the value is the pay-
load to give that component. Other root keys for the object will be described in Client design, but we can enumerate
the theme and language keys, which obviously represent the current theme and language.
4.3.8.1. Parameters
4.3.8.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.8.2. Exceptions
4.3.8.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.8.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.8.2.3. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.8.2.4. NukeException
This generic exception, with code 00000FC3, reports that an error occurred during the process of loading the session
data. The exception should carry other information that can be useful to developers. This includes the case of a
wrong session code.
4.3.9.1. Parameters
4.3.9.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.9.2. Exceptions
4.3.9.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.9.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.9.2.3. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.9.2.4. NukeException
This generic exception, with code 00000FC4, reports that an error occurred during the process of saving the session
data. The exception should carry other information that can be useful to developers.
4.3.10.1. Parameters
4.3.10.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.10.2. Exceptions
4.3.10.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.10.2.3. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.10.2.4. NukeException
This generic exception, with code 00000FC5, reports that an error occurred during the process of deleting the ses-
sion data. The exception should carry other information that can be useful to developers. This includes the case of a
wrong session code.
4.3.11.1. Parameters
4.3.11.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.11.2. Exceptions
4.3.11.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.11.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.11.2.3. LoginException
This exception is thrown when the confirmation fails because of wrong password/signature.
4.3.11.2.4. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.12.1. Parameters
4.3.12.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.12.2. Exceptions
4.3.12.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.12.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.12.2.3. LoginException
This exception is thrown when the confirmation fails because of wrong password/signature.
4.3.12.2.4. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.13.1. Parameters
4.3.13.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.13.2.2. UserNotFoundException
This exception is thrown when the username is not found in the database.
4.3.13.2.3. PermissionDeniedException
This exception is thrown when the current session is actively logged in.
4.3.13.2.4. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.14.1. Parameters
4.3.14.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.14.2. Exceptions
4.3.14.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.14.2.2. UserNotFoundException
This exception is thrown when the username is not found in the database.
4.1.1.1.1. PermissionDeniedException
This exception is thrown when the current session is actively logged in.
4.3.14.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
This method returns the Group-ID (GID) of the newly created group.
4.3.15.1. Parameters
4.3.15.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.15.2. Exceptions
4.3.15.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.15.2.2. GroupException
This exception is thrown in case of an error creating the group. The reason depends on the code:
4.3.15.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.15.2.4. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.16.1. Parameters
4.3.16.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.16.2.2. GroupException
This exception is thrown in case of an error creating the group. The reason depends on the code:
4.3.16.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.17.1. Parameters
4.3.17.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.17.2. Exceptions
4.3.17.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.17.2.2. GroupException
This exception is thrown in case of an error creating the group. The reason depends on the code:
4.3.17.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
49
We are already assuming that a group will be identified by an integer inside the database
Distributed under Creative Commons 2.5 BY-SA IT Page 92
FlashNuke: The Flash CMS
4.3.18. DeleteGroup(sid: String, gname: String)
4.3.18.1. Parameters
4.3.18.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.18.2. Exceptions
4.3.18.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.18.2.2. GroupException
This exception is thrown in case of an error creating the group. The reason depends on the code:
4.3.18.2.3. PermissionDeniedException
This exception is thrown when the method is executed by an anonymous user.
4.3.18.2.4. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
As we have said when describing the system architecture, the system is based on the multi-level three-tier paradigm.
Each tier is multi-level. This method represents the lower level of communication. We have also required that multi-
ple requests from multiple components have to be handled within the same payload and in parallel. Both require-
ments are achieved with this routing method.
In order to better understand the power of this method, we will make an example.
The user is browsing the Forums and is writing a message to post. Before submitting, the user sees a fantastic-
looking image on the Lastest upload pictures block, and votes it with 5 stars. The development team of the block un-
derstood that voting a picture is not a real-time activity and programmed the block to queue rating requests. The
block calls FlashNuke Client’s methods to queue a server request (which won’t have a response message in this ex-
ample). Meanwhile, the Private Messages block wakes up and requests the server, still asynchronously, information
50
This exception is not thrown to User Administrators or higher
Distributed under Creative Commons 2.5 BY-SA IT Page 93
FlashNuke: The Flash CMS
about new private messages. FlashNuke queues the new request and waits for the 10 seconds needed to send asyn-
chronous requests.
Finally, and before that 10 seconds deadline, the user submits the new forum topic. That’s of course an event that
must be processed real-time. FlashNuke then packs all the pending requests into a single one, like the following:
[Forum Module] {
[Action] => Post new topic
[Forum] => “Off Topic” (ID 45)
[Subject] => Hey Dude!
[Body] => What‟s up guys? LOOOOOOOOOOOOOOOOL
}
[Pictures Block] {
[Action] => Rate picture
[Picture] => Maschio Angioino (ID 001647526)
[Rating] => 5
}
[PrivateMessages Block] {
[Action] Refresh
}
The server receives the payload and then forks the thread execution in multiple threads, one for each component.
Each component is executed with the part of the payload that belongs to it. For example, the PrivateMessages
server logic, running in a separate thread, will return something like the following:
[TotalMessages] 5
[Unread] 2
This, and the return parameters of other components, are packed in a new payload and returned to the client, which
was waiting for the server response with HTTP connection open. The response may look like the following:
[Forum Module] {
[Result] => OK
}
[Pictures Block] {
}
[PrivateMessages Block] {
[TotalMessages] 5
[Unread] 2
}
We may still spend some words about the final results of this transaction. The Forum module may display a pop-up
message saying that the new topic is being displayed on the board. Supposing that before the transaction the user
received a private message (there were 4 messages and 1 unread), the PM block may now highlight the number of
messages and show a flashing icon requesting user’s attention. When the user decides to read the new message, a
new request will be made using this technique to read the full message body.
Now that we have described the working of this method with a text example, it’s time to describe the structure of
the return parameter.
The return parameter is a dictionary. Each key represents a component. Values are considered as Object, and are
passed directly to the component indicated in the key, which will be responsible of decoding the data. Of course, the
real parameters must be XML-Serializable or XML-Serialized. It has no importance if the returning parameters has
the same dictionaries as the payload input parameter. The return parameter may carry components’ internal excep-
tions by simply having the exception as value (it is possible because every class, including Exception, inherits Object).
It is interesting to notice that this technique supports protocol obfuscation and/or cryptography techniques, by sim-
ply adding an encoding layer between the business logic and the raw data.
4.3.19.2. Exceptions
4.3.19.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.19.2.2. NukeException
This exception is thrown when a critical error makes processing impossible. Possible codes include most common
situations:
4.3.19.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
However, Web Services teach us that special encoding techniques may be applied to SOAP messages, including en-
cryption/decryption functions. However, neither this documentation nor the first release of FlashNuke will actually
protect the payload against sniffing.
The basic difference between these two methods is multi-component processing. The Admin components, which
may need higher levels of isolation, are not designed to run in multithread mode. Each request to Admin panel must
51
This exception is thrown even when the component is installed but requires higher privileges. Admin components are included
in this case
52
An appropriate value must be given to the InnerException property to help debuggers find the cause of the error
53
An Admin Component is a component made for the Administration panel, which is visible to Administrators only
Distributed under Creative Commons 2.5 BY-SA IT Page 95
FlashNuke: The Flash CMS
be served by a single component at once. Obviously, due to the UI design of the Admin panel, the user is supposed
to interact with a single component at once. Instead, in normal user exercise, multiple components (Blocks and
Modules54) may dispatch requests at the same time.
This basically changes one aspect of I/O parameters: they refer to a single object and not to a collection.
The return parameter, in fact, is a payload in Object format that has to be delivered as it is to the component that
requested processing. On server side, the component that dispatched the request and has to serve it is identified by
its canonical name, which is not part of the payload anymore.
Developers should be aware that the payload itself could be a dictionary. We do actually enforce the usage of dic-
tionaries because they are the most similar data type to XML markup.
4.3.20.1. Parameters
4.3.20.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.20.2. Exceptions
4.3.20.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.20.2.2. PermissionDeniedException
This exception is thrown the user is not logged in or is not an Administrator. This has nothing to do with user’s privi-
leges (see next exception, code 0xF05).
4.3.20.2.3. NukeException
The meaning of this exception depends on the code:
This exception is thrown even if the component is not an Admin component. The error message specifies the situa-
tion.
54
We are considering the opportunity to allow the execution of multiple Modules in tabbed view for next releases of FlashNuke
55
String and Byte[] are typical XML-Serialized classes
56
An appropriate value must be given to the InnerException property to help debuggers find the cause of the error
Distributed under Creative Commons 2.5 BY-SA IT Page 96
FlashNuke: The Flash CMS
This exception is thrown when the Admin tries to use a component which he’s not Admin of. We will deal with
Admin responsibilities when designing the database.
4.3.20.2.4. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
It has no input parameters and is not supposed to throw any exception. Its job is to read the configuration parame-
ters and website layout and send the data to the client in the form of a dictionary. Actually, not all configuration pa-
rameters should be available over a public protocol: some of them are internal to the server and it could be incon-
venient (not to say risky) to transmit them. We will deal with this when designing the server and optimizing the
processes.
4.3.21.1. Parameters
None
4.3.21.2. Exceptions
4.3.21.2.1. BannedUserException
This exception is thrown when the current IP address is banned. The client shows the error message, and the server
logs the attempted operation.
goofy
djgoofy
goofy78
Since the returning parameter is an array of String, detailed information must be retrieved using the GetUserInfo
method.
4.3.22.1. Parameters
4.3.22.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.22.2. Exceptions
4.3.22.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.22.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
It throws a NotFoundException exception if the specified user does not exist and the third parameter is set to true or
not specified. Else it returns a null value.
4.3.23.1. Parameters
4.3.23.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
This parameter is useful during sign up: since exception throwing is CPU intensive, because the runtime needs to
save the stack and the debug information, and we don’t need the exception to know if a username is already taken,
the client may set the parameter to false and check if a null value is returned before allowing the user to complete
the sign up process.
4.3.23.2. Exceptions
4.3.23.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
57
Like email address. Password and public key are always null
Distributed under Creative Commons 2.5 BY-SA IT Page 98
FlashNuke: The Flash CMS
4.3.23.2.2. NotFoundException
This exception is thrown when no user with the specified username exists and the OnErrorThrowException parame-
ter is set to false.
4.3.23.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.3.24.1. Parameters
4.3.24.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
4.3.24.2. Exceptions
4.3.24.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.24.2.2. NotFoundException
This exception is thrown when no user with the specified ID exists.
4.3.24.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
It must be noticed that, in order to let the error reporting work, exceptions must not propagate to Flash Player run-
time. This can be achieved by properly setting the onError event of Flex objects.
4.3.25.1. Parameters
4.3.25.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
In order to make this method work, the error object must be of a class that, more than inheriting from Exception,
implements the IXmlSerializable interface.
4.3.25.2. Exceptions
4.3.25.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.25.2.2. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
File upload through SOAP is proven to be feasible thanks to two Flex and Visual Studio tutorials.
The file size must not exceed server limits: file size should be checked client side.
4.3.26.1. Parameters
4.3.26.1.1. sid: String
This parameter represents the session ID for the current session. As we have defined it, the SID is a 40-characters al-
phanumerical case sensitive code. The session must be active (timeout not expired).
^[^/:*?"<>|\r\n]*$
4.3.26.2. Exceptions
4.3.26.2.1. SessionExpiredException
The SessionExpiredException is thrown if the session is expired. The session is not found within the database and it
must be renewed. The exception is handled by calling the GetewSID method and logging in before running the
method again.
4.3.26.2.2. NukeException
The exact meaning of this exception depends on the code:
4.3.26.2.3. BannedUserException
This exception is thrown when the current user or IP address is banned. The client shows the error message, and the
server logs the attempted operation.
4.4. WSDL
Not available (yet)
Client
GetInitData
IDictionary Obj
GetNewSID
ProcessRequest
Load PicGallery GetGalleries
SELECT galleries
ProcessRequest
Show gallery #14 GetPics
SELECT pictures
Recordset Object
ReadFiles
Login
CheckCredentials
IUser
Timeout
ProcessRequest
Upload Pic
SessionExpired
GetNewSID
Login
CheckCredentials
IUser
ProcessRequest
WriteFile
Status: OK Status: OK
It is important to understand that this is a high-level description of the software dynamics. We chose to not fall in
implementation details and generalized the DB and file system operations with these two objects. In .NET Frame-
work, running an SQL command is a complex procedure that involves more classes, and it gets even more compli-
cated when running in transactional environment.
The user first enters the website: this requires the client to be initialized –as we mentioned, this includes the default
language and theme settings- and so the client runs the GetInitData() method to obtain information.
Using those information, the client initializes itself and the default components to display. We won’t go into the de-
tails, since the client development has been made independent from the rest of the system.
The client then starts a new session by running the GetNewSID() method. This makes the server generate a new
unique58 SID and transmit it to the client while registering it into the database (we have supposed asynchronously).
The client is finally ready to accept user interactions. In this example, the user tries to load the PicGallery module.
This makes the client run the ProcessRequest() method with appropriate arguments to require the initialization of
the module. In this example, the module first shows a list of available picture galleries. Remind that the user is not
yet logged in, so we must suppose that this and the following operations are permitted to Anonymous Users.
The component queries59 the database for existing galleries and returns the list to the client.
The client then requires to browse the gallery ID 14. This, as expected, causes the execution of ProcessRequest()
method, which carries a “Browse gallery 14” command for the PicGallery component. This causes the component to
query the database for pictures inside that gallery, then read the files from the file system60.
The user, while looking at the fantastic image shown, decides to log in. This causes the client to execute the Login()
method (in this example, with success): the server returns an IUser object containing user data.
At this time, the user is amazed by the high-resolution images and stays hypnotized for a dozen of minutes looking at
the screen. This causes a session timeout. When the user finally realizes what happened to his mind, he finally tries
to upload a picture from his computer showing other people his ability as photographer. Unfortunately, when trying
to process the request, the server refuses the SID provided by the client and returns an exception.
Now the client has to re-establish the virtual connection with the server that was represented by the SID. First, it in-
vokes the GetNewSID() method again, then requires the user to log in again and invokes the Login() method once
more, and finally retries the execution of the ProcessRequest() method. Please notice that in this case we supposed
the picture gallery does not use the Upload method of the web service but uses it own one to manage uploads (i.e.
allowing to determine special information such as resolution, camera manufacturer, etc, or to generate a thumb-
nail).
58
Actually, in order to be sure that the SID is unique, a loop cycle must be implemented to search inside the database for exist-
ing SIDs. However, we didn’t highlight this in the example
59
Even if we required the execution of PL/SQL procedures for security reasons, it’s obvious that such procedures will result in a
combination of common SQL commands: SELECT, INSERT, UPDATE, DELETE
60
Remember that this is an example! There are a thousand of technical reasons that suggest the server to give the client only
the URL of pictures in a production environment, leaving the client itself the responsibility to load the pictures via HTTP
Distributed under Creative Commons 2.5 BY-SA IT Page 103
FlashNuke: The Flash CMS
The ProcessRequest() method gives the data to the component, which registers the new image into the database
and writes the file into the file system, returning an OK message to the client.
This document is made by three parts: in the first one, we will deal with the entities that compose the domain model
and the relationships between them in order to build an Entity-Relationship Diagram (E-R Diagram), which is the
theory at the base of any relational database; after building the E-R diagram, we will apply engineering techniques to
translate the E-R model into an optimal62 relational model; in the last part, which will be built together with the
server (since the requirements are not yet clear), we will define and then code the PL/SQL functions that will ma-
nipulate data.
We already defined as a requirement that FlashNuke must not access the data source directly except in Admin
mode. This requirement works as a firewall against SQL-Injection exploits. By strictly limiting the entry points of the
data source, we accomplish an important objective: we give breath to developers, who will be able to reduce the
impact of security tests in project budget.
However, the most important part of this document is the logic analysis and design. We will try to translate the E-R
model into a relational model, and we will deal with the problem of performance optimization by using caching
mechanisms. Web applications, in fact, need to be designed for maximum performance because largest websites
have thousands of visitors in a minute. In many cases, websites need to be distributed over more redundant servers.
Distributing the three tiers of FlashNuke is the first way to obtain additional performance, but the real work is done
on the server and on the database. Another important problem of large website is disk space: servers do not have
unlimited resources, and, most important, hosting services offer limited amounts of space. Using the minimum
quantity of disk space is another important objective to achieve.
Software engineering teaches us that the best way to achieve disk space objectives is using compression; and that
the best way to achieve performance objectives is using redundancy of data. Computer science teaches us that com-
pression reduces performance and redundancy reduces free disk space. It’s a problem of compromise.
61
In this case, as for all the three-tier systems, the client is what we called server. Literature explains this naming: we won’t
62
In software engineering, optimal refers to the best compromise between performance and size
Distributed under Creative Commons 2.5 BY-SA IT Page 104
FlashNuke: The Flash CMS
7.2. The importance of preventing SQL-Injections
Before continuing, let’s focus on the importance of preventing one of the most common attacks in three-tier sys-
tems, and particularly in web environment: SQL-Injections. SQL is the standard language for relational databases,
and has not been replaced by any other language yet. We will see how easy can be breaking the security of an SQL-
based website’s database. It is important to understand that SQL-Injection is not the only hacking technique that can
be applied against a website. A complete security analysis must be performed by expert analysts both on the docu-
mentation and on the code; however, the Injection vulnerability affects the majority of web application that are not
written with appropriate coding tricks.
SQL-Injections use the basic vulnerability of SQL language: being source. A source code may always be altered by ap-
propriate misuse of parameters, creating a brand new SQL statement that is executed with unpredictable results.
This affects test cases domain, and can be explained by an example.
SQL = “SELECT * FROM Admins WHERE username = „*username*‟ AND password = „*pass*‟;”;
The execution of the code depends on the number of resulting rows after the execution of the statement. In the
statement, the fields surrounded by stars (*) are replaced by local variables. A tester usually builds three domains for
testing:
This because the SQL interpreter is suppose to do the following: search for the matching username; if found, check
that the password matches for that username.63
As we said, the operations done by the SQL DBMS fully depend on the final SQL statement it will receive by the cli-
ent. Following the above example, if the username is goofy and the password is donald, the client will build the fol-
lowing statement:
We don’t care which domain this test is part of. We can observe that the static sequence of the compiled SQL code
follows what the DBMS is expected to do during a login.
„ OR 1 OR username = „
In order to understand what happens now, we need to build the final statement.
SELECT * FROM Admins WHERE username = „goofy‟ AND password = „„ OR 1 OR username = „‟;
This statement is a valid SQL statement (notice that we used quotes in the right place). The difference is in what the
interpreter does while evaluating the condition statement for each row: it checks for username matching goofy, then
63
Real working of a DBMS differs, but we don’t care in this example
Distributed under Creative Commons 2.5 BY-SA IT Page 105
FlashNuke: The Flash CMS
password matching donald for those who passed first check; it checks for the true condition for each row, which is
always verified, and then it checks for the empty username, which we assume is not verified. The result is the com-
bination of the three condition in OR, which is the full table! Since the code just checks if there is no result or more
results are returned, the login succeeds.
It is important to understand that the unwanted result is due to the complete change of the SQL statement’s static
sequence: instead of evaluating the AND of two conditions, the DBMS will evaluate true!
Compiled code and byte-code are not vulnerable to such attacks, because operations are not given by input but pre-
viously declared within the data source.
Component
+Name : String
+Version : String
+Visibility : AccessLevel
#Signature : DigitalSignature
+Logo : Image
+Load()
+Unload()
+Install()
+Uninstall()
1..* #CheckDigitalSignature() : DigitalSignature
#Administer()
SupremeAdministrator
#ChangeConfiguration()
#ViewLog() : SystemLog
#ManageComponents()
SystemError
-Component : Component
-TechnicalInfo
+Report()
The above picture is a simplified version of the class diagram, from which we will build the E-R Diagram. Basically,
singleton classes have been removed: we will implement them during logic DB design.
File
Uploaded Session
Owns
Download
Allowed
Running
User
Partial Admin
Creates
Administers Administrator
Belongs
Component
Module
Group
Creates
Since users have to be activated when they sign up, and we didn’t show the difference between an active and an in-
active user in the diagram, we are going to implement part of the email confirmation system in the user table. Each
user is associated a Boolean flag that allows logging in if true, and an activation key, which is a 40-characters string,
which must be provided to the system in order to confirm the validity of the email address.
Now let’s go to the sessions. As we mentioned, the session may be temporary or persistent. We are using sessions to
basically provide user tracking64 and identification, but we also want Registered Users to save a work session: for ex-
ample, a user may start writing a message in the Forums, but needs to leave and wants to resume later. The exact
view state, complete with the message draft, is saved into system’s permanent memory and loaded later. However,
we now notice that saving and loading sessions is quite different from using a SID to track and identify a client. So we
are going to separate the two kinds of sessions. More, since the payload of the saved sessions, which is basically raw
data that components use to save and restore their view state, is something that isn’t interesting for database pur-
poses. So we are going to write the payload into files stored in server’s file system and keep only basic information in
the database.
Because of this, we are going to create two separate tables: one for active sessions, and one for saved sessions. The
saved sessions table contains just the session ID, a reference to the user that saved it, and a timestamp indicating
when the session was saved. The server will have to properly save payload into files.
As an example of the analysis technique, we will show only three tables in this release of the document. All others
will come later
64
Tracking activities should always be noticed in a privacy statement
Distributed under Creative Commons 2.5 BY-SA IT Page 109
FlashNuke: The Flash CMS
partialadmin: BOOLEAN
7.5.1.4. Triggers
None
7.5.1.5. Constraints
pubkey and password must not be NULL together
pubkey and password must not be NOT NULL together
If admin is TRUE, then partialadmin must be TRUE
username is UNIQUE and NOT NULL
email is UNIQUE and NOT NULL
lastip and lasthost must refer to the same remote host
7.5.2.4. Triggers
Delete rows where last_action is early than X minutes ago, where X is a parameter set by the webmaster
7.5.2.5. Constraints
ip and hostname must refer to the same remote host
7.5.3.4. Triggers
None
7.5.3.5. Constraints
None
8. Accessible Version
Exception ex = new NotYetImplementedException() extending NotImplementedException;
ex.message = “This feature has not been implemented YET. Work in progress”;
throw ex;
Files:
Default.mxml: contains the source code for the layout demo. Import it in a new or existing Flex project, or
compile it with the stand-alone compiler
The working of the prototype is simple: the user has to load Parent.html from the bin directory using a browser that
supports Adobe Flash Player, or Parent.swf from the stand-alone version of Adobe Flash Player. After the parent has
completed loading, the user has to hit the First load the child button. The parent control will load the child as an ex-
ternal control and display it below the horizontal line. When the child is loaded, the application is ready to work.
There is a text box and two buttons for each control. The user may write on any text box and perform the following
four actions:
Tell child or Ask parent: the child will display the text written in the parent’s textbox in its one
Ask child or Tell parent: the parent will display the text written in the child’s textbox in its one
For example, let’s write “Hello World” in the parent’s textbox, and then hit Ask Parent. “Hello World” will be dis-
played in child’s textbox.
The name of the control to load is defined within a function. This makes us think that the name can be really be set
at runtime and be totally unknown when compiling.
This prototype has been developed using Adobe Flex 2.0 under Windows Vista x64, and tested using Internet Ex-
plorer 7.0 and Mozilla Firefox 2.0.0.3 with Adobe Flash Player 9.
We used the mx.core.SWFLoader class to load the child control: SWFLoader documentation is poor, so we had to re-
verse-engineer its dynamics analyzing the source code from SWFLoader.as, included in Flex SDK. Loading a movie is
completely asynchronous. SWFLoader uses FlexLoader, a class inheriting from Loader, to load a movie. The Loader
class is the key to understand the working of the SWFLoader, but it’s internal to Flash runtime and there’s no code
for it. By reverse-engineering SWFLoader, we reached to generate a working procedure to obtain the pointer to the
object that is loaded (the SWFLoader itself is not useful).
It is important to understand that the above procedure must be respected. Running the load method and then trying
to extract the application property won’t work. Even waiting for the complete event and then trying to get the
pointer won’t work. Both events must be raised by the SWFLoader. Also, the content property must be converted to
SystemManager, or nothing will work.
The two classes implement the Observer pattern. The parent loads the child and stores its pointer in an internal
property. After loading, the parent invokes a RegisterParent method on the child passing the pointer to itself: this
12.3.2. Conclusions
This prototype proves the feasibility of RN002. However, the user will notice that displaying of the child control is not
optimal (it goes off screen). We’ll have to work solve this problem, that may have been caused by the SWFLoader.
More, in this example we have been unable to implement the IChild interface due to MXML limitations. Using inter-
faces is crucial when developing FlashNuke.
We should try to make a new prototype, written in ActionScript 3.0, maybe adding some other interesting technical
features. For example, we could avoid to display the SWFLoader on the GUI (it’s transparent, but the control in-
stanced on the UI is not the target movie itself), or even trying to manage multiple components.
The classic method used to prove one’s identity to a software system is the password. The password is usually a
string that may contain only numbers, numbers and letters or all the characters that can be displayed on-screen.
Some password are case sensitive (AqUA is different from aQUA) and other are case insensitive (no matter how you
write it, just type the letters A, Q, U and A). Passwords can be user-chosen or system-generated. In almost 90% of
cases, a user-chosen password is something so easy to remember that anyone that knows the person enough may
try to guess the password (for example, the name of the mother), or else it’s enough easy to guess it by carefully
watching at the keys pressed by the user during typing. A system-generated password is so hard to remember that
almost every user writes it down onto a post-it that is left attached to a prominent place like the computer’s screen
so what was thought to be kept secret becomes public and everyone can get access to the system.
Another problem with password is eavesdropping over the Internet. A password is a string that is generally transmit-
ted clearly over the network. Anyone having appropriate tools (such as the Wireshark (31) network analyzer) can
sniff over the connection and grab anyone’s password with some luck. A good way to implement a secure authenti-
cation protocol is using cryptography, but it’s not an everyday possibility in web environment, since it requires a high
server load even to process non-critical data.
During the last years, research has put all its efforts in finding an authentication method that cannot be sniffed or in-
tercepted. Researchers quickly understood that the only way was to find a way to make the string that is transmitted
over the network valid only for a single login session without changing the password at every login. All the protocols
based on this technique can be called Challenge Handshake (avoid confusion with the CHAP protocol, that is based
on the same principles). The server challenges the client to prove the user identity using a handshake protocol that
works like the following:
1. The server sends a security code that is valid only for one session
2. The client uses the password and the security code to obtain a verification code and then sends it to the
server
The password is never transmitted, and neither encrypted (because cryptography needs the negotiation of a key,
which is not always possible in public environments).
In order to merge the complexity of a very long password and the security of a challenge handshake protocol, digital
signature can be used to authenticate users65.
A private key, that is owned only by the legitimate owner of the signature, and is used to sign documents
A public key, that everyone can use to verify that a certain document has been signed by the person that
claims to have signed it
A certificate, that may be used to prove the real identity of a person or determine his trust level
FlashNuke doesn’t care about certificates. However, it must be noticed that if a user owns a certified digital signa-
ture associated to his email address, there may be no need to perform the address verification. However, this re-
quires more complexity in FlashNuke design, so we won’t consider this opportunity, even because too few people
have a certified digital signature: this makes the effort not proportioned to the effective gain.
It has no importance if somebody sniffs a public key over a connection. The public key, in fact, is meant to be publicly
distributed. It has no sense to place sniffing sensors on a megaphone.
A web authentication system, such as FlashNuke, can store the public key and ask the user that wants to authenti-
cate to use his private key to prove his identity.
When the user registers, he can generate a new private key or use an existing one as signature. He then generates
the public key and transmits it to the server, which will store it in its database.
When the user wants to log in, the server generates a random and long number (digital signature is a numerical algo-
rithm) and transmits it to the client. The client then uses the private key to generate another number, for example
using the RSA decryption formula, which is the signature of the security code received before. The server then ap-
plies the inverse function, for example the RSA encryption formula, to the signature using the public key and verifies
that the result matches the security code.
The codes that are transmitted over the network are valid only within a single login session. The complexity of the
codes and the length of the signature do only enforce the system, but don’t make it invulnerable to long-term at-
tacks.
Recent web browsers do have support for generating a digital signature and signing data. However, it must be no-
ticed that a signature must always be protected by a password or a PIN. That password, obviously, doesn’t exit from
the device where it’s used in.
More information can be found on Wikipedia (32) or googling for digital signature.
65
In many countries, digital signature is legally recognized as a proof of identity for the user that signs a document. There’s no
reason to doubt of its efficiency in network authentication environments
Distributed under Creative Commons 2.5 BY-SA IT Page 114
FlashNuke: The Flash CMS
14. Exception reference
14.1. Client
14.2. Accessible
14.3. Server
15. ToDos
15.1. Make prototype for RI002, maybe fetching the PopUpManager example
15.2. Research for a standard skinning format
66
This exception is thrown even when the component is installed but requires higher privileges. Admin components are included
in this case
67
An appropriate value must be given to the InnerException property to help debuggers find the cause of the error
Distributed under Creative Commons 2.5 BY-SA IT Page 115