Example #1
0
function ltrsymlink()
{
    global $HTTP_POST_VARS, $thisnode, $sess;
    foreach ($HTTP_POST_VARS as $key => $value) {
        if (preg_match('/(.*)?_([0-9]+)/', $key, $erg)) {
            if ($erg[1] == "rename" or $erg[1] == "delete") {
                $method = $erg[1];
                $id = $erg[2];
            }
        }
    }
    if ($id != "" and $method != "") {
        if ($method == "delete") {
            delete_symlink($id);
        } elseif ($method == "rename") {
            if ($HTTP_POST_VARS["field_name-{$id}"] != "") {
                if (level_count($HTTP_POST_VARS["field_name-{$id}"]) > 0) {
                    include "directory/edit/err_invalidslash.html";
                    exit;
                }
                $fullpath = id2path($id);
                rename_symlink($id, parent_path($fullpath) . $HTTP_POST_VARS["field_name-{$id}"] . '/');
            }
        }
    }
    //echo("Location: ".$thisnode['path']."?editmode=1");
    header("Location: " . $sess->url($thisnode['path'] . "?editmode=1"));
    exit;
}
Example #2
0
function del($id, $act_as_admin = false, $quick = false)
{
    global $sess, $mytrail, $auth;
    if (!defined("DIRECTORY_NOTIFICATION_INC")) {
    }
    include "messages/directory_notification.inc";
    rm_object((int) $id, true);
    if ($act_as_admin) {
        send_admin_notification($mytrail, LTMSG_TRAILDEL);
    }
    //TODO: add reason
    if (!$quick) {
        page_close();
        include "directory/edit/del-confirmation.html";
        exit;
    } else {
        page_close();
        Header("Location: " . $sess->url(build_good_url(parent_path($mytrail['path']))));
    }
}
Example #3
0
function display_form(&$http_vars, $cond_array = array())
{
    global $PHP_SELF;
    if (!defined("LAY_SEARCH_INC")) {
        include "layout/lay_search.inc";
    }
    if (!defined("LAY_DIRECTORY_INC")) {
        include "layout/lay_directory.inc";
    }
    $kat = ereg_replace('^/([^-\\]*-[^/]*)(.*)', '\\2', $PHP_SELF);
    page_head($http_vars, $kat);
    $tpl = new Template(APPLICATION_HOME . "/templates/search", "keep");
    $tpl->set_file(array("main" => "main.html"));
    $tpl->set_var("IWANTTO", print_iwantto('/', $caps));
    $tpl->set_var("EXPERTS", "");
    $tpl->set_var("TRAILS", "");
    $tpl->set_var("CATEGORIES", print_adv_search_form($http_vars, $cond_array, parent_path($kat)));
    $tpl->parse("main", "main");
    $tpl->p("main");
    page_foot();
}
Example #4
0
$capabilities = get_caps($perm, $kat);
// this is used at many places
/*
 Mod_rewrite directs us all the queries to the directory to this file. Now
 we will have to find out whether we have to display a node, or a trail.
 
 If it's a trail, we must find out, if we can only redirect to the Trail-Window
 (we got called from the correct directory-node) or if we have to display
 the correct node (parent of Trail) and open the Trail in a new Window
*/
if (preg_match('/^\\/Experts\\/(.+)/', $kat, $found)) {
    display_mypage($found[1]);
} else {
    if (!is_trail($kat) or $kat == "/") {
        display_directory();
    } else {
        $autoopen = $kat;
        $sess->register("autoopen");
        header("Location: " . $sess->url(parent_path($kat)));
    }
}
page_close();
//echo("<p>");
/*foreach($auth->auth as $key => $value)
 echo("$key = $value<br>"); */
/*foreach($GLOBALS as $key => $value)
 echo("$key = $value<br>");*/
?>