Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setquota.php « ajax « settings - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 244a85e3d9c39187720962865b29ce67f00109a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

// Init owncloud
require_once('../../lib/base.php');

// We send json data
header( "Content-Type: application/jsonrequest" );

// Check if we are a user
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
	echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
	exit();
}

$username = $_POST["username"];
$quota= OC_Helper::computerFileSize($_POST["quota"]);

// Return Success story
OC_Preferences::setValue($username,'files','quota',$quota);
echo json_encode( array( "status" => "success", "data" => array( "username" => $username ,'quota'=>$quota)));

?>