Example #1
0
function editform($predef = "", $errfile = "")
{
    global $sess, $mytrail, $auth, $PATH_INFO, $perm;
    $capabilities = get_caps($perm, parent_path($mytrail['path']));
    //$mytrail is a complete nodeinfo-structure that comes from
    //trail.php
    $tpl = new Template(APPLICATION_HOME . "/templates/trail", "keep");
    $tpl->set_file(array("simpleframe" => "simpleframe.html"));
    $tpl->set_var("CONTENT", print_trail_editform($mytrail, $predef, has_caps($capabilities, CAP_SUPERUSER), $errfile));
    $tpl->parse("simpleframe", "simpleframe");
    print $tpl->get("simpleframe");
}
Example #2
0
function display_form($passerror = false, $senderror = "", $ssenderror = false, $posconf = false)
{
    global $kat, $expert, $in_login, $perm, $extension, $sess, $method, $ltrstr, $HTTP_GET_VARS, $auth, $viewdata_messages, $PATH_INFO;
    list($leer, $expert, $method, $extension) = split('/', $PATH_INFO);
    $pl = build_pathlist($kat, false);
    $plf = build_pathlist($kat, true);
    $restriction_list = build_restriction_list($kat);
    $username = $auth->auth['uname'];
    $in_login = false;
    $userdata = get_user_from_name($expert);
    $capabilities = get_caps($perm, $kat);
    if (!class_exists("Template")) {
        include "template.inc";
    }
    if (!(isset($HTTP_GET_VARS['viewtype']) and $HTTP_GET_VARS['viewtype'] == "0")) {
        $tpl = new Template(APPLICATION_HOME . "/templates/mypage", "keep");
        $tpl->set_file(array("main" => "editall.html"));
        include "commonheader2.html";
        $tpl->set_var("USERNAME", $expert);
    }
    switch ($method) {
        case "Messages":
            if ($extension == "") {
                $extension = "Inbox";
            }
            if (!isset($viewdata_messages)) {
                $viewdata_messages['ci'] = 0;
                $viewdata_messages['ob'] = 'd';
                $sess->register("viewdata_messages");
            }
            if (isset($HTTP_GET_VARS['ci'])) {
                $ci = $HTTP_GET_VARS['ci'];
                $ci = $HTTP_GET_VARS['ci'] == "all" ? "-1" : $ci;
                $viewdata_messages['ci'] = $ci == "" ? 0 : $ci;
            }
            if (isset($HTTP_GET_VARS['ob'])) {
                $viewdata_messages['ob'] = $HTTP_GET_VARS['ob'] == "" ? 'd' : $HTTP_GET_VARS['ob'];
            }
            if (isset($HTTP_GET_VARS['viewtype']) and $HTTP_GET_VARS['viewtype'] == "0") {
                do_mor($userdata, $HTTP_GET_VARS, $extension == "Inbox");
            } elseif (isset($HTTP_GET_VARS['viewtype']) and $HTTP_GET_VARS['viewtype'] != "0") {
                $tpl->set_var("EDITFORM", print_my_lms($userdata, $viewdata_messages['ci'], $viewdata_messages['ob'], $senderror, $HTTP_GET_VARS['objectid'], $HTTP_GET_VARS['viewtype'], $extension));
            } else {
                $tpl->set_var("EDITFORM", print_my_lms($userdata, $viewdata_messages['ci'], $viewdata_messages['ob'], $senderror, "", 1, $extension));
            }
            $subnav = array();
            $subnav[0] = array("title" => $ltrstr['Inbox'], "url" => "Inbox");
            $subnav[1] = array("title" => $ltrstr['Outbox'], "url" => "Outbox");
            //         die(count_friends($userdata['User_ID']));
            if (count_friends($userdata['User_ID']) != 0) {
                $subnav[2] = array("title" => $ltrstr['Composer'], "url" => "Composer");
            }
            switch ($extension) {
                case "Inbox":
                    $idx = 0;
                    break;
                case "Outbox":
                    $idx = 1;
                    break;
                case "Composer":
                    $idx = 2;
                    break;
                default:
                    $idx = -1;
            }
            $tpl->set_var("SUBNAV", "");
            update_read_stamp($userdata['User_ID']);
            break;
        case "Send_Message":
            $tpl->set_var("EDITFORM", print_message_send_form($userdata['Username'], $ssenderror));
            $tpl->set_var("SUBNAV", "");
            break;
        case "Make_friendship":
            $tpl->set_var("EDITFORM", print_make_friendship($userdata['Username']));
            $tpl->set_var("SUBNAV", "");
            break;
        case "Settings":
            if ($extension == "") {
                $extension = "Profile";
            }
            //die("Ext: ".$extension);
            $subnav = array();
            $subnav[0] = array("title" => $ltrstr['Profile'], "url" => "Profile");
            $subnav[1] = array("title" => $ltrstr['Security Preferences'], "url" => "Password");
            $subnav[2] = array("title" => $ltrstr['Preferences'], "url" => "Preferences");
            switch ($extension) {
                case "Profile":
                    $idx = 0;
                    break;
                case "Password":
                    $idx = 1;
                    break;
                case "Preferences":
                    $idx = 2;
                    break;
                default:
                    $idx = -1;
            }
            $tpl->set_var("EDITFORM", print_all_settings_form($extension, $userdata, $passerror, $posconf));
            $tpl->set_var("SUBNAV", "");
            break;
    }
    $itsme = $auth->auth['uname'] == $expert or has_caps($capabilities, CAP_SUPERUSER);
    $tpl->set_var("FRIENDLIST", print_mypage_friendlist($userdata['User_ID'], $userdata, $itsme));
    $tpl->set_var("IWANTTO", print_iwantto($PATH_INFO));
    $tpl->parse("main", "main");
    $tpl->p("main");
    include "commonfooter2.html";
}
Example #3
0
if (!defined("USER_INC")) {
    include "dbapi/user.inc";
}
if (!defined("MSG_FRIENDSHIPS_INC")) {
    include "messages/friendships.inc";
}
if (!defined("MESSAGES_INC")) {
    include "messages/friendships.inc";
}
page_open(array("sess" => "Linktrail_Session", "auth" => "Linktrail_Auth", "perm" => "Linktrail_Perm", "user" => "Linktrail_User"));
//Some funny guy with good eyes might try to call this file directely with his own
//userid (I'm asking me, where he should get it) and the userid of his friend (I am even
//more asking me how to get it) for comfirming the request/cancelin a frienddship.
//Let's kick him back!
$capabilities = get_caps($perm, "/");
if ($HTTP_GET_VARS['expert'] != $auth->auth['uid'] and has_caps($capabilities, CAP_SUPERUSER)) {
    page_close();
    Header("Location: " . $sess->url("/Experts/" . rawurlencode($expert)));
    exit;
}
if ($HTTP_GET_VARS['expert'] == "" or $HTTP_GET_VARS['target'] == "") {
    page_close();
    Header("Location: " . $sess->url("/Experts/" . rawurlencode($expert)));
    exit;
}
$uname = uid2name($HTTP_GET_VARS['expert']);
$hisname = uid2name($HTTP_GET_VARS['target']);
/*foreach($HTTP_GET_VARS as $key => $value)
 echo("$key = $value<br>");
 
die("test");*/
Example #4
0
    include "layout/lay_directory.inc";
}
if (!defined("LAY_DIREDIT_INC")) {
    include "layout/lay_diredit.inc";
}
if (!defined("LAY_SLOTS_INC")) {
    include "layout/lay_slots.inc";
}
if (!defined("DISPLAY_DIRECTORY_INC")) {
    include "application/display_directory.inc";
}
$capabilities = get_caps($perm, $kat);
$kat = $PATH_INFO;
$nodeinfo = get_node_info($kat);
//push back evil guys...
if (!has_caps($capabilities, CAP_EDIT_EXPERTS) or $REQUEST_METHOD != "POST" or $nodeinfo == -1) {
    go_back();
}
if (isset($cancel)) {
    go_back();
} else {
    doit();
}
function go_back()
{
    global $sess, $PATH_INFO;
    page_close();
    Header("Location: " . $sess->url($PATH_INFO));
    exit;
}
function print_error($errstr, $predef)
Example #5
0
function perm_check($type, $perms, $thislink)
{
    global $auth;
    $res = false;
    switch ($type) {
        case "add":
            $res = has_caps($perms, PERM_ADD);
            break;
        case "edit":
            $res = (has_caps($perms, PERM_EDIT) or has_caps($perms, PERM_MOVE) or $thislink['uid'] == $auth->auth['uid']);
            break;
        case "move":
            $res = has_caps($perms, PERM_MOVE);
            break;
        case "del":
            $res = (has_caps($perms, PERM_DEL) or has_caps($perms, PERM_MOVE) or $thislink['uid'] == $auth->auth['uid']);
            break;
        case "pass":
            $res = true;
            break;
    }
    return $res;
}
Example #6
0
}
if (!defined("LAY_DIRECTORY_INC")) {
    include "layout/lay_directory.inc";
}
if (!defined("LAY_SLOTS_INC")) {
    include "layout/lay_slots.inc";
}
if (!class_exists("Template")) {
    include "template.inc";
}
$capabilities = get_caps($perm, $kat);
$url = str_replace('//', '/', $PATH_INFO);
$pos = strrpos($url, '/') + 1;
$method = substr($url, $pos);
$kat = substr($url, 0, $pos);
if (!has_caps($capabilities, CAP_EDIT_SLOTS)) {
    Header("Location: " . $sess->url($kat));
    exit;
}
if ($method == "") {
    $method = "Add_Slot";
}
//die("Method: $method || Path: $kat || pathinfo: $PATH_INFO");
$nodeinfo = get_node_info($kat);
switch ($method) {
    case 'Add_Slot':
        if ($REQUEST_METHOD == "GET") {
            add_slot_form();
        } else {
            if (isset($del)) {
                go_back();