Fix protection on tpl to avoid direct url call
This commit is contained in:
parent
07f1dd7dae
commit
768cc19bbc
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Require
|
// Require
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Code to ouput content when action is presend
|
* Code to ouput content when action is presend
|
||||||
*
|
*
|
||||||
@ -26,6 +25,14 @@
|
|||||||
* $diroutput
|
* $diroutput
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'presend')
|
if ($action == 'presend')
|
||||||
{
|
{
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|||||||
@ -20,6 +20,14 @@
|
|||||||
* $conf
|
* $conf
|
||||||
* $langs
|
* $langs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE commonfields_add.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE commonfields_add.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -20,6 +20,14 @@
|
|||||||
* $conf
|
* $conf
|
||||||
* $langs
|
* $langs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE commonfields_edit.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE commonfields_edit.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -22,6 +22,14 @@
|
|||||||
*
|
*
|
||||||
* $keyforbreak may be defined to key to switch on second column
|
* $keyforbreak may be defined to key to switch on second column
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -24,6 +24,14 @@
|
|||||||
* $parameters
|
* $parameters
|
||||||
* $cols
|
* $cols
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE extrafields_add.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE extrafields_add.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -24,6 +24,14 @@
|
|||||||
* $parameters
|
* $parameters
|
||||||
* $cols
|
* $cols
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Loop to show all columns of extrafields for the search title line
|
// Loop to show all columns of extrafields for the search title line
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Loop to complete $param for extrafields
|
// Loop to complete $param for extrafields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Loop to complete the sql search criterias from extrafields
|
// Loop to complete the sql search criterias from extrafields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Loop to show all columns of extrafields for the title line
|
// Loop to show all columns of extrafields for the title line
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,6 +17,14 @@
|
|||||||
* Output code for the filemanager
|
* Output code for the filemanager
|
||||||
* $module must be defined ('ecm', 'medias', ...)
|
* $module must be defined ('ecm', 'medias', ...)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE core/tpl/filemanager.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE core/tpl/filemanager.tpl.php -->
|
||||||
|
|||||||
@ -15,6 +15,13 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
|
|
||||||
print '<!-- BEGIN PHP TEMPLATE ONLINEPAYMENTLINKS -->';
|
print '<!-- BEGIN PHP TEMPLATE ONLINEPAYMENTLINKS -->';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user