mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
fix code formating, add license if missing
This commit is contained in:
parent
4f4f3923b9
commit
d70a6c79b3
|
@ -1,4 +1,35 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MyDMS. Document Management System
|
||||||
|
* Copyright (C) 2002-2005 Markus Westphal
|
||||||
|
* Copyright (C) 2006-2008 Malcolm Cowe
|
||||||
|
* Copyright (C) 2010 Matteo Lucarelli
|
||||||
|
* Copyright (C) 2010-2024 Uwe Steinmann
|
||||||
|
*
|
||||||
|
* PHP version 8
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @category SeedDMS
|
||||||
|
* @package SeedDMS
|
||||||
|
* @author Uwe Steinmann <info@seeddms.org>
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||||
|
* @link https://www.seeddms.org Main Site
|
||||||
|
*/
|
||||||
|
|
||||||
/* Middleware for authentication based on session */
|
/* Middleware for authentication based on session */
|
||||||
class SeedDMS_Auth_Middleware_Session { /* {{{ */
|
class SeedDMS_Auth_Middleware_Session { /* {{{ */
|
||||||
|
|
||||||
|
@ -23,8 +54,9 @@ class SeedDMS_Auth_Middleware_Session { /* {{{ */
|
||||||
$settings = $this->container->config;
|
$settings = $this->container->config;
|
||||||
$logger = $this->container->logger;
|
$logger = $this->container->logger;
|
||||||
$userobj = null;
|
$userobj = null;
|
||||||
if($this->container->has('userobj'))
|
if ($this->container->has('userobj')) {
|
||||||
$userobj = $this->container->userobj;
|
$userobj = $this->container->userobj;
|
||||||
|
}
|
||||||
|
|
||||||
if ($userobj) {
|
if ($userobj) {
|
||||||
$response = $next($request, $response);
|
$response = $next($request, $response);
|
||||||
|
@ -50,17 +82,20 @@ class SeedDMS_Auth_Middleware_Session { /* {{{ */
|
||||||
/* Delete Cookie */
|
/* Delete Cookie */
|
||||||
setcookie("mydms_session", $dms_session, time() - 3600, $settings->_httpRoot);
|
setcookie("mydms_session", $dms_session, time() - 3600, $settings->_httpRoot);
|
||||||
if ($settings->_enableGuestLogin) {
|
if ($settings->_enableGuestLogin) {
|
||||||
if(!($userobj = $dms->getUser($settings->_guestID)))
|
if (!($userobj = $dms->getUser($settings->_guestID))) {
|
||||||
return $response->withStatus(403);
|
return $response->withStatus(403);
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
return $response->withStatus(403);
|
return $response->withStatus(403);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($userobj->isAdmin()) {
|
if ($userobj->isAdmin()) {
|
||||||
if ($resArr["su"]) {
|
if ($resArr["su"]) {
|
||||||
if(!($userobj = $dms->getUser($resArr["su"])))
|
if (!($userobj = $dms->getUser($resArr["su"]))) {
|
||||||
return $response->withStatus(403);
|
return $response->withStatus(403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$dms->setUser($userobj);
|
$dms->setUser($userobj);
|
||||||
} else {
|
} else {
|
||||||
return $response->withStatus(403);
|
return $response->withStatus(403);
|
||||||
|
|
|
@ -1,6 +1,37 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MyDMS. Document Management System
|
||||||
|
* Copyright (C) 2002-2005 Markus Westphal
|
||||||
|
* Copyright (C) 2006-2008 Malcolm Cowe
|
||||||
|
* Copyright (C) 2010 Matteo Lucarelli
|
||||||
|
* Copyright (C) 2010-2024 Uwe Steinmann
|
||||||
|
*
|
||||||
|
* PHP version 8
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @category SeedDMS
|
||||||
|
* @package SeedDMS
|
||||||
|
* @author Uwe Steinmann <info@seeddms.org>
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||||
|
* @link https://www.seeddms.org Main Site
|
||||||
|
*/
|
||||||
|
|
||||||
$conversionmgr = null;
|
$conversionmgr = null;
|
||||||
require_once("inc.ClassConversionMgr.php");
|
require_once "inc.ClassConversionMgr.php";
|
||||||
$conversionmgr = new SeedDMS_ConversionMgr();
|
$conversionmgr = new SeedDMS_ConversionMgr();
|
||||||
|
|
||||||
if (!empty($settings->_converters['preview'])) {
|
if (!empty($settings->_converters['preview'])) {
|
||||||
|
|
|
@ -1,28 +1,41 @@
|
||||||
<?php
|
<?php
|
||||||
// MyDMS. Document Management System
|
|
||||||
// Copyright (C) 2002-2005 Markus Westphal
|
/**
|
||||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
* MyDMS. Document Management System
|
||||||
// Copyright (C) 2010 Matteo Lucarelli
|
* Copyright (C) 2002-2005 Markus Westphal
|
||||||
//
|
* Copyright (C) 2006-2008 Malcolm Cowe
|
||||||
// This program is free software; you can redistribute it and/or modify
|
* Copyright (C) 2010 Matteo Lucarelli
|
||||||
// it under the terms of the GNU General Public License as published by
|
* Copyright (C) 2010-2024 Uwe Steinmann
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
*
|
||||||
// (at your option) any later version.
|
* PHP version 8
|
||||||
//
|
*
|
||||||
// This program is distributed in the hope that it will be useful,
|
* This program is free software; you can redistribute it and/or modify
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* it under the terms of the GNU General Public License as published by
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
// GNU General Public License for more details.
|
* (at your option) any later version.
|
||||||
//
|
*
|
||||||
// You should have received a copy of the GNU General Public License
|
* This program is distributed in the hope that it will be useful,
|
||||||
// along with this program; if not, write to the Free Software
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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.
|
||||||
|
*
|
||||||
|
* @category SeedDMS
|
||||||
|
* @package SeedDMS
|
||||||
|
* @author Uwe Steinmann <info@seeddms.org>
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||||
|
* @link https://www.seeddms.org Main Site
|
||||||
|
*/
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
if(!empty($settings->_coreDir))
|
if (!empty($settings->_coreDir)) {
|
||||||
require_once($settings->_coreDir.'/Core.php');
|
require_once $settings->_coreDir . '/Core.php';
|
||||||
else
|
} else {
|
||||||
require_once('vendor/seeddms/core/Core.php');
|
require_once 'vendor/seeddms/core/Core.php';
|
||||||
|
}
|
||||||
|
|
||||||
$request = Request::createFromGlobals();
|
$request = Request::createFromGlobals();
|
||||||
|
|
|
@ -1,34 +1,46 @@
|
||||||
<?php
|
<?php
|
||||||
// MyDMS. Document Management System
|
|
||||||
// Copyright (C) 2002-2005 Markus Westphal
|
|
||||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
|
||||||
// Copyright (C) 2010 Matteo Lucarelli
|
|
||||||
// Copyright (C) 2010-2016 Uwe Steinmann
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
if(!isset($settings))
|
/**
|
||||||
require_once("../inc/inc.Settings.php");
|
* MyDMS. Document Management System
|
||||||
require_once("inc/inc.Utils.php");
|
* Copyright (C) 2002-2005 Markus Westphal
|
||||||
require_once("inc/inc.LogInit.php");
|
* Copyright (C) 2006-2008 Malcolm Cowe
|
||||||
require_once("inc/inc.Language.php");
|
* Copyright (C) 2010 Matteo Lucarelli
|
||||||
require_once("inc/inc.Init.php");
|
* Copyright (C) 2010-2024 Uwe Steinmann
|
||||||
require_once("inc/inc.Extension.php");
|
*
|
||||||
require_once("inc/inc.DBInit.php");
|
* PHP version 8
|
||||||
require_once("inc/inc.ClassUI.php");
|
*
|
||||||
require_once("inc/inc.Authentication.php");
|
* 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.
|
||||||
|
*
|
||||||
|
* @category SeedDMS
|
||||||
|
* @package SeedDMS
|
||||||
|
* @author Uwe Steinmann <info@seeddms.org>
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||||
|
* @link https://www.seeddms.org Main Site
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!isset($settings)) {
|
||||||
|
require_once "../inc/inc.Settings.php");
|
||||||
|
}
|
||||||
|
require_once "inc/inc.Utils.php";
|
||||||
|
require_once "inc/inc.LogInit.php";
|
||||||
|
require_once "inc/inc.Language.php";
|
||||||
|
require_once "inc/inc.Init.php";
|
||||||
|
require_once "inc/inc.Extension.php";
|
||||||
|
require_once "inc/inc.DBInit.php";
|
||||||
|
require_once "inc/inc.ClassUI.php";
|
||||||
|
require_once "inc/inc.Authentication.php";
|
||||||
|
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||||
|
|
|
@ -1,35 +1,47 @@
|
||||||
<?php
|
<?php
|
||||||
// MyDMS. Document Management System
|
|
||||||
// Copyright (C) 2002-2005 Markus Westphal
|
|
||||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
|
||||||
// Copyright (C) 2010 Matteo Lucarelli
|
|
||||||
// Copyright (C) 2010-2016 Uwe Steinmann
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
if(!isset($settings))
|
/**
|
||||||
require_once("../inc/inc.Settings.php");
|
* MyDMS. Document Management System
|
||||||
require_once("inc/inc.Utils.php");
|
* Copyright (C) 2002-2005 Markus Westphal
|
||||||
require_once("inc/inc.LogInit.php");
|
* Copyright (C) 2006-2008 Malcolm Cowe
|
||||||
require_once("inc/inc.Language.php");
|
* Copyright (C) 2010 Matteo Lucarelli
|
||||||
require_once("inc/inc.Init.php");
|
* Copyright (C) 2010-2016 Uwe Steinmann
|
||||||
require_once("inc/inc.Extension.php");
|
*
|
||||||
require_once("inc/inc.DBInit.php");
|
* PHP version 8
|
||||||
require_once("inc/inc.ClassUI.php");
|
*
|
||||||
require_once("inc/inc.ClassAccessOperation.php");
|
* This program is free software; you can redistribute it and/or modify
|
||||||
require_once("inc/inc.Authentication.php");
|
* 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.
|
||||||
|
*
|
||||||
|
* @category SeedDMS
|
||||||
|
* @package SeedDMS
|
||||||
|
* @author Uwe Steinmann <info@seeddms.org>
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||||
|
* @link https://www.seeddms.org Main Site
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!isset($settings)) {
|
||||||
|
require_once "../inc/inc.Settings.php";
|
||||||
|
}
|
||||||
|
require_once "inc/inc.Utils.php";
|
||||||
|
require_once "inc/inc.LogInit.php";
|
||||||
|
require_once "inc/inc.Language.php";
|
||||||
|
require_once "inc/inc.Init.php";
|
||||||
|
require_once "inc/inc.Extension.php";
|
||||||
|
require_once "inc/inc.DBInit.php";
|
||||||
|
require_once "inc/inc.ClassUI.php";
|
||||||
|
require_once "inc/inc.ClassAccessOperation.php";
|
||||||
|
require_once "inc/inc.Authentication.php";
|
||||||
|
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user