Skip to content

Commit

Permalink
Merge branch 'crypt'
Browse files Browse the repository at this point in the history
Conflicts:
	inc/SP/Core/Upgrade/Group.class.php
	inc/SP/Core/Upgrade/Upgrade.class.php
  • Loading branch information
nuxsmin committed Mar 1, 2017
2 parents 3693a71 + c9b36bc commit a0e2c48
Show file tree
Hide file tree
Showing 159 changed files with 40,512 additions and 31,268 deletions.
41 changes: 41 additions & 0 deletions ajax/ajax_task.php
@@ -0,0 +1,41 @@
<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
* sysPass 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 3 of the License, or
* (at your option) any later version.
*
* sysPass 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 sysPass. If not, see <http://www.gnu.org/licenses/>.
*/

use SP\Controller\TaskController;
use SP\Http\Request;

define('APP_ROOT', '..');

require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';

session_write_close();

Request::checkReferer('GET');

header('Content-Type: text/event-stream');
header('Cache-Control: no-store, no-cache');
header('Access-Control-Allow-Origin: *');

$Controller = new TaskController();
$Controller->doAction();
36 changes: 36 additions & 0 deletions ajax/ajax_upgrade.php
@@ -0,0 +1,36 @@
<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
* sysPass 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 3 of the License, or
* (at your option) any later version.
*
* sysPass 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 sysPass. If not, see <http://www.gnu.org/licenses/>.
*/

use SP\Controller\MainActionController;
use SP\Http\Request;

define('APP_ROOT', '..');
define('IS_UPGRADE', 1);

require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';

Request::checkReferer('GET');

$Controller = new MainActionController();
$Controller->doAction();
17 changes: 14 additions & 3 deletions inc/Base.php
Expand Up @@ -38,9 +38,14 @@
define('PLUGINS_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'Plugins');
define('LOCALES_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'locales');
define('SQL_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'sql');
define('LOG_FILE', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'syspass.log');

define('DEBUG', false);

// Required random_compat polyfill for random_bytes() and random_int()
// @see https://github.com/paragonie/random_compat/tree/v2.0.4#random_compat
require_once EXTENSIONS_PATH . DIRECTORY_SEPARATOR . 'random_compat' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'random.php';

require 'SplClassLoader.php';

$ClassLoader = new SplClassLoader('SP');
Expand All @@ -66,15 +71,21 @@
*/
function debugLog($data, $printLastCaller = false)
{
error_log(print_r($data, true));
if (!error_log(date('Y-m-d H:i:s') . ' - ' . print_r($data, true) . PHP_EOL, 3, LOG_FILE)) {
error_log(print_r($data, true));
}

if ($printLastCaller === true) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$n = count($backtrace);

for ($i = 1; $i <= $n - 1; $i++) {
$class = isset($backtrace[$i]['class']) ? $backtrace[$i]['class'] : '';
error_log(sprintf('Caller %d: %s\%s', $i, $class, $backtrace[$i]['function']));
$line = sprintf('Caller %d: %s\%s', $i, $class, $backtrace[$i]['function']);

if (!error_log($line . PHP_EOL, 3, LOG_FILE)) {
error_log($line);
}
}
}
}
Expand All @@ -83,7 +94,7 @@ function debugLog($data, $printLastCaller = false)
* Alias gettext function
*
* @param string $string
* @param bool $tranlate Si es necesario traducir
* @param bool $tranlate Si es necesario traducir
* @return string
*/
function __($string, $tranlate = true)
Expand Down

0 comments on commit a0e2c48

Please sign in to comment.