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"); }
function display_done() { global $kat, $auth, $uid, $perm, $sess; if (!defined("COMMON_PERMISSIONS_INC")) { include "commonapi/common_permissions.inc"; } /* auth_preauth() will authenticatge the user since logon_now_as is registered and set to true */ page_close(); page_open(array("sess" => "Linktrail_Session", "auth" => "Linktrail_Auth", "perm" => "Linktrail_Perm")); $caps = get_caps($perm, '/'); if (!defined("LAY_MYPAGE_INC")) { include "layout/lay_mypage.inc"; } if (!defined("LAY_DIRECTORY_INC")) { include "layout/lay_directory.inc"; } $pl = build_pathlist($kat, false); $plf = build_pathlist($kat, true); $restriction_list = build_restriction_list($kat); //$username = $auth->auth['uname']; $in_login = false; include "template.inc"; include "commonheader2.html"; $tpl = new Template(APPLICATION_HOME . "/templates/login", "keep"); $tpl->set_file(array("main" => "regdone.html")); //$tpl->set_var("IWANTTO", print_mypage_iwantto($caps, $auth->auth['uname'])); $tpl->set_var("USERNAME", $auth->auth['uname']); $tpl->set_var("MYPAGEURL", $sess->url(build_good_url("/Experts/" . $auth->auth['uname']))); $tpl->set_var("SETTINGSURL", $sess->url(build_good_url("/Experts/" . $auth->auth['uname'] . '/Settings'))); $tpl->set_var("TOURURL", $sess->url("/Tour/")); $tpl->set_var("IWANTTO", print_iwantto('/', $caps)); $tpl->set_var("HOME_URL", $sess->url("/")); $tpl->parse("main", "main"); $tpl->p("main"); include "commonfooter2.html"; page_close(); exit; }
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"; }
include "commonapi/common_user.inc"; } if (!defined("COMMON_ERRORS_INC")) { include "commonapi/common_errors.inc"; } if (!defined("LAY_MYPAGE_INC")) { include "layout/lay_mypage.inc"; } $kat = ereg_replace('^/([^-\\]*-[^/]*)(.*)', '\\2', $PHP_SELF); $pl = build_pathlist($kat, false); $plf = build_pathlist($kat, true); $username = $auth->auth['uname']; $restriction_list = build_restriction_list($kat); $in_login = false; $nobody = ($auth->auth["uid"] == "nobody" or $auth->auth["uid"] == "" or $auth->auth["uid"] == "form"); $capabilities = get_caps($perm, '/'); include "template.inc"; include "commonheader2.html"; if ($REQUEST_METHOD == "POST") { doit(); } else { form(); } include "commonfooter2.html"; page_close(); function form($error = "") { global $kat, $capabilities; print print_password_request(false, '/', $capabilities); } function doit()
exit; } /* GLOBALS */ sqgetGlobalVar('username', $username, SQ_SESSION); sqgetGlobalVar('key', $key, SQ_COOKIE); sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('submit', $submit, SQ_POST); for ($i = 0; $i <= 9; $i++) { $varc = 'CHECK_TEST_' . $i; sqgetGlobalVar($varc, ${$varc}, SQ_POST); $vart = 'TEST_' . $i; sqgetGlobalVar($vart, ${$vart}, SQ_POST); } /* END GLOBALS */ $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $caps_array = get_caps($imap_stream); $list = array('TEST_0', 'TEST_1', 'TEST_2', 'TEST_3', 'TEST_4', 'TEST_5', 'TEST_6', 'TEST_7', 'TEST_8', 'TEST_9'); print "<br><center><b>IMAP server information</b></center><br>\n"; print "<center><table bgcolor=\"" . $color[3] . "\" width=\"100%\" border=\"1\" cellpadding=\"2\"><tr><td bgcolor=" . $color[3] . "><br>\n"; print "<center><table width=\"95%\" border=\"1\" bgcolor=\"" . $color[3] . "\">\n"; print "<tr><td bgcolor=\"" . $color[4] . "\"><b>Server Capability response:</b><br>\n"; foreach ($caps_array[0] as $value) { print htmlspecialchars($value); } print "</td></tr><tr><td>\n"; if (!isset($submit) || $submit == 'default') { print "<br><font color=" . $color[6] . "><small>Select the IMAP commands you would like to run.\n Most commands require a selected mailbox so the SELECT-command is already setup.\n You can clear all the commands and test your own IMAP command strings. The\n commands are executed in order. The default values are simple IMAP commands using\n your default_charset and folder_prefix from SquirrelMail when needed.<br><br>\n </small></font><center><font color=" . $color[6] . "><small><b>NOTE: These commands\n are live, any changes made will effect your current\n email account.</b></small></font></center><br>\n"; if (!isset($submit)) { $submit = ''; } } else {
/* First I read the permissions of our user. */ if (!defined("COMMON_PERMISSIONS_INC")) { include "commonapi/common_permissions.inc"; } if (!defined("PERMISSIONS_INC")) { include "dbapi/permissions.inc"; } page_open(array("sess" => "Linktrail_Session", "auth" => "Linktrail_Auth", "perm" => "Linktrail_Perm", "user" => "Linktrail_User")); $mytrail = get_node_info($PATH_INFO); if ($mytrail == -1) { $mytrail = get_node_info($PATH_INFO . "?"); } if ($auth->auth['uid'] != $mytrail['userid']) { page_close(); Header("Location: " . $sess->url($PATH_INFO)); exit; } $caps = get_caps($perm); //used to read the superuser-capability of users with perm->have-perm("admin"); $trailperms = relevant_perms($mytrail, $auth->auth["uid"], $caps); if (!class_exists("Template")) { include "template.inc"; } if ($action == "exec") { doit(); } else { form(); } page_close();
} 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>");
if (!defined("COMUTILS_INC")) { include "dbapi/comutils.inc"; } if (!defined("LAY_DIRECTORY_INC")) { 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();
function print_results($query, $advanced = false) { global $perm, $sess, $HTTP_GET_VARS, $glob_userdata, $glob_search_words; $glob_search_words = array(); if (!defined("SEARCH_INC")) { include "search/search2.inc"; } if (!defined("LAY_DIRECTORY_INC")) { include "layout/lay_directory.inc"; } if (!defined("LAY_SEARCH_INC")) { include "layout/lay_search.inc"; } if (!defined("COMMON_PERMISSIONS_INC")) { include "commonapi/common_permissions.inc"; } $ciu = $HTTP_GET_VARS['ciu'] == "" ? 0 : $HTTP_GET_VARS['ciu']; $cit = $HTTP_GET_VARS['cit'] == "" ? 0 : $HTTP_GET_VARS['cit']; $cic = $HTTP_GET_VARS['cic'] == "" ? 0 : $HTTP_GET_VARS['cic']; if ($glob_userdata['ResPerPage'] == "") { $glob_userdata['ResPerPage'] = DIR_MAX_SEARCH; } if ($glob_userdata['HighlightSearch'] == "") { $glob_userdata['HighlightSearch'] = true; } $restriction = $HTTP_GET_VARS['restriction']; if ($query != "") { $err = ""; if ($advanced == false) { $query = format_query($query); } else { $query = format_query_simple($query); } // echo("freag: $query<p>"); $users = array(); if (!ereg('^/Experts', $restriction)) { $cats = execute_query($query, $sess->id, $cic, "c", $restriction, $glob_userdata['ResPerPage']); if (!isset($cats['error'])) { $trails = execute_query($query, $sess->id, $cit, "t", $restriction, $glob_userdata['ResPerPage']); $glob_search_words = $cats['resinfo']['words']; } else { $err = $cats['error']; } if (!is_array($err)) { $experts = execute_query($query, $sess->id, 0, "e", $restriction, $glob_userdata['ResPerPage']); } if (isset($experts['error']) and !is_array($err)) { $err = $experts['error']; } } else { $users = execute_query($query, $sess->id, $ciu, "t", $restriction, $glob_userdata['ResPerPage']); $glob_search_words = $cats['words']; // die($users['resinfo']['rescount']); if (isset($users['error'])) { $err = $users['error']; } $users['resinfo']['ci'] = $ciu; } } print_page_begin(); $tpl = new Template(APPLICATION_HOME . "/templates/search", "keep"); $tpl->set_file(array("main" => "main.html")); $caps = get_caps($perm, '/'); $tpl->set_var("IWANTTO", print_iwantto('/', $caps)); //printf("Test: %d / %d / %d<p>",count($trails['results']) ,count($trails['results']) ,count($trails['results']) ); //printf("Test: %d, %d, %d", count($cats['results']), count($trails['results']), count($users['results'])); if (count($cats['results']) == 0 and count($trails['results']) == 0 and count($users['results']) == 0 or $query == "") { if (is_array($err)) { $tpl->set_var("CATEGORIES", print_search_error($err)); } else { $tpl->set_var("CATEGORIES", implode("\n", file(TEMPLATE_ROOT . 'search/nothing_found.html'))); } $tpl->set_var("TRAILS", ""); $tpl->set_var("EXPERTS", ""); } elseif (count($users) > 0) { $tpl->set_var("CATEGORIES", print_found_users($users)); $tpl->set_var("EXPERTS", ""); $tpl->set_var("TRAILS", ""); } else { $tpl->set_var("CATEGORIES", print_found_categories($cats)); $tpl->set_var("TRAILS", print_found_trails($trails)); $tpl->set_var("EXPERTS", print_found_experts($experts)); } $tpl->parse("main", "main"); $tpl->p("main"); print_page_end(); }