How Securing Web Access LightArmy

LightArmy has default web access allowing access only to the root and 'Public' folder. And all other folders inside root are blocked for access using .htaccess. If you using apache web server you may not need to do anythings, your web structure has been secured.

For another please configure as above mention: giving access only to the root and 'Public' folder and you must block another folders.

Security Code Auto Registration

Security Code Auto Registration is a way to register your application automatically for authorization. Administrator is the only user granted for access at this auto registration.

Using this feature, you will not must entered manually to database to configure user access right to application. LightArmy first will create a unique or supplied identity for your application and register it to LightArmy registry.

Now, you can configure user access right using web-based applications provided. LightArmy provides you two ways of: you can configure per user (user-based) or you can configure per application (application-based).

If you think to whom users application will be given access, you use application-based. If you thing what accesses you will give to a user, you use user-based.

User-based access right management:


Application-based access right management:


Analogy:
You place your file on operating system (i.e. Linux, Windows , etc) at any folder and then you can configure access right of that application.

Note:
You can create hierarchy of security code as you wish as you create file system hierarchy.

How to cache your page?

You create your page as any other pages. To cache your page, you just only add an attribute 'Cache' with value of 'true' for page xml element of your page configuration (*.pageconf file). For more custom cache, utilize two other attributes: CacheLifetime, and CacheKeys.

CacheLifetime attribute defines for how long time (in minutes), page cache is valid. CacheKeys attribute defines in what parameters (key), separate cache will be made for the same page. As for example, you have page to deliver user information that not change for a user but different from user to user, you can use user id for CacheKeys.

Here is for your example:



<?xml version="1.0" encoding="UTF-8"?>
<page name="HelpFile" id="HelpFile" Cache="true" CacheLifetime="0" CacheKeys="fn::GetParam('context_id')" >
<processor PageSecurityCode="Page|HelpFile" HelpContext="LIGHTARMY-Applications.HelpFile"
sOnlyTemplateFileName="HelpFile.html" CanPublic="true" Authenticate="false"
ValidateSystemConfiguration="false" >

<PageSecurityCode>
<Name>Help File</Name>
<Description></Description>
<HelpContext>LIGHTARMY-Applications.HelpFile</HelpContext>
</PageSecurityCode>

<TemplateProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Show();
]]></TemplateProcessingScript>

<ResponseProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Print();
]]></ResponseProcessingScript>

<IncludeFile>PageClass/HelpFile.php</IncludeFile>

</processor>
</page>

How to use dynamic value inside page configuration?

You can assign dynamic value to any parameters inside page configuration (*.pageconf file). You define your dynamic value using prefix 'fn::' for parameter value. As for example: fn::GetParam('context_id'). Any statement after prefix must can be evaluated and resulting a simple value.

Here is for your example:



<?xml version="1.0" encoding="UTF-8"?>
<page name="HelpFile" id="HelpFile" Cache="true" CacheLifetime="0" CacheKeys="fn::GetParam('context_id')" >
<processor PageSecurityCode="Page|HelpFile" HelpContext="LIGHTARMY-Applications.HelpFile"
sOnlyTemplateFileName="HelpFile.html" CanPublic="true" Authenticate="false"
ValidateSystemConfiguration="false" >

<PageSecurityCode>
<Name>Help File</Name>
<Description></Description>
<HelpContext>LIGHTARMY-Applications.HelpFile</HelpContext>
</PageSecurityCode>

<TemplateProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Show();
]]></TemplateProcessingScript>

<ResponseProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Print();
]]></ResponseProcessingScript>

<IncludeFile>PageClass/HelpFile.php</IncludeFile>

</processor>
</page>

How to create static page?

You create your page as any other pages. To change your page as static page, you just only add an attribute 'Static' with value of 'true' for page xml element of your page configuration (*.pageconf file).

If you want to use parameter for your static page, you can utilize cache inside page configuration. There are some attributes related to cached page: Cache, CacheLifetime, and CacheKeys.

Here is for your example:



<?xml version="1.0" encoding="UTF-8"?>
<page name="HelpFile" id="HelpFile" Cache="true" CacheLifetime="0" CacheKeys="fn::GetParam('context_id')" >
<processor PageSecurityCode="Page|HelpFile" HelpContext="LIGHTARMY-Applications.HelpFile"
sOnlyTemplateFileName="HelpFile.html" CanPublic="true" Authenticate="false"
ValidateSystemConfiguration="false" >

<PageSecurityCode>
<Name>Help File</Name>
<Description></Description>
<HelpContext>LIGHTARMY-Applications.HelpFile</HelpContext>
</PageSecurityCode>

<TemplateProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Show();
]]></TemplateProcessingScript>

<ResponseProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Print();
]]></ResponseProcessingScript>

<IncludeFile>PageClass/HelpFile.php</IncludeFile>

</processor>
</page>

How to link help context-sensitive with application?

You do link help context-sensitive with application inside of its configuration (*.pageconf file). Inside 'page' xml root will present a 'processor' xml element. For static security code, you define a HelpContext attribute to do. Other, you create HelpContext element inside PageSecurityCode element under 'processor' xml element.

See below for your example:



<?xml version="1.0" encoding="UTF-8"?>
<page name="NestMaint" id="NestMaint" >
<processor PageSecurityCode="Page|NestMaint" HelpContext="LIGHTARMY-Applications.NestConfig" sOnlyTemplateFileName="NestMaint.html" CanPublic="false">

<PageSecurityCode>
<Name>Nest Maintenance</Name>
<Description></Description>
<HelpContext>LIGHTARMY-Applications.NestConfig</HelpContext>
</PageSecurityCode>

<PageActionSelectionScript><![CDATA[
switch ((string)GetCurrentPageConfig('sForm')) {
case 'NestMaint':
CIISONLINE_NestMaint::NestMaintAction(GetCurrentPageConfig('sAction'));
}
]]></PageActionSelectionScript>
<TemplateProcessingScript><![CDATA[
CIISONLINE_Header::Menu_Show();
CIISONLINE_Footer::FooterForm_Show();
CIISONLINE_NestMaint::MenuPath_Show();
CIISONLINE_NestMaint::NestMaint_Show();
]]></TemplateProcessingScript>
<ResponseProcessingScript><![CDATA[
ResponseWrite (PrintVar('main'));
]]></ResponseProcessingScript>
<IncludeFile>PageClass/Header.php</IncludeFile>
<IncludeFile>PageClass/Footer.php</IncludeFile>
<IncludeFile>PageClass/NestMaint.php</IncludeFile>

<TemplateSpaceHolder name="Header">Header.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Footer">Footer.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space01">Space01.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space02">Space02.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space03">Space03.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space04">Space04.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space05">Space05.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space06">Space06.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space07">Space07.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space08">Space08.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space09">Space09.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space10">Space10.html</TemplateSpaceHolder>

</processor>
</page>

How to use Remote Queue?

First you need to define a queue box with the type of Remote. Fill the queue server uri, username and password.

Now you can access queue as any other type of queue and completely transparent. You can put message, get message, delete message, and list messages using common way.

Here is an example of queue configuration using remote queue:



<?xml version="1.0" encoding="UTF-8"?>
<configuration id="administration">
<section name="queue">
<config name="boxes">
<config name="subscriber">
<config name="buffer">
<config name="storage">
<config name="type">FileSystem</config>
<config name="directory">buffer</config>
</config>
</config>
<config name="handled">
<config name="storage">
<config name="type">FileSystem</config>
<config name="directory">handled</config>
</config>
</config>


<config name="storage">
<config name="type">Remote</config>
<config name="authkeyfilter">CIISONLINE_FEP_STREAMWRAPPER::AuthKeyFilter</config>
<config name="server">http://localhost/knowledge/Queue.php</config>
<config name="user">steve</config>
<config name="password">password</config>
<config name="secure">1</config>
</config>
</config>
</config>
</section>
</configuration>

CommentLuv Enabled

Followers