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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-09-18 20:24:39 +0400
committerTom Needham <needham.thomas@gmail.com>2012-09-18 20:30:13 +0400
commit3b465f419acb9cd85c9dc25ab9166fe3fa529afe (patch)
tree10963b901d7d9374157c9c9d082836ac4c9d7e97 /lib
parent0f489e80ad6b2a6e042f7e2d6b479341b04ec4bc (diff)
Allow exporting of users from any user backend, fixed oc-1645
Diffstat (limited to 'lib')
-rw-r--r--lib/migrate.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/migrate.php b/lib/migrate.php
index d05c781f555..39cb2832c19 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