From 31b7480effa86109af46b9a4e25b0cc637511621 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 11 Jun 2013 07:53:54 +0200 Subject: [PATCH 1/4] gpluspost: "Hootsuite" instead of "Seesmic" --- gpluspost/gpluspost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 352784959..dae59efe9 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -2,7 +2,7 @@ /** * Name: G+ Post - * Description: Posts to a Google+ page with the help of Seesmic + * Description: Posts to a Google+ page with the help of Hootsuite * Version: 0.1 * Author: Michael Vogel */ From f2be148087e6edfdcb145775fcf713d8e5242581 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 22 Jun 2013 20:05:03 +0200 Subject: [PATCH 2/4] jappixmini: Added parameters for a default server and a default username as well as a central defined bosh server address. --- jappixmini/jappixmini.php | 42 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 69c58e94c..aac5c5486 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -122,6 +122,22 @@ function jappixmini_plugin_admin(&$a, &$o) { $o .= ''; $o .= '
'; + // bosh address + $bosh_address = get_config("jappixmini", "bosh_address"); + $o .= '


'; + $o .= '

'; + + // default server address + $default_server = get_config("jappixmini", "default_server"); + $o .= '


'; + $o .= '

'; + + // default user name to friendica nickname + $default_user = intval(get_config("jappixmini", "default_user")); + $default_user = intval($default_user) ? ' checked="checked"' : ''; + $o .= ''; + $o .= '
'; + // info text field $info_text = get_config("jappixmini", "infotext"); $o .= '


'; @@ -137,8 +153,14 @@ function jappixmini_plugin_admin_post(&$a) { if ($submit) { $info_text = $_REQUEST['jappixmini-infotext']; $bosh_proxy = intval($_REQUEST['jappixmini-proxy']); + $default_user = intval($_REQUEST['jappixmini-defaultuser']); + $bosh_address = $_REQUEST['jappixmini-address']; + $default_server = $_REQUEST['jappixmini-server']; set_config("jappixmini", "infotext", $info_text); set_config("jappixmini", "bosh_proxy", $bosh_proxy); + set_config("jappixmini", "bosh_address", $bosh_address); + set_config("jappixmini", "default_server", $default_server); + set_config("jappixmini", "default_user", $default_user); } } @@ -224,6 +246,11 @@ function jappixmini_settings(&$a, &$s) { $dontinsertchat = get_pconfig(local_user(),'jappixmini','dontinsertchat'); $insertchat = !(intval($dontinsertchat) ? ' checked="checked"' : ''); + $defaultbosh = get_config("jappixmini", "bosh_address"); + + if ($defaultbosh != "") + set_pconfig(local_user(),'jappixmini','bosh', $defaultbosh); + $username = get_pconfig(local_user(),'jappixmini','username'); $username = htmlentities($username); $server = get_pconfig(local_user(),'jappixmini','server'); @@ -239,6 +266,12 @@ function jappixmini_settings(&$a, &$s) { $encrypt_checked = $encrypt ? ' checked="checked"' : ''; $encrypt_disabled = $encrypt ? '' : ' disabled="disabled"'; + if ($server == "") + $server = get_config("jappixmini", "default_server"); + + if (($username == "") and get_config("jappixmini", "default_user")) + $username = $a->user["nickname"]; + $info_text = get_config("jappixmini", "infotext"); $info_text = htmlentities($info_text); $info_text = str_replace("\n", "
", $info_text); @@ -278,9 +311,12 @@ function jappixmini_settings(&$a, &$s) { $s .= ' '; $s .= '
'; - $s .= ''; - $s .= ' '; - $s .= '
'; + if (defaultbosh == "") { + $s .= ''; + $s .= ' '; + $s .= '
'; + } + $s .= ''; $s .= ' '; From eccc3bfc45cd1ab48b82ff1a78c740fc526cbe30 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 23 Jun 2013 00:26:49 +0200 Subject: [PATCH 3/4] jappixmini: The login window is repositioned so that there are no problems with "vier" --- jappixmini/lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jappixmini/lib.js b/jappixmini/lib.js index a777a7fdd..ed52f5974 100644 --- a/jappixmini/lib.js +++ b/jappixmini/lib.js @@ -40,7 +40,7 @@ function jappixmini_addon_get_client_secret(callback) { var div = document.getElementById("#jappixmini-password-query-div"); if (!div) { - div = $('

Retype your Friendica password for chatting:
'); + div = $('
Retype your Friendica password for chatting:
'); var input = $('') div.append(input); From 21778176e6fa03d97705c1a74f24f2b49dca8aa3 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 23 Jun 2013 03:30:22 +0200 Subject: [PATCH 4/4] pumpio: Resetting of authentification data is added. --- pumpio/pumpio.css | 4 +- pumpio/pumpio.php | 121 +++++++++++++++++++++++++++------------------- 2 files changed, 73 insertions(+), 52 deletions(-) diff --git a/pumpio/pumpio.css b/pumpio/pumpio.css index eba380e4f..020f3697b 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 b7634bcbd..da723eca9 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 .= ''; - $s .= ''; - $s .= '
'; - $s .= '
'; $s .= ''; $s .= ''; $s .= '
'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + if (($username != '') AND ($servername != '')) { - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $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 .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $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) {