Skip to content
Browse files

stored consumer keys properly

  • Loading branch information...
1 parent 165f736 commit 1ea823a8cd8dc05c2bdb07c329f9c12a6f9e455a @randyjensen committed
Showing with 7 additions and 14 deletions.
  1. +2 −2 README.txt
  2. +5 −12 openphoto-wordpress.php
View
4 README.txt
@@ -3,7 +3,7 @@ Contributors: randyjensen,randyhoyt
Tags: openphoto,media
Requires at least: 3.2
Tested up to: 3.3
-Stable tag: 0.9
+Stable tag: 0.9.1
Insert photos from your OpenPhoto installation into your WordPress content through the media manager.
@@ -26,5 +26,5 @@ Find the project on [GitHub](https://github.com/openphoto/openphoto-wordpress "O
== Changelog ==
-= 0.9 =
+= 0.9.1 =
* Initial release
View
17 openphoto-wordpress.php
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: OpenPhoto for WordPress
-Version: 0.1
+Version: 0.9.1
Plugin URI: https://github.com/openphoto/openphoto-wordpress
Author: Randy Hoyt, Randy Jensen
Author URI: http://cultivatr.com/
@@ -64,7 +64,6 @@ function media_render_openphoto_tab() {
$response = $client->get("/tags/list.json");
$response = json_decode($response);
$tags = $response->result;
-
?>
<script>
jQuery(document).ready(function() {
@@ -130,7 +129,6 @@ function media_render_openphoto_tab() {
<input type="hidden" name="post_mime_type" value="">
<ul class="subsubsub">
<?php
-
if ( $photos ) {
$total_pages = $photos[0]->totalPages;
$current_page = $photos[0]->currentPage;
@@ -141,7 +139,6 @@ function media_render_openphoto_tab() {
?></ul>
<div class="tablenav">
<?php
-
if ( $photos ) {
if ($total_pages > 1) {
echo '<div class="tablenav-pages">';
@@ -167,7 +164,6 @@ function media_render_openphoto_tab() {
}
if ( $tags ) {
-
?><div class="alignleft actions">
<select name="m">
<option value="0">Show all tags</option>
@@ -183,13 +179,8 @@ function media_render_openphoto_tab() {
<input type="submit" name="post-query-submit" id="op-post-query-submit" class="button-secondary" value="Filter »">
</div>
<br class="clear">
- <?php
-
- }
-
- ?></div>
+ <?php } ?></div>
</form>
-
<?php
if ( $photos ) {
@@ -389,7 +380,7 @@ function settings_render_openphoto_page() {
$newinput['oauth_token'] = trim($input['oauth_token']);
$newinput['oauth_token_secret'] = trim($input['oauth_token_secret']);
$newinput['oauth_verifier'] = trim($input['oauth_verifier']);
-
+
if ( $newinput['host'] != $openphoto['host'] ) {
$host_changed = true;
}
@@ -451,6 +442,8 @@ function settings_render_openphoto_page() {
if ($result['response']['code'] == 200) {
$access = wp_parse_args($result['body']);
+ $openphoto['oauth_consumer_key'] = $_REQUEST["oauth_consumer_key"];
+ $openphoto['oauth_consumer_secret'] = $_REQUEST["oauth_consumer_secret"];
$openphoto['oauth_token'] = $access['oauth_token'];
$openphoto['oauth_token_secret'] = $access['oauth_token_secret'];

0 comments on commit 1ea823a

Please sign in to comment.
Something went wrong with that request. Please try again.