summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyUserSession.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyUserSession.php')
-rw-r--r--admin/survey/classes/class.SurveyUserSession.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/admin/survey/classes/class.SurveyUserSession.php b/admin/survey/classes/class.SurveyUserSession.php
index a839878..b23be27 100644
--- a/admin/survey/classes/class.SurveyUserSession.php
+++ b/admin/survey/classes/class.SurveyUserSession.php
@@ -39,12 +39,21 @@ class SurveyUserSession
}
self::$ank_id = $anketa;
+ // Ce ni prijavljen v 1ko nastavimo usr_id na avtorja ankete, da se prikazejo njegovi grafi
+ if($global_user_id == -1){
+ SurveyInfo::getInstance()->SurveyInit(self::$ank_id);
+ $usr_id = SurveyInfo::getInstance()->getSurveyColumn("insert_uid");
+ }
+ else{
+ $usr_id = $global_user_id;
+ }
+
# preberemo vse nastavitve za to anketo - ce jih se nimamo
if (!is_countable(self::$dataArray) || count(self::$dataArray) == 0) {
- $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$global_user_id'");
+ $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$usr_id'");
$row = mysqli_fetch_array($sql);
- self::$dataArray = unserialize($row['data']);
+ self::$dataArray = ($row != null ? unserialize($row['data']) : array());
}
}