$cv = $doc->getcv(); if (!$cv) { throw new Exception("No CV # {$id}", __LINE__); } // access 0 - public, 1 - to whom I applied only, 2 - private (me only) if ($cv->cv_status != 0 && !$ACCESS) { throw new Exception("Access Denied", __LINE__); } // here, on this site status==1 effectively means the same as status==2 $key = substr(md5($cv->filename . $doc->fname . $doc->lname), 0, 8); if ($key !== $action) { throw new Exception("Invalid Link", __LINE__); } if ($refer) { // not MSIE or second pass $doc->sendcv($cv); exit; } else { $showcv = $id; } // msie would not let save files from such links, we need to show some page first } catch (Exception $e) { $result = false; $mesg = 'Can not send CV: ' . $e->getMessage() . ' (' . $e->getCode() . ')'; } } $cvacc = 0; if ($UUID && $ACCESS && $docid) { try { if (!$db) { $db = db_career();