Initial Commit of AgileBill Open Source
This commit is contained in:
81
themes/default/blocks/htaccess/add.tpl
Normal file
81
themes/default/blocks/htaccess/add.tpl
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
|
||||
<!-- Display the form validation -->
|
||||
{if $form_validation}
|
||||
{ $block->display("core:alert_fields") }
|
||||
{/if}
|
||||
|
||||
<!-- Display the form to collect the input values -->
|
||||
<form id="htaccess_add" name="htaccess_add" method="post" action="">
|
||||
|
||||
<table width=100% border="0" cellspacing="0" cellpadding="0" class="table_background">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr valign="top">
|
||||
<td width="65%" class="table_heading">
|
||||
<center>
|
||||
{translate module=htaccess}title_add{/translate}
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="65%" class="row1">
|
||||
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_name
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
<input type="text" name="htaccess_name" value="{$VAR.htaccess_name}" {if $htaccess_name == true}class="form_field_error"{/if}>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_description
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
<textarea name="htaccess_description" cols="40" rows="5" {if $htaccess_description == true}class="form_field_error"{/if}>{$VAR.htaccess_description}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_status
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
{ $list->bool("htaccess_status", $VAR.htaccess_status, "form_menu") }
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_group_avail
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
{ $list->select_groups($VAR.htaccess_group_avail,"htaccess_group_avail","form_field","10","") }
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%"></td>
|
||||
<td width="65%">
|
||||
<input type="submit" name="Submit" value="{translate}submit{/translate}" class="form_button">
|
||||
<input type="hidden" name="_page" value="htaccess_dir:add">
|
||||
<input type="hidden" name="_page_current" value="htaccess:add">
|
||||
<input type="hidden" name="do[]" value="htaccess:add">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
38
themes/default/blocks/htaccess/htaccess.tpl
Normal file
38
themes/default/blocks/htaccess/htaccess.tpl
Normal file
@@ -0,0 +1,38 @@
|
||||
<table width="200" border="0" cellspacing="0" cellpadding="0" class="body">
|
||||
<tr>
|
||||
<td valign="top" align="center" width="35%">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
|
||||
<form name="form1" method="post" action="">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr valign="top">
|
||||
<td width="65%" class="table_heading">
|
||||
<div align="center">
|
||||
{translate module=htaccess}
|
||||
downloads
|
||||
{/translate}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="65%" class="row1">
|
||||
<center>
|
||||
<iframe name="htaccess" id="htaccess" style="border:0px; width:200px; height:100px;" scrolling="auto" ALLOWTRANSPARENCY="true" frameborder="0" SRC="?_page=htaccess:list&_escape=1"></iframe>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
27
themes/default/blocks/htaccess/list.tpl
Normal file
27
themes/default/blocks/htaccess/list.tpl
Normal file
@@ -0,0 +1,27 @@
|
||||
{ $method->exe("htaccess","list_dirs")}
|
||||
{ if ($method->result == FALSE) }
|
||||
{ $block->display("core:method_error") }
|
||||
{/if}
|
||||
{if $htaccess_display == true}
|
||||
{popup_init src="$SSL_URL/includes/overlib/overlib.js"}
|
||||
{foreach from=$htaccess_results item=record}
|
||||
<table width="90%" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
|
||||
{assign var="desc" value=$record.description}
|
||||
{if $desc == ''}{assign var="desc" value="No description available"}{/if}
|
||||
<a href="{$record.url}" target="_blank" {popup capcolor="ffffff" textcolor="333333" bgcolor="506DC7" fgcolor="FFFFFF" width="170" caption="Description" text="$desc" snapx=1 snapy=1 sticky=1}>
|
||||
<u>{$record.name}
|
||||
</u></a>
|
||||
</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
{/foreach}
|
||||
{else}
|
||||
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
|
||||
{translate module=htaccess}
|
||||
none_authorized
|
||||
{/translate}
|
||||
</font>
|
||||
{/if}
|
107
themes/default/blocks/htaccess/search_show.tpl
Normal file
107
themes/default/blocks/htaccess/search_show.tpl
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
|
||||
{$method->exe("htaccess","search_show")}
|
||||
{if ($method->result == FALSE)}
|
||||
{$block->display("core:method_error")}
|
||||
{else}
|
||||
{if $results == 1}
|
||||
{translate results=$results}search_result_count{/translate}
|
||||
{else}
|
||||
{translate results=$results}search_results_count{/translate}
|
||||
{/if}
|
||||
<BR>
|
||||
|
||||
|
||||
{literal}
|
||||
<script language="JavaScript">
|
||||
<!-- START
|
||||
var module = 'htaccess';
|
||||
{/literal}
|
||||
{if $VAR._print == TRUE}
|
||||
var p = '&_escape=y&_print=y';
|
||||
{else}
|
||||
var p = '';
|
||||
{/if}{literal}
|
||||
var IMAGE = '{/literal}{$NONSSL_IMAGE}{literal}';
|
||||
var order = '{/literal}{$order}{literal}';
|
||||
var sort1 = '{/literal}{$sort}{literal}';
|
||||
var search_id = '{/literal}{$search_id}{literal}';
|
||||
var page = {/literal}{$page}{literal};
|
||||
var pages = '{/literal}{$pages}{literal}';
|
||||
var results = '{/literal}{$results}{literal}';
|
||||
var limit = '{/literal}{$limit}{literal}';
|
||||
record_arr = new Array ({/literal}{$limit}{literal});
|
||||
var i = 0;
|
||||
// END -->
|
||||
</script>
|
||||
<SCRIPT SRC="themes/{/literal}{$THEME_NAME}{literal}/search.js"></SCRIPT>
|
||||
{/literal}
|
||||
|
||||
<!-- SHOW THE SEARCH NAVIGATION MENU -->
|
||||
<center><script language="JavaScript">document.write(search_nav_top());</script></center>
|
||||
|
||||
<!-- BEGIN THE RESULTS CONTENT AREA -->
|
||||
<div id="search_results" onKeyPress="key_handler(event);">
|
||||
<table id="main1" width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
|
||||
<form id="form1" name="form1" method="post" action="">
|
||||
<tr>
|
||||
<td>
|
||||
<table id="main2" width="100%" border="0" cellspacing="1" cellpadding="2">
|
||||
|
||||
|
||||
<!-- DISPLAY THE SEARCH HEADING -->
|
||||
<tr valign="middle" align="center" class="table_heading">
|
||||
<td width="44" class="table_heading"> </td>
|
||||
<td width="892" class="table_heading">
|
||||
{literal}
|
||||
<script language="JavaScript">
|
||||
document.write(search_heading('{/literal}{translate module=htaccess}field_name{/translate}{literal}','name'));
|
||||
</script>
|
||||
{/literal}
|
||||
</td>
|
||||
<td width="47" class="table_heading"> </td>
|
||||
<!-- LOOP THROUGH EACH RECORD -->
|
||||
{foreach from=$htaccess item=record}
|
||||
<tr id="row{$record.id}" onClick="row_sel('{$record.id}',1);" onDblClick="window.location='?_page=htaccess:view&id={$record.id},';" onMouseOver="row_mouseover('{$record.id}', 'row_mouse_over_select', 'row_mouse_over');" onMouseOut="row_mouseout('{$record.id}', '{$record._C}', 'row_select');" class="{$record._C}">
|
||||
|
||||
<td align="center" width="44">
|
||||
<input type="checkbox" name="record{$record.id}" value="{$record.id}" onClick="row_sel('{$record.id}',1,'{$record._C}');">
|
||||
</td>
|
||||
|
||||
<td width="892">
|
||||
{$record.name}
|
||||
</td>
|
||||
|
||||
<td width="47">
|
||||
{if $record.status == "1"}
|
||||
<img src="themes/{$THEME_NAME}/images/icons/go_16.gif" border="0" width="16" height="16">
|
||||
{else}
|
||||
<img src="themes/{$THEME_NAME}/images/icons/stop_16.gif" border="0" width="16" height="16">
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
{literal}
|
||||
<script language="JavaScript">row_sel('{/literal}{$record.id}{literal}', 0, '{/literal}{$record._C}{literal}'); record_arr[i] = '{/literal}{$record.id}{literal}'; i++; </script>
|
||||
{/literal}
|
||||
{/foreach}
|
||||
<!-- END OF RESULT LOOP -->
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
{if $VAR._print != TRUE}<br>
|
||||
<center>
|
||||
<input type="submit" name="Submit" value="{translate}view_edit{/translate}" onClick="mass_do('', module+':view', limit, module);" class="form_button">
|
||||
<input type="submit" name="Submit" value="{translate}delete{/translate}" onClick="mass_do('delete', module+':search_show&search_id={$search_id}&page={$page}&order_by={$order}&{$sort}', limit, module);" class="form_button">
|
||||
<input type="submit" name="Submit" value="{translate}select_all{/translate}" onClick="all_select(record_arr);" class="form_button">
|
||||
<input type="submit" name="Submit" value="{translate}deselect_all{/translate}" onClick="all_deselect(record_arr);" class="form_button">
|
||||
<input type="submit" name="Submit" value="{translate}range_select{/translate}" onClick="all_range_select(record_arr,limit);" class="form_button">
|
||||
<br>
|
||||
</center>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
223
themes/default/blocks/htaccess/view.tpl
Normal file
223
themes/default/blocks/htaccess/view.tpl
Normal file
@@ -0,0 +1,223 @@
|
||||
|
||||
{ $method->exe("htaccess","view") } { if ($method->result == FALSE) } { $block->display("core:method_error") } {else}
|
||||
|
||||
{literal}
|
||||
<script src="themes/{/literal}{$THEME_NAME}{literal}/view.js"></script>
|
||||
<script language="JavaScript">
|
||||
var module = 'htaccess';
|
||||
var locations = '{/literal}{$VAR.module_id}{literal}';
|
||||
var id = '{/literal}{$VAR.id}{literal}';
|
||||
var ids = '{/literal}{$VAR.ids}{literal}';
|
||||
var array_id = id.split(",");
|
||||
var array_ids = ids.split(",");
|
||||
var num=0;
|
||||
if(array_id.length > 2) {
|
||||
document.location = '?_page='+module+':view&id='+array_id[0]+'&ids='+id;
|
||||
}else if (array_ids.length > 2) {
|
||||
document.write(view_nav_top(array_ids,id,ids));
|
||||
}
|
||||
|
||||
function delete_record(id,ids)
|
||||
{
|
||||
temp = window.confirm("{/literal}{translate}alert_delete{/translate}{literal}");
|
||||
if(temp == false) return;
|
||||
|
||||
var replace_id = id + ",";
|
||||
ids = ids.replace(replace_id, '');
|
||||
if(ids == '') {
|
||||
var url = '?_page=core:search&module=' + module + '&do[]=' + module + ':delete&delete_id=' + id + COOKIE_URL;
|
||||
window.location = url;
|
||||
return;
|
||||
} else {
|
||||
var page = 'view&id=' +ids;
|
||||
}
|
||||
|
||||
var doit = 'delete';
|
||||
var url = '?_page='+ module +':'+ page +'&do[]=' + module + ':' + doit + '&delete_id=' + id + COOKIE_URL;
|
||||
window.location = url;
|
||||
}
|
||||
// END -->
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
<!-- Loop through each record -->
|
||||
{foreach from=$htaccess item=htaccess} <a name="{$htaccess.id}"></a>
|
||||
|
||||
<!-- Display the field validation -->
|
||||
{if $form_validation}
|
||||
{ $block->display("core:alert_fields") }
|
||||
{/if}
|
||||
|
||||
<!-- Display each record -->
|
||||
<form name="htaccess_view" method="post" action="">
|
||||
|
||||
<table width=100% border="0" cellspacing="0" cellpadding="0" class="table_background">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr valign="top">
|
||||
<td width="65%" class="table_heading">
|
||||
<center>
|
||||
{translate module=htaccess}
|
||||
title_view
|
||||
{/translate}
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="65%" class="row1">
|
||||
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_name
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
<input type="text" name="htaccess_name" value="{$htaccess.name}" size="32">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_description
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
<textarea name="htaccess_description" cols="40" rows="5" >{$htaccess.description}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_status
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
{ $list->bool("htaccess_status", $htaccess.status, "form_menu") }
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="35%">
|
||||
{translate module=htaccess}
|
||||
field_group_avail
|
||||
{/translate}
|
||||
</td>
|
||||
<td width="65%">
|
||||
{ $list->select_groups($htaccess.group_avail,"htaccess_group_avail","form_field","10","") }
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1" valign="middle" align="left">
|
||||
<td width="35%"></td>
|
||||
<td width="65%">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="submit" name="Submit" value="{translate}submit{/translate}" class="form_button">
|
||||
</td>
|
||||
<td align="right">
|
||||
<input type="button" name="delete" value="{translate}delete{/translate}" class="form_button" onClick="delete_record('{$htaccess.id}','{$VAR.id}');">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="65%" class="row1">
|
||||
<table width="100%" border="0" cellpadding="3" class="row1">
|
||||
<tr>
|
||||
<td><a href="?_page=core:search&module=htaccess_dir&htaccess_dir_htaccess_id={$htaccess.id}">
|
||||
{translate module=htaccess}
|
||||
view_all
|
||||
{/translate}
|
||||
</a></td>
|
||||
<td>
|
||||
<div align="right"><a href="?_page=htaccess_dir:add&id={$htaccess.id}">
|
||||
{translate module=htaccess}
|
||||
add_directory
|
||||
{/translate}
|
||||
</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="65%" class="row1">
|
||||
<table width="100%" border="0" cellpadding="3" class="row1">
|
||||
<tr>
|
||||
<td>
|
||||
<div align="center"><a href="?_page=core:search&module=htaccess_dir&htaccess_htaccess_id={$htaccess.id}">
|
||||
</a>
|
||||
<textarea name="textarea" cols="80" rows="8" ><?php
|
||||
#### START COOKIE AUTHENTICATION: ####
|
||||
define('_RETURN_URL', 'URL of page this code is inserted into...');
|
||||
define('_HTACCESS_ID', '{$htaccess.id}');
|
||||
require_once('{$smarty.const.PATH_AGILE}cookie.index.php');
|
||||
error_reporting(0);
|
||||
#### END COOKIE AUTHENTICATION ####
|
||||
?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div align="center">
|
||||
<textarea name="textarea2" cols="80" rows="4" >{literal}{group id={/literal}{$htaccess.id}{literal} msg="Sorry, you are not authorized for this area"}
|
||||
Your html, javascript, images, etc., are placed here for protection within the smarty templates...
|
||||
{/group}{/literal}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
{$list->unserial($htaccess.group_avail, "groups")}
|
||||
{assign var="idx" value=0}
|
||||
<textarea name="textarea4" cols="80" rows="6" ># .htaccess for local/remote Apache servers with mod_auth_mysql enabled
|
||||
AuthName "{$htaccess.name}"
|
||||
AuthType Basic
|
||||
require group 1
|
||||
AuthMySQLHost {$smarty.const.AGILE_DB_HOST}
|
||||
AuthMySQLDB {$smarty.const.AGILE_DB_DATABASE}
|
||||
AuthMySQLUser {$smarty.const.AGILE_DB_USERNAME}
|
||||
AuthMySQLPassword ********
|
||||
AuthMySQLUserTable "{$smarty.const.AGILE_DB_PREFIX}account as A,{$smarty.const.AGILE_DB_PREFIX}account_group as B"
|
||||
AuthMySQLNameField username
|
||||
AuthMySQLPasswordField password
|
||||
AuthMySQLGroupField status
|
||||
AuthMySQLMD5Passwords On
|
||||
AuthMySQLNoPasswd Off
|
||||
AuthMySQLUserCondition "( A.date_expire > UNIX_TIMESTAMP(NOW()) OR A.date_expire <= 0 OR A.date_expire IS NULL ) AND B.account_id = A.id AND ({foreach from=$groups item=arrgr}{if $idx != 0}OR {else}{assign var="idx" value=1}{/if}B.group_id = {$arrgr} {/foreach})"
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<textarea name="textarea3" cols="80" rows="6" ># .htaccess for local/remote Apache servers with mod_auth_remote enabled
|
||||
AuthType Basic
|
||||
AuthName {$htaccess.name}
|
||||
AuthRemoteServer yourdomain.com
|
||||
AuthRemotePort 80
|
||||
AuthRemoteURL /agilebill/includes/files/htaccess_{$htaccess.id}/
|
||||
require valid-user
|
||||
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="_page" value="htaccess:view">
|
||||
<input type="hidden" name="htaccess_id" value="{$htaccess.id}">
|
||||
<input type="hidden" name="do[]" value="htaccess:update">
|
||||
<input type="hidden" name="id" value="{$VAR.id}">
|
||||
</form>
|
||||
{/foreach}
|
||||
{/if}
|
Reference in New Issue
Block a user