定制 texxasrulez/rounddav_provision 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

texxasrulez/rounddav_provision

Composer 安装命令:

composer require texxasrulez/rounddav_provision

包简介

Roundcube plugin to auto-provision RoundDAV users on first login.

README 文档

README

Downloads Packagist Downloads Packagist Version Github License GitHub Stars GitHub Issues GitHub Contributors GitHub Forks Donate Paypal

Automatic RoundDAV account provisioning and SSO integration for Roundcube.

This plugin binds Roundcube authentication to RoundDAV users, calendars, addressbooks, and the web-based Files UI.

This plugin requires RoundDAV Server to function.

Recommended Plugins:

RoundDAV Files Roundcube Plugin

RoundDAV Bookmarks Roundcube Plugin

Check out the Suite README to see what is entailed.

Features

  • Creates a RoundDAV user on first Roundcube login
  • Ensures default calendar and addressbook exist
  • Creates extra calendars and addressbooks per user (config-driven)
  • Generates one-shot SSO URLs for the RoundDAV Files UI
  • Triggers SSO logout when the user logs out of Roundcube
  • Logs everything to the rounddav log channel for easy debugging

This is the hub that keeps Roundcube and RoundDAV in sync.

Screenshot

Alt text

Installation

  1. Copy the plugin into Roundcube:
roundcube/plugins/rounddav_provision/
  1. Enable it in Roundcube config (config/config.inc.php or equivalent):
$config['plugins'][] = 'rounddav_provision';
  1. Copy the default config:
cd roundcube/plugins/rounddav_provision/
cp config.inc.php.dist config.inc.php
  1. Edit config.inc.php and set at least:
$config['rounddav_api_url']   = 'https://your.server/rounddav/public/api.php';
$config['rounddav_base_url']  = 'https://your.server/rounddav/public';
$config['rounddav_sso_secret'] = 'change_me_sso'; // must match RoundDAV sso.secret
$config['rounddav_sso_enabled'] = true;

Configuration Options

Core API/SSO

// Where provisioning calls are sent
$config['rounddav_api_url']  = 'https://your.server/rounddav/public/api.php';

// Base URL for browser-facing RoundDAV (SSO, files UI, admin UI)
config['rounddav_base_url']  = 'https://your.server/rounddav/public';

// Shared secret used to HMAC-sign SSO tokens
$config['rounddav_sso_secret'] = 'change_me_sso';

// Toggle SSO integration (if false, rounddav_files falls back to plain URLs)
$config['rounddav_sso_enabled'] = true;

Roundcube Preferences visibility

The plugin exposes a configuration card inside Settings → Preferences. Control who can see and edit it with rounddav_provision_settings_user_ids:

// Default: only Roundcube user ID 1 (typically the administrator)
$config['rounddav_provision_settings_user_ids'] = [1];

// Allow everyone
$config['rounddav_provision_settings_user_ids'] = '*';

// Allow a custom list
$config['rounddav_provision_settings_user_ids'] = [1, 7, 12];

The page lists the configured API endpoint, SSO state, and lets you edit every config.inc.php option without SSH access (the file is rewritten automatically on save).

Extra per-user calendars

Define zero or more calendars to be created for each new RoundDAV user:

$config['rounddav_extra_calendars'] = [
    [
        'uri'         => 'personal',
        'displayname' => 'Personal',
        'mode'        => 'events',  // 'events', 'tasks', or 'both'
        'shared'      => false,
    ],
    [
        'uri'         => 'todo',
        'displayname' => 'Tasks',
        'mode'        => 'tasks',
        'shared'      => false,
    ],
];
  • uri (required) – DAV collection URI segment (unique per user, not "default")
  • displayname – what clients see; defaults to uri if omitted
  • mode – how RoundDAV configures the components field:
    • eventsVEVENT
    • tasksVTODO
    • bothVEVENT,VTODO
  • shared – reserved for future global/shared collections support

Extra per-user addressbooks

$config['rounddav_extra_addressbooks'] = [
    [
        'uri'         => 'work',
        'displayname' => 'Work Contacts',
        'shared'      => false,
    ],
    [
        'uri'         => 'shared',
        'displayname' => 'Shared Contacts',
        'shared'      => true,
    ],
];
  • uri (required) – DAV addressbook URI segment (unique per user, not "default")
  • displayname – human-readable label
  • shared – reserved for future global sharing semantics

How It Works Internally

Hooks

The plugin registers:

  • authenticate($args) – captures credentials for provisioning
  • login_after($args) – performs provisioning and prepares SSO URL
  • logout_after($args) – schedules a browser-side hit to RoundDAV SSO logout

Provisioning Flow

  1. User logs into Roundcube.
  2. authenticate hook sees the username/password and stores them in $_SESSION temporarily.
  3. login_after fires:
    • Reads credentials from $_SESSION.
    • Calls RoundDAV /api.php?r=provision/user with JSON payload.
    • Logs the response to logs/rounddav.
    • Generates SSO login URL and stores it in $_SESSION['rounddav_sso_login_url'].
  4. rounddav_files later reads that SSO URL and uses it for the Files iframe.

SSO Token Format

The SSO login URL looks like:

https://your.server/rounddav/public/sso_login.php?user=<user>&ts=<ts>&sig=<sig>

Where:

  • tstime() at generation
  • sighash_hmac('sha256', "$user|$ts", $secret)

Logout uses:

https://your.server/rounddav/public/sso_logout.php?user=<user>&ts=<ts>&sig=<sig>

with the string "$user|$ts|logout" for the HMAC input.

Logging

The plugin logs to the rounddav channel inside Roundcube:

  • Provisioning calls and responses
  • SSO URL generation
  • SSO configuration status

This makes it easy to debug misconfigurations without guessing.

Philosophy

rounddav_provision is intentionally boring in the best way:

  • It doesn’t touch Roundcube core files.
  • It uses documented hooks.
  • It uses sessions and config like any other plugin.
  • It does one job extremely well: keep DAV users in sync with Roundcube users.

Enjoy!

💰 Donations 💰

If you use this plugin and would like to show your appreciation by buying me a cup of coffee, I surely would appreciate it. A regular cup of Joe is sufficient, but a Starbucks Coffee would be better ...
Zelle (Zelle is integrated within many major banks Mobile Apps by default) - Just send to texxasrulez at yahoo dot com
No Zelle in your banks mobile app, no problem, just click Paypal and I can make a Starbucks run ...

I appreciate the interest in this plugin and hope all the best ...

texxasrulez/rounddav_provision 适用场景与选型建议

texxasrulez/rounddav_provision 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 texxasrulez/rounddav_provision 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 texxasrulez/rounddav_provision 我们能提供哪些服务?
定制开发 / 二次开发

基于 texxasrulez/rounddav_provision 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 17
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2025-12-15