/** * @return ilOneDrivePlugin */ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * @return bool */ protected function addItemsAfter() { if (!$this->node->getIsDir()) { $exoFile = exodItemCache::get($this->node->getId()); if (!$exoFile instanceof exodFile) { $exoFile = $this->getService()->getClient()->getFileObject($this->node->getPath()); } if ($exoFile->getMsURL()) { $this->selection_list->addItem(ilOneDrivePlugin::getInstance()->txt('asl_open_msoffice'), 'ms', $exoFile->getMsURL(), '', '', '_blank'); } } return true; }
/** * @return exodAppBusiness * @throws ilCloudException */ public function getExodApp() { $exodBearerToken = $this->getTokenObject(); $inst = ilOneDrivePlugin::getInstance()->getExodApp($exodBearerToken); // echo '<pre>' . print_r($this->getTokenObject(), 1) . '</pre>'; // var_dump($inst->isTokenValid()); // FSX // exit; if (!$inst->isTokenValid()) { // $inst->getExodAuth()->authenticate(ilLink::_getLink($_GET['ref_id'])); } if (!$inst->isTokenValid()) { global $ilUser; if ($ilUser->getId() == $this->getOwnerId()) { if ($inst->checkAndRefreshToken()) { $this->storeToken($inst->getExodBearerToken()); } } else { throw new ilCloudException(ilCloudException::AUTHENTICATION_FAILED, 'Der Ordner kann zur Zeit nur vom Besitzer geöffnet werden.'); } } else { } return $inst; }
<#1> <?php include_once "./Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/classes/class.ilOneDrivePlugin.php"; $plugin_object = ilOneDrivePlugin::getInstance(); $fields = array('id' => array('type' => 'integer', 'length' => 8, 'notnull' => true), 'access_token' => array('type' => 'text', 'length' => 2000), 'refresh_token' => array('type' => 'text', 'length' => 2000), 'public_link' => array('type' => 'boolean'), 'max_file_size' => array('type' => 'text', 'length' => 256), 'valid_through' => array('type' => 'integer', 'length' => 8), 'validation_user_id' => array('type' => 'integer', 'length' => 8)); global $ilDB; $ilDB->createTable($plugin_object->getPluginTableName(), $fields); $ilDB->addPrimaryKey($plugin_object->getPluginTableName(), array("id")); ?> <#2> <?php include_once "./Modules/Cloud/classes/class.ilCloudPluginConfig.php"; include_once "./Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/classes/class.ilOneDrivePlugin.php"; $plugin_object = ilOneDrivePlugin::getInstance(); $config_object = new ilCloudPluginConfig($plugin_object->getPluginConfigTableName()); $config_object->initDB();
<?php chdir('../../../../../../../'); require_once './Services/Init/classes/class.ilInitialisation.php'; ilInitialisation::initILIAS(); require_once './Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/classes/Auth/class.exodAuthFactory.php'; require_once './Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/classes/class.ilOneDrivePlugin.php'; ilOneDrivePlugin::getInstance()->getExodApp(new exodBearerToken())->getExodAuth()->redirectToObject(); exit;