Index: trunk/extensions/SimpleSurvey/SimpleSurvey.classes.php |
— | — | @@ -71,18 +71,19 @@ |
72 | 72 | global $wgRequest, $wgUser; |
73 | 73 | $dbw = wfGetDb( DB_MASTER ); |
74 | 74 | $now = $dbw->timestamp(); |
75 | | - $cookieID = $wgRequest->getCookie( "vitals-survey" ); |
| 75 | + /*$cookieID = $wgRequest->getCookie( "vitals-survey" ); |
76 | 76 | if ( $cookieID == null ) { |
77 | 77 | $cookieID = self::generateRandomCookieID(); |
78 | 78 | $wgRequest->response()->setcookie( "vitals-survey", $cookieID ); |
79 | | - } |
| 79 | + }*/ |
80 | 80 | |
81 | 81 | foreach ( $survey['questions'] as $question => $config ) { |
82 | 82 | $dbw->insert( |
83 | 83 | 'prefswitch_survey', |
84 | 84 | array_merge( |
85 | 85 | array( |
86 | | - 'pss_user' => $cookieID, |
| 86 | + 'pss_user' => $wgUser->getId(), |
| 87 | + 'pss_user_text' => $wgUser->getName(), |
87 | 88 | 'pss_timestamp' => $now, |
88 | 89 | 'pss_name' => $name, |
89 | 90 | 'pss_question' => $question, |
— | — | @@ -97,17 +98,15 @@ |
98 | 99 | $dbw->insert( |
99 | 100 | 'prefswitch_survey', |
100 | 101 | array( |
101 | | - 'pss_user' => $cookieID, |
| 102 | + 'pss_user' => $wgUser->getId(), |
| 103 | + 'pss_user_text' => $wgUser->getName(), |
102 | 104 | 'pss_timestamp' => $now, |
103 | 105 | 'pss_name' => $name, |
104 | 106 | 'pss_question' => "logged_in", |
105 | | - 'pss_answer' => $wgUser->isLoggedIn() ? "yes":"no", |
| 107 | + 'pss_answer' => $wgUser->isLoggedIn() ? "yes" : "no", |
106 | 108 | 'pss_answer_data' => wfGetIP(), |
107 | 109 | ), |
108 | 110 | __METHOD__ |
109 | 111 | ); |
110 | | - |
111 | | - |
112 | | - |
113 | 112 | } |
114 | 113 | } |
\ No newline at end of file |