From 701a250b6ede4936d1dd677b8e1813a440e90c71 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 30 Aug 2010 19:45:58 -0300 Subject: Fix gettext calls with printf to permit change strings order --- etc/inc/auth.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'etc/inc/auth.inc') diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 6fa418c..1180174 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -928,7 +928,7 @@ function ldap_backed($username, $passwd, $authcfg) { /* Iterate through the user containers for search */ foreach ($ldac_splits as $i => $ldac_split) { /* Make sure we just use the first user we find */ - log_error(sprintf(gettext("Now Searching in server %s, container %s with filter %s."), $ldapname, $ldac_split, $ldapfilter)); + log_error(sprintf(gettext("Now Searching in server %1$s, container %2$s with filter %3$s."), $ldapname, $ldac_split, $ldapfilter)); if ($ldapscope == "one") $ldapfunc = "ldap_list"; else @@ -961,12 +961,12 @@ function ldap_backed($username, $passwd, $authcfg) { /* Now lets bind as the user we found */ if (!($res = @ldap_bind($ldap, $userdn, $passwd))) { - log_error(sprintf(gettext("ERROR! Could not login to server %s as user %s."), $ldapname, $username)); + log_error(sprintf(gettext("ERROR! Could not login to server %1$s as user %2$s."), $ldapname, $username)); @ldap_unbind($ldap); return false; } - log_error(sprintf(gettext("Logged in successfully as %s via LDAP server %s with DN = %s."), $username, $ldapname, $userdn)); + log_error(sprintf(gettext("Logged in successfully as %1$s via LDAP server %2$s with DN = %3$s."), $username, $ldapname, $userdn)); /* At this point we are bound to LDAP so the user was auth'd okay. Close connection. */ @ldap_unbind($ldap); @@ -1145,7 +1145,7 @@ function session_auth() { $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_POST['usernamefld']; $_SESSION['last_access'] = time(); - log_error(sprintf(gettext("Successful login for user '%s' from: %s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Successful login for user '%1$s' from: %2$s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); $HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username']; if (isset($_POST['postafterlogin'])) return true; @@ -1158,7 +1158,7 @@ function session_auth() { } else { /* give the user an error message */ $_SESSION['Login_Error'] = gettext("Username or Password incorrect"); - log_error(sprintf(gettext("Login attempt with user: '%s' from: '%s' failed."), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Login attempt with user: '%1$s' from: '%2$s' failed."), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); if(isAjax()) { echo "showajaxmessage('{$_SESSION['Login_Error']}');"; return; @@ -1198,9 +1198,9 @@ function session_auth() { if (isset($_GET['logout'])) { if ($_SESSION['Logout']) - log_error(sprintf(gettext("Session timed out for user '%s' from: %s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Session timed out for user '%1$s' from: %2$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); else - log_error(sprintf(gettext("User logged out for user '%s' from: %s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("User logged out for user '%1$s' from: %2$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); /* wipe out $_SESSION */ $_SESSION = array(); -- cgit v1.1