Permalink
Browse files

Remove conf.serial and auth.serial

  • Loading branch information...
1 parent 86591d4 commit edee9edde1ee03dcc2666980e612891a18b61b41 @cdujeu cdujeu committed Jun 17, 2016
@@ -108,7 +108,10 @@ public static function start()
$inst = self::getInstance();
$inst->startInst();
$confStorageDriver = self::getConfStorageImpl();
- require_once($confStorageDriver->getUserClassFileName());
+ $userFile = $confStorageDriver->getUserClassFileName();
+ if(!empty($userFile)){
+ require_once($userFile);
+ }
}
/**
* Init CONF, AUTH drivers
@@ -28,7 +28,10 @@
defined('AJXP_EXEC') or die('Access not allowed');
-
+/**
+ * Class RolesService
+ * @package Pydio\Core\Services
+ */
class RolesService
{
@@ -345,8 +348,10 @@ public static function bootSequence()
}
RolesService::updateRole($rootRole);
}
+ file_put_contents(AJXP_CACHE_DIR . "/admin_counted", "true");
// Legacy, should never happen
+ /*
$adminCount = UsersService::countAdminUsers();
if ($adminCount == 0) {
$authDriver = ConfService::getAuthDriverImpl();
@@ -374,7 +379,7 @@ public static function bootSequence()
file_put_contents(AJXP_CACHE_DIR . "/admin_counted", "true");
throw new PydioException("There is an admin user, but without admin right. Now any user can have the administration rights, \\n your 'admin' user was set with the admin rights. Please check that this suits your security configuration.");
}
- file_put_contents(AJXP_CACHE_DIR . "/admin_counted", "true");
+ */
}
}
@@ -1,188 +0,0 @@
-<?php
-/*
- * Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
- * 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 <http://pyd.io/>.
- */
-use Pydio\Auth\Core\AbstractAuthDriver;
-use Pydio\Core\Model\ContextInterface;
-use Pydio\Core\Services\ConfService;
-use Pydio\Core\Services\UsersService;
-use Pydio\Core\Utils\Utils;
-use Pydio\Core\Utils\VarsFilter;
-
-defined('AJXP_EXEC') or die( 'Access not allowed');
-
-/**
- * Standard auth implementation, stores the data in serialized files
- * @package AjaXplorer_Plugins
- * @subpackage Auth
- */
-class serialAuthDriver extends AbstractAuthDriver
-{
- public $usersSerFile;
- public $driverName = "serial";
-
- /**
- * @param ContextInterface $ctx
- * @param array $options
- */
- public function init(ContextInterface $ctx, $options = [])
- {
- parent::init($ctx, $options);
- $this->usersSerFile = VarsFilter::filter($this->getOption("USERS_FILEPATH"), $ctx);
- }
-
- public function performChecks()
- {
- if(!isset($this->options)) return;
- if (isset($this->options["FAST_CHECKS"]) && $this->options["FAST_CHECKS"] === true) {
- return;
- }
- $usersDir = dirname($this->usersSerFile);
- if (!is_dir($usersDir) || !is_writable($usersDir)) {
- throw new Exception("Parent folder for users file is either inexistent or not writeable.");
- }
- if (is_file($this->usersSerFile) && !is_writable($this->usersSerFile)) {
- throw new Exception("Users file exists but is not writeable!");
- }
- }
-
- protected function _listAllUsers()
- {
- $users = Utils::loadSerialFile($this->usersSerFile);
- if (UsersService::ignoreUserCase()) {
- $users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
- }
- ConfService::getConfStorageImpl()->filterUsersByGroup($users, "/", true);
- return $users;
- }
-
- public function listUsers($baseGroup = "/", $recursive = true)
- {
- $users = Utils::loadSerialFile($this->usersSerFile);
- if (UsersService::ignoreUserCase()) {
- $users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
- }
- ConfService::getConfStorageImpl()->filterUsersByGroup($users, $baseGroup, !$recursive);
- ksort($users);
- return $users;
- }
-
- public function supportsUsersPagination()
- {
- return true;
- }
-
- // $baseGroup = "/"
- public function listUsersPaginated($baseGroup, $regexp, $offset = -1 , $limit = -1, $recursive = true)
- {
- $users = $this->listUsers($baseGroup);
- $result = array();
- $index = 0;
- foreach ($users as $usr => $pass) {
- if (!empty($regexp) && !preg_match("/".preg_quote($regexp)."/i", $usr)) {
- continue;
- }
- if ($offset != -1 && $index < $offset) {
- $index ++;
- continue;
- }
- $result[$usr] = $pass;
- $index ++;
- if($limit != -1 && count($result) >= $limit) break;
- }
- return $result;
- }
- public function getUsersCount($baseGroup = "/", $regexp = "", $filterProperty = null, $filterValue = null, $recursive = true)
- {
- return count($this->listUsersPaginated($baseGroup, $regexp, -1, -1, $recursive));
- }
-
-
- public function userExists($login)
- {
- if(UsersService::ignoreUserCase()) $login = strtolower($login);
- $users = $this->_listAllUsers();
- if(!is_array($users) || !array_key_exists($login, $users)) return false;
- return true;
- }
-
- public function checkPassword($login, $pass, $seed)
- {
- if(UsersService::ignoreUserCase()) $login = strtolower($login);
- $userStoredPass = $this->getUserPass($login);
- if(!$userStoredPass) return false;
- if ($seed == "-1") { // Seed = -1 means that password is not encoded.
- return Utils::pbkdf2_validate_password($pass, $userStoredPass);//($userStoredPass == md5($pass));
- } else {
- return (md5($userStoredPass.$seed) === $pass);
- }
- }
-
- public function usersEditable()
- {
- return true;
- }
- public function passwordsEditable()
- {
- return true;
- }
-
- public function createUser($login, $passwd)
- {
- if(UsersService::ignoreUserCase()) $login = strtolower($login);
- $users = $this->_listAllUsers();
- if(!is_array($users)) $users = array();
- if(array_key_exists($login, $users)) return "exists";
- if ($this->getOptionAsBool("TRANSMIT_CLEAR_PASS")) {
- $users[$login] = Utils::pbkdf2_create_hash($passwd);//md5($passwd);
- } else {
- $users[$login] = $passwd;
- }
- Utils::saveSerialFile($this->usersSerFile, $users);
- }
- public function changePassword($login, $newPass)
- {
- if(UsersService::ignoreUserCase()) $login = strtolower($login);
- $users = $this->_listAllUsers();
- if(!is_array($users) || !array_key_exists($login, $users)) return ;
- if ($this->getOptionAsBool("TRANSMIT_CLEAR_PASS")) {
- $users[$login] = Utils::pbkdf2_create_hash($newPass);//md5($newPass);
- } else {
- $users[$login] = $newPass;
- }
- Utils::saveSerialFile($this->usersSerFile, $users);
- }
- public function deleteUser($login)
- {
- if(UsersService::ignoreUserCase()) $login = strtolower($login);
- $users = $this->_listAllUsers();
- if (is_array($users) && array_key_exists($login, $users)) {
- unset($users[$login]);
- Utils::saveSerialFile($this->usersSerFile, $users);
- }
- }
-
- public function getUserPass($login)
- {
- if(!$this->userExists($login)) return false;
- $users = $this->_listAllUsers();
- return $users[$login];
- }
-
-}
@@ -1,29 +0,0 @@
-<?php
-/*
-* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
-* 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 <http://pyd.io/>.
-*/
-$mess=array(
-"Serialized authentication storage" => "Serialisierte Anmeldedaten",
-"Stores the Authentication data as serialized PHP values on the filesystem." => "Speichert Anmeldedaten durch PHP serialisiert im Dateisystem.",
-"Users" => "Benutzer",
-"The users list" => "Eine Liste mit Benutzern",
-"Users File" => "Benutzerdatei",
-"Fast Checks" => "Schnellprüfung",
-"When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks" => "Wenn ein benutzerdefinierter Stream-Wrapper verwendet wird kann dies die Geschwindigkeit verbessern, indem verschiedene is_file oder is_dir Prüfungen übersprungen werden.",
-);
@@ -1,29 +0,0 @@
-<?php
-/*
-* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
-* 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 <http://pyd.io/>.
-*/
-$mess=array(
-"Serialized authentication storage" => "Serialized authentication storage",
-"Stores the Authentication data as serialized PHP values on the filesystem." => "Stores the Authentication data as serialized PHP values on the filesystem.",
-"Users" => "Users",
-"The users list" => "The users list",
-"Users File" => "Users File",
-"Fast Checks" => "Fast Checks",
-"When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks" => "When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks",
-);
@@ -1,29 +0,0 @@
-<?php
-/*
-* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
-* 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 <http://pyd.io/>.
-*/
-$mess=array(
-"Serialized authentication storage" => "Stockage des identifiants dans des fichiers sérialisés",
-"Stores the Authentication data as serialized PHP values on the filesystem." => "Stockage des identifiants d'authentification dans des fichiers PHP sérialisés sur le système de fichier.",
-"Users" => "Utilisateurs",
-"The users list" => "Liste des utilisateurs.",
-"Users File" => "Fichier des utilisateurs",
-"Fast Checks" => "Vérifications rapides",
-"When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks" => "Lors de l'utilisation d'un wrapper personnalisé pour lire les fichiers, cela peut améliorer les performances en ignorant des vérifications de type 'is_file,is_dir'",
-);
@@ -1,29 +0,0 @@
-<?php
-/*
-* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
-* 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 <http://pyd.io/>.
-*/
-$mess=array(
-"Serialized authentication storage" => "Autenticazione Serializzata",
-"Stores the Authentication data as serialized PHP values on the filesystem." => "Salva i dati d'Autenticazione come valori serializzati, in un file PHP, sul filesystem.",
-"Users" => "Utenti",
-"The users list" => "Lista utenti",
-"Users File" => "File utenti",
-"Fast Checks" => "Controlli Rapidi",
-"When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks" => "Quando si utilizza un wrapper personalizzato per leggere i file, questa opzione può aumentare le performance saltando diversi controlli 'is_file' e 'is_dir'",
-);
@@ -1,29 +0,0 @@
-<?php
-/*
-* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
-* 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 <http://pyd.io/>.
-*/
-$mess=array(
-"Serialized authentication storage" => "Armazenamento de Autenticação em Série",
-"Stores the Authentication data as serialized PHP values on the filesystem." => "Guarda os dados de autenticação em valores em série PHP no sistema de ficheiros.",
-"Users" => "Utilizadores",
-"The users list" => "Lista de Utilizadores",
-"Users File" => "Users File",
-"Fast Checks" => "Fast Checks",
-"When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks" => "When using a custom stream wrapper to read the files, this can increase performances by skipping various is_file,is_dir checks",
-);
Oops, something went wrong.

0 comments on commit edee9ed

Please sign in to comment.