Example #1
0
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
 * redirect to the notification's href
 */
try {
    OCP\App::checkAppEnabled("notify");
    OCP\User::checkLoggedIn();
    $id = (int) $_GET["id"];
    $uid = OCP\User::getUser();
    $notification = OC_Notify::getNotificationById((int) $id);
    if ($notification && $notification["uid"] == $uid) {
        OC_Notify::markReadById($uid, $id, true);
        if ($notification["app"] == "notify") {
            switch ($notification["class"]) {
                case "sharedCalendar":
                case "sharedEvent":
                    $href = OCP\Util::linkTo("calendar", "index.php");
                    break;
                case "sharedAbook":
                    $href = OCP\Util::linkTo("contacts", "index.php");
                    break;
                case "sharedFile":
                    $href = OCP\Util::linkTo("files", "index.php", array("dir" => "/Shared" . rtrim(dirname($notification["params"]["name"]), "/")));
                    break;
                case "sharedFolder":