Merge branch 'master' of https://github.com/redmatrix/redmatrix
This commit is contained in:
commit
79b5fb5b58
@ -17,6 +17,7 @@ We need much more than this, but here are areas where developers can help. Pleas
|
|||||||
[li]Write more webpage widgets[/li]
|
[li]Write more webpage widgets[/li]
|
||||||
[li]restricted access OAuth clients[/li]
|
[li]restricted access OAuth clients[/li]
|
||||||
[li](Advanced) create a UI for building Comanche pages[/li]
|
[li](Advanced) create a UI for building Comanche pages[/li]
|
||||||
|
[li](less advanced) create a way to preview Comanche results on a preview page while editing on another page[/li]
|
||||||
[li]Extend WebDAV to provide desktop access to photo albums[/li]
|
[li]Extend WebDAV to provide desktop access to photo albums[/li]
|
||||||
[li]External post connectors - create standard interface[/li]
|
[li]External post connectors - create standard interface[/li]
|
||||||
[li]External post connectors, add popular services[/li]
|
[li]External post connectors, add popular services[/li]
|
||||||
|
@ -36,7 +36,8 @@ function attach_init(&$a) {
|
|||||||
|
|
||||||
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
|
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
|
||||||
if($r['data']['flags'] & ATTACH_FLAG_OS ) {
|
if($r['data']['flags'] & ATTACH_FLAG_OS ) {
|
||||||
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
|
$fname = dbunescbin($r['data']['data']);
|
||||||
|
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
|
||||||
$ostream = fopen('php://output','wb');
|
$ostream = fopen('php://output','wb');
|
||||||
if($istream && $ostream) {
|
if($istream && $ostream) {
|
||||||
pipe_streams($istream,$ostream);
|
pipe_streams($istream,$ostream);
|
||||||
@ -45,7 +46,7 @@ function attach_init(&$a) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo $r['data']['data'];
|
echo dbunescbin($r['data']['data']);
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
12
mod/item.php
12
mod/item.php
@ -116,7 +116,7 @@ function item_post(&$a) {
|
|||||||
* Check service class limits
|
* Check service class limits
|
||||||
*/
|
*/
|
||||||
if ($uid && !(x($_REQUEST,'parent')) && !(x($_REQUEST,'post_id'))) {
|
if ($uid && !(x($_REQUEST,'parent')) && !(x($_REQUEST,'post_id'))) {
|
||||||
$ret = item_check_service_class($uid,x($_REQUEST,'webpage'));
|
$ret = item_check_service_class($uid,(($_REQUEST['webpage'] == ITEM_WEBPAGE) ? true : false));
|
||||||
if (!$ret['success']) {
|
if (!$ret['success']) {
|
||||||
notice( t($ret['message']) . EOL) ;
|
notice( t($ret['message']) . EOL) ;
|
||||||
if(x($_REQUEST,'return'))
|
if(x($_REQUEST,'return'))
|
||||||
@ -1084,6 +1084,7 @@ function item_check_service_class($channel_id,$iswebpage) {
|
|||||||
$ret = array('success' => false, $message => '');
|
$ret = array('success' => false, $message => '');
|
||||||
|
|
||||||
if ($iswebpage) {
|
if ($iswebpage) {
|
||||||
|
// note: we aren't counting comanche templates and blocks, only webpages
|
||||||
$r = q("select count(id) as total from item where parent = id
|
$r = q("select count(id) as total from item where parent = id
|
||||||
and ( item_restrict & %d ) > 0 and ( item_restrict & %d ) = 0 and uid = %d ",
|
and ( item_restrict & %d ) > 0 and ( item_restrict & %d ) = 0 and uid = %d ",
|
||||||
intval(ITEM_WEBPAGE),
|
intval(ITEM_WEBPAGE),
|
||||||
@ -1092,7 +1093,8 @@ function item_check_service_class($channel_id,$iswebpage) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("select count(id) as total from item where parent = id and item_restrict = 0 and uid = %d ",
|
$r = q("select count(id) as total from item where parent = id and item_restrict = 0 and (item_flags & %d) > 0 and uid = %d ",
|
||||||
|
intval(ITEM_WALL),
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1103,14 +1105,16 @@ function item_check_service_class($channel_id,$iswebpage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$iswebpage) {
|
if (!$iswebpage) {
|
||||||
|
$max = service_class_fetch($channel_id,'total_items');
|
||||||
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {
|
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.'),$r[0]['total']);
|
$result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$max);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$max = service_class_fetch($channel_id,'total_pages');
|
||||||
if(! service_class_allows($channel_id,'total_pages',$r[0]['total'])) {
|
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.'),$r[0]['total']);
|
$result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$max);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2015-04-11.999
|
2015-04-14.1002
|
||||||
|
Reference in New Issue
Block a user