aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Admin/Accounts.php9
-rw-r--r--Zotlabs/Module/Admin/Site.php3
-rw-r--r--Zotlabs/Module/Email_validation.php11
-rw-r--r--Zotlabs/Module/Go.php66
-rw-r--r--Zotlabs/Module/Item.php1
-rw-r--r--Zotlabs/Module/Linkinfo.php4
-rw-r--r--Zotlabs/Module/New_channel.php4
-rw-r--r--images/video_poster.jpgbin0 -> 24871 bytes
-rw-r--r--include/auth.php1
-rw-r--r--include/bbcode.php6
-rwxr-xr-xinclude/items.php2
-rw-r--r--view/pdl/mod_go.pdl6
-rwxr-xr-xview/tpl/admin_accounts.tpl4
-rwxr-xr-xview/tpl/admin_site.tpl1
-rw-r--r--view/tpl/go.tpl16
-rwxr-xr-xview/tpl/jot-header.tpl11
16 files changed, 132 insertions, 13 deletions
diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php
index 2043550fc..8925ffff1 100644
--- a/Zotlabs/Module/Admin/Accounts.php
+++ b/Zotlabs/Module/Admin/Accounts.php
@@ -16,6 +16,9 @@ class Accounts {
*/
function post() {
+
+logger('post: ' . print_r($_POST,true));
+
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
@@ -24,7 +27,7 @@ class Accounts {
// change to switch structure?
// account block/unblock button was submitted
- if (x($_POST, 'page_users_block')) {
+ if (x($_POST, 'page_accounts_block')) {
for ($i = 0; $i < count($users); $i++) {
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
$op = ($blocked[$i]) ? '& ~' : '| ';
@@ -43,13 +46,13 @@ class Accounts {
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
}
// registration approved button was submitted
- if (x($_POST, 'page_users_approve')) {
+ if (x($_POST, 'page_accounts_approve')) {
foreach ($pending as $hash) {
account_allow($hash);
}
}
// registration deny button was submitted
- if (x($_POST, 'page_users_deny')) {
+ if (x($_POST, 'page_accounts_deny')) {
foreach ($pending as $hash) {
account_deny($hash);
}
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 037f49277..52b36e03e 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -38,6 +38,7 @@ class Site {
$site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : '');
$site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : '');
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
+ $firstpage = ((x(trim($_POST,'firstpage'))) ? notags(trim($_POST['firstpage'])) : 'profiles');
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
@@ -80,6 +81,7 @@ class Site {
set_config('system', 'maxloadavg', $maxloadavg);
set_config('system', 'frontpage', $frontpage);
set_config('system', 'sellpage', $site_sellpage);
+ set_config('system', 'workflow_channel_next', $firstpage);
set_config('system', 'site_location', $site_location);
set_config('system', 'mirror_frontpage', $mirror_frontpage);
set_config('system', 'sitename', $sitename);
@@ -340,6 +342,7 @@ class Site {
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
'$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
+ '$firstpage' => array('firstpage', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')),
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),
diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php
index 4cc016847..b8bb720cd 100644
--- a/Zotlabs/Module/Email_validation.php
+++ b/Zotlabs/Module/Email_validation.php
@@ -8,9 +8,18 @@ class Email_validation extends \Zotlabs\Web\Controller {
function post() {
if($_POST['token']) {
- if(! account_approve(trim($_POST['token']))) {
+ // This will redirect internally on success unless the channel is auto_created
+ if(! account_approve(trim(basename($_POST['token'])))) {
notice('Token verification failed.');
}
+ else {
+ if(get_config('system','auto_channel_create')) {
+ $next_page = get_config('system', 'workflow_channel_next', 'profiles');
+ }
+ if($next_page) {
+ goaway(z_root() . '/' . $next_page);
+ }
+ }
}
}
diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php
new file mode 100644
index 000000000..2c2dcf460
--- /dev/null
+++ b/Zotlabs/Module/Go.php
@@ -0,0 +1,66 @@
+<?php
+
+namespace Zotlabs\Module;
+
+
+class Go extends \Zotlabs\Web\Controller {
+
+ function init() {
+ if(local_channel()) {
+ $channel = \App::get_channel();
+ if($channel) {
+ profile_load($channel['channel_address'],0);
+ }
+ }
+ }
+
+
+
+ function get() {
+ if(! local_channel()) {
+ notify( t('This page is available only to site members') . EOL);
+ }
+
+ $channel = \App::get_channel();
+
+
+ $title = t('Welcome');
+
+ $m = t('What would you like to do?');
+
+ $m1 = t('Please bookmark this page if you would like to return to it in the future');
+
+
+ $options = [
+ 'profile_photo' => t('Upload a profile photo'),
+ 'profiles' => t('Edit your default profile'),
+ 'suggest' => t('View friend suggestions'),
+ 'directory' => t('View the directory to find other interesting channels'),
+ 'settings' => t('View/edit your channel settings'),
+ 'help' => t('View the site or project documentation'),
+ 'channel/' . $channel['channel_address'] => t('Visit your channel homepage'),
+ 'connections' => t('View your connections and/or add somebody whose address you already know'),
+ 'network' => t('View your personal stream (this may be empty until you add some connections)'),
+
+ ];
+
+ $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false);
+ $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true);
+
+ if($site_firehose || $net_firehose) {
+ $options['pubstream'] = t('View the public stream. Warning: this content is not moderated');
+ }
+
+ $o = replace_macros(get_markup_template('go.tpl'), [
+ '$title' => $title,
+ '$m' => $m,
+ '$m1' => $m1,
+ '$options' => $options
+
+ ]);
+
+ return $o;
+
+ }
+
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index ad829137a..db2d64d70 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -753,6 +753,7 @@ class Item extends \Zotlabs\Web\Controller {
if ((! $plink) && ($item_thread_top)) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
+ $plink = substr($plink,0,190);
}
$datarray['aid'] = $channel['channel_account_id'];
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php
index 78c34583e..3392e4114 100644
--- a/Zotlabs/Module/Linkinfo.php
+++ b/Zotlabs/Module/Linkinfo.php
@@ -120,9 +120,9 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$siteinfo = self::parseurl_getsiteinfo($url);
- // If this is a Red site, use zrl rather than url so they get zids sent to them by default
+ // If the site uses this platform, use zrl rather than url so they get zids sent to them by default
- if( x($siteinfo,'generator') && (strpos($siteinfo['generator'], \Zotlabs\Lib\System::get_platform_name() . ' ') === 0))
+ if(is_matrix_url($url))
$template = str_replace('url','zrl',$template);
if($siteinfo["title"] == "") {
diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php
index 2b73fa191..9f2fea802 100644
--- a/Zotlabs/Module/New_channel.php
+++ b/Zotlabs/Module/New_channel.php
@@ -89,9 +89,7 @@ class New_channel extends \Zotlabs\Web\Controller {
change_channel($result['channel']['channel_id']);
- if(! strlen($next_page = get_config('system','workflow_channel_next')))
- $next_page = 'settings';
-
+ $next_page = get_config('system', 'workflow_channel_next', 'profiles');
goaway(z_root() . '/' . $next_page);
}
diff --git a/images/video_poster.jpg b/images/video_poster.jpg
new file mode 100644
index 000000000..e4fc3b2da
--- /dev/null
+++ b/images/video_poster.jpg
Binary files differ
diff --git a/include/auth.php b/include/auth.php
index 78be32bf4..6f5e58361 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -261,6 +261,7 @@ else {
$verify = account_verify_password($_POST['username'], $_POST['password']);
if($verify && array_key_exists('reason',$verify) && $verify['reason'] === 'unvalidated') {
notice( t('Email validation is incomplete. Please check your email.'));
+ goaway(z_root() . '/email_validation/' . bin2hex(trim(escape_tags($_POST['username']))));
}
elseif($verify) {
$atoken = $verify['xchan'];
diff --git a/include/bbcode.php b/include/bbcode.php
index 2b8274c0f..0c85a0a4e 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -108,7 +108,11 @@ function tryzrlvideo($match) {
if($zrl)
$link = zid($link);
- return '<video controls="controls" preload="none" src="' . str_replace(' ','%20',$link) . '" style="width:100%; max-width:' . App::$videowidth . 'px"><a href="' . str_replace(' ','%20',$link) . '">' . $link . '</a></video>';
+ $static_link = get_config('system','video_default_poster','images/video_poster.jpg');
+ if($static_link)
+ $poster = 'poster="' . escape_tags($static_link) . '" ' ;
+
+ return '<video ' . $poster . ' controls="controls" preload="none" src="' . str_replace(' ','%20',$link) . '" style="width:100%; max-width:' . App::$videowidth . 'px"><a href="' . str_replace(' ','%20',$link) . '">' . $link . '</a></video>';
}
// [noparse][i]italic[/i][/noparse] turns into
diff --git a/include/items.php b/include/items.php
index b12ad1d85..c7206458e 100755
--- a/include/items.php
+++ b/include/items.php
@@ -390,7 +390,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) {
$arr['comment_policy'] = map_scope(\Zotlabs\Access\PermissionLimits::Get($channel['channel_id'],'post_comments'));
if ((! $arr['plink']) && (intval($arr['item_thread_top']))) {
- $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']);
+ $arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']),0,190);
}
diff --git a/view/pdl/mod_go.pdl b/view/pdl/mod_go.pdl
new file mode 100644
index 000000000..c34898dd5
--- /dev/null
+++ b/view/pdl/mod_go.pdl
@@ -0,0 +1,6 @@
+[region=aside]
+[widget=fullprofile][/widget]
+[/region]
+[region=right_aside]
+[widget=notifications][/widget]
+[/region]
diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl
index 3535363a0..d6c9591fd 100755
--- a/view/tpl/admin_accounts.tpl
+++ b/view/tpl/admin_accounts.tpl
@@ -41,7 +41,7 @@
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return toggle_selectall('pending_ckbx');">{{$select_all}}</a></div>
- <div class="submit"><input type="submit" name="page_users_deny" value="{{$deny}}"> <input type="submit" name="page_users_approve" value="{{$approve}}"></div>
+ <div class="submit"><input type="submit" name="page_accounts_deny" value="{{$deny}}"> <input type="submit" name="page_accounts_approve" value="{{$approve}}"></div>
{{else}}
<p>{{$no_pending}}</p>
{{/if}}
@@ -80,7 +80,7 @@
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return toggle_selectall('users_ckbx');">{{$select_all}}</a></div>
- <div class="submit"><input type="submit" name="page_users_block" value="{{$block}}/{{$unblock}}"> <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"></div>
+ <div class="submit"><input type="submit" name="page_accounts_block" value="{{$block}}/{{$unblock}}"> <input type="submit" name="page_accounts_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"></div>
{{else}}
NO USERS?!?
{{/if}}
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index 50482f03d..0eabe620d 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -74,6 +74,7 @@
{{include file="field_select.tpl" field=$access_policy}}
{{include file="field_input.tpl" field=$location}}
{{include file="field_input.tpl" field=$sellpage}}
+ {{include file="field_input.tpl" field=$firstpage}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
diff --git a/view/tpl/go.tpl b/view/tpl/go.tpl
new file mode 100644
index 000000000..f0f9ee79e
--- /dev/null
+++ b/view/tpl/go.tpl
@@ -0,0 +1,16 @@
+<h2>{{$title}}</h2>
+
+<div class="descriptive-text">
+ <p>{{$m}}</p>
+ <p>{{$m1}}</p>
+</div>
+
+{{if $options}}
+<ul class="nav nav-pills flex-column">
+{{foreach $options as $k => $v}}
+ <li class="nav-item"><a href="{{$k}}" class="nav-link">{{$v}}</a></li>
+{{/foreach}}
+</ul>
+{{/if}}
+
+
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index ffaa4e208..0ffc8b349 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -110,10 +110,21 @@ var activeCommentID = 0;
var activeCommentText = '';
$(document).ready(function() {
+
/* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser);
+ $('#id_mimetype').on('load', jotSetMime);
+ $('#id_mimetype').on('change', jotSetMime);
+
+ function jotSetMime() {
+ var mtype = $('#id_mimetype').val();
+ if(mtype == 'text/bbcode')
+ $('#profile-jot-submit-left').show();
+ else
+ $('#profile-jot-submit-left').hide();
+ }
$('#invisible-wall-file-upload').fileupload({
url: 'wall_attach/{{$nickname}}',