Пример #1
0
 /**
  * @param $object
  */
 protected function serviceAuth(ilObjCloud $object)
 {
     global $ilCtrl;
     try {
         $service = ilCloudConnector::getServiceClass($object->getServiceName(), $object->getId());
         $service->authService($ilCtrl->getLinkTarget($this, "afterServiceAuth") . "&authMode=true");
     } catch (Exception $e) {
         ilUtil::sendFailure($e->getMessage(), true);
         ilObjectGUI::redirectToRefId($this->parent_id);
     }
 }
Пример #2
0
 protected function afterSave(ilObjCloud $a_new_object)
 {
     try {
         $form = $this->initCreateForm("cld");
         if ($form->checkInput()) {
             $a_new_object->setServiceName($form->getInput("service"));
             $a_new_object->setRootFolder("/");
             $a_new_object->setOnline(false);
             $a_new_object->setAuthComplete(false);
             $this->plugin_service = new ilCloudPluginService($a_new_object->getServiceName(), $a_new_object->getId());
             $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service);
             if ($init_gui) {
                 $init_gui->afterSavePluginCreation($a_new_object, $form);
             }
             $a_new_object->update();
             $this->serviceAuth($a_new_object);
         }
     } catch (Exception $e) {
         ilUtil::sendFailure($e->getMessage(), true);
         ilObjectGUI::redirectToRefId($this->parent_id);
     }
 }