Ejemplo n.º 1
0
 /**
  * Execute the api call to unlink the subject from the principal.
  */
 public function execute()
 {
     $response = 1;
     $mapper = Social_IdMappingService::create();
     $mapper->unlink($this->getAppId(), $this->snid, $this->sid);
     $response = 0;
     return $response;
 }
Ejemplo n.º 2
0
 /**
  * Execute the api call to get user app list.
  */
 public function execute()
 {
     error_log("Mapping user in the right method");
     $response = 1;
     $mapper = Social_IdMappingService::create();
     $mapper->link($this->aid, $this->nid, $this->uid, $this->snid, $this->sid);
     $response = 0;
     return $response;
 }
Ejemplo n.º 3
0
 public function execute()
 {
     $mapper = Social_IdMappingService::create();
     $subjects = array();
     if (null != $this->m_pid) {
         $subjects = $mapper->mapPrincipalToSubjects($this->m_aid, $this->m_pid);
     } else {
         $subjects = $mapper->mapSubjectToSubjects($this->m_aid, $this->m_nid, $this->m_uid);
     }
     $result = array();
     foreach ($subjects as $subject) {
         $result['subject'][] = $subject;
     }
     return $result;
 }
Ejemplo n.º 4
0
 /**
  * Execute the api call to get user app list.
  */
 public function execute()
 {
     $mapper = Social_IdMappingService::create();
     $pids = explode(",", $this->pids);
     $responses = array();
     if (isset($this->network) && !$this->isEmpty($this->network)) {
         // In this case, the user is passing in PIDs and requesting them to be converted to subjects in the network's space
         $responses = $mapper->mapPrincipalsToSubjects($this->application, $this->network, $pids);
     } else {
         // If there is no network ID or requested network, this is a no-op.
         $responses = array_combine($pids, $pids);
     }
     $final_result = array();
     foreach ($responses as $pid => $uid) {
         $final_result['idmap'][] = array('uid' => $uid, 'pid' => $pid);
     }
     return $final_result;
 }