]> git.mxchange.org Git - friendica.git/blobdiff - mod/cal.php
Merge pull request #5830 from nupplaphil/update_from_boot
[friendica.git] / mod / cal.php
index ae1060c47ad5d36a1a76e774857ffd6c4f25e939..6f483acc163478853847b72c36b343bccb0117d4 100644 (file)
@@ -17,10 +17,12 @@ use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Event;
 use Friendica\Model\Group;
+use Friendica\Model\Item;
 use Friendica\Model\Profile;
 use Friendica\Protocol\DFRN;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
+use Friendica\Util\Security;
 
 function cal_init(App $a)
 {
@@ -141,7 +143,7 @@ function cal_content(App $a)
        }
 
        // get the permissions
-       $sql_perms = item_permissions_sql($owner_uid, $remote_contact, $groups);
+       $sql_perms = Item::getPermissionsSQLByUserId($owner_uid, $remote_contact, $groups);
        // we only want to have the events of the profile owner
        $sql_extra = " AND `event`.`cid` = 0 " . $sql_perms;
 
@@ -299,7 +301,7 @@ function cal_content(App $a)
                // Respect the export feature setting for all other /cal pages if it's not the own profile
                if ((local_user() !== intval($owner_uid)) && !Feature::isEnabled($owner_uid, "export_calendar")) {
                        notice(L10n::t('Permission denied.') . EOL);
-                       goaway('cal/' . $nick);
+                       $a->internalRedirect('cal/' . $nick);
                }
 
                // Get the export data by uid
@@ -320,7 +322,7 @@ function cal_content(App $a)
                                $return_path = "cal/" . $nick;
                        }
 
-                       goaway($return_path);
+                       $a->internalRedirect($return_path);
                }
 
                // If nothing went wrong we can echo the export content