Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge
This commit is contained in:
commit
043f7bf2ab
@ -1,6 +1,10 @@
|
|||||||
# Select image from https://hub.docker.com/_/php/
|
# Select image from https://hub.docker.com/_/php/
|
||||||
image: php:7.1
|
image: php:7.1
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
# Select what we should cache
|
# Select what we should cache
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -11,13 +15,11 @@ variables:
|
|||||||
MYSQL_DATABASE: hello_world_test
|
MYSQL_DATABASE: hello_world_test
|
||||||
MYSQL_ROOT_PASSWORD: mysql
|
MYSQL_ROOT_PASSWORD: mysql
|
||||||
|
|
||||||
|
|
||||||
services:
|
|
||||||
- mysql:5.7
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
# prevent error installing buggy postgresql-client package
|
||||||
|
- mkdir -p /usr/share/man/man1 /usr/share/man/man7
|
||||||
- apt-get update -yqq
|
- apt-get update -yqq
|
||||||
- apt-get install -yqq git mysql-server mysql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
|
- apt-get install -yqq --no-install-recommends git mysql-client postgresql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libaspell-dev libpcre3-dev libtidy-dev
|
||||||
# Install PHP extensions
|
# Install PHP extensions
|
||||||
- docker-php-ext-install mbstring mcrypt pdo_mysql pdo_pgsql curl json intl gd xml zip bz2 opcache
|
- docker-php-ext-install mbstring mcrypt pdo_mysql pdo_pgsql curl json intl gd xml zip bz2 opcache
|
||||||
# Install & enable Xdebug for code coverage reports
|
# Install & enable Xdebug for code coverage reports
|
||||||
@ -25,12 +27,69 @@ before_script:
|
|||||||
- docker-php-ext-enable xdebug
|
- docker-php-ext-enable xdebug
|
||||||
# Install and run Composer
|
# Install and run Composer
|
||||||
- curl -sS https://getcomposer.org/installer | php
|
- curl -sS https://getcomposer.org/installer | php
|
||||||
- php composer.phar install
|
# Install dev libraries from composer
|
||||||
|
- php composer.phar install --no-progress
|
||||||
|
# Configure PHP values, needed for phpunit code coverage HTML generation
|
||||||
|
- echo "memory_limit = 256M" > /usr/local/etc/php/conf.d/hubzilla.ini
|
||||||
|
|
||||||
# We test PHP7 with MySQL, but we allow it to fail
|
|
||||||
|
# We test PHP7 with MySQL
|
||||||
test:php:mysql:
|
test:php:mysql:
|
||||||
|
stage: test
|
||||||
|
services:
|
||||||
|
- mysql:5.7
|
||||||
script:
|
script:
|
||||||
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
||||||
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
||||||
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
|
||||||
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
|
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
|
||||||
|
|
||||||
|
# test PHP7 with PostgreSQL
|
||||||
|
test:php:postgres:
|
||||||
|
stage: test
|
||||||
|
services:
|
||||||
|
- postgres:latest
|
||||||
|
variables:
|
||||||
|
POSTGRES_DB: ci-db
|
||||||
|
POSTGRES_USER: ci-user
|
||||||
|
POSTGRES_PASSWORD: ci-pass
|
||||||
|
script:
|
||||||
|
- export PGPASSWORD=$POSTGRES_PASSWORD
|
||||||
|
- psql --version
|
||||||
|
- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();"
|
||||||
|
# Import hubzilla's DB schema
|
||||||
|
- psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql
|
||||||
|
# Show databases and relations/tables of hubzilla's database
|
||||||
|
#- psql -h "postgres" -U "$POSTGRES_USER" -l
|
||||||
|
#- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\dt;"
|
||||||
|
# Run the actual tests
|
||||||
|
- vendor/bin/phpunit --configuration tests/phpunit-pgsql.xml --testdox
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
# Gitlab should show the results, but has problems parsing PHPUnit's junit file.
|
||||||
|
reports:
|
||||||
|
junit: tests/results/junit.xml
|
||||||
|
# Archive test results (coverage, testdox, junit)
|
||||||
|
name: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
|
||||||
|
paths:
|
||||||
|
- tests/results/
|
||||||
|
|
||||||
|
|
||||||
|
# Generate Doxygen API Documentation and deploy it at GitLab pages
|
||||||
|
pages:
|
||||||
|
stage: deploy
|
||||||
|
cache: {}
|
||||||
|
image: php:7-cli-alpine
|
||||||
|
before_script:
|
||||||
|
- apk update
|
||||||
|
- apk add doxygen ttf-freefont graphviz
|
||||||
|
script:
|
||||||
|
- doxygen util/Doxyfile
|
||||||
|
- mv doc/html/ public/
|
||||||
|
- echo "API documentation should be accessible at https://hubzilla.frama.io/core/ soon"
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
only:
|
||||||
|
# Only generate it on main repo's master branch
|
||||||
|
- master@hubzilla/core
|
||||||
|
@ -87,9 +87,11 @@ class DReport {
|
|||||||
|
|
||||||
// Is the sender one of our channels?
|
// Is the sender one of our channels?
|
||||||
|
|
||||||
$c = q("select channel_id from channel where channel_hash = '%s' limit 1",
|
$c = q("select channel_id from channel where channel_hash = '%s' or channel_portable_id = '%s' limit 1",
|
||||||
|
dbesc($dr['sender']),
|
||||||
dbesc($dr['sender'])
|
dbesc($dr['sender'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! $c)
|
if(! $c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -104,6 +106,8 @@ class DReport {
|
|||||||
$rxchan = $dr['recipient'];
|
$rxchan = $dr['recipient'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// is the recipient one of our connections, or do we want to store every report?
|
// is the recipient one of our connections, or do we want to store every report?
|
||||||
|
|
||||||
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
|
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief lowlevel implementation of Zot6 protocol.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Zotlabs\Zot6\HTTPSig;
|
use Zotlabs\Zot6\HTTPSig;
|
||||||
use Zotlabs\Access\Permissions;
|
use Zotlabs\Access\Permissions;
|
||||||
use Zotlabs\Access\PermissionLimits;
|
use Zotlabs\Access\PermissionLimits;
|
||||||
@ -14,14 +9,17 @@ use Zotlabs\Daemon\Master;
|
|||||||
|
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Lowlevel implementation of Zot6 protocol.
|
||||||
|
*
|
||||||
|
*/
|
||||||
class Libzot {
|
class Libzot {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Generates a unique string for use as a zot guid.
|
* @brief Generates a unique string for use as a zot guid.
|
||||||
*
|
*
|
||||||
* Generates a unique string for use as a zot guid using our DNS-based url, the
|
* Generates a unique string for use as a zot guid using our DNS-based url,
|
||||||
* channel nickname and some entropy.
|
* the channel nickname and some entropy.
|
||||||
* The entropy ensures uniqueness against re-installs where the same URL and
|
* The entropy ensures uniqueness against re-installs where the same URL and
|
||||||
* nickname are chosen.
|
* nickname are chosen.
|
||||||
*
|
*
|
||||||
@ -32,9 +30,8 @@ class Libzot {
|
|||||||
* immediate universe.
|
* immediate universe.
|
||||||
*
|
*
|
||||||
* @param string $channel_nick a unique nickname of controlling entity
|
* @param string $channel_nick a unique nickname of controlling entity
|
||||||
* @returns string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function new_uid($channel_nick) {
|
static function new_uid($channel_nick) {
|
||||||
$rawstr = z_root() . '/' . $channel_nick . '.' . mt_rand();
|
$rawstr = z_root() . '/' . $channel_nick . '.' . mt_rand();
|
||||||
return(base64url_encode(hash('whirlpool', $rawstr, true), true));
|
return(base64url_encode(hash('whirlpool', $rawstr, true), true));
|
||||||
@ -52,8 +49,8 @@ class Libzot {
|
|||||||
*
|
*
|
||||||
* @param string $guid
|
* @param string $guid
|
||||||
* @param string $pubkey
|
* @param string $pubkey
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function make_xchan_hash($guid, $pubkey) {
|
static function make_xchan_hash($guid, $pubkey) {
|
||||||
return base64url_encode(hash('whirlpool', $guid . $pubkey, true));
|
return base64url_encode(hash('whirlpool', $guid . $pubkey, true));
|
||||||
}
|
}
|
||||||
@ -65,10 +62,8 @@ class Libzot {
|
|||||||
* should only be used by channels which are defined on this hub.
|
* should only be used by channels which are defined on this hub.
|
||||||
*
|
*
|
||||||
* @param string $hash - xchan_hash
|
* @param string $hash - xchan_hash
|
||||||
* @returns array of hubloc (hub location structures)
|
* @return array of hubloc (hub location structures)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function get_hublocs($hash) {
|
static function get_hublocs($hash) {
|
||||||
|
|
||||||
/* Only search for active hublocs - e.g. those that haven't been marked deleted */
|
/* Only search for active hublocs - e.g. those that haven't been marked deleted */
|
||||||
@ -92,16 +87,17 @@ class Libzot {
|
|||||||
* packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check'
|
* packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check'
|
||||||
* @param array $recipients
|
* @param array $recipients
|
||||||
* envelope recipients, array of portable_id's; empty for public posts
|
* envelope recipients, array of portable_id's; empty for public posts
|
||||||
* @param string msg
|
* @param string $msg
|
||||||
* optional message
|
* optional message
|
||||||
|
* @param string $encoding
|
||||||
|
* optional encoding, default 'activitystreams'
|
||||||
* @param string $remote_key
|
* @param string $remote_key
|
||||||
* optional public site key of target hub used to encrypt entire packet
|
* optional public site key of target hub used to encrypt entire packet
|
||||||
* NOTE: remote_key and encrypted packets are required for 'auth_check' packets, optional for all others
|
* NOTE: remote_key and encrypted packets are required for 'auth_check' packets, optional for all others
|
||||||
* @param string $methods
|
* @param string $methods
|
||||||
* optional comma separated list of encryption methods @ref self::best_algorithm()
|
* optional comma separated list of encryption methods @ref best_algorithm()
|
||||||
* @returns string json encoded zot packet
|
* @returns string json encoded zot packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function build_packet($channel, $type = 'activity', $recipients = null, $msg = '', $encoding = 'activitystreams', $remote_key = null, $methods = '') {
|
static function build_packet($channel, $type = 'activity', $recipients = null, $msg = '', $encoding = 'activitystreams', $remote_key = null, $methods = '') {
|
||||||
|
|
||||||
$sig_method = get_config('system','signature_algorithm','sha256');
|
$sig_method = get_config('system','signature_algorithm','sha256');
|
||||||
@ -146,11 +142,10 @@ class Libzot {
|
|||||||
* @brief Choose best encryption function from those available on both sites.
|
* @brief Choose best encryption function from those available on both sites.
|
||||||
*
|
*
|
||||||
* @param string $methods
|
* @param string $methods
|
||||||
* comma separated list of encryption methods
|
* Comma separated list of encryption methods
|
||||||
* @return string first match from our site method preferences crypto_methods() array
|
* @return string first match from our site method preferences crypto_methods() array
|
||||||
* of a method which is common to both sites; or 'aes256cbc' if no matches are found.
|
* of a method which is common to both sites; or 'aes256cbc' if no matches are found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function best_algorithm($methods) {
|
static function best_algorithm($methods) {
|
||||||
|
|
||||||
$x = [
|
$x = [
|
||||||
@ -164,7 +159,6 @@ class Libzot {
|
|||||||
* * \e string \b methods - comma separated list of encryption methods
|
* * \e string \b methods - comma separated list of encryption methods
|
||||||
* * \e string \b result - the algorithm to return
|
* * \e string \b result - the algorithm to return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
call_hooks('zot_best_algorithm', $x);
|
call_hooks('zot_best_algorithm', $x);
|
||||||
|
|
||||||
if($x['result'])
|
if($x['result'])
|
||||||
@ -190,7 +184,7 @@ class Libzot {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief send a zot message
|
* @brief Send a zot message.
|
||||||
*
|
*
|
||||||
* @see z_post_url()
|
* @see z_post_url()
|
||||||
*
|
*
|
||||||
@ -200,7 +194,6 @@ class Libzot {
|
|||||||
* @param array $crypto (required if encrypted httpsig, requires hubloc_sitekey and site_crypto elements)
|
* @param array $crypto (required if encrypted httpsig, requires hubloc_sitekey and site_crypto elements)
|
||||||
* @return array see z_post_url() for returned data format
|
* @return array see z_post_url() for returned data format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function zot($url, $data, $channel = null,$crypto = null) {
|
static function zot($url, $data, $channel = null,$crypto = null) {
|
||||||
|
|
||||||
if($channel) {
|
if($channel) {
|
||||||
@ -227,7 +220,6 @@ class Libzot {
|
|||||||
/**
|
/**
|
||||||
* @brief Refreshes after permission changed or friending, etc.
|
* @brief Refreshes after permission changed or friending, etc.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* refresh is typically invoked when somebody has changed permissions of a channel and they are notified
|
* refresh is typically invoked when somebody has changed permissions of a channel and they are notified
|
||||||
* to fetch new permissions via a finger/discovery operation. This may result in a new connection
|
* to fetch new permissions via a finger/discovery operation. This may result in a new connection
|
||||||
* (abook entry) being added to a local channel and it may result in auto-permissions being granted.
|
* (abook entry) being added to a local channel and it may result in auto-permissions being granted.
|
||||||
@ -251,7 +243,6 @@ class Libzot {
|
|||||||
* * \b true if successful
|
* * \b true if successful
|
||||||
* * otherwise \b false
|
* * otherwise \b false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function refresh($them, $channel = null, $force = false) {
|
static function refresh($them, $channel = null, $force = false) {
|
||||||
|
|
||||||
logger('them: ' . print_r($them,true), LOGGER_DATA, LOG_DEBUG);
|
logger('them: ' . print_r($them,true), LOGGER_DATA, LOG_DEBUG);
|
||||||
@ -317,7 +308,7 @@ class Libzot {
|
|||||||
|
|
||||||
if(! $hsig_valid) {
|
if(! $hsig_valid) {
|
||||||
logger('http signature not valid: ' . print_r($hsig,true));
|
logger('http signature not valid: ' . print_r($hsig,true));
|
||||||
return $result;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -524,9 +515,13 @@ class Libzot {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param string $sender
|
||||||
|
* @param string $site_id
|
||||||
|
* @return null|array
|
||||||
|
*/
|
||||||
static function valid_hub($sender, $site_id) {
|
static function valid_hub($sender, $site_id) {
|
||||||
|
|
||||||
$r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_site_id = '%s' limit 1",
|
$r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_site_id = '%s' limit 1",
|
||||||
@ -548,7 +543,6 @@ class Libzot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $r[0];
|
return $r[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -559,21 +553,14 @@ class Libzot {
|
|||||||
* origination address. This will fetch the discovery packet of the sender,
|
* origination address. This will fetch the discovery packet of the sender,
|
||||||
* which contains the public key we need to verify our guid and url signatures.
|
* which contains the public key we need to verify our guid and url signatures.
|
||||||
*
|
*
|
||||||
* @param array $arr an associative array which must contain:
|
* @param string $id
|
||||||
* * \e string \b guid => guid of conversant
|
|
||||||
* * \e string \b guid_sig => guid signed with conversant's private key
|
|
||||||
* * \e string \b url => URL of the origination hub of this communication
|
|
||||||
* * \e string \b url_sig => URL signed with conversant's private key
|
|
||||||
*
|
*
|
||||||
* @return array An associative array with
|
* @return array An associative array with
|
||||||
* * \b success boolean true or false
|
* * \e boolean \b success
|
||||||
* * \b message (optional) error string only if success is false
|
* * \e string \b message (optional, unused) error string only if success is false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function register_hub($id) {
|
static function register_hub($id) {
|
||||||
|
|
||||||
$id_hash = false;
|
|
||||||
$valid = false;
|
|
||||||
$hsig_valid = false;
|
$hsig_valid = false;
|
||||||
|
|
||||||
$result = [ 'success' => false ];
|
$result = [ 'success' => false ];
|
||||||
@ -954,8 +941,8 @@ class Libzot {
|
|||||||
* @param string $hub - url of site we just contacted
|
* @param string $hub - url of site we just contacted
|
||||||
* @param array $arr - output of z_post_url()
|
* @param array $arr - output of z_post_url()
|
||||||
* @param array $outq - The queue structure attached to this request
|
* @param array $outq - The queue structure attached to this request
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function process_response($hub, $arr, $outq) {
|
static function process_response($hub, $arr, $outq) {
|
||||||
|
|
||||||
logger('remote: ' . print_r($arr,true),LOGGER_DATA);
|
logger('remote: ' . print_r($arr,true),LOGGER_DATA);
|
||||||
@ -995,6 +982,7 @@ class Libzot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) {
|
if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) {
|
||||||
|
|
||||||
foreach($x['delivery_report'] as $xx) {
|
foreach($x['delivery_report'] as $xx) {
|
||||||
call_hooks('dreport_process',$xx);
|
call_hooks('dreport_process',$xx);
|
||||||
if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) {
|
if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) {
|
||||||
@ -1082,11 +1070,6 @@ class Libzot {
|
|||||||
*
|
*
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
* 'pickup' structure returned from remote site
|
* 'pickup' structure returned from remote site
|
||||||
* @param string $sender_url
|
|
||||||
* the url specified by the sender in the initial communication.
|
|
||||||
* We will verify the sender and url in each returned message structure and
|
|
||||||
* also verify that all the messages returned match the site url that we are
|
|
||||||
* currently processing.
|
|
||||||
*
|
*
|
||||||
* @returns array
|
* @returns array
|
||||||
* Suitable for logging remotely, enumerating the processing results of each message/recipient combination
|
* Suitable for logging remotely, enumerating the processing results of each message/recipient combination
|
||||||
@ -1094,7 +1077,6 @@ class Libzot {
|
|||||||
* * [1] => \e string $delivery_status
|
* * [1] => \e string $delivery_status
|
||||||
* * [2] => \e string $address
|
* * [2] => \e string $address
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function import($arr) {
|
static function import($arr) {
|
||||||
|
|
||||||
$env = $arr;
|
$env = $arr;
|
||||||
@ -1174,7 +1156,6 @@ class Libzot {
|
|||||||
|
|
||||||
$deliveries = self::public_recips($env,$AS);
|
$deliveries = self::public_recips($env,$AS);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$deliveries = array_unique($deliveries);
|
$deliveries = array_unique($deliveries);
|
||||||
@ -1217,7 +1198,7 @@ class Libzot {
|
|||||||
if($private) {
|
if($private) {
|
||||||
$arr['item_private'] = true;
|
$arr['item_private'] = true;
|
||||||
}
|
}
|
||||||
// @fixme - spoofable
|
/// @FIXME - spoofable
|
||||||
if($AS->data['hubloc']) {
|
if($AS->data['hubloc']) {
|
||||||
$arr['item_verified'] = true;
|
$arr['item_verified'] = true;
|
||||||
}
|
}
|
||||||
@ -1251,6 +1232,13 @@ class Libzot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param array $env
|
||||||
|
* @param object $act
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
static function is_top_level($env, $act) {
|
static function is_top_level($env, $act) {
|
||||||
if($env['encoding'] === 'zot' && array_key_exists('flags',$env) && in_array('thread_parent', $env['flags'])) {
|
if($env['encoding'] === 'zot' && array_key_exists('flags',$env) && in_array('thread_parent', $env['flags'])) {
|
||||||
return true;
|
return true;
|
||||||
@ -1294,9 +1282,9 @@ class Libzot {
|
|||||||
* Some of these will be rejected, but this gives us a place to start.
|
* Some of these will be rejected, but this gives us a place to start.
|
||||||
*
|
*
|
||||||
* @param array $msg
|
* @param array $msg
|
||||||
* @return NULL|array
|
* @param object $act
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function public_recips($msg, $act) {
|
static function public_recips($msg, $act) {
|
||||||
|
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
@ -1821,7 +1809,7 @@ class Libzot {
|
|||||||
$arr['owner_xchan'] = $a['signature']['signer'];
|
$arr['owner_xchan'] = $a['signature']['signer'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme - spoofable
|
/// @FIXME - spoofable
|
||||||
if($AS->data['hubloc']) {
|
if($AS->data['hubloc']) {
|
||||||
$arr['item_verified'] = true;
|
$arr['item_verified'] = true;
|
||||||
}
|
}
|
||||||
@ -1852,8 +1840,8 @@ class Libzot {
|
|||||||
* * \e int \b obj_type
|
* * \e int \b obj_type
|
||||||
* * \e int \b mid
|
* * \e int \b mid
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function remove_community_tag($sender, $arr, $uid) {
|
static function remove_community_tag($sender, $arr, $uid) {
|
||||||
|
|
||||||
if(! (activity_match($arr['verb'], ACTIVITY_TAG) && ($arr['obj_type'] == ACTIVITY_OBJ_TAGTERM)))
|
if(! (activity_match($arr['verb'], ACTIVITY_TAG) && ($arr['obj_type'] == ACTIVITY_OBJ_TAGTERM)))
|
||||||
@ -1924,8 +1912,8 @@ class Libzot {
|
|||||||
* @param array $orig
|
* @param array $orig
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @param boolean $tag_delivery
|
* @param boolean $tag_delivery
|
||||||
|
* @return void|array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function update_imported_item($sender, $item, $orig, $uid, $tag_delivery) {
|
static function update_imported_item($sender, $item, $orig, $uid, $tag_delivery) {
|
||||||
|
|
||||||
// If this is a comment being updated, remove any privacy information
|
// If this is a comment being updated, remove any privacy information
|
||||||
@ -2144,12 +2132,13 @@ class Libzot {
|
|||||||
* @brief Processes delivery of profile.
|
* @brief Processes delivery of profile.
|
||||||
*
|
*
|
||||||
* @see import_directory_profile()
|
* @see import_directory_profile()
|
||||||
|
*
|
||||||
* @param array $sender an associative array
|
* @param array $sender an associative array
|
||||||
* * \e string \b hash a xchan_hash
|
* * \e string \b hash a xchan_hash
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
* @param array $deliveries (unused)
|
* @param array $deliveries (unused)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function process_profile_delivery($sender, $arr, $deliveries) {
|
static function process_profile_delivery($sender, $arr, $deliveries) {
|
||||||
|
|
||||||
logger('process_profile_delivery', LOGGER_DEBUG);
|
logger('process_profile_delivery', LOGGER_DEBUG);
|
||||||
@ -2170,6 +2159,7 @@ class Libzot {
|
|||||||
* * \e string \b hash a xchan_hash
|
* * \e string \b hash a xchan_hash
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
* @param array $deliveries (unused) deliveries is irrelevant
|
* @param array $deliveries (unused) deliveries is irrelevant
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
static function process_location_delivery($sender, $arr, $deliveries) {
|
static function process_location_delivery($sender, $arr, $deliveries) {
|
||||||
|
|
||||||
@ -2187,7 +2177,7 @@ class Libzot {
|
|||||||
$x = Libsync::sync_locations($xchan,$arr,true);
|
$x = Libsync::sync_locations($xchan,$arr,true);
|
||||||
logger('results: ' . print_r($x,true), LOGGER_DEBUG);
|
logger('results: ' . print_r($x,true), LOGGER_DEBUG);
|
||||||
if($x['changed']) {
|
if($x['changed']) {
|
||||||
$guid = random_string() . '@' . App::get_hostname();
|
//$guid = random_string() . '@' . App::get_hostname();
|
||||||
Libzotdir::update_modtime($sender,$r[0]['xchan_guid'],$arr['locations'][0]['address'],UPDATE_FLAGS_UPDATED);
|
Libzotdir::update_modtime($sender,$r[0]['xchan_guid'],$arr['locations'][0]['address'],UPDATE_FLAGS_UPDATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2211,8 +2201,8 @@ class Libzot {
|
|||||||
*
|
*
|
||||||
* @param string $sender_hash A channel hash
|
* @param string $sender_hash A channel hash
|
||||||
* @param array $locations
|
* @param array $locations
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function check_location_move($sender_hash, $locations) {
|
static function check_location_move($sender_hash, $locations) {
|
||||||
|
|
||||||
if(! $locations)
|
if(! $locations)
|
||||||
@ -2254,7 +2244,6 @@ class Libzot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns an array with all known distinct hubs for this channel.
|
* @brief Returns an array with all known distinct hubs for this channel.
|
||||||
*
|
*
|
||||||
@ -2263,7 +2252,6 @@ class Libzot {
|
|||||||
* * \e string \b channel_hash the hash of the channel
|
* * \e string \b channel_hash the hash of the channel
|
||||||
* @return array an array with associative arrays
|
* @return array an array with associative arrays
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function encode_locations($channel) {
|
static function encode_locations($channel) {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
@ -2317,10 +2305,8 @@ class Libzot {
|
|||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
* @param string $pubkey
|
|
||||||
* @return boolean true if updated or inserted
|
* @return boolean true if updated or inserted
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function import_site($arr) {
|
static function import_site($arr) {
|
||||||
|
|
||||||
if( (! is_array($arr)) || (! $arr['url']) || (! $arr['site_sig']))
|
if( (! is_array($arr)) || (! $arr['url']) || (! $arr['site_sig']))
|
||||||
@ -2835,14 +2821,20 @@ class Libzot {
|
|||||||
$ret['locations'] = $x;
|
$ret['locations'] = $x;
|
||||||
|
|
||||||
$ret['site'] = self::site_info();
|
$ret['site'] = self::site_info();
|
||||||
|
/**
|
||||||
|
* @hooks zotinfo
|
||||||
|
* Hook to manipulate the zotinfo array before it is returned.
|
||||||
|
*/
|
||||||
call_hooks('zotinfo', $ret);
|
call_hooks('zotinfo', $ret);
|
||||||
|
|
||||||
return($ret);
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get siteinfo.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
static function site_info() {
|
static function site_info() {
|
||||||
|
|
||||||
$signing_key = get_config('system','prvkey');
|
$signing_key = get_config('system','prvkey');
|
||||||
@ -2926,18 +2918,16 @@ class Libzot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $ret['site'];
|
return $ret['site'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param array $hub
|
* @param array $hub
|
||||||
* @param string $sitekey (optional, default empty)
|
* @param string $site_id (optional, default empty)
|
||||||
*
|
*
|
||||||
* @return string hubloc_url
|
* @return string hubloc_url
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function update_hub_connected($hub, $site_id = '') {
|
static function update_hub_connected($hub, $site_id = '') {
|
||||||
|
|
||||||
if ($site_id) {
|
if ($site_id) {
|
||||||
@ -2996,12 +2986,21 @@ class Libzot {
|
|||||||
return $hub['hubloc_url'];
|
return $hub['hubloc_url'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param string $data
|
||||||
|
* @param string $key
|
||||||
|
* @param string $alg (optional) default 'sha256'
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
static function sign($data,$key,$alg = 'sha256') {
|
static function sign($data,$key,$alg = 'sha256') {
|
||||||
if(! $key)
|
if(! $key)
|
||||||
return 'no key';
|
return 'no key';
|
||||||
|
|
||||||
$sig = '';
|
$sig = '';
|
||||||
openssl_sign($data,$sig,$key,$alg);
|
openssl_sign($data,$sig,$key,$alg);
|
||||||
|
|
||||||
return $alg . '.' . base64url_encode($sig);
|
return $alg . '.' . base64url_encode($sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3027,11 +3026,14 @@ class Libzot {
|
|||||||
return(($verify > 0) ? true : false);
|
return(($verify > 0) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
static function is_zot_request() {
|
static function is_zot_request() {
|
||||||
|
|
||||||
$x = getBestSupportedMimeType([ 'application/x-zot+json' ]);
|
$x = getBestSupportedMimeType([ 'application/x-zot+json' ]);
|
||||||
|
|
||||||
return(($x) ? true : false);
|
return(($x) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,8 @@ class PConfig {
|
|||||||
* The configuration key to set
|
* The configuration key to set
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* The value to store
|
* The value to store
|
||||||
|
* @param string $updated (optional)
|
||||||
|
* The datetime to store
|
||||||
* @return mixed Stored $value or false
|
* @return mixed Stored $value or false
|
||||||
*/
|
*/
|
||||||
static public function Set($uid, $family, $key, $value, $updated = NULL) {
|
static public function Set($uid, $family, $key, $value, $updated = NULL) {
|
||||||
@ -239,7 +241,9 @@ class PConfig {
|
|||||||
* The category of the configuration value
|
* The category of the configuration value
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* The configuration key to delete
|
* The configuration key to delete
|
||||||
* @return mixed
|
* @param string $updated (optional)
|
||||||
|
* The datetime to store
|
||||||
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
static public function Delete($uid, $family, $key, $updated = NULL) {
|
static public function Delete($uid, $family, $key, $updated = NULL) {
|
||||||
|
|
||||||
@ -271,22 +275,13 @@ class PConfig {
|
|||||||
dbesc($key)
|
dbesc($key)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Synchronize delete with clones.
|
||||||
|
|
||||||
if ($family != 'hz_delpconfig') {
|
if ($family != 'hz_delpconfig') {
|
||||||
$hash = hash('sha256',$family.':'.$key);
|
$hash = hash('sha256',$family.':'.$key);
|
||||||
set_pconfig($uid,'hz_delpconfig',$hash,$updated);
|
set_pconfig($uid,'hz_delpconfig',$hash,$updated);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Synchronize delete with clones.
|
|
||||||
|
|
||||||
if(! array_key_exists('transient', \App::$config[$uid]))
|
|
||||||
\App::$config[$uid]['transient'] = array();
|
|
||||||
if(! array_key_exists($family, \App::$config[$uid]['transient']))
|
|
||||||
\App::$config[$uid]['transient'][$family] = array();
|
|
||||||
|
|
||||||
if ($new) {
|
|
||||||
\App::$config[$uid]['transient'][$family]['pcfgdel:'.$key] = $updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,13 @@ require_once('include/channel.php');
|
|||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Provides the Cards module.
|
||||||
|
*
|
||||||
|
*/
|
||||||
class Cards extends Controller {
|
class Cards extends Controller {
|
||||||
|
|
||||||
function init() {
|
public function init() {
|
||||||
|
|
||||||
if(argc() > 1)
|
if(argc() > 1)
|
||||||
$which = argv(1);
|
$which = argv(1);
|
||||||
@ -20,14 +24,15 @@ class Cards extends Controller {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
profile_load($which);
|
profile_load($which);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* @see \Zotlabs\Web\Controller::get()
|
* @see \\Zotlabs\\Web\\Controller::get()
|
||||||
|
*
|
||||||
|
* @return string Parsed HTML from template 'cards.tpl'
|
||||||
*/
|
*/
|
||||||
function get($update = 0, $load = false) {
|
public function get($update = 0, $load = false) {
|
||||||
|
|
||||||
if(observer_prohibited(true)) {
|
if(observer_prohibited(true)) {
|
||||||
return login();
|
return login();
|
||||||
@ -99,7 +104,6 @@ class Cards extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(perm_is_allowed($owner, $ob_hash, 'write_pages')) {
|
if(perm_is_allowed($owner, $ob_hash, 'write_pages')) {
|
||||||
|
|
||||||
$x = [
|
$x = [
|
||||||
|
@ -106,7 +106,7 @@ class Chanview extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if (\App::$poi) {
|
if (\App::$poi) {
|
||||||
$url = \App::$poi['xchan_url'];
|
$url = \App::$poi['xchan_url'];
|
||||||
if(\App::$poi['xchan_network'] === 'zot') {
|
if(in_array(\App::$poi['xchan_network'], ['zot', 'zot6'])) {
|
||||||
$is_zot = true;
|
$is_zot = true;
|
||||||
}
|
}
|
||||||
if(local_channel()) {
|
if(local_channel()) {
|
||||||
|
@ -80,8 +80,9 @@ class Dreport extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("select * from dreport where dreport_xchan = '%s' and dreport_mid = '%s'",
|
$r = q("select * from dreport where (dreport_xchan = '%s' or dreport_xchan = '%s') and dreport_mid = '%s'",
|
||||||
dbesc($channel['channel_hash']),
|
dbesc($channel['channel_hash']),
|
||||||
|
dbesc($channel['channel_portable_id']),
|
||||||
dbesc($mid)
|
dbesc($mid)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
namespace Zotlabs\Module;
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Embedphoto endpoint.
|
||||||
*
|
*
|
||||||
|
* Provide an AJAX endpoint to fill the embedPhotoModal with folders and photos
|
||||||
|
* selection.
|
||||||
*/
|
*/
|
||||||
class Embedphotos extends \Zotlabs\Web\Controller {
|
class Embedphotos extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
@ -13,11 +15,11 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @brief This is the POST destination for the embedphotos button.
|
||||||
*
|
*
|
||||||
* This is the POST destination for the embedphotos button
|
* @return string A JSON string.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function post() {
|
public function post() {
|
||||||
if (argc() > 1 && argv(1) === 'album') {
|
if (argc() > 1 && argv(1) === 'album') {
|
||||||
// API: /embedphotos/album
|
// API: /embedphotos/album
|
||||||
$name = (x($_POST, 'name') ? $_POST['name'] : null );
|
$name = (x($_POST, 'name') ? $_POST['name'] : null );
|
||||||
@ -29,7 +31,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
if (argc() > 1 && argv(1) === 'albumlist') {
|
if (argc() > 1 && argv(1) === 'albumlist') {
|
||||||
// API: /embedphotos/albumlist
|
// API: /embedphotos/albumlist
|
||||||
$album_list = $this->embedphotos_album_list($a);
|
$album_list = $this->embedphotos_album_list();
|
||||||
json_return_and_die(array('status' => true, 'albumlist' => $album_list));
|
json_return_and_die(array('status' => true, 'albumlist' => $album_list));
|
||||||
}
|
}
|
||||||
if (argc() > 1 && argv(1) === 'photolink') {
|
if (argc() > 1 && argv(1) === 'photolink') {
|
||||||
@ -38,7 +40,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
if (!$href) {
|
if (!$href) {
|
||||||
json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false));
|
json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false));
|
||||||
}
|
}
|
||||||
$resource_id = array_pop(explode("/", $href));
|
$resource_id = array_pop(explode('/', $href));
|
||||||
$r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1",
|
$r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1",
|
||||||
dbesc($resource_id)
|
dbesc($resource_id)
|
||||||
);
|
);
|
||||||
@ -58,47 +60,50 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copied from include/widgets.php::widget_album() with a modification to get the profile_uid from
|
* @brief Get photos from an album.
|
||||||
* the input array as in widget_item()
|
|
||||||
*
|
*
|
||||||
* @param array $args
|
* @see \\Zotlabs\\Widget\\Album::widget()
|
||||||
* @return string with HTML
|
*
|
||||||
|
* @param array $args associative array with
|
||||||
|
* * \e array \b channel
|
||||||
|
* * \e string \b album
|
||||||
|
* @return string with HTML code from 'photo_album.tpl'
|
||||||
*/
|
*/
|
||||||
function embedphotos_widget_album($args) {
|
protected function embedphotos_widget_album($args) {
|
||||||
|
|
||||||
$channel_id = 0;
|
$channel_id = 0;
|
||||||
if(array_key_exists('channel', $args))
|
|
||||||
|
if (array_key_exists('channel', $args)) {
|
||||||
$channel = $args['channel'];
|
$channel = $args['channel'];
|
||||||
$channel_id = intval($channel['channel_id']);
|
$channel_id = intval($channel['channel_id']);
|
||||||
|
}
|
||||||
if (! $channel_id)
|
if (! $channel_id)
|
||||||
$channel_id = \App::$profile_uid;
|
$channel_id = \App::$profile_uid;
|
||||||
if (! $channel_id)
|
if (! $channel_id)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$owner_uid = $channel_id;
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
$sql_extra = permissions_sql($channel_id);
|
$sql_extra = permissions_sql($channel_id);
|
||||||
|
|
||||||
if (! perm_is_allowed($channel_id, get_observer_hash(), 'view_storage'))
|
if (! perm_is_allowed($channel_id, get_observer_hash(), 'view_storage'))
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
if($args['album'])
|
if (isset($args['album']))
|
||||||
$album = (($args['album'] === '/') ? '' : $args['album']);
|
$album = (($args['album'] === '/') ? '' : $args['album']);
|
||||||
if($args['title'])
|
if (isset($args['title']))
|
||||||
$title = $args['title'];
|
$title = $args['title'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This may return incorrect permissions if you have multiple directories of the same name.
|
* @note This may return incorrect permissions if you have multiple directories of the same name.
|
||||||
* It is a limitation of the photo table using a name for a photo album instead of a folder hash
|
* It is a limitation of the photo table using a name for a photo album instead of a folder hash
|
||||||
*/
|
*/
|
||||||
if ($album) {
|
if ($album) {
|
||||||
require_once('include/attach.php');
|
require_once('include/attach.php');
|
||||||
$x = q("select hash from attach where filename = '%s' and uid = %d limit 1",
|
$x = q("select hash from attach where filename = '%s' and uid = %d limit 1",
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval($owner_uid)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
if ($x) {
|
if ($x) {
|
||||||
$y = attach_can_view_folder($owner_uid,get_observer_hash(),$x[0]['hash']);
|
$y = attach_can_view_folder($channel_id, get_observer_hash(), $x[0]['hash']);
|
||||||
if (! $y)
|
if (! $y)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -110,13 +115,13 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
(SELECT resource_id, max(imgscale) imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 AND photo_usage IN ( %d, %d ) $sql_extra GROUP BY resource_id) ph
|
(SELECT resource_id, max(imgscale) imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 AND photo_usage IN ( %d, %d ) $sql_extra GROUP BY resource_id) ph
|
||||||
ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale)
|
ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale)
|
||||||
ORDER BY created $order",
|
ORDER BY created $order",
|
||||||
intval($owner_uid),
|
intval($channel_id),
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval(PHOTO_NORMAL),
|
intval(PHOTO_NORMAL),
|
||||||
intval(PHOTO_PROFILE)
|
intval(PHOTO_PROFILE)
|
||||||
);
|
);
|
||||||
|
|
||||||
$photos = array();
|
$photos = [];
|
||||||
if (count($r)) {
|
if (count($r)) {
|
||||||
$twist = 'rotright';
|
$twist = 'rotright';
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
@ -125,15 +130,18 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
else
|
else
|
||||||
$twist = 'rotright';
|
$twist = 'rotright';
|
||||||
|
|
||||||
|
$ph = photo_factory('');
|
||||||
|
$phototypes = $ph->supportedTypes();
|
||||||
|
|
||||||
$ext = $phototypes[$rr['mimetype']];
|
$ext = $phototypes[$rr['mimetype']];
|
||||||
|
|
||||||
$imgalt_e = $rr['filename'];
|
$imgalt_e = $rr['filename'];
|
||||||
$desc_e = $rr['description'];
|
$desc_e = $rr['description'];
|
||||||
|
|
||||||
$imagelink = (z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id']
|
$imagelink = (z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $rr['resource_id']
|
||||||
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''));
|
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''));
|
||||||
|
|
||||||
$photos[] = array(
|
$photos[] = [
|
||||||
'id' => $rr['id'],
|
'id' => $rr['id'],
|
||||||
'twist' => ' ' . $twist . rand(2,4),
|
'twist' => ' ' . $twist . rand(2,4),
|
||||||
'link' => $imagelink,
|
'link' => $imagelink,
|
||||||
@ -143,35 +151,43 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
'desc'=> $desc_e,
|
'desc'=> $desc_e,
|
||||||
'ext' => $ext,
|
'ext' => $ext,
|
||||||
'hash'=> $rr['resource_id'],
|
'hash'=> $rr['resource_id'],
|
||||||
'unknown' => t('Unknown')
|
'unknown' => t('Unknown'),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tpl = get_markup_template('photo_album.tpl');
|
$tpl = get_markup_template('photo_album.tpl');
|
||||||
$o .= replace_macros($tpl, array(
|
$o = replace_macros($tpl, [
|
||||||
'$photos' => $photos,
|
'$photos' => $photos,
|
||||||
'$album' => (($title) ? $title : $album),
|
'$album' => (($title) ? $title : $album),
|
||||||
'$album_id' => rand(),
|
'$album_id' => rand(),
|
||||||
'$album_edit' => array(t('Edit Album'), $album_edit),
|
'$album_edit' => array(t('Edit Album'), false),
|
||||||
'$can_post' => false,
|
'$can_post' => false,
|
||||||
'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)),
|
'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)),
|
||||||
'$order' => false,
|
'$order' => false,
|
||||||
'$upload_form' => $upload_form,
|
'$upload_form' => '',
|
||||||
'$no_fullscreen_btn' => true
|
'$no_fullscreen_btn' => true,
|
||||||
));
|
]);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
function embedphotos_album_list($a) {
|
/**
|
||||||
|
* @brief Get albums observer is allowed to see.
|
||||||
|
*
|
||||||
|
* @see photos_albums_list()
|
||||||
|
*
|
||||||
|
* @return NULL|array
|
||||||
|
*/
|
||||||
|
protected function embedphotos_album_list() {
|
||||||
require_once('include/photos.php');
|
require_once('include/photos.php');
|
||||||
$p = photos_albums_list(\App::get_channel(), \App::get_observer());
|
$p = photos_albums_list(\App::get_channel(), \App::get_observer());
|
||||||
|
|
||||||
if ($p['success']) {
|
if ($p['success']) {
|
||||||
return $p['albums'];
|
return $p['albums'];
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,9 @@ class Group extends Controller {
|
|||||||
$groupname = notags(trim($_POST['groupname']));
|
$groupname = notags(trim($_POST['groupname']));
|
||||||
$public = intval($_POST['public']);
|
$public = intval($_POST['public']);
|
||||||
|
|
||||||
|
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ];
|
||||||
|
call_hooks ('privacygroup_extras_post',$hookinfo);
|
||||||
|
|
||||||
if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) {
|
if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) {
|
||||||
$r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
|
$r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
|
||||||
dbesc($groupname),
|
dbesc($groupname),
|
||||||
@ -76,8 +79,6 @@ class Group extends Controller {
|
|||||||
if($r)
|
if($r)
|
||||||
info( t('Privacy group updated.') . EOL );
|
info( t('Privacy group updated.') . EOL );
|
||||||
|
|
||||||
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ];
|
|
||||||
call_hooks ('privacygroup_extras_post',$hookinfo);
|
|
||||||
|
|
||||||
build_sync_packet(local_channel(),null,true);
|
build_sync_packet(local_channel(),null,true);
|
||||||
}
|
}
|
||||||
@ -242,6 +243,10 @@ class Group extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ];
|
||||||
|
call_hooks ('privacygroup_extras',$hookinfo);
|
||||||
|
$pgrp_extras = $hookinfo['pgrp_extras'];
|
||||||
|
|
||||||
$context = $context + array(
|
$context = $context + array(
|
||||||
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
|
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
|
||||||
'$details_label' => t('Edit'),
|
'$details_label' => t('Edit'),
|
||||||
@ -252,6 +257,7 @@ class Group extends Controller {
|
|||||||
'$form_security_token_edit' => get_form_security_token('group_edit'),
|
'$form_security_token_edit' => get_form_security_token('group_edit'),
|
||||||
'$delete' => t('Delete Group'),
|
'$delete' => t('Delete Group'),
|
||||||
'$form_security_token_drop' => get_form_security_token("group_drop"),
|
'$form_security_token_drop' => get_form_security_token("group_drop"),
|
||||||
|
'$pgrp_extras' => $pgrp_extras,
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -295,6 +301,7 @@ class Group extends Controller {
|
|||||||
|
|
||||||
$context['$groupeditor'] = $groupeditor;
|
$context['$groupeditor'] = $groupeditor;
|
||||||
$context['$desc'] = t('Click a channel to toggle membership');
|
$context['$desc'] = t('Click a channel to toggle membership');
|
||||||
|
$context['$pgrp_extras'] = $pgrp_extras;
|
||||||
|
|
||||||
if($change) {
|
if($change) {
|
||||||
$tpl = get_markup_template('groupeditor.tpl');
|
$tpl = get_markup_template('groupeditor.tpl');
|
||||||
|
@ -58,10 +58,10 @@ class Zot6Handler implements IHandler {
|
|||||||
*
|
*
|
||||||
* @param array $sender
|
* @param array $sender
|
||||||
* @param array $recipients
|
* @param array $recipients
|
||||||
|
* @param array $hub
|
||||||
*
|
*
|
||||||
* @return json_return_and_die()
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function reply_refresh($sender, $recipients, $hub) {
|
static function reply_refresh($sender, $recipients, $hub) {
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
|
|
||||||
@ -70,19 +70,18 @@ class Zot6Handler implements IHandler {
|
|||||||
// This would be a permissions update, typically for one connection
|
// This would be a permissions update, typically for one connection
|
||||||
|
|
||||||
foreach ($recipients as $recip) {
|
foreach ($recipients as $recip) {
|
||||||
|
|
||||||
$r = q("select channel.*,xchan.* from channel
|
$r = q("select channel.*,xchan.* from channel
|
||||||
left join xchan on channel_portable_id = xchan_hash
|
left join xchan on channel_portable_id = xchan_hash
|
||||||
where xchan_hash ='%s' limit 1",
|
where xchan_hash ='%s' limit 1",
|
||||||
dbesc($recip)
|
dbesc($recip)
|
||||||
);
|
);
|
||||||
|
/// @FIXME $msgtype is undefined
|
||||||
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], $r[0], (($msgtype === 'force_refresh') ? true : false));
|
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], $r[0], (($msgtype === 'force_refresh') ? true : false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// system wide refresh
|
// system wide refresh
|
||||||
|
/// @FIXME $msgtype is undefined
|
||||||
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], null, (($msgtype === 'force_refresh') ? true : false));
|
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], null, (($msgtype === 'force_refresh') ? true : false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,11 +104,10 @@ class Zot6Handler implements IHandler {
|
|||||||
* this 'message_list' at the destination and split it into individual messages which are
|
* this 'message_list' at the destination and split it into individual messages which are
|
||||||
* processed/delivered in order.
|
* processed/delivered in order.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
* @param array $hub
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function reply_message_request($data, $hub) {
|
static function reply_message_request($data, $hub) {
|
||||||
$ret = [ 'success' => false ];
|
$ret = [ 'success' => false ];
|
||||||
|
|
||||||
@ -153,11 +151,10 @@ class Zot6Handler implements IHandler {
|
|||||||
/*
|
/*
|
||||||
* fetch the requested conversation
|
* fetch the requested conversation
|
||||||
*/
|
*/
|
||||||
|
/// @FIXME $sender_hash is undefined
|
||||||
$messages = zot_feed($c[0]['channel_id'],$sender_hash, [ 'message_id' => $data['message_id'], 'encoding' => 'activitystreams' ]);
|
$messages = zot_feed($c[0]['channel_id'],$sender_hash, [ 'message_id' => $data['message_id'], 'encoding' => 'activitystreams' ]);
|
||||||
|
|
||||||
return (($messages) ? : [] );
|
return (($messages) ? : [] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function rekey_request($sender,$data,$hub) {
|
static function rekey_request($sender,$data,$hub) {
|
||||||
@ -219,10 +216,10 @@ class Zot6Handler implements IHandler {
|
|||||||
*
|
*
|
||||||
* @param array $sender
|
* @param array $sender
|
||||||
* @param array $recipients
|
* @param array $recipients
|
||||||
|
* @param array $hub
|
||||||
*
|
*
|
||||||
* return json_return_and_die()
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function reply_purge($sender, $recipients, $hub) {
|
static function reply_purge($sender, $recipients, $hub) {
|
||||||
|
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
@ -259,9 +256,4 @@ class Zot6Handler implements IHandler {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
boot.php
2
boot.php
@ -50,7 +50,7 @@ require_once('include/attach.php');
|
|||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||||
define ( 'STD_VERSION', '3.9.5' );
|
define ( 'STD_VERSION', '3.9.6' );
|
||||||
define ( 'ZOT_REVISION', '6.0a' );
|
define ( 'ZOT_REVISION', '6.0a' );
|
||||||
|
|
||||||
define ( 'DB_UPDATE_VERSION', 1230 );
|
define ( 'DB_UPDATE_VERSION', 1230 );
|
||||||
|
@ -137,7 +137,7 @@ function z_mime_content_type($filename) {
|
|||||||
* @param string $hash (optional)
|
* @param string $hash (optional)
|
||||||
* @param string $filename (optional)
|
* @param string $filename (optional)
|
||||||
* @param string $filetype (optional)
|
* @param string $filetype (optional)
|
||||||
* @return associative array with:
|
* @return array Associative array with:
|
||||||
* * \e boolean \b success
|
* * \e boolean \b success
|
||||||
* * \e int|boolean \b results amount of found results, or false
|
* * \e int|boolean \b results amount of found results, or false
|
||||||
* * \e string \b message with error messages if any
|
* * \e string \b message with error messages if any
|
||||||
@ -176,15 +176,17 @@ function attach_count_files($channel_id, $observer, $hash = '', $filename = '',
|
|||||||
/**
|
/**
|
||||||
* @brief Returns a list of files/attachments.
|
* @brief Returns a list of files/attachments.
|
||||||
*
|
*
|
||||||
* @param $channel_id
|
* @param int $channel_id
|
||||||
* @param $observer
|
* @param string $observer
|
||||||
* @param $hash (optional)
|
* @param string $hash (optional)
|
||||||
* @param $filename (optional)
|
* @param string $filename (optional)
|
||||||
* @param $filetype (optional)
|
* @param string $filetype (optional)
|
||||||
* @param $orderby
|
* @param string $orderby (optional)
|
||||||
* @param $start
|
* @param int $start (optional)
|
||||||
* @param $entries
|
* @param int $entries (optional)
|
||||||
* @return associative array with:
|
* @param string $since (optional)
|
||||||
|
* @param string $until (optional)
|
||||||
|
* @return array an associative array with:
|
||||||
* * \e boolean \b success
|
* * \e boolean \b success
|
||||||
* * \e array|boolean \b results array with results, or false
|
* * \e array|boolean \b results array with results, or false
|
||||||
* * \e string \b message with error messages if any
|
* * \e string \b message with error messages if any
|
||||||
@ -1429,7 +1431,16 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
|
|||||||
if(! $r) {
|
if(! $r) {
|
||||||
attach_drop_photo($channel_id,$resource);
|
attach_drop_photo($channel_id,$resource);
|
||||||
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo];
|
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo];
|
||||||
call_hooks("attach_delete",$arr);
|
|
||||||
|
/**
|
||||||
|
* @hooks attach_delete
|
||||||
|
* Called when deleting an attachment from channel.
|
||||||
|
* * \e int \b channel_id - the channel_id
|
||||||
|
* * \e string \b resource
|
||||||
|
* * \e int \b is_photo
|
||||||
|
*/
|
||||||
|
call_hooks('attach_delete', $arr);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1489,7 +1500,14 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo];
|
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo];
|
||||||
call_hooks("attach_delete",$arr);
|
/**
|
||||||
|
* @hooks attach_delete
|
||||||
|
* Called when deleting an attachment from channel.
|
||||||
|
* * \e int \b channel_id - the channel_id
|
||||||
|
* * \e string \b resource
|
||||||
|
* * \e int \b is_photo
|
||||||
|
*/
|
||||||
|
call_hooks('attach_delete', $arr);
|
||||||
|
|
||||||
file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true);
|
file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true);
|
||||||
|
|
||||||
@ -1868,7 +1886,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
|
|||||||
* @param int $channel_id
|
* @param int $channel_id
|
||||||
* @param string $hash
|
* @param string $hash
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @return array An associative array for the specified file.
|
* @return array Associative array for the specified file.
|
||||||
*/
|
*/
|
||||||
function get_file_activity_object($channel_id, $hash, $url) {
|
function get_file_activity_object($channel_id, $hash, $url) {
|
||||||
|
|
||||||
|
@ -261,13 +261,13 @@ function construct_activity_target($item) {
|
|||||||
* @param SimplePie $item
|
* @param SimplePie $item
|
||||||
* @return array $author
|
* @return array $author
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function get_atom_author($feed, $item) {
|
function get_atom_author($feed, $item) {
|
||||||
|
|
||||||
$author = [];
|
$author = [];
|
||||||
|
|
||||||
$found_author = $item->get_author();
|
$found_author = $item->get_author();
|
||||||
if($found_author) {
|
if($found_author) {
|
||||||
|
/// @FIXME $rawauthor is undefined here
|
||||||
if($rawauthor) {
|
if($rawauthor) {
|
||||||
if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data'])
|
if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data'])
|
||||||
$author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']);
|
$author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']);
|
||||||
@ -398,10 +398,10 @@ function get_atom_author($feed, $item) {
|
|||||||
'author' => $author
|
'author' => $author
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* @hooks parse_atom
|
* @hooks parse_atom_author
|
||||||
* * \e SimplePie \b feed - The original SimplePie feed
|
* * \e SimplePie \b feed - The original SimplePie feed
|
||||||
* * \e SimplePie \b item
|
* * \e SimplePie \b item
|
||||||
* * \e array \b result - the result array that will also get returned
|
* * \e array \b author - the result array that will also get returned
|
||||||
*/
|
*/
|
||||||
call_hooks('parse_atom_author', $arr);
|
call_hooks('parse_atom_author', $arr);
|
||||||
|
|
||||||
@ -416,10 +416,8 @@ function get_atom_author($feed, $item) {
|
|||||||
*
|
*
|
||||||
* @param SimplePie $feed
|
* @param SimplePie $feed
|
||||||
* @param SimplePie $item
|
* @param SimplePie $item
|
||||||
* @param[out] array $author
|
|
||||||
* @return array Associative array with the parsed item data
|
* @return array Associative array with the parsed item data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function get_atom_elements($feed, $item) {
|
function get_atom_elements($feed, $item) {
|
||||||
|
|
||||||
require_once('include/html2bbcode.php');
|
require_once('include/html2bbcode.php');
|
||||||
|
@ -7,7 +7,8 @@ use \Michelf\MarkdownExtra;
|
|||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return string|unknown
|
* @param string $suffix (optional) default null
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_help_fullpath($path, $suffix = null) {
|
function get_help_fullpath($path, $suffix = null) {
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ function get_help_fullpath($path,$suffix=null) {
|
|||||||
// Determine the language and modify the path accordingly
|
// Determine the language and modify the path accordingly
|
||||||
$x = determine_help_language();
|
$x = determine_help_language();
|
||||||
$lang = $x['language'];
|
$lang = $x['language'];
|
||||||
$url_idx = ($x['from_url'] ? 1 : 0);
|
|
||||||
// The English translation is at the root of /doc/. Other languages are in
|
// The English translation is at the root of /doc/. Other languages are in
|
||||||
// subfolders named by the language code such as "de", "es", etc.
|
// subfolders named by the language code such as "de", "es", etc.
|
||||||
if($lang !== 'en') {
|
if($lang !== 'en') {
|
||||||
@ -49,11 +50,10 @@ function get_help_fullpath($path,$suffix=null) {
|
|||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param string $tocpath
|
* @param string $tocpath (optional) default false
|
||||||
* @return string|unknown
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_help_content($tocpath = false) {
|
function get_help_content($tocpath = false) {
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$doctype = 'markdown';
|
$doctype = 'markdown';
|
||||||
|
|
||||||
@ -172,16 +172,20 @@ function preg_callback_help_include($matches) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Determines help language.
|
||||||
*
|
*
|
||||||
* @return boolean|array
|
* If the language was specified in the URL, override the language preference
|
||||||
|
* of the browser. Default to English if both of these are absent.
|
||||||
|
*
|
||||||
|
* @return array Associative array with:
|
||||||
|
* * \e string \b language - 2-letter ISO 639-1 code ("en")
|
||||||
|
* * \e boolean \b from_url - true if language from URL overrides browser default
|
||||||
*/
|
*/
|
||||||
function determine_help_language() {
|
function determine_help_language() {
|
||||||
$lang_detect = new Text_LanguageDetect();
|
$lang_detect = new Text_LanguageDetect();
|
||||||
// Set this mode to recognize language by the short code like "en", "ru", etc.
|
// Set this mode to recognize language by the short code like "en", "ru", etc.
|
||||||
$lang_detect->setNameMode(2);
|
$lang_detect->setNameMode(2);
|
||||||
// If the language was specified in the URL, override the language preference
|
|
||||||
// of the browser. Default to English if both of these are absent.
|
|
||||||
if($lang_detect->languageExists(argv(1))) {
|
if($lang_detect->languageExists(argv(1))) {
|
||||||
$lang = argv(1);
|
$lang = argv(1);
|
||||||
$from_url = true;
|
$from_url = true;
|
||||||
@ -212,14 +216,13 @@ function find_doc_file($s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Search in doc files.
|
||||||
*
|
*
|
||||||
* @param string $s
|
* @param string $s The search string to search for
|
||||||
* @return number|mixed|unknown|boolean
|
* @return array
|
||||||
*/
|
*/
|
||||||
function search_doc_files($s) {
|
function search_doc_files($s) {
|
||||||
|
|
||||||
|
|
||||||
\App::set_pager_itemspage(60);
|
\App::set_pager_itemspage(60);
|
||||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||||
|
|
||||||
@ -277,7 +280,6 @@ function doc_rank_sort($s1, $s2) {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function load_context_help() {
|
function load_context_help() {
|
||||||
|
|
||||||
$path = App::$cmd;
|
$path = App::$cmd;
|
||||||
@ -307,7 +309,7 @@ function load_context_help() {
|
|||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param string $s
|
* @param string $s
|
||||||
* @return void|boolean[]|number[]|string[]|unknown[]
|
* @return void|array
|
||||||
*/
|
*/
|
||||||
function store_doc_file($s) {
|
function store_doc_file($s) {
|
||||||
|
|
||||||
@ -351,7 +353,7 @@ function store_doc_file($s) {
|
|||||||
$x = item_store_update($item);
|
$x = item_store_update($item);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item['uuid'] = $item_message_id();
|
$item['uuid'] = item_message_id();
|
||||||
$item['mid'] = $item['parent_mid'] = z_root() . '/item/' . $item['uuid'];
|
$item['mid'] = $item['parent_mid'] = z_root() . '/item/' . $item['uuid'];
|
||||||
$x = item_store($item);
|
$x = item_store($item);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ require_once('include/perm_upgrade.php');
|
|||||||
* @param array $channel
|
* @param array $channel
|
||||||
* @param int $account_id
|
* @param int $account_id
|
||||||
* @param int $seize
|
* @param int $seize
|
||||||
|
* @param string $newname (optional)
|
||||||
* @return boolean|array
|
* @return boolean|array
|
||||||
*/
|
*/
|
||||||
function import_channel($channel, $account_id, $seize, $newname = '') {
|
function import_channel($channel, $account_id, $seize, $newname = '') {
|
||||||
@ -672,7 +673,7 @@ function import_items($channel, $items, $sync = false, $relocate = null) {
|
|||||||
/**
|
/**
|
||||||
* @brief Sync items to channel.
|
* @brief Sync items to channel.
|
||||||
*
|
*
|
||||||
* @see import_items
|
* @see import_items()
|
||||||
*
|
*
|
||||||
* @param array $channel where to import to
|
* @param array $channel where to import to
|
||||||
* @param array $items
|
* @param array $items
|
||||||
@ -1049,7 +1050,7 @@ function import_mail($channel, $mails, $sync = false) {
|
|||||||
/**
|
/**
|
||||||
* @brief Synchronise mails.
|
* @brief Synchronise mails.
|
||||||
*
|
*
|
||||||
* @see import_mail
|
* @see import_mail()
|
||||||
* @param array $channel
|
* @param array $channel
|
||||||
* @param array $mails
|
* @param array $mails
|
||||||
*/
|
*/
|
||||||
|
@ -3004,7 +3004,9 @@ function tgroup_check($uid, $item) {
|
|||||||
* @param array $channel
|
* @param array $channel
|
||||||
* @param array $item
|
* @param array $item
|
||||||
* @param int $item_id
|
* @param int $item_id
|
||||||
* @param boolean $parent
|
* @param array $parent
|
||||||
|
* @param boolean $edit (optional) default false
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false) {
|
function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false) {
|
||||||
|
|
||||||
|
@ -7,11 +7,13 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Handle errors in plugin calls
|
* @brief Handle errors in plugin calls.
|
||||||
*
|
*
|
||||||
* @param string $plugin name of the addon
|
* @param string $plugin name of the addon
|
||||||
* @param string $error_text text of error
|
* @param string $notice UI visible text of error
|
||||||
* @param bool $uninstall uninstall plugin
|
* @param string $log technical error message for logging
|
||||||
|
* @param bool $uninstall (optional) default false
|
||||||
|
* uninstall plugin on error
|
||||||
*/
|
*/
|
||||||
function handleerrors_plugin($plugin, $notice, $log, $uninstall = false){
|
function handleerrors_plugin($plugin, $notice, $log, $uninstall = false){
|
||||||
logger("Addons: [" . $plugin . "] Error: ".$log, LOGGER_ERROR);
|
logger("Addons: [" . $plugin . "] Error: ".$log, LOGGER_ERROR);
|
||||||
@ -213,7 +215,7 @@ function reload_plugins() {
|
|||||||
try {
|
try {
|
||||||
$func();
|
$func();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
handleerrors_plugin($plugin,"","UNLOAD FAILED (uninstalling) : ".$e->getMessage(),true);
|
handleerrors_plugin($pl, '', 'UNLOAD FAILED (uninstalling) : ' . $e->getMessage(),true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,7 +224,7 @@ function reload_plugins() {
|
|||||||
try {
|
try {
|
||||||
$func();
|
$func();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
handleerrors_plugin($plugin,"","LOAD FAILED (uninstalling): ".$e->getMessage(),true);
|
handleerrors_plugin($pl, '', 'LOAD FAILED (uninstalling): ' . $e->getMessage(),true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,8 +383,6 @@ function unregister_hook($hook, $file, $function) {
|
|||||||
* array in their theme_init() and use this to customise the app behaviour.
|
* array in their theme_init() and use this to customise the app behaviour.
|
||||||
* use insert_hook($hookname,$function_name) to do this.
|
* use insert_hook($hookname,$function_name) to do this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function load_hooks() {
|
function load_hooks() {
|
||||||
|
|
||||||
App::$hooks = [];
|
App::$hooks = [];
|
||||||
@ -1085,10 +1085,11 @@ function get_markup_template($s, $root = '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Test if a folder exists.
|
||||||
*
|
*
|
||||||
* @param string $folder
|
* @param string $folder
|
||||||
* @return boolean|string
|
* @return boolean|string
|
||||||
|
* False if folder does not exist, or canonicalized absolute pathname
|
||||||
*/
|
*/
|
||||||
function folder_exists($folder) {
|
function folder_exists($folder) {
|
||||||
// Get canonicalized absolute pathname
|
// Get canonicalized absolute pathname
|
||||||
|
137
include/text.php
137
include/text.php
@ -44,8 +44,8 @@ function replace_macros($s, $r) {
|
|||||||
try {
|
try {
|
||||||
$output = $t->replace_macros($arr['template'], $arr['params']);
|
$output = $t->replace_macros($arr['template'], $arr['params']);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
logger("Unable to render template: ".$e->getMessage());
|
logger('Unable to render template: ' . $e->getMessage());
|
||||||
$output = "<h3>ERROR: there was an error creating the output.</h3>";
|
$output = '<h3>ERROR: there was an error creating the output.</h3>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
@ -539,7 +539,14 @@ function paginate(&$a) {
|
|||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param int $i
|
||||||
|
* @param string $more
|
||||||
|
* @param string $less
|
||||||
|
* @return string Parsed HTML from template 'alt_pager.tpl'
|
||||||
|
*/
|
||||||
function alt_pager($i, $more = '', $less = '') {
|
function alt_pager($i, $more = '', $less = '') {
|
||||||
|
|
||||||
if(! $more)
|
if(! $more)
|
||||||
@ -810,7 +817,7 @@ function activity_match($haystack,$needle) {
|
|||||||
* and strip the period from any tags which end with one.
|
* and strip the period from any tags which end with one.
|
||||||
*
|
*
|
||||||
* @param string $s
|
* @param string $s
|
||||||
* @return Returns array of tags found, or empty array.
|
* @return array Returns an array of tags found, or empty array.
|
||||||
*/
|
*/
|
||||||
function get_tags($s) {
|
function get_tags($s) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@ -826,6 +833,9 @@ function get_tags($s) {
|
|||||||
// ignore anything in [color= ], because it may contain color codes which are mistaken for tags
|
// ignore anything in [color= ], because it may contain color codes which are mistaken for tags
|
||||||
$s = preg_replace('/\[color=(.*?)\]/sm','',$s);
|
$s = preg_replace('/\[color=(.*?)\]/sm','',$s);
|
||||||
|
|
||||||
|
// skip anchors in URL
|
||||||
|
$s = preg_replace('/\[url=(.*?)\]/sm','',$s);
|
||||||
|
|
||||||
// match any double quoted tags
|
// match any double quoted tags
|
||||||
|
|
||||||
if(preg_match_all('/([@#\!]\"\;.*?\"\;)/',$s,$match)) {
|
if(preg_match_all('/([@#\!]\"\;.*?\"\;)/',$s,$match)) {
|
||||||
@ -897,6 +907,7 @@ function tag_sort_length($a,$b) {
|
|||||||
function total_sort($a,$b) {
|
function total_sort($a,$b) {
|
||||||
if($a['total'] == $b['total'])
|
if($a['total'] == $b['total'])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return(($b['total'] > $a['total']) ? 1 : (-1));
|
return(($b['total'] > $a['total']) ? 1 : (-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1001,9 +1012,15 @@ function contact_block() {
|
|||||||
'$micropro' => $micropro,
|
'$micropro' => $micropro,
|
||||||
));
|
));
|
||||||
|
|
||||||
$arr = array('contacts' => $r, 'output' => $o);
|
$arr = ['contacts' => $r, 'output' => $o];
|
||||||
|
/**
|
||||||
|
* @hooks contact_block_end
|
||||||
|
* Called at the end of contact_block(), but can not manipulate the output.
|
||||||
|
* * \e array \b contacts - Result array from database
|
||||||
|
* * \e string \b output - the generated output
|
||||||
|
*/
|
||||||
call_hooks('contact_block_end', $arr);
|
call_hooks('contact_block_end', $arr);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,16 +1122,20 @@ function linkify($s, $me = false) {
|
|||||||
* to a local redirector which uses https and which redirects to the selected content
|
* to a local redirector which uses https and which redirects to the selected content
|
||||||
*
|
*
|
||||||
* @param string $s
|
* @param string $s
|
||||||
* @param int $uid
|
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
function sslify($s) {
|
function sslify($s) {
|
||||||
|
|
||||||
// Local photo cache
|
// Local photo cache
|
||||||
$str = array(
|
$str = [
|
||||||
'body' => $s,
|
'body' => $s,
|
||||||
'uid' => local_channel()
|
'uid' => local_channel()
|
||||||
);
|
];
|
||||||
|
/**
|
||||||
|
* @hooks cache_body_hook
|
||||||
|
* * \e string \b body The content to parse and also the return value
|
||||||
|
* * \e int|bool \b uid
|
||||||
|
*/
|
||||||
call_hooks('cache_body_hook', $str);
|
call_hooks('cache_body_hook', $str);
|
||||||
|
|
||||||
$s = $str['body'];
|
$s = $str['body'];
|
||||||
@ -1219,7 +1240,11 @@ function get_mood_verbs() {
|
|||||||
/**
|
/**
|
||||||
* @brief Function to list all smilies, both internal and from addons.
|
* @brief Function to list all smilies, both internal and from addons.
|
||||||
*
|
*
|
||||||
* @return Returns array with keys 'texts' and 'icons'
|
* @param boolean $default_only (optional) default false
|
||||||
|
* true will prevent that plugins can add smilies
|
||||||
|
* @return array Returns an associative array with:
|
||||||
|
* * \e array \b texts
|
||||||
|
* * \e array \b icons
|
||||||
*/
|
*/
|
||||||
function list_smilies($default_only = false) {
|
function list_smilies($default_only = false) {
|
||||||
|
|
||||||
@ -1297,6 +1322,11 @@ function list_smilies($default_only = false) {
|
|||||||
if($default_only)
|
if($default_only)
|
||||||
return $params;
|
return $params;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hooks smile
|
||||||
|
* * \e array \b texts - default values and also return value
|
||||||
|
* * \e array \b icons - default values and also return value
|
||||||
|
*/
|
||||||
call_hooks('smilie', $params);
|
call_hooks('smilie', $params);
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
@ -1622,6 +1652,10 @@ function generate_named_map($location) {
|
|||||||
|
|
||||||
function prepare_body(&$item,$attach = false,$opts = false) {
|
function prepare_body(&$item,$attach = false,$opts = false) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hooks prepare_body_init
|
||||||
|
* * \e array \b item
|
||||||
|
*/
|
||||||
call_hooks('prepare_body_init', $item);
|
call_hooks('prepare_body_init', $item);
|
||||||
|
|
||||||
$s = '';
|
$s = '';
|
||||||
@ -1653,13 +1687,19 @@ function prepare_body(&$item,$attach = false,$opts = false) {
|
|||||||
|
|
||||||
$event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false);
|
$event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false);
|
||||||
|
|
||||||
$prep_arr = array(
|
$prep_arr = [
|
||||||
'item' => $item,
|
'item' => $item,
|
||||||
'html' => $event ? $event['content'] : $s,
|
'html' => $event ? $event['content'] : $s,
|
||||||
'event' => $event['header'],
|
'event' => $event['header'],
|
||||||
'photo' => $photo
|
'photo' => $photo
|
||||||
);
|
];
|
||||||
|
/**
|
||||||
|
* @hooks prepare_body
|
||||||
|
* * \e array \b item
|
||||||
|
* * \e string \b html - the parsed HTML to return
|
||||||
|
* * \e string \b event - the event header to return
|
||||||
|
* * \e string \b photo - the photo to return
|
||||||
|
*/
|
||||||
call_hooks('prepare_body', $prep_arr);
|
call_hooks('prepare_body', $prep_arr);
|
||||||
|
|
||||||
$s = $prep_arr['html'];
|
$s = $prep_arr['html'];
|
||||||
@ -1729,17 +1769,24 @@ function prepare_binary($item) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Given a text string, convert from bbcode to html and add smilie icons.
|
* @brief Given a text string, convert from content_type to HTML.
|
||||||
|
*
|
||||||
|
* Take a text in plain text, html, markdown, bbcode, PDL or PHP and prepare
|
||||||
|
* it to return HTML.
|
||||||
|
*
|
||||||
|
* In bbcode this function will add smilie icons.
|
||||||
*
|
*
|
||||||
* @param string $text
|
* @param string $text
|
||||||
* @param string $content_type (optional) default text/bbcode
|
* @param string $content_type (optional)
|
||||||
* @param boolean $cache (optional) default false
|
* default 'text/bbcode', other values are 'text/plain', 'text/html',
|
||||||
*
|
* 'text/markdown', 'application/x-pdl', 'application/x-php'
|
||||||
|
* @param boolean|array $opts (optional)
|
||||||
|
* default false, otherwise configuration array for bbcode()
|
||||||
* @return string
|
* @return string
|
||||||
|
* The parsed $text as prepared HTML.
|
||||||
*/
|
*/
|
||||||
function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
|
function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
|
||||||
|
|
||||||
|
|
||||||
switch($content_type) {
|
switch($content_type) {
|
||||||
case 'text/plain':
|
case 'text/plain':
|
||||||
$s = escape_tags($text);
|
$s = escape_tags($text);
|
||||||
@ -1780,7 +1827,7 @@ function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
|
|||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
if(stristr($text, '[nosmile]'))
|
if(stristr($text, '[nosmile]'))
|
||||||
$s = bbcode($text, [ 'cache' => $cache ]);
|
$s = bbcode($text, ((is_array($opts)) ? $opts : [] ));
|
||||||
else
|
else
|
||||||
$s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
|
$s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
|
||||||
|
|
||||||
@ -2239,19 +2286,24 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief array_elm_to_str($arr,$elm,$delim = ',') extract unique individual elements from an array of arrays and return them as a string separated by a delimiter
|
* @brief Extract unique individual elements from an array of arrays and return
|
||||||
* similar to ids_to_querystr, but allows a different delimiter instead of a db-quote option
|
* them as a string separated by a delimiter.
|
||||||
* empty elements (evaluated after trim()) are ignored.
|
*
|
||||||
* @param $arr array
|
* Similar to ids_to_querystr, but allows a different delimiter instead of a
|
||||||
* @param $elm array key to extract from sub-array
|
* db-quote option empty elements (evaluated after trim()) are ignored.
|
||||||
* @param $delim string default ','
|
*
|
||||||
* @param $each filter function to apply to each element before evaluation, default is 'trim'.
|
* @see ids_to_querystr()
|
||||||
|
*
|
||||||
|
* @param array $arr
|
||||||
|
* @param string $elm key to extract from sub-array
|
||||||
|
* @param string $delim (optional) default ','
|
||||||
|
* @param string $each (optional) default is 'trim'
|
||||||
|
* Filter function to apply to each element before evaluation.
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function array_elm_to_str($arr, $elm, $delim = ',', $each = 'trim') {
|
function array_elm_to_str($arr, $elm, $delim = ',', $each = 'trim') {
|
||||||
|
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
|
|
||||||
if($arr && is_array($arr)) {
|
if($arr && is_array($arr)) {
|
||||||
foreach($arr as $x) {
|
foreach($arr as $x) {
|
||||||
if(is_array($x) && array_key_exists($elm,$x)) {
|
if(is_array($x) && array_key_exists($elm,$x)) {
|
||||||
@ -2262,6 +2314,7 @@ function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode($delim, $tmp);
|
return implode($delim, $tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2486,9 +2539,9 @@ function design_tools() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates website portation tools menu
|
* @brief Creates website portation tools menu.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string Parsed HTML code from template 'website_portation_tools.tpl'
|
||||||
*/
|
*/
|
||||||
function website_portation_tools() {
|
function website_portation_tools() {
|
||||||
|
|
||||||
@ -2501,7 +2554,7 @@ function website_portation_tools() {
|
|||||||
$sys = true;
|
$sys = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return replace_macros(get_markup_template('website_portation_tools.tpl'), array(
|
return replace_macros(get_markup_template('website_portation_tools.tpl'), [
|
||||||
'$title' => t('Import'),
|
'$title' => t('Import'),
|
||||||
'$import_label' => t('Import website...'),
|
'$import_label' => t('Import website...'),
|
||||||
'$import_placeholder' => t('Select folder to import'),
|
'$import_placeholder' => t('Select folder to import'),
|
||||||
@ -2518,7 +2571,7 @@ function website_portation_tools() {
|
|||||||
'$cloud_export_desc' => t('/path/to/export/folder'),
|
'$cloud_export_desc' => t('/path/to/export/folder'),
|
||||||
'$cloud_export_hint' => t('Enter a path to a cloud files destination.'),
|
'$cloud_export_hint' => t('Enter a path to a cloud files destination.'),
|
||||||
'$cloud_export_select' => t('Specify folder'),
|
'$cloud_export_select' => t('Specify folder'),
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3093,7 +3146,13 @@ function pdl_selector($uid, $current='') {
|
|||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);
|
$arr = ['channel_id' => $uid, 'current' => $current, 'entries' => $r];
|
||||||
|
/**
|
||||||
|
* @hooks pdl_selector
|
||||||
|
* * \e int \b channel_id
|
||||||
|
* * \e string \b current
|
||||||
|
* * \e array \b entries - Result from database query
|
||||||
|
*/
|
||||||
call_hooks('pdl_selector', $arr);
|
call_hooks('pdl_selector', $arr);
|
||||||
|
|
||||||
$entries = $arr['entries'];
|
$entries = $arr['entries'];
|
||||||
@ -3168,7 +3227,6 @@ function text_highlight($s, $lang) {
|
|||||||
'language' => $lang,
|
'language' => $lang,
|
||||||
'success' => false
|
'success' => false
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hooks text_highlight
|
* @hooks text_highlight
|
||||||
* * \e string \b text
|
* * \e string \b text
|
||||||
@ -3369,13 +3427,17 @@ function punify($s) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be aware that unpunify will only convert domain names and not pathnames
|
/**
|
||||||
|
* Be aware that unpunify() will only convert domain names and not pathnames.
|
||||||
|
*
|
||||||
|
* @param string $s
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function unpunify($s) {
|
function unpunify($s) {
|
||||||
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
||||||
$x = new idna_convert(['encoding' => 'utf8']);
|
$x = new idna_convert(['encoding' => 'utf8']);
|
||||||
return $x->decode($s);
|
|
||||||
|
|
||||||
|
return $x->decode($s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3519,4 +3581,3 @@ function new_uuid() {
|
|||||||
|
|
||||||
return $hash;
|
return $hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ function zot_build_packet($channel, $type = 'notify', $recipients = null, $remot
|
|||||||
* packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check'
|
* packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check'
|
||||||
* @param array $recipients
|
* @param array $recipients
|
||||||
* envelope information, array ( 'guid' => string, 'guid_sig' => string ); empty for public posts
|
* envelope information, array ( 'guid' => string, 'guid_sig' => string ); empty for public posts
|
||||||
* @param string msg
|
* @param string $msg
|
||||||
* optional message
|
* optional message
|
||||||
* @param string $remote_key
|
* @param string $remote_key
|
||||||
* optional public site key of target hub used to encrypt entire packet
|
* optional public site key of target hub used to encrypt entire packet
|
||||||
@ -5057,7 +5057,7 @@ function zot_reply_auth_check($data,$encrypted_packet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// There should be exactly one recipient, the original auth requestor
|
// There should be exactly one recipient, the original auth requestor
|
||||||
|
/// @FIXME $recipients is undefined here.
|
||||||
$ret['message'] .= 'recipients ' . print_r($recipients,true) . EOL;
|
$ret['message'] .= 'recipients ' . print_r($recipients,true) . EOL;
|
||||||
|
|
||||||
if ($data['recipients']) {
|
if ($data['recipients']) {
|
||||||
|
@ -79,7 +79,7 @@ $HTTP["url"] =~ "\.(out|log|htaccess)$" {
|
|||||||
url.access-deny = ("")
|
url.access-deny = ("")
|
||||||
}
|
}
|
||||||
|
|
||||||
$HTTP["url"] =~ "(^|/)\.git|(^|/)store" {
|
$HTTP["url"] =~ "(^|/)\.git|(^|/)store|(^|/)util" {
|
||||||
url.access-deny = ("")
|
url.access-deny = ("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,5 +141,10 @@ server {
|
|||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#deny access to util
|
||||||
|
location ~ /util {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
|
||||||
bootstrap="../boot.php"
|
bootstrap="../boot.php"
|
||||||
forceCoversAnnotation="false"
|
forceCoversAnnotation="false"
|
||||||
beStrictAboutCoversAnnotation="true"
|
beStrictAboutCoversAnnotation="true"
|
||||||
beStrictAboutOutputDuringTests="true"
|
beStrictAboutOutputDuringTests="true"
|
||||||
beStrictAboutTodoAnnotatedTests="true"
|
beStrictAboutTodoAnnotatedTests="true"
|
||||||
verbose="true">
|
verbose="true">
|
||||||
|
<testsuites>
|
||||||
<testsuite name="Hubzilla default Test Suite">
|
<testsuite name="Hubzilla default Test Suite">
|
||||||
<directory suffix="Test.php">./unit/</directory>
|
<directory suffix="Test.php">./unit/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="API Test Suite">
|
<testsuite name="API Test Suite">
|
||||||
<directory suffix="Test.php" prefix="API">./unit/</directory>
|
<directory suffix="Test.php" prefix="API">./unit/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
<groups>
|
<groups>
|
||||||
<exclude>
|
<exclude>
|
||||||
<group>mysql</group>
|
<group>mysql</group>
|
||||||
</exclude>
|
</exclude>
|
||||||
</groups>
|
</groups>
|
||||||
<!--cover reporting-->
|
<!--coverage reporting-->
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||||
<directory suffix=".php">../Zotlabs/</directory>
|
<directory suffix=".php">../Zotlabs/</directory>
|
||||||
@ -26,21 +28,22 @@
|
|||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
<logging>
|
<logging>
|
||||||
<log type="junit" target="./results/junit.xml" logIncompleteSkipped="false"/>
|
<log type="junit" target="./results/junit.xml"/>
|
||||||
<log type="coverage-clover" target="./results/coverage-clover.xml"/>
|
<!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>-->
|
||||||
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
|
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
|
||||||
highLowerBound="70"/>
|
highLowerBound="70"/>
|
||||||
<log type="testdox-text" target="./results/testdox.txt"/>
|
<!--<log type="testdox-text" target="./results/testdox.txt"/>-->
|
||||||
|
<log type="testdox-html" target="./results/testdox.html"/>
|
||||||
</logging>
|
</logging>
|
||||||
<php>
|
<php>
|
||||||
<!-- Default test database config, only used if no environment variables
|
<!-- Default test database config, only used if no environment variables
|
||||||
with same names are set.
|
with same names are set.
|
||||||
!!! Never run against a real database, it will truncate all tables -->
|
!!! Never run against a real database, it will truncate all tables -->
|
||||||
<env name="hz_db_server" value="127.0.0.1"/>
|
<env name="hz_db_server" value="postgres"/>
|
||||||
<env name="hz_db_scheme" value="pgsql"/>
|
<env name="hz_db_scheme" value="pgsql"/>
|
||||||
<env name="hz_db_port" value="5432"/>
|
<env name="hz_db_port" value="5432"/>
|
||||||
<env name="hz_db_user" value="travis_hz"/>
|
<env name="hz_db_user" value="ci-user"/>
|
||||||
<env name="hz_db_pass" value="hubzilla"/>
|
<env name="hz_db_pass" value="ci-pass"/>
|
||||||
<env name="hz_db_database" value="travis_hubzilla"/>
|
<env name="hz_db_database" value="ci-db"/>
|
||||||
</php>
|
</php>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
INPUT = README.md index.php boot.php include/ install/ util/ view/ Zotlabs/
|
INPUT = README.md index.php boot.php include/ install/ util/ view/ Zotlabs/
|
||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
PROJECT_NAME = "The Hubzilla"
|
PROJECT_NAME = "The Hubzilla"
|
||||||
PROJECT_LOGO = images/rm-64.png
|
PROJECT_LOGO = images/hz-64.png
|
||||||
|
IMAGE_PATH = images/
|
||||||
EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/zotsh/easywebdav/ util/generate-hooks-index/
|
EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/zotsh/easywebdav/ util/generate-hooks-index/
|
||||||
EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test*
|
EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test*
|
||||||
OUTPUT_DIRECTORY = doc
|
OUTPUT_DIRECTORY = doc
|
||||||
@ -33,5 +34,6 @@ INTERACTIVE_SVG = YES
|
|||||||
CLASS_GRAPH = YES
|
CLASS_GRAPH = YES
|
||||||
COLLABORATION_GRAPH = NO
|
COLLABORATION_GRAPH = NO
|
||||||
# fix @var (https://bugzilla.gnome.org/show_bug.cgi?id=626105)
|
# fix @var (https://bugzilla.gnome.org/show_bug.cgi?id=626105)
|
||||||
|
# Should be obsolete with doxygen >= 1.8.15
|
||||||
#INPUT_FILTER = "sed -e 's/@var\s/@see /'"
|
#INPUT_FILTER = "sed -e 's/@var\s/@see /'"
|
||||||
INPUT_FILTER = "php util/Doxygen_phpvarfilter.php"
|
INPUT_FILTER = "php util/Doxygen_phpvarfilter.php"
|
||||||
|
@ -468,6 +468,9 @@ function notificationsUpdate(cached_data) {
|
|||||||
$.get(pingCmd,function(data) {
|
$.get(pingCmd,function(data) {
|
||||||
|
|
||||||
// Put the object into storage
|
// Put the object into storage
|
||||||
|
if(! data)
|
||||||
|
return;
|
||||||
|
|
||||||
sessionStorage.setItem('notifications_cache', JSON.stringify(data));
|
sessionStorage.setItem('notifications_cache', JSON.stringify(data));
|
||||||
|
|
||||||
var fnotifs = [];
|
var fnotifs = [];
|
||||||
@ -766,7 +769,7 @@ function updateConvItems(mode,data) {
|
|||||||
mediaPlaying = false;
|
mediaPlaying = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; }));
|
var bimgs = ((preloadImages) ? false : $(".wall-item-body img, .wall-photo-item img").not(function() { return this.complete; }));
|
||||||
var bimgcount = bimgs.length;
|
var bimgcount = bimgs.length;
|
||||||
|
|
||||||
if (bimgcount) {
|
if (bimgcount) {
|
||||||
@ -842,10 +845,10 @@ function collapseHeight() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var collapsedContentHeight = Math.ceil($("#region_2").height());
|
var collapsedContentHeight = Math.ceil($("#region_2").height());
|
||||||
contentHeightDiff = origContentHeight - collapsedContentHeight;
|
contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight;
|
||||||
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
|
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
|
||||||
|
|
||||||
if(i){
|
if(i && !liking){
|
||||||
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
|
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
|
||||||
console.log('collapsed above viewport count: ' + i);
|
console.log('collapsed above viewport count: ' + i);
|
||||||
$(window).scrollTop(sval);
|
$(window).scrollTop(sval);
|
||||||
@ -996,7 +999,7 @@ function liveUpdate(notify_id) {
|
|||||||
$("#profile-jot-text-loading").hide();
|
$("#profile-jot-text-loading").hide();
|
||||||
|
|
||||||
// adjust scroll position if new content was added above viewport
|
// adjust scroll position if new content was added above viewport
|
||||||
if(update_mode === 'update') {
|
if(update_mode === 'update' && !justifiedGalleryActive) {
|
||||||
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
|
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1518
view/ru/hmessages.po
1518
view/ru/hmessages.po
File diff suppressed because it is too large
Load Diff
@ -729,7 +729,6 @@ App::$strings["Directory Options"] = "Параметры каталога";
|
|||||||
App::$strings["Safe Mode"] = "Безопасный режим";
|
App::$strings["Safe Mode"] = "Безопасный режим";
|
||||||
App::$strings["Public Forums Only"] = "Только публичные форумы";
|
App::$strings["Public Forums Only"] = "Только публичные форумы";
|
||||||
App::$strings["This Website Only"] = "Только этот веб-сайт";
|
App::$strings["This Website Only"] = "Только этот веб-сайт";
|
||||||
App::$strings["view full size"] = "посмотреть в полный размер";
|
|
||||||
App::$strings["Friendica"] = "";
|
App::$strings["Friendica"] = "";
|
||||||
App::$strings["OStatus"] = "";
|
App::$strings["OStatus"] = "";
|
||||||
App::$strings["GNU-Social"] = "";
|
App::$strings["GNU-Social"] = "";
|
||||||
@ -1549,6 +1548,8 @@ App::$strings["Default maximum affinity level"] = "Максимальный ур
|
|||||||
App::$strings["0-99 default 99"] = "0-99 (по умолчанию 99)";
|
App::$strings["0-99 default 99"] = "0-99 (по умолчанию 99)";
|
||||||
App::$strings["Default minimum affinity level"] = "Минимальный уровень сходства по умолчанию.";
|
App::$strings["Default minimum affinity level"] = "Минимальный уровень сходства по умолчанию.";
|
||||||
App::$strings["0-99 - default 0"] = "0-99 (по умолчанию 0)";
|
App::$strings["0-99 - default 0"] = "0-99 (по умолчанию 0)";
|
||||||
|
App::$strings["Always reset on new page visit."] = "Всегда сбрасывать при посещении новой страницы.";
|
||||||
|
App::$strings["default: yes"] = "по-умолчанию: да";
|
||||||
App::$strings["Affinity Slider Settings"] = "Настройки слайдера сходства";
|
App::$strings["Affinity Slider Settings"] = "Настройки слайдера сходства";
|
||||||
App::$strings["Addon Settings"] = "Настройки расширений";
|
App::$strings["Addon Settings"] = "Настройки расширений";
|
||||||
App::$strings["Please save/submit changes to any panel before opening another."] = "Пожалуйста сохраните / отправьте изменения на панели прежде чем открывать другую.";
|
App::$strings["Please save/submit changes to any panel before opening another."] = "Пожалуйста сохраните / отправьте изменения на панели прежде чем открывать другую.";
|
||||||
@ -1788,6 +1789,7 @@ App::$strings["Unable to check command line PHP, as shell_exec() is disabled. Th
|
|||||||
App::$strings["The command line version of PHP on your system does not have \"register_argc_argv\" enabled."] = "В консольной версии PHP в вашей системе отключена опция \"register_argc_argv\".";
|
App::$strings["The command line version of PHP on your system does not have \"register_argc_argv\" enabled."] = "В консольной версии PHP в вашей системе отключена опция \"register_argc_argv\".";
|
||||||
App::$strings["This is required for message delivery to work."] = "Это необходимо для функционирования доставки сообщений.";
|
App::$strings["This is required for message delivery to work."] = "Это необходимо для функционирования доставки сообщений.";
|
||||||
App::$strings["PHP register_argc_argv"] = "";
|
App::$strings["PHP register_argc_argv"] = "";
|
||||||
|
App::$strings["This is not sufficient to upload larger images or files. You should be able to upload at least 4 MB at once."] = "Этого недостаточно для загрузки больших изображений или файлов. Вы должны иметь возможность загрузить как минимум 4 Мб за раз.";
|
||||||
App::$strings["Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once."] = "Максимально разрешённый общий размер загрузок установлен в %s. Максимальный размер одной загрузки установлен в %s. Вам разрешено загружать до %d файлов за один приём.";
|
App::$strings["Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once."] = "Максимально разрешённый общий размер загрузок установлен в %s. Максимальный размер одной загрузки установлен в %s. Вам разрешено загружать до %d файлов за один приём.";
|
||||||
App::$strings["You can adjust these settings in the server php.ini file."] = "Вы можете изменить эти настройки в файле php.ini на сервере.";
|
App::$strings["You can adjust these settings in the server php.ini file."] = "Вы можете изменить эти настройки в файле php.ini на сервере.";
|
||||||
App::$strings["PHP upload limits"] = "Максимальный размер загрузки в PHP";
|
App::$strings["PHP upload limits"] = "Максимальный размер загрузки в PHP";
|
||||||
@ -2757,8 +2759,8 @@ App::$strings["Add to app-tray"] = "Добавить в app-tray";
|
|||||||
App::$strings["Remove from app-tray"] = "Удалить из app-tray";
|
App::$strings["Remove from app-tray"] = "Удалить из app-tray";
|
||||||
App::$strings["Pin to navbar"] = "Добавить на панель навигации";
|
App::$strings["Pin to navbar"] = "Добавить на панель навигации";
|
||||||
App::$strings["Unpin from navbar"] = "Удалить с панели навигации";
|
App::$strings["Unpin from navbar"] = "Удалить с панели навигации";
|
||||||
App::$strings["I will attend"] = "Я буду присутствовать";
|
App::$strings["I will attend"] = "Я буду участвовать";
|
||||||
App::$strings["I will not attend"] = "Я не буду присутствовать";
|
App::$strings["I will not attend"] = "Я не буду участвовать";
|
||||||
App::$strings["I might attend"] = "Я возможно буду присутствовать";
|
App::$strings["I might attend"] = "Я возможно буду присутствовать";
|
||||||
App::$strings["I agree"] = "Я согласен";
|
App::$strings["I agree"] = "Я согласен";
|
||||||
App::$strings["I disagree"] = "Я не согласен";
|
App::$strings["I disagree"] = "Я не согласен";
|
||||||
@ -2806,6 +2808,12 @@ App::$strings["This is your default setting for who can view your default channe
|
|||||||
App::$strings["This is your default setting for who can view your connections"] = "Это настройка по умолчанию для тех, кто может просматривать ваши контакты";
|
App::$strings["This is your default setting for who can view your connections"] = "Это настройка по умолчанию для тех, кто может просматривать ваши контакты";
|
||||||
App::$strings["This is your default setting for who can view your file storage and photos"] = "Это настройка по умолчанию для тех, кто может просматривать ваше хранилище файлов и фотографий";
|
App::$strings["This is your default setting for who can view your file storage and photos"] = "Это настройка по умолчанию для тех, кто может просматривать ваше хранилище файлов и фотографий";
|
||||||
App::$strings["This is your default setting for the audience of your webpages"] = "Это настройка по умолчанию для аудитории ваших веб-страниц";
|
App::$strings["This is your default setting for the audience of your webpages"] = "Это настройка по умолчанию для аудитории ваших веб-страниц";
|
||||||
|
App::$strings["Likes %1\$s's %2\$s"] = "Нравится %1\$s %2\$s";
|
||||||
|
App::$strings["Doesn't like %1\$s's %2\$s"] = "Не нравится %1\$s %2\$s";
|
||||||
|
App::$strings["Will attend %1\$s's %2\$s"] = "Примет участие %1\$s %2\$s";
|
||||||
|
App::$strings["Will not attend %1\$s's %2\$s"] = "Не примет участие %1\$s %2\$s";
|
||||||
|
App::$strings["May attend %1\$s's %2\$s"] = "Возможно примет участие %1\$s %2\$s";
|
||||||
|
App::$strings["🔁 Repeated %1\$s's %2\$s"] = "🔁 Повторил %1\$s %2\$s";
|
||||||
App::$strings["0. Beginner/Basic"] = "Начинающий / Базовый";
|
App::$strings["0. Beginner/Basic"] = "Начинающий / Базовый";
|
||||||
App::$strings["1. Novice - not skilled but willing to learn"] = "1. Новичок - не опытный, но желающий учиться";
|
App::$strings["1. Novice - not skilled but willing to learn"] = "1. Новичок - не опытный, но желающий учиться";
|
||||||
App::$strings["2. Intermediate - somewhat comfortable"] = "2. Промежуточный - более удобный";
|
App::$strings["2. Intermediate - somewhat comfortable"] = "2. Промежуточный - более удобный";
|
||||||
@ -3133,7 +3141,7 @@ App::$strings["Cancel GNU social Connection"] = "Отменить подключ
|
|||||||
App::$strings["<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "<strong>Замечание</strong>: Из-за настроек конфиденциальности (<em>скрыть данные своего профиля от неизвестных зрителей?</em>) cсылка, потенциально включенная в общедоступные публикации, переданные в GNU social, приведет посетителя к пустой странице, информирующей его о том, что доступ к вашему профилю был ограничен.";
|
App::$strings["<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "<strong>Замечание</strong>: Из-за настроек конфиденциальности (<em>скрыть данные своего профиля от неизвестных зрителей?</em>) cсылка, потенциально включенная в общедоступные публикации, переданные в GNU social, приведет посетителя к пустой странице, информирующей его о том, что доступ к вашему профилю был ограничен.";
|
||||||
App::$strings["Post to GNU social by default"] = "Публиковать в GNU social по умолчанию";
|
App::$strings["Post to GNU social by default"] = "Публиковать в GNU social по умолчанию";
|
||||||
App::$strings["If enabled your public postings will be posted to the associated GNU-social account by default"] = "Если включено, ваши общедоступные публикации будут опубликованы в связанной учётной записи GNU social по умолчанию";
|
App::$strings["If enabled your public postings will be posted to the associated GNU-social account by default"] = "Если включено, ваши общедоступные публикации будут опубликованы в связанной учётной записи GNU social по умолчанию";
|
||||||
App::$strings["GNU-Social Crosspost Connector"] = "";
|
App::$strings["GNU-Social Crosspost Connector"] = "Подключение пересылки публикаций GNU Social";
|
||||||
App::$strings["Post to GNU social"] = "Опубликовать в GNU Social";
|
App::$strings["Post to GNU social"] = "Опубликовать в GNU Social";
|
||||||
App::$strings["API URL"] = "";
|
App::$strings["API URL"] = "";
|
||||||
App::$strings["Application name"] = "Название приложения";
|
App::$strings["Application name"] = "Название приложения";
|
||||||
@ -3293,6 +3301,25 @@ App::$strings["Follow"] = "Отслеживать";
|
|||||||
App::$strings["%1\$s is now following %2\$s"] = "%1\$s сейчас отслеживает %2\$s";
|
App::$strings["%1\$s is now following %2\$s"] = "%1\$s сейчас отслеживает %2\$s";
|
||||||
App::$strings["The GNU-Social protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол GNU-Social не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала.";
|
App::$strings["The GNU-Social protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол GNU-Social не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала.";
|
||||||
App::$strings["GNU-Social Protocol"] = "Протокол GNU-Social";
|
App::$strings["GNU-Social Protocol"] = "Протокол GNU-Social";
|
||||||
|
App::$strings["TOTP Two-Step Verification"] = "Двухэтапная верификация TOTP";
|
||||||
|
App::$strings["Enter the 2-step verification generated by your authenticator app:"] = "Введите код проверки, созданный вашим приложением для аутентификации";
|
||||||
|
App::$strings["Success!"] = "Успех!";
|
||||||
|
App::$strings["Invalid code, please try again."] = "Неверный код. Пожалуйста, попробуйте ещё раз.";
|
||||||
|
App::$strings["Too many invalid codes..."] = "Слишком много неверных кодов...";
|
||||||
|
App::$strings["Verify"] = "Проверить";
|
||||||
|
App::$strings["You haven't set a TOTP secret yet.\nPlease click the button below to generate one and register this site\nwith your preferred authenticator app."] = "Вы еще не установили секретный код TOTP. Пожалуйста, нажмите на кнопку ниже, чтобы сгенерировать его и зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации.";
|
||||||
|
App::$strings["Your TOTP secret is"] = "Ваш секретный код TOTP";
|
||||||
|
App::$strings["Be sure to save it somewhere in case you lose or replace your mobile device.\nUse your mobile device to scan the QR code below to register this site\nwith your preferred authenticator app."] = "Обязательно сохраните его где-нибудь на случай потери или замены мобильного устройства. С помощью мобильного устройства отсканируйте приведенный ниже QR-код, чтобы зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации.";
|
||||||
|
App::$strings["Test"] = "Тест";
|
||||||
|
App::$strings["Generate New Secret"] = "Сгенерировать новый секретный код";
|
||||||
|
App::$strings["Go"] = "Вперёд";
|
||||||
|
App::$strings["Enter your password"] = "Введите ваш пароль";
|
||||||
|
App::$strings["enter TOTP code from your device"] = "введите код TOTP из вашего устройства";
|
||||||
|
App::$strings["Pass!"] = "Принято!";
|
||||||
|
App::$strings["Fail"] = "Отказано";
|
||||||
|
App::$strings["Incorrect password, try again."] = "Неверный пароль, попробуйте снова.";
|
||||||
|
App::$strings["Record your new TOTP secret and rescan the QR code above."] = "Запишите ваш секретный код TOTP и повторно отсканируйте приведенный ниже QR-код.";
|
||||||
|
App::$strings["TOTP Settings"] = "Настройки TOTP";
|
||||||
App::$strings["Message to display on every page on this server"] = "Отображаемое сообщение на каждой странице на этом сервере.";
|
App::$strings["Message to display on every page on this server"] = "Отображаемое сообщение на каждой странице на этом сервере.";
|
||||||
App::$strings["Pageheader Settings"] = "Настройки шапки страницы";
|
App::$strings["Pageheader Settings"] = "Настройки шапки страницы";
|
||||||
App::$strings["pageheader Settings saved."] = "Настройки шапки страницы сохранены.";
|
App::$strings["pageheader Settings saved."] = "Настройки шапки страницы сохранены.";
|
||||||
@ -3354,6 +3381,9 @@ App::$strings["Message sent to %s. New account registration: %s"] = "Сообщ
|
|||||||
App::$strings["Send your identity to all websites"] = "Отправить ваши данные на все веб-сайты";
|
App::$strings["Send your identity to all websites"] = "Отправить ваши данные на все веб-сайты";
|
||||||
App::$strings["Send ZID"] = "Отправить ZID";
|
App::$strings["Send ZID"] = "Отправить ZID";
|
||||||
App::$strings["Who likes me?"] = "Кому я нравлюсь?";
|
App::$strings["Who likes me?"] = "Кому я нравлюсь?";
|
||||||
|
App::$strings["Max queueworker threads"] = "Макс. количество обработчиков очереди";
|
||||||
|
App::$strings["Assume workers dead after ___ seconds"] = "Считать обработчики неактивными через секунд";
|
||||||
|
App::$strings["Queueworker Settings"] = "Настройки обработчика очереди";
|
||||||
App::$strings["lonely"] = "одинокий";
|
App::$strings["lonely"] = "одинокий";
|
||||||
App::$strings["drunk"] = "пьяный";
|
App::$strings["drunk"] = "пьяный";
|
||||||
App::$strings["horny"] = "возбуждённый";
|
App::$strings["horny"] = "возбуждённый";
|
||||||
@ -3406,14 +3436,14 @@ App::$strings["Post to Libertree by default"] = "Публиковать в Liber
|
|||||||
App::$strings["Libertree Post Settings"] = "Настройки публикаций в Libertree";
|
App::$strings["Libertree Post Settings"] = "Настройки публикаций в Libertree";
|
||||||
App::$strings["Libertree Settings saved."] = "Настройки Libertree сохранены.";
|
App::$strings["Libertree Settings saved."] = "Настройки Libertree сохранены.";
|
||||||
App::$strings["Channel is required."] = "Необходим канал.";
|
App::$strings["Channel is required."] = "Необходим канал.";
|
||||||
App::$strings["Hubzilla Crosspost Connector Settings saved."] = "";
|
App::$strings["Hubzilla Crosspost Connector Settings saved."] = "Настройки пересылки публикаций Hubzilla сохранены.";
|
||||||
App::$strings["Relay public postings to another Hubzilla channel"] = "Ретранслировать общедоступные публикации в другой канал Hubzilla";
|
App::$strings["Relay public postings to another Hubzilla channel"] = "Ретранслировать общедоступные публикации в другой канал Hubzilla";
|
||||||
App::$strings["Send public postings to Hubzilla channel by default"] = "Отправлять общедоступные публикации в канал Hubzilla по умолчанию";
|
App::$strings["Send public postings to Hubzilla channel by default"] = "Отправлять общедоступные публикации в канал Hubzilla по умолчанию";
|
||||||
App::$strings["Hubzilla API Path"] = "Путь к Hubzilla API";
|
App::$strings["Hubzilla API Path"] = "Путь к Hubzilla API";
|
||||||
App::$strings["Hubzilla login name"] = "Имя входа Hubzilla";
|
App::$strings["Hubzilla login name"] = "Имя входа Hubzilla";
|
||||||
App::$strings["Hubzilla channel name"] = "Название канала Hubzilla";
|
App::$strings["Hubzilla channel name"] = "Название канала Hubzilla";
|
||||||
App::$strings["Hubzilla Crosspost Connector"] = "";
|
App::$strings["Hubzilla Crosspost Connector"] = "Пересылка публикаций Hubzilla";
|
||||||
App::$strings["Post to Hubzilla"] = "";
|
App::$strings["Post to Hubzilla"] = "Опубликовать в Hubzilla";
|
||||||
App::$strings["ActivityPub Protocol Settings updated."] = "Настройки протокола ActivityPub обновлены.";
|
App::$strings["ActivityPub Protocol Settings updated."] = "Настройки протокола ActivityPub обновлены.";
|
||||||
App::$strings["The activitypub protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол ActivityPub не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала.";
|
App::$strings["The activitypub protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол ActivityPub не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала.";
|
||||||
App::$strings["Deliver to ActivityPub recipients in privacy groups"] = "Доставить получателям ActivityPub в группах безопасности";
|
App::$strings["Deliver to ActivityPub recipients in privacy groups"] = "Доставить получателям ActivityPub в группах безопасности";
|
||||||
@ -3455,4 +3485,3 @@ App::$strings["Skeleton Settings"] = "Настройки скелета";
|
|||||||
App::$strings["__ctx:opensearch__ Search %1\$s (%2\$s)"] = "Искать %1\$s (%2\$s)";
|
App::$strings["__ctx:opensearch__ Search %1\$s (%2\$s)"] = "Искать %1\$s (%2\$s)";
|
||||||
App::$strings["__ctx:opensearch__ \$Projectname"] = "";
|
App::$strings["__ctx:opensearch__ \$Projectname"] = "";
|
||||||
App::$strings["Search \$Projectname"] = "Поиск \$Projectname";
|
App::$strings["Search \$Projectname"] = "Поиск \$Projectname";
|
||||||
App::$strings["Cover Photo"] = "";
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<input type='hidden' name='form_security_token' value='{{$form_security_token_edit}}'>
|
<input type='hidden' name='form_security_token' value='{{$form_security_token_edit}}'>
|
||||||
{{include file="field_input.tpl" field=$gname}}
|
{{include file="field_input.tpl" field=$gname}}
|
||||||
{{include file="field_checkbox.tpl" field=$public}}
|
{{include file="field_checkbox.tpl" field=$public}}
|
||||||
|
{{$pgrp_extras}}
|
||||||
<a href="group/drop/{{$gid}}?t={{$form_security_token_drop}}" onclick="return confirmDelete();" class="btn btn-sm btn-danger">
|
<a href="group/drop/{{$gid}}?t={{$form_security_token_drop}}" onclick="return confirmDelete();" class="btn btn-sm btn-danger">
|
||||||
{{$delete}}
|
{{$delete}}
|
||||||
</a>
|
</a>
|
||||||
|
Reference in New Issue
Block a user