public function onCxnRegister($cxn, $params) {
    $storedCxn = $this->cxnStore->getByCxnId($cxn['cxnId']);

    if (!$storedCxn || $storedCxn['secret'] == $cxn['secret']) {
      $this->log->notice('Register cxnId="{cxnId}" siteUrl={siteUrl}: OK', array(
        'cxnId' => $cxn['cxnId'],
        'siteUrl' => $cxn['siteUrl'],
      ));
      $this->cxnStore->add($cxn);
      return $this->createSuccess(array(
        'cxn_id' => $cxn['cxnId'],
      ));
    }
    else {
      $this->log->warning('Register cxnId="{cxnId}" siteUrl="{siteUrl}": Secret does not match.', array(
        'cxnId' => $cxn['cxnId'],
        'siteUrl' => $cxn['siteUrl'],
      ));
      $this->createError('Secret does not match previous registration.');
    }
  }
public function onCxnRegister($cxn, $params) {
    $storedCxn = $this->cxnStore->getByCxnId($cxn['cxnId']);

    if (!$storedCxn || $storedCxn['secret'] == $cxn['secret']) {
      $this->log->notice('Register cxnId="{cxnId}" siteUrl={siteUrl}: OK', array(
        'cxnId' => $cxn['cxnId'],
        'siteUrl' => $cxn['siteUrl'],
      ));
      $this->cxnStore->add($cxn);
      return $this->createSuccess(array(
        'cxn_id' => $cxn['cxnId'],
      ));
    }
    else {
      $this->log->warning('Register cxnId="{cxnId}" siteUrl="{siteUrl}": Secret does not match.', array(
        'cxnId' => $cxn['cxnId'],
        'siteUrl' => $cxn['siteUrl'],
      ));
      $this->createError('Secret does not match previous registration.');
    }
  }
public function onCxnRegister ( $ cxn , $ params ) { $ storedCxn = $ this -> cxnStore -> getByCxnId ( $ cxn [ 'cxnId' ] ) ; if ( ! $ storedCxn || $ storedCxn [ 'secret' ] == $ cxn [ 'secret' ] ) { $ this -> log -> notice ( 'Register cxnId="{cxnId}" siteUrl={siteUrl}: OK' , array ( 'cxnId' => $ cxn [ 'cxnId' ] , 'siteUrl' => $ cxn [ 'siteUrl' ] , ) ) ; $ this -> cxnStore -> add ( $ cxn ) ; return $ this -> createSuccess ( array ( 'cxn_id' => $ cxn [ 'cxnId' ] , ) ) ; } else { $ this -> log -> warning ( 'Register cxnId="{cxnId}" siteUrl="{siteUrl}": Secret does not match.' , array ( 'cxnId' => $ cxn [ 'cxnId' ] , 'siteUrl' => $ cxn [ 'siteUrl' ] , ) ) ; $ this -> createError ( 'Secret does not match previous registration.' ) ; } }
Callback for Cxn.register.

@param array $cxn
The CXN record submitted by the client.
@param array $params
Additional parameters from the client.
@return array
Callback for Cxn . register .