1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Merge pull request #718 from owncloud/fix-session

migrate OC::session to OC::server->getSession
This commit is contained in:
jbtbnl 2014-11-26 11:20:50 +01:00
commit 63a9a50c45

View File

@ -15,7 +15,7 @@ $this->create('contacts_index', '/')
->get() ->get()
->action( ->action(
function($params){ function($params){
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('PageController', 'index'); $dispatcher->dispatch('PageController', 'index');
} }
@ -28,7 +28,7 @@ $this->create('contacts_address_books_for_user', 'addressbooks/')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'userAddressBooks'); $dispatcher->dispatch('AddressBookController', 'userAddressBooks');
} }
@ -38,7 +38,7 @@ $this->create('contacts_address_book_connectors', 'connectors/{backend}')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('BackendController', 'getConnectors'); $dispatcher->dispatch('BackendController', 'getConnectors');
} }
@ -49,7 +49,7 @@ $this->create('contacts_backend_enable', 'backend/{backend}/{enable}')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('BackendController', 'enableBackend'); $dispatcher->dispatch('BackendController', 'enableBackend');
} }
@ -60,7 +60,7 @@ $this->create('contacts_backend_status', 'backend/{backend}')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('BackendController', 'backendStatus'); $dispatcher->dispatch('BackendController', 'backendStatus');
} }
@ -71,7 +71,7 @@ $this->create('contacts_address_book_add', 'addressbook/{backend}/add')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'addAddressBook'); $dispatcher->dispatch('AddressBookController', 'addAddressBook');
} }
@ -82,7 +82,7 @@ $this->create('contacts_address_book', 'addressbook/{backend}/{addressBookId}')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'getAddressBook'); $dispatcher->dispatch('AddressBookController', 'getAddressBook');
} }
@ -93,7 +93,7 @@ $this->create('contacts_address_book_contacts', 'addressbook/{backend}/{addressB
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'getContacts'); $dispatcher->dispatch('AddressBookController', 'getContacts');
} }
@ -104,7 +104,7 @@ $this->create('contacts_address_book_headers', 'addressbook/{backend}/{addressBo
->method('HEAD') ->method('HEAD')
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'getAddressBook'); $dispatcher->dispatch('AddressBookController', 'getAddressBook');
} }
@ -115,7 +115,7 @@ $this->create('contacts_address_book_options', 'addressbook/{backend}/{addressBo
->method('OPTIONS') ->method('OPTIONS')
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'getAddressBook'); $dispatcher->dispatch('AddressBookController', 'getAddressBook');
} }
@ -126,7 +126,7 @@ $this->create('contacts_address_book_update', 'addressbook/{backend}/{addressBoo
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'updateAddressBook'); $dispatcher->dispatch('AddressBookController', 'updateAddressBook');
} }
@ -138,7 +138,7 @@ $this->create('contacts_address_book_delete', 'addressbook/{backend}/{addressBoo
->action( ->action(
function($params) { function($params) {
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher->dispatch('AddressBookController', 'deleteAddressBook'); $dispatcher->dispatch('AddressBookController', 'deleteAddressBook');
} }
) )
@ -148,7 +148,7 @@ $this->create('contacts_address_book_activate', 'addressbook/{backend}/{addressB
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'activateAddressBook'); $dispatcher->dispatch('AddressBookController', 'activateAddressBook');
} }
@ -159,7 +159,7 @@ $this->create('contacts_address_book_add_contact', 'addressbook/{backend}/{addre
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'addChild'); $dispatcher->dispatch('AddressBookController', 'addChild');
} }
@ -170,7 +170,7 @@ $this->create('contacts_address_book_delete_contact', 'addressbook/{backend}/{ad
->delete() ->delete()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'deleteChild'); $dispatcher->dispatch('AddressBookController', 'deleteChild');
} }
@ -181,7 +181,7 @@ $this->create('contacts_address_book_delete_contacts', 'addressbook/{backend}/{a
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'deleteChildren'); $dispatcher->dispatch('AddressBookController', 'deleteChildren');
} }
@ -192,7 +192,7 @@ $this->create('contacts_address_book_move_contact', 'addressbook/{backend}/{addr
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('AddressBookController', 'moveChild'); $dispatcher->dispatch('AddressBookController', 'moveChild');
} }
@ -203,7 +203,7 @@ $this->create('contacts_import_upload', 'addressbook/{backend}/{addressBookId}/{
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ImportController', 'upload'); $dispatcher->dispatch('ImportController', 'upload');
} }
@ -214,7 +214,7 @@ $this->create('contacts_import_prepare', 'addressbook/{backend}/{addressBookId}/
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ImportController', 'prepare'); $dispatcher->dispatch('ImportController', 'prepare');
} }
@ -225,7 +225,7 @@ $this->create('contacts_import_start', 'addressbook/{backend}/{addressBookId}/{i
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ImportController', 'start'); $dispatcher->dispatch('ImportController', 'start');
} }
@ -236,7 +236,7 @@ $this->create('contacts_import_status', 'addressbook/{backend}/{addressBookId}/{
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ImportController', 'status'); $dispatcher->dispatch('ImportController', 'status');
} }
@ -247,7 +247,7 @@ $this->create('contacts_address_book_export', 'addressbook/{backend}/{addressBoo
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ExportController', 'exportAddressBook'); $dispatcher->dispatch('ExportController', 'exportAddressBook');
} }
@ -258,7 +258,7 @@ $this->create('contacts_contact_export', 'addressbook/{backend}/{addressBookId}/
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ExportController', 'exportContact'); $dispatcher->dispatch('ExportController', 'exportContact');
} }
@ -269,7 +269,7 @@ $this->create('contacts_export_selected', 'exportSelected')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ExportController', 'exportSelected'); $dispatcher->dispatch('ExportController', 'exportSelected');
} }
@ -279,7 +279,7 @@ $this->create('contacts_contact_photo', 'addressbook/{backend}/{addressBookId}/c
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'getPhoto'); $dispatcher->dispatch('ContactPhotoController', 'getPhoto');
} }
@ -290,7 +290,7 @@ $this->create('contacts_upload_contact_photo', 'addressbook/{backend}/{addressBo
->put() ->put()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'uploadPhoto'); $dispatcher->dispatch('ContactPhotoController', 'uploadPhoto');
} }
@ -301,7 +301,7 @@ $this->create('contacts_cache_contact_photo', 'addressbook/{backend}/{addressBoo
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'cacheCurrentPhoto'); $dispatcher->dispatch('ContactPhotoController', 'cacheCurrentPhoto');
} }
@ -312,7 +312,7 @@ $this->create('contacts_cache_fs_photo', 'addressbook/{backend}/{addressBookId}/
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'cacheFileSystemPhoto'); $dispatcher->dispatch('ContactPhotoController', 'cacheFileSystemPhoto');
} }
@ -323,7 +323,7 @@ $this->create('contacts_tmp_contact_photo', 'addressbook/{backend}/{addressBookI
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'getTempPhoto'); $dispatcher->dispatch('ContactPhotoController', 'getTempPhoto');
} }
@ -334,7 +334,7 @@ $this->create('contacts_crop_contact_photo', 'addressbook/{backend}/{addressBook
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactPhotoController', 'cropPhoto'); $dispatcher->dispatch('ContactPhotoController', 'cropPhoto');
} }
@ -346,7 +346,7 @@ $this->create('contacts_contact_patch', 'addressbook/{backend}/{addressBookId}/c
->patch() ->patch()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactController', 'patch'); $dispatcher->dispatch('ContactController', 'patch');
} }
@ -357,7 +357,7 @@ $this->create('contacts_contact_get', 'addressbook/{backend}/{addressBookId}/con
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactController', 'getContact'); $dispatcher->dispatch('ContactController', 'getContact');
} }
@ -369,7 +369,7 @@ $this->create('contacts_contact_save_all', 'addressbook/{backend}/{addressBookId
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ContactController', 'saveContact'); $dispatcher->dispatch('ContactController', 'saveContact');
} }
@ -380,7 +380,7 @@ $this->create('contacts_categories_list', 'groups/')
->get() ->get()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'getGroups'); $dispatcher->dispatch('GroupController', 'getGroups');
} }
@ -390,7 +390,7 @@ $this->create('contacts_categories_add', 'groups/add')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'addGroup'); $dispatcher->dispatch('GroupController', 'addGroup');
} }
@ -400,7 +400,7 @@ $this->create('contacts_categories_delete', 'groups/delete')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'deleteGroup'); $dispatcher->dispatch('GroupController', 'deleteGroup');
} }
@ -410,7 +410,7 @@ $this->create('contacts_categories_rename', 'groups/rename')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'renameGroup'); $dispatcher->dispatch('GroupController', 'renameGroup');
} }
@ -420,7 +420,7 @@ $this->create('contacts_categories_addto', 'groups/addto/{categoryId}')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'addToGroup'); $dispatcher->dispatch('GroupController', 'addToGroup');
} }
@ -430,7 +430,7 @@ $this->create('contacts_categories_removefrom', 'groups/removefrom/{categoryId}'
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('GroupController', 'removeFromGroup'); $dispatcher->dispatch('GroupController', 'removeFromGroup');
} }
@ -441,7 +441,7 @@ $this->create('contacts_setpreference', 'preference/set')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
$dispatcher = new Dispatcher($params); $dispatcher = new Dispatcher($params);
$dispatcher->dispatch('SettingsController', 'set'); $dispatcher->dispatch('SettingsController', 'set');
} }
@ -451,7 +451,7 @@ $this->create('contacts_index_properties', 'indexproperties/{user}/')
->post() ->post()
->action( ->action(
function($params) { function($params) {
\OC::$session->close(); \OC::$server->getSession()->close();
// TODO: Add BackgroundJob for this. // TODO: Add BackgroundJob for this.
\OCP\Util::emitHook('OCA\Contacts', 'indexProperties', array()); \OCP\Util::emitHook('OCA\Contacts', 'indexProperties', array());