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 <?php
//// RCMCardDAV Plugin Admin Settings // RCMCardDAV Plugin Admin Settings
//// ** ADDRESSBOOK PRESETS // ** ADDRESSBOOK PRESETS
//// PRESET FOR: baikal /* PRESET FOR: baikal
//$prefs['Baïkal'] = array( $prefs['Baïkal'] = array(
// // required attributes // required attributes
// 'name' => 'Baïkal', 'name' => 'Baïkal',
// 'username' => '%u', 'username' => '%u',
// 'password' => '%p', 'password' => '%p',
// 'url' => '{baikal_url}/card.php/addressbooks/%u/', '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: owncloud // optional attributes
//$prefs['ownCloud'] = array( 'active' => true,
// // required attributes 'readonly' => false,
// 'name' => 'ownCloud', 'refresh_time' => '00:05:00',
// 'username' => '%u',
// 'password' => '%p', 'fixed' => array('username', 'password'),
// 'url' => '{owncloud_url}/remote.php/dav/addressbooks/users/%u/default/', 'hide' => false,
// );
// // optional attributes END: baikal */
// 'active' => true,
// 'readonly' => false, /* PRESET FOR: owncloud
// 'refresh_time' => '00:05:00', $prefs['ownCloud'] = array(
// // required attributes
// 'fixed' => array('username', 'password'), 'name' => 'ownCloud',
// 'hide' => false, 'username' => '%u',
//); 'password' => '%p',
//// END: owncloud '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_path=$(ynh_app_setting_get $carddav_app_id path)
carddav_url="https://${carddav_domain}${carddav_path%/}" carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string "{${carddav_app}_url}" "$carddav_url" "$carddav_tmp_config" 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 fi
done done

View file

@ -202,7 +202,8 @@ then
carddav_path=$(ynh_app_setting_get $carddav_app_id path) carddav_path=$(ynh_app_setting_get $carddav_app_id path)
carddav_url="https://${carddav_domain}${carddav_path%/}" carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string "{${carddav_app}_url}" "$carddav_url" "$carddav_tmp_config" 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 fi
done done