mirror of
https://github.com/friendica/friendica
synced 2025-04-22 09:10:10 +00:00
Merge remote-tracking branch 'upstream/develop' into diaspora-item
This commit is contained in:
commit
24c32cff0d
99 changed files with 2750 additions and 2500 deletions
|
@ -48,8 +48,6 @@ class Site extends BaseAdmin
|
|||
|
||||
self::checkFormSecurityTokenRedirectOnError('/admin/site', 'admin_site');
|
||||
|
||||
$a = DI::app();
|
||||
|
||||
if (!empty($_POST['republish_directory'])) {
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Directory');
|
||||
return;
|
||||
|
@ -146,9 +144,11 @@ class Site extends BaseAdmin
|
|||
$relay_user_tags = !empty($_POST['relay_user_tags']);
|
||||
$active_panel = (!empty($_POST['active_panel']) ? "#" . trim($_POST['active_panel']) : '');
|
||||
|
||||
$transactionConfig = DI::config()->beginTransaction();
|
||||
|
||||
// Has the directory url changed? If yes, then resubmit the existing profiles there
|
||||
if ($global_directory != DI::config()->get('system', 'directory') && ($global_directory != '')) {
|
||||
DI::config()->set('system', 'directory', $global_directory);
|
||||
$transactionConfig->set('system', 'directory', $global_directory);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'Directory');
|
||||
}
|
||||
|
||||
|
@ -194,131 +194,133 @@ class Site extends BaseAdmin
|
|||
);
|
||||
}
|
||||
}
|
||||
DI::config()->set('system', 'ssl_policy' , $ssl_policy);
|
||||
DI::config()->set('system', 'maxloadavg' , $maxloadavg);
|
||||
DI::config()->set('system', 'min_memory' , $min_memory);
|
||||
DI::config()->set('system', 'optimize_tables' , $optimize_tables);
|
||||
DI::config()->set('system', 'contact_discovery' , $contact_discovery);
|
||||
DI::config()->set('system', 'synchronize_directory' , $synchronize_directory);
|
||||
DI::config()->set('system', 'poco_requery_days' , $poco_requery_days);
|
||||
DI::config()->set('system', 'poco_discovery' , $poco_discovery);
|
||||
DI::config()->set('system', 'poco_local_search' , $poco_local_search);
|
||||
DI::config()->set('system', 'nodeinfo' , $nodeinfo);
|
||||
DI::config()->set('config', 'sitename' , $sitename);
|
||||
DI::config()->set('config', 'sender_email' , $sender_email);
|
||||
DI::config()->set('system', 'suppress_tags' , $suppress_tags);
|
||||
DI::config()->set('system', 'shortcut_icon' , $shortcut_icon);
|
||||
DI::config()->set('system', 'touch_icon' , $touch_icon);
|
||||
$transactionConfig->set('system', 'ssl_policy' , $ssl_policy);
|
||||
$transactionConfig->set('system', 'maxloadavg' , $maxloadavg);
|
||||
$transactionConfig->set('system', 'min_memory' , $min_memory);
|
||||
$transactionConfig->set('system', 'optimize_tables' , $optimize_tables);
|
||||
$transactionConfig->set('system', 'contact_discovery' , $contact_discovery);
|
||||
$transactionConfig->set('system', 'synchronize_directory' , $synchronize_directory);
|
||||
$transactionConfig->set('system', 'poco_requery_days' , $poco_requery_days);
|
||||
$transactionConfig->set('system', 'poco_discovery' , $poco_discovery);
|
||||
$transactionConfig->set('system', 'poco_local_search' , $poco_local_search);
|
||||
$transactionConfig->set('system', 'nodeinfo' , $nodeinfo);
|
||||
$transactionConfig->set('config', 'sitename' , $sitename);
|
||||
$transactionConfig->set('config', 'sender_email' , $sender_email);
|
||||
$transactionConfig->set('system', 'suppress_tags' , $suppress_tags);
|
||||
$transactionConfig->set('system', 'shortcut_icon' , $shortcut_icon);
|
||||
$transactionConfig->set('system', 'touch_icon' , $touch_icon);
|
||||
|
||||
if ($banner == "") {
|
||||
DI::config()->delete('system', 'banner');
|
||||
$transactionConfig->delete('system', 'banner');
|
||||
} else {
|
||||
DI::config()->set('system', 'banner', $banner);
|
||||
$transactionConfig->set('system', 'banner', $banner);
|
||||
}
|
||||
|
||||
if (empty($email_banner)) {
|
||||
DI::config()->delete('system', 'email_banner');
|
||||
$transactionConfig->delete('system', 'email_banner');
|
||||
} else {
|
||||
DI::config()->set('system', 'email_banner', $email_banner);
|
||||
$transactionConfig->set('system', 'email_banner', $email_banner);
|
||||
}
|
||||
|
||||
if (empty($additional_info)) {
|
||||
DI::config()->delete('config', 'info');
|
||||
$transactionConfig->delete('config', 'info');
|
||||
} else {
|
||||
DI::config()->set('config', 'info', $additional_info);
|
||||
$transactionConfig->set('config', 'info', $additional_info);
|
||||
}
|
||||
DI::config()->set('system', 'language', $language);
|
||||
DI::config()->set('system', 'theme', $theme);
|
||||
$transactionConfig->set('system', 'language', $language);
|
||||
$transactionConfig->set('system', 'theme', $theme);
|
||||
Theme::install($theme);
|
||||
|
||||
if ($theme_mobile == '---') {
|
||||
DI::config()->delete('system', 'mobile-theme');
|
||||
$transactionConfig->delete('system', 'mobile-theme');
|
||||
} else {
|
||||
DI::config()->set('system', 'mobile-theme', $theme_mobile);
|
||||
$transactionConfig->set('system', 'mobile-theme', $theme_mobile);
|
||||
}
|
||||
if ($singleuser == '---') {
|
||||
DI::config()->delete('system', 'singleuser');
|
||||
$transactionConfig->delete('system', 'singleuser');
|
||||
} else {
|
||||
DI::config()->set('system', 'singleuser', $singleuser);
|
||||
$transactionConfig->set('system', 'singleuser', $singleuser);
|
||||
}
|
||||
if (preg_match('/\d+(?:\s*[kmg])?/i', $maximagesize)) {
|
||||
DI::config()->set('system', 'maximagesize', $maximagesize);
|
||||
$transactionConfig->set('system', 'maximagesize', $maximagesize);
|
||||
} else {
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('%s is no valid input for maximum image size', $maximagesize));
|
||||
}
|
||||
DI::config()->set('system', 'max_image_length' , $maximagelength);
|
||||
DI::config()->set('system', 'jpeg_quality' , $jpegimagequality);
|
||||
$transactionConfig->set('system', 'max_image_length' , $maximagelength);
|
||||
$transactionConfig->set('system', 'jpeg_quality' , $jpegimagequality);
|
||||
|
||||
DI::config()->set('config', 'register_policy' , $register_policy);
|
||||
DI::config()->set('system', 'max_daily_registrations', $daily_registrations);
|
||||
DI::config()->set('system', 'account_abandon_days' , $abandon_days);
|
||||
DI::config()->set('config', 'register_text' , $register_text);
|
||||
DI::config()->set('system', 'allowed_sites' , $allowed_sites);
|
||||
DI::config()->set('system', 'allowed_email' , $allowed_email);
|
||||
DI::config()->set('system', 'forbidden_nicknames' , $forbidden_nicknames);
|
||||
DI::config()->set('system', 'system_actor_name' , $system_actor_name);
|
||||
DI::config()->set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
|
||||
DI::config()->set('system', 'allowed_oembed' , $allowed_oembed);
|
||||
DI::config()->set('system', 'block_public' , $block_public);
|
||||
DI::config()->set('system', 'publish_all' , $force_publish);
|
||||
DI::config()->set('system', 'newuser_private' , $newuser_private);
|
||||
DI::config()->set('system', 'enotify_no_content' , $enotify_no_content);
|
||||
DI::config()->set('system', 'disable_embedded' , $disable_embedded);
|
||||
DI::config()->set('system', 'allow_users_remote_self', $allow_users_remote_self);
|
||||
DI::config()->set('system', 'explicit_content' , $explicit_content);
|
||||
DI::config()->set('system', 'proxify_content' , $proxify_content);
|
||||
DI::config()->set('system', 'cache_contact_avatar' , $cache_contact_avatar);
|
||||
DI::config()->set('system', 'check_new_version_url' , $check_new_version_url);
|
||||
$transactionConfig->set('config', 'register_policy' , $register_policy);
|
||||
$transactionConfig->set('system', 'max_daily_registrations', $daily_registrations);
|
||||
$transactionConfig->set('system', 'account_abandon_days' , $abandon_days);
|
||||
$transactionConfig->set('config', 'register_text' , $register_text);
|
||||
$transactionConfig->set('system', 'allowed_sites' , $allowed_sites);
|
||||
$transactionConfig->set('system', 'allowed_email' , $allowed_email);
|
||||
$transactionConfig->set('system', 'forbidden_nicknames' , $forbidden_nicknames);
|
||||
$transactionConfig->set('system', 'system_actor_name' , $system_actor_name);
|
||||
$transactionConfig->set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
|
||||
$transactionConfig->set('system', 'allowed_oembed' , $allowed_oembed);
|
||||
$transactionConfig->set('system', 'block_public' , $block_public);
|
||||
$transactionConfig->set('system', 'publish_all' , $force_publish);
|
||||
$transactionConfig->set('system', 'newuser_private' , $newuser_private);
|
||||
$transactionConfig->set('system', 'enotify_no_content' , $enotify_no_content);
|
||||
$transactionConfig->set('system', 'disable_embedded' , $disable_embedded);
|
||||
$transactionConfig->set('system', 'allow_users_remote_self', $allow_users_remote_self);
|
||||
$transactionConfig->set('system', 'explicit_content' , $explicit_content);
|
||||
$transactionConfig->set('system', 'proxify_content' , $proxify_content);
|
||||
$transactionConfig->set('system', 'cache_contact_avatar' , $cache_contact_avatar);
|
||||
$transactionConfig->set('system', 'check_new_version_url' , $check_new_version_url);
|
||||
|
||||
DI::config()->set('system', 'block_extended_register', !$enable_multi_reg);
|
||||
DI::config()->set('system', 'no_openid' , !$enable_openid);
|
||||
DI::config()->set('system', 'no_regfullname' , !$enable_regfullname);
|
||||
DI::config()->set('system', 'register_notification' , $register_notification);
|
||||
DI::config()->set('system', 'community_page_style' , $community_page_style);
|
||||
DI::config()->set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
|
||||
DI::config()->set('system', 'verifyssl' , $verifyssl);
|
||||
DI::config()->set('system', 'proxyuser' , $proxyuser);
|
||||
DI::config()->set('system', 'proxy' , $proxy);
|
||||
DI::config()->set('system', 'curl_timeout' , $timeout);
|
||||
DI::config()->set('system', 'imap_disabled' , !$mail_enabled && function_exists('imap_open'));
|
||||
DI::config()->set('system', 'ostatus_disabled' , !$ostatus_enabled);
|
||||
DI::config()->set('system', 'diaspora_enabled' , $diaspora_enabled);
|
||||
$transactionConfig->set('system', 'block_extended_register', !$enable_multi_reg);
|
||||
$transactionConfig->set('system', 'no_openid' , !$enable_openid);
|
||||
$transactionConfig->set('system', 'no_regfullname' , !$enable_regfullname);
|
||||
$transactionConfig->set('system', 'register_notification' , $register_notification);
|
||||
$transactionConfig->set('system', 'community_page_style' , $community_page_style);
|
||||
$transactionConfig->set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
|
||||
$transactionConfig->set('system', 'verifyssl' , $verifyssl);
|
||||
$transactionConfig->set('system', 'proxyuser' , $proxyuser);
|
||||
$transactionConfig->set('system', 'proxy' , $proxy);
|
||||
$transactionConfig->set('system', 'curl_timeout' , $timeout);
|
||||
$transactionConfig->set('system', 'imap_disabled' , !$mail_enabled && function_exists('imap_open'));
|
||||
$transactionConfig->set('system', 'ostatus_disabled' , !$ostatus_enabled);
|
||||
$transactionConfig->set('system', 'diaspora_enabled' , $diaspora_enabled);
|
||||
|
||||
DI::config()->set('config', 'private_addons' , $private_addons);
|
||||
$transactionConfig->set('config', 'private_addons' , $private_addons);
|
||||
|
||||
DI::config()->set('system', 'force_ssl' , $force_ssl);
|
||||
DI::config()->set('system', 'hide_help' , !$show_help);
|
||||
$transactionConfig->set('system', 'force_ssl' , $force_ssl);
|
||||
$transactionConfig->set('system', 'hide_help' , !$show_help);
|
||||
|
||||
DI::config()->set('system', 'dbclean' , $dbclean);
|
||||
DI::config()->set('system', 'dbclean-expire-days' , $dbclean_expire_days);
|
||||
DI::config()->set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
|
||||
$transactionConfig->set('system', 'dbclean' , $dbclean);
|
||||
$transactionConfig->set('system', 'dbclean-expire-days' , $dbclean_expire_days);
|
||||
$transactionConfig->set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
|
||||
|
||||
if ($dbclean_unclaimed == 0) {
|
||||
$dbclean_unclaimed = $dbclean_expire_days;
|
||||
}
|
||||
|
||||
DI::config()->set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
|
||||
$transactionConfig->set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
|
||||
|
||||
DI::config()->set('system', 'max_comments', $max_comments);
|
||||
DI::config()->set('system', 'max_display_comments', $max_display_comments);
|
||||
$transactionConfig->set('system', 'max_comments', $max_comments);
|
||||
$transactionConfig->set('system', 'max_display_comments', $max_display_comments);
|
||||
|
||||
if ($temppath != '') {
|
||||
$temppath = BasePath::getRealPath($temppath);
|
||||
}
|
||||
|
||||
DI::config()->set('system', 'temppath', $temppath);
|
||||
$transactionConfig->set('system', 'temppath', $temppath);
|
||||
|
||||
DI::config()->set('system', 'only_tag_search' , $only_tag_search);
|
||||
DI::config()->set('system', 'compute_group_counts', $compute_group_counts);
|
||||
$transactionConfig->set('system', 'only_tag_search' , $only_tag_search);
|
||||
$transactionConfig->set('system', 'compute_group_counts', $compute_group_counts);
|
||||
|
||||
DI::config()->set('system', 'worker_queues' , $worker_queues);
|
||||
DI::config()->set('system', 'worker_fastlane' , $worker_fastlane);
|
||||
$transactionConfig->set('system', 'worker_queues' , $worker_queues);
|
||||
$transactionConfig->set('system', 'worker_fastlane' , $worker_fastlane);
|
||||
|
||||
DI::config()->set('system', 'relay_directly' , $relay_directly);
|
||||
DI::config()->set('system', 'relay_scope' , $relay_scope);
|
||||
DI::config()->set('system', 'relay_server_tags', $relay_server_tags);
|
||||
DI::config()->set('system', 'relay_deny_tags' , $relay_deny_tags);
|
||||
DI::config()->set('system', 'relay_user_tags' , $relay_user_tags);
|
||||
$transactionConfig->set('system', 'relay_directly' , $relay_directly);
|
||||
$transactionConfig->set('system', 'relay_scope' , $relay_scope);
|
||||
$transactionConfig->set('system', 'relay_server_tags', $relay_server_tags);
|
||||
$transactionConfig->set('system', 'relay_deny_tags' , $relay_deny_tags);
|
||||
$transactionConfig->set('system', 'relay_user_tags' , $relay_user_tags);
|
||||
|
||||
$transactionConfig->commit();
|
||||
|
||||
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module\Admin;
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||
use Friendica\Core\Config\ValueObject\Cache;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
|
@ -114,6 +115,10 @@ class Summary extends BaseAdmin
|
|||
$warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
|
||||
}
|
||||
|
||||
if (!DI::configFileManager()->dataIsWritable()) {
|
||||
$warningtext[] = DI::l10n()->t('Friendica\'s configuration store "%s" isn\'t writable. Until then database updates won\'t be applied automatically, admin settings and console configuration changes won\'t be saved.', ConfigFileManager::CONFIG_DATA_FILE);
|
||||
}
|
||||
|
||||
// Check server vitality
|
||||
if (!self::checkSelfHostMeta()) {
|
||||
$well_known = DI::baseUrl()->get() . Probe::HOST_META;
|
||||
|
@ -154,7 +159,7 @@ class Summary extends BaseAdmin
|
|||
}
|
||||
|
||||
// check legacy basepath settings
|
||||
$configLoader = (new Config())->createConfigFileLoader($a->getBasePath(), $_SERVER);
|
||||
$configLoader = (new Config())->createConfigFileManager($a->getBasePath(), $_SERVER);
|
||||
$configCache = new Cache();
|
||||
$configLoader->setupCache($configCache);
|
||||
$confBasepath = $configCache->get('system', 'basepath');
|
||||
|
|
|
@ -99,7 +99,7 @@ class ApiResponse extends Response
|
|||
|
||||
$data3 = [$root_element => $data2];
|
||||
|
||||
return XML::fromArray($data3, $xml, false, $namespaces);
|
||||
return XML::fromArray($data3, $dummy, false, $namespaces);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -157,7 +157,7 @@ class Friendica extends BaseModule
|
|||
|
||||
$visible_addons = Addon::getVisibleList();
|
||||
|
||||
$config->load('feature_lock');
|
||||
$config->reload();
|
||||
$locked_features = [];
|
||||
$featureLocks = $config->get('config', 'feature_lock');
|
||||
if (isset($featureLocks)) {
|
||||
|
|
|
@ -43,8 +43,6 @@ class OpenSearch extends BaseModule
|
|||
$baseUrl = DI::baseUrl()->get();
|
||||
|
||||
/** @var DOMDocument $xml */
|
||||
$xml = null;
|
||||
|
||||
XML::fromArray([
|
||||
'OpenSearchDescription' => [
|
||||
'@attributes' => [
|
||||
|
|
|
@ -34,7 +34,6 @@ class ReallySimpleDiscovery extends BaseModule
|
|||
{
|
||||
protected function rawContent(array $request = [])
|
||||
{
|
||||
$xml = null;
|
||||
$content = XML::fromArray([
|
||||
'rsd' => [
|
||||
'@attributes' => [
|
||||
|
@ -67,7 +66,7 @@ class ReallySimpleDiscovery extends BaseModule
|
|||
],
|
||||
],
|
||||
],
|
||||
], $xml);
|
||||
]);
|
||||
System::httpExit($content, Response::TYPE_XML);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ class Display extends BaseSettings
|
|||
$first_day_of_week = !empty($request['first_day_of_week']) ? intval($request['first_day_of_week']) : 0;
|
||||
$calendar_default_view = !empty($request['calendar_default_view']) ? trim($request['calendar_default_view']) : 'month';
|
||||
$infinite_scroll = !empty($request['infinite_scroll']) ? intval($request['infinite_scroll']) : 0;
|
||||
$no_auto_update = !empty($request['no_auto_update']) ? intval($request['no_auto_update']) : 0;
|
||||
$enable_smart_threading = !empty($request['enable_smart_threading']) ? intval($request['enable_smart_threading']) : 0;
|
||||
$enable_dislike = !empty($request['enable_dislike']) ? intval($request['enable_dislike']) : 0;
|
||||
$display_resharer = !empty($request['display_resharer']) ? intval($request['display_resharer']) : 0;
|
||||
|
@ -113,7 +112,6 @@ class Display extends BaseSettings
|
|||
$this->pConfig->set($uid, 'system', 'itemspage_network' , $itemspage_network);
|
||||
$this->pConfig->set($uid, 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
|
||||
$this->pConfig->set($uid, 'system', 'update_interval' , $browser_update);
|
||||
$this->pConfig->set($uid, 'system', 'no_auto_update' , $no_auto_update);
|
||||
$this->pConfig->set($uid, 'system', 'no_smilies' , !$enable_smile);
|
||||
$this->pConfig->set($uid, 'system', 'infinite_scroll' , $infinite_scroll);
|
||||
$this->pConfig->set($uid, 'system', 'no_smart_threading' , !$enable_smart_threading);
|
||||
|
@ -202,7 +200,6 @@ class Display extends BaseSettings
|
|||
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
|
||||
}
|
||||
|
||||
$no_auto_update = $this->pConfig->get($uid, 'system', 'no_auto_update', 0);
|
||||
$enable_smile = !$this->pConfig->get($uid, 'system', 'no_smilies', 0);
|
||||
$infinite_scroll = $this->pConfig->get($uid, 'system', 'infinite_scroll', 0);
|
||||
$enable_smart_threading = !$this->pConfig->get($uid, 'system', 'no_smart_threading', 0);
|
||||
|
@ -265,7 +262,6 @@ class Display extends BaseSettings
|
|||
'$itemspage_network' => ['itemspage_network' , $this->t('Number of items to display per page:'), $itemspage_network, $this->t('Maximum of 100 items')],
|
||||
'$itemspage_mobile_network' => ['itemspage_mobile_network', $this->t('Number of items to display per page when viewed from mobile device:'), $itemspage_mobile_network, $this->t('Maximum of 100 items')],
|
||||
'$ajaxint' => ['browser_update' , $this->t('Update browser every xx seconds'), $browser_update, $this->t('Minimum of 10 seconds. Enter -1 to disable it.')],
|
||||
'$no_auto_update' => ['no_auto_update' , $this->t('Automatic updates only at the top of the post stream pages'), $no_auto_update, $this->t('Auto update may add new posts at the top of the post stream pages, which can affect the scroll position and perturb normal reading if it happens anywhere else the top of the page.')],
|
||||
'$enable_smile' => ['enable_smile' , $this->t('Display emoticons'), $enable_smile, $this->t('When enabled, emoticons are replaced with matching symbols.')],
|
||||
'$infinite_scroll' => ['infinite_scroll' , $this->t('Infinite scroll'), $infinite_scroll, $this->t('Automatic fetch new items when reaching the page end.')],
|
||||
'$enable_smart_threading' => ['enable_smart_threading' , $this->t('Enable Smart Threading'), $enable_smart_threading, $this->t('Enable the automatic suppression of extraneous thread indentation.')],
|
||||
|
|
|
@ -38,7 +38,7 @@ class Community extends CommunityModule
|
|||
$this->parseRequest();
|
||||
|
||||
$o = '';
|
||||
if (!empty($_GET['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
|
||||
if (!empty($request['force'])) {
|
||||
$o = DI::conversation()->create(self::getItems(), 'community', true, false, 'commented', DI::userSession()->getLocalUserId());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,53 +31,55 @@ class Network extends NetworkModule
|
|||
{
|
||||
protected function rawContent(array $request = [])
|
||||
{
|
||||
if (!isset($_GET['p']) || !isset($_GET['item'])) {
|
||||
if (!isset($request['p']) || !isset($request['item'])) {
|
||||
System::exit();
|
||||
}
|
||||
|
||||
$this->parseRequest($_GET);
|
||||
$this->parseRequest($request);
|
||||
|
||||
$profile_uid = intval($_GET['p']);
|
||||
$profile_uid = intval($request['p']);
|
||||
|
||||
$o = '';
|
||||
|
||||
if (!DI::pConfig()->get($profile_uid, 'system', 'no_auto_update') || ($_GET['force'] == 1)) {
|
||||
if (!empty($_GET['item'])) {
|
||||
$item = Post::selectFirst(['parent'], ['id' => $_GET['item']]);
|
||||
$parent = $item['parent'] ?? 0;
|
||||
} else {
|
||||
$parent = 0;
|
||||
}
|
||||
|
||||
$conditionFields = [];
|
||||
if (!empty($parent)) {
|
||||
// Load only a single thread
|
||||
$conditionFields['parent'] = $parent;
|
||||
} elseif (self::$order === 'received') {
|
||||
// Only load new toplevel posts
|
||||
$conditionFields['unseen'] = true;
|
||||
$conditionFields['gravity'] = Item::GRAVITY_PARENT;
|
||||
} else {
|
||||
// Load all unseen items
|
||||
$conditionFields['unseen'] = true;
|
||||
}
|
||||
|
||||
$params = ['limit' => 100];
|
||||
$table = 'network-item-view';
|
||||
|
||||
$items = self::getItems($table, $params, $conditionFields);
|
||||
|
||||
if (self::$order === 'received') {
|
||||
$ordering = '`received`';
|
||||
} elseif (self::$order === 'created') {
|
||||
$ordering = '`created`';
|
||||
} else {
|
||||
$ordering = '`commented`';
|
||||
}
|
||||
|
||||
$o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, DI::userSession()->getLocalUserId());
|
||||
if (empty($request['force'])) {
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
|
||||
if (!empty($request['item'])) {
|
||||
$item = Post::selectFirst(['parent'], ['id' => $request['item']]);
|
||||
$parent = $item['parent'] ?? 0;
|
||||
} else {
|
||||
$parent = 0;
|
||||
}
|
||||
|
||||
$conditionFields = [];
|
||||
if (!empty($parent)) {
|
||||
// Load only a single thread
|
||||
$conditionFields['parent'] = $parent;
|
||||
} elseif (self::$order === 'received') {
|
||||
// Only load new toplevel posts
|
||||
$conditionFields['unseen'] = true;
|
||||
$conditionFields['gravity'] = Item::GRAVITY_PARENT;
|
||||
} else {
|
||||
// Load all unseen items
|
||||
$conditionFields['unseen'] = true;
|
||||
}
|
||||
|
||||
$params = ['limit' => 100];
|
||||
$table = 'network-item-view';
|
||||
|
||||
$items = self::getItems($table, $params, $conditionFields);
|
||||
|
||||
if (self::$order === 'received') {
|
||||
$ordering = '`received`';
|
||||
} elseif (self::$order === 'created') {
|
||||
$ordering = '`created`';
|
||||
} else {
|
||||
$ordering = '`commented`';
|
||||
}
|
||||
|
||||
$o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, DI::userSession()->getLocalUserId());
|
||||
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class Profile extends BaseModule
|
|||
$a = DI::app();
|
||||
|
||||
// Ensure we've got a profile owner if updating.
|
||||
$a->setProfileOwner((int)($_GET['p'] ?? 0));
|
||||
$a->setProfileOwner((int)($request['p'] ?? 0));
|
||||
|
||||
if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($a->getProfileOwner())) {
|
||||
throw new ForbiddenException();
|
||||
|
@ -58,7 +58,7 @@ class Profile extends BaseModule
|
|||
|
||||
$o = '';
|
||||
|
||||
if (empty($_GET['force']) && DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
|
||||
if (empty($request['force'])) {
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
|
||||
|
@ -73,9 +73,9 @@ class Profile extends BaseModule
|
|||
AND `visible` AND (NOT `deleted` OR `gravity` = ?)
|
||||
AND `wall` " . $sql_extra, $a->getProfileOwner(), Item::GRAVITY_ACTIVITY];
|
||||
|
||||
if ($_GET['force'] && !empty($_GET['item'])) {
|
||||
if ($request['force'] && !empty($request['item'])) {
|
||||
// When the parent is provided, we only fetch this
|
||||
$condition = DBA::mergeConditions($condition, ['parent' => $_GET['item']]);
|
||||
$condition = DBA::mergeConditions($condition, ['parent' => $request['item']]);
|
||||
} elseif ($is_owner || !$last_updated) {
|
||||
// If the page user is the owner of the page we should query for unseen
|
||||
// items. Otherwise use a timestamp of the last succesful update request.
|
||||
|
|
|
@ -48,7 +48,6 @@ class HostMeta extends BaseModule
|
|||
|
||||
$domain = DI::baseUrl()->get();
|
||||
|
||||
$xml = null;
|
||||
XML::fromArray([
|
||||
'XRD' => [
|
||||
'@attributes' => [
|
||||
|
@ -81,13 +80,6 @@ class HostMeta extends BaseModule
|
|||
'href' => $domain . '/amcd'
|
||||
]
|
||||
],
|
||||
'5:link' => [
|
||||
'@attributes' => [
|
||||
'rel' => 'http://oexchange.org/spec/0.8/rel/resident-target',
|
||||
'type' => 'application/xrd+xml',
|
||||
'href' => $domain . '/oexchange/xrd'
|
||||
]
|
||||
],
|
||||
'Property' => [
|
||||
'@attributes' => [
|
||||
'type' => 'http://salmon-protocol.org/ns/magic-key',
|
||||
|
|
|
@ -230,9 +230,7 @@ class Xrd extends BaseModule
|
|||
{
|
||||
$baseURL = $this->baseUrl->get();
|
||||
|
||||
$xml = null;
|
||||
|
||||
XML::fromArray([
|
||||
$xmlString = XML::fromArray([
|
||||
'XRD' => [
|
||||
'@attributes' => [
|
||||
'xmlns' => 'http://docs.oasis-open.org/ns/xri/xrd-1.0',
|
||||
|
@ -319,10 +317,10 @@ class Xrd extends BaseModule
|
|||
]
|
||||
],
|
||||
],
|
||||
], $xml);
|
||||
]);
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/xrd+xml');
|
||||
System::httpExit($xmlString, Response::TYPE_XML, 'application/xrd+xml');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue