-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #401 from GOCDB/hotfix-5.10-access_test
Add an access_test method to API to master
- Loading branch information
Showing
4 changed files
with
53 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* Class to manage output of the Access Test result | ||
*/ | ||
|
||
namespace org\gocdb\services; | ||
|
||
use SimpleXMLElement; | ||
|
||
class AccessTest | ||
{ | ||
/** | ||
* @return string XML used to signal successful authorization return | ||
*/ | ||
public function getRenderingOutput() | ||
{ | ||
$xmlElem = new SimpleXMLElement("<results />"); | ||
$xmlElem->addAttribute('identifier', Get_User_Principle_PI()); | ||
$xmlElem->addChild('authorized', 'true'); | ||
|
||
$domSxe = dom_import_simplexml($xmlElem); | ||
|
||
$dom = new \DOMDocument('1.0'); | ||
$dom->encoding = 'UTF-8'; | ||
$domSxe = $dom->importNode($domSxe, true); | ||
$domSxe = $dom->appendChild($domSxe); | ||
$dom->formatOutput = true; | ||
|
||
return $dom->saveXML(); | ||
} | ||
} |