function new_request_token($consumer, $callback = null) { $c = Doctrine::getTable('sfOauthServerConsumer')->findOneByConsumerKey($consumer->key); $key = md5(time()); $secret = time() + time(); $token = new OAuthToken($key, md5(md5($secret))); $token = new sfOauthServerRequestToken(); $token->setToken($key); $token->setSecret(md5(md5($secret))); $token->setConsumer($c); $token->setScope($c->getScope()); $token->save(); $token = new OAuthToken($token->getToken(), $token->getSecret()); return $token; }