Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Haakon Meland Eriksen 2016-02-06 12:57:25 +01:00
commit 2935c5fe1a
29 changed files with 1910 additions and 1800 deletions

View File

@ -48,7 +48,7 @@ require_once('include/AccessList.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
define ( 'STD_VERSION', '1.2' );
define ( 'STD_VERSION', '1.2.1' );
define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1161 );

View File

@ -681,7 +681,7 @@ class Item extends BaseObject {
$qc = ((local_channel()) ? get_pconfig(local_channel(),'system','qcomment') : null);
$qcomment = (($qc) ? explode("\n",$qc) : null);
$arr = array('comment_buttons' => '');
$arr = array('comment_buttons' => '','id' => $this->get_id());
call_hooks('comment_buttons',$arr);
$comment_buttons = $arr['comment_buttons'];

View File

@ -15,6 +15,9 @@ function cli_startup() {
if(is_null($db)) {
@include(".htconfig.php");
if(! defined('UNO'))
define('UNO', 0);
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
date_default_timezone_set($a->timezone);

View File

@ -38,6 +38,9 @@ function get_feature_default($feature) {
function get_features($filtered = true) {
if(UNO)
return array();
$arr = array(
// General

View File

@ -484,7 +484,7 @@ function identity_basic_export($channel_id, $items = false) {
// use constants here as otherwise we will have no idea if we can import from a site
// with a non-standard platform and version.
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION);
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => UNO );
$r = q("select * from channel where channel_id = %d limit 1",
intval($channel_id)
@ -928,9 +928,6 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
$block = true;
}
if($block && intval(get_config('system','block_public_blackout')))
return $o;
if((! is_array($profile)) && (! count($profile)))
return $o;

View File

@ -76,7 +76,7 @@ EOT;
if(local_channel()) {
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select'))
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select') && (! UNO))
$nav['channels'] = $chans;
$nav['logout'] = Array('logout',t('Logout'), "", t('End this session'),'logout_nav_btn');
@ -84,7 +84,7 @@ EOT;
// user menu
$nav['usermenu'][] = Array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations'),'channel_nav_btn');
$nav['usermenu'][] = Array('profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn');
if(feature_enabled(local_channel(),'multi_profiles'))
if(feature_enabled(local_channel(),'multi_profiles') && (! UNO))
$nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn');
else
$nav['usermenu'][] = Array('profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn');
@ -94,16 +94,17 @@ EOT;
require_once('include/chat.php');
$has_chats = chatroom_list_count(local_channel());
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'] . (($has_chats) ? '' : '/new'), t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
if(! UNO)
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'] . (($has_chats) ? '' : '/new'), t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
require_once('include/menu.php');
$has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK);
if($has_bookmarks) {
if(($has_bookmarks) && (! UNO)) {
$nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks'),'bookmarks_nav_btn');
}
if(feature_enabled($channel['channel_id'],'webpages'))
if(feature_enabled($channel['channel_id'],'webpages') && (! UNO))
$nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages'),'webpages_nav_btn');
}
else {
@ -154,7 +155,8 @@ EOT;
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn');
$nav['apps'] = array('apps', t('Apps'), "", t('Applications, utilities, links, games'),'apps_nav_btn');
if(! UNO)
$nav['apps'] = array('apps', t('Apps'), "", t('Applications, utilities, links, games'),'apps_nav_btn');
$nav['search'] = array('search', t('Search'), "", t('Search site @name, #tag, ?docs, content'));
@ -196,8 +198,9 @@ EOT;
$nav['all_events'] = array('events', t('Events'), "", t('Event Calendar'),'events_nav_btn');
$nav['all_events']['all']=array('events', t('See all events'), "", "");
$nav['all_events']['mark'] = array('', t('Mark all events seen'), '','');
$nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn');
if(! UNO)
$nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn');
$nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn');

View File

@ -527,7 +527,6 @@ function widget_settings_menu($arr) {
'selected' => ''
);
if($role === false || $role === 'custom') {
$tabs[] = array(
'label' => t('Connection Default Permissions'),

View File

@ -2868,6 +2868,9 @@ function import_site($arr, $pubkey) {
*/
function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
if(UNO)
return;
$a = get_app();
logger('build_sync_packet');
@ -2997,6 +3000,9 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
*/
function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(UNO)
return;
require_once('include/import.php');
/** @FIXME this will sync red structures (channel, pconfig and abook). Eventually we need to make this application agnostic. */

View File

@ -28,6 +28,9 @@ $a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? fal
@include('.htconfig.php');
if(! defined('UNO'))
define('UNO', 0);
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
date_default_timezone_set($a->timezone);

View File

@ -19,6 +19,8 @@ $db_pass = 'mysqlpassword';
$db_data = 'mysqldatabasename';
$db_type = 0; // use 1 for postgres, 0 for mysql
define( 'UNO', 0 );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -109,6 +109,9 @@ function import_account(&$a, $account_id) {
return;
}
if(UNO)
return;
if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
$v1 = substr($data['compatibility']['database'],-4);
$v2 = substr(DB_UPDATE_VERSION,-4);
@ -116,6 +119,12 @@ function import_account(&$a, $account_id) {
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
notice($t);
}
if(array_key_exists('server_role',$data['compatibility'])
&& $data['compatibility']['server_role'] != UNO) {
notice( t('Server platform is not compatible. Operation not permitted.') . EOL);
return;
}
}
// import channel

View File

@ -227,8 +227,8 @@ function register_content(&$a) {
$nickname = ((x($_REQUEST,'nickname')) ? strip_tags(trim($_REQUEST['nickname'])) : "" );
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" );
$auto_create = get_config('system','auto_channel_create');
$default_role = get_config('system','default_permissions_role');
$auto_create = ((UNO) || (get_config('system','auto_channel_create')) ? true : false);
$default_role = ((UNO) ? 'social' : get_config('system','default_permissions_role'));
require_once('include/bbcode.php');

View File

@ -600,7 +600,7 @@ function settings_content(&$a) {
local_channel());
if (!count($r)){
notice(t("You can't edit this application."));
notice(t('Application not found.'));
return;
}
$app = $r[0];

View File

@ -67,7 +67,8 @@ function setup_post(&$a) {
$phpath = trim($_POST['phpath']);
$adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']);
$advanced = ((intval($_POST['advanced'])) ? 1 : 0);
// $siteurl should not have a trailing slash
$siteurl = rtrim($siteurl,'/');
@ -118,6 +119,7 @@ function setup_post(&$a) {
$timezone = notags(trim($_POST['timezone']));
$adminmail = notags(trim($_POST['adminmail']));
$siteurl = notags(trim($_POST['siteurl']));
$advanced = ((intval($_POST['advanced'])) ? 1 : 0);
if($siteurl != z_root()) {
$test = z_fetch_url($siteurl."/setup/testrewrite");
@ -138,16 +140,17 @@ function setup_post(&$a) {
$tpl = get_intltext_template('htconfig.tpl');
$txt = replace_macros($tpl,array(
'$dbhost' => $dbhost,
'$dbport' => $dbport,
'$dbuser' => $dbuser,
'$dbpass' => $dbpass,
'$dbdata' => $dbdata,
'$dbtype' => $dbtype,
'$timezone' => $timezone,
'$siteurl' => $siteurl,
'$site_id' => random_string(),
'$phpath' => $phpath,
'$dbhost' => $dbhost,
'$dbport' => $dbport,
'$dbuser' => $dbuser,
'$dbpass' => $dbpass,
'$dbdata' => $dbdata,
'$dbtype' => $dbtype,
'$uno' => 1 - $advanced,
'$timezone' => $timezone,
'$siteurl' => $siteurl,
'$site_id' => random_string(),
'$phpath' => $phpath,
'$adminmail' => $adminmail
));
@ -321,7 +324,6 @@ function setup_content(&$a) {
'$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
'$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')),
'$lbl_10' => t('Please select a default timezone for your website'),
'$baseurl' => $a->get_baseurl(),
@ -363,6 +365,7 @@ function setup_content(&$a) {
'$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
'$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')),
'$advanced' => array('advanced', t('Enable $Projectname <strong>advanced</strong> features?'), 0, t('Some advanced features, while useful - may be best suited for technically proficient audiences')),
'$timezone' => array('timezone', t('Please select a default timezone for your website'), $timezone, '', get_timezones()),

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
2016-02-04.1299H
2016-02-05.1300H

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -12,6 +12,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Note: Plusieurs de ces réglages seront disponibles via le panneau d'administration
* après l'installation. Lorsque des modifications sont apportés à travers le panneau d'administration

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -10,6 +10,8 @@ $db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
define( 'UNO', {{$uno}} );
/*
* Notice: Many of the following settings will be available in the admin panel
* after a successful site install. Once they are set in the admin panel, they

View File

@ -19,6 +19,7 @@
{{include file="field_input.tpl" field=$adminmail}}
{{include file="field_input.tpl" field=$siteurl}}
{{include file="field_checkbox.tpl" field=$advanced}}
{{include file="field_select_grouped.tpl" field=$timezone}}