You are here

function certificate_node_certificate in Certificate 6

Same name and namespace in other branches
  1. 8.3 certificate.pages.inc \certificate_node_certificate()
  2. 6.2 certificate.pages.inc \certificate_node_certificate()
  3. 7.3 certificate.pages.inc \certificate_node_certificate()
  4. 7.2 certificate.pages.inc \certificate_node_certificate()
  5. 3.x certificate.pages.inc \certificate_node_certificate()

Get certificate for a specific node.

1 string reference to 'certificate_node_certificate'
certificate_menu in ./certificate.module
Implementation of hook_menu().

File

./certificate.pages.inc, line 14
Builds the module's user-facing pages.

Code

function certificate_node_certificate($node) {
  global $user;
  if ($user->uid) {
    $account = $user;
  }
  $perm = certificate_can_access_certificate($node, $user);
  if ($perm != 1) {

    //$perm is a string! show error.
    return $perm;
  }

  // Use account of a different user if allowed.
  if (user_access('administer certificates') && arg(3) > 0) {
    $account = user_load(arg(3));
  }
  return certificate_single($account, $node);
}