public function executeAsociate_account(sfWebRequest $request)
 {
     $token = $request->getParameter('token-account');
     $pk_practil = $this->getUser()->getAttribute('s_pk_practil_associate_account', null);
     $email = $request->getParameter('email-account');
     if ($token == md5('p-10004')) {
         if ($pk_practil != null) {
             $lib = new practil_lib();
             $url = $lib->url_practil_associate_account($email);
             $respuesta_servicio = file_get_contents($url);
             $decode = json_decode($respuesta_servicio);
             if ($decode->{'success'}) {
                 $new_user = new UserSc();
                 $new_user->setEmail($email);
                 $new_user->setPassword('practil');
                 $new_user->setFlag('1');
                 $new_user->setProfile($decode->{'accountpk'});
                 $new_user->save();
                 return sfView::SUCCESS;
             } else {
                 $this->getUser()->setAttribute('s_pk_practil_associate_account', null);
                 return sfView::ERROR;
             }
         } else {
             $this->getUser()->setAttribute('s_pk_practil_associate_account', null);
             return sfView::ERROR;
         }
     } else {
         $this->getUser()->setAttribute('s_pk_practil_associate_account', null);
         return sfView::ERROR;
     }
 }
 /**
  * Declares an association between this object and a UserSc object.
  *
  * @param      UserSc $v
  * @return     TreeUser The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setUserSc(UserSc $v = null)
 {
     if ($v === null) {
         $this->setUserId(NULL);
     } else {
         $this->setUserId($v->getId());
     }
     $this->aUserSc = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the UserSc object, it will not be re-added.
     if ($v !== null) {
         $v->addTreeUser($this);
     }
     return $this;
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      UserSc $value A UserSc object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(UserSc $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }