Exemplo n.º 1
0
        if (sizeof($result) > 0) {
            $group = new EfrontGroup($result[0]);
            echo json_encode($group->useKeyForUser($currentUser));
        } else {
            throw new Exception(_INVALIDKEY . ': ' . $_GET['group_key']);
        }
    } catch (Exception $e) {
        handleAjaxExceptions($e);
    }
    exit;
}
if (isset($_GET['bookmarks']) && EfrontUser::isOptionVisible('bookmarks')) {
    try {
        $bookmarks = bookmarks::getBookmarks($currentUser, $currentLesson);
        if ($_GET['bookmarks'] == 'remove' && in_array($_GET['id'], array_keys($bookmarks))) {
            $bookmark = new bookmarks($_GET['id']);
            $bookmark->delete();
        } elseif ($_GET['bookmarks'] == 'add') {
            foreach ($bookmarks as $value) {
                $urls[] = $value['url'];
            }
            if (!in_array($_SERVER['PHP_SELF'] . "?view_unit=" . $currentUnit['id'], $urls)) {
                $fields = array('users_LOGIN' => $currentUser->user['login'], 'lessons_ID' => $currentLesson->lesson['id'], 'name' => $currentUnit['name'], 'url' => $_SERVER['PHP_SELF'] . "?view_unit=" . $currentUnit['id']);
                bookmarks::create($fields);
            }
        } else {
            echo json_encode($bookmarks);
        }
    } catch (Exception $e) {
        handleAjaxExceptions($e);
    }
Copyright Intermesh 2003
Author: Merijn Schering <*****@*****.**>
Version: 1.0 Release date: 08 July 2003

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.
*/
require "../Group-Office.php";
$GO_SECURITY->authenticate();
require $GO_LANGUAGE->get_language_file('bookmarks');
require $GO_THEME->theme_path . "simple_header.inc";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    require $GO_CONFIG->class_path . "bookmarks.class.inc";
    $bookmarks = new bookmarks();
    $URL = trim($_REQUEST['URL']);
    $name = trim($_REQUEST['name']);
    $invalid[] = "\"";
    $invalid[] = "&";
    $invalid[] = "?";
    if (!validate_input($name, $invalid)) {
        $feedback = "<p class=\"Error\">" . $invalid_chars . ": \" & ?</p>";
    } else {
        if ($URL != "" && $name != "") {
            if (!eregi('(^http[s]*:[/]+)(.*)', $URL)) {
                $URL = "http://" . $URL;
            }
            if ($_REQUEST['bookmark_id']) {
                if ($bookmarks->update_bookmark($_REQUEST['bookmark_id'], $URL, $name, $_REQUEST['new_window'])) {
                    echo "<script type=\"text/javascript\">\nopener.location=opener.location\nwindow.close()\n</script>";
Exemplo n.º 3
0
/*
Copyright Intermesh 2004
Author: Merijn Schering <*****@*****.**>
Version: 1.0 Release date: 12 March 2004

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.
*/
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();
//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()) {
Exemplo n.º 4
0
/*
Copyright Intermesh 2003
Author: Merijn Schering <*****@*****.**>
Version: 1.0 Release date: 08 July 2003

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.
*/
require "../Group-Office.php";
$GO_SECURITY->authenticate();
require $GO_LANGUAGE->get_language_file('bookmarks');
$page_title = $menu_bookmarks;
require $GO_CONFIG->class_path . "bookmarks.class.inc";
$bookmarks = new bookmarks();
if (isset($_REQUEST['delete_bookmark'])) {
    $bookmarks->delete_bookmark($GO_SECURITY->user_id, $_REQUEST['delete_bookmark']);
}
require $GO_THEME->theme_path . "header.inc";
?>
<table border="0" cellpadding="10" cellspacing="0">
<tr>
	<td>
	<table border="0" cellpadding="0" cellspacing="0" class="TableBorder" width="600">
	<tr>
		<td valign="top">
		<table border="0" cellpadding="1" cellspacing="1" width="100%">
		<tr>
			<td colspan="99" class="TableHead"><?php 
echo $menu_bookmarks;
Exemplo n.º 5
0
  Copyright Intermesh 2004
  Author: Merijn Schering <*****@*****.**>
  Version: 1.0 Release date: 08 July 2003
  Version: 2.0 Release date: 12 March 2004

  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.
*/
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();
$bookmark_id = isset($_REQUEST['bookmark_id']) ? $_REQUEST['bookmark_id'] : 0;
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
switch ($task) {
    case 'save':
        $URL = smart_addslashes(trim($_REQUEST['URL']));
        $name = smart_addslashes(trim($_REQUEST['name']));
        $invalid[] = "\"";
        $invalid[] = "&";
        $invalid[] = "?";
        if (!validate_input($name, $invalid)) {
            $feedback = "<p class=\"Error\">" . $invalid_chars . ": \" & ?</p>";
        } else {
            if ($URL != "" && $name != "") {
                /*if (!eregi('(^http[s]*:[/]+)(.*)', $URL))
                	{
Exemplo n.º 6
0
/**
* controller
*
* @author     Dac Chartrand <*****@*****.**>
* @license    http://www.fsf.org/licensing/licenses/gpl-3.0.html
*/
function sux($action, $params = null)
{
    // Alphasort
    $alphasort = false;
    if (isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'alpha') {
        $alphasort = true;
    }
    switch ($action) {
        case 'admin':
            // --------------------------------------------------------------------
            // Admin
            // --------------------------------------------------------------------
            $admin = new bookmarksAdmin();
            if ($admin->formValidate($_POST)) {
                $admin->formProcess($_POST);
                $admin->formSuccess();
            } else {
                $admin->formBuild($_POST);
            }
            break;
        case 'approve':
            // --------------------------------------------------------------------
            // Approve
            // --------------------------------------------------------------------
            $bm = new bookmarksApprove();
            if ($bm->formValidate($_POST)) {
                $bm->formProcess($_POST);
                $bm->formSuccess();
            } else {
                $bm->formBuild($_POST);
            }
            break;
        case 'suggest':
            // --------------------------------------------------------------------
            // Suggest
            // --------------------------------------------------------------------
            $bm = new bookmarksSuggest();
            if ($bm->formValidate($_POST)) {
                $bm->formProcess($_POST);
                $bm->formSuccess();
            } else {
                $bm->formBuild($_POST);
            }
            break;
        case 'edit':
            // --------------------------------------------------------------------
            // Edit
            // --------------------------------------------------------------------
            $id = !empty($params[0]) ? $params[0] : null;
            $edit = new bookmarksEdit($id);
            if ($edit->formValidate($_POST)) {
                $edit->formProcess($_POST);
                $edit->formSuccess();
            } else {
                $edit->formBuild($_POST);
            }
            break;
        case 'user':
            // --------------------------------------------------------------------
            // User
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/bookmarks'));
            }
            $bm = new bookmarks();
            $bm->user($params[0], $alphasort);
            break;
        case 'tag':
            // --------------------------------------------------------------------
            // Tags
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/bookmarks'));
            }
            $bm = new bookmarks();
            if ($params[0] == 'cloud') {
                $bm->tagcloud();
            } else {
                $bm->tag($params[0], $alphasort);
            }
            break;
        case 'rss':
            // --------------------------------------------------------------------
            // RSS
            // --------------------------------------------------------------------
            $bm = new bookmarks();
            $bm->rss();
            break;
        default:
            // --------------------------------------------------------------------
            // Default
            // --------------------------------------------------------------------
            $bm = new bookmarks();
            $bm->listing($alphasort);
            break;
    }
}
Exemplo n.º 7
0
Version: 1.0 Release date: 08 July 2003
Version: 2.0 Release date: 12 March 2004

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'])) {