-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of EmailAddress (CFM-14) and Identifier (CFM-15)
- Loading branch information
Benn Oshrin
committed
Jan 26, 2022
1 parent
9ccb9cc
commit 7037c3b
Showing
24 changed files
with
920 additions
and
20 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
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 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 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,64 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Registry Email Addresses Controller | ||
| * | ||
| * Portions licensed to the University Corporation for Advanced Internet | ||
| * Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
| * See the NOTICE file distributed with this work for additional information | ||
| * regarding copyright ownership. | ||
| * | ||
| * UCAID licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with the | ||
| * License. You may obtain a copy of the License at: | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * @link https://www.internet2.edu/comanage COmanage Project | ||
| * @package registry | ||
| * @since COmanage Registry v5.0.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace App\Controller; | ||
|
|
||
| // XXX not doing anything with Log yet | ||
| use Cake\Log\Log; | ||
| use Cake\ORM\TableRegistry; | ||
|
|
||
| class EmailAddressesController extends MVEAController { | ||
| public $pagination = [ | ||
| 'order' => [ | ||
| 'EmailAddresses.mail' => 'asc' | ||
| ] | ||
| ]; | ||
|
|
||
| /** | ||
| * Callback run prior to the request render. | ||
| * | ||
| * @since COmanage Registry v5.0.0 | ||
| * @param EventInterface $event Cake Event | ||
| * @return \Cake\Http\Response HTTP Response | ||
| */ | ||
|
|
||
| public function beforeRender(\Cake\Event\EventInterface $event) { | ||
| if(!$this->request->is('restful')) { | ||
| // XXX maybe $CoSettings should be available via AppController, like $this->getCOID()? | ||
| $CoSettings = TableRegistry::getTableLocator()->get('CoSettings'); | ||
|
|
||
| $settings = $CoSettings->find()->where(['co_id' => $this->getCOID()])->firstOrFail(); | ||
|
|
||
| // XXX move this into MVEAController or a trait | ||
| $this->set('vv_default_type', $settings->email_address_default_type_id); | ||
| } | ||
|
|
||
| return parent::beforeRender($event); | ||
| } | ||
| } |
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,64 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Registry Identifiers Controller | ||
| * | ||
| * Portions licensed to the University Corporation for Advanced Internet | ||
| * Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
| * See the NOTICE file distributed with this work for additional information | ||
| * regarding copyright ownership. | ||
| * | ||
| * UCAID licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with the | ||
| * License. You may obtain a copy of the License at: | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * @link https://www.internet2.edu/comanage COmanage Project | ||
| * @package registry | ||
| * @since COmanage Registry v5.0.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace App\Controller; | ||
|
|
||
| // XXX not doing anything with Log yet | ||
| use Cake\Log\Log; | ||
| use Cake\ORM\TableRegistry; | ||
|
|
||
| class IdentifiersController extends MVEAController { | ||
| public $pagination = [ | ||
| 'order' => [ | ||
| 'Identifiers.identifier' => 'asc' | ||
| ] | ||
| ]; | ||
|
|
||
| /** | ||
| * Callback run prior to the request render. | ||
| * | ||
| * @since COmanage Registry v5.0.0 | ||
| * @param EventInterface $event Cake Event | ||
| * @return \Cake\Http\Response HTTP Response | ||
| */ | ||
|
|
||
| public function beforeRender(\Cake\Event\EventInterface $event) { | ||
| if(!$this->request->is('restful')) { | ||
| // XXX maybe $CoSettings should be available via AppController, like $this->getCOID()? | ||
| $CoSettings = TableRegistry::getTableLocator()->get('CoSettings'); | ||
|
|
||
| $settings = $CoSettings->find()->where(['co_id' => $this->getCOID()])->firstOrFail(); | ||
|
|
||
| // XXX move this into MVEAController or a trait | ||
| $this->set('vv_default_type', $settings->identifier_default_type_id); | ||
| } | ||
|
|
||
| return parent::beforeRender($event); | ||
| } | ||
| } |
Oops, something went wrong.