-
Notifications
You must be signed in to change notification settings - Fork 4
CFM-103_LDAP_server_mvc #374
Open
Ioannis
wants to merge
4
commits into
COmanage:develop
Choose a base branch
from
Ioannis:CFM-103_LDAP_server_mvc
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,130
−4
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
435c58c
Add LdapServer MVC
Ioannis 9c096bb
Added common ldap server codes enum file. Added basic transaction met…
Ioannis 4362438
Add more ldap server helper function for interacting with the server.…
Ioannis fdaf7c3
fix phpdoc since version number
Ioannis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
61 changes: 61 additions & 0 deletions
61
app/plugins/CoreServer/src/Controller/LdapServersController.php
This file contains hidden or 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,61 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Registry LDAP Servers 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.3.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace CoreServer\Controller; | ||
|
|
||
| use Cake\Event\EventInterface; | ||
| use App\Controller\StandardPluginController; | ||
|
|
||
| class LdapServersController extends StandardPluginController { | ||
| protected array $paginate = [ | ||
| 'order' => [ | ||
| 'LdapServers.serverurl' => 'asc' | ||
| ] | ||
| ]; | ||
|
|
||
|
|
||
| /** | ||
| * Callback run prior to the request render. | ||
| * | ||
| * @param EventInterface $event Cake Event | ||
| * @return \Cake\Http\Response|null|void | ||
| * @since COmanage Registry v5.2.0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v5.3.0 |
||
| */ | ||
| public function beforeRender(EventInterface $event) { | ||
| $link = $this->getPrimaryLink(true); | ||
|
|
||
| if(!empty($link->value)) { | ||
| $this->set('vv_bc_parent_obj', $this->LdapServers->Servers->get($link->value)); | ||
| $this->set('vv_bc_parent_displayfield', $this->LdapServers->Servers->getDisplayField()); | ||
| $this->set('vv_bc_parent_primarykey', $this->LdapServers->Servers->getPrimaryKey()); | ||
| } | ||
|
|
||
| return parent::beforeRender($event); | ||
| } | ||
| } | ||
40 changes: 40 additions & 0 deletions
40
app/plugins/CoreServer/src/Lib/Enum/LdapCommonCodesEnum.php
This file contains hidden or 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,40 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Registry LDAP Common Codes Enum | ||
| * | ||
| * 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-plugins | ||
| * @since COmanage Registry v5.3.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace CoreServer\Lib\Enum; | ||
|
|
||
| use App\Lib\Enum\StandardEnum; | ||
|
|
||
| class LdapCommonCodesEnum extends StandardEnum | ||
| { | ||
| const int LDAP_NO_SUCH_OBJECT = 0x20; // 32 | ||
| const int LDAP_ENTRY_ALREADY_EXISTS = 0x44; // 68 | ||
| // Application/internal code (not from ldap_errno()): | ||
| const int LDAP_CONNECT_ERROR = 0x5b; // 91 (internal) | ||
| } |
This file contains hidden or 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,56 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Registry LDAP Servers Entity | ||
| * | ||
| * 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.3.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace CoreServer\Model\Entity; | ||
|
|
||
| use Cake\ORM\Entity; | ||
|
|
||
| class LdapServer extends Entity { | ||
| use \App\Lib\Traits\EntityMetaTrait; | ||
|
|
||
| /** | ||
| * Fields that can be mass assigned using newEntity() or patchEntity(). | ||
| * | ||
| * @var array<string, bool> | ||
| */ | ||
| protected array $_accessible = [ | ||
| '*' => true, | ||
| 'id' => false, | ||
| 'slug' => false, | ||
| ]; | ||
|
|
||
| /** | ||
| * Fields that are excluded from JSON versions of the entity. | ||
| * | ||
| * @var array | ||
| */ | ||
| protected array $_hidden = [ | ||
| 'password' | ||
| ]; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The messages should be grouped together as the rest of the file is grouped, so
errormessages with othererrormessages,fieldmessages with otherfieldmessages, etc.