@@ 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. |
@@ 632-650 (lines=19) @@ | ||
629 | * |
|
630 | * @return mixed |
|
631 | */ |
|
632 | protected function setLoginAttempt() |
|
633 | { |
|
634 | $update = sprintf(" |
|
635 | UPDATE |
|
636 | %sfaquser |
|
637 | SET |
|
638 | session_timestamp ='%s', |
|
639 | ip = '%s', |
|
640 | success = 0 |
|
641 | WHERE |
|
642 | user_id = %d", |
|
643 | PMF_Db::getTablePrefix(), |
|
644 | $_SERVER['REQUEST_TIME'] + $this->lockoutTime, |
|
645 | $_SERVER['REMOTE_ADDR'], |
|
646 | $this->getUserId() |
|
647 | ); |
|
648 | ||
649 | return $this->config->getDb()->query($update); |
|
650 | } |
|
651 | ||
652 | /** |
|
653 | * Checks if the last login attempt from current user failed. |
@@ 3299-3310 (lines=12) @@ | ||
3296 | * |
|
3297 | * @return bool |
|
3298 | */ |
|
3299 | public function updateQuestionAnswer($openQuestionId, $faqId, $categoryId) |
|
3300 | { |
|
3301 | $query = sprintf( |
|
3302 | 'UPDATE %sfaqquestions SET answer_id = %d, category_id= %d WHERE id= %d', |
|
3303 | PMF_Db::getTablePrefix(), |
|
3304 | $faqId, |
|
3305 | $categoryId, |
|
3306 | $openQuestionId |
|
3307 | ); |
|
3308 | ||
3309 | return $this->_config->getDb()->query($query); |
|
3310 | } |
|
3311 | ||
3312 | /** |
|
3313 | * Returns a part of a query to check permissions. |