Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Remove some die() and exit()
Browse files Browse the repository at this point in the history
Remove legacy "security modified"
  • Loading branch information
cdujeu committed May 27, 2016
1 parent 4196c42 commit d74696f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 15 deletions.
34 changes: 34 additions & 0 deletions core/src/core/src/pydio/Core/Exception/DBConnectionException.php
@@ -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);
}
}
4 changes: 0 additions & 4 deletions core/src/plugins/action.share/src/ShareCenter.php
Expand Up @@ -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{
Expand Down
2 changes: 0 additions & 2 deletions core/src/plugins/action.share/src/Store/ShareStore.php
Expand Up @@ -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;
}
}
Expand All @@ -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){
Expand Down
4 changes: 0 additions & 4 deletions core/src/plugins/action.share/src/View/MinisiteRenderer.php
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions core/src/plugins/auth.sql/class.sqlAuthDriver.php
Expand Up @@ -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();
}
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/conf.sql/class.sqlConfDriver.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit d74696f

Please sign in to comment.