aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Apps.php2
-rw-r--r--Zotlabs/Lib/ThreadItem.php4
-rw-r--r--Zotlabs/Module/New_channel.php20
-rw-r--r--Zotlabs/Module/Oauthinfo.php23
-rw-r--r--Zotlabs/Module/Well_known.php10
-rw-r--r--include/js_strings.php10
-rw-r--r--include/oauth.php2
-rw-r--r--include/text.php4
-rwxr-xr-xutil/add_addon_repo4
-rwxr-xr-xutil/add_theme_repo4
-rwxr-xr-xutil/add_widget_repo4
-rwxr-xr-xutil/update_addon_repo4
-rwxr-xr-xutil/update_theme_repo4
-rwxr-xr-xutil/update_widget_repo4
-rw-r--r--view/js/mod_new_channel.js13
-rwxr-xr-xview/tpl/conv_item.tpl2
-rwxr-xr-xview/tpl/js_strings.tpl12
17 files changed, 106 insertions, 20 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 24cb4a626..2dded1aaa 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -45,6 +45,8 @@ class Apps {
}
}
+ call_hooks('get_system_apps',$ret);
+
return $ret;
}
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index c7a2c9373..0fed78158 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -102,6 +102,9 @@ class ThreadItem {
if($item['author']['xchan_network'] === 'rss')
$shareable = true;
+ $privacy_warning = false;
+ if($item['owner']['xchan_network'] === 'activitypub')
+ $privacy_warning = true;
$mode = $conv->get_mode();
@@ -370,6 +373,7 @@ class ThreadItem {
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'lock' => $lock,
+ 'privacy_warning' => $privacy_warning,
'verified' => $verified,
'unverified' => $unverified,
'forged' => $forged,
diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php
index c946961bc..97a46a43e 100644
--- a/Zotlabs/Module/New_channel.php
+++ b/Zotlabs/Module/New_channel.php
@@ -41,7 +41,7 @@ class New_channel extends \Zotlabs\Web\Controller {
$test[] = legal_webbie($x);
// fullname plus random number
$test[] = legal_webbie($x) . mt_rand(1000,9999);
-
+
json_return_and_die(check_webbie($test));
}
@@ -49,7 +49,10 @@ class New_channel extends \Zotlabs\Web\Controller {
require_once('library/urlify/URLify.php');
$result = array('error' => false, 'message' => '');
$n = trim($_REQUEST['nick']);
-
+ if(! $n) {
+ $n = trim($_REQUEST['name']);
+ }
+
$x = false;
if(get_config('system','unicode_usernames')) {
@@ -58,9 +61,20 @@ class New_channel extends \Zotlabs\Web\Controller {
if((! $x) || strlen($x) > 64)
$x = strtolower(\URLify::transliterate($n));
-
+
+
$test = array();
+ // first name
+ if(strpos($x,' '))
+ $test[] = legal_webbie(substr($x,0,strpos($x,' ')));
+ if($test[0]) {
+ // first name plus first initial of last
+ $test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
+ // first name plus random number
+ $test[] = $test[0] . mt_rand(1000,9999);
+ }
+
$n = legal_webbie($x);
if(strlen($n)) {
$test[] = $n;
diff --git a/Zotlabs/Module/Oauthinfo.php b/Zotlabs/Module/Oauthinfo.php
new file mode 100644
index 000000000..2d10913c4
--- /dev/null
+++ b/Zotlabs/Module/Oauthinfo.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Zotlabs\Module;
+
+
+class Oauthinfo extends \Zotlabs\Web\Controller {
+
+
+ function init() {
+
+ $ret = [
+ 'issuer' => z_root(),
+ 'authorization_endpoint' => z_root() . '/authorize',
+ 'token_endpoint' => z_root() . '/token',
+ 'response_types_supported' => [ 'code', 'token', 'id_token', 'code id_token', 'token id_token' ]
+ ];
+
+
+ json_return_and_die($ret);
+ }
+
+
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Well_known.php b/Zotlabs/Module/Well_known.php
index 177de2323..442994b54 100644
--- a/Zotlabs/Module/Well_known.php
+++ b/Zotlabs/Module/Well_known.php
@@ -50,7 +50,15 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Hostxrd();
$module->init();
break;
-
+
+ case 'oauth-authorization-server':
+ \App::$argc -= 1;
+ array_shift(\App::$argv);
+ \App::$argv[0] = 'oauthinfo';
+ $module = new \Zotlabs\Module\Oauthinfo();
+ $module->init();
+ break;
+
case 'dnt-policy.txt':
echo file_get_contents('doc/dnt-policy.txt');
killme();
diff --git a/include/js_strings.php b/include/js_strings.php
index 936594291..d9038e838 100644
--- a/include/js_strings.php
+++ b/include/js_strings.php
@@ -23,6 +23,16 @@ function js_strings() {
'$linkurl' => t('Please enter a link URL'),
'$leavethispage' => t('Unsaved changes. Are you sure you wish to leave this page?'),
'$location' => t('Location'),
+ '$lovely' => t('lovely'),
+ '$wonderful' => t('wonderful'),
+ '$fantastic' => t('fantastic'),
+ '$great' => t('great'),
+ '$nick_invld1' => t('Your chosen nickname was either already taken or not valid. Please use our suggestion ('),
+ '$nick_invld2' => t(') or enter a new one.'),
+ '$nick_valid' => t('Thank you, this nickname is valid.'),
+ '$name_empty' => t('A channel name is required.'),
+ '$name_ok1' => t('This is a '),
+ '$name_ok2' => t(' channel name'),
// translatable prefix and suffix strings for jquery.timeago -
// using the defaults set below if left untranslated, empty strings if
diff --git a/include/oauth.php b/include/oauth.php
index a3c52bf27..845ec4558 100644
--- a/include/oauth.php
+++ b/include/oauth.php
@@ -79,7 +79,7 @@ class ZotOAuth1DataStore extends OAuth1DataStore {
$k = $consumer;
}
- $r = q("INSERT INTO tokens (id, secret, client_id, auth_scope, expires) VALUES ('%s','%s','%s','%s', %d)",
+ $r = q("INSERT INTO tokens (id, secret, client_id, auth_scope, expires, uid) VALUES ('%s','%s','%s','%s', %d, 0)",
dbesc($key),
dbesc($sec),
dbesc($k),
diff --git a/include/text.php b/include/text.php
index aafba2168..34063cdd7 100644
--- a/include/text.php
+++ b/include/text.php
@@ -572,7 +572,7 @@ function item_message_id() {
$r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1",
dbesc($mid));
- if(count($r))
+ if($r)
$dups = true;
} while($dups == true);
@@ -593,7 +593,7 @@ function photo_new_resource() {
$r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1",
dbesc($resource));
- if(count($r))
+ if($r)
$found = true;
} while($found === true);
diff --git a/util/add_addon_repo b/util/add_addon_repo
index 6bd9686a1..d82081470 100755
--- a/util/add_addon_repo
+++ b/util/add_addon_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -lt 2 ]; then
echo usage: $0 repo_url nickname
diff --git a/util/add_theme_repo b/util/add_theme_repo
index 30898dc01..7ae9cdb02 100755
--- a/util/add_theme_repo
+++ b/util/add_theme_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -lt 2 ]; then
echo usage: $0 repo_url nickname
diff --git a/util/add_widget_repo b/util/add_widget_repo
index a8e888cdc..77774587c 100755
--- a/util/add_widget_repo
+++ b/util/add_widget_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -lt 2 ]; then
echo usage: $0 repo_url nickname
diff --git a/util/update_addon_repo b/util/update_addon_repo
index efa46c668..0e471eb4f 100755
--- a/util/update_addon_repo
+++ b/util/update_addon_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -ne 1 ]; then
echo usage: $0 repository
diff --git a/util/update_theme_repo b/util/update_theme_repo
index 609e0cde0..b4de55568 100755
--- a/util/update_theme_repo
+++ b/util/update_theme_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -ne 1 ]; then
diff --git a/util/update_widget_repo b/util/update_widget_repo
index c88a1e637..70d09f959 100755
--- a/util/update_widget_repo
+++ b/util/update_widget_repo
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash -f
+#!/usr/bin/env bash
+
+set -f
if [ $# -ne 1 ]; then
echo usage: $0 repository
diff --git a/view/js/mod_new_channel.js b/view/js/mod_new_channel.js
index c01029046..10a94796c 100644
--- a/view/js/mod_new_channel.js
+++ b/view/js/mod_new_channel.js
@@ -43,19 +43,20 @@
$("#nick_help_loading").show();
$("#nick_help_text").hide();
+ var zreg_name = $("#id_name").val();
var zreg_nick = $("#id_nickname").val();
- $.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
+ $.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick) + '&name=' + encodeURIComponent(zreg_name),function(data) {
$("#id_nickname").val(data);
if(data !== zreg_nick) {
$("#id_nickname").addClass('is-validated');
$("#help_nickname").addClass('text-danger').removeClass('text-muted');
- $("#help_nickname").html('Your chosen nickname was either already taken or not valid. Please use our suggestion (' + data + ') or enter a new one.');
+ $("#help_nickname").html(aStr['nick_invld1'] + data + aStr['nick_invld2']);
$("#id_nickname").focus();
}
else {
$("#id_nickname").addClass('is-validated');
$("#help_nickname").addClass('text-success').removeClass('text-muted').removeClass('text-danger');
- $("#help_nickname").html("Thank you, this nickname is valid.");
+ $("#help_nickname").html(aStr['nick_valid']);
}
$("#nick_help_loading").hide();
$("#nick_help_text").show();
@@ -69,18 +70,18 @@
if($("#id_name").hasClass('is-validated'))
return true;
- var verbs = ['lovely', 'wonderful', 'gorgeous', 'great'];
+ var verbs = [ aStr['lovely'], aStr['wonderful'], aStr['fantastic'], aStr['great'] ];
var verb = verbs[Math.floor((Math.random() * 4) + 0)];
if(! $("#id_name").val()) {
$("#id_name").focus();
$("#help_name").addClass('text-danger').removeClass('text-muted');
- $("#help_name").html("A channel name is required.");
+ $("#help_name").html(aStr['name_empty']);
return false;
}
else {
$("#help_name").addClass('text-success').removeClass('text-muted').removeClass('text-danger');
- $("#help_name").html('This is a ' + verb + ' channel name.');
+ $("#help_name").html(aStr['name_ok1'] + verb + aStr['name_ok2']);
$("#id_name").addClass('is-validated');
return true;
}
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index f72737d82..6baf06dda 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -43,7 +43,7 @@
</div>
{{if $item.lock}}
<div class="wall-item-lock dropdown">
- <i class="fa fa-lock lockview" data-toggle="dropdown" title="{{$item.lock}}" onclick="lockview('item',{{$item.id}});" ></i>&nbsp;
+ <i class="fa fa-lock lockview{{if $item.privacy_warning}} text-danger{{/if}}" data-toggle="dropdown" title="{{$item.lock}}" onclick="lockview('item',{{$item.id}});" ></i>&nbsp;
<div id="panel-{{$item.id}}" class="dropdown-menu"></div>
</div>
{{/if}}
diff --git a/view/tpl/js_strings.tpl b/view/tpl/js_strings.tpl
index 4243c2ea5..01fc3f993 100755
--- a/view/tpl/js_strings.tpl
+++ b/view/tpl/js_strings.tpl
@@ -23,6 +23,18 @@
'linkurl' : "{{$linkurl}}",
'leavethispage' : "{{$leavethispage}}",
'location' : "{{$location}}",
+ 'lovely' : "{{$lovely}}",
+ 'wonderful' : "{{$wonderful}}",
+ 'fantastic' : "{{$fantastic}}",
+ 'great' : "{{$great}}",
+ 'nick_invld1' : "{{$nick_invld1}}",
+ 'nick_invld2' : "{{$nick_invld2}}",
+ 'nick_valid' : "{{$nick_valid}}",
+ 'name_empty' : "{{$name_empty}}",
+ 'name_ok1' : "{{$name_ok1}}",
+ 'name_ok2' : "{{$name_ok2}}",
+
+
't01' : "{{$t01}}",
't02' : "{{$t02}}",