Small fixes and things

This commit is contained in:
Jarkko Toivanen 2024-12-20 16:40:32 +02:00
parent 3bf3b486bf
commit f717080e8a
Signed by: jt
GPG key ID: 9151B109B73ECAD5
3 changed files with 9 additions and 3 deletions

View file

@ -12,3 +12,6 @@ docker-run: data/
FORCE: FORCE:
cp -r src/data ./ cp -r src/data ./
chmod 777 data chmod 777 data
docker-run-dev: data/ src/
docker run -v $(current_dir)src/:/var/www/html/ -v $(current_dir)data/:/var/www/html/data/ -p 8080:80 snuffler/snuffler-web:dev

View file

@ -102,7 +102,7 @@ class DataBase extends SQLite3 {
function addPersona($userid, $handle, $name, $about=NULL, $colour=NULL) { function addPersona($userid, $handle, $name, $about=NULL, $colour=NULL) {
$id = hexdec(uniqid()); $id = hexdec(uniqid());
$sql = "INSERT INTO personas (id, userid, handle, name, colour) VALUES ('$id', '$userid', '$handle', '$about', '$colour');"; $sql = "INSERT INTO personas (id, userid, handle, name, about, colour) VALUES ('$id', '$userid', '$handle', '$name', '$about', '$colour');";
$ret = $this->exec($sql); $ret = $this->exec($sql);
if(!$ret) { if(!$ret) {
die($this->lastErrorMsg()); die($this->lastErrorMsg());
@ -125,6 +125,9 @@ class DataBase extends SQLite3 {
return false; return false;
} }
$dbhash = $ret[0]; $dbhash = $ret[0];
if(!$dbhash) {
return false;
}
return password_verify($password, $dbhash); return password_verify($password, $dbhash);
} }

View file

@ -80,8 +80,8 @@ $posts = array_reverse($database->getPosts());
foreach($posts as $post) { foreach($posts as $post) {
echo '<div class="post">'; echo '<div class="post">';
echo '<div class="postinfo">'; echo '<div class="postinfo">';
echo '<strong>' . $post["user.name"] . '</strong>'; echo $post["user.name"] . ': <strong>' . $post["persona.name"] . '</strong>';
echo '<br><small>@' . $post["user.handle"] . '</small>'; echo '<br><small>@' . $post["user.handle"] . '@' . $post["persona.handle"] . '</small>';
echo '</div>'; echo '</div>';
echo '<p>' . $post["post.text"] . '</p>'; echo '<p>' . $post["post.text"] . '</p>';