diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Cover_photo.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Events.php | 13 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Profile_photo.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Profiles.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 30 |
6 files changed, 44 insertions, 11 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 7c8e1323c..72ec1020d 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -88,7 +88,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { if($r) { $base_image = $r[0]; - $base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents($base_image['content']) : dbunescbin($base_image['content'])); + $base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content'])); $im = photo_factory($base_image['content'], $base_image['mimetype']); if($im->is_valid()) { @@ -320,7 +320,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { } if(intval($r[0]['os_storage'])) - $data = @file_get_contents($r[0]['content']); + $data = @file_get_contents(dbunescbin($r[0]['content'])); else $data = dbunescbin($r[0]['content']); diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php index a5cc868be..26455cf8e 100644 --- a/Zotlabs/Module/Events.php +++ b/Zotlabs/Module/Events.php @@ -440,8 +440,6 @@ class Events extends \Zotlabs\Web\Controller { $permissions = ((x($orig_event)) ? $orig_event : $perm_defaults); - //print_r(acl2json($permissions['allow_gid'])); killme(); - $tpl = get_markup_template('event_form.tpl'); $form = replace_macros($tpl,array( @@ -469,9 +467,6 @@ class Events extends \Zotlabs\Web\Controller { '$l_text' => (($event_id) ? t('Edit Location') : t('Location')), '$l_orig' => $l_orig, '$t_orig' => $t_orig, - '$sh_text' => t('Share this event'), - '$sh_checked' => $sh_checked, - '$share' => array('distr', t('Share this event'), $sh_checked, '', array(t('No'),t('Yes'))), '$preview' => t('Preview'), '$perms_label' => t('Permission settings'), // populating the acl dialog was a permission description from view_stream because Cal.php, which @@ -483,6 +478,8 @@ class Events extends \Zotlabs\Web\Controller { '$deny_cid' => acl2json($permissions['deny_cid']), '$deny_gid' => acl2json($permissions['deny_gid']), + '$lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'), + '$submit' => t('Submit'), '$advanced' => t('Advanced Options') @@ -611,6 +608,12 @@ class Events extends \Zotlabs\Web\Controller { $end = null; } else { $end = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtend'], 'c') : datetime_convert('UTC','UTC',$rr['dtend'],'c')); + + // give a fake end to birthdays so they get crammed into a + // single day on the calendar + + if($rr['etype'] === 'birthday') + $end = null; } diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 1534dcfd6..3f0ab3ab0 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -246,7 +246,7 @@ class Photos extends \Zotlabs\Web\Controller { intval($page_owner_uid) ); if(count($r)) { - $d = (($r[0]['os_storage']) ? @file_get_contents($r[0]['content']) : dbunescbin($r[0]['content'])); + $d = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($r[0]['content'])) : dbunescbin($r[0]['content'])); $ph = photo_factory($d, $r[0]['mimetype']); if($ph->is_valid()) { $rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 ); diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 8a12e3799..231b80bcf 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -98,7 +98,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { if($r) { $base_image = $r[0]; - $base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents($base_image['content']) : dbunescbin($base_image['content'])); + $base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content'])); $im = photo_factory($base_image['content'], $base_image['mimetype']); if($im->is_valid()) { @@ -354,7 +354,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { } if(intval($r[0]['os_storage'])) - $data = @file_get_contents($r[0]['content']); + $data = @file_get_contents(dbunescbin($r[0]['content'])); else $data = dbunescbin($r[0]['content']); diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 127304f92..19a642a83 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -31,7 +31,7 @@ class Profiles extends \Zotlabs\Web\Controller { // move every contact using this profile as their default to the user default - $r = q("UPDATE abook SET abook_profile = (SELECT profile_guid AS FROM profile WHERE is_default = 1 AND uid = %d LIMIT 1) WHERE abook_profile = '%s' AND abook_channel = %d ", + $r = q("UPDATE abook SET abook_profile = (SELECT profile_guid FROM profile WHERE is_default = 1 AND uid = %d LIMIT 1) WHERE abook_profile = '%s' AND abook_channel = %d ", intval(local_channel()), dbesc($profile_guid), intval(local_channel()) diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index bb4e9179c..8cf106b33 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -90,6 +90,35 @@ class Wiki extends \Zotlabs\Web\Controller { // Not the channel owner $channel_acl = $x = array(); } + + // Download a wiki + if ((argc() > 3) && (argv(2) === 'download') && (argv(3) === 'wiki')) { + $resource_id = argv(4); + $w = wiki_get_wiki($resource_id); + if (!$w['path']) { + notice('Error retrieving wiki' . EOL); + } + $zip_folder_name = random_string(10); + $zip_folderpath = '/tmp/' . $zip_folder_name; + if (!mkdir($zip_folderpath, 0770, false)) { + logger('Error creating zip file export folder: ' . $zip_folderpath, LOGGER_NORMAL); + notice('Error creating zip file export folder' . EOL); + } + $zip_filename = $w['urlName']; + $zip_filepath = '/tmp/' . $zip_folder_name . '/' . $zip_filename; + // Generate the zip file + \Zotlabs\Lib\ExtendedZip::zipTree($w['path'], $zip_filepath, \ZipArchive::CREATE); + // Output the file for download + header('Content-disposition: attachment; filename="' . $zip_filename . '.zip"'); + header("Content-Type: application/zip"); + $success = readfile($zip_filepath); + if ($success) { + rrmdir($zip_folderpath); // delete temporary files + } else { + rrmdir($zip_folderpath); // delete temporary files + logger('Error downloading wiki: ' . $resource_id); + } + } switch (argc()) { case 2: @@ -297,6 +326,7 @@ class Wiki extends \Zotlabs\Web\Controller { } } + // Create a page if ((argc() === 4) && (argv(2) === 'create') && (argv(3) === 'page')) { $nick = argv(1); |