From: <xa...@us...> - 2010-01-14 14:34:29
|
Revision: 24361 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24361&view=rev Author: xavidp Date: 2010-01-14 13:51:28 +0000 (Thu, 14 Jan 2010) Log Message: ----------- [ENH/bp r24356]Anti-bot captcha added when anonymous are allowed add new calendar items. Modified Paths: -------------- branches/proposals/3.x/templates/tiki-calendar_edit_item.tpl branches/proposals/3.x/tiki-calendar_edit_item.php Modified: branches/proposals/3.x/templates/tiki-calendar_edit_item.tpl =================================================================== --- branches/proposals/3.x/templates/tiki-calendar_edit_item.tpl 2010-01-14 13:44:08 UTC (rev 24360) +++ branches/proposals/3.x/templates/tiki-calendar_edit_item.tpl 2010-01-14 13:51:28 UTC (rev 24361) @@ -621,6 +621,9 @@ <input type="radio" id="id_affectAll" name="affect" value="all"/><label for="id_affectAll">{tr}Update every events of this recurrence rule{/tr}</label> </td></tr> {/if} +{if !$user and $prefs.feature_antibot eq 'y'} + {include file='antibot.tpl' tr_style="formcolor"} +{/if} <tr><td><input type="submit" name="act" value="{tr}Save{/tr}" /> {if $id} <input type="submit" onclick='document.location="tiki-calendar_edit_item.php?calitemId={$id}&delete=y";return false;' value="{tr}Delete event{/tr}"/>{/if} {if $recurrence.id} <input type="submit" onclick='document.location="tiki-calendar_edit_item.php?recurrenceId={$recurrence.id}&delete=y";return false;' value="{tr}Delete Recurrent events{/tr}"/>{/if} Modified: branches/proposals/3.x/tiki-calendar_edit_item.php =================================================================== --- branches/proposals/3.x/tiki-calendar_edit_item.php 2010-01-14 13:44:08 UTC (rev 24360) +++ branches/proposals/3.x/tiki-calendar_edit_item.php 2010-01-14 13:51:28 UTC (rev 24361) @@ -177,6 +177,14 @@ } if (isset($_REQUEST['act']) || isset($_REQUEST['preview']) || isset($_REQUEST['changeCal'])) { + + if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { + $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); + $smarty->assign('errortype', 'no_redirect_login'); + $smarty->display("error.tpl"); + die; + } + $save = $_POST['save']; // Take care of timestamps dates coming from jscalendar if ( isset($save['date_start']) || isset($save['date_end']) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |