mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-11 19:23:01 +02:00
since number of accepted args not required for add_event_handler, simplify calls
git-svn-id: http://piwigo.org/svn/trunk@28714 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -269,8 +269,8 @@ add_event_handler('render_tag_url', 'str2url');
|
||||
add_event_handler('blockmanager_register_blocks', 'register_default_menubar_blocks', EVENT_HANDLER_PRIORITY_NEUTRAL-1);
|
||||
if ( !empty($conf['original_url_protection']) )
|
||||
{
|
||||
add_event_handler('get_element_url', 'get_element_url_protection_handler', EVENT_HANDLER_PRIORITY_NEUTRAL, 2 );
|
||||
add_event_handler('get_src_image_url', 'get_src_image_url_protection_handler', EVENT_HANDLER_PRIORITY_NEUTRAL, 2 );
|
||||
add_event_handler('get_element_url', 'get_element_url_protection_handler');
|
||||
add_event_handler('get_src_image_url', 'get_src_image_url_protection_handler');
|
||||
}
|
||||
trigger_notify('init');
|
||||
?>
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
/**
|
||||
* @package functions\comment
|
||||
*/
|
||||
|
||||
|
||||
add_event_handler('user_comment_check', 'user_comment_check',
|
||||
EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
|
||||
|
||||
add_event_handler('user_comment_check', 'user_comment_check');
|
||||
|
||||
/**
|
||||
* Does basic check on comment and returns action to perform.
|
||||
@@ -143,7 +142,7 @@ SELECT COUNT(*) AS user_exists
|
||||
$comment_action='reject';
|
||||
$_POST['cr'][] = 'key'; // rvelices: I use this outside to see how spam robots work
|
||||
}
|
||||
|
||||
|
||||
// website
|
||||
if (!empty($comm['website_url']))
|
||||
{
|
||||
@@ -158,7 +157,7 @@ SELECT COUNT(*) AS user_exists
|
||||
$comment_action='reject';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// email
|
||||
if (empty($comm['email']))
|
||||
{
|
||||
@@ -177,7 +176,7 @@ SELECT COUNT(*) AS user_exists
|
||||
$infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
|
||||
$comment_action='reject';
|
||||
}
|
||||
|
||||
|
||||
// anonymous id = ip address
|
||||
$ip_components = explode('.', $comm['ip']);
|
||||
if (count($ip_components) > 3)
|
||||
@@ -283,23 +282,23 @@ function delete_user_comment($comment_id)
|
||||
{
|
||||
$user_where_clause = ' AND author_id = \''.$GLOBALS['user']['id'].'\'';
|
||||
}
|
||||
|
||||
|
||||
if (is_array($comment_id))
|
||||
$where_clause = 'id IN('.implode(',', $comment_id).')';
|
||||
else
|
||||
$where_clause = 'id = '.$comment_id;
|
||||
|
||||
|
||||
$query = '
|
||||
DELETE FROM '.COMMENTS_TABLE.'
|
||||
WHERE '.$where_clause.
|
||||
$user_where_clause.'
|
||||
;';
|
||||
|
||||
|
||||
if ( pwg_db_changes(pwg_query($query)) )
|
||||
{
|
||||
invalidate_user_cache_nb_comments();
|
||||
|
||||
email_admin('delete',
|
||||
email_admin('delete',
|
||||
array('author' => $GLOBALS['user']['username'],
|
||||
'comment_id' => $comment_id
|
||||
));
|
||||
@@ -383,9 +382,9 @@ UPDATE '.COMMENTS_TABLE.'
|
||||
$user_where_clause.'
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
|
||||
// mail admin and ask to validate the comment
|
||||
if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action)
|
||||
if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action)
|
||||
{
|
||||
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
|
||||
|
||||
@@ -411,7 +410,7 @@ $user_where_clause.'
|
||||
'content' => stripslashes($comment['content'])) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $comment_action;
|
||||
}
|
||||
|
||||
@@ -482,7 +481,7 @@ SELECT
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
list($author_id) = pwg_db_fetch_row($result);
|
||||
|
||||
return $author_id;
|
||||
@@ -499,7 +498,7 @@ function validate_user_comment($comment_id)
|
||||
$where_clause = 'id IN('.implode(',', $comment_id).')';
|
||||
else
|
||||
$where_clause = 'id = '.$comment_id;
|
||||
|
||||
|
||||
$query = '
|
||||
UPDATE '.COMMENTS_TABLE.'
|
||||
SET validated = \'true\'
|
||||
@@ -507,7 +506,7 @@ UPDATE '.COMMENTS_TABLE.'
|
||||
WHERE '.$where_clause.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
|
||||
invalidate_user_cache_nb_comments();
|
||||
trigger_notify('user_comment_validation', $comment_id);
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ SELECT id
|
||||
if ($notify_user and email_check_format($mail_address))
|
||||
{
|
||||
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
|
||||
|
||||
|
||||
$keyargs_content = array(
|
||||
get_l10n_args('Hello %s,', stripslashes($login)),
|
||||
get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
|
||||
@@ -262,7 +262,7 @@ SELECT id
|
||||
get_l10n_args('', ''),
|
||||
get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
|
||||
);
|
||||
|
||||
|
||||
pwg_mail(
|
||||
$mail_address,
|
||||
array(
|
||||
@@ -281,7 +281,7 @@ SELECT id
|
||||
'email'=>$mail_address,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
return $user_id;
|
||||
}
|
||||
else
|
||||
@@ -1050,7 +1050,7 @@ function pwg_password_verify($password, $hash, $user_id=null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Rehash using new hash.
|
||||
$hash = pwg_password_hash($password);
|
||||
|
||||
@@ -1088,7 +1088,7 @@ function try_log_user($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);
|
||||
add_event_handler('try_log_user', 'pwg_login');
|
||||
|
||||
/**
|
||||
* Default method for user login, can be overwritten with 'try_log_user' trigger.
|
||||
@@ -1447,7 +1447,7 @@ function get_sql_condition_FandF(
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns sql WHERE condition for recent photos/albums for current user.
|
||||
*
|
||||
* @param string $db_field
|
||||
|
||||
Reference in New Issue
Block a user