PHP |
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
| <?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );
class plgAuthenticationExample extends JPlugin
{
function plgAuthenticationExample(& $subject, $config)
{
parent::__construct($subject, $config);
die('plgAuthenticationExample');
}
function onUserAuthenticate( $credentials, $options, &$response ){
jimport('joomla.user.helper');
$username = mysql_real_escape_string($credentials['username']);
$password = mysql_real_escape_string( md5($credentials['password']) );
//тут мой код, присваивает $result тру/фалсе
// var_dump($credentials);
// var_dump($options);
// var_dump($response);
if($result){
$response->status = JAUTHENTICATE_STATUS_SUCCESS;
$response->error_message = '';
}
else{
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->error_message = JText::_('JGLOBAL_AUTH_INVALID_PASS');
}
}
} |
|
В общем как вот тут убить авторизацию в случаи когда $result == false?
Да, вот тут начало
PHP |
1
2
3
4
5
6
7
| $plugin->onUserAuthenticate($credentials, $options, $response);
var_dump($response->status);
var_dump(JAuthentication::STATUS_SUCCESS);
// If authentication is successful break out of the loop
if ($response->status === JAuthentication::STATUS_SUCCESS) |
|
Добавлено через 34 минуты
вся херня в дополнительном плагине авторизации... Нафига тут 2 плагина авторизации?