mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 11:49:56 +03:00
feature 3010 : replace trigger_action/event by trigger_notify/change
git-svn-id: http://piwigo.org/svn/trunk@28587 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
f98edc7a2e
commit
4bd32005b5
62 changed files with 322 additions and 344 deletions
|
@ -174,7 +174,7 @@ function register_user($login, $password, $mail_address, $notify_admin=true, &$e
|
|||
}
|
||||
}
|
||||
|
||||
$errors = trigger_event(
|
||||
$errors = trigger_change(
|
||||
'register_user_check',
|
||||
$errors,
|
||||
array(
|
||||
|
@ -273,7 +273,7 @@ SELECT id
|
|||
);
|
||||
}
|
||||
|
||||
trigger_action(
|
||||
trigger_notify(
|
||||
'register_user',
|
||||
array(
|
||||
'id'=>$user_id,
|
||||
|
@ -959,7 +959,7 @@ function log_user($user_id, $remember_me)
|
|||
$_SESSION['pwg_uid'] = (int)$user_id;
|
||||
|
||||
$user['id'] = $_SESSION['pwg_uid'];
|
||||
trigger_action('user_login', $user['id']);
|
||||
trigger_notify('user_login', $user['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -984,7 +984,7 @@ function auto_login()
|
|||
if ($key!==false and $key===$cookie[2])
|
||||
{
|
||||
log_user($cookie[0], true);
|
||||
trigger_action('login_success', stripslashes($username));
|
||||
trigger_notify('login_success', stripslashes($username));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1085,7 +1085,7 @@ function pwg_password_verify($password, $hash, $user_id=null)
|
|||
*/
|
||||
function try_log_user($username, $password, $remember_me)
|
||||
{
|
||||
return trigger_event('try_log_user', false, $username, $password, $remember_me);
|
||||
return trigger_change('try_log_user', false, $username, $password, $remember_me);
|
||||
}
|
||||
|
||||
add_event_handler('try_log_user', 'pwg_login', EVENT_HANDLER_PRIORITY_NEUTRAL, 4);
|
||||
|
@ -1121,10 +1121,10 @@ SELECT '.$conf['user_fields']['id'].' AS id,
|
|||
if ($conf['password_verify']($password, $row['password'], $row['id']))
|
||||
{
|
||||
log_user($row['id'], $remember_me);
|
||||
trigger_action('login_success', stripslashes($username));
|
||||
trigger_notify('login_success', stripslashes($username));
|
||||
return true;
|
||||
}
|
||||
trigger_action('login_failure', stripslashes($username));
|
||||
trigger_notify('login_failure', stripslashes($username));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ function logout_user()
|
|||
{
|
||||
global $conf;
|
||||
|
||||
trigger_action('user_logout', @$_SESSION['pwg_uid']);
|
||||
trigger_notify('user_logout', @$_SESSION['pwg_uid']);
|
||||
|
||||
$_SESSION = array();
|
||||
session_unset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue