Skip to content

Commit

Permalink
same fix for menu_link (issue #187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianka Martinovic committed Oct 23, 2013
1 parent 4983143 commit 2638896
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 155 deletions.
41 changes: 23 additions & 18 deletions upload/modules/menu_link/add.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
<?php

/**
* This file is part of an ADDON for use with Black Cat CMS Core.
* This ADDON is released under the GNU GPL.
* Additional license terms can be seen in the info.php of this module.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* @module menu-link
* @author WebsiteBaker Project, LEPTON Project
* @copyright 2004-2010, WebsiteBaker Project
* @copyright 2010-2011, LEPTON Project
* @link http://www.LEPTON-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see info.php of this module
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @category CAT_Modules
* @package menu_link
*
*/

// include class.secure.php to protect this file and the whole CMS!
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php



$table = CAT_TABLE_PREFIX ."mod_menu_link";
$database->query("INSERT INTO `$table` (`page_id`, `section_id`, `target_page_id`, `anchor`, `extern`) VALUES ('$page_id', '$section_id', '0', '0', '')");
Expand Down
41 changes: 23 additions & 18 deletions upload/modules/menu_link/delete.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
<?php

/**
* This file is part of an ADDON for use with Black Cat CMS Core.
* This ADDON is released under the GNU GPL.
* Additional license terms can be seen in the info.php of this module.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* @module menu-link
* @author WebsiteBaker Project, LEPTON Project
* @copyright 2004-2010, WebsiteBaker Project
* @copyright 2010-2011, LEPTON Project
* @link http://www.LEPTON-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see info.php of this module
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @category CAT_Modules
* @package menu_link
*
*/

// include class.secure.php to protect this file and the whole CMS!
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php



$table = CAT_TABLE_PREFIX ."mod_menu_link";
$database->query("DELETE FROM `$table` WHERE section_id = '$section_id'");
Expand Down
42 changes: 23 additions & 19 deletions upload/modules/menu_link/index.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
<?php

/**
* This file is part of an ADDON for use with Black Cat CMS Core.
* This ADDON is released under the GNU GPL.
* Additional license terms can be seen in the info.php of this module.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* @module menu-link
* @author WebsiteBaker Project, LEPTON Project
* @copyright 2004-2010, WebsiteBaker Project
* @copyright 2010-2011, LEPTON Project
* @link http://www.LEPTON-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see info.php of this module
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @category CAT_Modules
* @package menu_link
*
*/

// include class.secure.php to protect this file and the whole CMS!
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php



?>
43 changes: 24 additions & 19 deletions upload/modules/menu_link/info.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
<?php

/**
* This file is part of an ADDON for use with Black Cat CMS Core.
* This ADDON is released under the GNU GPL.
* Additional license terms can be seen in the info.php of this module.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* @module menu-link
* @author WebsiteBaker Project, LEPTON Project
* @copyright 2004-2010, WebsiteBaker Project
* @copyright 2010-2011, LEPTON Project
* @link http://www.LEPTON-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see info.php of this module
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @category CAT_Modules
* @package menu_link
*
*/

// include class.secure.php to protect this file and the whole CMS!
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php



$module_directory = 'menu_link';
$module_name = 'Menu Link';
$module_function = 'page';
$module_version = '2.8.1';
$module_version = '2.8.2';
$module_platform = '1.x';
$module_author = 'Ryan Djurovich, thorn';
$module_license = 'GNU General Public License';
Expand Down
54 changes: 36 additions & 18 deletions upload/modules/menu_link/install.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
<?php

/**
* This file is part of an ADDON for use with Black Cat CMS Core.
* This ADDON is released under the GNU GPL.
* Additional license terms can be seen in the info.php of this module.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* @module menu-link
* @author WebsiteBaker Project, LEPTON Project
* @copyright 2004-2010, WebsiteBaker Project
* @copyright 2010-2011, LEPTON Project
* @link http://www.LEPTON-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see info.php of this module
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
* @category CAT_Modules
* @package menu_link
*
*/

// include class.secure.php to protect this file and the whole CMS!
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php



$table = CAT_TABLE_PREFIX ."mod_menu_link";
// $database->query("DROP TABLE IF EXISTS `$table`");
Expand All @@ -51,4 +56,17 @@
)
");

// add files to class_secure
$addons_helper = new CAT_Helper_Addons();
foreach(
array( 'save.php' )
as $file
) {
if ( false === $addons_helper->sec_register_file( 'menu_link', $file ) )
{
error_log( "Unable to register file -$file-!" );
}
}


?>
15 changes: 8 additions & 7 deletions upload/modules/menu_link/modify.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* @author Black Cat Development
* @author Website Baker Project, LEPTON Project, Black Cat Development
* @copyright 2004-2010, Website Baker Project
* @copyright 2011-2012, LEPTON Project
* @copyright 2013, Black Cat Development
* @link http://blackcat-cms.org
* @license http://www.gnu.org/licenses/gpl.html
Expand All @@ -23,23 +25,22 @@
*
*/

if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
if (defined('CAT_PATH')) {
include(CAT_PATH.'/framework/class.secure.php');
} else {
$root = "../";
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= "../";
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}


global $MOD_MENU_LINK, $TEXT;

$backend = CAT_Backend::getInstance('pages','pages_modify');
Expand Down Expand Up @@ -141,7 +142,7 @@ function populate() {

/*]]>*/
</script>
<form name="menulink" action="<?php echo CAT_URL ?>/modules/menu_link/save.php" method="post" class="ajaxForm">
<form name="menulink" action="<?php echo CAT_URL ?>/modules/menu_link/save.php" method="post">
<input type="hidden" name="page_id" value="<?php echo $page_id ?>" />
<input type="hidden" name="section_id" value="<?php echo $section_id ?>" />
<table>
Expand Down
Loading

0 comments on commit 2638896

Please sign in to comment.