aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.homeinstall/hubzilla-setup.sh12
-rw-r--r--Zotlabs/Module/Rmagic.php15
-rw-r--r--include/markdown.php37
-rw-r--r--include/nav.php32
-rw-r--r--view/css/mod_home.css5
-rw-r--r--view/css/mod_login.css5
-rw-r--r--view/theme/redbasic/css/style.css10
-rwxr-xr-xview/tpl/nav.tpl11
-rw-r--r--view/tpl/nav_login.tpl15
-rwxr-xr-xview/tpl/rmagic.tpl18
10 files changed, 101 insertions, 59 deletions
diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh
index 6310bf47f..c83fb8de9 100755
--- a/.homeinstall/hubzilla-setup.sh
+++ b/.homeinstall/hubzilla-setup.sh
@@ -491,7 +491,7 @@ END
print_info "letsenrypt exists already (nothing downloaded > no certificate created and registered)"
return 0
fi
- git clone https://github.com/lukas2511/letsencrypt.sh $le_dir
+ git clone https://github.com/lukas2511/dehydrated $le_dir
cd $le_dir
# create config file for letsencrypt.sh
echo "WELLKNOWN=$le_dir" > $le_dir/config.sh
@@ -511,9 +511,9 @@ END
then
die "Failed to load $url_http"
fi
- # run letsencrypt.sh
+ # run script dehydrated
#
- ./letsencrypt.sh --cron --config $le_dir/config.sh
+ ./dehydrated --cron --config $le_dir/config.sh
}
function configure_apache_for_https {
@@ -730,8 +730,8 @@ echo "#" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"+++ \$(date) +++\"" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
-echo "echo \"\$(date) - renew certificat...\"" >> /var/www/$hubzilladaily
-echo "bash $le_dir/letsencrypt.sh --cron --config $le_dir/config.sh" >> /var/www/$hubzilladaily
+echo "echo \"\$(date) - renew certificate...\"" >> /var/www/$hubzilladaily
+echo "bash $le_dir/dehydrated --cron --config $le_dir/config.sh" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# stop hubzilla" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - stoping apache and mysql...\"" >> /var/www/$hubzilladaily
@@ -798,7 +798,7 @@ echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# update" >> /var/www/$hubzilladaily
-echo "echo \"\$(date) - updating letsencrypt.sh...\"" >> /var/www/$hubzilladaily
+echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily
diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php
index 9252d1f1d..9fcc72441 100644
--- a/Zotlabs/Module/Rmagic.php
+++ b/Zotlabs/Module/Rmagic.php
@@ -70,13 +70,12 @@ class Rmagic extends \Zotlabs\Web\Controller {
function get() {
-
- $o = replace_macros(get_markup_template('rmagic.tpl'),array(
- '$title' => t('Remote Authentication'),
- '$desc' => t('Enter your channel address (e.g. channel@example.com)'),
- '$submit' => t('Authenticate')
- ));
- return $o;
-
+ return replace_macros(get_markup_template('rmagic.tpl'),
+ [
+ '$title' => t('Remote Authentication'),
+ '$address' => [ 'address', t('Enter your channel address (e.g. channel@example.com)'), '', '' ],
+ '$submit' => t('Authenticate')
+ ]
+ );
}
}
diff --git a/include/markdown.php b/include/markdown.php
index b4656f769..7afdc6c54 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -110,6 +110,39 @@ function diaspora_mention_callback($matches) {
}
+function diaspora_mention_callback2($matches) {
+
+ $webbie = $matches[1] . '@' . $matches[2];
+ $link = '';
+ if($webbie) {
+ $r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_addr = '%s' limit 1",
+ dbesc($webbie)
+ );
+ if(! $r) {
+ $x = discover_by_webbie($webbie);
+ if($x) {
+ $r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_addr = '%s' limit 1",
+ dbesc($webbie)
+ );
+ }
+ }
+ if($r)
+ $link = $r[0]['xchan_url'];
+ }
+
+ $name = (($r) ? $r[0]['xchan_name'] : $matches[1]);
+
+ if(! $link)
+ $link = 'https://' . $matches[2] . '/u/' . $matches[1];
+
+ if($r && $r[0]['hubloc_network'] === 'zot')
+ return '@[zrl=' . $link . ']' . trim($name) . ((substr($matches[0],-1,1) === '+') ? '+' : '') . '[/zrl]' ;
+ else
+ return '@[url=' . $link . ']' . trim($name) . ((substr($matches[0],-1,1) === '+') ? '+' : '') . '[/url]' ;
+
+}
+
+
/**
* @brief
@@ -141,9 +174,11 @@ function markdown_to_bb($s, $use_zrl = false) {
// first try plustags
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s);
-
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}/','diaspora_mention_callback',$s);
+ $s = preg_replace_callback('/\@\{(.+?)\@(.+?)\}\+/','diaspora_mention_callback2',$s);
+ $s = preg_replace_callback('/\@\{(.+?)\@(.+?)\}/','diaspora_mention_callback2',$s);
+
// Escaping the hash tags - doesn't always seem to work
// $s = preg_replace('/\#([^\s\#])/','\\#$1',$s);
// This seems to work
diff --git a/include/nav.php b/include/nav.php
index 356c0643b..3c97d42da 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -76,6 +76,20 @@ EOT;
$userinfo = null;
$nav['loginmenu']=array();
+ if($observer) {
+ $userinfo = array(
+ 'icon' => $observer['xchan_photo_m'],
+ 'name' => $observer['xchan_addr'],
+ );
+ }
+
+ elseif(! $_SESSION['authenticated']) {
+ $nav['remote_login'] = remote_login();
+ $nav['loginmenu'][] = Array('rmagic',t('Remote authentication'),'',t('Click to authenticate to your home hub'),'rmagic_nav_btn');
+ }
+
+
+
if(local_channel()) {
@@ -114,6 +128,13 @@ EOT;
if(! get_account_id()) {
$nav['login'] = login(true,'main-login',false,false);
$nav['loginmenu'][] = Array('login',t('Login'),'',t('Sign in'),'login_nav_btn');
+ App::$page['content'] .= replace_macros(get_markup_template('nav_login.tpl'),
+ [
+ '$nav' => $nav,
+ 'userinfo' => $userinfo
+ ]
+ );
+
}
else
$nav['alogout'] = Array('logout',t('Logout'), "", t('End this session'),'logout_nav_btn');
@@ -121,17 +142,6 @@ EOT;
}
- if($observer) {
- $userinfo = array(
- 'icon' => $observer['xchan_photo_m'],
- 'name' => $observer['xchan_addr'],
- );
- }
-
- elseif(! $_SESSION['authenticated']) {
- $nav['remote_login'] = remote_login();
- $nav['loginmenu'][] = Array('rmagic',t('Remote authentication'),'',t('Click to authenticate to your home hub'),'rmagic_nav_btn');
- }
$homelink = get_my_url();
if(! $homelink) {
diff --git a/view/css/mod_home.css b/view/css/mod_home.css
index b6112eb38..fa2b2b28d 100644
--- a/view/css/mod_home.css
+++ b/view/css/mod_home.css
@@ -3,8 +3,3 @@
margin-bottom: 50px;
}
-#login-main {
- max-width: 400px;
- margin-left: auto;
- margin-right: auto;
-}
diff --git a/view/css/mod_login.css b/view/css/mod_login.css
deleted file mode 100644
index 53ba9cb1d..000000000
--- a/view/css/mod_login.css
+++ /dev/null
@@ -1,5 +0,0 @@
-#login-main {
- max-width: 400px;
- margin-left: auto;
- margin-right: auto;
-}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index db7e50fe7..02ee689ce 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -2107,7 +2107,9 @@ dl.bb-dl > dd > li {
text-align: center;
}
-#nav-login {
- padding: 10px;
- min-width: 300px;
-}
+#login-main, .rmagic-button {
+ max-width: 400px;
+ margin-top: 20px;
+ margin-left: auto;
+ margin-right: auto;
+} \ No newline at end of file
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 68326a077..8f8165ba1 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -145,14 +145,8 @@
</li>
{{/if}}
{{if $nav.login && !$userinfo}}
- <li class="hidden-xs">
- <a href="#" title="{{$nav.loginmenu.0.3}}" id="{{$nav.loginmenu.0.4}}" onclick="openClose('nav-login'); return false;">{{$nav.loginmenu.0.1}} <span class="caret" id="loginmenu-caret"></span></a>
- <div id="nav-login" class="dropdown-menu">
- <div class="form-group">
- {{$nav.login}}
- </div>
- {{$nav.remote_login}}
- </div>
+ <li class="">
+ <a href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}" data-toggle="modal" data-target="#nav-login">{{$nav.loginmenu.1.1}}</a>
</li>
{{/if}}
{{if $nav.register}}
@@ -186,6 +180,7 @@
{{$navapps}}
</ul>
</div>
+
{{if $nav.help.6}}
<div id="contextual-help-content" class="contextual-help-content">
{{$nav.help.5}}
diff --git a/view/tpl/nav_login.tpl b/view/tpl/nav_login.tpl
new file mode 100644
index 000000000..5ad5a4990
--- /dev/null
+++ b/view/tpl/nav_login.tpl
@@ -0,0 +1,15 @@
+{{if $nav.login && !$userinfo}}
+<div id="nav-login" class="modal" role="dialog">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header"><h3>{{$nav.loginmenu.1.1}}</h3></div>
+ <div class="modal-body">
+ <div class="form-group">
+ {{$nav.login}}
+ {{$nav.remote_login}}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{/if}}
diff --git a/view/tpl/rmagic.tpl b/view/tpl/rmagic.tpl
index d0f7aab64..9d84e4a36 100755
--- a/view/tpl/rmagic.tpl
+++ b/view/tpl/rmagic.tpl
@@ -1,13 +1,9 @@
<div class="generic-content-wrapper-styled">
-<h3>{{$title}}</h3>
-
-<form action="rmagic" method="post" >
-
- <label for="rmagic-address" id="label-rmagic-address" class="rmagic-label">{{$desc}}</label>
- <input type="text" maxlength="255" size="32" name="address" id="rmagic-address" class="rmagic-input" value="" />
-
- <input type="submit" name="submit" id="rmagic-submit-button" value="{{$submit}}" />
- <div id="rmagic-submit-end" class="rmagic-field-end"></div>
-
-</form>
+ <h3>{{$title}}</h3>
+ <form action="rmagic" method="post" >
+ <div class="form-group">
+ {{include file="field_input.tpl" field=$address}}
+ <input class="btn btn-primary" type="submit" name="submit" id="rmagic-submit-button" value="{{$submit}}" />
+ </div>
+ </form>
</div>