[TYPO3] Problems with FE login by IP ( cc_iplogin_fe )
Lasse Guldsborg
lasse at clioonline.dk
Tue Sep 11 14:45:08 CEST 2007
Just to answer my own question, in case anyone is interested =)
The T3 guru Thomas Lorenzen made an extension for me. I think he plans to
publish it to TER (tl_ipfelogin), but in case it takes a while before he
gets around to it I'll just post the main part of the extension code here so
you guys can se how it was done:
function main($content,$conf) {
if($GLOBALS["TSFE"]->fe_user->user) {
return;
}
$ip = $_SERVER["REMOTE_ADDR"];
$query = 'select * from fe_users where
FIND_IN_SET("'.$ip.'",tx_tlipfelogin_autologin_ips)'.$this->cObj->enableFields("fe_users");
$res = $GLOBALS["TYPO3_DB"]->sql_query($query);
$FE_USER = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res);
if($FE_USER) {
$content .= '
<form method="post" id="fe_user_login_form"
action="'.$this->pi_getPageLink($GLOBALS["TSFE"]->id).'">
<input type="hidden" id="user" name="user"
value="'.$FE_USER["username"].'" />
<input type="hidden" id="pass" name="pass"
value="'.$FE_USER["password"].'" />
<input type="hidden" name="logintype" value="login" />
<input type="hidden" name="pid" value="'.$FE_USER["pid"].'" />
</form>
<script type="text/javascript">
document.getElementById("fe_user_login_form").submit();
</script>
';
return $content;
}
}
Best regards,
Lasse Guldsborg
"Lasse Guldsborg" <lasse at clioonline.dk> skrev i en meddelelse
news:mailman.1.1186742038.14391.typo3-english at lists.netfielders.de...
> Hi
>
> I would like to have certain FE users auto-login by IP, but I can't get
> the cc_iplogin_fe / cc_ipauth extensions working.
>
> I have installed the following:
> typo3 4.1.1
> cc_iplogin_fe 1.1.1
> cc_ipauth 1.1.1
>
> I believe I have followed the (fairly short) manual to the letter. Can
> anyone tell me if the extensions are even compatible with t3 4.1.1, or if
> there is a good alternative solution?
>
> Any help is much appreciated!
>
> Best regards,
> Lasse
>
More information about the TYPO3-english
mailing list