Bonjour a tous,
Je voudrais perreniser un code qui n'est pas Orienté PHP5.
Je recupere cette erreur:
Declaration of ServiceAuthenticator::authenticate() should be compatible with that of AuthenticatorBase::authenticate()
issue ici:
Je n'arrive pas a comprendre cette erreur, même en traduisant ca ne me parle pas......
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 [warning] 10:53:19 01/10/07 DEPRECATED ERROR: Declaration of ServiceAuthenticator::authenticate() should be compatible with that of AuthenticatorBase::authenticate() Dans le fichier /var/www/php-/WEB-INF/classes/php/authenticator/ServiceAuthenticator.php à la ligne 180 #0 /var/www/php-/WEB-INF/GlobalPrependEx.php(70): myErrorHandler(2048, 'Declaration of ...', '/var/www/php-...', 180, Array) #1 /var/www/php-/WEB-INF/GlobalPrependEx.php(70): include_once() #2 /var/www/php-/WEB-INF/globalPrepend.php(33): include_once('/var/www/php-...') #3 /var/www/site_at/WEB-INF/boot-php.inc(96): include_once('/var/www/php-...') #4 /var/www/site_at/Admin.php(8): include('/var/www/site...') #5 {main}
L'erreur est lancée lorsqu'on include_once la classe ServiceAuthenticator.
Voici la classe:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89 class ServiceAuthenticator extends AuthenticatorBase { // ----- Instance Variables --------------------------------------------- // /** * Descriptive information about this implementation. * @type string */ var $sInfo = 'php.authenticator.ServiceAuthenticator/1.0'; /** * Character encoding to use to read the username and password parameters * from the request. If not set, the encoding of the request body will be * used. * @type string */ var $sCharacterEncoding = ''; // ----- Public Properties ---------------------------------------------- // /** * Return descriptive information about this Valve implementation. */ function getInfo() { return $this->sInfo; } /** * Return the character encoding to use to read the username and password. */ function getCharacterEncoding() { return $this->sCharacterEncoding; } /** * Set the character encoding to be used to read the username and password. */ function setCharacterEncoding($sCharacterEncoding) { $this->sCharacterEncoding = $sCharacterEncoding; } // ----- Constructor ---------------------------------------------------- // function ServiceAuthenticator() { // Setup the parent object first #parent::__construct(); // PHP5 parent::AuthenticatorBase(); } // ----- Public Methods ------------------------------------------------- // /** * Authenticate the user (service) making this request, based on the * specified login configuration. Return <code>True</code> if any specified * constraint has been satisfied, or <code>False</code> on failure to * authenticate. * * @param Request Request we are processing * @param Response Response we are creating * @param LoginConfig The LoginConfig configuration describing how * authentication should be performed. * @returns boolean */ function authenticate(&$request, &$response, $oConfig) { // References to objects we will need later $oSession = Null; // Have we already authenticated someone? $oPrincipal = $request->getUserPrincipal(); // Principal #String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE); if($oPrincipalNote(PhpMVC_Auth_Const::getKey('SESS_USERNAME_NOTE'), $sUsername); #$session->setNote(PhpMVC_Auth_Const::getKey('SESS_PASSWORD_NOTE'), $sPassword); // Redirect the user to the original request URI: // There is no login page for a service authentication (non-interactive logon), // so we just return True (auth=success) and garnt permission to access the // resourses guarded by this authenticator. return True; // } }
Je vous remercie d'avance pour l'aide!!!
Ronio
Partager