@@ 250-299 (lines=50) @@ | ||
247 | * @param int $sectionId |
|
248 | * @return bool |
|
249 | */ |
|
250 | public function deleteSection($sectionId) |
|
251 | { |
|
252 | if ($sectionId <= 0 || !is_numeric($sectionId)) { |
|
253 | return false; |
|
254 | } |
|
255 | ||
256 | $delete = sprintf(' |
|
257 | DELETE FROM |
|
258 | %sfaqsections |
|
259 | WHERE |
|
260 | id = %d', |
|
261 | Db::getTablePrefix(), |
|
262 | $sectionId |
|
263 | ); |
|
264 | ||
265 | $res = $this->config->getDb()->query($delete); |
|
266 | if (!$res) { |
|
267 | return false; |
|
268 | } |
|
269 | ||
270 | $delete = sprintf(' |
|
271 | DELETE FROM |
|
272 | %sfaqsection_group |
|
273 | WHERE |
|
274 | section_id = %d', |
|
275 | Db::getTablePrefix(), |
|
276 | $sectionId |
|
277 | ); |
|
278 | ||
279 | $res = $this->config->getDb()->query($delete); |
|
280 | if (!$res) { |
|
281 | return false; |
|
282 | } |
|
283 | ||
284 | $delete = sprintf(' |
|
285 | DELETE FROM |
|
286 | %sfaqsection_news |
|
287 | WHERE |
|
288 | section_id = %d', |
|
289 | Db::getTablePrefix(), |
|
290 | $sectionId |
|
291 | ); |
|
292 | ||
293 | $res = $this->config->getDb()->query($delete); |
|
294 | if (!$res) { |
|
295 | return false; |
|
296 | } |
|
297 | ||
298 | return true; |
|
299 | } |
|
300 | ||
301 | /** |
|
302 | * Returns true if the user given by $userId is a member of |
@@ 349-398 (lines=50) @@ | ||
346 | * |
|
347 | * @return bool |
|
348 | */ |
|
349 | public function deleteGroup($groupId) |
|
350 | { |
|
351 | if ($groupId <= 0 || !is_numeric($groupId)) { |
|
352 | return false; |
|
353 | } |
|
354 | ||
355 | $delete = sprintf(' |
|
356 | DELETE FROM |
|
357 | %sfaqgroup |
|
358 | WHERE |
|
359 | group_id = %d', |
|
360 | Db::getTablePrefix(), |
|
361 | $groupId |
|
362 | ); |
|
363 | ||
364 | $res = $this->config->getDb()->query($delete); |
|
365 | if (!$res) { |
|
366 | return false; |
|
367 | } |
|
368 | ||
369 | $delete = sprintf(' |
|
370 | DELETE FROM |
|
371 | %sfaquser_group |
|
372 | WHERE |
|
373 | group_id = %d', |
|
374 | Db::getTablePrefix(), |
|
375 | $groupId |
|
376 | ); |
|
377 | ||
378 | $res = $this->config->getDb()->query($delete); |
|
379 | if (!$res) { |
|
380 | return false; |
|
381 | } |
|
382 | ||
383 | $delete = sprintf(' |
|
384 | DELETE FROM |
|
385 | %sfaqgroup_right |
|
386 | WHERE |
|
387 | group_id = %d', |
|
388 | Db::getTablePrefix(), |
|
389 | $groupId |
|
390 | ); |
|
391 | ||
392 | $res = $this->config->getDb()->query($delete); |
|
393 | if (!$res) { |
|
394 | return false; |
|
395 | } |
|
396 | ||
397 | return true; |
|
398 | } |
|
399 | ||
400 | /** |
|
401 | * Returns true if the user given by $userId is a member of |