从远程脚本和登录创建owncloud用户

时间:2014-12-31 19:56:46

标签: php login owncloud

我试图创建一个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中完成帐户的完整创建我错过了什么?为什么这两个表没有初始化?

0 个答案:

没有答案