mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Studienordnung Entwurf
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2013 fhcomplete.org
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
* Authors: Andreas Österreicher <[email protected]>
|
||||
*/
|
||||
/**
|
||||
* Aufruf: fhcomplete.php?class=benutzer&method=search&typ=json¶meter_0=österreicher
|
||||
*/
|
||||
header( 'Expires: -1' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||
header( 'Pragma: no-cache' );
|
||||
header('Content-Type: text/html;charset=UTF-8');
|
||||
|
||||
$class = $_REQUEST['class'];
|
||||
$method = $_REQUEST['method'];
|
||||
$typ = (isset($_REQUEST['typ'])?$_REQUEST['typ']:'');
|
||||
|
||||
// die einzelnen funktionsparameter werden durchnummeriert mit 0 beginnend:
|
||||
// parameter_0=param0¶meter_1=param1¶meter_3[0]=param3arr0¶meter_3[1]=param3arr1
|
||||
$parameter=array();
|
||||
for($i=0;$i<100;$i++)
|
||||
{
|
||||
if(isset($_REQUEST['parameter_'.$i]))
|
||||
$parameter[]=$_REQUEST['parameter_'.$i];
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/webservicerecht.class.php');
|
||||
require_once('../include/'.$class.'.class.php');
|
||||
|
||||
// Berechtigung pruefen
|
||||
$uid = get_uid();
|
||||
|
||||
// TODO Klasse pruefen und nicht nur die Methode
|
||||
$wsrecht = new webservicerecht();
|
||||
if(!$wsrecht->isUserAuthorized($uid, $method))
|
||||
die('Sie haben keine Berechtigung fuer diesen Vorgang');
|
||||
|
||||
// Funktion aufrufen
|
||||
$obj = new $class();
|
||||
if(call_user_func_array(array($obj, $method), $parameter))
|
||||
{
|
||||
$data['result']=$obj->cleanResult();
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['result']='';
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$obj->errormsg;
|
||||
}
|
||||
|
||||
// Daten ausgeben
|
||||
if($typ=='json')
|
||||
echo json_encode($data);
|
||||
elseif($typ=='xml')
|
||||
echo array_to_xml($data);
|
||||
else
|
||||
var_dump($data);
|
||||
?>
|
||||
Reference in New Issue
Block a user