Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
0788d37c60
@ -20,6 +20,15 @@ class Hook {
|
||||
if($r)
|
||||
return true;
|
||||
|
||||
// To aid in upgrade and transition, remove old settings for any registered hooks that match in all respects except
|
||||
// for priority or hook_version
|
||||
|
||||
$r = q("DELETE FROM `hook` where `hook` = '%s' and `file` = '%s' and `function` = '%s'",
|
||||
dbesc($hook),
|
||||
dbesc($file),
|
||||
dbesc($function)
|
||||
);
|
||||
|
||||
$r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`, `hook_version`) VALUES ( '%s', '%s', '%s', %d, %d )",
|
||||
dbesc($hook),
|
||||
dbesc($file),
|
||||
@ -46,6 +55,18 @@ class Hook {
|
||||
return $r;
|
||||
}
|
||||
|
||||
// unregister all hooks with this file component.
|
||||
// Useful for addon upgrades where you want to clean out old interfaces.
|
||||
|
||||
static public function unregister_by_file($file) {
|
||||
|
||||
$r = q("DELETE FROM hook WHERE `file` = '%s' ",
|
||||
dbesc($file)
|
||||
);
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Inserts a hook into a page request.
|
||||
|
@ -725,7 +725,7 @@ class Admin extends \Zotlabs\Web\Controller {
|
||||
'$embed_allow' => array('embed_allow', t('Allow embedded HTML content only from these domains'), $whiteembeds_str, t('One site per line. Leave empty to allow from any site by default')),
|
||||
'$embed_deny' => array('embed_deny', t('Block embedded HTML from these domains'), $blackembeds_str, ''),
|
||||
|
||||
'$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')),
|
||||
// '$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')),
|
||||
'$submit' => t('Submit')
|
||||
));
|
||||
}
|
||||
|
@ -1243,14 +1243,14 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if (!$iswebpage) {
|
||||
$max = service_class_fetch($channel_id,'total_items');
|
||||
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
|
||||
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {
|
||||
$result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$max);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$max = service_class_fetch($channel_id,'total_pages');
|
||||
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_pages'));
|
||||
if(! service_class_allows($channel_id,'total_pages',$r[0]['total'])) {
|
||||
$result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$max);
|
||||
return $result;
|
||||
|
@ -615,7 +615,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
|
||||
|
||||
$limit = service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit');
|
||||
$limit = engr_units_to_bytes(service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit'));
|
||||
if($limit !== false) {
|
||||
$usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 );
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ class Browser extends DAV\Browser\Plugin {
|
||||
return;
|
||||
|
||||
// Storage and quota for the account (all channels of the owner of this directory)!
|
||||
$limit = service_class_fetch($owner, 'attach_upload_limit');
|
||||
$limit = engr_units_to_bytes(service_class_fetch($owner, 'attach_upload_limit'));
|
||||
$r = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d",
|
||||
intval($this->auth->channel_account_id)
|
||||
);
|
||||
|
@ -315,13 +315,13 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
|
||||
}
|
||||
|
||||
// check against service class quota
|
||||
$limit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit');
|
||||
$limit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'));
|
||||
if ($limit !== false) {
|
||||
$x = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d ",
|
||||
intval($c[0]['channel_account_id'])
|
||||
);
|
||||
if (($x) && ($x[0]['total'] + $size > $limit)) {
|
||||
logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit);
|
||||
logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . userReadableSize($limit));
|
||||
attach_delete($c[0]['channel_id'], $hash);
|
||||
return;
|
||||
}
|
||||
@ -549,7 +549,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
|
||||
intval($this->auth->owner_id)
|
||||
);
|
||||
|
||||
$ulimit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit');
|
||||
$ulimit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'));
|
||||
$limit = (($ulimit) ? $ulimit : $limit);
|
||||
|
||||
$x = q("select sum(filesize) as total from attach where aid = %d",
|
||||
|
@ -208,13 +208,13 @@ class File extends DAV\Node implements DAV\IFile {
|
||||
return;
|
||||
}
|
||||
|
||||
$limit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit');
|
||||
$limit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'));
|
||||
if ($limit !== false) {
|
||||
$x = q("select sum(filesize) as total from attach where aid = %d ",
|
||||
intval($c[0]['channel_account_id'])
|
||||
);
|
||||
if (($x) && ($x[0]['total'] + $size > $limit)) {
|
||||
logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit);
|
||||
logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . userReadableSize($limit));
|
||||
attach_delete($c[0]['channel_id'], $this->data['hash']);
|
||||
return;
|
||||
}
|
||||
|
8
doc/context/en/admin/logs/help.html
Normal file
8
doc/context/en/admin/logs/help.html
Normal file
@ -0,0 +1,8 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>This page allows you to adjust log settings and to view and existing log.</dd>
|
||||
<dt>Log Settings</dt>
|
||||
<dd>When you enable the Debugging option, system log information will begin appending to the file specified in the "Log File" box (path is relative to the hub root, for example /var/www). Note that this file must be writable by the web server.</dd>
|
||||
<dt>Log Level</dt>
|
||||
<dd>The log level option allows you to set how much information is appended to the log file. Warning: Increasing this level can quickly inflate the size of the log file to >100MB, especially on hubs with more than a few members.</dd>
|
||||
</dl>
|
4
doc/context/en/admin/queue/help.html
Normal file
4
doc/context/en/admin/queue/help.html
Normal file
@ -0,0 +1,4 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>The queue statistics display how many posts are in the queue for delivery to other hubs. The priority is related to how many times the delivery has been unsuccessfully attempted.</dd>
|
||||
</dl>
|
@ -1,3 +1,4 @@
|
||||
<h3>Security Settings</h3>
|
||||
<p>This page contains various administrator settings related to security.</p>
|
||||
<p>To save any changes you make to these settings, you must press the Submit button.</p>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>This page contains various administrator settings related to security. To save any changes you make to these settings, you must press the Submit button.</dd>
|
||||
</dl>
|
8
doc/context/en/chat/help.html
Normal file
8
doc/context/en/chat/help.html
Normal file
@ -0,0 +1,8 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>Create and use chat rooms to communicate in real-time, using the standard Hubzilla permissions system for chat room access control.</dd>
|
||||
<dt>Create new chat room</dt>
|
||||
<dd>Use the "Create New" button to create a new chat room. Enter a name and how long messages should be retained.</dd>
|
||||
<dt>Chatting</dt>
|
||||
<dd>Enter your message in the message box and press Submit. You can set a status by selecting the chat room menu button beside the Submit button. Other people "in the room" are visible in the side panel in the "Chat Members" panel.</dd>
|
||||
</dl>
|
8
doc/context/en/connections/help.html
Normal file
8
doc/context/en/connections/help.html
Normal file
@ -0,0 +1,8 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>This page displays a list of all this channel's connections. The list can be <a href='#' onclick='contextualHelpFocus(".section-title-wrapper", 0); return false;' title="Click to highlight element...">sorted and filtered using the menu button beside the search button</a>. </dd>
|
||||
<dt>Connection Details</dt>
|
||||
<dd>Each list entry shows the details of a specific connection. A translucent avatar image indicates an archived connection.</dd>
|
||||
<dt>Connection Status</dt>
|
||||
<dd>A connection can be in different states: <ul><li>Archived</li><li>Ignored</li><li>Blocked</li><li>Hidden</li></ul></dd>
|
||||
</dl>
|
8
doc/context/en/connections/ifpending/help.html
Normal file
8
doc/context/en/connections/ifpending/help.html
Normal file
@ -0,0 +1,8 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>This page displays a list of all this channel's connections. The list can be <a href='#' onclick='contextualHelpFocus(".section-title-wrapper", 0); return false;' title="Click to highlight element...">sorted and filtered using the menu button beside the search button</a>. </dd>
|
||||
<dt>Connection Details</dt>
|
||||
<dd>Each list entry shows the details of a specific connection. A translucent avatar image indicates an archived connection.</dd>
|
||||
<dt>Connection Status</dt>
|
||||
<dd>A connection can be in different states: <ul><li>Archived</li><li>Ignored</li><li>Blocked</li><li>Hidden</li></ul></dd>
|
||||
</dl>
|
8
doc/context/en/events/help.html
Normal file
8
doc/context/en/events/help.html
Normal file
@ -0,0 +1,8 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt>General</dt>
|
||||
<dd>This page displays a calendar of events both owned by you and shared with you from other channels.</dd>
|
||||
<dt><a href='#' onclick='contextualHelpFocus("#title", 0); return false;' title="Click to highlight element...">Calendar View</a></dt>
|
||||
<dd>The calendar can be displayed in month, week, or day mode using the options in the side panel.</dd>
|
||||
<dt>Export/Import</dt>
|
||||
<dd>Export or import calendar events using standard iCalendar format (.ics) files.</dd>
|
||||
</dl>
|
@ -591,6 +591,7 @@ function service_class_allows($uid, $property, $usage = false) {
|
||||
if($limit === false)
|
||||
return true; // No service class set => everything is allowed
|
||||
|
||||
$limit = engr_units_to_bytes($limit);
|
||||
if($usage === false) {
|
||||
// We use negative values for not allowed properties in a subscriber plan
|
||||
return ((x($limit)) ? (bool) $limit : true);
|
||||
@ -627,6 +628,8 @@ function account_service_class_allows($aid, $property, $usage = false) {
|
||||
if($limit === false)
|
||||
return true; // No service class is set => everything is allowed
|
||||
|
||||
$limit = engr_units_to_bytes($limit);
|
||||
|
||||
if($usage === false) {
|
||||
// We use negative values for not allowed properties in a subscriber plan
|
||||
return ((x($limit)) ? (bool) $limit : true);
|
||||
|
@ -5616,3 +5616,18 @@ function send_profile_photo_activity($channel,$photo,$profile) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sync_an_item($channel_id,$item_id) {
|
||||
|
||||
$r = q("select * from item where id = %d",
|
||||
intval($item_id)
|
||||
);
|
||||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
$rid = q("select * from item_id where iid = %d",
|
||||
intval($item_id)
|
||||
);
|
||||
build_sync_packet($channel_d,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid));
|
||||
}
|
||||
}
|
@ -131,7 +131,7 @@ function photo_upload($channel, $observer, $args) {
|
||||
intval($account_id)
|
||||
);
|
||||
|
||||
$limit = service_class_fetch($channel_id,'photo_upload_limit');
|
||||
$limit = engr_units_to_bytes(service_class_fetch($channel_id,'photo_upload_limit'));
|
||||
|
||||
if (($r) && ($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
|
||||
$ret['message'] = upgrade_message();
|
||||
@ -296,7 +296,7 @@ function photo_upload($channel, $observer, $args) {
|
||||
|
||||
$photo_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . t('a new photo') . '[/zrl]';
|
||||
|
||||
$album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . $album . '[/zrl]';
|
||||
$album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . ((strlen($album)) ? $album : '/') . '[/zrl]';
|
||||
|
||||
$activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link);
|
||||
|
||||
|
@ -1825,7 +1825,7 @@ function lang_selector() {
|
||||
}
|
||||
|
||||
|
||||
function return_bytes ($size_str) {
|
||||
function engr_units_to_bytes ($size_str) {
|
||||
switch (substr ($size_str, -1)) {
|
||||
case 'M': case 'm': return (int)$size_str * 1048576;
|
||||
case 'K': case 'k': return (int)$size_str * 1024;
|
||||
|
@ -210,6 +210,7 @@ header #banner #logo-text {
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 51px;
|
||||
width: 100%;
|
||||
max-height: 50%;
|
||||
background: $comment_item_colour;
|
||||
padding: 20px;
|
||||
@ -223,6 +224,24 @@ header #banner #logo-text {
|
||||
.contextual-help-content dd {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.contextual-help-tool {
|
||||
padding: 7px;
|
||||
filter: alpha(opacity=20);
|
||||
opacity: .2;
|
||||
}
|
||||
|
||||
.contextual-help-tool:hover {
|
||||
filter: alpha(opacity=50);
|
||||
opacity: .5;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.contextual-help-tool i {
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* contextual help end */
|
||||
|
||||
/* footer */
|
||||
|
@ -15,9 +15,6 @@
|
||||
{{include file="field_textarea.tpl" field=$whitelisted_channels}}
|
||||
{{include file="field_textarea.tpl" field=$blacklisted_channels}}
|
||||
|
||||
|
||||
{{include file="field_checkbox.tpl" field=$embed_coop}}
|
||||
|
||||
{{include file="field_textarea.tpl" field=$embed_allow}}
|
||||
{{include file="field_textarea.tpl" field=$embed_deny}}
|
||||
|
||||
|
@ -36,10 +36,6 @@
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a></li>
|
||||
{{/if}}
|
||||
{{if $nav.help.6}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="{{$nav.help.0}}" title="{{$nav.help.3}}" role="menuitem" id="{{$nav.help.4}}">{{$nav.help.1}}</a></li>
|
||||
{{/if}}
|
||||
{{if $nav.logout}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" role="menuitem" id="{{$nav.logout.4}}">{{$nav.logout.1}}</a></li>
|
||||
@ -207,6 +203,9 @@
|
||||
{{if $nav.help.6}}
|
||||
<div id="contextual-help-content" class="contextual-help-content">
|
||||
{{$nav.help.5}}
|
||||
<button type="button" class="close" onclick="contextualHelp();">×</button>
|
||||
<div class="pull-right">
|
||||
<a class="contextual-help-tool" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}"><i class="icon-question"></i></a>
|
||||
<a class="contextual-help-tool" href="#" onclick="contextualHelp(); return false;"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
Reference in New Issue
Block a user