ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCertificateMigrationInteraction.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
10 
16 {
17  const OPTION_GOTO_LIST = 'listCertificates';
18  const OPTION_CANCEL = 'cancel';
19 
23  public function getInputTypes() : array
24  {
25  return [
26  new SingleType(IntegerValue::class),
27  new SingleType(IntegerValue::class),
28  ];
29  }
30 
34  public function getOutputType() : SingleType
35  {
36  return new SingleType(StringValue::class);
37  }
38 
42  public function getRemoveOption()
43  {
44  return new UserInteractionOption('remove', self::OPTION_CANCEL);
45  }
46 
51  public function getOptions(array $input) : array
52  {
53  return [
54  new UserInteractionOption('my_certificates', self::OPTION_GOTO_LIST),
55  ];
56  }
57 
64  public function interaction(array $input, \ILIAS\BackgroundTasks\Task\UserInteraction\Option $user_selected_option, \ILIAS\BackgroundTasks\Bucket $bucket)
65  {
66  global $DIC;
67 
68  $progress = $input[0]->getValue();
69  $user_id = $input[1]->getValue();
70  $logger = $DIC->logger()->cert();
71 
72  $logger->debug('User interaction certificate migration for user with id: ' . $user_id);
73  $logger->debug('User interaction certificate migration State: ' . $bucket->getState());
74  if ($user_selected_option->getValue() != self::OPTION_GOTO_LIST) {
75  $logger->info('User interaction certificate migration canceled for user with id: ' . $user_id);
76  return $input;
77  }
78 
79  $DIC->ctrl()->redirectByClass([
80  'ilPersonalDesktopGUI',
81  'ilAchievementsGUI',
82  'ilUserCertificateGUI'
83  ], 'listCertificates');
84 
85  return $input;
86  }
87 }
global $DIC
Definition: saml.php:7
Class BaseForm.
interaction(array $input, \ILIAS\BackgroundTasks\Task\UserInteraction\Option $user_selected_option, \ILIAS\BackgroundTasks\Bucket $bucket)
Class ilCertificateMigrationInteraction.