Ejemplo n.º 1
0
         } else {
             if ($_POST['close'] == 'true') {
                 header('Location: ' . $GO_MODULES->url);
                 exit;
             }
         }
     } else {
         $acl_read = $GO_SECURITY->get_new_acl('bookmarks');
         $acl_write = $GO_SECURITY->get_new_acl('bookmarks');
         if ($acl_read > 0 && $acl_write > 0) {
             if (!($bookmark_id = $bookmarks->add_bookmark($GO_SECURITY->user_id, $_POST['catagory_id'], $URL, $name, $new_window, $acl_read, $acl_write))) {
                 $GO_SECURITY->delete_acl($acl_read);
                 $GO_SECURITY->delete_acl($acl_write);
                 $feedback = "<p class=\"Error\">" . $strSaveError . "</p>";
             } else {
                 if (!isset($_POST['private']) && ($catagory = $bookmarks->get_catagory($_POST['catagory_id']))) {
                     $GO_SECURITY->copy_acl($catagory['acl_write'], $acl_write);
                     $GO_SECURITY->copy_acl($catagory['acl_read'], $acl_read);
                 }
                 if (!$GO_SECURITY->user_in_acl($GO_SECURITY->user_id, $acl_write)) {
                     $GO_SECURITY->add_user_to_acl($GO_SECURITY->user_id, $acl_write);
                 }
                 if ($_POST['close'] == 'true') {
                     header('Location: ' . $GO_MODULES->url);
                     exit;
                 }
             }
         }
     }
 } else {
     $feedback = "<p class=\"Error\">" . $error_missing_field . "</p>";
Ejemplo n.º 2
0
$GO_MODULES->authenticate('bookmarks');
require $GO_MODULES->path . 'classes/bookmarks.class.inc';
$bookmarks = new bookmarks();
//get the language file
require $GO_LANGUAGE->get_language_file('bookmarks');
//where did we come from?
$return_to = $GO_MODULES->url;
//define task
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$catagory_id = isset($_REQUEST['catagory_id']) ? $_REQUEST['catagory_id'] : 0;
//create a tab window
$tabtable = new tabtable('catagories_tab', $strProperties, '600', '400', '120', '', true);
//save catagory
switch ($task) {
    case 'copy_read_permissions':
        if ($catagory = $bookmarks->get_catagory($catagory_id)) {
            $bookmarks->get_user_bookmarks($GO_SECURITY->user_id, $catagory_id);
            while ($bookmarks->next_record()) {
                $GO_SECURITY->copy_acl($catagory['acl_read'], $bookmarks->f('acl_read'));
            }
        }
        break;
    case 'copy_write_permissions':
        if ($catagory = $bookmarks->get_catagory($catagory_id)) {
            $bookmarks->get_user_bookmarks($GO_SECURITY->user_id, $catagory_id);
            while ($bookmarks->next_record()) {
                $GO_SECURITY->copy_acl($catagory['acl_write'], $bookmarks->f('acl_write'));
            }
        }
        break;
    case 'save':
Ejemplo n.º 3
0
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
$columns = 3;
require "../../Group-Office.php";
$GO_SECURITY->authenticate();
require $GO_LANGUAGE->get_language_file('bookmarks');
$GO_MODULES->authenticate('bookmarks');
require $GO_MODULES->path . 'classes/bookmarks.class.inc';
$bookmarks = new bookmarks();
$bookmarks2 = new bookmarks();
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
if (isset($_REQUEST['delete_catagory'])) {
    if ($catagory = $bookmarks->get_catagory($_REQUEST['delete_catagory'])) {
        if ($GO_SECURITY->user_id == $catagory['user_id']) {
            if ($bookmarks->delete_catagory($_REQUEST['delete_catagory'])) {
                $GO_SECURITY->delete_acl($catagory['acl_write']);
                $GO_SECURITY->delete_acl($catagory['acl_read']);
            }
        }
    }
}
if (isset($_POST['bookmarks'])) {
    switch ($task) {
        case 'delete':
            while ($bookmark_id = array_shift($_POST['bookmarks'])) {
                if ($bookmark = $bookmarks->get_bookmark($bookmark_id)) {
                    $catagory = $bookmarks->get_catagory($bookmark['catagory_id']);
                    if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $catagory['acl_write'])) {