Author: ralfbecker
New Revision: 55434
URL: http://svn.stylite.de/viewvc/egroupware?rev=55434&view=rev
Log:
allow api as app like home for everyone, and implement calling of namespaced class-names from EGroupware namespace in index.php and json.php
Modified:
trunk/egroupware/index.php
trunk/egroupware/json.php
trunk/phpgwapi/inc/class.egw.inc.php
trunk/phpgwapi/inc/common_functions.inc.php
— trunk/egroupware/index.php (original)
+++ trunk/egroupware/index.php Sat Mar 19 16:24:36 2016
@@ -34,10 +34,20 @@
/*
This is the menuaction driver for the multi-layered design
*/
-if(isset($GET[‘menuaction’]) && preg_match(’/^[A-Za-z0-9]+.[A-Za-z0-9_]+.[A-Za-z0-9_]+$/’,$GET[‘menuaction’]))
+if(isset($GET[‘menuaction’]) && preg_match(’/^[A-Za-z0-9]+.[A-Za-z0-9\\]+.[A-Za-z0-9_]+$/’,$_GET[‘menuaction’]))
{
list($app,$class,$method) = explode(’.’,$_GET[‘menuaction’]);
- if(! $app || ! $class || ! $method)
-
- // check if autoloadable class belongs to given app
- if (substr($class, 0, 11) == ‘EGroupware\’)
- {
-
list(,$app_from_class) = explode('\\', strtolower($class));
- }
- elseif(strpos($class, ‘_’) !== false)
- {
-
list($app_from_class) = explode('_', $class);
- }
- if(!$app || !$class || !$method || isset($app_from_class) && $app_from_class != $app)
{
$invalid_data = True;
}
@@ -62,9 +72,6 @@
)
);
include(’./header.inc.php’);
-// check if users are supposed to change their password every x sdays, then check if password is of old age or the devil-admin reset the users password
-// and forced the user to change his password on next login.
-auth::check_password_age($app,$class,$method);
// user changed timezone
if (isset($_GET[‘tz’]))
@@ -130,7 +137,14 @@
$app = ‘phpgwapi’;
}
- $obj = CreateObject($app.’.’.$class);
— trunk/egroupware/json.php (original)
+++ trunk/egroupware/json.php Sat Mar 19 16:24:36 2016
@@ -71,7 +71,15 @@
if (strpos($_GET[‘menuaction’],’::’) !== false && strpos($_GET[‘menuaction’],’.’) === false) // static method name app_something::method
{
@list($className,$functionName,$handler) = explode(’::’,$_GET[‘menuaction’]);
-
-
if (substr($className, 0, 11) == 'EGroupware\\')
-
{
-
list(,$appName) = explode('\\', strtolower($className));
-
}
-
else
-
{
-
list($appName) = explode('_',$className);
-
}
}
else
{
— trunk/phpgwapi/inc/class.egw.inc.php (original)
+++ trunk/phpgwapi/inc/class.egw.inc.php Sat Mar 19 16:24:36 2016
@@ -350,7 +350,7 @@
{
$this->currentapp = $GLOBALS[‘egw_info’][‘flags’][‘currentapp’]; // some apps change it later
-
if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('api', 'home'))) // give everyone implicit home rights
{
// This will need to use ACL in the future
if (!$GLOBALS['egw_info']['user']['apps'][$currentapp = $GLOBALS['egw_info']['flags']['currentapp']] ||
— trunk/phpgwapi/inc/common_functions.inc.php (original)
+++ trunk/phpgwapi/inc/common_functions.inc.php Sat Mar 19 16:24:36 2016
@@ -985,7 +985,7 @@
-
@param $p1,$p2,… class parameters (all optional)
-
@return object reference to an object
*/
-function &CreateObject($class)
+function CreateObject($class)
{
list($appname,$classname) = explode(’.’,$class);
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs