function search(&$cond_array) { global $PHP_SELF, $sess; $kat = ereg_replace('^/([^-\\]*-[^/]*)(.*)', '\\2', $PHP_SELF); $query = ""; $connectors = array("a" => " AND ", "o" => " OR ", "n" => " AND NOT "); foreach ($cond_array as $condition) { if ($condition['text'] == "") { continue; } //ignore empty conditions! if ($condition['loc'] == "a") { $query .= $connectors[$condition['conn']]; $query .= '"%' . $condition['text'] . '%"'; } else { $query .= $connectors[$condition['conn']]; switch ($condition['loc']) { case "tt": $query .= '{"%' . $condition['text'] . '%";TrailTitle:100}'; break; case "td": $query .= '{"%' . $condition['text'] . '%";TrailDesc:100}'; break; case "lt": $query .= '{"%' . $condition['text'] . '%";LinkName:100}'; break; case "ld": $query .= '{"%' . $condition['text'] . '%";LinkDesc:100}'; break; case "lu": $query .= '{"%' . $condition['text'] . '%";URL:100}'; break; } } } // die("<pre>$query</pre>"); Header("Location: " . $sess->url(build_good_url(parent_path($kat)) . 'Search?aq=' . urlencode($query))); }
function do_mor($userdata, &$http_vars, $in) { global $sess, $SERVER_NAME, $extension; if (!defined("MESSAGES_INC")) { include "dbapi/messages.inc"; } if (!$http_vars['objectid']) { page_close(); Header($sess->url(build_good_url("/Experts/" . $userdata['Username'] . "/Messages"))); exit; } $msg = read_one_message($http_vars['objectid'], $in); if (!is_object($msg)) { page_close(); Header("Location: " . $sess->url(build_good_url("/Experts/" . $userdata['Username'] . "/Messages"))); exit; } if ($msg->get_target() != $userdata['User_ID'] and $msg->is_inbox and ($msg->sender != $userdata['Username'] and !$msg->is_inbox)) { /* Some script-kiddie just noticed the message-id in the URI and tried to enter the ID of a message that was not sent to you. I'm just laughing and redirecting the funny guy back... */ page_close(); Header("Location: " . $sess->url(build_good_url("/Experts/" . $userdata['Username'] . "/Messages"))); exit; } $str = ""; $str = $msg->user_interaction($http_vars); if ($str == "") { $str = $sess->url(build_good_url("/Experts/" . $userdata['Username'] . "/Messages/{$extension}") . "?t=2"); } // page_close(); // echo("aa"); header("Location: " . $str); // die("Str: $str"); // echo("a"); exit; }
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; }
$mytrail = get_node_info($PHP_SELF); } if (!is_array($mytrail)) { $mytrail = get_node_info($PATH_INFO); } if ($in_trail == 1) { //die(class_exists("Template")); if (!class_exists("Template")) { include "template.inc"; } $tpl = new Template(APPLICATION_HOME . "/templates/trail", "keep"); $tpl->set_file(array("simpleframe" => "simpleframe.html")); $tpl->set_var("CONTENT", print_loginform_trail($PHP_SELF, $this->auth["uname"], $ltrstr['Trail_Login'], $failed)); $tpl->parse("simpleframe", "simpleframe"); /* global $action, $kat; $action = $HTTP_GET_VARS['action']; $kat = $HTTP_GET_VARS['kat'];*/ //die($action); // $sess->register("kat"); $sess->register("action"); print $tpl->get("simpleframe"); } elseif ($in_trail == 2) { print msg_box($ltrstr['LOGIN'], print_loginform_trail(build_good_url($PHP_SELF), $this->auth["uname"], $ltrstr['Trail_Login_Add'], $failed), $mytrail, $mytrail['path'] . "?dologout=1", 0, $ltrstr['Back without logging in']); /*}elseif ($in_trail == 3){ print(msg_box($ltrstr['LOGIN'], print_loginform_trail(build_good_url($PHP_SELF), $this->auth["uname"], $ltrstr['Trail_Login_Sub'],$failed), $mytrail, $mytrail['path']."?dologout=1", 0, $ltrstr['Back without logging in'])); */ } elseif ($in_trail == 4) { print msg_box($ltrstr['LOGIN'], print_loginform_trail(build_good_url($PHP_SELF), $this->auth["uname"], $ltrstr['Trail_Login_Req'], $failed), $mytrail, $mytrail['path'] . "?dologout=1", 0, $ltrstr['Back without logging in']); } ?>
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'])))); } }