From 19add4c03a91fed02990b97d15eb08d5e7021eef Mon Sep 17 00:00:00 2001 From: dongsheng Date: Mon, 28 Jul 2008 08:24:55 +0000 Subject: [PATCH] "MDL-13766, repository settings page" --- lang/en_utf8/repository.php | 6 ++ repository/ajax.php | 2 +- .../boxnet/lang/en_utf8/repository_boxnet.php | 4 ++ repository/boxnet/repository.class.php | 16 +++++- repository/flickr/repository.class.php | 6 +- repository/lib.php | 28 ++++++--- repository/ws.php | 2 +- user/repository.php | 57 +++++++++++++++++++ user/tabs.php | 16 ++++-- 9 files changed, 120 insertions(+), 17 deletions(-) create mode 100644 lang/en_utf8/repository.php create mode 100644 user/repository.php diff --git a/lang/en_utf8/repository.php b/lang/en_utf8/repository.php new file mode 100644 index 0000000000..05932628a7 --- /dev/null +++ b/lang/en_utf8/repository.php @@ -0,0 +1,6 @@ +dirroot.'/repository/boxnet/'.'boxlibphp5.php'); class repository_boxnet extends repository{ private $box; + public $type = 'boxnet'; public function __construct($repositoryid, $context = SITEID, $options = array()){ global $SESSION, $action; @@ -55,6 +56,16 @@ class repository_boxnet extends repository{ parent::__construct($repositoryid, $context, $options); } + public function get_login(){ + global $DB; + $repository = new stdclass; + $repository->id = $this->repositoryid; + if ($entry = $DB->get_record('repository', $repository)) { + $ret->username = $entry->username; + $ret->password = $entry->password; + } + return $ret; + } public function get_listing($path = '/', $search = ''){ global $CFG; $list = array(); @@ -104,16 +115,17 @@ class repository_boxnet extends repository{ } else { $t = $this->box->getTicket(); if(empty($this->options['auth_token'])) { + $ret = $this->get_login(); $str = ''; $str .= '
'; $str .= ''; $str .= ''; $str .= '