Add Useers Quota and Email


#1

Hi! Tell me how to add Quota and Email

<?php

/// Config Users ///
$userName = "user1";
$RRpassword = "12345";
$Email = "mail@mail.com";
$Quota = "100MB";
$Groupid = "Users";

 /// Config Admin ///
 $ownAdminname = "Admin";
 $ownAdminpassword = "Admin Pass";
 $ownHost = "Host";

/// Add new user ///
$url = 'http://' . $ownAdminname . ':' . $ownAdminpassword . '@'.$ownHost.'/ocs/v1.php/cloud/users';

$ownCloudPOSTArray = array('userid' => $userName, 'password' => $RRpassword );

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $ownCloudPOSTArray);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Add to a group called 'Users'
$groupUrl = $url . '/' . $userName . '/' . 'groups';

$ownCloudPOSTArrayGroup = array('groupid' => $Groupid);

$ch = curl_init($groupUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $ownCloudPOSTArrayGroup);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

?>

#2

Not sure how you do this in php. You could use this python client: