Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge

This commit is contained in:
zotlabs 2017-11-06 21:55:58 -08:00
commit 5e47b767ea
15 changed files with 126 additions and 108 deletions

37
DEVELOPERS Normal file
View File

@ -0,0 +1,37 @@
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

View File

@ -59,19 +59,10 @@ class Cloud extends \Zotlabs\Web\Controller {
// if we arrived at this path with any query parameters in the url, build a clean url without
// them and redirect.
// @fixme if the filename has an ampersand in it AND there are query parameters,
// this may not do the right thing.
if((strpos($_SERVER['QUERY_STRING'],'?') !== false) || (strpos($_SERVER['QUERY_STRING'],'&') !== false && strpos($_SERVER['QUERY_STRING'],'&') === false)) {
$path = z_root();
if(argc()) {
foreach(\App::$argv as $a) {
$path .= '/' . $a;
}
}
goaway($path);
}
$x = clean_query_string();
if($x !== \App::$query_string)
goaway(z_root() . '/' . $x);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
@ -92,16 +83,17 @@ class Cloud extends \Zotlabs\Web\Controller {
$server->addPlugin($browser);
// Experimental QuotaPlugin
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
// ob_start();
// All we need to do now, is to fire up the server
$server->exec();
// ob_end_flush();
if($browser->build_page)
construct_page();
killme();
}

View File

@ -102,7 +102,7 @@ class Directory extends \Zotlabs\Web\Controller {
$common = array();
$index = 0;
foreach($r as $rr) {
$common[$rr['xchan_addr']] = $rr['total'];
$common[$rr['xchan_addr']] = ((intval($rr['total']) > 0) ? intval($rr['total']) - 1 : 0);
$addresses[$rr['xchan_addr']] = $index++;
}
@ -334,7 +334,7 @@ class Directory extends \Zotlabs\Web\Controller {
'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '',
'ignore_label' => t('Don\'t suggest'),
'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''),
'common_label' => t('Common connections:'),
'common_label' => t('Common connections (estimated):'),
'common_count' => intval($common[$rr['address']]),
'safe' => $safe_mode
);

View File

@ -219,7 +219,7 @@ class Ping extends \Zotlabs\Web\Controller {
intval(local_channel())
);
break;
case 'messages':
case 'mail':
$r = q("update mail set mail_seen = 1 where mail_seen = 0 and channel_id = %d ",
intval(local_channel())
);

View File

@ -233,6 +233,7 @@ class Browser extends DAV\Browser\Plugin {
$f[] = $ft;
}
$output = '';
if ($this->enablePost) {
$this->server->emit('onHTMLActionsPanel', array($parent, &$output, $path));

View File

@ -925,6 +925,7 @@ class App {
*/
self::$argv = explode('/', self::$cmd);
self::$argc = count(self::$argv);
if ((array_key_exists('0', self::$argv)) && strlen(self::$argv[0])) {
if(strpos(self::$argv[0],'.')) {

View File

@ -0,0 +1,4 @@
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Editar las propiedades individuales de la aplicación seleccionada. Las categorías le permiten ordenar sus aplicaciones para ayudarle a encontrarlas más fácilmente en la lista. El soporte para aplicaciones personalizadas que usted o su administrador puedan elegir para crear incluye campos como "Precio de la aplicación" y "Ubicación para la compra" que no son aplicables a las aplicaciones principales de Hubzilla.</dd>
</dl>

View File

@ -0,0 +1,4 @@
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Modificar o eliminar sus "apps" usando el botón de control que está junto al icono de cada aplicación de la lista.</dd>
</dl>

View File

@ -0,0 +1,6 @@
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Esta página le muestra qué aplicaciones están disponibles para su canal, incluyendo tanto las aplicaciones principales como las proporcionadas por addons. Para añadir una aplicación al <a href=' #' onclick=' contextualHelpFocus ("#app-menu", 1); devuelve false;' title="Pulsar para abrir...">menú de aplicaciones</a> "estrelle" la aplicación de la siguiente lista.</dd>
<dt>Gestionar las aplicaciones (apps)</dt>
<dd>Pulse el botón "Gestionar aplicaciones" para abrir una página en la podrá editar el nombre, las categorías y otras propiedades de sus aplicaciones.</dd>
</dl>

View File

@ -0,0 +1,19 @@
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Las fichas representan un área persistente para la colaboración que está separada del stream social. Son algo más ligeras que las páginas web y los wikis para una rápida organización de la información y tienen la ventaja de permitir la colaboración y los comentarios. Son muy adecuados para ayudar a organizar tareas complejas en las que hay actualizaciones y retroalimentación frecuentes.</dd>
<dt>Añadir una ficha</dt>
<dd>
Crear una ficha nueva es muy parecido a componer un nuevo post.<br><br>
<ul>
<li>
<b>Nombre del enlace de la página</b>: Este nombre es el de la ficha para una URL estática
</li>
<li>
<b>Título</b>: El título se muestra en la parte de arriba de la ficha
</li>
<li>
<b>Categorías</b>: Si tiene activada la opción <a href="/settings/features">Temas de las entradas</a> en su canal, entonces puede añadirlas a la ficha. Estas categorías o temas se despliegan en la lista <b>Temas</b> en el panel de la izquierda y permiten filtrar su colección de fichas.
</li>
</ul>
</dd>
</dl>

View File

@ -1,7 +1,6 @@
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Esta página muestra los ficheros en la "nube" de un canal. Los archivos visibles para el observador dependen de los permisos de archivo individuales establecidas por
el propietario del canal. Si tiene permiso para crear o cargar ficheros, verá botones de control por encima de la lista de ficheros.</dd>
<dt><a href="#" onclick='contextualHelpFocus("#tabs-collapse-1", 0); return false;' title="Pulsar en el elemento resaltado...">Pestañas de los contenidos del canal</a></dt>
<dd>Las pestañas de los contenidos del canal son enlaces a otros contenidos publicados por el canal. La pestaña "<b>Mi perfil</b>" enlaza con el perfil del canal. La pestaña "<b>Fotos</b>" enlaza con las galerías de fotos. La pestaña "<b>Ficheros</b>" enlaza con los ficheros de cualquier tipo compartidos por el canal.</dd>
</dl>
<dl class="dl-horizontal">
<dt>General</dt>
<dd>Esta página muestra los archivos "cloud" de un canal. Los archivos visibles para el observador dependen de los permisos de fichero individuales establecidos por el propietario del canal. Si tiene permiso para crear o cargar archivos verá botones de control encima de la lista de ficheros. </dd>
<dt><a href='#' onclick='contextualHelpFocus("#tabs-collapse-1", 0); return false;' title="Pulsar en el elemento resaltado...">Pestañas de contenidos del canal</a></dt>
<dd>Las pestañas de contenidos del canal son enlaces a otros contenidos publicados por el canal. La pestaña <b>Mi canal</b> enlaza con el perfil del canal. La pestaña <b>Fotos</b> enlaza con las galerías de fotos del canal. La pestaña <b>Ficheros</b> enlaza con los ficheros compartidos publicados por el canal.</dd>
</dl>

View File

@ -947,9 +947,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
if($notify) {
//$cloudPath = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['0']['display_path'];
//$object = get_file_activity_object($channel['channel_id'], $r['0']['hash'], $cloudPath);
//file_activity($channel['channel_id'], $object, $r['0']['allow_cid'], $r['0']['allow_gid'], $r['0']['deny_cid'], $r['0']['deny_gid'], 'post', $notify);
$cloudPath = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['0']['display_path'];
$object = get_file_activity_object($channel['channel_id'], $r['0']['hash'], $cloudPath);
file_activity($channel['channel_id'], $object, $r['0']['allow_cid'], $r['0']['allow_gid'], $r['0']['deny_cid'], $r['0']['deny_gid'], 'post', $notify);
}
return $ret;
@ -1421,7 +1421,7 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
intval($channel_id)
);
file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', $notify=1);
file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true);
return;
}
@ -2341,6 +2341,11 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) {
}
/**
* Used to generate a select input box of all your folders
*/
function attach_folder_select_list($channel_id) {
$r = q("select * from attach where is_dir = 1 and uid = %d",
@ -2391,6 +2396,10 @@ function attach_folder_rpaths($all_folders,$that_folder) {
return (($error) ? false : [ $current_hash , $path ]);
}
/**
* @brief Given a channel_id and attach_hash, return an array with the full relative path and os_path
*/
function attach_syspaths($channel_id,$attach_hash) {
@ -2414,6 +2423,17 @@ function attach_syspaths($channel_id,$attach_hash) {
return [ 'os_path' => $os_path, 'path' => $path ];
}
/**
* in earlier releases we did not fill in os_path and display_path in the attach DB structure.
* (It was not needed or used). Going forward we intend to make use of these fields.
* A cron task checks for empty values (as older attachments may have arrived at our site
* in a clone operation) and executes attach_syspaths() to generate these field values and correct
* the attach table entry. The operation is limited to 100 DB entries at a time so as not to
* overload the system in any cron run. Eventually it will catch up with old attach structures
* and switch into maintenance mode to correct any that might arrive in clone packets from older
* sites.
*/
function attach_upgrade() {
@ -2440,6 +2460,12 @@ function attach_upgrade() {
}
/**
* Chunked uploader for integration with the blueimp jquery-uploader
* This is currently used.
*/
function save_chunk($channel,$start,$end,$len) {
$result = [];
@ -2478,64 +2504,3 @@ function save_chunk($channel,$start,$end,$len) {
}
/**
* @brief Submit handler for chunked uploads.
*
* @param array $channel
* @param array $arr
* @return array
*/
function chunkloader($channel, $arr) {
logger('request: ' . print_r($arr,true), LOGGER_DEBUG);
logger('files: ' . print_r($_FILES,true), LOGGER_DEBUG);
$result = [];
$tmp_path = $_FILES['file']['tmp_name'];
$new_base = 'store/[data]/' . $channel['channel_address'] . '/tmp';
os_mkdir($new_base,STORAGE_DEFAULT_PERMISSIONS,true);
$new_path = $new_base . '/' . $arr['resumableFilename'];
rename($tmp_path,$new_path . '.' . intval($arr['resumableChunkNumber']));
$missing_parts = false;
for($x = 1; $x <= intval($arr['resumableTotalChunks']); $x ++) {
if(! file_exists($new_path . '.' . $x)) {
$missing_parts = true;
break;
}
}
if($missing_parts) {
$result['partial'] = true;
return $result;
}
if(intval($arr['resumableTotalChunks']) === 1) {
rename($new_path . '.' . '1', $new_path);
}
else {
for($x = 1; $x <= intval($arr['resumableTotalChunks']); $x ++) {
$istream = fopen($new_path . '.' . $x,'rb');
$ostream = fopen($new_path,'ab');
if($istream && $ostream) {
pipe_streams($istream,$ostream);
fclose($istream);
fclose($ostream);
}
unlink($new_path . '.' . $x);
}
}
$result['name'] = $arr['resumableFilename'];
$result['type'] = $arr['resumableType'];
$result['tmp_name'] = $new_path;
$result['error'] = 0;
$result['size'] = $arr['resumableTotalSize'];
$result['complete'] = true;
return $result;
}

View File

@ -230,6 +230,7 @@ function can_comment_on_post($observer_xchan, $item) {
$x = [
'observer_hash' => $observer_xchan,
'item' => $item,
'allowed' => 'unset'
];
/**
* @hooks can_comment_on_post

View File

@ -103,25 +103,14 @@ function strip_zats($s) {
return preg_replace('/[\?&]zat=(.*?)(&|$)/ism','$2',$s);
}
function strip_auth_query_params() {
$_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
$_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
$_SERVER['QUERY_STRING'] = strip_owt($_SERVER['QUERY_STRING']);
$_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = strip_owt($_SERVER['REQUEST_URI']);
$_ENV['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_ENV['QUERY_STRING']);
$_ENV['QUERY_STRING'] = strip_zids($_ENV['QUERY_STRING']);
$_ENV['QUERY_STRING'] = strip_owt($_ENV['QUERY_STRING']);
$_ENV['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_ENV['REQUEST_URI']);
$_ENV['REQUEST_URI'] = strip_zids($_ENV['REQUEST_URI']);
$_ENV['REQUEST_URI'] = strip_owt($_ENV['REQUEST_URI']);
function clean_query_string() {
$x = strip_zids(\App::$query_string);
$x = strip_owt($x);
$x = strip_zats($x);
return strip_query_param($x,'f');
}

View File

@ -26,7 +26,7 @@
<input type="hidden" name="return_url" value="{{$return_url}}" />
<label for="files-upload">{{$upload_header}}</label>
<input class="form-group pull-left" id="files-upload" type="file" name="userfile">
{{**include file="field_checkbox.tpl" field=$notify**}}
{{include file="field_checkbox.tpl" field=$notify}}
<div class="pull-right btn-group">
<div class="btn-group">
{{if $lockstate}}