openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 826612de94179f61b1867e50c8e18656d7cacddc
parent 5c931fc0cfa2a107f99a222e2baac7591b35f190
Author: Jan Dankert <devnull@localhost>
Date:   Wed,  6 Dec 2017 23:53:14 +0100

Eigener Namespace für Security-Klassen.

Diffstat:
action/LoginAction.class.php | 2+-
action/StartAction.class.php | 3++-
action/UserAction.class.php | 10++--------
auth/InternalAuth.class.php | 1+
db/update/DBVersion000007.class.php | 1+
model/User.class.php | 10+++++-----
modules/security/Base2n.class.php | 1+
modules/security/Password.class.php | 1+
8 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/action/LoginAction.class.php b/action/LoginAction.class.php @@ -22,7 +22,7 @@ use InternalAuth; use Logger; use ObjectNotFoundException; use OpenRatException; -use Password; +use \security\Password; use Session; use \Html; use \Mail; diff --git a/action/StartAction.class.php b/action/StartAction.class.php @@ -13,8 +13,9 @@ use cms\model\Model; use database\Database; +use Http; use Logger; -use Password; +use \security\Password; use Session; use \Html; use \Mail; diff --git a/action/UserAction.class.php b/action/UserAction.class.php @@ -12,14 +12,8 @@ use cms\model\Language; -use Base2n; -use Exception; -use JSqueeze; -use Less_Parser; -use Logger; -use ObjectNotFoundException; -use Password; -use Session; +use \security\Password; +use \Session; use \Html; use \Mail; diff --git a/auth/InternalAuth.class.php b/auth/InternalAuth.class.php @@ -1,6 +1,7 @@ <?php use cms\model\User; +use security\Password; /** * Authentifizierungsmodul für die interne Benutzerdatenbank. diff --git a/db/update/DBVersion000007.class.php b/db/update/DBVersion000007.class.php @@ -1,5 +1,6 @@ <?php use database\DbVersion; +use security\Password; /** * Security enhancements. diff --git a/model/User.class.php b/model/User.class.php @@ -16,7 +16,7 @@ namespace cms\model; // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - +use security\Password; /** @@ -563,7 +563,7 @@ SQL if ( $always ) { - $algo = \Password::bestAlgoAvailable(); + $algo = Password::bestAlgoAvailable(); $expire = null; } else @@ -580,7 +580,7 @@ SQL $sql->setInt('expires',$expire); $sql->setInt ('algo' ,$algo ); - $sql->setString('password',\Password::hash($this->pepperPassword($password),$algo) ); + $sql->setString('password',Password::hash($this->pepperPassword($password),$algo) ); $sql->setInt ('userid' ,$this->userid ); $sql->query( $sql ); @@ -891,7 +891,7 @@ SQL $row_user = $sql->getRow( $sql ); // Pruefen ob Kennwort mit Datenbank uebereinstimmt. - return \Password::check($this->pepperPassword($password),$row_user['password_hash'],$row_user['password_algo']); + return Password::check($this->pepperPassword($password),$row_user['password_hash'],$row_user['password_algo']); } @@ -1007,7 +1007,7 @@ SQL */ public function renewOTPSecret() { - $secret = \Password::randomHexString(64); + $secret = Password::randomHexString(64); $db = db_connection(); diff --git a/modules/security/Base2n.class.php b/modules/security/Base2n.class.php @@ -1,4 +1,5 @@ <?php +namespace security; /** * Binary-to-text PHP Utilities * diff --git a/modules/security/Password.class.php b/modules/security/Password.class.php @@ -1,4 +1,5 @@ <?php +namespace security; define('OR_PASSWORD_ALGO_PLAIN',0); define('OR_PASSWORD_ALGO_CRYPT',1);