Skip to content
Permalink
Browse files

Remove some die() and exit()

Remove legacy "security modified"
  • Loading branch information
cdujeu committed May 27, 2016
1 parent 4196c42 commit d74696f92ce8da7bb21e2356aeecee351bcf29a5
@@ -0,0 +1,34 @@
<?php
/*
* Copyright 2007-2016 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <https://pydio.com/>.
*/
namespace Pydio\Core\Exception;

defined('AJXP_EXEC') or die('Access not allowed');



class DBConnectionException extends PydioException
{
public function __construct()
{
$messageString = "There was an error trying to connect to your database! Did you change any configuration for the core connection? Or maybe your database is down?";
parent::__construct($messageString);
}
}
@@ -1240,10 +1240,6 @@ public static function loadShareByHash($hash){
return;
}
if(!empty($data) && is_array($data)){
if(isSet($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true){
header("HTTP/1.0 401 Not allowed, script was modified");
exit();
}
if($data["SHARE_TYPE"] == "minisite"){
self::loadMinisite($data, $hash);
}else{
@@ -154,7 +154,6 @@ public function loadShare($hash){
if($this->sqlSupported){
$this->confStorage->simpleStoreGet("share", $hash, "serial", $data);
if(!empty($data)){
$data["SECURITY_MODIFIED"] = false;
return $data;
}
}
@@ -175,7 +174,6 @@ public function loadShare($hash){
if(empty($inputData)) return false;
$dataModified = !$this->checkHash($inputData, $hash); //(md5($inputData) != $id);
$publicletData = @unserialize($inputData);
$publicletData["SECURITY_MODIFIED"] = $dataModified;
$publicletData["PUBLICLET_PATH"] = $file;
/*
if($this->sqlSupported){
@@ -41,10 +41,6 @@ public static function renderError($data, $hash = '', $error = null){

public static function loadMinisite($data, $hash = '', $error = null)
{
if(isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true){
$mess = ConfService::getMessages();
$error = $mess['share_center.164'];
}
$repository = $data["REPOSITORY"];
$confs = [];
PluginsService::getInstance()->initActivePlugins();
@@ -43,8 +43,7 @@ public function init($options)
dibi::connect($this->sqlDriver);
}
} catch (DibiException $e) {
echo get_class($e), ': ', $e->getMessage(), "\n";
exit(1);
throw new \Pydio\Core\Exception\DBConnectionException();
}
}

@@ -24,6 +24,8 @@
use Pydio\Access\Core\Filter\ContentFilter;
use Pydio\Access\Core\Model\Repository;
use Pydio\Core\Controller\HTMLWriter;
use Pydio\Core\Exception\DBConnectionException;
use Pydio\Core\Exception\PydioException;
use Pydio\Core\Services\AuthService;
use Pydio\Conf\Core\AbstractAjxpUser;
use Pydio\Conf\Core\AbstractConfDriver;
@@ -90,9 +92,7 @@ public function init($options)
}
}
} catch (DibiException $e) {
//throw $e;
echo get_class($e), ': ', $e->getMessage(), "\n";
exit(1);
throw new DBConnectionException();
}
}

0 comments on commit d74696f

Please sign in to comment.
You can’t perform that action at this time.