Esempio n. 1
0
 public function handle_request($_method = NULL, $_params = NULL)
 {
     //print "DEBUG: handle_request<br/>\n";
     // Import query string and anything posted
     $this->query_string = $_SERVER['PATH_INFO'];
     $raw = file_get_contents('php://input');
     // Deserialize the "raw" data
     $data = $this->deserialize_request($raw);
     $p = $this->extract_parameters($data, $_REQUEST);
     //syslog(LOG_INFO, "params = ".serialize($p));
     // Figure method
     $method = isset($data['method']) ? $data['method'] : $_method;
     // Determine if this is okay to do, based on the namespace
     if (substr($method, 0, 27) != 'org.freemedsoftware.public.') {
         if (!CallMethod('org.freemedsoftware.public.Login.LoggedIn')) {
             syslog(LOG_INFO, "Access attempt for '{$method}' denied due to user not being logged in");
             return 'INVALID_SESSION';
             trigger_error("Access attempt for '{$method}' denied due to user not being logged in", E_USER_ERROR);
         }
     }
     // TODO: call appropriate method:
     // $output = CallMethod ( $data['method'], $data['params'] );
     $output = @call_user_func_array('CallMethod', array_merge(array($method), $p));
     // Reserialize and return the appropriate data
     return $this->serialize_response($output);
 }
Esempio n. 2
0
function smarty_function_method($params, &$smarty)
{
    if (!isset($params['namespace'])) {
        $smarty->trigger_error("Namespace not specified");
    }
    if (isset($params['param'])) {
        $x = call_user_func_array('CallMethod', array($params['namespace'], $params['param']));
    } elseif (isset($params['param0'])) {
        // Use param1 ... paramN
        foreach ($params as $k => $v) {
            if (substr($k, 0, 5) == 'param') {
                $key = substr($k, 5, strlen($k) - 5);
                if ($key == '0' or $key + 0 > 0) {
                    $r[$key + 0] = $v;
                }
            }
            // end if substr(param)
        }
        // end foreach
        ksort($r);
        $x = call_user_func_array('CallMethod', array_merge(array($params['namespace']), $r));
    } else {
        $x = CallMethod($params['namespace']);
    }
    // Handle optional variable return policy
    if ($params['var']) {
        $smarty->assign($params['var'], $x);
    } else {
        return $x;
    }
}
Esempio n. 3
0
function tm($method, $params = NULL)
{
    if (is_array($params)) {
        t($method, call_user_func_array('CallMethod', array_merge(array($method), $params)));
    } else {
        t($method, CallMethod($method));
    }
}
 protected function checkAuthenticationPolicy($methodName)
 {
     // Return false if attempting to access core namespace
     if (strpos($methodName, 'org.freemedsoftware.core.') !== false) {
         return false;
     }
     // Always allow public methods
     if (strpos($methodName, 'org.freemedsoftware.gwt.client.Public') !== false) {
         return true;
     }
     if (strpos($methodName, 'org.freemedsoftware.public.') !== false) {
         return true;
     }
     // Check authentication
     if (CallMethod('org.freemedsoftware.public.Login.LoggedIn') == false) {
         syslog(LOG_INFO, "Not logged in, failing checkAuthenticationPolicy");
         return false;
     }
     // Default to returning "true"
     return true;
 }
 public function action()
 {
     switch ($_REQUEST['piece']) {
         case 'links':
             $this->load('org.freemedsoftware.ui.mainframe.' . $_REQUEST['piece']);
             break;
         case 'defaultpane':
             $dailyAppointmentsDate = $this->import_date("dailyAppointmentsDate", date('Y-m-d'));
             $this->smarty->assign('dailyAppointmentsDate', $this->export_date($dailyAppointmentsDate));
             $this->smarty->assign('dailyCalendar', CallMethod('org.freemedsoftware.api.Scheduler.GetDailyAppointments', $dailyAppointmentsDate));
             $this->load('org.freemedsoftware.ui.mainframe.' . $_REQUEST['piece']);
             break;
         default:
             if (file_exists(dirname(__FILE__) . '/../../.svn/entries')) {
                 $this->smarty->assign('svnVersion', trim(`svn info | grep Revision | cut -d: -f2`));
             } else {
                 $this->smarty->assign('svnVersion', '');
             }
             $this->load('org.freemedsoftware.ui.mainframe');
             break;
     }
 }
Esempio n. 6
0
File: acl.php Progetto: rrsc/freemed
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t("org.freemedsoftware.module.ACL.GetUserGroups", CallMethod("org.freemedsoftware.module.ACL.UserGroups"));
$x = CreateObject('org.freemedsoftware.acl.gacl_api', array('db_type' => 'mysql', 'db_host' => DB_HOST, 'db_user' => DB_USER, 'db_password' => DB_PASSWORD, 'db_name' => DB_NAME, 'db_table_prefix' => 'acl_', 'debug' => false, 'caching' => true, 'force_cache_expire' => true, 'cache_expire_time' => 600));
print_r($x->get_group_objects(11, 'ARO'));
Esempio n. 7
0
 public function Multicall($calls)
 {
     if (!is_array($calls)) {
         return false;
     }
     $output = array();
     foreach ($calls as $k => $v) {
         $v = (array) $v;
         if (substr($v['method'], 0, 25) == 'org.freemedsoftware.core.') {
             syslog(LOG_ERR, "Invalid method called {$v['method']}");
             return false;
         }
         if (is_array($v['parameters'])) {
             $output[$k] = @call_user_func_array('CallMethod', array_merge(array($v['method']), $v['parameters']));
         } else {
             $output[$k] = @CallMethod($v['method']);
         }
     }
     return $output;
 }
Esempio n. 8
0
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t("org.freemedsoftware.api.Agata7.GetReports", CallMethod("org.freemedsoftware.api.Agata7.GetReports"));
Esempio n. 9
0
#!/usr/bin/env php
<?php 
// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t('org.freemedsoftware.module.PatientTag.CreateTag', CallMethod('org.freemedsoftware.module.PatientTag.CreateTag', 1, 'test'));
t('org.freemedsoftware.module.PatientTag.CreateTag', CallMethod('org.freemedsoftware.module.PatientTag.CreateTag', 1, 'also'));
t('org.freemedsoftware.module.PatientTag.SimpleTagSearch', CallMethod('org.freemedsoftware.module.PatientTag.SimpleTagSearch', 'test'));
t('org.freemedsoftware.module.PatientTag.AdvancedTagSearch', CallMethod('org.freemedsoftware.module.PatientTag.AdvancedTagSearch', 'test', array(array('tag' => 'also', 'operator' => 'AND'))));
t('org.freemedsoftware.module.PatientTag.ExpireTag', CallMethod('org.freemedsoftware.module.PatientTag.ExpireTag', 1, 'test'));
t('org.freemedsoftware.module.PatientTag.ExpireTag', CallMethod('org.freemedsoftware.module.PatientTag.ExpireTag', 1, 'also'));
Esempio n. 10
0
 public function _setup()
 {
     //syslog(LOG_INFO, get_class($this)." : _setup()");
     if (!$this->create_table()) {
         return false;
     }
     //syslog(LOG_INFO, get_class($this)." : done with create_table");
     $c = $GLOBALS['sql']->queryOne("SELECT COUNT(*) FROM " . $this->table_name);
     if ($c > 0) {
         return false;
     }
     return CallMethod('org.freemedsoftware.api.TableMaintenance.ImportStockData', $this->table_name);
 }
Esempio n. 11
0
 public function _setup()
 {
     if (!$this->create_table()) {
         return false;
     }
     $c = $GLOBALS['sql']->queryOne("SELECT COUNT(*) FROM " . $this->table_name);
     if ($c > 0) {
         return false;
     }
     return CallMethod('org.freemedsoftware.api.TableMaintenance.ImportStockData', $this->table_name);
 }
Esempio n. 12
0
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
//t('org.freemedsoftware.module.ProgressNotes.RenderSinglePDF', CallMethod('org.freemedsoftware.module.ProgressNotes.RenderSinglePDF', '7'));
t('org.freemedsoftware.module.Prescription.RenderToPDF', CallMethod('org.freemedsoftware.module.Prescription.RenderToPDF', '2874', true));
Esempio n. 13
0
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t("resolve_module(systemreports)", resolve_module('systemreports'));
t("freemed::module_handler(useradd)", freemed::module_handler('UserAdd'));
#t("resolveobjectpath(org.freemedsoftware.module.systemreports)", ResolveObjectPath('org.freemedsoftware.module.systemreports'));
#t("resolveclassname(org.freemedsoftware.module.systemreports.view)", ResolveClassName('org.freemedsoftware.module.systemreports.view'));
#t("resolvemethodname(org.freemedsoftware.module.systemreports.view)", ResolveMethodName('org.freemedsoftware.module.systemreports.view'));
t('org.freemedsoftware.module.zipcodes.CalculateDistance', CallMethod('org.freemedsoftware.module.zipcodes.CalculateDistance', '06226', '03743'));
Esempio n. 14
0
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
//t("org.freemedsoftware.api.Messages.send", CallMethod('org.freemedsoftware.api.Messages.send', array('system' => 1, 'user' => 1, 'patient' => 1, 'subject' => 'Regression test', 'text' => 'This is a test of the regression testing mechanism for FreeMED\'s messaging system.')));
//t("org.freemedsoftware.api.Messages.view", CallMethod('org.freemedsoftware.api.Messages.view'));
t("org.freemedsoftware.module.MessagesModule.add", CallMethod('org.freemedsoftware.module.MessagesModule.add', array('msgsubject' => 'subject', 'msgperson' => 'test', 'msgby' => 1, 'msgto' => 1)));
Esempio n. 15
0
    unset($controller_name);
    include_once dirname(__FILE__) . "/ui/" . strtolower($layout) . "/controller/controller.default.php";
    $controller_name = 'controller_default';
    $controller = new ${controller_name}();
    if (CallMethod('org.freemedsoftware.public.Login.LoggedIn')) {
        $controller->action($piece);
    } else {
        session_regenerate_id();
        $controller->load_default();
    }
    exit;
}
unset($controller);
unset($controller_name);
include_once dirname(__FILE__) . "/ui/" . strtolower($layout) . "/controller/controller.{$piece}.php";
$controller_name = 'controller_' . str_replace('.', '_', $piece);
$controller = new ${controller_name}();
if (CallMethod('org.freemedsoftware.public.Login.LoggedIn')) {
    $controller->action();
} else {
    $controller->load_default();
}
//----------------- Functions ----------------------------------------------
function controller_standard_error_handler($no, $str, $file, $line, $context)
{
    switch ($no) {
        case E_USER_ERROR:
            die("{$file} [{$line}] : {$str}");
            break;
    }
}
Esempio n. 16
0
<?php

// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t("org.freemedsoftware.api.PatientInterface.picklist", CallMethod("org.freemedsoftware.api.PatientInterface.picklist", 'john'));
t("org.freemedsoftware.api.PatientInterface.ProceduresToBill", CallMethod("org.freemedsoftware.api.PatientInterface.ProceduresToBill"));
t("org.freemedsoftware.api.PatientInterface.ToText", CallMethod("org.freemedsoftware.api.PatientInterface.ToText", 1));
t("org.freemedsoftware.api.PatientInterface.EmrModules", CallMethod("org.freemedsoftware.api.PatientInterface.EmrModules"));
Esempio n. 17
0
#!/usr/bin/env php
<?php 
// $Id$
//
// Authors:
//      Jeff Buchbinder <*****@*****.**>
//
// FreeMED Electronic Medical Record and Practice Management System
// Copyright (C) 1999-2012 FreeMED Software Foundation
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include_once dirname(__FILE__) . '/bootstrap.test.php';
t("org.freemedsoftware.api.Remitt.getProtocolVersion", CallMethod('org.freemedsoftware.api.Remitt.getProtocolVersion'));
t("org.freemedsoftware.api.Remitt.listPlugins (render)", CallMethod('org.freemedsoftware.api.Remitt.listPlugins', 'render'));
t("org.freemedsoftware.api.Remitt.listPlugins (transport)", CallMethod('org.freemedsoftware.api.Remitt.listPlugins', 'transport'));
t("org.freemedsoftware.api.Remitt.listOptions", CallMethod('org.freemedsoftware.api.Remitt.listOptions', 'render', 'org.remitt.plugin.render.XsltPlugin'));