[Pkg-owncloud-commits] [owncloud] 38/73: Allow exporting of users from any user backend, fixed oc-1645
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:09:05 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.0.10
in repository owncloud.
commit 3b465f419acb9cd85c9dc25ab9166fe3fa529afe
Author: Tom Needham <needham.thomas at gmail.com>
Date: Tue Sep 18 16:24:39 2012 +0000
Allow exporting of users from any user backend, fixed oc-1645
---
lib/migrate.php | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/lib/migrate.php b/lib/migrate.php
index d05c781..39cb283 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -84,21 +84,15 @@ class OC_Migrate{
$types = array( 'user', 'instance', 'system', 'userfiles' );
if( !in_array( $type, $types ) ){
OC_Log::write( 'migration', 'Invalid export type', OC_Log::ERROR );
- return json_encode( array( array( 'success' => false ) ) );
+ return json_encode( array( 'success' => false ) );
}
self::$exporttype = $type;
// Userid?
if( self::$exporttype == 'user' ){
// Check user exists
- if( !is_null($uid) ){
- $db = new OC_User_Database;
- if( !$db->userExists( $uid ) ){
- OC_Log::write('migration', 'User: '.$uid.' is not in the database and so cannot be exported.', OC_Log::ERROR);
- return json_encode( array( 'success' => false ) );
- }
- self::$uid = $uid;
- } else {
- self::$uid = OC_User::getUser();
+ self::$uid = is_null($uid) ? OC_User::getUser() : $uid;
+ if(!OC_User::userExists(self::$uid)){
+ return json_encode( array( 'success' => false) );
}
}
// Calculate zipname
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list