[Fusionforge-commits] r14324 - in trunk/src/plugins/oauthconsumer: common include www

Madhumita Dhar mdhar at fusionforge.org
Wed Sep 7 18:20:38 CEST 2011


Author: mdhar
Date: 2011-09-07 18:20:38 +0200 (Wed, 07 Sep 2011)
New Revision: 14324

Added:
   trunk/src/plugins/oauthconsumer/include/access_token_api.php
   trunk/src/plugins/oauthconsumer/www/access_token_delete.php
   trunk/src/plugins/oauthconsumer/www/access_tokens.php
   trunk/src/plugins/oauthconsumer/www/callback.php
   trunk/src/plugins/oauthconsumer/www/get_access_token.php
Modified:
   trunk/src/plugins/oauthconsumer/common/oauthconsumer-init.php
   trunk/src/plugins/oauthconsumer/include/fusionforge_oauth_datastore.php
   trunk/src/plugins/oauthconsumer/www/checks.php
   trunk/src/plugins/oauthconsumer/www/index.php
Log:
adding support for retrieving access tokens from providers and managing them

Modified: trunk/src/plugins/oauthconsumer/common/oauthconsumer-init.php
===================================================================
--- trunk/src/plugins/oauthconsumer/common/oauthconsumer-init.php	2011-09-07 14:14:17 UTC (rev 14323)
+++ trunk/src/plugins/oauthconsumer/common/oauthconsumer-init.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -23,6 +23,7 @@
 require_once $gfplugins.'oauthconsumer/include/oauthconsumerPlugin.class.php' ;
 require_once $gfplugins.'oauthconsumer/include/fusionforge_oauth_datastore.php';
 require_once $gfplugins.'oauthconsumer/include/provider_api.php';
+require_once $gfplugins.'oauthconsumer/include/access_token_api.php';
 
 $oauthconsumerPluginObject = new oauthconsumerPlugin ;
 

Added: trunk/src/plugins/oauthconsumer/include/access_token_api.php
===================================================================
--- trunk/src/plugins/oauthconsumer/include/access_token_api.php	                        (rev 0)
+++ trunk/src/plugins/oauthconsumer/include/access_token_api.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -0,0 +1,99 @@
+<?php
+require_once('OAuth.php');
+
+class OAuthAccessToken extends OAuthToken {
+	
+	protected $id;
+	protected $provider_id;
+	protected $user_id;
+	protected $time_stamp;
+	
+	function __construct( $provider_id, $key, $secret, $user_id, $time_stamp=null, $id=0) {
+		parent::__construct($key, $secret);
+		$this->id = $id;
+		$this->provider_id = $provider_id;
+		$this->user_id = $user_id;
+		$this->time_stamp = $time_stamp;
+	}
+	
+	public function get_id()	{
+		return $this->id;
+	}
+	
+	public function set_id($id) 	{
+		$this->id = $id;
+	}
+	
+	public function get_provider_id()	{
+		return $this->provider_id;
+	}
+	
+	public function get_token_key() {
+		return $this->key;
+	}
+	
+	public function get_token_secret() {
+		return $this->secret;
+	}
+	
+	public function get_user_id() {
+		return $this->user_id;
+	}
+	
+	public function get_time_stamp() {
+		return $this->time_stamp;
+	}
+	
+	static function convert_row_to_object($row)	{
+		if($row!=null)	{
+			$access_token = new OAuthAccessToken($row['provider_id'], $row['token_key'], $row['token_secret'], $row['user_id'], $row['time_stamp'], $row['id']);
+			return $access_token;
+		}else {
+			return null;
+		}
+	}
+	
+	static function get_access_token($id) {
+		$conn = FFOAuthDataStore::singleton();
+		$row = $conn->find_token_from_id($id);
+		$access_token = self::convert_row_to_object($row);
+		return $access_token;
+	}
+	
+	static function get_all_access_tokens($user_id) {
+		$conn = FFOAuthDataStore::singleton();
+		$rows = $conn->find_all_access_tokens($user_id);
+		$access_tokens = array();
+		foreach ($rows as $row)	{
+			$access_token = OAuthAccessToken::convert_row_to_object($row);
+			$access_tokens[] = $access_token;
+		}
+		return $access_tokens;
+	}
+	
+	function write_to_db() {
+		if ( strlen(trim( $this->get_provider_id() ))==0 || strlen(trim( $this->get_user_id() ))==0 || strlen(trim( $this->get_token_key() ))==0 || strlen(trim( $this->get_token_secret() ))==0 ) {
+			exit_error( "Error trying to add the access token. Some required parameters are not set.", 'oauthconsumer' );
+		}
+		$conn = FFOAuthDataStore::singleton();
+		$id = $conn->save_access_token($this);
+		if(!$id)	{
+			exit_error("Error trying to add access token to DB", 'oauthconsumer');
+		}else {
+			$this->set_id($id);
+		}
+	}
+	
+	function delete()	{
+		$conn = FFOAuthDataStore::singleton();
+		$id = $this->get_id();
+		if($id!=0)	{
+			if(!($conn->delete_access_token($id)))	{
+				exit_error("Error trying to delete access token from DB", 'oauthconsumer');
+			}
+		}else 	{
+			exit_error("Trying to delete non-existent access token from DB", 'oauthconsumer');
+		}
+	}
+	
+}
\ No newline at end of file

Modified: trunk/src/plugins/oauthconsumer/include/fusionforge_oauth_datastore.php
===================================================================
--- trunk/src/plugins/oauthconsumer/include/fusionforge_oauth_datastore.php	2011-09-07 14:14:17 UTC (rev 14323)
+++ trunk/src/plugins/oauthconsumer/include/fusionforge_oauth_datastore.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -178,7 +178,139 @@
 		db_commit();
 		return true;
 	}
+	
+	/**
+	* Saves an OAuthAccessToken to the DB
+	*
+	* @param OAuthAccessToken $token
+	* @return int the token ID in the DB
+	*/
+	public function save_access_token($token) {
+	
+		$t_token_table = "plugin_oauthconsumer_access_token";
+		$time_stamp = time();
+		$token_id = $token->get_id();
+		if ( 0 == $token_id ) {
+			# create
+			$t_query = "INSERT INTO $t_token_table ( provider_id, token_key, token_secret, user_id, time_stamp ) VALUES ($1, $2, $3, $4, $5)";
+			$t_result = db_query_params( $t_query, array( $token->get_provider_id(), $token->get_token_key(), $token->get_token_secret(), $token->get_user_id(), $time_stamp ) );
+		
+			$token_id = db_insertid($t_result, $t_token_table, 'id');
+			return $token_id;
+		}
+		else { # TODO feature to be added later, with lifetime/limited access feature support
+			//$t_query = "UPDATE $t_token_table SET provider_id=$1, token_key=$2, token_secret=$3, user_id=$4, time_stamp=$4 WHERE id=$5";
+			//db_query_params( $t_query, array( $token->getproviderId(), $token->key, $token->secret, $token->getUserId(), $token->gettime_stamp(), $token->getId() ) );
+			exit_error("The access token already exists and cannot be modified.", 'oauthconsumer');
+		}
+	
+	}
 
+	/**
+	* Retrieve a table of columns values for all access tokens (of a user)
+	*
+	* @param int $user_id
+	* @return array of arrays of column values
+	*/
+	public function find_all_access_tokens($user_id) {
+		$t_token_table = "plugin_oauthconsumer_access_token";
+		if(isset($user_id)||($user_id)) {
+			$t_query = "SELECT * FROM $t_token_table WHERE user_id = $1";
+			$t_result = db_query_params( $t_query, array( (int) $user_id ) );
+				
+		}
+		$t_rows = array();
 	
+		while ( $t_row = db_fetch_array( $t_result ) ) {
+			$t_rows[] = $t_row;
+		}
+	
+		return $t_rows;
+	}
+	
+	/**
+	* Retrieve values of columns for a token in the DB provided its key
+	*
+	* @param string $token_key
+	* @return array of column values
+	*/
+	public function find_access_token_from_key($token_key) {
+		$t_token_table = "plugin_oauthconsumer_access_token";
+	
+		$t_query = "SELECT * FROM $t_token_table WHERE token_key = $1";
+		$t_result = db_query_params( $t_query, array( $token_key ) );
+	
+		if ( db_numrows( $t_result ) < 1 ) {
+			return null;
+		}
+	
+		$t_row = db_fetch_array( $t_result );	
+		return $t_row;
+	}
+	
+	/**
+	 * Retrieve values of columns for a token in the DB provided its id
+	 *
+	 * @param int $token_id
+	 * @return array of column values
+	 */
+	public function find_token_from_id($token_id) {
+		$t_token_table = "plugin_oauthconsumer_access_token";
+	
+		$t_query = "SELECT * FROM $t_token_table WHERE id = $1";
+		$t_result = db_query_params( $t_query, array( (int) $token_id ) );
+	
+		if ( db_numrows( $t_result ) < 1 ) {
+			return null;
+		}
+	
+		$t_row = db_fetch_array( $t_result );	
+		return $t_row;
+	}
+	
+	/**
+	 * Retrieve a table of columns values for all tokens issued for a provider (and a user)
+	 *
+	 * @param int $provider_id
+	 * @param int $user_id
+	 * @return array of arrays of column values
+	 */
+	public function find_access_tokens_by_provider($provider_id, $user_id) {
+		$t_token_table = "plugin_oauthconsumer_access_token";
+	
+		if(isset($user_id)) {
+			$t_query = "SELECT * FROM $t_token_table WHERE provider_id = $1 AND user_id = $2";
+			$t_result = db_query_params( $t_query, array( (int) $provider_id, (int) $user_id ) );
+		}
+	
+		$t_rows = array();
+	
+		while ( $t_row = db_fetch_array( $t_result ) ) {
+			$t_rows[] = $t_row;
+		}
+	
+		return $t_rows;
+	}
+	
+	/**
+	* Deletes an access token from the DB
+	*
+	* @param string $token_type
+	* @param int $token_id
+	*/
+	function delete_access_token($token_id) {
+		$t_token_table = "plugin_oauthconsumer_access_token";
+	
+		$t_query = "DELETE FROM $t_token_table WHERE id=$1";
+		$t_result = db_query_params( $t_query, array( (int) $token_id ) );
+		
+		if (!$t_result) {
+			db_rollback();
+			return false;
+		}
+		
+		db_commit();
+		return true;
+	}
 
 }

Added: trunk/src/plugins/oauthconsumer/www/access_token_delete.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/access_token_delete.php	                        (rev 0)
+++ trunk/src/plugins/oauthconsumer/www/access_token_delete.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -0,0 +1,17 @@
+<?php
+
+require_once('../../env.inc.php');
+require_once 'checks.php';
+
+oauthconsumer_CheckUser();
+
+if(!form_key_is_valid(getStringFromRequest('plugin_oauthconsumer_delete_access_token')))	{
+	exit_form_double_submit();
+}
+
+$token_id = getStringFromGet('token_id');
+$token = OAuthAccessToken::get_access_token($token_id);
+$token->delete();
+
+form_release_key(getStringFromRequest('plugin_oauthconsumer_delete_access_token'));
+session_redirect( '/plugins/'.$pluginname.'/access_tokens.php');

Added: trunk/src/plugins/oauthconsumer/www/access_tokens.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/access_tokens.php	                        (rev 0)
+++ trunk/src/plugins/oauthconsumer/www/access_tokens.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -0,0 +1,34 @@
+<?php
+
+require_once('../../env.inc.php');
+require_once 'checks.php';
+
+oauthconsumer_CheckUser();
+
+$userid = session_get_user()->getID();
+$access_tokens = OAuthAccessToken::get_all_access_tokens($userid);
+
+if(count($access_tokens)>0)	{	
+	echo $HTML->boxTop(_('OAuth Access Tokens'));
+	echo $HTML->listTableTop(array(_('Provider'), _('Consumer Key'), _('Consumer Secret'), '', ''));	
+	$i = 0;
+	foreach( $access_tokens as $token ) { ?>
+		<tr <?php echo $HTML->boxGetAltRowStyle($i++) ?>>
+		<td class="center"><?php echo ( OAuthProvider::get_provider($token->get_provider_id())->get_name() ) ?></td>
+	    <td class="center"><?php echo ( $token->get_token_key() ) ?></td>
+		<td class="center"><?php echo ( $token->get_token_secret() ) ?></td>
+		<td class="center">
+			<?php print util_make_link('/plugins/'.$pluginname.'/access_token_delete.php?token_id=' . $token->get_id() . '&plugin_oauthconsumer_delete_access_token='.form_generate_key(), _('Delete')); ?>
+		</td></tr>		
+		<?php 
+	} 
+	echo $HTML->listTableBottom();
+	echo $HTML->boxBottom();
+	echo util_make_link('/plugins/'.$pluginname.'/get_access_token.php', _('Get more access tokens')).'<br /> ';
+}
+else {
+	echo '<p>'. _('You have no OAuth Access Tokens registered in the database currently').'</p>';
+}
+
+
+site_user_footer(array());
\ No newline at end of file

Added: trunk/src/plugins/oauthconsumer/www/callback.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/callback.php	                        (rev 0)
+++ trunk/src/plugins/oauthconsumer/www/callback.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -0,0 +1,65 @@
+<?php
+require_once('../../env.inc.php');
+require_once 'checks.php';
+
+oauthconsumer_CheckUser();
+
+$verifier = $_GET['oauth_verifier']?$_GET['oauth_verifier']:getStringFromPost('oauth_verifier');
+$token = $_GET['oauth_token']?$_GET['oauth_token']:getStringFromPost('oauth_token');
+
+if(!$verifier || !$token)	{
+	exit_error("OAuth parameters not found.");
+}
+?>
+<form action="callback.php" method="post">
+	<?php 
+	echo '<input type="hidden" name="oauth_verifier" value="'.$verifier.'"/>';
+	echo '<input type="hidden" name="oauth_token" value="'.$token.'"/>';
+	echo '<input type="hidden" name="provider_id" value="'.$_COOKIE['PROVIDER'].'"/>';
+	echo _('<b>Step 3: </b>Exchange the authorized request token for an access token');?>
+	<br>
+	<input type="submit" value="<?php echo _('Go') ?>"
+</form>
+<?php 
+$f_provider_id = getStringFromPost('provider_id');
+
+if($f_provider_id)	{
+	$provider = OAuthProvider::get_provider($f_provider_id);
+	$provider_name = $provider->get_name();
+	$consumer_key = $provider->get_consumer_key();
+	$consumer_secret = $provider->get_consumer_secret();
+	$request_token_url = $provider->get_request_token_url();
+	$authorize_url = $provider->get_authorize_url();
+	$access_token_url = $provider->get_access_token_url();
+		
+	$parameters = array("oauth_verifier"=>$verifier, "oauth_token"=>$token);
+	
+	$ff_consumer = new OAuthConsumer($consumer_key, $consumer_secret);
+	$oauth_request_token = new OAuthToken($_COOKIE['OAUTH_TOKEN'], $_COOKIE['OAUTH_TOKEN_SECRET']);
+	
+	$ff_request2 = OAuthRequest::from_consumer_and_token($ff_consumer, false, "GET", $access_token_url, $parameters);
+	$hmac = new OAuthSignatureMethod_HMAC_SHA1();
+	$ff_request2->sign_request($hmac, $ff_consumer, $oauth_request_token);
+	
+	//sending request with curl
+	$curl = curl_init();
+	
+	curl_setopt($curl, CURLOPT_URL, $ff_request2->to_url());
+	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+	
+	$access_token_string = curl_exec ($curl);
+	curl_close ($curl);
+	
+	parse_str($access_token_string, $access_token_array);
+	$userid = session_get_user()->getID();
+	if(!$access_token_array['oauth_token'] || !$access_token_array['oauth_token_secret'])	{
+		exit_error("Access Token not received.");
+	}
+	$new_access_token = new OAuthAccessToken($f_provider_id, $access_token_array['oauth_token'], $access_token_array['oauth_token_secret'], $userid);
+	$new_access_token->write_to_db();
+	
+	echo _("New access token received and saved!<br>");
+	echo _("Access Token Key : ".$access_token_array['oauth_token']."<br>");
+	echo _("Access Token Secret : ".$access_token_array['oauth_token_secret']."<br>");
+		
+}
\ No newline at end of file

Modified: trunk/src/plugins/oauthconsumer/www/checks.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/checks.php	2011-09-07 14:14:17 UTC (rev 14323)
+++ trunk/src/plugins/oauthconsumer/www/checks.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -9,7 +9,6 @@
 require_once $gfwww.'include/pre.php';
 
 $pluginname = 'oauthconsumer';
-
 // the header that displays for the user portion of the plugin
 function oauthconsumer_User_Header($params) {
 	global $DOCUMENT_ROOT,$HTML, $user_id, $pluginname;
@@ -45,7 +44,7 @@
 	if (!($realuser) || !($realuser->usesPlugin($pluginname))) { //check if user has activated the plugin
 		exit_error("First activate the User's $pluginname plugin through Account Maintenance Page", $pluginname);
 	}
-	
+
 	//displays the page header
 	oauthconsumer_User_Header(array('title'=>'Personal page for OAuth','pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));    
 	

Added: trunk/src/plugins/oauthconsumer/www/get_access_token.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/get_access_token.php	                        (rev 0)
+++ trunk/src/plugins/oauthconsumer/www/get_access_token.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -0,0 +1,148 @@
+<?php
+
+require_once('../../env.inc.php');
+require_once 'checks.php';
+
+oauthconsumer_CheckUser();
+
+$providers = OAuthProvider::get_all_oauthproviders();
+if(count($providers)>0)	{
+?>
+	<p>To get an access token, there are three steps involved: </p> 
+    <ol><li>Get an unauthorized request token 
+    <li>Authorize the request token 
+    <li>Exchange the authorized request token for an access token </ol>
+    Select a provider from the list below and get started!</p> 
+	<form action="get_access_token.php" method="post">
+	
+	<select name=providers>
+		<?php foreach ($providers as $provider) 	{
+			echo '<option value="'.$provider->get_id().'">'.$provider->get_name().'</option>';
+		}?>		
+	</select>
+	<input type="submit" value="<?php echo _('Select') ?>"/>
+	</form>
+	
+	<?php 
+	$f_provider_name = "Provider";
+	$f_provider_id = getStringFromPost('providers');
+	if($f_provider_id)	{
+		$f_provider = OAuthProvider::get_provider($f_provider_id);	
+		$f_provider_name = $f_provider->get_name();
+		$f_consumer_key = $f_provider->get_consumer_key();
+		$f_consumer_secret = $f_provider->get_consumer_secret();
+		$f_request_token_url = $f_provider->get_request_token_url();
+		$f_authorize_url = $f_provider->get_authorize_url();
+		$f_access_token_url = $f_provider->get_access_token_url();
+	}
+	?>
+	<br><br>
+	<form action="get_access_token.php" method="post">
+	<?php echo '<input type="hidden" name="plugin_oauthconsumer_get_request_token" value="'.form_generate_key().'"/>' ?>
+	<?php echo '<input type="hidden" name="providers" value="'.$f_provider_id.'"/>' ?>
+	<table class="width75" align="center" cellspacing="1">
+		
+		<tr>
+		<td class="form-title" colspan="2"><?php echo _("<b>".$f_provider_name."</b>") ?></td>
+		</tr>
+		
+		<tr>
+		<td class="category"><?php echo _('Consumer Key') ?></td>
+		<td><input name="consumer_key" maxlength="250" size="80" value="<?php echo $f_consumer_key ?>" readonly/></td>
+		</tr>
+		
+		<tr>
+		<td class="category"><?php echo _('Request Token URL') ?></td>
+		<td><input name="request_token_url" maxlength="250" size="80" value="<?php echo $f_request_token_url ?>"/></td>
+		</tr>
+		
+		<tr>
+		<td class="category"><?php echo _('Authorization URL') ?></td>
+		<td><input name="authorize_url" maxlength="250" size="80" value="<?php echo $f_authorize_url ?>"/></td>
+		</tr>
+		
+		<tr>
+		<td class="category"><?php echo _('Access Token URL') ?></td>
+		<td><input name="access_token_url" maxlength="250" size="80" value="<?php echo $f_access_token_url ?>"/></td>
+		</tr>
+		
+	</table><br>
+	
+	<?php
+	$url_string = $f_request_token_url?"(from ".$f_request_token_url.")":""; 
+	echo _('<b>Step 1: </b>Get Request Token '.$url_string) ?>
+	<br>
+	<input type="submit" value="<?php echo _('Go') ?>"
+	</form>
+	
+	<?php
+	$form_key = getStringFromPost('plugin_oauthconsumer_get_request_token');
+	$f_provider_id = getStringFromPost('providers');
+	if($form_key && $f_provider_id && form_key_is_valid($form_key))	{
+		form_release_key($form_key);
+		
+		$f_provider = OAuthProvider::get_provider($f_provider_id);
+		$f_provider_name = $f_provider->get_name();
+		$f_consumer_key = $f_provider->get_consumer_key();
+		$f_consumer_secret = $f_provider->get_consumer_secret();
+		$f_request_token_url = getStringFromPost('request_token_url');
+		$f_authorize_url = getStringFromPost('authorize_url');
+		$f_access_token_url = getStringFromPost('access_token_url');
+		
+		$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https';
+		$http_url = $scheme . '://' . $_SERVER['HTTP_HOST'];
+		$callback_url = $http_url."/plugins/".$pluginname."/callback.php";
+		$parameters = array("oauth_callback"=>$callback_url);
+		
+		$ff_consumer = new OAuthConsumer($f_consumer_key, $f_consumer_secret);
+		
+		$ff_request1 = OAuthRequest::from_consumer_and_token($ff_consumer, false, "GET", $f_request_token_url, $parameters);
+		$hmac = new OAuthSignatureMethod_HMAC_SHA1();
+		$ff_request1->sign_request($hmac, $ff_consumer, NULL);
+		
+		//sending request with curl
+		$curl = curl_init();
+		
+		curl_setopt($curl, CURLOPT_URL, $ff_request1->to_url());
+		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+		
+		$request_token_string = curl_exec ($curl);
+		curl_close ($curl);
+		
+		parse_str($request_token_string, $request_token);
+		echo _("New request token received!<br>");
+		echo _("Request Token Key : ".$request_token['oauth_token']."<br>");
+		echo _("Request Token Secret : ".$request_token['oauth_token_secret']."<br><br>");
+		//print_r($request_token);
+		session_set_cookie('PROVIDER', $f_provider_id, '', 10*60);
+		session_set_cookie('OAUTH_TOKEN', $request_token['oauth_token'], '', 10*60);
+		session_set_cookie('OAUTH_TOKEN_SECRET', $request_token['oauth_token_secret'], '', 10*60);
+		$oauth_request_token = new OAuthToken($request_token['oauth_token'], $request_token['oauth_token_secret']);
+		
+		$separator = "?";
+		if (strpos($f_authorize_url,"?")!=false) $separator = "&";
+		
+		$new_user_authorization_url = $f_authorize_url . $separator . "oauth_token=".$request_token['oauth_token']."&oauth_callback=".$callback_url;
+		//print_r($new_user_authorization_url);
+		?>
+		
+		<form action="get_access_token.php" method="post">
+		<?php echo '<input type="hidden" name="authorization_url" value="'.$new_user_authorization_url.'"/>' ?>
+		<?php 
+		echo _('<b>Step 2: </b>Authorize the Request Token (from '.$f_authorize_url.")") ?>
+		<br>
+		<input type="submit" value="<?php echo _('Go') ?>"
+		</form>
+		<?php 
+		//header("Location:".$new_user_authorization_url);
+	}
+	
+	$f_authorization_url = getStringFromPost('authorization_url');
+	if($f_authorization_url)	{
+		header("Location:".$f_authorization_url);
+	}
+}else 	{
+	echo '<p>'. _('There are no OAuth Providers registered in the database currently. Please ask your forge administer to create one.').'</p>';
+}
+
+site_user_footer(array());
\ No newline at end of file

Modified: trunk/src/plugins/oauthconsumer/www/index.php
===================================================================
--- trunk/src/plugins/oauthconsumer/www/index.php	2011-09-07 14:14:17 UTC (rev 14323)
+++ trunk/src/plugins/oauthconsumer/www/index.php	2011-09-07 16:20:38 UTC (rev 14324)
@@ -6,6 +6,7 @@
 oauthconsumer_CheckUser();
 
 echo util_make_link('/plugins/'.$pluginname.'/providers.php', _('OAuth Providers')). ' <br />';
+echo util_make_link('/plugins/'.$pluginname.'/get_access_token.php', _('Get Access tokens')).'<br /> ';
 echo util_make_link('/plugins/'.$pluginname.'/access_tokens.php', _('Access tokens')).'<br /> ';
 
 




More information about the Fusionforge-commits mailing list