@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | * This function multiplies blocks. |
| 261 | 261 | * |
| 262 | 262 | * @param string $block Blockname |
| 263 | - * @param array $blockContent Content of block |
|
| 263 | + * @param string $blockContent Content of block |
|
| 264 | 264 | * |
| 265 | 265 | * @return string implode('', $tmpBlock) |
| 266 | 266 | */ |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * |
| 352 | 352 | * @param string $content Content to check |
| 353 | 353 | * |
| 354 | - * @return array |
|
| 354 | + * @return string |
|
| 355 | 355 | */ |
| 356 | 356 | private function _checkContent($content) |
| 357 | 357 | { |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | * |
| 184 | 184 | * @param string $val Value |
| 185 | 185 | * |
| 186 | - * @return bool |
|
| 186 | + * @return integer |
|
| 187 | 187 | */ |
| 188 | 188 | public function isValIgnorable($val) |
| 189 | 189 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $exemplaryNPlurals = intval($exemplary['PMF_LANG[nplurals]']); |
| 96 | 96 | $toCheckNPlurals = intval($toCheck['PMF_LANG[nplurals]']); |
| 97 | 97 | // One English plural form is equal to (xx/en) of xx plural forms (1/2, 2/2, 3/2,..,6/2..) |
| 98 | - $pluralsRatio = ($toCheckNPlurals != -1) ? ($toCheckNPlurals / $exemplaryNPlurals) : 1; |
|
| 98 | + $pluralsRatio = ($toCheckNPlurals != -1) ? ($toCheckNPlurals/$exemplaryNPlurals) : 1; |
|
| 99 | 99 | |
| 100 | 100 | $retval = $countAll = $countTranslated = 0; |
| 101 | 101 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $retval = floor(100 * $countTranslated / $countAll); |
|
| 128 | + $retval = floor(100*$countTranslated/$countAll); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | unset($exemplary, $toCheck); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | * @param string $pass Password |
| 493 | 493 | * @param int $userId User ID |
| 494 | 494 | * |
| 495 | - * @return mixed |
|
| 495 | + * @return boolean |
|
| 496 | 496 | */ |
| 497 | 497 | public function createUser($login, $pass = '', $userId = 0) |
| 498 | 498 | { |
@@ -1107,6 +1107,8 @@ discard block |
||
| 1107 | 1107 | /** |
| 1108 | 1108 | * Sends mail to the current user. |
| 1109 | 1109 | * |
| 1110 | + * @param string $subject |
|
| 1111 | + * @param string $message |
|
| 1110 | 1112 | * @return bool |
| 1111 | 1113 | */ |
| 1112 | 1114 | public function mailUser($subject, $message) |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | public function getUserId() |
| 243 | 243 | { |
| 244 | 244 | if (isset($this->userId) && is_int($this->userId)) { |
| 245 | - return (int) $this->userId; |
|
| 245 | + return (int)$this->userId; |
|
| 246 | 246 | } |
| 247 | 247 | $this->userId = -1; |
| 248 | 248 | $this->errors[] = self::ERROR_USER_NO_USERID; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | WHERE |
| 272 | 272 | user_id = %d '.($allowBlockedUsers ? '' : "AND account_status != 'blocked'"), |
| 273 | 273 | PMF_Db::getTablePrefix(), |
| 274 | - (int) $userId |
|
| 274 | + (int)$userId |
|
| 275 | 275 | ); |
| 276 | 276 | |
| 277 | 277 | $res = $this->config->getDb()->query($select); |
@@ -281,9 +281,9 @@ discard block |
||
| 281 | 281 | return false; |
| 282 | 282 | } |
| 283 | 283 | $user = $this->config->getDb()->fetchArray($res); |
| 284 | - $this->userId = (int) $user['user_id']; |
|
| 285 | - $this->login = (string) $user['login']; |
|
| 286 | - $this->status = (string) $user['account_status']; |
|
| 284 | + $this->userId = (int)$user['user_id']; |
|
| 285 | + $this->login = (string)$user['login']; |
|
| 286 | + $this->status = (string)$user['account_status']; |
|
| 287 | 287 | |
| 288 | 288 | // get encrypted password |
| 289 | 289 | // @todo: Add a getEncPassword method to the Auth* classes for the (local and remote) Auth Sources. |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | return false; |
| 349 | 349 | } |
| 350 | 350 | $user = $this->config->getDb()->fetchArray($res); |
| 351 | - $this->userId = (int) $user['user_id']; |
|
| 352 | - $this->login = (string) $user['login']; |
|
| 353 | - $this->status = (string) $user['account_status']; |
|
| 351 | + $this->userId = (int)$user['user_id']; |
|
| 352 | + $this->login = (string)$user['login']; |
|
| 353 | + $this->status = (string)$user['account_status']; |
|
| 354 | 354 | |
| 355 | 355 | // get user-data |
| 356 | 356 | if (!$this->userdata instanceof PMF_User_UserData) { |
@@ -397,9 +397,9 @@ discard block |
||
| 397 | 397 | return false; |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | - $this->userId = (int) $user['user_id']; |
|
| 401 | - $this->login = (string) $user['login']; |
|
| 402 | - $this->status = (string) $user['account_status']; |
|
| 400 | + $this->userId = (int)$user['user_id']; |
|
| 401 | + $this->login = (string)$user['login']; |
|
| 402 | + $this->status = (string)$user['account_status']; |
|
| 403 | 403 | |
| 404 | 404 | // get user-data |
| 405 | 405 | if (!$this->userdata instanceof PMF_User_UserData) { |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | // is $login valid? |
| 506 | - $login = (string) $login; |
|
| 506 | + $login = (string)$login; |
|
| 507 | 507 | if (!$this->isValidLogin($login)) { |
| 508 | 508 | $this->errors[] = self::ERROR_USER_LOGINNAME_TOO_SHORT; |
| 509 | 509 | |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | |
| 520 | 520 | // set user-ID |
| 521 | 521 | if (0 == $userId) { |
| 522 | - $this->userId = (int) $this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faquser', 'user_id'); |
|
| 522 | + $this->userId = (int)$this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faquser', 'user_id'); |
|
| 523 | 523 | } else { |
| 524 | 524 | $this->userId = $userId; |
| 525 | 525 | } |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | */ |
| 776 | 776 | public function isValidLogin($login) |
| 777 | 777 | { |
| 778 | - $login = (string) $login; |
|
| 778 | + $login = (string)$login; |
|
| 779 | 779 | |
| 780 | 780 | if (strlen($login) < $this->loginMinLength || !preg_match($this->validUsername, $login)) { |
| 781 | 781 | $this->errors[] = self::ERROR_USER_LOGIN_INVALID; |
@@ -1059,12 +1059,12 @@ discard block |
||
| 1059 | 1059 | // To make passwords harder to get wrong, a few letters & numbers have been omitted. |
| 1060 | 1060 | // This will ensure safety with browsers using fonts with confusable letters. |
| 1061 | 1061 | // Removed: o,O,0,1,l,L |
| 1062 | - $consonants = ['b','c','d','f','g','h','j','k','m','n','p','r','s','t','v','w','x','y','z']; |
|
| 1063 | - $vowels = ['a','e','i','u']; |
|
| 1062 | + $consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']; |
|
| 1063 | + $vowels = ['a', 'e', 'i', 'u']; |
|
| 1064 | 1064 | $newPassword = ''; |
| 1065 | 1065 | $skipped = false; |
| 1066 | 1066 | |
| 1067 | - srand((double) microtime() * 1000000); |
|
| 1067 | + srand((double)microtime()*1000000); |
|
| 1068 | 1068 | |
| 1069 | 1069 | while (strlen($newPassword) < $minimumLength) { |
| 1070 | 1070 | if (rand(0, 1)) { |
@@ -1074,9 +1074,7 @@ discard block |
||
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | switch (rand(0, $skipped ? 3 : ($allowUnderscore ? 5 : 4))) { |
| 1077 | - case 0: |
|
| 1078 | - case 1: |
|
| 1079 | - $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
| 1077 | + case 0 : case 1 : $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
| 1080 | 1078 | break; |
| 1081 | 1079 | case 2: |
| 1082 | 1080 | case 3: |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | * Returns the field $field of the user data. If $field is an |
| 72 | 72 | * array, an associative array will be returned. |
| 73 | 73 | * |
| 74 | - * @param mixed $field Field(s) |
|
| 74 | + * @param string $field Field(s) |
|
| 75 | 75 | * |
| 76 | 76 | * @return mixed |
| 77 | 77 | */ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function load($userId) |
| 184 | 184 | { |
| 185 | - $userId = (int) $userId; |
|
| 185 | + $userId = (int)$userId; |
|
| 186 | 186 | if (($userId <= 0) && ($userId != -1)) { |
| 187 | 187 | return false; |
| 188 | 188 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function add($userId) |
| 252 | 252 | { |
| 253 | - $userId = (int) $userId; |
|
| 253 | + $userId = (int)$userId; |
|
| 254 | 254 | if (($userId <= 0) && ($userId != -1)) { |
| 255 | 255 | return false; |
| 256 | 256 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function delete($userId) |
| 287 | 287 | { |
| 288 | - $userId = (int) $userId; |
|
| 288 | + $userId = (int)$userId; |
|
| 289 | 289 | if (($userId <= 0) && ($userId != -1)) { |
| 290 | 290 | return false; |
| 291 | 291 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @param string $lang Language |
| 127 | 127 | * |
| 128 | - * @return bool |
|
| 128 | + * @return integer |
|
| 129 | 129 | */ |
| 130 | 130 | public static function isLanguage($lang) |
| 131 | 131 | { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @param int $date Date |
| 139 | 139 | * |
| 140 | - * @return int |
|
| 140 | + * @return boolean |
|
| 141 | 141 | */ |
| 142 | 142 | public static function isLikeOnPMFDate($date) |
| 143 | 143 | { |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | /** |
| 320 | 320 | * debug_backtrace() wrapper function. |
| 321 | 321 | * |
| 322 | - * @param $string |
|
| 322 | + * @param string $string |
|
| 323 | 323 | * |
| 324 | 324 | * @return string |
| 325 | 325 | */ |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $dateEnd = PMF_Filter::filterInput(INPUT_POST, 'dateEnd', FILTER_SANITIZE_STRING); |
| 42 | 42 | $question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRING); |
| 43 | 43 | $categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, |
| 44 | - 'flags' => FILTER_REQUIRE_ARRAY, ))); |
|
| 44 | + 'flags' => FILTER_REQUIRE_ARRAY, ))); |
|
| 45 | 45 | $record_lang = PMF_Filter::filterInput(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
| 46 | 46 | $tags = PMF_Filter::filterInput(INPUT_POST, 'tags', FILTER_SANITIZE_STRING); |
| 47 | 47 | $active = PMF_Filter::filterInput(INPUT_POST, 'active', FILTER_SANITIZE_STRING); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $dateEnd = PMF_Filter::filterInput(INPUT_POST, 'dateEnd', FILTER_SANITIZE_STRING); |
| 42 | 42 | $question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRING); |
| 43 | 43 | $categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, |
| 44 | - 'flags' => FILTER_REQUIRE_ARRAY, ))); |
|
| 44 | + 'flags' => FILTER_REQUIRE_ARRAY,))); |
|
| 45 | 45 | $record_lang = PMF_Filter::filterInput(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
| 46 | 46 | $tags = PMF_Filter::filterInput(INPUT_POST, 'tags', FILTER_SANITIZE_STRING); |
| 47 | 47 | $active = PMF_Filter::filterInput(INPUT_POST, 'active', FILTER_SANITIZE_STRING); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | if (empty($ajaxData['categories'])) { |
| 51 | 51 | $categories = array(-1); // Access for all users and groups |
| 52 | 52 | } else { |
| 53 | - $categories = explode(',', (int) $ajaxData['categories']); |
|
| 53 | + $categories = explode(',', (int)$ajaxData['categories']); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | echo json_encode( |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | foreach ($userList as $single_user) { |
| 67 | 67 | $user->getUserById($single_user, true); |
| 68 | 68 | $users[] = array('user_id' => $user->getUserId(), |
| 69 | - 'login' => $user->getLogin(), ); |
|
| 69 | + 'login' => $user->getLogin(), ); |
|
| 70 | 70 | } |
| 71 | 71 | echo json_encode($users); |
| 72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | foreach ($memberList as $single_member) { |
| 79 | 79 | $user->getUserById($single_member, true); |
| 80 | 80 | $members[] = array('user_id' => $user->getUserId(), |
| 81 | - 'login' => $user->getLogin(), ); |
|
| 81 | + 'login' => $user->getLogin(), ); |
|
| 82 | 82 | } |
| 83 | 83 | echo json_encode($members); |
| 84 | 84 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | foreach ($userList as $single_user) { |
| 67 | 67 | $user->getUserById($single_user, true); |
| 68 | 68 | $users[] = array('user_id' => $user->getUserId(), |
| 69 | - 'login' => $user->getLogin(), ); |
|
| 69 | + 'login' => $user->getLogin(),); |
|
| 70 | 70 | } |
| 71 | 71 | echo json_encode($users); |
| 72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | foreach ($memberList as $single_member) { |
| 79 | 79 | $user->getUserById($single_member, true); |
| 80 | 80 | $members[] = array('user_id' => $user->getUserId(), |
| 81 | - 'login' => $user->getLogin(), ); |
|
| 81 | + 'login' => $user->getLogin(),); |
|
| 82 | 82 | } |
| 83 | 83 | echo json_encode($members); |
| 84 | 84 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | foreach ($items as $item) { |
| 57 | 57 | if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
| 58 | - echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active'); |
|
| 58 | + echo $faq->updateRecordFlag((int)$item[0], addslashes($item[1]), $item[2], 'active'); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | foreach ($items as $item) { |
| 74 | 74 | if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
| 75 | - echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky'); |
|
| 75 | + echo $faq->updateRecordFlag((int)$item[0], addslashes($item[1]), $item[2], 'sticky'); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if (!is_null($questionIds['questions'])) { |
| 134 | 134 | foreach ($questionIds['questions'] as $questionId) { |
| 135 | - $faq->deleteQuestion((int) $questionId); |
|
| 135 | + $faq->deleteQuestion((int)$questionId); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | echo $PMF_LANG['ad_entry_delsuc']; |
@@ -48,98 +48,98 @@ |
||
| 48 | 48 | switch ($ajax_action) { |
| 49 | 49 | |
| 50 | 50 | // save active FAQs |
| 51 | - case 'save_active_records': |
|
| 52 | - if ($user->perm->checkRight($user->getUserId(), 'approverec')) { |
|
| 53 | - if (!empty($items)) { |
|
| 54 | - $faq = new PMF_Faq($faqConfig); |
|
| 55 | - |
|
| 56 | - foreach ($items as $item) { |
|
| 57 | - if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
|
| 58 | - echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active'); |
|
| 51 | + case 'save_active_records': |
|
| 52 | + if ($user->perm->checkRight($user->getUserId(), 'approverec')) { |
|
| 53 | + if (!empty($items)) { |
|
| 54 | + $faq = new PMF_Faq($faqConfig); |
|
| 55 | + |
|
| 56 | + foreach ($items as $item) { |
|
| 57 | + if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
|
| 58 | + echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active'); |
|
| 59 | + } |
|
| 59 | 60 | } |
| 60 | 61 | } |
| 62 | + } else { |
|
| 63 | + echo $PMF_LANG['err_NotAuth']; |
|
| 61 | 64 | } |
| 62 | - } else { |
|
| 63 | - echo $PMF_LANG['err_NotAuth']; |
|
| 64 | - } |
|
| 65 | - break; |
|
| 66 | - |
|
| 67 | - // save sticky FAQs |
|
| 68 | - case 'save_sticky_records': |
|
| 69 | - if ($user->perm->checkRight($user->getUserId(), 'editbt')) { |
|
| 70 | - if (!empty($items)) { |
|
| 71 | - $faq = new PMF_Faq($faqConfig); |
|
| 72 | - |
|
| 73 | - foreach ($items as $item) { |
|
| 74 | - if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
|
| 75 | - echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky'); |
|
| 65 | + break; |
|
| 66 | + |
|
| 67 | + // save sticky FAQs |
|
| 68 | + case 'save_sticky_records': |
|
| 69 | + if ($user->perm->checkRight($user->getUserId(), 'editbt')) { |
|
| 70 | + if (!empty($items)) { |
|
| 71 | + $faq = new PMF_Faq($faqConfig); |
|
| 72 | + |
|
| 73 | + foreach ($items as $item) { |
|
| 74 | + if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) { |
|
| 75 | + echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky'); |
|
| 76 | + } |
|
| 76 | 77 | } |
| 77 | 78 | } |
| 79 | + } else { |
|
| 80 | + echo $PMF_LANG['err_NotAuth']; |
|
| 78 | 81 | } |
| 79 | - } else { |
|
| 80 | - echo $PMF_LANG['err_NotAuth']; |
|
| 81 | - } |
|
| 82 | - break; |
|
| 82 | + break; |
|
| 83 | 83 | |
| 84 | - // search FAQs for suggestions |
|
| 85 | - case 'search_records': |
|
| 86 | - if ($user->perm->checkRight($user->getUserId(), 'editbt')) { |
|
| 87 | - $faq = new PMF_Faq($faqConfig); |
|
| 88 | - $faqSearch = new PMF_Search($faqConfig); |
|
| 89 | - $faqSearch->setCategory(new PMF_Category($faqConfig)); |
|
| 90 | - $faqSearchResult = new PMF_Search_Resultset($user, $faq, $faqConfig); |
|
| 91 | - $searchResult = ''; |
|
| 92 | - $searchString = PMF_Filter::filterInput(INPUT_POST, 'search', FILTER_SANITIZE_STRIPPED); |
|
| 84 | + // search FAQs for suggestions |
|
| 85 | + case 'search_records': |
|
| 86 | + if ($user->perm->checkRight($user->getUserId(), 'editbt')) { |
|
| 87 | + $faq = new PMF_Faq($faqConfig); |
|
| 88 | + $faqSearch = new PMF_Search($faqConfig); |
|
| 89 | + $faqSearch->setCategory(new PMF_Category($faqConfig)); |
|
| 90 | + $faqSearchResult = new PMF_Search_Resultset($user, $faq, $faqConfig); |
|
| 91 | + $searchResult = ''; |
|
| 92 | + $searchString = PMF_Filter::filterInput(INPUT_POST, 'search', FILTER_SANITIZE_STRIPPED); |
|
| 93 | 93 | |
| 94 | - if (!is_null($searchString)) { |
|
| 94 | + if (!is_null($searchString)) { |
|
| 95 | 95 | |
| 96 | - $searchResult = $faqSearch->search($searchString, false); |
|
| 96 | + $searchResult = $faqSearch->search($searchString, false); |
|
| 97 | 97 | |
| 98 | - $faqSearchResult->reviewResultset($searchResult); |
|
| 98 | + $faqSearchResult->reviewResultset($searchResult); |
|
| 99 | 99 | |
| 100 | - $searchHelper = new PMF_Helper_Search($faqConfig); |
|
| 101 | - $searchHelper->setSearchterm($searchString); |
|
| 100 | + $searchHelper = new PMF_Helper_Search($faqConfig); |
|
| 101 | + $searchHelper->setSearchterm($searchString); |
|
| 102 | 102 | |
| 103 | - echo $searchHelper->renderAdminSuggestionResult($faqSearchResult); |
|
| 103 | + echo $searchHelper->renderAdminSuggestionResult($faqSearchResult); |
|
| 104 | + } |
|
| 105 | + } else { |
|
| 106 | + echo $PMF_LANG['err_NotAuth']; |
|
| 104 | 107 | } |
| 105 | - } else { |
|
| 106 | - echo $PMF_LANG['err_NotAuth']; |
|
| 107 | - } |
|
| 108 | - break; |
|
| 109 | - |
|
| 110 | - // delete FAQs |
|
| 111 | - case 'delete_record': |
|
| 112 | - if ($user->perm->checkRight($user->getUserId(), 'delbt')) { |
|
| 113 | - $recordId = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT); |
|
| 114 | - $recordLang = PMF_Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING); |
|
| 115 | - |
|
| 116 | - $logging = new PMF_Logging($faqConfig); |
|
| 117 | - $logging->logAdmin($user, 'Deleted FAQ ID '.$recordId); |
|
| 118 | - |
|
| 119 | - $faq->deleteRecord($recordId, $recordLang); |
|
| 120 | - echo $PMF_LANG['ad_entry_delsuc']; |
|
| 121 | - } else { |
|
| 122 | - echo $PMF_LANG['err_NotAuth']; |
|
| 123 | - } |
|
| 124 | - break; |
|
| 125 | - |
|
| 126 | - // delete open questions |
|
| 127 | - case 'delete_question': |
|
| 128 | - if ($user->perm->checkRight($user->getUserId(), 'delquestion')) { |
|
| 129 | - $checks = array( |
|
| 130 | - 'filter' => FILTER_VALIDATE_INT, |
|
| 131 | - 'flags' => FILTER_REQUIRE_ARRAY, |
|
| 132 | - ); |
|
| 133 | - $questionIds = PMF_Filter::filterInputArray(INPUT_POST, array('questions' => $checks)); |
|
| 134 | - |
|
| 135 | - if (!is_null($questionIds['questions'])) { |
|
| 136 | - foreach ($questionIds['questions'] as $questionId) { |
|
| 137 | - $faq->deleteQuestion((int) $questionId); |
|
| 108 | + break; |
|
| 109 | + |
|
| 110 | + // delete FAQs |
|
| 111 | + case 'delete_record': |
|
| 112 | + if ($user->perm->checkRight($user->getUserId(), 'delbt')) { |
|
| 113 | + $recordId = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT); |
|
| 114 | + $recordLang = PMF_Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING); |
|
| 115 | + |
|
| 116 | + $logging = new PMF_Logging($faqConfig); |
|
| 117 | + $logging->logAdmin($user, 'Deleted FAQ ID '.$recordId); |
|
| 118 | + |
|
| 119 | + $faq->deleteRecord($recordId, $recordLang); |
|
| 120 | + echo $PMF_LANG['ad_entry_delsuc']; |
|
| 121 | + } else { |
|
| 122 | + echo $PMF_LANG['err_NotAuth']; |
|
| 123 | + } |
|
| 124 | + break; |
|
| 125 | + |
|
| 126 | + // delete open questions |
|
| 127 | + case 'delete_question': |
|
| 128 | + if ($user->perm->checkRight($user->getUserId(), 'delquestion')) { |
|
| 129 | + $checks = array( |
|
| 130 | + 'filter' => FILTER_VALIDATE_INT, |
|
| 131 | + 'flags' => FILTER_REQUIRE_ARRAY, |
|
| 132 | + ); |
|
| 133 | + $questionIds = PMF_Filter::filterInputArray(INPUT_POST, array('questions' => $checks)); |
|
| 134 | + |
|
| 135 | + if (!is_null($questionIds['questions'])) { |
|
| 136 | + foreach ($questionIds['questions'] as $questionId) { |
|
| 137 | + $faq->deleteQuestion((int) $questionId); |
|
| 138 | + } |
|
| 138 | 139 | } |
| 140 | + echo $PMF_LANG['ad_entry_delsuc']; |
|
| 141 | + } else { |
|
| 142 | + echo $PMF_LANG['err_NotAuth']; |
|
| 139 | 143 | } |
| 140 | - echo $PMF_LANG['ad_entry_delsuc']; |
|
| 141 | - } else { |
|
| 142 | - echo $PMF_LANG['err_NotAuth']; |
|
| 143 | - } |
|
| 144 | - break; |
|
| 144 | + break; |
|
| 145 | 145 | } |