1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Bugtracker #4707 - fla.php doesn't work in a multilingual site

This commit is contained in:
marj
2009-07-18 13:08:37 +00:00
parent 010c06d9af
commit 07fa97d39c
2 changed files with 73 additions and 69 deletions

View File

@@ -9,9 +9,9 @@
* Manage/View failed login attempts * Manage/View failed login attempts
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/fla.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/fla.php,v $
* $Revision: 1.7 $ * $Revision: 1.8 $
* $Date: 2008-12-30 13:51:41 $ * $Date: 2009-07-18 13:08:37 $
* $Author: secretr $ * $Author: marj_nl_fr $
* *
*/ */
require_once("../class2.php"); require_once("../class2.php");
@@ -127,7 +127,7 @@ if($sql->db_Select("generic", "*", "gen_type='auto_banned' ORDER BY gen_datestam
$message .= " - ".$ab['gen_ip']; $message .= " - ".$ab['gen_ip'];
} }
$message .= "<div class='right'>( <a href='".e_SELF."?dabl'>".FLALAN_16."</a> )</div>"; $message .= "<div class='right'>(<a href='".e_SELF."?dabl'>".FLALAN_16."</a>)</div>";
$emessage->add($message); $emessage->add($message);
} }
@@ -177,11 +177,12 @@ else
{ {
extract($fa);//FIXME kill extract() extract($fa);//FIXME kill extract()
$gen_chardata = str_replace(":::", "<br />", $e107->tp->toHTML($gen_chardata));
$host = $e107->get_host_name(getenv($gen_ip)); $host = $e107->get_host_name(getenv($gen_ip));
$text .= " $text .= "
<tr> <tr>
<td>".$gen->convert_date($gen_datestamp, "forum")."</td> <td>".$gen->convert_date($gen_datestamp, "forum")."</td>
<td>".str_replace(":::", "<br />", htmlentities($gen_chardata, ENT_QUOTES, CHARSET))."</td> <td>".$gen_chardata."</td>
<td>".$e107->ipDecode($fa['gen_ip'])."<br />{$host}</td> <td>".$e107->ipDecode($fa['gen_ip'])."<br />{$host}</td>
<td class='center middle autocheck e-pointer'> <td class='center middle autocheck e-pointer'>
".$frm->checkbox('fladelete[]', $gen_id)." ".$frm->checkbox('fladelete[]', $gen_id)."
@@ -197,7 +198,7 @@ else
</tbody> </tbody>
</table> </table>
<div class='buttons-bar center'> <div class='buttons-bar center'>
".$frm->admin_button('delbanSubmit', FLALAN_10, 'delete',FLALAN_10,'title=')." ".$frm->admin_button('delbanSubmit', FLALAN_10, 'delete', FLALAN_10, 'title=')."
</div> </div>
</fieldset> </fieldset>
</form> </form>
@@ -205,7 +206,8 @@ else
$parms = $fla_total.",".$amount.",".$from.",".e_SELF.'?'."[FROM].".$amount; $parms = $fla_total.",".$amount.",".$from.",".e_SELF.'?'."[FROM].".$amount;
$nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}"); $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
if ($nextprev) $text .= "<div class='nextprev-bar'>".$nextprev."</div>"; if ($nextprev)
$text .= "<div class='nextprev-bar'>".$nextprev."</div>";
@@ -240,4 +242,3 @@ function headerjs()
return $ret; return $ret;
} }
?>

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.23 $ | $Revision: 1.24 $
| $Date: 2009-07-05 18:47:51 $ | $Date: 2009-07-18 13:08:37 $
| $Author: e107steved $ | $Author: marj_nl_fr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -303,7 +303,7 @@ class userlogin
// Function called to log the reason for a failed login. Currently always returns false - could return some other value // Function called to log the reason for a failed login. Currently always returns false - could return some other value
function invalidLogin($username,$reason, $fip = '?', $extra_text = '') function invalidLogin($username, $reason, $fip = '?', $extra_text = '')
{ {
global $sql, $pref, $tp, $e107; global $sql, $pref, $tp, $e107;
@@ -312,67 +312,67 @@ class userlogin
{ {
case LOGIN_ABORT : // alt_auth reject case LOGIN_ABORT : // alt_auth reject
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />");
$this->genNote($fip,$username,'Alt_auth: '.LAN_LOGIN_14); $this->genNote($fip,$username, 'Alt_auth: '.LAN_LOGIN_14);
$this->logNote('LAN_ROLL_LOG_04','Alt_Auth: '.$username); $this->logNote('LAN_ROLL_LOG_04', 'Alt_Auth: '.$username);
$doCheck = TRUE; $doCheck = TRUE;
break; break;
case LOGIN_DB_ERROR : // alt_auth couldn't add valid user case LOGIN_DB_ERROR : // alt_auth couldn't add valid user
define("LOGINMESSAGE", LAN_LOGIN_31."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_31."<br /><br />");
$this->genNote($fip,$username,'Alt_auth: '.LAN_LOGIN_30); $this->genNote($fip,$username, 'Alt_auth: '.LAN_LOGIN_30);
// $this->logNote('LAN_ROLL_LOG_04','Alt_Auth: '.$username); // Added in alt_auth login // $this->logNote('LAN_ROLL_LOG_04', 'Alt_Auth: '.$username); // Added in alt_auth login
$doCheck = TRUE; $doCheck = TRUE;
break; break;
case LOGIN_BAD_PW : case LOGIN_BAD_PW :
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />");
$this->logNote('LAN_ROLL_LOG_03',$username); $this->logNote('LAN_ROLL_LOG_03', $username);
break; break;
case LOGIN_CHAP_FAIL : case LOGIN_CHAP_FAIL :
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />");
$this->logNote('LAN_ROLL_LOG_03','CHAP: '.$username); $this->logNote('LAN_ROLL_LOG_03', 'CHAP: '.$username);
break; break;
case LOGIN_BAD_USER : case LOGIN_BAD_USER :
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />");
$this->genNote($fip,$username,LAN_LOGIN_14); $this->genNote($fip,$username, LAN_LOGIN_14);
$this->logNote('LAN_ROLL_LOG_04',$username); $this->logNote('LAN_ROLL_LOG_04', $username);
$doCheck = TRUE; $doCheck = TRUE;
break; break;
case LOGIN_BAD_USERNAME : case LOGIN_BAD_USERNAME :
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />");
$this->logNote('LAN_ROLL_LOG_08',$username); $this->logNote('LAN_ROLL_LOG_08', $username);
break; break;
case LOGIN_MULTIPLE : case LOGIN_MULTIPLE :
define("LOGINMESSAGE", LAN_LOGIN_24."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_24."<br /><br />");
$this->logNote('LAN_ROLL_LOG_07',"U: {$username} IP: {$fip}"); $this->logNote('LAN_ROLL_LOG_07', "U: {$username} IP: {$fip}");
$this->genNote($fip,$username,LAN_LOGIN_16); $this->genNote($fip, $username, LAN_LOGIN_16);
$doCheck = TRUE; $doCheck = TRUE;
break; break;
case LOGIN_BAD_CODE : case LOGIN_BAD_CODE :
define("LOGINMESSAGE", LAN_LOGIN_23."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_23."<br /><br />");
$this->logNote('LAN_ROLL_LOG_02',$username); $this->logNote('LAN_ROLL_LOG_02', $username);
break; break;
case LOGIN_NOT_ACTIVATED : case LOGIN_NOT_ACTIVATED :
define("LOGINMESSAGE", LAN_LOGIN_22."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_22."<br /><br />");
$this->logNote('LAN_ROLL_LOG_05',$username); $this->logNote('LAN_ROLL_LOG_05', $username);
$this->genNote($fip,$username,LAN_LOGIN_27); $this->genNote($fip, $username, LAN_LOGIN_27);
$doCheck = TRUE; $doCheck = TRUE;
break; break;
case LOGIN_BLANK_FIELD : case LOGIN_BLANK_FIELD :
define("LOGINMESSAGE", LAN_LOGIN_20."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_20."<br /><br />");
$this->logNote('LAN_ROLL_LOG_01',$username); $this->logNote('LAN_ROLL_LOG_01', $username);
break; break;
case LOGIN_BAD_TRIGGER : case LOGIN_BAD_TRIGGER :
define("LOGINMESSAGE", $extra_text."<br /><br />"); define("LOGINMESSAGE", $extra_text."<br /><br />");
$this->logNote('LAN_ROLL_LOG_06',$username); $this->logNote('LAN_ROLL_LOG_06', $username);
break; break;
case LOGIN_BANNED : case LOGIN_BANNED :
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); // Just give 'incorrect login' message define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); // Just give 'incorrect login' message
$this->genNote($fip,$username,LAN_LOGIN_25); $this->genNote($fip, $username, LAN_LOGIN_25);
$this->logNote('LAN_ROLL_LOG_09',$username); $this->logNote('LAN_ROLL_LOG_09', $username);
break; break;
default : // Something's gone wrong! default : // Something's gone wrong!
define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); // Just give 'incorrect login' message define("LOGINMESSAGE", LAN_LOGIN_21."<br /><br />"); // Just give 'incorrect login' message
$this->genNote($fip,$username,LAN_LOGIN_26); $this->genNote($fip,$username, LAN_LOGIN_26);
$this->logNote('LAN_ROLL_LOG_10',$username); $this->logNote('LAN_ROLL_LOG_10', $username);
} }
if ($doCheck) if ($doCheck)
@@ -392,18 +392,23 @@ class userlogin
// Make a note of an event in the rolling log // Make a note of an event in the rolling log
function logNote($title,$text) function logNote($title, $text)
{ {
global $admin_log; global $admin_log;
$admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"LOGIN",$title,$text,FALSE,LOG_TO_ROLLING); $e107 = &e107::getInstance();
$title = $e107->tp->toDB($title);
$text = $e107->tp->toDB($text);
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", $title, $text, FALSE, LOG_TO_ROLLING);
} }
// Make a note of an event in the 'generic' table // Make a note of an event in the 'generic' table
function genNote($fip,$username,$msg1) function genNote($fip, $username, $msg1)
{ {
global $sql, $tp; //global $sql, $tp;
$sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '".$msg1." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username)."'"); $e107 = &e107::getInstance();
$message = $e107->tp->toDB($msg1." ::: ".LAN_LOGIN_1.": ".$username);
$e107->sql->db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '{$message}'");
} }
@@ -487,5 +492,3 @@ class userlogin
} }
} }
} }
?>