diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php
index 09262d839..ef8ff51b6 100755
--- a/diaspora/diaspora.php
+++ b/diaspora/diaspora.php
@@ -107,66 +107,84 @@ function diaspora_queue_hook(&$a,&$b) {
function diaspora_settings(&$a,&$s) {
- if(! local_user())
- return;
+ if(! local_user())
+ return;
- /* Add our stylesheet to the page so we can make our settings look nice */
+ /* Add our stylesheet to the page so we can make our settings look nice */
- $a->page['htmlhead'] .= '' . "\r\n";
+ $a->page['htmlhead'] .= '' . "\r\n";
- /* Get the current state of our config variables */
+ /* Get the current state of our config variables */
- $enabled = get_pconfig(local_user(),'diaspora','post');
+ $enabled = get_pconfig(local_user(),'diaspora','post');
- $checked = (($enabled) ? ' checked="checked" ' : '');
+ $checked = (($enabled) ? ' checked="checked" ' : '');
- $def_enabled = get_pconfig(local_user(),'diaspora','post_by_default');
+ $def_enabled = get_pconfig(local_user(),'diaspora','post_by_default');
- $def_checked = (($def_enabled) ? ' checked="checked" ' : '');
+ $def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $diaspora_username = get_pconfig(local_user(), 'diaspora', 'diaspora_username');
- $diaspora_password = get_pconfig(local_user(), 'diaspora', 'diaspora_password');
- $diaspora_url = get_pconfig(local_user(), 'diaspora', 'diaspora_url');
+ $diaspora_username = get_pconfig(local_user(), 'diaspora', 'diaspora_username');
+ $diaspora_password = get_pconfig(local_user(), 'diaspora', 'diaspora_password');
+ $diaspora_url = get_pconfig(local_user(), 'diaspora', 'diaspora_url');
+ $status = "";
- /* Add some HTML to the existing form */
+ if ($diaspora_username AND $diaspora_password AND $diaspora_url) {
+ try {
+ require_once("addon/diaspora/diasphp.php");
- $s .= '';
- $s .= '' . t('Diaspora') . '
';
- $s .= '';
- $s .= '