1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00

Merge pull request #53 from YunoHost-Apps/fix-nextcloud

Add nextcloud support, and remove sed -i
This commit is contained in:
Maniack Crudelis 2019-03-05 11:48:22 +01:00 committed by GitHub
commit 9727331700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 38 deletions

View file

@ -1,41 +1,59 @@
<?php
//// RCMCardDAV Plugin Admin Settings
// RCMCardDAV Plugin Admin Settings
//// ** ADDRESSBOOK PRESETS
// ** ADDRESSBOOK PRESETS
//// PRESET FOR: baikal
//$prefs['Baïkal'] = array(
// // required attributes
// 'name' => 'Baïkal',
// 'username' => '%u',
// 'password' => '%p',
// 'url' => '{baikal_url}/card.php/addressbooks/%u/',
//
// // optional attributes
// 'active' => true,
// 'readonly' => false,
// 'refresh_time' => '00:05:00',
//
// 'fixed' => array('username', 'password'),
// 'hide' => false,
//);
//// END: baikal
/* PRESET FOR: baikal
$prefs['Baïkal'] = array(
// required attributes
'name' => 'Baïkal',
'username' => '%u',
'password' => '%p',
'url' => '{baikal_url}/card.php/addressbooks/%u/',
//// PRESET FOR: owncloud
//$prefs['ownCloud'] = array(
// // required attributes
// 'name' => 'ownCloud',
// 'username' => '%u',
// 'password' => '%p',
// 'url' => '{owncloud_url}/remote.php/dav/addressbooks/users/%u/default/',
//
// // optional attributes
// 'active' => true,
// 'readonly' => false,
// 'refresh_time' => '00:05:00',
//
// 'fixed' => array('username', 'password'),
// 'hide' => false,
//);
//// END: owncloud
// optional attributes
'active' => true,
'readonly' => false,
'refresh_time' => '00:05:00',
'fixed' => array('username', 'password'),
'hide' => false,
);
END: baikal */
/* PRESET FOR: owncloud
$prefs['ownCloud'] = array(
// required attributes
'name' => 'ownCloud',
'username' => '%u',
'password' => '%p',
'url' => '{owncloud_url}/remote.php/dav/addressbooks/users/%u/default/',
// optional attributes
'active' => true,
'readonly' => false,
'refresh_time' => '00:05:00',
'fixed' => array('username', 'password'),
'hide' => false,
);
END: owncloud */
/* PRESET FOR: nextcloud
$prefs['NextCloud'] = array(
// required attributes
'name' => 'nextCloud',
'username' => '%u',
'password' => '%p',
'url' => '{nextcloud_url}/remote.php/dav/addressbooks/users/%u/contacts/',
// optional attributes
'active' => true,
'readonly' => false,
'refresh_time' => '00:05:00',
'fixed' => array('username', 'password'),
'hide' => false,
);
END: nextcloud */

View file

@ -176,7 +176,8 @@ then
carddav_path=$(ynh_app_setting_get $carddav_app_id path)
carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string "{${carddav_app}_url}" "$carddav_url" "$carddav_tmp_config"
sed -i "/\/\/\/\/ PRESET FOR: $carddav_app/,/\/\/\/\/ END: $carddav_app/s/^\/\///" "$carddav_tmp_config"
ynh_replace_string "/* PRESET FOR: $carddav_app" "" "$carddav_tmp_config"
ynh_replace_string "END: $carddav_app */" "" "$carddav_tmp_config"
fi
done

View file

@ -202,7 +202,8 @@ then
carddav_path=$(ynh_app_setting_get $carddav_app_id path)
carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string "{${carddav_app}_url}" "$carddav_url" "$carddav_tmp_config"
sed -i "/\/\/\/\/ PRESET FOR: $carddav_app/,/\/\/\/\/ END: $carddav_app/s/^\/\///" "$carddav_tmp_config"
ynh_replace_string "\/\* PRESET FOR: $carddav_app" "" "$carddav_tmp_config"
ynh_replace_string "END: $carddav_app \*\/" "" "$carddav_tmp_config"
fi
done