Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r326 - registry/trunk/app/Controller

Subject: COmanage Developers List

List archive

[comanage-dev] r326 - registry/trunk/app/Controller


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r326 - registry/trunk/app/Controller
  • Date: Wed, 25 Jul 2012 10:51:55 -0400

Author: benno
Date: 2012-07-25 10:51:55 -0400 (Wed, 25 Jul 2012)
New Revision: 326

Modified:
registry/trunk/app/Controller/VootController.php
Log:
Handle extension parsing for VOOT (CO-396)

Modified: registry/trunk/app/Controller/VootController.php
===================================================================
--- registry/trunk/app/Controller/VootController.php 2012-07-25 00:58:11
UTC (rev 325)
+++ registry/trunk/app/Controller/VootController.php 2012-07-25 14:51:55
UTC (rev 326)
@@ -58,13 +58,30 @@
// Run the auth check
parent::beforeFilter();

- if(isset($this->params['memberid'])) {
+ $memberid = isset($this->params['memberid']) ? $this->params['memberid']
: null;
+ $groupid = isset($this->params['groupid']) ? $this->params['groupid'] :
null;
+
+ if(isset($this->params['ext'])) {
+ // Because the non-VOOT API calls accept a formatting notation as an
extension
+ // (eg: /cos.json, /co_people.xml) and the VOOT API calls don't, part
of our
+ // identifier may have been parsed into an extension (eg:
foo.internet2 / edu).
+ // Practically, this only applies to memberid at the moment since
groupid is
+ // expected to be numeric, but we'll handle the groupid case anyway.
+
+ if($memberid && !$groupid) {
+ $memberid .= "." . $this->params['ext'];
+ } elseif($groupid) {
+ $groupid .= "." . $this->params['ext'];
+ }
+ }
+
+ if($memberid) {
// Map the provided identifier to one or more CO Person IDs.

try {
// XXX We should really provide an identifier type. Instead, we'll
just
// take the first person returned.
- $coppl =
$this->CoPerson->idsForIdentifier($this->params['memberid'], null);
+ $coppl = $this->CoPerson->idsForIdentifier($memberid, null);

if(!empty($coppl)) {
$this->coPersonIdReq = $coppl[0];
@@ -86,8 +103,8 @@
}

// We just copy the Group ID if set
- if(isset($this->params['groupid'])) {
- $this->coGroupIdReq = $this->params['groupid'];
+ if($groupid) {
+ $this->coGroupIdReq = $groupid;
}
}




  • [comanage-dev] r326 - registry/trunk/app/Controller, svnlog, 07/25/2012

Archive powered by MHonArc 2.6.16.

Top of Page