Soucis avec jAuth 1.6

43 views
Skip to first unread message

giviz givizator

unread,
Jul 3, 2014, 9:39:11 AM7/3/14
to jeli...@googlegroups.com
Salut tout le monde !

Je commence à migrer une vieille application encore en ... 1.0 ! vers la version 1.6

Je galère avec le module jAuth, j'ai bien le form de connexion, mais quand je le valide, il me remet immédiatement sur le form.
Je n'ai même pas l'impression qu'il passe par l'action login:in car si je remplace son code par un simple echo + exit, il m'affiche quand même le form.

Je tourne en rond sans trouver la solution :/

Voici la config du plugin :

;<?php die(''); ?>
;for security reasons , don't remove or modify the first line

;============= Main parameters

; driver name : "ldap", "Db", "Class" or "LDS" (respect the case of characters)
driver = Db

;============ Parameters for the plugin
; session variable name
session_name = "JELIX_USER"

; Says if there is a check on the ip address : verify if the ip
; is the same when the user has been connected
secure_with_ip = 0

;Timeout. After the given time (in minutes) without activity, the user is disconnected.
; If the value is 0 : no timeout
timeout = 0

; If the value is "on", the user must be authentificated for all actions, except those
; for which a plugin parameter  auth.required is false
; If the value is "off", the authentification is not required for all actions, except those
; for which a plugin parameter  auth.required is true
auth_required = on

; What to do if an authentification is required but the user is not authentificated
; 1 = generate an error. This value should be set for web services (xmlrpc, jsonrpc...)
; 2 = redirect to an action
on_error = 2

; locale key for the error message when on_error=1
error_message = "jauth~autherror.notlogged"

; action to execute on a missing authentification when on_error=2
on_error_action = "jauth~login:form"

; action to execute when a bad ip is checked with secure_with_ip=1 and on_error=2
bad_ip_action = "jauth~login:out"

;=========== Parameters for jauth module

; number of second to wait after a bad authentification
on_error_sleep = 3

; action to redirect after the login
after_login = "main~default:index"

; action to redirect after a logout
after_logout = "jauth~login:form"

; says if after_login can be overloaded by a "auth_url_return" parameter in the url/form for the login
enable_after_login_override = off

; says if after_logout can be overloaded by a "auth_url_return" parameter in the url/form for the login
enable_after_logout_override = off

;============ Parameters for the persistance of the authentification

; enable the persistance of the authentification between two sessions
persistant_enable=off

; key to use to crypt the password in the cookie. replace it by your own words !
persistant_crypt_key= exampleOfCryptKey

; the name of the cookie which is used to store data for the authentification
persistant_cookie_name=jelixAuthentificationCookie

; duration of the validity of the cookie (in days). default is 1 day.
persistant_duration = 1

;=========== parameters for password hashing

; method of the hash. 0 or "" means old hashing behavior of jAuth
; (using password_* parameters in drivers ).
; Prefer to choose 1, which is the default hash method (bcrypt).
password_hash_method =

; options for the hash method. list of "name:value" separated by a ";"
password_hash_options =



;=========== Parameters for drivers

;------- parameters for the "Db" driver
[Db]
; name of the dao to get user data
dao = "main~webmaster"

; profile to use for jDb
profile = "monprofl"

; name of the php function to crypt the password in the database
password_crypt_function = md5 


A noter que le password est bien en MD5 dans la bdd et que j'ai fait un test de load de l'user avec la dao main~webmaster et que tout fonctionne normalement.

Si vous avez une idée de ou ca peut venir, je suis preneur !

A bientôt !

Merci

Laurent Jouanneau

unread,
Jul 3, 2014, 9:58:52 AM7/3/14
to jeli...@googlegroups.com
Salut le revenant :),

As tu bien suivi toutes les instructions de migrations ? (1.0 -> 1.1 ->
1.2 -> 1.3 -> 1.4 -> 1.5 -> 1.6, voir les manuels sur docs.jelix.org)

répertoire temp vidé ?

Et sinon, ça ressemble à un problème de session...

Je te propose de mettre des jLog::log() partout dans
lib/jelix/plugins/coord/auth/auth.coord.php, et de voir ce qui se passe.
(ouai c'est pas top, mais bon...)

Laurent
> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes
> "jelix-fr".
> Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le
> concernant, envoyez un e-mail à l'adresse
> jelix-fr+u...@googlegroups.com
> <mailto:jelix-fr+u...@googlegroups.com>.
> Pour obtenir davantage d'options, consultez la page
> https://groups.google.com/d/optout.

giviz givizator

unread,
Jul 4, 2014, 3:52:13 AM7/4/14
to jeli...@googlegroups.com
Salut Laurent !

Non, en fait c'est un changement profond de l'application, donc je pars sur une installation from scratch de jelix 1.6 dans laquelle je migre manuellement le code de la 1.1 petit à petit.

Le rep temps était donc vide, puisque l'install était fraiche.

Je vais essayer de trouver avec du debug demain, la j'y ai déjà passé plus d'une heure :D

Surtout que ce module jAuth, il m'avait déjà bien fait galérer avec la 1.0 !

giviz givizator

unread,
Jul 4, 2014, 5:02:36 AM7/4/14
to jeli...@googlegroups.com

Ok, bon ce matin je décide de m'attaquer au problème et tout fonctionne maintenant :D

Sans doute un problème de session, tu avais raison ;)

Par contre, à chaque fois que je modifie un template puis que je reload la page, au premier refresh je me mange une erreur :

Fatal error: Call to undefined function template_meta_4838d2e48783ba7c09b317f44079c0c5() in /home/work/abcd/lib/jelix/tpl/jTpl.class.php on line 281

Une fois la première erreur, ca fonctionne bien. Si je remodifie le template, j'ai à nouveau une fois l'erreur.

Le template :
TPL = main~main<br/>

Il ne figure pas dans l'array processdMeta
Array
(
)

Il semble que la fonction soit bien générée à la volée
<?php
if (jApp::config()->compilation['checkCacheFiletime'] &&
filemtime('/home/work/felorix/admin/modules/main/templates/main.tpl') > 1404464281){ return false;
} else {
require_once('/home/work/felorix/lib/jelix/plugins/tpl/html/function.jurl.php');
function template_meta_c204912722c38acf2e40b7afe215840f($t){

}
function template_c204912722c38acf2e40b7afe215840f($t){

Mais une fois généré, on dirait qu'elle n'est pas chargée car php semble ne pas la connaitre.

Une idée ?


Le jeudi 3 juillet 2014 15:39:11 UTC+2, giviz givizator a écrit :

Laurent Jouanneau

unread,
Jul 6, 2014, 5:37:29 PM7/6/14
to jeli...@googlegroups.com
Salut,

j'ai corrigé ce problème il y a quelques jours. J'avais le même
agacement :-) Il s'agit en fait d'un souci quand il y a un cache
d'opcode (y en a un par défaut maintenant dans PHP). Si on fait un
require du même fichier 2 fois durant la même requête, le cache est
utilisé, même si le fichier a changé entre les deux requires (ce qui est
le cas dans Jelix).

https://github.com/jelix/jelix/commit/e25b9ab270bf0ee37b6aabed150bde069bb057af

Installe une nightly 1.6.x :-)

Laurent

giviz givizator

unread,
Jul 6, 2014, 5:55:07 PM7/6/14
to jeli...@googlegroups.com

Ah cool !

Merci Laurent, j'installe la mise à jour demain alors :)

A+


Le jeudi 3 juillet 2014 15:39:11 UTC+2, giviz givizator a écrit :
Reply all
Reply to author
Forward
0 new messages