<?php

class openidAction extends sfAction {
  public function execute($request) {

  }

  public function getOpenIdObject() {
    // Instantiate openid
    $identity = sfConfig::get('app_openid_service_uri');
    $controller = $this->getController();
    $openid = new sfPHPOpenID();
    $openid->setIdentity($identity);

    // Script which handles a response from OpenID Server
    $processUrl = $controller->genUrl('@openidLogin', true);
    $openid->setApprovedURL($processUrl);

    // Url of website
    $trustUrl = $controller->genUrl('@homepage', true);
    $openid->SetTrustRoot($trustUrl);

    return $openid;
  }
}
