Merge branch 'dev' into 3.2RC

This commit is contained in:
Mario Vavti 2018-03-01 08:38:17 +01:00
commit 844bef5070
66 changed files with 230 additions and 48 deletions

View File

@ -215,6 +215,7 @@ class Display extends \Zotlabs\Web\Controller {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
$r = null;
require_once('include/channel.php');
@ -235,7 +236,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
if($r === null) {
if(! $r) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner uid can't match
@ -281,7 +282,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
if($r === null) {
if(! $r) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner_xchan can't match
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))

View File

@ -7,12 +7,11 @@ class Email_validation extends \Zotlabs\Web\Controller {
function post() {
$success = false;
if($_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(account_approve(trim(basename($_POST['token'])))) {
$success = true;
if(get_config('system','auto_channel_create')) {
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
}
@ -21,7 +20,9 @@ class Email_validation extends \Zotlabs\Web\Controller {
}
}
}
if(! $success) {
notice( t('Token verification failed.') . EOL);
}
}

View File

@ -36,7 +36,7 @@ class Go extends \Zotlabs\Web\Controller {
'cover_photo' => t('Upload a cover photo'),
'profiles' => t('Edit your default profile'),
'suggest' => t('View friend suggestions'),
'directory' => t('View the directory to find other interesting channels'),
'directory' => t('View the channel directory'),
'settings' => t('View/edit your channel settings'),
'help' => t('View the site or project documentation'),
'channel/' . $channel['channel_address'] => t('Visit your channel homepage'),

View File

@ -123,9 +123,6 @@ class Register extends \Zotlabs\Web\Controller {
if($policy == REGISTER_OPEN ) {
if($email_verify) {
$res = verify_email_address($result);
if($res) {
info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ;
}
}
else {
$res = send_register_success_email($result['email'],$result['password']);
@ -133,7 +130,8 @@ class Register extends \Zotlabs\Web\Controller {
if($res) {
if($invite_code) {
info( t('Registration successful. Continue to create your first channel...') . EOL ) ;
} else {
}
else {
info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ;
}
}

View File

@ -61,7 +61,8 @@ class Featured {
$tpl = get_markup_template("settings_addons.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_featured"),
'$title' => t('Feature/Addon Settings'),
'$title' => t('Addon Settings'),
'$descrip' => t('Please save/submit changes to any panel before opening another.'),
'$settings_addons' => $settings_addons
));
return $o;

View File

@ -0,0 +1,83 @@
<?php
namespace Zotlabs\Widget;
class Newmember {
function widget($arr) {
if(! local_channel())
return EMPTY_STR;
$c = \App::get_channel();
if(! $c)
return EMPTY_STR;
$a = \App::get_account();
if(! $a)
return EMPTY_STR;
if(datetime_convert('UTC','UTC',$a['account_created']) < datetime_convert('UTC','UTC', 'now - 60 days'))
return EMPTY_STR;
// This could be a new account that was used to clone a very old channel
$ob = \App::get_observer();
if($ob && array_key_exists('xchan_name_date',$ob) && $ob['xchan_name_date'] < datetime_convert('UTC','UTC','now - 60 days'))
return EMPTY_STR;
$options = [
t('Profile Creation'),
[
'profile_photo' => t('Upload profile photo'),
'cover_photo' => t('Upload cover photo'),
'profiles' => t('Edit your profile'),
],
t('Find and Connect with others'),
[
'directory' => t('View the channel directory'),
'suggest' => t('View friend suggestions'),
'connections' => t('Manage your connections'),
],
t('Communicate'),
[
'channel/' . $channel['channel_address'] => t('View your channel homepage'),
'network' => t('View your network stream'),
],
t('Miscellaneous'),
[
'settings' => t('Settings'),
'help' => t('Documentation'),
]
];
$site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false);
$net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true);
// hack to put this in the correct spot of the array
if($site_firehose || $net_firehose) {
$options[5]['pubstream'] = t('View public stream. Warning: not moderated');
}
$o = replace_macros(get_markup_template('new_member.tpl'), [
'$title' => t('New Member Links'),
'$options' => $options
]);
return $o;
}
}

View File

@ -54,7 +54,7 @@ class Settings_menu {
}
$tabs[] = array(
'label' => t('Feature/Addon settings'),
'label' => t('Addon settings'),
'url' => z_root().'/settings/featured',
'selected' => ((argv(1) === 'featured') ? 'active' : ''),
);
@ -79,7 +79,7 @@ class Settings_menu {
'selected' => ''
);
if(get_account_techlevel() > 0) {
if(feature_enabled(local_channel(),'oauth_clients')) {
$tabs[] = array(
'label' => t('Connected apps'),
'url' => z_root() . '/settings/oauth',
@ -87,7 +87,7 @@ class Settings_menu {
);
}
if(get_account_techlevel() > 2) {
if(feature_enabled(local_channel(),'access_tokens')) {
$tabs[] = array(
'label' => t('Guest Access Tokens'),
'url' => z_root() . '/settings/tokens',

View File

@ -50,7 +50,7 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.2RC' );
define ( 'STD_VERSION', '3.3' );
define ( 'ZOT_REVISION', '1.3' );
define ( 'DB_UPDATE_VERSION', 1206 );

View File

@ -530,7 +530,7 @@ function account_deny($hash) {
function account_approve($hash) {
$ret = array('success' => false);
$ret = false;
// Note: when the password in the register table is 'verify', the uid actually contains the account_id

View File

@ -125,7 +125,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d
*/
function dob($dob) {
if ($dob === '0000-00-00')
if ($dob === '0000-00-00' || $dob === '')
$value = '';
else
$value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d'));

View File

@ -54,14 +54,6 @@ function get_features($filtered = true) {
t('General Features'),
[
'multi_profiles',
t('Multiple Profiles'),
t('Ability to create multiple profiles'),
false,
get_config('feature_lock','multi_profiles'),
feature_level('multi_profiles',3),
],
[
'advanced_profiles',
@ -163,14 +155,6 @@ function get_features($filtered = true) {
feature_level('ajaxchat',1),
],
[
'permcats',
t('Permission Groups'),
t('Provide alternate connection permission roles.'),
false,
get_config('feature_lock','permcats'),
feature_level('permcats',2),
],
[
'smart_birthdays',
@ -219,6 +203,58 @@ function get_features($filtered = true) {
],
],
'access_control' => [
t('Access Control and Permissions'),
[
'groups',
t('Privacy Groups'),
t('Enable management and selection of privacy groups'),
true,
get_config('feature_lock','groups'),
feature_level('groups',0),
],
[
'multi_profiles',
t('Multiple Profiles'),
t('Ability to create multiple profiles'),
false,
get_config('feature_lock','multi_profiles'),
feature_level('multi_profiles',3),
],
[
'permcats',
t('Permission Groups'),
t('Provide alternate connection permission roles.'),
false,
get_config('feature_lock','permcats'),
feature_level('permcats',2),
],
[
'oauth_clients',
t('OAuth Clients'),
t('Manage authenticatication tokens for mobile and remote apps.'),
false,
get_config('feature_lock','oauth_clients'),
feature_level('oauth_clients',1),
],
[
'access_tokens',
t('Access Tokens'),
t('Create access tokens so that non-members can access private content.'),
false,
get_config('feature_lock','access_tokens'),
feature_level('access_tokens',2),
],
],
// Post composition
'composition' => [
@ -312,14 +348,6 @@ function get_features($filtered = true) {
feature_level('archives',1),
],
[
'groups',
t('Privacy Groups'),
t('Enable management and selection of privacy groups'),
true,
get_config('feature_lock','groups'),
feature_level('groups',0),
],
[
'savedsearch',

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -5,4 +5,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -5,4 +5,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -10,4 +10,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -7,4 +7,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -6,4 +6,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -6,4 +6,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -6,4 +6,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -1,3 +1,4 @@
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -14,4 +14,5 @@ $content
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -1,3 +1,4 @@
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -7,4 +7,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -2,4 +2,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -1,3 +1,4 @@
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -3,4 +3,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -4,4 +4,5 @@
[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]
[/region]

View File

@ -2,15 +2,15 @@
<div class="descriptive-paragraph" style="font-size: 1.2em;"><p>{{$desc}}</p></div>
<form action="email_validation" method="post">
<form action="email_validation/{{$email}}" method="post">
{{include file="field_input.tpl" field=$token}}
<div class="pull-right">
<a href="email_resend/{{$email}}" class="btn btn-warning">{{$resend}}</a>
</div>
<div class="submit-wrapper" >
<div class="pull-right submit-wrapper">
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
</div>
<div class="resend-email" >
<a href="email_resend/{{$email}}" class="btn btn-warning">{{$resend}}</a>
</div>
</form>
<div class="clear"></div>

17
view/tpl/new_member.tpl Normal file
View File

@ -0,0 +1,17 @@
<div class="widget">
<h3>{{$title}}</h3>
{{if $options}}
<ul class="nav nav-pills flex-column">
{{foreach $options as $x}}
{{if is_array($x) }}
{{foreach $x as $y => $z}}
<li class="nav-item"><a href="{{$y}}" class="nav-link">{{$z}}</a></li>
{{/foreach}}
{{else}}
<div><strong>{{$x}}</strong></div>
{{/if}}
{{/foreach}}
</ul>
{{/if}}
</div>

View File

@ -1,5 +1,6 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<div class="descriptive-text pull-right">{{$descrip}}</div>
<h2>{{$title}}</h2>
</div>
<form action="settings/featured" method="post" autocomplete="off">