Skip to content

Commit

Permalink
renamed files
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaHerrmann committed Jul 4, 2017
1 parent 2086cfe commit 165ce56
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
Empty file modified classes/Differenz
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions classes/configuration_exception.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace repository_owncloud2;
namespace repository_owncloud;

defined('MOODLE_INTERNAL') || die();

Expand All @@ -37,6 +37,6 @@ class configuration_exception extends \moodle_exception {
* @param string $debuginfo detailed information how to fix problem
*/
public function __construct($hint = '', $debuginfo = null) {
parent::__construct('exception_config', 'repository_owncloud2', '', $hint, $debuginfo);
parent::__construct('exception_config', 'repository_owncloud', '', $hint, $debuginfo);
}
}
4 changes: 2 additions & 2 deletions classes/owncloud_client2.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace repository_owncloud2;
namespace repository_owncloud;
use core_php_time_limit;

/**
Expand All @@ -35,7 +35,7 @@
* @version 0.1.5
*/

class owncloud_client2 {
class owncloud_client {

/**#@+
* @access private
Expand Down
Empty file modified codecov.yml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
defined('MOODLE_INTERNAL') || die();

$capabilities = array(
'repository/owncloud2:view' => array(
'repository/owncloud:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// General.
$string['pluginname'] = 'ownCloud2';
$string['pluginname'] = 'ownCloud';
$string['configplugin'] = 'ownCloud repository configuration';
$string['owncloud2'] = 'ownCloud2';
$string['owncloud2:view'] = 'View ownCloud2';
$string['configplugin'] = 'ownCloud2 configuration';
$string['pluginname_help'] = 'ownCloud2 repository';
$string['owncloud'] = 'ownCloud';
$string['owncloud:view'] = 'View ownCloud';
$string['configplugin'] = 'ownCloud configuration';
$string['pluginname_help'] = 'ownCloud repository';

// Settings reminder.
$string['settings_withoutissuer'] = 'You have not added an OAuth2 issuer yet.';
Expand Down
32 changes: 16 additions & 16 deletions lib.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @package repository_owncloud
* @copyright 2017 Westfälische Wilhelms-Universität Münster (WWU Münster)
* @author Projektseminar Uni Münster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or
*/

// @codeCoverageIgnoreStart
Expand All @@ -36,7 +36,7 @@
* @author Projektseminar Uni Münster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class repository_owncloud2 extends repository {
class repository_owncloud extends repository {

/**
* OAuth 2 client
Expand All @@ -53,7 +53,7 @@ class repository_owncloud2 extends repository {
private $dav = null;

/**
* repository_owncloud2 constructor.
* repository_owncloud constructor.
* @param int $repositoryid
* @param bool|int|stdClass $context
* @param array $options
Expand All @@ -62,7 +62,7 @@ public function __construct($repositoryid, $context = SYSCONTEXTID, $options = a
parent::__construct($repositoryid, $context, $options);
try {
// Issuer from config table
$issuerid = get_config('owncloud2', 'issuerid');
$issuerid = get_config('owncloud', 'issuerid');
$this->issuer = \core\oauth2\api::get_issuer($issuerid);
} catch (dml_missing_record_exception $e) {
// A Repository is marked as disabled when no issuer is present.
Expand Down Expand Up @@ -90,14 +90,14 @@ public function __construct($repositoryid, $context = SYSCONTEXTID, $options = a
/**
* Initiates the webdav client.
* @param $issuerid
* @throws \repository_owncloud2\configuration_exception
* @throws \repository_owncloud\configuration_exception
*/
public function initiate_webdavclient($issuerid) {
try {
$issuer = \core\oauth2\api::get_issuer($issuerid);
$baseurl = $issuer->get('baseurl');
} catch (Exception $e) {
$newexception = new \repository_owncloud2\configuration_exception();
$newexception = new \repository_owncloud\configuration_exception();
throw $newexception;
}
$https = 'https://';
Expand All @@ -114,16 +114,16 @@ public function initiate_webdavclient($issuerid) {
$server = substr($baseurl, 7);
}
if (empty($webdavport)) {
$newexception = new \repository_owncloud2\configuration_exception();
$newexception = new \repository_owncloud\configuration_exception();
throw $newexception;
}
} else {
$newexception = new \repository_owncloud2\configuration_exception();
$newexception = new \repository_owncloud\configuration_exception();
throw $newexception;
}
// Authentication method is set to Bearer, since we use OAuth 2.0.
// repository_googledocs\rest
$this->dav = new repository_owncloud2\owncloud_client2($server, '', '', 'bearer', $webdavtype);
$this->dav = new repository_owncloud\owncloud_client($server, '', '', 'bearer', $webdavtype);
$this->dav->port = $webdavport;
$this->dav->debug = false;
}
Expand Down Expand Up @@ -498,7 +498,7 @@ public static function type_config_form($mform, $classname = 'repository') {
$issuers = core\oauth2\api::get_all_issuers();
$types = array();

$issuerid = get_config('owncloud2', 'issuerid');
$issuerid = get_config('owncloud', 'issuerid');

// Validates which issuers implement the right endpoints.
$validissuers = '';
Expand Down Expand Up @@ -534,23 +534,23 @@ public static function type_config_form($mform, $classname = 'repository') {
if (!empty($issuerid)) {
$bool = strpos($validissuers, $types[$issuerid]);
if (!is_int($bool)) {
$text .= get_string('invalid_issuer', 'repository_owncloud2', $types[$issuerid]);
$text .= get_string('invalid_issuer', 'repository_owncloud', $types[$issuerid]);
$urgency = 'error';
} else {
$text .= get_string('settings_withissuer', 'repository_owncloud2', $types[$issuerid]);
$text .= get_string('settings_withissuer', 'repository_owncloud', $types[$issuerid]);
$urgency = 'info';
}
} else {
$text .= get_string('settings_withoutissuer', 'repository_owncloud2');
$text .= get_string('settings_withoutissuer', 'repository_owncloud');
$urgency = 'warning';
}
$html = $OUTPUT->notification($text , $urgency);
$mform->addElement('html', $html);
$select = $mform->addElement('select', 'issuerid', 'Issuer', $types);
$mform->addRule('issuerid', $strrequired, 'required', null, 'issuer');
$mform->addHelpButton('issuerid', 'chooseissuer', 'repository_owncloud2');
$mform->addHelpButton('issuerid', 'chooseissuer', 'repository_owncloud');
$mform->setType('issuerid', PARAM_RAW_TRIMMED);
$mform->addElement('html', get_string('right_issuers', 'repository_owncloud2', $validissuers));
$mform->addElement('html', get_string('right_issuers', 'repository_owncloud', $validissuers));
if (!empty($issuerid)) {
$select->setSelected($issuerid);
}
Expand Down Expand Up @@ -609,7 +609,7 @@ private function get_parsedurl($endpointname) {

$webdavurl = $this->issuer->get_endpoint_url($endpointname);
if (empty($webdavurl)) {
$exception = new \repository_owncloud2\configuration_exception();
$exception = new \repository_owncloud\configuration_exception();
throw $exception;
}
// $parseurl = scheme https host sns-testing.sciebo.de port 443 path /remote.php/webdav
Expand Down
Empty file modified pix/file_picker_files.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified pix/file_picker_login.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified pix/icon.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/generator/lib.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
* @author Projektseminar Uni Münster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class repository_owncloud2_generator extends testing_repository_generator {
class repository_owncloud_generator extends testing_repository_generator {
}
10 changes: 5 additions & 5 deletions tests/repository_owncloud2_test.php → tests/repository_owncloud_test.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@

global $CFG;

class repository_owncloud2_testcase extends advanced_testcase {
class repository_owncloud_testcase extends advanced_testcase {

/** @var null|repository_owncloud the repository_owncloud object, which the tests are run on. */
private $repo = null;

/**
* Sets up the tested repository_owncloud object and all data records which are
* Sets up the tested minor repository_owncloud object and all data records which are
* needed to initialize the repository.
*/
protected function setUp() {
global $DB;
$this->resetAfterTest(true);

$typeparams = array('type' => 'owncloud2', 'visible' => 0, 'issuerid' => 1, 'validissuers' => '');
$typeparams = array('type' => 'owncloud', 'visible' => 0, 'issuerid' => 1, 'validissuers' => '');
// First, create a owncloud repository type and instance.
$generator = $this->getDataGenerator()->get_plugin_generator('repository_owncloud2');
$generator = $this->getDataGenerator()->get_plugin_generator('repository_owncloud');
$reptype = $generator->create_type($typeparams);

// Then insert a name for the instance into the database.
$instance = $DB->get_record('repository_instances', array('typeid' => $reptype->id));
$DB->update_record('repository_instances', (object) array('id' => $instance->id, 'name' => 'ownCloud'));

// At last, create a repository_owncloud object from the instance id.
$this->repo = new repository_owncloud2($instance->id);
$this->repo = new repository_owncloud($instance->id);
$this->repo->options['typeid'] = $reptype->id;
}

Expand Down
8 changes: 4 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

// additional
/**
* Version.php for ownCloud repository.
*
Expand All @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017062101; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2017070400; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016052300; // Requires Moodle 3.1 version.
$plugin->component = 'repository_owncloud2'; // Full name of the plugin (used for diagnostics).
$plugin->component = 'repository_owncloud'; // Full name of the plugin (used for diagnostics).
$plugin->release = 'v0.1.0';
$plugin->maturity = MATURITY_ALPHA;
$plugin->maturity = MATURITY_ALPHA;

0 comments on commit 165ce56

Please sign in to comment.