summaryrefslogtreecommitdiff
path: root/edit.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-04-24 20:47:42 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-04-24 20:47:42 +0000
commit79276ba832eef6d013b4485df126d87fe1470b00 (patch)
treedc826b3b836864f7e7850b86d6a1fbb2ee8d0ab7 /edit.php
parent77124d11d2d9bf8dc51a5b14034eba4133e7f225 (diff)
downloadarticles-79276ba832eef6d013b4485df126d87fe1470b00.tar.gz
articles-79276ba832eef6d013b4485df126d87fe1470b00.tar.bz2
articles-79276ba832eef6d013b4485df126d87fe1470b00.zip
allow the use of a random number string image to prevent spam submissions
Diffstat (limited to 'edit.php')
-rw-r--r--edit.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/edit.php b/edit.php
index 01341b3..9d9fc14 100644
--- a/edit.php
+++ b/edit.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_articles/edit.php,v 1.24 2006/04/21 15:18:42 spiderr Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_articles/edit.php,v 1.25 2006/04/24 20:47:41 squareing Exp $
* @package article
* @subpackage functions
*/
@@ -21,9 +21,6 @@ include_once( LIBERTY_PKG_PATH.'edit_help_inc.php' );
// Is package installed and enabled
$gBitSystem->verifyPackage( 'articles' );
-// initiate feedback array
-$gBitSmarty->assign_by_ref( 'feedback', $feedback = array() );
-
include_once('lookup_article_inc.php');
$isOwner = FALSE;
@@ -42,13 +39,6 @@ if( !$isOwner ) {
die;
}
-// content templates
-if( !empty( $_REQUEST["template_id"] ) && $_REQUEST["template_id"] > 0 ) {
- $template_data = $tikilib->get_template( $_REQUEST["template_id"] );
- $_REQUEST["preview"] = 1;
- $_REQUEST["body"] = $template_data["content"].$_REQUEST["data"];
-}
-
// if we want to remove a custom image, just nuke all custom image settings at once
if( !empty( $_REQUEST['remove_image'] ) ) {
$_REQUEST['image_attachment_id'] = NULL;
@@ -57,6 +47,13 @@ if( !empty( $_REQUEST['remove_image'] ) ) {
$_REQUEST['preview'] = 1;
}
+// random image code
+if( !empty( $_REQUEST["save"] ) && $gBitSystem->isFeatureActive( 'articles_submissions_rnd_img' ) && ( !isset( $_SESSION['random_number'] ) || $_SESSION['random_number'] != $_REQUEST['rnd_img'] ) ) {
+ $feedback['error'] = tra( "You need to supply the correct code to submit." );
+ $_REQUEST['preview'] = TRUE;
+ unset( $_REQUEST['save'] );
+}
+
// If we are in preview mode then preview it!
if( !empty( $_REQUEST['preview'] ) ) {
$article = $gContent->preparePreview( $_REQUEST );
@@ -98,6 +95,8 @@ if ($gBitSystem->isPackageActive( 'quicktags' )) {
include_once( QUICKTAGS_PKG_PATH . 'quicktags_inc.php' );
}
+$gBitSmarty->assign( 'feedback', ( !empty( $feedback ) ? $feedback : NULL ) );
+
// Display the Index Template
$gBitSmarty->assign( 'show_page_bar', 'n' );
// load the ajax library for this page