我试图创建一个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"
如果我要从owncloud网页登录(从浏览器打开),我可以看到在登录之后,自己的数据填充了ownc_storages和ownc_filecache。
在owncloud中完成帐户的完整创建我错过了什么?为什么这两个表没有初始化?