forked from pkp/pkp-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp#10819 Unable to update OAuth scope for authenticated ORCIDs
- Loading branch information
Showing
17 changed files
with
646 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/mail/mailables/OrcidRequestUpdateScope.php | ||
* | ||
* Copyright (c) 2014-2025 Simon Fraser University | ||
* Copyright (c) 2000-2025 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class OrcidRequestUpdateScope | ||
* | ||
* @brief An automatic email sent to the update users' ORCID OAuth scope for member API deposits. | ||
*/ | ||
|
||
namespace PKP\mail\mailables; | ||
|
||
use APP\submission\Submission; | ||
use PKP\context\Context; | ||
use PKP\mail\Mailable; | ||
use PKP\mail\traits\Configurable; | ||
use PKP\mail\traits\OrcidVariables; | ||
use PKP\mail\traits\Recipient; | ||
use PKP\security\Role; | ||
|
||
class OrcidRequestUpdateScope extends Mailable | ||
{ | ||
use Configurable; | ||
use Recipient; | ||
use OrcidVariables; | ||
|
||
protected static ?string $name = 'orcid.orcidRequestUpdateScope.name'; | ||
protected static ?string $description = 'emails.orcidRequestUpdateScope.description'; | ||
protected static ?string $emailTemplateKey = 'ORCID_REQUEST_UPDATE_SCOPE'; | ||
protected static array $toRoleIds = [Role::ROLE_ID_AUTHOR, Role::ROLE_ID_REVIEWER]; | ||
|
||
public function __construct(Context $context, Submission $submission, string $oauthUrl) | ||
{ | ||
parent::__construct([$context, $submission]); | ||
$this->setupOrcidVariables($oauthUrl, $context); | ||
} | ||
|
||
public static function getDataDescriptions(): array | ||
{ | ||
/** | ||
* Adds ORCID URLs to email template | ||
*/ | ||
return array_merge( | ||
parent::getDataDescriptions(), | ||
static::getOrcidDataDescriptions() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
classes/migration/upgrade/v3_5_0/I10819_OrcidOauthScopeMail.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_5_0/I10819_OrcidOauthScopeMail.php | ||
* | ||
* Copyright (c) 2025 Simon Fraser University | ||
* Copyright (c) 2025 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I10819_OrcidOauthScopeMail | ||
* | ||
* @brief Add new email template for updating users' OAuth scope | ||
*/ | ||
|
||
namespace PKP\migration\upgrade\v3_5_0; | ||
|
||
use APP\facades\Repo; | ||
use PKP\install\DowngradeNotSupportedException; | ||
use PKP\migration\Migration; | ||
|
||
class I10819_OrcidOauthScopeMail extends Migration | ||
{ | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function up(): void | ||
{ | ||
Repo::emailTemplate()->dao->installEmailTemplates( | ||
Repo::emailTemplate()->dao->getMainEmailTemplatesFilename(), | ||
[], | ||
'ORCID_REQUEST_UPDATE_SCOPE', | ||
true, | ||
); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
* @throws DowngradeNotSupportedException | ||
*/ | ||
public function down(): void | ||
{ | ||
throw new DowngradeNotSupportedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.