Changeset 3094350
- Timestamp:
- 05/29/2024 08:21:31 AM (22 months ago)
- Location:
- heyrecruit/trunk
- Files:
-
- 6 edited
-
Controller/HeyrecruitController.php (modified) (9 diffs)
-
Controller/HeyrecruitRestApiController.php (modified) (8 diffs)
-
constConfig.php (modified) (1 diff)
-
heyrecruit.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/sections/text.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
heyrecruit/trunk/Controller/HeyrecruitController.php
r3079466 r3094350 13 13 14 14 /** 15 * @var mixed15 * @var string|int|bool 16 16 */ 17 17 private $pageId; … … 369 369 $form->locationId = $this->job['company_location_jobs'][0]['company_location_id']; 370 370 $form->postUrl = HEYRECRUIT_URL . $this->applyPath . '?language=deu&job_id=' . $form->jobId . '&company_location_id=' . $form->locationId; 371 $form->jwt = esc_attr($_SESSION['HEYRECRUIT_TOKEN'] );371 $form->jwt = esc_attr($_SESSION['HEYRECRUIT_TOKEN'] ?? null); 372 372 $form->confirmPage = $this->getOption('confirmPage'); 373 373 … … 635 635 ob_start(); 636 636 637 $textElement = $this->element['job_section_element_strings'][0]['text'] ?? ''; 638 637 639 if ($this->element['element_type'] === 'image') { 638 $data = json_decode($t his->element['job_section_element_strings'][0]['text']) ?? null;640 $data = json_decode($textElement); 639 641 640 642 if (!$data) { … … 644 646 $imageSrc = $data[0]; 645 647 } else { 646 $data = json_decode($this->element['job_section_element_strings'][0]['text']) ?? null; 648 649 $data = json_decode($textElement); 647 650 } 648 651 … … 1361 1364 1362 1365 $args = (object)[ 1363 'showDescription' => $overviewPage->show_description,1364 'description' => $overviewPage->overview_page_strings[0]['description'] ?? null,1366 'showDescription' => $overviewPage->show_description, 1367 'description' => $overviewPage->overview_page_strings[0]['description'] ?? null, 1365 1368 ]; 1366 1369 } … … 1394 1397 $template = 'companyInfoDeactivated.php'; 1395 1398 $companyLocation = $company->company_locations[array_key_first($company->company_locations)]; 1396 1397 1398 1399 1399 1400 if ($overviewPage->show_social_links) { … … 1427 1428 * @param bool|null $default 1428 1429 * 1429 * @return null|mixed1430 * @return object|resource|array|string|float|int|bool|null 1430 1431 */ 1431 1432 public function getOption(string $name, bool $default = null) { … … 1438 1439 * 1439 1440 * @param string $name 1440 * @param mixed|null $value1441 * @param object|resource|array|string|float|int|bool|null $value 1441 1442 * 1442 1443 * @return void … … 1773 1774 * emptyCheck 1774 1775 * 1775 * @param mixed$value1776 * @param string|null $value 1776 1777 * 1777 1778 * @return string|bool 1778 1779 */ 1779 private function emptyCheck( $value): ?string {1780 private function emptyCheck(?string $value): ?string { 1780 1781 1781 1782 return empty($value) ? false : $value; -
heyrecruit/trunk/Controller/HeyrecruitRestApiController.php
r3066361 r3094350 106 106 } 107 107 108 $this->setAuthConfig(); 109 $this->authenticate(); 108 if (isset($_SESSION['HEYRECRUIT_COMPANY']['id']) 109 && $_SESSION['HEYRECRUIT_COMPANY']['id'] !== HEYRECRUIT_COMPANY_ID 110 ) { 111 unset($_SESSION['HEYRECRUIT_TOKEN']); 112 } 113 114 if (HEYRECRUIT_COMPANY_ID && HEYRECRUIT_API_SECRET_KEY) { 115 116 $this->setAuthConfig(); 117 $this->authenticate(); 118 } 110 119 } 111 120 … … 151 160 } 152 161 153 unset($_SESSION['HEYRECRUIT_TOKEN']);154 162 155 163 return ['error' => true]; … … 174 182 public function getCompany(): array { 175 183 176 if (isset($_SESSION['HEYRECRUIT_COMPANY']) && !HEYRECRUIT_DEBUG_MODUS) { 184 if (isset($_SESSION['HEYRECRUIT_COMPANY']) && 185 ($_SESSION['HEYRECRUIT_COMPANY']['id'] ?? 0) === HEYRECRUIT_COMPANY_ID && !HEYRECRUIT_DEBUG_MODUS) { 186 187 unset($_SESSION['HEYRECRUIT_TOKEN']); 177 188 return $_SESSION['HEYRECRUIT_COMPANY']; 178 } 189 190 } 191 179 192 180 193 $result = $this->curlGet($this->path['get_company'] . '/', null); … … 334 347 protected function addApplicant(int $jobId, int $locationId, array $data): array { 335 348 336 $url = $this->path['add_applicant'] . '?job_id=' . $jobId . '&company_location_id=' . $locationId;337 338 return $this->curlPost($url, $data);349 $url = $this->path['add_applicant'] . '?job_id=' . $jobId . '&company_location_id=' . $locationId; 350 351 return $this->curlPost($url, $data); 339 352 } 340 353 … … 359 372 * @param array|null $query 360 373 * 361 * @return mixed374 * @return array 362 375 */ 363 376 private function curlGet(string $url, ?array $query = []): array { … … 366 379 367 380 $queryData = http_build_query($query); 368 $queryData = str_replace(['%5B%5D', '%5B0%5D'], ['[]', ''], $queryData); 381 $queryData = str_replace([ 382 '%5B%5D', 383 '%5B0%5D' 384 ], [ 385 '[]', 386 '' 387 ], $queryData); 369 388 370 389 $query = strpos($url, '?') !== false ? '&' . $queryData : '?' . $queryData; … … 379 398 * @param array $data 380 399 * 381 * @return mixed382 */ 383 private function curlPost(string $path, array $data = []): mixed{400 * @return array 401 */ 402 private function curlPost(string $path, array $data = []): array { 384 403 385 404 return $this->sendCurl($path, $data); … … 393 412 * @param string $sendType 394 413 * 395 * @return mixed396 */ 397 private function sendCurl(string $path, array $data, string $sendType = 'POST'): mixed{414 * @return array 415 */ 416 private function sendCurl(string $path, array $data, string $sendType = 'POST'): array { 398 417 399 418 $dataJson = json_encode($data); -
heyrecruit/trunk/constConfig.php
r3079470 r3094350 3 3 const 4 4 HEYRECRUIT_PLUGIN_NAME = 'Heyrecruit', 5 HEYRECRUIT_VERSION = '1.2. 0',5 HEYRECRUIT_VERSION = '1.2.1', 6 6 HEYRECRUIT_PLUGIN_BASENAME = 'heyrecruit/heyrecruit.php', 7 7 HEYRECRUIT_OPTION_KEY_NAME = 'heyrecruit', -
heyrecruit/trunk/heyrecruit.php
r3079470 r3094350 10 10 11 11 /** 12 * @since 1.2. 012 * @since 1.2.1 13 13 * @package heyrecruit_core 14 14 * @wordpress-plugin 15 15 * Plugin Name: Heyrecruit 16 * Version: 1.2. 016 * Version: 1.2.1 17 17 * Author: Heyrecruit 18 18 * Author URI: https://www.heyrecruit.de -
heyrecruit/trunk/readme.txt
r3079466 r3094350 2 2 Contributors: heyrecruit 3 3 Requires at least: 6.1.1 4 Tested up to: 6.5. 24 Tested up to: 6.5.3 5 5 Requires PHP: 7.4 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 License: GPLv2 8 8 … … 78 78 79 79 == Changelog == 80 = 1.2.1 = 81 *Kompatibilität mit neuerer Version der Heyrecruit-API und PHP v.7.4 hergestellt 82 83 == Changelog == 80 84 = 1.2.0 = 81 *Aufschlüsselung des Shortcodes **[hr_company_info]** in **[hr_company_header]** & **[hr_company_description]** für eine noch individuellere Gestaltung.85 *Aufschlüsselung des Shortcodes **[hr_company_info]** in +*[hr_company_header]** & **[hr_company_description]** für eine noch individuellere Gestaltung. 82 86 *Aufsplittung des Job Headers in die Anzeigen-Details und Anzeigentitel, Anzeigensubtitel und Anzeigenbild. 83 87 *Kopfzeile wird nun mit und ohne Bild zur Verfügung gestellt. -
heyrecruit/trunk/templates/sections/text.php
r3066361 r3094350 1 1 <?php defined('ABSPATH') || exit; ?> 2 2 <span class="hr_text" 3 style="display: block;"><?php echo wp_kses_post($this->element['job_section_element_strings'][0]['html'] ) ?? wp_kses_post($this->element['job_section_element_strings'][0]['text']); ?></span>3 style="display: block;"><?php echo wp_kses_post($this->element['job_section_element_strings'][0]['html']??'') ?? wp_kses_post($this->element['job_section_element_strings'][0]['text']??''); ?></span>
Note: See TracChangeset
for help on using the changeset viewer.