lukasboc / onepagercms

OPCMS is a content management system for onepage websites.
https://onepagercms.de
9 stars 6 forks source link

Login without Mailadress or change sending Mail Header Field From to RFC2822 compliant #113

Open freddey opened 2 years ago

freddey commented 2 years ago

I think it should be possible to login without Mailadress! There is webspace where sending mails over php does not work. It would be nice if you could still use the CMS. I installed it on lima-city.de and got an Error Message. It says: Header Field From is not RFC2822 compliant (not existing).

ghost commented 2 years ago

Hi, You can create your own password manually with a little PHP script (you can use an online PHP sandbox). blablabla is the secret in your file database/SQLUserActions.php, line 9. setYourOwnPasswordHere is an example for a password in plain text.

<?php
define('secret', 'blablabla');
$hash = password_hash('setYourOwnPasswordHere' . secret, PASSWORD_BCRYPT, array('cost' => 15));
echo $hash;

Get the generated hash and update manually the database (create a new line or edit an existing user).

# Connect to database
sqlite3 SQLiteDatabase.db

Edit an existing user :

UPDATE Users SET password = '$2y$15$J/dGwWAYQDxBPwUIWerqQ.o9I/dtyYr.VNFJPjs5DWZPM6BNzRXBm' WHERE username = 'test';

Or create the first user :

Edit an existing user :

INSERT INTO Users VALUES ('1', 'test', '$2y$15$J/dGwWAYQDxBPwUIWerqQ.o9I/dtyYr.VNFJPjs5DWZPM6BNzRXBm', 'your@email.org');