| @@ 3262-3273 (lines=12) @@ | ||
| 3259 | * |
|
| 3260 | * @return bool |
|
| 3261 | */ |
|
| 3262 | public function updateQuestionAnswer($openQuestionId, $faqId, $categoryId) |
|
| 3263 | { |
|
| 3264 | $query = sprintf( |
|
| 3265 | 'UPDATE %sfaqquestions SET answer_id = %d, category_id= %d WHERE id= %d', |
|
| 3266 | Db::getTablePrefix(), |
|
| 3267 | $faqId, |
|
| 3268 | $categoryId, |
|
| 3269 | $openQuestionId |
|
| 3270 | ); |
|
| 3271 | ||
| 3272 | return $this->config->getDb()->query($query); |
|
| 3273 | } |
|
| 3274 | } |
|
| 3275 | ||
| @@ 213-224 (lines=12) @@ | ||
| 210 | * |
|
| 211 | * @return bool |
|
| 212 | */ |
|
| 213 | public function updateInstance($id, Array $data) |
|
| 214 | { |
|
| 215 | $update = sprintf( |
|
| 216 | "UPDATE %sfaqinstances SET instance = '%s', comment = '%s' WHERE id = %d", |
|
| 217 | Db::getTablePrefix(), |
|
| 218 | $data['instance'], |
|
| 219 | $data['comment'], |
|
| 220 | (int)$id |
|
| 221 | ); |
|
| 222 | ||
| 223 | return $this->config->getDb()->query($update); |
|
| 224 | } |
|
| 225 | ||
| 226 | /** |
|
| 227 | * Deletes an instance. |
|
| @@ 637-658 (lines=22) @@ | ||
| 634 | * |
|
| 635 | * @return mixed |
|
| 636 | */ |
|
| 637 | protected function setLoginAttempt() |
|
| 638 | { |
|
| 639 | $this->loginAttempts++; |
|
| 640 | ||
| 641 | $update = sprintf(" |
|
| 642 | UPDATE |
|
| 643 | %sfaquser |
|
| 644 | SET |
|
| 645 | session_timestamp ='%s', |
|
| 646 | ip = '%s', |
|
| 647 | success = 0, |
|
| 648 | login_attempts = login_attempts + 1 |
|
| 649 | WHERE |
|
| 650 | user_id = %d", |
|
| 651 | Db::getTablePrefix(), |
|
| 652 | $_SERVER['REQUEST_TIME'], |
|
| 653 | $_SERVER['REMOTE_ADDR'], |
|
| 654 | $this->getUserId() |
|
| 655 | ); |
|
| 656 | ||
| 657 | return $this->config->getDb()->query($update); |
|
| 658 | } |
|
| 659 | ||
| 660 | /** |
|
| 661 | * Checks if the last login attempt from current user failed. |
|