Merge branch 'stable4' of git://gitorious.org/owncloud/owncloud into stable4
This commit is contained in:
commit
01f25119d5
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('bookmarks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
|
||||
$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
|
||||
|
|
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('bookmarks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
|
||||
|
|
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('bookmarks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
|
||||
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$cal = $_POST["calendarid"];
|
||||
$calendar = OC_Calendar_App::getCalendar($cal, true);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid'], true);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(trim($_POST['name']) == ''){
|
||||
OCP\JSON::error(array('message'=>'empty'));
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(trim($_POST['name']) == ''){
|
||||
OCP\JSON::error(array('message'=>'empty'));
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||
if($errarr){
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
//check for calendar rights or create new one
|
||||
ob_start();
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
OCP\App::checkAppEnabled('calendar');
|
||||
$nl="\r\n";
|
||||
$comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(isset($_POST["firstday"])){
|
||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
|
||||
OCP\JSON::success();
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(isset($_POST["timeformat"])){
|
||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
|
||||
OCP\JSON::success();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = strip_tags($_GET['id']);
|
||||
$idtype = strip_tags($_GET['idtype']);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = strip_tags($_GET['id']);
|
||||
$idtype = strip_tags($_GET['idtype']);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = strip_tags($_GET['id']);
|
||||
$idtype = strip_tags($_GET['idtype']);
|
||||
|
|
|
@ -11,6 +11,10 @@ OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php';
|
|||
//General Hooks
|
||||
OCP\Util::connectHook('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'createUser');
|
||||
OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser');
|
||||
//Sharing Hooks
|
||||
OCP\Util::connectHook('OC_Calendar', 'deleteEvent', 'OC_Calendar_Share', 'post_eventdelete');
|
||||
OCP\Util::connectHook('OC_Calendar', 'deleteCalendar', 'OC_Calendar_Share', 'post_caldelete');
|
||||
|
||||
OCP\Util::addscript('calendar','loader');
|
||||
OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
|
||||
OCP\Util::addStyle("3rdparty", "chosen/chosen");
|
||||
|
|
|
@ -439,7 +439,7 @@ class OC_Calendar_App{
|
|||
$output['end'] = date('Y-m-d', $result->format('U') + --$duration);
|
||||
}else{
|
||||
$output['start'] = $result->format('Y-m-d H:i:s');
|
||||
$output['end'] = date('Y-m-d H:i:s', $result->format('U') + $duration);
|
||||
$output['end'] = date('Y-m-d H:i:s', $result->format('U') + $result->format('Z') + $duration);
|
||||
}
|
||||
$return[] = $output;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,9 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
|
|||
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
|
||||
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
|
||||
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
|
||||
if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
|
||||
$newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
|
||||
}
|
||||
|
||||
return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
|
||||
}
|
||||
|
@ -192,6 +195,9 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
|
|||
if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
|
||||
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
|
||||
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
|
||||
if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
|
||||
$newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
|
||||
}
|
||||
|
||||
OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
|
||||
OCP\User::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$sites = array();
|
||||
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
$dir = stripslashes($_GET["dir"]);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
$dir = stripslashes($_GET["dir"]);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get the params
|
||||
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get the params
|
||||
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
$dir = stripslashes($_GET["dir"]);
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
<?php
|
||||
|
||||
// fix webdav properties, remove namespace information between curly bracket update for OC4
|
||||
$installedVersion=OCP\Config::getAppValue('files', 'installed_version');
|
||||
if (version_compare($installedVersion, '1.1.2', '<')) {
|
||||
$query = OC_DB::prepare( "SELECT propertyname, propertypath, userid FROM `*PREFIX*properties`" );
|
||||
$result = $query->execute();
|
||||
while( $row = $result->fetchRow()){
|
||||
$query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertyname = ? WHERE userid = ? AND propertypath = ?' );
|
||||
$query->execute( array( preg_replace("/^{.*}/", "", $row["propertyname"]),$row["userid"], $row["propertypath"] ));
|
||||
}
|
||||
}
|
||||
|
||||
//update from OC 3
|
||||
|
||||
//try to remove remaining files.
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.1.1
|
||||
1.1.2
|
|
@ -124,8 +124,6 @@
|
|||
} else if (href.indexOf("#") === 0) {
|
||||
type = 'inline';
|
||||
|
||||
} else {
|
||||
type = 'ajax';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
$user = OCP\USER::getUser();
|
||||
// TODO translations
|
||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
|||
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||
$uid_shared_with = $_POST['uid_shared_with'];
|
||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
|||
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
||||
$sources = explode(';', $_POST['sources']);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
OCP\JSON::checkAdminUser();
|
||||
if ($_POST['resharing'] == true) {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
OCP\JSON::checkAdminUser();
|
||||
if ($_POST['allowSharingWithEveryone'] == true) {
|
||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
|||
|
||||
OCP\JSON::checkAppEnabled('files_sharing');
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||
$uid_shared_with = $_POST['uid_shared_with'];
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get paramteres
|
||||
$filecontents = isset($_POST['filecontents']) ? $_POST['filecontents'] : false;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
OCP\JSON::checkAppEnabled('files_versions');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
require_once('apps/files_versions/versions.php');
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('gallery');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if (!isset($_GET['token']) || !isset($_GET['operation'])) {
|
||||
OCP\JSON::error(array('cause' => 'Not enought arguments'));
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Init owncloud
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('tasks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
||||
$first_calendar = reset($calendars);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Init owncloud
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('tasks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
||||
$category_options = OC_Calendar_App::getCategoryOptions();
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
// Init owncloud
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('tasks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
$task = OC_Calendar_App::getEventObject( $id );
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Init owncloud
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('tasks');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$l10n = new OC_L10N('tasks');
|
||||
|
||||
|
|
|
@ -440,6 +440,10 @@ class OC_LDAP {
|
|||
*/
|
||||
static public function readAttribute($dn, $attr) {
|
||||
$cr = self::getConnectionResource();
|
||||
if(!is_resource($cr)) {
|
||||
//LDAP not available
|
||||
return false;
|
||||
}
|
||||
$rr = ldap_read($cr, $dn, 'objectClass=*', array($attr));
|
||||
$er = ldap_first_entry($cr, $rr);
|
||||
//LDAP attributes are not case sensitive
|
||||
|
@ -495,6 +499,11 @@ class OC_LDAP {
|
|||
if(!is_null($attr) && !is_array($attr)) {
|
||||
$attr = array(strtolower($attr));
|
||||
}
|
||||
$cr = self::getConnectionResource();
|
||||
if(!is_resource($cr)) {
|
||||
//LDAP not available
|
||||
return array();
|
||||
}
|
||||
$sr = @ldap_search(self::getConnectionResource(), $base, $filter, $attr);
|
||||
$findings = @ldap_get_entries(self::getConnectionResource(), $sr );
|
||||
// if we're here, probably no connection ressource is returned.
|
||||
|
@ -686,11 +695,22 @@ class OC_LDAP {
|
|||
* Connects and Binds to LDAP
|
||||
*/
|
||||
static private function establishConnection() {
|
||||
static $phpLDAPinstalled = true;
|
||||
if(!$phpLDAPinstalled) {
|
||||
return false;
|
||||
}
|
||||
if(!self::$configured) {
|
||||
OCP\Util::writeLog('ldap', 'Configuration is invalid, cannot connect', OCP\Util::INFO);
|
||||
return false;
|
||||
}
|
||||
if(!self::$ldapConnectionRes) {
|
||||
//check if php-ldap is installed
|
||||
if(!function_exists('ldap_connect')) {
|
||||
$phpLDAPinstalled = false;
|
||||
OCP\Util::writeLog('user_ldap', 'function ldap_connect is not available. Make sure that the PHP ldap module is installed.', OCP\Util::ERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
self::$ldapConnectionRes = ldap_connect(self::$ldapHost, self::$ldapPort);
|
||||
if(ldap_set_option(self::$ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) {
|
||||
if(ldap_set_option(self::$ldapConnectionRes, LDAP_OPT_REFERRALS, 0)) {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
require_once ("../../lib/base.php");
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_Util::checkAdminUser();
|
||||
|
||||
$action=isset($_POST['action'])?$_POST['action']:$_GET['action'];
|
||||
$result=false;
|
||||
switch($action){
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - ajax group list
|
||||
*
|
||||
* @author Hans Bakker
|
||||
* @copyright 2011 hansmbakker+kde@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$RUNTIME_NOAPPS = TRUE; //no apps, yet
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
if(!OC_User::isLoggedIn()){
|
||||
if(!isset($_SERVER['PHP_AUTH_USER'])){
|
||||
header('WWW-Authenticate: Basic realm="ownCloud Server"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'Valid credentials must be supplied';
|
||||
exit();
|
||||
} else {
|
||||
if(!OC_User::checkPassword($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])){
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$groups = array();
|
||||
|
||||
foreach( OC_Group::getGroups() as $i ){
|
||||
// Do some more work here soon
|
||||
$groups[] = array( "groupname" => $i );
|
||||
}
|
||||
|
||||
OC_JSON::encodedPrint($groups);
|
||||
|
||||
?>
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - ajax user list
|
||||
*
|
||||
* @author Hans Bakker
|
||||
* @copyright 2011 hansmbakker+kde@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$RUNTIME_NOAPPS = TRUE; //no apps, yet
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
if(!OC_User::isLoggedIn()){
|
||||
if(!isset($_SERVER['PHP_AUTH_USER'])){
|
||||
header('WWW-Authenticate: Basic realm="ownCloud Server"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'Valid credentials must be supplied';
|
||||
exit();
|
||||
} else {
|
||||
if(!OC_User::checkPassword($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])){
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$users = array();
|
||||
|
||||
foreach( OC_User::getUsers() as $i ){
|
||||
$users[] = array( "username" => $i, "groups" => join( ", ", OC_Group::getUserGroups( $i ) ));
|
||||
}
|
||||
|
||||
OC_JSON::encodedPrint($users);
|
||||
|
||||
?>
|
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Hans Bakker
|
||||
* @copyright 2011 Hans Bakker hansmbakker+kde@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$RUNTIME_NOAPPS = TRUE; //no apps, yet
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
if(!isset($_SERVER['PHP_AUTH_USER'])){
|
||||
header('WWW-Authenticate: Basic realm="ownCloud Server"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'Valid credentials must be supplied';
|
||||
exit();
|
||||
} else {
|
||||
if(OC_User::checkPassword($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])){
|
||||
OC_JSON::encodedPrint(array("username" => $_SERVER["PHP_AUTH_USER"], "user_valid" => "true"));
|
||||
} else {
|
||||
OC_JSON::encodedPrint(array("username" => $_SERVER["PHP_AUTH_USER"], "user_valid" => "false"));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -121,6 +121,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
|
|||
public function updateProperties($properties) {
|
||||
$existing = $this->getProperties(array());
|
||||
foreach($properties as $propertyName => $propertyValue) {
|
||||
$propertyName = preg_replace("/^{.*}/", "", $propertyName); // remove leading namespace from property name
|
||||
// If it was null, we need to delete the property
|
||||
if (is_null($propertyValue)) {
|
||||
if(array_key_exists( $propertyName, $existing )){
|
||||
|
|
|
@ -34,22 +34,15 @@ namespace OCP;
|
|||
* This class provides functions to manage apps in ownCloud
|
||||
*/
|
||||
class App {
|
||||
|
||||
/**
|
||||
* @brief Makes owncloud aware of this app
|
||||
* @brief This call is deprecated and not necessary to use.
|
||||
* @param $data array with all information
|
||||
* @returns true/false
|
||||
*
|
||||
* This function registers the application. $data is an associative array.
|
||||
* The following keys are required:
|
||||
* - id: id of the application, has to be unique ('addressbook')
|
||||
* - name: Human readable name ('Addressbook')
|
||||
* - version: array with Version (major, minor, bugfix) ( array(1, 0, 2))
|
||||
*
|
||||
* The following keys are optional:
|
||||
* - order: integer, that influences the position of your application in
|
||||
* a list of applications. Lower values come first.
|
||||
* @deprecated this method is deprecated
|
||||
* Do not call it anymore
|
||||
* It'll remain in our public API for compatibility reasons
|
||||
*
|
||||
*/
|
||||
public static function register( $data ){
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
|
||||
$password = $_POST["password"];
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
OC_JSON::setContentTypeHeader();
|
||||
|
||||
OC_App::disable($_POST['appid']);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
OC_JSON::setContentTypeHeader();
|
||||
|
||||
if(OC_App::enable($_POST['appid'])){
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$l=OC_L10N::get('core');
|
||||
|
||||
// Get data
|
||||
if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ){
$email=trim($_POST['email']);
|
||||
if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ){
|
||||
$email=trim($_POST['email']);
|
||||
OC_Preferences::setValue(OC_User::getUser(),'settings','email',$email);
|
||||
OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
|
||||
}else{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$name = $_POST["groupname"];
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$username = $_POST["username"];
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ require_once('../../lib/base.php');
|
|||
$l=OC_L10N::get('settings');
|
||||
|
||||
OC_JSON::checkLoggedIn();
|
||||
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
if( isset( $_POST['lang'] ) ){
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
require_once('../../lib/base.php');
|
||||
OC_Util::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
OC_Config::setValue( 'loglevel', $_POST['level'] );
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$username = isset($_POST["username"])?$_POST["username"]:'';
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$success = true;
|
||||
$error = "add user to";
|
||||
|
|
Loading…
Reference in New Issue