| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | use BitCode\BitForm\Core\Database\FormEntryModel; |
| 11 | 11 | use BitCode\BitForm\Core\Database\FormModel; |
| 12 | 12 | use BitCode\BitForm\Core\Util\ApiResponse; |
| 13 | +use BitCode\BitForm\Core\Util\IpTool; | |
| 13 | 14 | use BitCode\BitForm\Core\Util\Log; |
| 14 | 15 | use BitCode\BitForm\Core\Util\SmartTags; |
| 15 | 16 | use BitCode\BitForm\Core\Util\Utilities; |
| 16 | 17 | /** |
| @@ -297,9 +298,11 @@ | ||
| 297 | 298 | wp_json_encode($appConfig->details) : $appConfig->details; |
| 298 | 299 | } |
| 299 | 300 | $connectionCategory = 'connected_integration_apps'; |
| 300 | 301 | |
| 301 | - $integrationHandler = new IntegrationHandler(0); | |
| 302 | + // saveIntegration reads user_details['id'|'ip'|'time']; without them the insert | |
| 303 | + // raises null-offset warnings and stores null user_id/created_at | |
| 304 | + $integrationHandler = new IntegrationHandler(0, IpTool::getUserDetail()); | |
| 302 | 305 | |
| 303 | 306 | return $integrationHandler->saveIntegration($connectionName, $connectionType, $connectionDetails, $connectionCategory); |
| 304 | 307 | } |
| 305 | 308 | |
| @@ -333,6 +336,14 @@ | ||
| 333 | 336 | { |
| 334 | 337 | $integrationHandler = new IntegrationHandler(0); |
| 335 | 338 | |
| 336 | 339 | return $integrationHandler->deleteIntegration($appId); |
| 340 | + } | |
| 341 | + | |
| 342 | + public function renameConnectedApp($appId, $name) | |
| 343 | + { | |
| 344 | + // User details carry the time renameConnectedApp() stamps into updated_at. | |
| 345 | + $integrationHandler = new IntegrationHandler(0, IpTool::getUserDetail()); | |
| 346 | + | |
| 347 | + return $integrationHandler->renameConnectedApp($appId, $name); | |
| 337 | 348 | } |
| 338 | 349 | } |