diff --git a/pumpio/pumpio.css b/pumpio/pumpio.css
index eba380e4..020f3697 100755
--- a/pumpio/pumpio.css
+++ b/pumpio/pumpio.css
@@ -1,11 +1,11 @@
-#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label {
+#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label, #pumpio-delete-label {
float: left;
width: 200px;
margin-top: 10px;
}
-#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault {
+#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault, #pumpio-delete {
float: left;
margin-top: 10px;
}
diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php
index b7634bcb..da723eca 100755
--- a/pumpio/pumpio.php
+++ b/pumpio/pumpio.php
@@ -198,47 +198,59 @@ function pumpio_settings(&$a,&$s) {
$s .= '
';
$s .= '
' . t('Pump.io Post Settings') . ' ';
- $s .= '
';
- $s .= ''.t('pump.io servername (without "http://" or "https://" )').' ';
- $s .= ' ';
- $s .= '
';
-
$s .= '
';
$s .= ''.t('pump.io username (without the servername)').' ';
$s .= ' ';
$s .= '
';
+ $s .= '
';
+ $s .= ''.t('pump.io servername (without "http://" or "https://" )').' ';
+ $s .= ' ';
+ $s .= '
';
+
if (($username != '') AND ($servername != '')) {
- $s .= '
';
-
- $s .= '
';
- $s .= '' . t('Enable pump.io Post Plugin') . ' ';
- $s .= ' ';
- $s .= '
';
-
- $s .= '
';
- $s .= '' . t('Post to pump.io by default') . ' ';
- $s .= ' ';
- $s .= '
';
-
- $s .= '
';
- $s .= '' . t('Should posts be public?') . ' ';
- $s .= ' ';
- $s .= '
';
-
- $s .= '
';
- $s .= '' . t('Mirror all public posts') . ' ';
- $s .= ' ';
- $s .= '
';
$oauth_token = get_pconfig(local_user(), "pumpio", "oauth_token");
$oauth_token_secret = get_pconfig(local_user(), "pumpio", "oauth_token_secret");
$s .= '
';
- if (($oauth_token == "") OR ($oauth_token_secret == ""))
- $s .= t("You are not authenticated to pumpio");
+ if (($oauth_token == "") OR ($oauth_token_secret == "")) {
+ $s .= '
';
+
+ //$s .= t("You are not authenticated to pumpio");
+ } else {
+ $s .= '
';
+ $s .= '' . t('Enable pump.io Post Plugin') . ' ';
+ $s .= ' ';
+ $s .= '
';
+
+ $s .= '
';
+ $s .= '' . t('Post to pump.io by default') . ' ';
+ $s .= ' ';
+ $s .= '
';
+
+ $s .= '
';
+ $s .= '' . t('Should posts be public?') . ' ';
+ $s .= ' ';
+ $s .= '
';
+
+ $s .= '
';
+ $s .= '' . t('Mirror all public posts') . ' ';
+ $s .= ' ';
+ $s .= '
';
+
+ $s .= '
';
+ $s .= '' . t('Check to delete this preset') . ' ';
+ $s .= ' ';
+ $s .= '
';
+
+ //$s .= '
';
+
+ }
$s .= '
';
}
@@ -253,28 +265,37 @@ function pumpio_settings(&$a,&$s) {
function pumpio_settings_post(&$a,&$b) {
if(x($_POST,'pumpio-submit')) {
- // filtering the username if it is filled wrong
- $user = $_POST['pumpio_user'];
- if (strstr($user, "@")) {
- $pos = strpos($user, "@");
- if ($pos > 0)
- $user = substr($user, 0, $pos);
+ if(x($_POST,'pumpio_delete')) {
+ set_pconfig(local_user(),'pumpio','consumer_key','');
+ set_pconfig(local_user(),'pumpio','consumer_secret','');
+ set_pconfig(local_user(),'pumpio','host','');
+ set_pconfig(local_user(),'pumpio','oauth_token','');
+ set_pconfig(local_user(),'pumpio','oauth_token_secret','');
+ set_pconfig(local_user(),'pumpio','post',false);
+ set_pconfig(local_user(),'pumpio','post_by_default',false);
+ set_pconfig(local_user(),'pumpio','user','');
+ } else {
+ // filtering the username if it is filled wrong
+ $user = $_POST['pumpio_user'];
+ if (strstr($user, "@")) {
+ $pos = strpos($user, "@");
+ if ($pos > 0)
+ $user = substr($user, 0, $pos);
+ }
+
+ // Filtering the hostname if someone is entering it with "http"
+ $host = $_POST['pumpio_host'];
+ $host = trim($host);
+ $host = str_replace(array("https://", "http://"), array("", ""), $host);
+
+ set_pconfig(local_user(),'pumpio','post',intval($_POST['pumpio']));
+ set_pconfig(local_user(),'pumpio','host',$host);
+ set_pconfig(local_user(),'pumpio','user',$user);
+ set_pconfig(local_user(),'pumpio','public',$_POST['pumpio_public']);
+ set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']);
+ set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
}
-
- // Filtering the hostname if someone is entering it with "http"
- $host = $_POST['pumpio_host'];
- $host = trim($host);
- $host = str_replace(array("https://", "http://"), array("", ""), $host);
-
- set_pconfig(local_user(),'pumpio','post',intval($_POST['pumpio']));
- set_pconfig(local_user(),'pumpio','host',$host);
- set_pconfig(local_user(),'pumpio','user',$user);
- set_pconfig(local_user(),'pumpio','public',$_POST['pumpio_public']);
- set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']);
- set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
-
}
-
}
function pumpio_post_local(&$a,&$b) {