Esempio n. 1
0
 public static function callbackDispatch($object, $data)
 {
     // dashboard routing
     $object->append(url('^/equipment/$', patterns('controller\\Dashboard', url_get('^$', 'dashboardAction'))));
     // device management routing
     $object->append(url('^/equipment/devices/', patterns('controller\\Devices', url_get('^$', 'defaultAction'), url_get('^new', 'newFormAction'), url_post('^new', 'newSaveAction'), url_get('^delete(?P<id>\\d+)$', 'deleteAction'), url_get('^categories$', 'categoriesListAction'), url_post('^categories$', 'categoriesNewAction'), url_get('^types$', 'typesListAction'), url_post('^types$', 'typesNewAction'))));
     // checkouts routing
     $object->append(url('^/equipment/checkouts/', patterns('controller\\Checkouts', url_get('^$', 'defaultAction'), url_get('^checkout', 'checkoutFormAction'), url_post('^checkout', 'checkoutSaveAction'), url_post('^checkin$', 'checkinAction'), url_get('^(?P<id>\\d+)', 'showCheckoutAction'))));
 }
Esempio n. 2
0
function GetTbName($cookie)
{
    $name = url_get("http://tieba.baidu.com/f/user/json_userinfo", "", $cookie);
    if ($name == 'null') {
        return false;
    } else {
        return iconv("GB2312", "UTF-8", getmid($name, '"user_name_weak":"', '","'));
    }
}
Esempio n. 3
0
/**
 * Get a chunk of JSON from a given URL.
 * @param string URL
 * @param string Top-level member to retrieve
 * @return multi JSON class structure
 */
function json_url($p_url, $p_member = null)
{
    $t_data = url_get($p_url);
    $t_json = json_decode(utf8_encode($t_data));
    if (is_null($p_member)) {
        return $t_json;
    } else {
        return $t_json->{$p_member};
    }
}
Esempio n. 4
0
/**
 * Get a chunk of JSON from a given URL.
 * @param string $p_url    URL.
 * @param string $p_member Optional top-level member to retrieve.
 * @return mixed JSON class structure, false in case of non-existent member
 */
function json_url($p_url, $p_member = null)
{
    $t_data = url_get($p_url);
    $t_json = json_decode($t_data);
    if (is_null($p_member)) {
        return $t_json;
    } else {
        if (property_exists($t_json, $p_member)) {
            return $t_json->{$p_member};
        } else {
            return false;
        }
    }
}
Esempio n. 5
0
 public static function registerDispatch($dispatcher, $data)
 {
     $form_url = url('^/ajax-form/', patterns('AjaxFormController.php:AjaxFormController', url_get('^open', 'get_open'), url_post('^submit', 'post_submit')));
     $dispatcher->append($form_url);
 }
Esempio n. 6
0
 private function import_commits($p_repo, $p_uri_base, $p_commit_ids, $p_branch = '')
 {
     static $s_parents = array();
     static $s_counter = 0;
     if (is_array($p_commit_ids)) {
         $s_parents = array_merge($s_parents, $p_commit_ids);
     } else {
         $s_parents[] = $p_commit_ids;
     }
     $t_changesets = array();
     while (count($s_parents) > 0 && $s_counter < 200) {
         $t_commit_id = array_shift($s_parents);
         echo "Retrieving {$t_commit_id} ... ";
         # Handle branch names with '+' character
         $t_fixed_id = str_replace('+', '%2B', $t_commit_id);
         $t_commit_url = $this->uri_base($p_repo) . 'a=commit;h=' . $t_fixed_id;
         $t_input = url_get($t_commit_url);
         if (!$t_input) {
             echo "failed.\n";
             echo "'{$t_commit_url}' did not return any data.\n";
             die;
         }
         list($t_changeset, $t_commit_parents) = $this->commit_changeset($p_repo, $t_input, $p_branch);
         if (!is_null($t_changeset)) {
             $t_changesets[] = $t_changeset;
         }
         $s_parents = array_merge($s_parents, $t_commit_parents);
         $s_counter += 1;
     }
     $s_counter = 0;
     return $t_changesets;
 }
 private function import_commits($p_repo, $p_uri_base, $p_commit_ids, $p_branch = '')
 {
     static $s_parents = array();
     static $s_counter = 0;
     if (is_array($p_commit_ids)) {
         $s_parents = array_merge($s_parents, $p_commit_ids);
     } else {
         $s_parents[] = $p_commit_ids;
     }
     $t_changesets = array();
     while (count($s_parents) > 0 && $s_counter < 200) {
         $t_commit_id = array_shift($s_parents);
         echo "Retrieving {$t_commit_id} ... ";
         $t_commit_url = $this->uri_base($p_repo) . 'a=commit;h=' . $t_commit_id;
         $t_input = url_get($t_commit_url);
         if (false === $t_input) {
             echo "failed.\n";
             continue;
         }
         list($t_changeset, $t_commit_parents) = $this->commit_changeset($p_repo, $t_input, $p_branch);
         if (!is_null($t_changeset)) {
             $t_changesets[] = $t_changeset;
         }
         $s_parents = array_merge($s_parents, $t_commit_parents);
     }
     $s_counter = 0;
     return $t_changesets;
 }
Esempio n. 8
0
<?php

include "../../common/lib.php";
notLogin("../../login.php");
$login_name = login_name();
$row_site = site_data();
//各々のページを選んで飛んできていなかったら、一覧へ戻す
if (!isset($_GET["page_id"])) {
    url_get("../index.php");
} else {
    $page_id = $_GET["page_id"];
}
//ログインしているユーザID
$login = $_SESSION["login"];
//メッセージを表示
$m = "";
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $page_id = $_GET["page_id"];
    $m .= "<p><a href='index.php?page_id={$page_id}'>OK</a></p>";
}
//アップロードメッセージ表示
$up_m = "";
if (isset($_SESSION["up_img"])) {
    $up_m .= $_SESSION["up_img"];
    $_SESSION["up_img"] = NULL;
    $up_m .= "<p><a href='index.php?page_id={$page_id}'>OK</a></p>";
}
//ページのデータを取得
$retu = "*";
Esempio n. 9
0
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
# Override staffLoginPage() defined in staff.inc.php to return an
# HTTP/Forbidden status rather than the actual login page.
# XXX: This should be moved to the AjaxController class
function staffLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'AJAX_REQUEST', 1);
require 'staff.inc.php';
//Clean house...don't let the world see your crap.
ini_set('display_errors', '0');
//Disable error display
ini_set('display_startup_errors', '0');
//TODO: disable direct access via the browser? i,e All request must have REFER?
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'Server configuration error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/kb/', patterns('ajax.kbase.php:KbaseAjaxAPI', url_get('^canned-response/(?P<id>\\d+).(?P<format>json|txt)', 'cannedResp'), url_get('^faq/(?P<id>\\d+)', 'faq'))), url('^/content/', patterns('ajax.content.php:ContentAjaxAPI', url_get('^log/(?P<id>\\d+)', 'log'), url_get('^ticket_variables', 'ticket_variables'), url_get('^signature/(?P<type>\\w+)(?:/(?P<id>\\d+))?$', 'getSignature'), url_get('^(?P<id>\\d+)/(?:(?P<lang>\\w+)/)?manage$', 'manageContent'), url_get('^(?P<id>[\\w-]+)/(?:(?P<lang>\\w+)/)?manage$', 'manageNamedContent'), url_post('^(?P<id>\\d+)(?:/(?P<lang>\\w+))?$', 'updateContent'))), url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI', url_get('^scp', 'scp'), url_get('^links', 'templateLinks'))), url('^/form/', patterns('ajax.forms.php:DynamicFormsAjaxAPI', url_get('^help-topic/(?P<id>\\d+)$', 'getFormsForHelpTopic'), url_get('^field-config/(?P<id>\\d+)$', 'getFieldConfiguration'), url_post('^field-config/(?P<id>\\d+)$', 'saveFieldConfiguration'), url_delete('^answer/(?P<entry>\\d+)/(?P<field>\\d+)$', 'deleteAnswer'))), url('^/list/', patterns('ajax.forms.php:DynamicFormsAjaxAPI', url_get('^item/(?P<id>\\d+)/properties$', 'getListItemProperties'), url_post('^item/(?P<id>\\d+)/properties$', 'saveListItemProperties'))), url('^/report/overview/', patterns('ajax.reports.php:OverviewReportAjaxAPI', url_get('^graph$', 'getPlotData'), url_get('^table/groups$', 'enumTabularGroups'), url_get('^table/export$', 'downloadTabularData'), url_get('^table$', 'getTabularData'))), url('^/users', patterns('ajax.users.php:UsersAjaxAPI', url_get('^$', 'search'), url_get('^/local$', 'search', array('local')), url_get('^/remote$', 'search', array('remote')), url_get('^/(?P<id>\\d+)$', 'getUser'), url_post('^/(?P<id>\\d+)$', 'updateUser'), url_get('^/(?P<id>\\d+)/preview$', 'preview'), url_get('^/(?P<id>\\d+)/edit$', 'editUser'), url('^/lookup$', 'getUser'), url_get('^/lookup/form$', 'lookup'), url_post('^/lookup/form$', 'addUser'), url_get('^/add$', 'addUser'), url('^/import$', 'importUsers'), url_get('^/select$', 'selectUser'), url_get('^/select/(?P<id>\\d+)$', 'selectUser'), url_get('^/select/auth:(?P<bk>\\w+):(?P<id>.+)$', 'addRemoteUser'), url_get('^/(?P<id>\\d+)/register$', 'register'), url_post('^/(?P<id>\\d+)/register$', 'register'), url_get('^/(?P<id>\\d+)/delete$', 'delete'), url_post('^/(?P<id>\\d+)/delete$', 'delete'), url_get('^/(?P<id>\\d+)/manage(?:/(?P<target>\\w+))?$', 'manage'), url_post('^/(?P<id>\\d+)/manage(?:/(?P<target>\\w+))?$', 'manage'), url_get('^/(?P<id>\\d+)/org(?:/(?P<orgid>\\d+))?$', 'updateOrg'), url_post('^/(?P<id>\\d+)/org$', 'updateOrg'), url_get('^/staff$', 'searchStaff'), url_post('^/(?P<id>\\d+)/note$', 'createNote'), url_get('^/(?P<id>\\d+)/forms/manage$', 'manageForms'), url_post('^/(?P<id>\\d+)/forms/manage$', 'updateForms'))), url('^/orgs', patterns('ajax.orgs.php:OrgsAjaxAPI', url_get('^$', 'search'), url_get('^/search$', 'search'), url_get('^/(?P<id>\\d+)$', 'getOrg'), url_post('^/(?P<id>\\d+)$', 'updateOrg'), url_post('^/(?P<id>\\d+)/profile$', 'updateOrg', array(true)), url_get('^/(?P<id>\\d+)/edit$', 'editOrg'), url_get('^/lookup/form$', 'lookup'), url_post('^/lookup/form$', 'addOrg'), url_get('^/add$', 'addOrg'), url_post('^/add$', 'addOrg'), url_get('^/select$', 'selectOrg'), url_get('^/select/(?P<id>\\d+)$', 'selectOrg'), url_get('^/(?P<id>\\d+)/add-user(?:/(?P<userid>\\d+))?$', 'addUser'), url_get('^/(?P<id>\\d+)/add-user(?:/auth:(?P<userid>.+))?$', 'addUser', array(true)), url_post('^/(?P<id>\\d+)/add-user$', 'addUser'), url('^/(?P<id>\\d+)/import-users$', 'importUsers'), url_get('^/(?P<id>\\d+)/delete$', 'delete'), url_delete('^/(?P<id>\\d+)/delete$', 'delete'), url_post('^/(?P<id>\\d+)/note$', 'createNote'), url_get('^/(?P<id>\\d+)/forms/manage$', 'manageForms'), url_post('^/(?P<id>\\d+)/forms/manage$', 'updateForms'))), url('^/tickets/', patterns('ajax.tickets.php:TicketsAjaxAPI', url_get('^(?P<tid>\\d+)/change-user$', 'changeUserForm'), url_post('^(?P<tid>\\d+)/change-user$', 'changeUser'), url_get('^(?P<tid>\\d+)/user$', 'viewUser'), url_post('^(?P<tid>\\d+)/user$', 'updateUser'), url_get('^(?P<tid>\\d+)/preview', 'previewTicket'), url_post('^(?P<tid>\\d+)/lock$', 'acquireLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/renew', 'renewLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/release', 'releaseLock'), url_get('^(?P<tid>\\d+)/collaborators/preview$', 'previewCollaborators'), url_get('^(?P<tid>\\d+)/collaborators$', 'showCollaborators'), url_post('^(?P<tid>\\d+)/collaborators$', 'updateCollaborators'), url_get('^(?P<tid>\\d+)/add-collaborator/(?P<uid>\\d+)$', 'addCollaborator'), url_get('^(?P<tid>\\d+)/add-collaborator/auth:(?P<bk>\\w+):(?P<id>.+)$', 'addRemoteCollaborator'), url('^(?P<tid>\\d+)/add-collaborator$', 'addCollaborator'), url_get('^lookup', 'lookup'), url_get('^search', 'search'), url_get('^(?P<tid>\\d+)/forms/manage$', 'manageForms'), url_post('^(?P<tid>\\d+)/forms/manage$', 'updateForms'), url_get('^(?P<tid>\\d+)/canned-resp/(?P<cid>\\w+).(?P<format>json|txt)', 'cannedResponse'))), url('^/collaborators/', patterns('ajax.tickets.php:TicketsAjaxAPI', url_get('^(?P<cid>\\d+)/view$', 'viewCollaborator'), url_post('^(?P<cid>\\d+)$', 'updateCollaborator'))), url('^/draft/', patterns('ajax.draft.php:DraftAjaxAPI', url_post('^(?P<id>\\d+)$', 'updateDraft'), url_delete('^(?P<id>\\d+)$', 'deleteDraft'), url_post('^(?P<id>\\d+)/attach$', 'uploadInlineImage'), url_get('^(?P<namespace>[\\w.]+)$', 'getDraft'), url_post('^(?P<namespace>[\\w.]+)$', 'createDraft'), url_get('^images/browse$', 'getFileList'))), url('^/note/', patterns('ajax.note.php:NoteAjaxAPI', url_get('^(?P<id>\\d+)$', 'getNote'), url_post('^(?P<id>\\d+)$', 'updateNote'), url_delete('^(?P<id>\\d+)$', 'deleteNote'), url_post('^attach/(?P<ext_id>\\w\\d+)$', 'createNote'))), url_post('^/upgrader', array('ajax.upgrader.php:UpgraderAjaxAPI', 'upgrade')), url('^/help/', patterns('ajax.tips.php:HelpTipAjaxAPI', url_get('^tips/(?P<namespace>[\\w_.]+)$', 'getTipsJson'), url_get('^(?P<lang>[\\w_]+)?/tips/(?P<namespace>[\\w_.]+)$', 'getTipsJsonForLang'))));
Signal::send('ajax.scp', $dispatcher);
# Call the respective function
print $dispatcher->resolve($ost->get_path_info());
Esempio n. 10
0
 public static function callbackDispatch($object, $data)
 {
     $search_url = url('^/equipment.*search', patterns('controller\\EquipmentItem', url_post('^.*', 'searchAction')));
     $categories_url = url('^/equipment.*categories/', patterns('controller\\EquipmentCategory', url_get('^list$', 'listAction'), url_get('^listJson$', 'listJsonAction'), url_get('^listJsonTree$', 'listJsonTreeAction'), url_get('^view/(?P<id>\\d+)$', 'viewAction'), url_get('^openTicketsJson/(?P<item_id>\\d+)$', 'openTicketsJsonAction'), url_get('^closedTicketsJson/(?P<item_id>\\d+)$', 'closedTicketsJsonAction'), url_get('^getItemsJson/(?P<category_id>\\d+)$', 'categoryItemsJsonAction'), url_post('^save', 'saveAction'), url_post('^delete', 'deleteAction')));
     $item_url = url('^/equipment.*item/', patterns('controller\\EquipmentItem', url_get('^list$', 'listAction'), url_get('^listJson$', 'listJsonAction'), url_get('^listBelongingJson$', 'listBelongingJsonAction'), url_get('^listNotBelongingJson$', 'listNotBelongingJsonAction'), url_get('^listStaffJson$', 'listStaffJsonAction'), url_get('^view/(?P<id>\\d+)$', 'viewAction'), url_get('^new/(?P<category_id>\\d+)$', 'newAction'), url_post('^publish', 'publishAction'), url_post('^activate', 'activateAction'), url_post('^save', 'saveAction'), url_get('^openTicketsJson/(?P<item_id>\\d+)$', 'openTicketsJsonAction'), url_get('^closedTicketsJson/(?P<item_id>\\d+)$', 'closedTicketsJsonAction'), url_get('^getDynamicForm/(?P<id>\\d+)$', 'getDynamicForm'), url_post('^search', 'searchAction'), url_post('^delete', 'deleteAction'), url_post('^openNewTicket', 'openNewTicketAction')));
     $status_url = url('^/equipment.*status/', patterns('controller\\EquipmentStatus', url_get('^list$', 'listAction'), url_get('^view/(?P<id>\\d+)$', 'viewAction'), url_get('^new/(?P<category_id>\\d+)$', 'newAction'), url_get('^listJson$', 'listJsonAction'), url_get('^getItemsJson/(?P<status_id>\\d+)$', 'statusItemsJsonAction'), url_post('^save', 'saveAction'), url_post('^delete', 'deleteAction')));
     $recurring_url = url('^/equipment.*recurring/', patterns('controller\\TicketRecurring', url_get('^list$', 'listAction'), url_get('^view/(?P<id>\\d+)$', 'viewAction'), url_get('^viewByTicket/(?P<id>\\d+)$', 'viewByTicketAction'), url_get('^addByTicket/(?P<id>\\d+)$', 'addByTicketAction'), url_get('^new/(?P<category_id>\\d+)$', 'newAction'), url_get('^listJson$', 'listJsonAction'), url_get('^getItemsJson/(?P<status_id>\\d+)$', 'statusItemsJsonAction'), url_get('^listTicketsJson$', 'listTicketsJson'), url_get('^listEquipmentJson$', 'listEquipmentJson'), url_post('^save', 'saveAction'), url_post('^delete', 'deleteAction'), url_post('^enableEvents', 'enableEventsAction')));
     $maintenance_url = url('^/equipment.*maintenance/', patterns('controller\\Maintenance', url_get('^startStructureTest$', 'startDatabaseIntegrityTest'), url_get('^purgeData$', 'startDatabaseDataPurge'), url_get('^recreateDatabase', 'startDatabaseRecreate'), url_get('.*', 'defaultAction')));
     $media_url = url('^/equipment.*assets/', patterns('controller\\MediaController', url_get('^(?P<url>.*)$', 'defaultAction')));
     $dashboard_url = url('^/equipment.*dashboard/', patterns('controller\\Dashboard', url_get('^treeJson', 'treeJsonAction'), url_get('.*', 'viewAction')));
     $redirect_url = url('^/equipment.*ostroot/', patterns('controller\\MediaController', url_get('^(?P<url>.*)$', 'redirectAction')));
     $object->append($search_url);
     $object->append($media_url);
     $object->append($redirect_url);
     $object->append($maintenance_url);
     $object->append($dashboard_url);
     $object->append($categories_url);
     $object->append($item_url);
     $object->append($status_url);
     $object->append($recurring_url);
 }
Esempio n. 11
0
<?php

/*********************************************************************
    ajax.php

    Ajax utils for client interface.

    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
function clientLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'client.inc.php';
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'Server configuration error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI', url_get('^client$', 'client'))), url('^/draft/', patterns('ajax.draft.php:DraftAjaxAPI', url_post('^(?P<id>\\d+)$', 'updateDraftClient'), url_delete('^(?P<id>\\d+)$', 'deleteDraftClient'), url_post('^(?P<id>\\d+)/attach$', 'uploadInlineImageClient'), url_get('^(?P<namespace>[\\w.]+)$', 'getDraftClient'), url_post('^(?P<namespace>[\\w.]+)$', 'createDraftClient'))), url('^/form/', patterns('ajax.forms.php:DynamicFormsAjaxAPI', url_get('^help-topic/(?P<id>\\d+)$', 'getClientFormsForHelpTopic'), url_post('^upload/(\\d+)?$', 'upload'), url_post('^upload/(\\w+)?$', 'attach'))), url('^/i18n/(?P<lang>[\\w_]+)/', patterns('ajax.i18n.php:i18nAjaxAPI', url_get('(?P<tag>\\w+)$', 'getLanguageFile'))));
Signal::send('ajax.client', $dispatcher);
print $dispatcher->resolve($ost->get_path_info());
Esempio n. 12
0
    curl_setopt($ch, CURLOPT_URL, $url);
    if ($POSTcontent != "") {
        curl_setopt($ch, CURLOPT_POSTFIELDS, $POSTcontent);
    }
    if ($cookie != "") {
        curl_setopt($ch, CURLOPT_COOKIE, $cookie);
    }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_TIMEOUT, 20);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}
$url = "http://ish.z.qq.com/infocenter_v2.jsp?B_UID={$qq}&sid={$sid}&g_ut=1";
$content = url_get($url);
$zz = getmiddltxt($content, ']<a href="http://blog', '">赞');
//print_r($zz);
//echo $content;
$a = count($zz);
//echo $zz[1][0];
for ($i = 1; $i <= $a; $i++) {
    $url1 = $zz[$i - 1][0];
    $url2 = getmiddltxt($url1, ']<a href="', '">赞');
    file_get_contents(html_entity_decode($url2[0][1]));
    echo "成功";
    sleep(5);
}
if ($a == "0") {
    echo "none";
}
Esempio n. 13
0
$page_text = $_POST["page_text"];
$value .= ",page_text='{$page_text}'";
if ($_POST["page_next"] != "") {
    $page_next = $_POST["page_next"];
    $value .= ",page_next='{$page_next}'";
}
$retu .= ",page_date";
$page_date = $_POST["page_date"];
$value .= ",page_date='{$page_date}'";
//制作者は変更されない
/*$user_id = $_POST["user_id"];
$value .= ",user_id='{$user_id}'";*/
if (isset($_POST["sub0"])) {
    $value .= ",page_state='0'";
} else {
    if (isset($_POST["sub1"])) {
        $value .= ",page_state='1'";
    }
}
$rule = " WHERE page_id='{$page_id}'";
//データベースにデータを上書き
$result = update($table, $value, $rule);
$row_site = site_data();
$site_url = $row_site["site_url"];
if ($result) {
    $_SESSION["message"] = "<p>編集が完了しました。<a href='{$site_url}/page.php?page_id={$page_id}' target='_blank'>ページを確認</a></p>";
    url_get("index.php?page_id={$page_id}");
} else {
    $_SESSION["message"] = "<p>編集失敗しました。</p>";
    url_get("index.php?page_id={$page_id}");
}
Esempio n. 14
0
/*********************************************************************
    ajax.php

    Ajax utils for the installer interface.

    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/

require('setup.inc.php');

if(!defined('INCLUDE_DIR'))
    Http::response(500, __('Server configuration error'));
require_once INCLUDE_DIR.'/class.dispatcher.php';
require_once INCLUDE_DIR.'/class.ajax.php';

$dispatcher = patterns('',
    url('^/help/', patterns('ajax.tips.php:HelpTipAjaxAPI',
        url_get('^tips/(?P<namespace>[\w_.]+)$', 'getTipsJson'),
        url_get('^(?P<lang>[\w_]+)?/tips/(?P<namespace>[\w_.]+)$', 'getTipsJsonForLang')
    ))
);
print $dispatcher->resolve(Osticket::get_path_info());
?>
function input_form()
{
    global $voters, $pin;
    /*
        $proxy = url_get("https://{$voters}/EBiraciRH2/___proxy", true, $_SESSION['cookie1'], json_array(false), true);
    */
    $proxy = url_get("https://{$voters}/", true, $_GET['cookie1']);
    $captcha1 = url_get("https://{$voters}/jcaptcha?" . timezone_escape(), true, $proxy['cookie']);
    $_GET['cookie1'] = $captcha1['cookie'];
    $person = url_get("http://{$pin}/SaznajOibWeb/fizickaOsoba.html", true, $_GET['cookie2']);
    $captcha2 = url_get("http://{$pin}/SaznajOibWeb/captcha.html", true, $person['cookie']);
    $_GET['cookie2'] = $captcha2['cookie'];
    $image1 = "data:" . $captcha1['content-type'] . ";base64," . base64_encode($captcha1['content']);
    $image2 = "data:" . $captcha2['content-type'] . ";base64," . base64_encode($captcha2['content']);
    print get_auth_doc(encode_id(), $image1, $image2, $_GET['oib'], $_GET['prezime'], $_GET['captcha1'], $_GET['mbg'], $_GET['boi'], $_GET['ime'], $_GET['captcha2'], $_GET['manjina']);
}
Esempio n. 16
0
<?php

define('ROOT_PATH', dirname(__FILE__) . '/../');
require_once ROOT_PATH . './install/common.php';
if (get_magic_quotes_gpc()) {
    $_POST = stripSlash($_POST);
    $_GET = stripSlash($_GET);
    $_COOKIE = stripSlash($_COOKIE);
}
$act = url_get('act');
if ($act != '') {
    //载入函数库
    require ROOT_PATH . './install/include/function.php';
    if (function_exists($act)) {
        return call_user_func($act);
    } else {
        if (file_exists(ROOT_PATH . './install/' . $act . '.php')) {
            require ROOT_PATH . './install/' . $act . '.php';
        }
    }
} else {
    require ROOT_PATH . './install/install.php';
}
Esempio n. 17
0
<?php

include "../common/lib.php";
notLogin();
//サイドナビの該当箇所をアクティブにする
$_SESSION["active"] = "page";
$login_name = login_name();
$row_site = site_data();
$m = "";
//削除が押されたら、ページIDをpage_edit.phpに送る
if (isset($_GET["delete"])) {
    $_SESSION["del_page_id"] = $_GET["delete"];
    url_get("page_edit.php");
}
//メッセージを取得
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
//ページのデータを取得
$retu = "*";
$table = "page";
$rule = " ORDER BY page_date DESC LIMIT 0,10";
$result = call_data($retu, $table, $rule);
?>

<?php 
include "../common/header.php";
headerArea("ページの編集・削除:SetucoCMS", $row_site, $login_name);
?>
Esempio n. 18
0
<?php

include "../common/lib.php";
notLogin();
//サイドナビの該当箇所をアクティブにする
$_SESSION["active"] = "category";
$login_name = login_name();
$row_site = site_data();
$m = "";
if (isset($_GET["delete"])) {
    $_SESSION["del_cat_id"] = $_GET["delete"];
    url_get("cat_edit.php");
}
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
$retu = "*";
$table = "category";
$rule = " ORDER BY cat_name";
$result = call_data($retu, $table, $rule);
?>

<?php 
include "../common/header.php";
headerArea("カテゴリーの追加・編集・削除:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
                <div id="topicPath">
Esempio n. 19
0
    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2012 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
# Override staffLoginPage() defined in staff.inc.php to return an
# HTTP/Forbidden status rather than the actual login page.
# XXX: This should be moved to the AjaxController class
function staffLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'staff.inc.php';
//Clean house...don't let the world see your crap.
ini_set('display_errors', '0');
//Disable error display
ini_set('display_startup_errors', '0');
//TODO: disable direct access via the browser? i,e All request must have REFER?
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'config error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/kb/', patterns('ajax.kbase.php:KbaseAjaxAPI', url_get('^canned-response/(?P<id>\\d+).(?P<format>json|txt)', 'cannedResp'), url_get('^faq/(?P<id>\\d+)', 'faq'))), url('^/content/', patterns('ajax.content.php:ContentAjaxAPI', url_get('^log/(?P<id>\\d+)', 'log'), url_get('^ticket_variables', 'ticket_variables'))), url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI', url_get('^ui', 'ui'))), url_get('^/users$', array('ajax.users.php:UsersAjaxAPI', 'search')), url_get('^/tickets$', array('ajax.tickets.php:TicketsAjaxAPI', 'search')), url('^/ticket/', patterns('ajax.tickets.php:TicketsAjaxAPI', url_get('^(?P<tid>\\d+)/preview', 'previewTicket'), url_get('^(?P<tid>\\d+)/lock', 'acquireLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/renew', 'renewLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/release', 'releaseLock'))));
# Call the respective function
print $dispatcher->resolve($_SERVER['PATH_INFO']);
Esempio n. 20
0
<?php

/*********************************************************************
    ajax.php

    Ajax utils for client interface.

    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2012 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
function clientLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'client.inc.php';
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'Server configuration error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI', url_get('^client', 'client'))));
print $dispatcher->resolve($_SERVER['PATH_INFO']);
<?php

include __DIR__ . '/fun.php';
$url = 'http://homeoint.org/books2/boenchar/index.htm';
$html = url_get($url);
$html = fromtxt2txt($html, 'CONTENTS', 'by H.A. Roberts');
$a = [];
$urls = [];
if (preg_match_all('~<a href="([^"]+)"~', $html, $a)) {
    foreach ($a[1] as $i => $href) {
        if (strstr($href, '..')) {
            continue;
        }
        $url2 = dirname($url) . '/' . $href;
        if ($pos = strpos($url2, '#')) {
            $url2 = substr($url2, 0, $pos);
        }
        if (isset($urls[$url2])) {
            continue;
        }
        $urls[$url2] = true;
        echo "{$url2}\n";
        $html = url_get($url2);
    }
}
Esempio n. 22
0
<?php

header("Content-type: text/html; charset=utf-8");
$content = "你是个sb";
$cookies = "BDUSS=Vk5UDh2a0dVMkppaU9iWWFLdTdqNXQ0VjZHVkJGMk14dWRSMS0yY0JPY3dvYnhWQVFBQUFBJCQAAAAAAAAAAAEAAADUWMIONb~p08PSu7j21MIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAUlVUwFJVVL";
$rs = url_get('https://sp0.baidu.com/yLsHczq6KgQFm2e88IuM_a/s?sample_name=bear_brain&request_query=' . $content . '&bear_type=2', "", $cookies);
echo $rs;
//preg_match('/answer\\":\\"([\S\s]+)",\\"question/',$rs,$re)
//echo $re;
function url_get($url, $POSTcontent = "", $cookie = "")
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    if ($POSTcontent != "") {
        curl_setopt($ch, CURLOPT_POSTFIELDS, $POSTcontent);
    }
    if ($cookie != "") {
        curl_setopt($ch, CURLOPT_COOKIE, $cookie);
    }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 20);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}
function getmid($txt, $left, $right)
{
    preg_match_all("{" . $left . "(.*?)" . $right . "}", $txt, $data, PREG_SET_ORDER);
    return $data[0][1];
}
Esempio n. 23
0
    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2012 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
# Override staffLoginPage() defined in staff.inc.php to return an
# HTTP/Forbidden status rather than the actual login page.
# XXX: This should be moved to the AjaxController class
function staffLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'staff.inc.php';
//Clean house...don't let the world see your crap.
ini_set('display_errors', '0');
//Disable error display
ini_set('display_startup_errors', '0');
//TODO: disable direct access via the browser? i,e All request must have REFER?
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'Server configuration error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/kb/', patterns('ajax.kbase.php:KbaseAjaxAPI', url_get('^canned-response/(?P<id>\\d+).(?P<format>json|txt)', 'cannedResp'), url_get('^faq/(?P<id>\\d+)', 'faq'))), url('^/content/', patterns('ajax.content.php:ContentAjaxAPI', url_get('^log/(?P<id>\\d+)', 'log'), url_get('^ticket_variables', 'ticket_variables'))), url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI', url_get('^scp', 'scp'))), url('^/report/overview/', patterns('ajax.reports.php:OverviewReportAjaxAPI', url_get('^graph$', 'getPlotData'), url_get('^table/groups$', 'enumTabularGroups'), url_get('^table/export$', 'downloadTabularData'), url_get('^table$', 'getTabularData'))), url_get('^/users$', array('ajax.users.php:UsersAjaxAPI', 'search')), url('^/tickets/', patterns('ajax.tickets.php:TicketsAjaxAPI', url_get('^(?P<tid>\\d+)/preview', 'previewTicket'), url_post('^(?P<tid>\\d+)/lock', 'acquireLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/renew', 'renewLock'), url_post('^(?P<tid>\\d+)/lock/(?P<id>\\d+)/release', 'releaseLock'), url_get('^lookup', 'lookup'), url_get('^search', 'search'))), url_post('^/upgrader', array('ajax.upgrader.php:UpgraderAjaxAPI', 'upgrade')));
# Call the respective function
print $dispatcher->resolve($_SERVER['PATH_INFO']);
Esempio n. 24
0
<?php

include "../common/lib.php";
notLogin();
//サイドナビの該当箇所をアクティブにする
$_SESSION["active"] = "tag";
$login_name = login_name();
$row_site = site_data();
$m = "";
if (isset($_GET["delete"])) {
    $_SESSION["del_tag_id"] = $_GET["delete"];
    url_get("tag_edit.php");
}
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
$retu = "*";
$table = "tag";
$rule = " ORDER BY tag_name";
$result = call_data($retu, $table, $rule);
$num = mysql_num_rows($result);
?>

<?php 
include "../common/header.php";
headerArea("タグの追加・編集・削除:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
Esempio n. 25
0
        url_get('^(?P<namespace>[\w.]+)$', 'getDraft'),
        url_post('^(?P<namespace>[\w.]+)$', 'createDraft'),
        url_get('^images/browse$', 'getFileList')
    )),
    url('^/note/', patterns('ajax.note.php:NoteAjaxAPI',
        url_get('^(?P<id>\d+)$', 'getNote'),
        url_post('^(?P<id>\d+)$', 'updateNote'),
        url_delete('^(?P<id>\d+)$', 'deleteNote'),
        url_post('^attach/(?P<ext_id>\w\d+)$', 'createNote')
    )),
    url('^/sequence/', patterns('ajax.sequence.php:SequenceAjaxAPI',
        url_get('^(?P<id>\d+)$', 'current'),
        url_get('^manage$', 'manage'),
        url_post('^manage$', 'manage')
    )),
    url_post('^/upgrader', array('ajax.upgrader.php:UpgraderAjaxAPI', 'upgrade')),
    url('^/help/', patterns('ajax.tips.php:HelpTipAjaxAPI',
        url_get('^tips/(?P<namespace>[\w_.]+)$', 'getTipsJson'),
        url_get('^(?P<lang>[\w_]+)?/tips/(?P<namespace>[\w_.]+)$', 'getTipsJsonForLang')
    )),
    url('^/i18n/(?P<lang>[\w_]+)/', patterns('ajax.i18n.php:i18nAjaxAPI',
        url_get('(?P<tag>\w+)$', 'getLanguageFile')
    ))
);

Signal::send('ajax.scp', $dispatcher);

# Call the respective function
print $dispatcher->resolve($ost->get_path_info());
?>
Esempio n. 26
0
// 引入simple_html_dom库
include 'simple_html_dom/simple_html_dom.php';
//数据库连接
include 'conn.php';
//脚本执行时间统计
include 'timer.class.php';
//new一个timer对象并且start开始计算脚本执行时间
$timer = new Timer();
$timer->start();
$cookie = 'xxxxxxxxxxxxxxxxxxxxxx';
//请输入登录蓝桥杯官网之后在*.lanqiao.org域下的完整cookie
// 新建一个Dom实例
$html = new simple_html_dom();
// exit(url_get('http://lx.lanqiao.org/problem.page?gpid=T1','',$cookie));
for ($i = 1; $i < 360; $i++) {
    $html->load(url_get('http://lx.lanqiao.org/problem.page?gpid=T' . $i, '', $cookie));
    if (!$html->find('div.tit', 0)) {
        continue;
        //如果当前题目无法查看就跳过
    }
    $链接 = 'http://lx.lanqiao.org/problem.page?gpid=T' . $i;
    $标题 = trim(strip_tags($html->find('div.tit', 0)));
    $内容 = trim($html->find('div.des', 0));
    $限定 = trim(strip_tags($html->find('div.res', 0)));
    $锦囊1 = trim(strip_tags($html->find('div.helpcont', 0)));
    $锦囊2 = trim(strip_tags($html->find('div.helpcont', 1)));
    $锦囊3 = trim(strip_tags($html->find('div.helpcont', 2)));
    // exit($html->find('div.des',0));
    $sql = "INSERT INTO lanqiao_spider_changwei (lanqiao_href,lanqiao_title,lanqiao_content,lanqiao_limit,lanqiao_help1,lanqiao_help2,lanqiao_help3) VALUES ('{$链接}','{$标题}','{$内容}','{$限定}','{$锦囊1}','{$锦囊2}','{$锦囊3}')";
    mysql_query($sql);
    echo mysql_errno() . '-' . mysql_error();
Esempio n. 27
0
    $page_id = $_POST["page_id"];
    $result_t = call_data("page_title", "page", " WHERE page_id='{$page_id}'");
    $row_t = mysql_fetch_array($result_t);
    $result = update("page", "cat_id='{$cat_new}'", " WHERE page_id='{$page_id}'");
    if ($result) {
        $m .= "<p>「{$row_t[0]}」のカテゴリーを変更しました。</p>";
    } else {
        if ($result) {
            $m .= "<p>変更失敗しました。</p>";
        }
    }
    $_SESSION["message"] = $m;
    url_get("index.php");
}
//公開状態の変更
if ($_POST["sub"] == "保存") {
    $state_new = $_POST["state_new"];
    $edit_page_id = $_POST["edit_page_id"];
    $result = update("page", "page_state='{$state_new}'", " WHERE page_id='{$edit_page_id}'");
    $result_t = call_data("page_title", "page", " WHERE page_id='{$edit_page_id}'");
    $row_t = mysql_fetch_array($result_t);
    if ($result) {
        $m .= "<p>「{$row_t[0]}」の公開状態を変更しました。</p>";
    } else {
        if ($result) {
            $m .= "<p>変更失敗しました。</p>";
        }
    }
    $_SESSION["message"] = $m;
    url_get("index.php");
}
Esempio n. 28
0
function install_sql()
{
    global $db_pre;
    //安装配置信息
    $db_address = url_get('db_address');
    $db_user = url_get('db_user');
    $db_pwd = url_get('db_pwd');
    $db_name = url_get('db_name');
    $db_pre = url_get('db_pre');
    $admin_user = url_get('admin_user');
    $admin_pwd = url_get('admin_pwd');
    $install_type = url_get('install_type');
    //链接mysql数据库
    $mysql_link = @mysql_connect($db_address, $db_user, $db_pwd);
    if (!$mysql_link) {
        showProgress(array('isError' => true, 'message' => 'mysql链接失败' . mysql_error()));
    }
    //检测SQL安装文件
    $sql_file = ROOT_PATH . './install/iwebshop.sql';
    if (!file_exists($sql_file)) {
        showProgress(array('isError' => true, 'message' => '安装的SQL文件' . basename($sql_file) . '不存在'));
    }
    //检测测试数据SQL文件
    $sql_test_file = ROOT_PATH . './install/iwebshop_test.sql';
    if ($install_type == 'all' && !file_exists($sql_test_file)) {
        showProgress(array('isError' => true, 'message' => '测试数据SQL文件' . basename($sql_test_file) . '不存在'));
    }
    //执行SQL,创建数据库操作
    mysql_query("set names 'UTF8'");
    if (!@mysql_select_db($db_name)) {
        $DATABASESQL = '';
        if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
            $DATABASESQL = "DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
        }
        if (!mysql_query('CREATE DATABASE `' . $db_name . '` ' . $DATABASESQL)) {
            showProgress(array('isError' => true, 'message' => '用户权限受限,创建' . $db_name . '数据库失败,请手动创建数据表'));
        }
    }
    if (!@mysql_select_db($db_name)) {
        showProgress(array('isError' => true, 'message' => $db_name . '数据库不存在' . mysql_error()));
    }
    //安装SQL
    parseSQL($sql_file);
    //安装测试数据
    if ($install_type == 'all') {
        parseSQL($sql_test_file);
    }
    //插入管理员数据
    $adminSql = 'insert into `' . $db_pre . 'admin` (`admin_name`,`password`,`role_id`,`create_time`) values ("' . $admin_user . '","' . md5($admin_pwd) . '",0,"' . date('Y-m-d H:i:s') . '")';
    if (!mysql_query($adminSql)) {
        showProgress(array('isError' => true, 'message' => '创建管理员失败' . mysql_error(), 'percent' => 0.9));
    }
    //写入配置文件
    $configDefFile = ROOT_PATH . './config/config_default.php';
    $configFile = ROOT_PATH . './config/config.php';
    $updateData = array('{TABLE_PREFIX}' => $db_pre, '{DB_R_ADDRESS}' => $db_address, '{DB_R_USER}' => $db_user, '{DB_R_PWD}' => $db_pwd, '{DB_R_NAME}' => $db_name, '{DB_W_ADDRESS}' => $db_address, '{DB_W_USER}' => $db_user, '{DB_W_PWD}' => $db_pwd, '{DB_W_NAME}' => $db_name, '{ENCRYPTKEY}' => md5(rand(1000000000, 9999999999)));
    $is_success = create_config($configFile, $configDefFile, $updateData);
    if (!$is_success) {
        showProgress(array('isError' => true, 'message' => '更新配置文件失败', 'percent' => 0.9));
    }
    //修改index.php首页
    $index_file = ROOT_PATH . './index.php';
    $index_content = '<?php
$iweb = dirname(__FILE__)."/lib/iweb.php";
$config = dirname(__FILE__)."/config/config.php";
require($iweb);
IWeb::createWebApp($config)->run();
?>';
    $is_success = file_put_contents($index_file, $index_content);
    if (!$is_success) {
        showProgress(array('isError' => true, 'message' => '生成index.php页面出错', 'percent' => 0.9));
    }
    //执行完毕
    showProgress(array('isError' => false, 'message' => '安装完成', 'percent' => 1));
}
Esempio n. 29
0
<?php

/*********************************************************************
    ajax.php

    Ajax utils for the installer interface.

    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require 'setup.inc.php';
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'Server configuration error');
}
require_once INCLUDE_DIR . '/class.dispatcher.php';
require_once INCLUDE_DIR . '/class.ajax.php';
$dispatcher = patterns('', url('^/help/', patterns('ajax.tips.php:HelpTipAjaxAPI', url_get('^tips/(?P<namespace>[\\w_.]+)$', 'getTipsJson'), url_get('^(?P<lang>[\\w_]+)?/tips/(?P<namespace>[\\w_.]+)$', 'getTipsJsonForLang'))));
print $dispatcher->resolve(Osticket::get_path_info());
Esempio n. 30
0
    Peter Rotich <*****@*****.**>
    Copyright (c)  2006-2012 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
# Override staffLoginPage() defined in staff.inc.php to return an
# HTTP/Forbidden status rather than the actual login page.
# XXX: This should be moved to the AjaxController class
function staffLoginPage($msg = 'Unauthorized')
{
    Http::response(403, 'Must login: '******'staff.inc.php';
//Clean house...don't let the world see your crap.
ini_set('display_errors', '0');
//Disable error display
ini_set('display_startup_errors', '0');
//TODO: disable direct access via the browser? i,e All request must have REFER?
if (!defined('INCLUDE_DIR')) {
    Http::response(500, 'config error');
}
require_once INCLUDE_DIR . "/class.dispatcher.php";
require_once INCLUDE_DIR . "/class.ajax.php";
$dispatcher = patterns("", url("^/kb/", patterns("ajax.kbase.php:KbaseAjaxAPI", url_get("^canned-response/(?P<id>\\d+).(?P<format>json|txt)", "cannedResp"), url_get("^faq/(?P<id>\\d+)", "faq"))), url("^/content/", patterns("ajax.content.php:ContentAjaxAPI", url_get("^log/(?P<id>\\d+)", 'log'), url_get("^ticket_variables", 'ticket_variables'))), url("^/config/", patterns("ajax.config.php:ConfigAjaxAPI", url_get("^ui", 'ui'))), url_get("^/ticket\$", array("ajax.tickets.php:TicketsAjaxAPI", "search")), url("^/ticket/", patterns("ajax.tickets.php:TicketsAjaxAPI", url_get("^(?P<tid>\\d+)/preview", "previewTicket"), url_get("^(?P<tid>\\d+)/lock", "acquireLock"), url_post("^(?P<tid>\\d+)/lock/(?P<id>\\d+)/renew", "renewLock"), url_post("^(?P<tid>\\d+)/lock/(?P<id>\\d+)/release", "releaseLock"))));
# Call the respective function
print $dispatcher->resolve($_SERVER['PATH_INFO']);