Page 1 of 1

Disable Captcha in FrontEndUsers

Posted: Thu Oct 21, 2010 9:09 am
by paulie
Is there a way to disable this globally ? Even with a code hack ?

This should work

Code: Select all

{cms_module module='FrontEndUsers' nocaptcha='1'} 
but the problem is that I load the my own version of the login form via a user defined tag (as I want to show a different login form for IE6 users (don't ask)

Code: Select all

global $gCms;
$feusers = $gCms->modules['FrontEndUsers']['object'];
$username = $feusers->LoggedInName();
$uid = $feusers->GetUserID($username);
$output = "You are logged in as <a href='/user-cp'><strong>". $username."</strong></a>";
$page_content_id = $gCms->variables['content_id'];
// CHECK IF IE6
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0') > 1) {
$ie6 = 1;

}
if ($ie6 != 1 ){
  $top = '<div id="wrapper" >
<div class="above_body" > <!-- closing tag is in template navbar --> 
	<div id="toplinks" class="toplinks" > ';
$bottom = '</div> 	
</div><!-- closing div for above_body --> ';
} else{ 
$login ='<a href="/user-cp"><img src="/design/login.png" ></a>
';
$logout='<a href="/feu/logout/53"><img src="/design/logout.png" ></a>
';}


if ($ie6 != 1 ){
$login = '
<ul class="nouser" style="padding-left:10px;margin:0px"> 
			<li> 
<form id="navbar_loginform" method="post" action="'.$curURL.'">
<fieldset id="logindetails" class="logindetails"> 
					<div> 
						<div> 
<input type="text" class="textbox" name="m713a0feu_input_username" id="navbar_username" size="25" accesskey="u" tabindex="101" value="User Name" /> 
<input type="text" class="textbox default-value" tabindex="102" name="vb_login_password_hint" id="navbar_password_hint" size="10" value="Password" style="display:none;" />
<input type="password" class="textbox" tabindex="102" name="m713a0feu_input_password" id="navbar_password" size="10" /> 
					
		
<input type="hidden" name="mact" value="1" />
<input type="hidden" name="m713a0returnid" value="53" />
<input type="hidden" name="page" value="53" />

<input type="submit" class="loginbutton" tabindex="104" value="Log in" title="Enter your username and password in the boxes provided to login, or click the \'register\' button to create a profile for yourself." accesskey="s" /> 

</div> 
					</div> 
				</fieldset> 
			</form> 
';



  $startSX=  '<span style="margin:0 0;padding:0;">';
  $logout = ' <a href="/feu/logout/53" title="Log out"><img src="/logo/sign-out.png" border="0"> Logout</a>';
// number 2
  if ($uid == ""){
  $output =		$top. $login.$bottom ;		
  }else {$output = $top. $startS . $output.		$logout.$bottom ;}

  }else {  
        if ($uid == ""){
        $output =	$login ;
  }else { $output =	$logout;}
} 

return $output; 
Can I set a variable in gCms->modules['FrontEndUsers']['object'] to displale the Captcha ? Or can I change something in the source code of FEU to  do the same ?

Thanks,
P

Re: Disable Captcha in FrontEndUsers

Posted: Thu Oct 21, 2010 11:59 am
by rica_carv
i had already had the same though....

Instead of hacking the code, i simply remove it from the template....
A twisted solution....

Re: Disable Captcha in FrontEndUsers

Posted: Thu Oct 21, 2010 2:29 pm
by paulie
I found the variable in FrontEndUsers.module.php

Code: Select all

    $this->SetParameterType('nocaptcha',CLEAN_INT);
I am going to check later if setting that to 1 will work sitewide for FEU.

Re: Disable Captcha in FrontEndUsers

Posted: Sat Oct 23, 2010 10:46 am
by paulie
no, that didn't work, that parameter is only for initialising the values...

does anyone have any ideas on how I can turn off the captcha for FEU ?

Re: Disable Captcha in FrontEndUsers

Posted: Mon Oct 25, 2010 7:00 pm
by paulie
In FEU : Under Preferences, there is Authentication Module/Method: but this is for resetting passwords, length of login fields etc. :(

Surely adding FEU & Captcha should enable great things, not restrict things :(

Re: Disable Captcha in FrontEndUsers

Posted: Wed Oct 27, 2010 4:57 pm
by rica_carv
Again....

Code: Select all

{* login form template *}
{* this is a sample template, feel free to customize it *}
{$startform}
{if $error}
  {$error}<br>
{/if}
Login com {$prompt_username} e  {$prompt_password}:
{$input_username}{$input_password}
 {if isset($captcha)}
   <br/>
   {$captcha_title}: {$input_captcha}<br/>
   {$captcha}
 {/if}
 {if isset($input_rememberme)}
   <br/>
   {$input_rememberme} {$prompt_rememberme}<br/>
 {/if}
 <br/>
 <input type="submit" name="{$feuactionid}submit" value="{$mod->Lang('login')}"/><br/>
  <a href="{$url_forgot}" title="{$mod->Lang('info_forgotpw')}">{$mod->Lang('forgotpw')}</a><br/>
  <a href="{$url_lostun}" title="{$mod->Lang('info_lostun')}">{$mod->Lang('lostusername')}</a>
</p>
{$endform}
Login template in my Front end user

When called via this:

Code: Select all

{cms_module module='FrontEndUsers' nocaptcha='1'} 
, it simply doen't appear.....

If this doesn't work, simply remove these lines:

Code: Select all

{if isset($captcha)}
   <br/>
   {$captcha_title}: {$input_captcha}<br/>
   {$captcha}
 {/if}
I insure that this will definetly remove the captcha from the login.....

Re: Disable Captcha in FrontEndUsers

Posted: Wed Oct 27, 2010 6:19 pm
by kendo451
Removing the lines will not work if FEU is expecting CAPTCHA to be on. Sure it won't show, but your login will be rejected.

Re: Disable Captcha in FrontEndUsers

Posted: Wed Nov 03, 2010 2:54 pm
by rica_carv
kendo451 wrote: Removing the lines will not work if FEU is expecting CAPTCHA to be on. Sure it won't show, but your login will be rejected.
Well, if the module is "smart" enough, this should disable the captcha login, anda accepte the user login:

Code: Select all

{cms_module module='FrontEndUsers' nocaptcha='1'} 
I haven't quite get around with the module code, but as soon i got some time, i'll try to figure this out...

Re: Disable Captcha in FrontEndUsers

Posted: Wed Nov 03, 2010 8:54 pm
by paulie
Thanks for your help guys.

I'm just surprised that when I try to add a new module, it can effect another module in such a way that the first module no longer works.

These things should be settable globally, in the module admin page, and not just in a template.

Re: Disable Captcha in FrontEndUsers

Posted: Thu Nov 04, 2010 4:51 am
by Dr.CSS
# (optional) nocaptcha="1"

Used with the login forms. his will disnable captcha on the form. By default, if the Captcha module is installed, validation of a captcha image will be required for login. This is a security measure intented to prevent brute force attacks.

Notice the if it's installed part, do you use captcha anywhere else, if not uninstall it so it doesn't try to trigger it?...

Re: Disable Captcha in FrontEndUsers

Posted: Mon Dec 13, 2010 5:12 am
by WebFXMaster
nocaptcha="1" only works PART of the time.  I have the FEU set-up in my default template in a sidebar.  On the HOME page, nocaptcha="1" works just fine, but any other page--even built on the same default template--the captcha appears.  I would have thought that, if the code was in the template, it would carry over to every page built on that template, but it does not.

Does anyone have any idea why it will work on one page and not another built on the same template?

Thanks,
WebFXMaster

Re: Disable Captcha in FrontEndUsers

Posted: Mon Dec 13, 2010 9:00 am
by Dr.CSS
Are they both set to not be cached?...

Re: Disable Captcha in FrontEndUsers

Posted: Mon Dec 13, 2010 2:37 pm
by WebFXMaster
Dr.CSS wrote: Are they both set to not be cached?...
I'd have to check to be sure, it's a site in development and there's a very good possibility that, since cached IS the default, I probably left it on... could that really make the difference?

WebFXMaster