Skip to content

Commit

Permalink
use sec_register_file() to register files using config.php directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianka Martinovic committed Dec 18, 2012
1 parent a5d7519 commit c75f1d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion upload/modules/form/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,18 @@
. ' `body` TEXT NOT NULL,'
. ' PRIMARY KEY ( `submission_id` ) '
. ' )';
$database->query($mod_form);
$database->query($mod_form);

// add files to class_secure
foreach(
array( 'add_field.php', 'delete_field.php', 'delete_submission.php',
'modify_field.php', 'modify_settings.php', 'move_down.php',
'move_up.php', 'save_field.php', 'save_settings.php', 'view_submission.php' )
as $file
) {
if ( false === $admin->get_helper('Addons')->sec_register_file( 'news', $file ) )
{
error_log( "Unable to register file -$file-!" );
}
}

13 changes: 13 additions & 0 deletions upload/modules/news/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@
$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_settings (section_id,page_id, `header`, `post_loop`, `footer`, `post_header`, `post_footer`, `comments_header`, `comments_loop`, `comments_footer`, `comments_page`) VALUES ('0', '0', '', '', '', '', '', '', '', '', '')");
}

// add files to class_secure
foreach(
array( 'add_group.php', 'add_post.php', 'comment.php', 'delete_comment.php', 'delete_group.php', 'delete_post.php',
'modify_comment.php', 'modify_group.php', 'modify_post.php', 'modify_settings.php', 'move_down.php', 'move_up.php',
'rss.php', 'save_comment.php', 'save_group.php', 'save_post.php', 'save_settings.php', 'submit_comment.php' )
as $file
) {
if ( false === $admin->get_helper('Addons')->sec_register_file( 'news', $file ) )
{
error_log( "Unable to register file -$file-!" );
}
}

// Make news post access files dir
require_once(WB_PATH.'/framework/functions.php');
make_dir(WB_PATH.MEDIA_DIRECTORY.'/newspics'); // create directory for images
Expand Down

0 comments on commit c75f1d1

Please sign in to comment.