我正在尝试创建一个 php 脚本来使用 owncloud 6 创建一个帐户。到目前为止,我已经这样做了:
//create user with OC_User class. The user gets created in table ownc_users
$creation_check = OC_User::createUser( $parametri["uid"], $parametri["password"] );
//I'll then do a login
OC_User::login( $parametri["uid"], $parametri["password"] );
$logged_user_username = OC_User::getUser();
//check if login went ok
if(!empty($logged_user_username)){
//Then I create the folders copyng them from the skeleton
\OC\Files\Filesystem::initMounts();
\OC\Files\Filesystem::initMountPoints( $parametri["uid"] );
}
一切正常,但是在我从 owncloud 的网页登录之前,不会填充表 ownc_filecache 和 ownc_storages。这对我来说是个问题,因为我稍后在其他脚本中需要它们。例如,如果我将以下值传递给脚本:
$parametri["uid"] = "test"
$parametri["password"] = "test"
- 用户被创建(ownc_user 表被填充)。
- 还创建了所有文件夹(从骨架......我可以在用户数据文件夹中看到它们)。
- 表 ownc_storages 未填充数据(存储 ID 未
与用户关联)。 - 表 ownc_filecache 未填充
如果我从 owncloud 网页登录(从浏览器打开它),我可以看到登录后 ownc_storages 和 ownc_filecache 填充了数据。
在 owncloud 中完成帐户的完整创建我缺少什么?为什么这两个表没有初始化?