This is the code used by someone:
/**
* @Implement of hook_comment()
*/
function mycaptcha_comment(&$comment, $op) {
global $user;
switch ($op) {
case 'insert':
if (isset($_SESSION['mycaptcha_ask_key'])) {
// unset the information
unset($_SESSION['mycaptcha_ask_key']);
}
break;
case 'validate':
if ($comment['mycaptcha_ask']) {
// validate the information
mycaptcha_ask_form_validate($comment['mycaptcha_ask']);
}
break;
}
}
On the above code, why is he using global $user;
? I see he doesn't use $user
in his code.