Skip to content

Commit 2131844

Browse files
author
Matti Maier
committed
fix in votes
1 parent 9deb2a8 commit 2131844

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

BNote/src/data/modules/abstimmungdata.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
require_once $GLOBALS["DIR_LOGIC_MODULES"] . "logincontroller.php";
23

34
/**
45
* Data Access Class for vote data.
@@ -437,7 +438,11 @@ function getUserPin($uid = -1) {
437438
if($uid == -1) {
438439
$uid = $_SESSION["user"];
439440
}
440-
return $this->database->getCell($this->database->getUserTable(), "pin", "id = $uid");
441+
$pin = $this->database->getCell($this->database->getUserTable(), "pin", "id = $uid");
442+
if($pin == null || $pin == "") {
443+
$pin = LoginController::createPin($this->database, $uid);
444+
}
445+
return $pin;
441446
}
442447

443448
function getOpenVoters($voteId) {

BNote/src/data/modules/kontaktdatendata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function update($id, $values, $plainUpdate=false) {
5757
function getPIN($uid) {
5858
$pin = $this->database->getCell($this->database->getUserTable(), "pin", "id = $uid");
5959
if($pin == null || $pin == "") {
60-
$pid = LoginController::createPin($this->database, $uid);
60+
$pin = LoginController::createPin($this->database, $uid);
6161
}
6262
return $pin;
6363
}

0 commit comments

Comments
 (0)