|
|
| 413 |
* @see lib/pkp/classes/handler/PKPHandler#validate() |
413 |
* @see lib/pkp/classes/handler/PKPHandler#validate() |
| 414 |
* @param $request Request |
414 |
* @param $request Request |
| 415 |
* @param $articleId integer |
415 |
* @param $articleId integer |
| 416 |
* @param $galleyId integer |
416 |
* @param $galleyId int or string |
| 417 |
*/ |
417 |
*/ |
| 418 |
function validate(&$request, $articleId, $galleyId = null) { |
418 |
function validate(&$request, $articleId, $galleyId = null) { |
| 419 |
$router =& $request->getRouter(); |
419 |
$router =& $request->getRouter(); |
|
|
| 460 |
$isSubscribedDomain = IssueAction::subscribedDomain($journal, $issue->getId(), $articleId); |
460 |
$isSubscribedDomain = IssueAction::subscribedDomain($journal, $issue->getId(), $articleId); |
| 461 |
|
461 |
|
| 462 |
// Check if login is required for viewing. |
462 |
// Check if login is required for viewing. |
| 463 |
if (!$isSubscribedDomain && !Validation::isLoggedIn() && $journal->getSetting('restrictArticleAccess') && isset($galleyId) && $galleyId != 0) { |
463 |
if (!$isSubscribedDomain && !Validation::isLoggedIn() && $journal->getSetting('restrictArticleAccess') && isset($galleyId) && $galleyId) { |
| 464 |
Validation::redirectLogin(); |
464 |
Validation::redirectLogin(); |
| 465 |
} |
465 |
} |
| 466 |
|
466 |
|
| 467 |
// bypass all validation if subscription based on domain or ip is valid |
467 |
// bypass all validation if subscription based on domain or ip is valid |
| 468 |
// or if the user is just requesting the abstract |
468 |
// or if the user is just requesting the abstract |
| 469 |
if ( (!$isSubscribedDomain && $subscriptionRequired) && |
469 |
if ( (!$isSubscribedDomain && $subscriptionRequired) && |
| 470 |
(isset($galleyId) && $galleyId!=0) ) { |
470 |
(isset($galleyId) && $galleyId) ) { |
| 471 |
|
471 |
|
| 472 |
// Subscription Access |
472 |
// Subscription Access |
| 473 |
$subscribedUser = IssueAction::subscribedUser($journal, $issue->getId(), $articleId); |
473 |
$subscribedUser = IssueAction::subscribedUser($journal, $issue->getId(), $articleId); |
|
|
| 483 |
if ( $paymentManager->onlyPdfEnabled() ) { |
483 |
if ( $paymentManager->onlyPdfEnabled() ) { |
| 484 |
$galleyDAO =& DAORegistry::getDAO('ArticleGalleyDAO'); |
484 |
$galleyDAO =& DAORegistry::getDAO('ArticleGalleyDAO'); |
| 485 |
if ($journal->getSetting('enablePublicGalleyId')) { |
485 |
if ($journal->getSetting('enablePublicGalleyId')) { |
| 486 |
$galley =& $galleyDAO->getGalley($galleyId, $articleId); |
|
|
| 487 |
} else { |
| 488 |
$galley =& $galleyDAO->getGalleyByBestGalleyId($galleyId, $articleId); |
486 |
$galley =& $galleyDAO->getGalleyByBestGalleyId($galleyId, $articleId); |
|
|
487 |
} else { |
| 488 |
$galley =& $galleyDAO->getGalley($galleyId, $articleId); |
| 489 |
} |
489 |
} |
| 490 |
if ( $galley && !$galley->isPdfGalley() ) { |
490 |
if ( $galley && !$galley->isPdfGalley() ) { |
| 491 |
$this->journal =& $journal; |
491 |
$this->journal =& $journal; |