Browse Source

removed dependancy on mock user object

pull/108/head
Paul Pound 13 years ago
parent
commit
30c41d0f72
  1. 2
      RestConnection.inc
  2. 14
      islandora.module

2
RestConnection.inc

@ -19,7 +19,7 @@ class RestConnection {
function RestConnection($user) { function RestConnection($user) {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
$this->connection = new RepositoryConnection($url, $user->name, $user->password); $this->connection = new RepositoryConnection($url, $user->name, $user->pass);
$this->connection->reuseConnection = TRUE; $this->connection->reuseConnection = TRUE;
$this->api = new FedoraApi($this->connection); $this->api = new FedoraApi($this->connection);
$this->cache = new SimpleCache(); $this->cache = new SimpleCache();

14
islandora.module

@ -264,9 +264,10 @@ function islandora_view_object($object_id) {
$page_number = (empty($_GET['page'])) ? '1' : $_GET['page']; $page_number = (empty($_GET['page'])) ? '1' : $_GET['page'];
$page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize']; $page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize'];
module_load_include('inc', 'islandora', 'RestConnection'); module_load_include('inc', 'islandora', 'RestConnection');
$user = new stdClass(); //$user = new stdClass();
$user->name = 'fedoraAdmin'; //$user->name = 'fedoraAdmin';
$user->password = 'islandora'; //$user->password = 'islandora';
global $user;
try { try {
$restConnection = new RestConnection($user); $restConnection = new RestConnection($user);
$fedora_object = new FedoraObject($object_id, $restConnection->repository); $fedora_object = new FedoraObject($object_id, $restConnection->repository);
@ -315,9 +316,10 @@ function islandora_theme() {
function islandora_datastream_as_attachment($object_id, $dsid){ function islandora_datastream_as_attachment($object_id, $dsid){
module_load_include('inc', 'islandora', 'RestConnection'); module_load_include('inc', 'islandora', 'RestConnection');
$user = new stdClass(); //$user = new stdClass();
$user->name = 'fedoraAdmin'; //$user->name = 'fedoraAdmin';
$user->password = 'islandora'; //$user->password = 'islandora';
global $user;
try { try {
$restConnection = new RestConnection($user); $restConnection = new RestConnection($user);
$fedora_object = new FedoraObject($object_id, $restConnection->repository); $fedora_object = new FedoraObject($object_id, $restConnection->repository);

Loading…
Cancel
Save