Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9f66e5aef3
9
boot.php
9
boot.php
@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
|
||||
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
||||
define ( 'ZOT_REVISION', 1 );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1090 );
|
||||
define ( 'DB_UPDATE_VERSION', 1091 );
|
||||
|
||||
define ( 'EOL', '<br />' . "\r\n" );
|
||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||
@ -218,7 +218,12 @@ define ( 'PHOTO_PROFILE', 0x0001 );
|
||||
define ( 'PHOTO_XCHAN', 0x0002 );
|
||||
define ( 'PHOTO_THING', 0x0004 );
|
||||
|
||||
|
||||
/**
|
||||
* Menu types
|
||||
*/
|
||||
|
||||
define ( 'MENU_SYSTEM', 0x0001 );
|
||||
define ( 'MENU_BOOKMARK', 0x0002 );
|
||||
|
||||
/**
|
||||
* Network and protocol family types
|
||||
|
@ -2259,7 +2259,7 @@ function tag_deliver($uid,$item_id) {
|
||||
|
||||
if($terms) {
|
||||
foreach($terms as $term) {
|
||||
if(($term['term'] == $u[0]['channel_name']) && link_compare($term['url'],$link)) {
|
||||
if((strcasecmp($term['term'],$u[0]['channel_name']) == 0) && link_compare($term['url'],$link)) {
|
||||
$mention = true;
|
||||
break;
|
||||
}
|
||||
@ -2322,8 +2322,10 @@ function tag_deliver($uid,$item_id) {
|
||||
|
||||
}
|
||||
|
||||
if((! $mention) && (! $union))
|
||||
if((! $mention) && (! $union)) {
|
||||
logger('tag_deliver: no mention and no union.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// tgroup delivery - setup a second delivery chain
|
||||
|
@ -100,11 +100,11 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
||||
$mimetype = z_mime_content_type($name);
|
||||
|
||||
|
||||
$c = q("select * from channel where channel_id = %d limit 1",
|
||||
$c = q("select * from channel where channel_id = %d and not (channel_pageflags & %d) limit 1",
|
||||
intval(PAGE_REMOVED),
|
||||
intval($this->auth->owner_id)
|
||||
);
|
||||
|
||||
|
||||
if(! $c) {
|
||||
logger('createFile: no channel');
|
||||
throw new DAV\Exception\Forbidden('Permission denied.');
|
||||
@ -143,13 +143,21 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
||||
file_put_contents($f, $data);
|
||||
$size = filesize($f);
|
||||
|
||||
$edited = datetime_convert();
|
||||
|
||||
$r = q("update attach set filesize = '%s' where hash = '%s' and uid = %d limit 1",
|
||||
$d = q("update attach set filesize = '%s', edited = '%s' where hash = '%s' and uid = %d limit 1",
|
||||
dbesc($size),
|
||||
dbesc($edited),
|
||||
dbesc($hash),
|
||||
intval($c[0]['channel_id'])
|
||||
);
|
||||
|
||||
$e = q("update attach set edited = '%s' where folder = '%s' and uid = %d limit 1",
|
||||
dbesc($edited),
|
||||
dbesc($this->folder_hash),
|
||||
intval($c[0]['channel_id'])
|
||||
);
|
||||
|
||||
$maxfilesize = get_config('system','maxfilesize');
|
||||
|
||||
if(($maxfilesize) && ($size > $maxfilesize)) {
|
||||
@ -180,8 +188,9 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
||||
return;
|
||||
}
|
||||
|
||||
$r = q("select * from channel where channel_id = %d limit 1",
|
||||
dbesc($this->auth->owner_id)
|
||||
$r = q("select * from channel where channel_id = %d and not (channel_pageflags & %d) limit 1",
|
||||
intval(PAGE_REMOVED),
|
||||
intval($this->auth->owner_id)
|
||||
);
|
||||
|
||||
if($r) {
|
||||
@ -233,13 +242,17 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
||||
|
||||
$channel_name = $path_arr[0];
|
||||
|
||||
$r = q("select channel_id from channel where channel_address = '%s' limit 1",
|
||||
dbesc($channel_name)
|
||||
|
||||
$r = q("select channel_id from channel where channel_address = '%s' and not ( channel_pageflags & %d ) limit 1",
|
||||
dbesc($channel_name),
|
||||
intval(PAGE_REMOVED)
|
||||
);
|
||||
|
||||
if(! $r)
|
||||
return;
|
||||
if(! $r) {
|
||||
throw new DAV\Exception\NotFound('The file with name: ' . $channel_name . ' could not be found');
|
||||
|
||||
return;
|
||||
}
|
||||
$channel_id = $r[0]['channel_id'];
|
||||
$this->auth->owner_id = $channel_id;
|
||||
$this->auth->owner_nick = $channel_name;
|
||||
@ -273,6 +286,15 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
||||
}
|
||||
|
||||
|
||||
function getLastModified() {
|
||||
$r = q("select edited from attach where folder = '%s' and uid = %d order by edited desc limit 1",
|
||||
dbesc($this->folder_hash),
|
||||
intval($this->auth->owner_id)
|
||||
);
|
||||
if($r)
|
||||
return datetime_convert('UTC','UTC', $r[0]['edited'],'U');
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -322,12 +344,12 @@ class RedFile extends DAV\Node implements DAV\IFile {
|
||||
function put($data) {
|
||||
logger('RedFile::put: ' . basename($this->name), LOGGER_DEBUG);
|
||||
|
||||
|
||||
$c = q("select * from channel where channel_id = %d limit 1",
|
||||
$c = q("select * from channel where channel_id = %d and not (channel_pageflags & %d) limit 1",
|
||||
intval(PAGE_REMOVED),
|
||||
intval($this->auth->owner_id)
|
||||
);
|
||||
|
||||
$r = q("select flags, data from attach where hash = '%s' and uid = %d limit 1",
|
||||
$r = q("select flags, folder, data from attach where hash = '%s' and uid = %d limit 1",
|
||||
dbesc($this->data['hash']),
|
||||
intval($c[0]['channel_id'])
|
||||
);
|
||||
@ -351,14 +373,23 @@ class RedFile extends DAV\Node implements DAV\IFile {
|
||||
if($r)
|
||||
$size = $r[0]['fsize'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$r = q("update attach set filesize = '%s' where hash = '%s' and uid = %d limit 1",
|
||||
|
||||
$edited = datetime_convert();
|
||||
|
||||
$d = q("update attach set filesize = '%s', edited = '%s' where hash = '%s' and uid = %d limit 1",
|
||||
dbesc($size),
|
||||
dbesc($edited),
|
||||
dbesc($this->data['hash']),
|
||||
intval($c[0]['channel_id'])
|
||||
);
|
||||
|
||||
$e = q("update attach set edited = '%s' where folder = '%s' and uid = %d limit 1",
|
||||
dbesc($edited),
|
||||
dbesc($r[0]['folder']),
|
||||
intval($c[0]['channel_id'])
|
||||
);
|
||||
|
||||
$maxfilesize = get_config('system','maxfilesize');
|
||||
|
||||
@ -414,7 +445,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
|
||||
|
||||
|
||||
function getLastModified() {
|
||||
return $this->data['edited'];
|
||||
return datetime_convert('UTC','UTC',$this->data['edited'],'U');
|
||||
}
|
||||
|
||||
|
||||
@ -440,8 +471,9 @@ function RedChannelList(&$auth) {
|
||||
|
||||
$ret = array();
|
||||
|
||||
$r = q("select channel_id, channel_address from channel where not (channel_pageflags & %d)",
|
||||
intval(PAGE_REMOVED)
|
||||
$r = q("select channel_id, channel_address from channel where not (channel_pageflags & %d) and not (channel_pageflags & %d) ",
|
||||
intval(PAGE_REMOVED),
|
||||
intval(PAGE_HIDDEN)
|
||||
);
|
||||
|
||||
if($r) {
|
||||
|
@ -536,9 +536,11 @@ CREATE TABLE IF NOT EXISTS `menu` (
|
||||
`menu_channel_id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`menu_name` char(255) NOT NULL DEFAULT '',
|
||||
`menu_desc` char(255) NOT NULL DEFAULT '',
|
||||
`menu_flags` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`menu_id`),
|
||||
KEY `menu_channel_id` (`menu_channel_id`),
|
||||
KEY `menu_name` (`menu_name`)
|
||||
KEY `menu_name` (`menu_name`),
|
||||
KEY `menu_flags` (`menu_flags`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `menu_item` (
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
define( 'UPDATE_VERSION' , 1090 );
|
||||
define( 'UPDATE_VERSION' , 1091 );
|
||||
|
||||
/**
|
||||
*
|
||||
@ -986,3 +986,11 @@ ADD INDEX ( `creator` ) ");
|
||||
}
|
||||
|
||||
|
||||
function update_r1090() {
|
||||
$r = q("ALTER TABLE `menu` ADD `menu_flags` INT NOT NULL DEFAULT '0',
|
||||
ADD INDEX ( `menu_flags` )");
|
||||
if($r)
|
||||
return UPDATE_SUCCESS;
|
||||
return UPDATE_FAILED;
|
||||
}
|
||||
|
||||
|
@ -355,8 +355,7 @@ function events_content(&$a) {
|
||||
'$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''),
|
||||
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
|
||||
'$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''),
|
||||
'$calendar' => cal($y,$m,$links, ' eventcal'),
|
||||
|
||||
'$calendar' => cal($y,$m,$links, ' eventcal'),
|
||||
'$events' => $events,
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ function page_content(&$a) {
|
||||
|
||||
$channel_address = argv(1);
|
||||
$page_id = argv(2);
|
||||
|
||||
dbg(1);
|
||||
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
|
||||
dbesc($channel_address)
|
||||
);
|
||||
@ -63,7 +63,7 @@ function page_content(&$a) {
|
||||
dbesc($page_id),
|
||||
intval(ITEM_WEBPAGE)
|
||||
);
|
||||
|
||||
dbg(0);
|
||||
if(! $r) {
|
||||
|
||||
// Check again with no permissions clause to see if it is a permissions issue
|
||||
|
@ -29,8 +29,10 @@ function pubsites_content(&$a) {
|
||||
$j = json_decode($ret['body'],true);
|
||||
if($j) {
|
||||
$o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Location') . '</td></tr>';
|
||||
foreach($j['sites'] as $jj) {
|
||||
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td></tr>';
|
||||
if($j['sites']) {
|
||||
foreach($j['sites'] as $jj) {
|
||||
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$o .= '</table>';
|
||||
|
@ -70,7 +70,7 @@ then
|
||||
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
|
||||
else
|
||||
sed -i "s/SOME DESCRIPTIVE TITLE./Red Communications Project/g" "$OUTFILE"
|
||||
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2013 the Red Matrix Project/g" "$OUTFILE"
|
||||
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2012-2014 the Red Matrix Project/g" "$OUTFILE"
|
||||
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2013/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE/Red/g" "$OUTFILE"
|
||||
|
@ -1 +1 @@
|
||||
2014-01-11.554
|
||||
2014-01-15.558
|
||||
|
Reference in New Issue
Block a user