@@ 216-227 (lines=12) @@ | ||
213 | * |
|
214 | * @return bool |
|
215 | */ |
|
216 | public function updateInstance($id, Array $data) |
|
217 | { |
|
218 | $update = sprintf( |
|
219 | "UPDATE %sfaqinstances SET instance = '%s', comment = '%s' WHERE id = %d", |
|
220 | PMF_Db::getTablePrefix(), |
|
221 | $data['instance'], |
|
222 | $data['comment'], |
|
223 | (int) $id |
|
224 | ); |
|
225 | ||
226 | return $this->config->getDb()->query($update); |
|
227 | } |
|
228 | ||
229 | /** |
|
230 | * Deletes an instance. |
@@ 3292-3303 (lines=12) @@ | ||
3289 | * |
|
3290 | * @return bool |
|
3291 | */ |
|
3292 | public function updateQuestionAnswer($openQuestionId, $faqId, $categoryId) |
|
3293 | { |
|
3294 | $query = sprintf( |
|
3295 | 'UPDATE %sfaqquestions SET answer_id = %d, category_id= %d WHERE id= %d', |
|
3296 | PMF_Db::getTablePrefix(), |
|
3297 | $faqId, |
|
3298 | $categoryId, |
|
3299 | $openQuestionId |
|
3300 | ); |
|
3301 | ||
3302 | return $this->_config->getDb()->query($query); |
|
3303 | } |
|
3304 | ||
3305 | /** |
|
3306 | * Returns a part of a query to check permissions. |
@@ 631-649 (lines=19) @@ | ||
628 | * |
|
629 | * @return mixed |
|
630 | */ |
|
631 | protected function setLoginAttempt() |
|
632 | { |
|
633 | $update = sprintf(" |
|
634 | UPDATE |
|
635 | %sfaquser |
|
636 | SET |
|
637 | session_timestamp ='%s', |
|
638 | ip = '%s', |
|
639 | success = 0 |
|
640 | WHERE |
|
641 | user_id = %d", |
|
642 | PMF_Db::getTablePrefix(), |
|
643 | $_SERVER['REQUEST_TIME'], |
|
644 | $_SERVER['REMOTE_ADDR'], |
|
645 | $this->getUserId() |
|
646 | ); |
|
647 | ||
648 | return $this->config->getDb()->query($update); |
|
649 | } |
|
650 | ||
651 | /** |
|
652 | * Checks if the last login attempt from current user failed. |