From 30c41d0f7285950b7b9a8fc3f5f862a4c68271c9 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Tue, 22 May 2012 09:49:57 -0300 Subject: [PATCH] removed dependancy on mock user object --- RestConnection.inc | 2 +- islandora.module | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/RestConnection.inc b/RestConnection.inc index e9e1291e..b1535ff1 100644 --- a/RestConnection.inc +++ b/RestConnection.inc @@ -19,7 +19,7 @@ class RestConnection { function RestConnection($user) { $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->api = new FedoraApi($this->connection); $this->cache = new SimpleCache(); diff --git a/islandora.module b/islandora.module index 5d8d7d9c..5ef3741e 100644 --- a/islandora.module +++ b/islandora.module @@ -264,9 +264,10 @@ function islandora_view_object($object_id) { $page_number = (empty($_GET['page'])) ? '1' : $_GET['page']; $page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize']; module_load_include('inc', 'islandora', 'RestConnection'); - $user = new stdClass(); - $user->name = 'fedoraAdmin'; - $user->password = 'islandora'; + //$user = new stdClass(); + //$user->name = 'fedoraAdmin'; + //$user->password = 'islandora'; + global $user; try { $restConnection = new RestConnection($user); $fedora_object = new FedoraObject($object_id, $restConnection->repository); @@ -315,9 +316,10 @@ function islandora_theme() { function islandora_datastream_as_attachment($object_id, $dsid){ module_load_include('inc', 'islandora', 'RestConnection'); - $user = new stdClass(); - $user->name = 'fedoraAdmin'; - $user->password = 'islandora'; + //$user = new stdClass(); + //$user->name = 'fedoraAdmin'; + //$user->password = 'islandora'; + global $user; try { $restConnection = new RestConnection($user); $fedora_object = new FedoraObject($object_id, $restConnection->repository);