Comparar commits

...

32 Commits

Autor SHA1 Mensagem Data
Daniel Molkentin 02bfb4f005 Amend ChangeLog 2014-02-26 15:08:12 +01:00
Daniel Molkentin d4dd5afbe7 Revert "Make "Sign Out" forget the cookies"
This reverts commit 8607300195.

This approach is too dangerous for 1.5.2.
2014-02-26 15:05:15 +01:00
Olivier Goffart 8607300195 Make "Sign Out" forget the cookies
If we keep the cookies, next time we sign in, the entered password
does not matter as the server still think our session is logged in.
2014-02-26 13:23:52 +01:00
Olivier Goffart e468ea2d68 Avoid re-entrency in HTTPCredidential::fetch
It is likely to re-enter if there is two jobs that asks for a password.

Example:
 1. log out
 2. restart the application
 3. enter a wrong password
 4. enter a wrong password again a few times
 5. enter the correct password
 6. it should must not prompt for the password again.

Because of the re-entrency, it was still prompting for the password several
times after the right password had been entered
2014-02-26 13:10:11 +01:00
Daniel Molkentin 05a1f7b1bb Another fix for the reconnect-logic 2014-02-26 11:26:50 +01:00
Daniel Molkentin b8a4a2d2f7 Add ChangeLog 2014-02-25 18:11:04 +01:00
Markus Goetz c7e70533a0 Shibboleth: Detect also QNAM redirects
If a QNAM job (e.g. Quota or ETag job) gets redirected,
we'll invalidate and then prompt to re-fetch the credentials
from the user.
(The keychain credentials will be wrong so they get deleted)
2014-02-25 14:22:55 +01:00
Daniel Molkentin d4fa06c4e1 Fix potential crash in c_iconv on Mac OS X 2014-02-25 12:48:40 +01:00
Markus Goetz 065690c2ce Shibboleth: Have proper invalidation if timeout during sync 2014-02-25 09:33:28 +01:00
Olivier Goffart 75cff87316 add missing copyright header 2014-02-24 19:32:41 +01:00
Markus Goetz b56843ead2 Account: Fix Metatype registratition 2014-02-24 15:31:11 +01:00
Markus Goetz 51b5f3c9b2 Propfind Job: Print redirect URL in log 2014-02-24 15:20:49 +01:00
Daniel Molkentin 7f508c0718 Account needs qRegisterMetaType 2014-02-24 14:56:57 +01:00
Daniel Molkentin 45a7d4ff4c Fix Wizard when returning from later steps
We need to reset the credential type when
returning to the first page from later steps.
Otherwise, unfinished credential instances
and their NAM will try to fetch data, which
will fail with weird symptoms.
2014-02-24 14:56:57 +01:00
Daniel Molkentin 995e8938ad SSLButton: Fix certificate display 2014-02-24 14:56:56 +01:00
Olivier Goffart 1e43d1fa49 Add missing license headers in tests
LGPL for csync tests,  GPL for mirall tests
2014-02-24 11:08:58 +01:00
Daniel Molkentin 5c1d612761 Account settings: Set correct state icon right away 2014-02-21 21:02:35 +01:00
Olivier Goffart f92cf3dee3 ammand last commit
We should not close the directory twice in the normal case
2014-02-21 19:09:38 +01:00
Olivier Goffart a71cb1d3ef Fix potential crash in case of abort while update:
We need to reset ctx->remote.read_from_db  BEFORE caling vio_closedir
Otherwise, it may interpret the handle as a 'bdtree' handle instead of
a owncloud handle.

Should fix #1442
2014-02-21 16:57:24 +01:00
Olivier Goffart cd13144415 Fix adding a file in a Shared readonly directory
It should not create a conflict in that case.

Also when editing a file, create a conflict using the normal way,
after downloading the file and checking it is not the same
2014-02-21 10:53:09 +01:00
Daniel Molkentin 67c07c4daa bump to 1.5.2 2014-02-21 09:56:04 +01:00
Daniel Molkentin 8e7290b450 Fix online state handling
Before this commit, parts of mirall were aware of the state, but not all.
Also, the state was not set back to Connected again in all cases. This
commit introduces the following changes:

- Make QuotaInfo a member of Account
- QuotaInfo and Folder (EtagJob) can put the client in disconnected mode
- FolderMan now disables etag-polling when offline

Fixes #1459
Fixes #1441
2014-02-20 23:24:03 +01:00
Daniel Molkentin b51a722347 Fix German translation for branch 2014-02-20 23:23:46 +01:00
Daniel Molkentin 30d0e2fee8 Remove stray debug 2014-02-20 23:23:46 +01:00
Klaas Freitag 04647b0d61 Handle empty passwords returning from the keychain read procedure.
This is needed if the keychain does not have the an QSettings based
fallback any more.
2014-02-20 16:53:38 +01:00
Klaas Freitag e991bcd112 Do not store the password in the config file. Erase it if it is there.
This fixes bug #1458
2014-02-20 14:35:02 +01:00
Klaas Freitag 82afb3b613 If a file in a read only share was edited, restore and create conflict.
This fixes bug #1448
2014-02-19 17:21:43 +01:00
Daniel Molkentin 726b41b0c7 Shib: Close browser window after login 2014-02-19 15:34:43 +01:00
Olivier Goffart e74f0f2854 Better support when user remove or rename the Shared directory 2014-02-19 15:23:36 +01:00
Olivier Goffart a51f050a08 More fix for moving shared directories
Abort a directory job if the first job fails

Also make sure the jobs are in the directory job of their destination paths
2014-02-19 13:08:35 +01:00
Klaas Freitag e4965ab06b Mac FS watcher: ignore events from the same process 2014-02-18 16:28:25 +01:00
hefee 1b03dc759b fixing typo
GNU Public License->  GNU General Public License
2014-02-17 22:42:51 +01:00
73 arquivos alterados com 1056 adições e 146 exclusões
+22
Ver Arquivo
@@ -1,6 +1,28 @@
ChangeLog
=========
version 1.5.2 (release 2014-02-26 )
* Fix behavior when attempting to rename Shared folder
* Fix potential endless sync loops on Mac OS (#1463)
* Fix potential crash when pausing during update phase (#1442)
* Fix handing of shared directories
* Fix online state handling (#1441, #1459)
* Fix potential crash in c_iconv on Mac OS
* Fix certificate chain display in SSLButton
* Fix sporadicly appearing multiple auth prompts on sign-in
* Show correct state icon in Account Settings right away
* Re-fetch content that gets deleted from read only shared directories
* Do not store the password in the config file, erase existing ones (#1469)
* Shibboleth: Close browser window after login
* Shibboleth: Proper invalidation if timeout during sync
* Shibboleth: Do not pop up IdP login immediately when modifying account
* Shibboleth: Avoid auth on restart by storing cookies in the wallet
* Fix license headers
ChangeLog
=========
version 1.5.1 (release 2014-02-13 )
* Added an auto updater that updates the client if a
more recent version was found automatically (Windows, Mac OS X)
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
set( MIRALL_VERSION_MAJOR 1 )
set( MIRALL_VERSION_MINOR 5 )
set( MIRALL_VERSION_PATCH 1 )
set( MIRALL_VERSION_PATCH 2 )
set( MIRALL_SOVERSION 0 )
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
+3 -6
Ver Arquivo
@@ -598,9 +598,8 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
ctx->status_code = CSYNC_STATUS_UPDATE_ERROR;
}
csync_vio_closedir(ctx, dh);
ctx->current_fs = previous_fs;
goto done;
goto error;
}
if (flag == CSYNC_FTW_FLAG_DIR && depth
@@ -608,8 +607,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
rc = csync_ftw(ctx, filename, fn, depth - 1);
if (rc < 0) {
ctx->current_fs = previous_fs;
csync_vio_closedir(ctx, dh);
goto done;
goto error;
}
if (ctx->current_fs && !ctx->current_fs->child_modified
@@ -636,15 +634,14 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, " <= Closing walk for %s with read_from_db %d", uri, read_from_db);
done:
ctx->remote.read_from_db = read_from_db;
csync_vio_file_stat_destroy(dirent);
SAFE_FREE(filename);
return rc;
error:
ctx->remote.read_from_db = read_from_db;
if (dh != NULL) {
csync_vio_closedir(ctx, dh);
}
ctx->remote.read_from_db = read_from_db;
SAFE_FREE(filename);
return -1;
}
+20
Ver Arquivo
@@ -1,3 +1,23 @@
/*
* httpbf - send big files via http
*
* Copyright (c) 2012 Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <stdio.h>
+1 -1
Ver Arquivo
@@ -126,7 +126,7 @@ static char *c_iconv(const char* str, enum iconv_direction dir)
}
if (ret == (size_t)-1) {
SAFE_FREE(out);
SAFE_FREE(out_in);
return NULL;
}
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config_csync.h"
#include "torture.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "torture.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <stdio.h>
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config_csync.h"
#include <string.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "torture.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "csync_misc.h"
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <unistd.h>
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#define CSYNC_TEST 1
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "csync_time.h"
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "torture.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "csync_update.c"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "csync_util.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2013 by Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "c_string.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2013 by Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <sys/types.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "support.h"
+14
Ver Arquivo
@@ -6,6 +6,20 @@
#
# Copyright (C) by Klaas Freitag <freitag@owncloud.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
use lib ".";
+14
Ver Arquivo
@@ -6,6 +6,20 @@
#
# Copyright (C) by Klaas Freitag <freitag@owncloud.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
use lib ".";
+14
Ver Arquivo
@@ -6,6 +6,20 @@
#
# Copyright (C) by Olivier Goffart <ogoffart@woboq.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
use lib ".";
+14
Ver Arquivo
@@ -6,6 +6,20 @@
#
# Copyright (C) by Olivier Goffart <ogoffart@woboq.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
use lib ".";
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "std/c_alloc.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <time.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <time.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <unistd.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config_csync.h"
#include "torture.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _TORTURE_H
#define _TORTURE_H
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "torture.h"
#include "vio/csync_vio_file_stat.h"
+19
Ver Arquivo
@@ -1,3 +1,22 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include "torture.h"
+13
Ver Arquivo
@@ -1,4 +1,17 @@
#!/bin/sh
#
# Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program 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 General Public License
# for more details.
#
WINEPREFIX=${WINEPREFIX:=$HOME/.wine}
+2
Ver Arquivo
@@ -256,6 +256,7 @@ set(mirall_SRCS
wizard/owncloudwizard.cpp
wizard/owncloudsetuppage.cpp
wizard/owncloudhttpcredspage.cpp
wizard/abstractcredswizardpage.cpp
wizard/owncloudwizardresultpage.cpp
wizard/owncloudwizardcommon.cpp
wizard/owncloudshibbolethcredspage.cpp
@@ -281,6 +282,7 @@ set(mirall_HEADERS
wizard/owncloudwizard.h
wizard/owncloudsetuppage.h
wizard/owncloudhttpcredspage.h
wizard/abstractcredswizardpage.h
wizard/owncloudwizardresultpage.h
wizard/owncloudwizardcommon.h
wizard/owncloudshibbolethcredspage.h
+4
Ver Arquivo
@@ -42,6 +42,10 @@ public:
virtual void persist(Account *account) = 0;
/** Invalidates auth token, or password for basic auth */
virtual void invalidateToken(Account *account) = 0;
virtual void invalidateAndFetch(Account *account) {
invalidateToken(account);
fetch(account);
}
static QString keychainKey(const QString &url, const QString &user);
+51 -31
Ver Arquivo
@@ -100,7 +100,8 @@ HttpCredentials::HttpCredentials()
HttpCredentials::HttpCredentials(const QString& user, const QString& password)
: _user(user),
_password(password),
_ready(true)
_ready(true),
_fetchJobInProgress(false)
{
}
@@ -179,19 +180,39 @@ QString HttpCredentials::fetchUser(Account* account)
void HttpCredentials::fetch(Account *account)
{
if( !account ) {
return;
}
if (_fetchJobInProgress) {
return;
}
fetchUser(account);
QSettings *settings = account->settingsWithGroup(Theme::instance()->appName());
QString kck = keychainKey(account->url().toString(), _user );
QString key = QString::fromLatin1( "%1/data" ).arg( kck );
if( settings && settings->contains(key) ) {
// Clean the password from the config file if it is in there.
// we do not want a security problem.
settings->remove(key);
key = QString::fromLatin1( "%1/type" ).arg( kck );
settings->remove(kck);
settings->sync();
}
if (_ready) {
Q_EMIT fetched();
} else {
ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
if( ! account->property("fetch_from_old_place").isValid() ) {
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
}
job->setInsecureFallback(true);
job->setInsecureFallback(false);
job->setKey(keychainKey(account->url().toString(), _user));
connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
job->setProperty("account", QVariant::fromValue(account));
job->start();
_fetchJobInProgress = true;
}
}
bool HttpCredentials::stillValid(QNetworkReply *reply)
@@ -208,32 +229,32 @@ void HttpCredentials::slotReadJobDone(QKeychain::Job *job)
_password = readJob->textData();
Account *account = qvariant_cast<Account*>(readJob->property("account"));
QKeychain::Error error = job->error();
switch (error) {
case NoError:
_ready = true;
account->setProperty("fetch_from_old_place", QVariant());
Q_EMIT fetched();
break;
default:
if (!_user.isEmpty()) {
bool ok;
// In case we haven't tried at the old place yet, do!
if( !account->property("fetch_from_old_place").isValid() ) {
account->setProperty("fetch_from_old_place", QVariant(true) );
if( _user.isEmpty()) {
qDebug() << "Strange: User is empty!";
}
fetch(account);
return;
}
QString pwd = queryPassword(&ok);
if (ok) {
_password = pwd;
_ready = true;
persist(account);
}
emit fetched();
QKeychain::Error error = job->error();
if( !_password.isEmpty() && error == NoError ) {
// All cool, the keychain did not come back with error.
// Still, the password can be empty which indicates a problem and
// the password dialog has to be opened.
_ready = true;
_fetchJobInProgress = false;
emit fetched();
} else {
if( error != NoError ) {
qDebug() << "Error while reading password" << job->errorString();
}
qDebug() << "Error while reading password" << job->errorString();
bool ok;
QString pwd = queryPassword(&ok);
_fetchJobInProgress = false;
if (ok) {
_password = pwd;
_ready = true;
persist(account);
}
emit fetched();
}
}
@@ -268,8 +289,7 @@ void HttpCredentials::persist(Account *account)
{
account->setCredentialSetting(QLatin1String(userC), _user);
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
job->setInsecureFallback(true);
job->setInsecureFallback(false);
connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotWriteJobDone(QKeychain::Job*)));
job->setKey(keychainKey(account->url().toString(), _user));
job->setTextData(_password);
+1
Ver Arquivo
@@ -62,6 +62,7 @@ private:
QString _user;
QString _password;
bool _ready;
bool _fetchJobInProgress; //True if the keychain job is in progress or the input dialog visible
};
} // ns Mirall
@@ -31,14 +31,13 @@ QNetworkReply* ShibbolethAccessManager::createRequest(QNetworkAccessManager::Ope
QNetworkCookieJar* jar(cookieJar());
QUrl url(request.url());
QList<QNetworkCookie> cookies;
Q_FOREACH(const QNetworkCookie& cookie, jar->cookiesForUrl(url)) {
if (!cookie.name().startsWith("_shibsession_")) {
cookies << cookie;
}
}
cookies << _cookie;
cookies << _cookie; // this line and the line above replace all cookies with self and then add the shibboleth cookie (filtering the current shib cookie)
jar->setCookiesFromUrl(cookies, url);
}
+58 -10
Ver Arquivo
@@ -14,6 +14,7 @@
#include <QMutex>
#include <QSettings>
#include <QNetworkReply>
#include "creds/shibbolethcredentials.h"
#include "creds/shibboleth/shibbolethaccessmanager.h"
@@ -76,6 +77,7 @@ ShibbolethCredentials::ShibbolethCredentials()
_url(),
_shibCookie(),
_ready(false),
_stillValid(false),
_browser(0),
_otherCookies()
{}
@@ -172,9 +174,22 @@ QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
connect(this, SIGNAL(newCookie(QNetworkCookie)),
qnam, SLOT(setCookie(QNetworkCookie)));
connect(qnam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(slotReplyFinished(QNetworkReply*)));
return qnam;
}
void ShibbolethCredentials::slotReplyFinished(QNetworkReply* r)
{
QVariant target = r->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (target.isValid()) {
_stillValid = false;
qWarning() << Q_FUNC_INFO << "detected redirect, will open Login Window"; // will be done in NetworkJob's finished signal
} else {
//_stillValid = true; // gets set when reading from keychain or getting it from browser
}
}
bool ShibbolethCredentials::ready() const
{
return _ready;
@@ -201,7 +216,7 @@ void ShibbolethCredentials::fetch(Account *account)
bool ShibbolethCredentials::stillValid(QNetworkReply *reply)
{
Q_UNUSED(reply)
return true;
return _stillValid;
}
void ShibbolethCredentials::persist(Account* account)
@@ -213,17 +228,20 @@ void ShibbolethCredentials::persist(Account* account)
storeShibCookie(_shibCookie, account);
}
// only used by Application::slotLogout(). Use invalidateAndFetch for normal usage
void ShibbolethCredentials::invalidateToken(Account *account)
{
Q_UNUSED(account)
_shibCookie = QNetworkCookie();
storeShibCookie(_shibCookie, account);
storeShibCookie(_shibCookie, account); // store/erase cookie
// ### access to ctx missing, but might not be required at all
//csync_set_module_property(ctx, "session_key", "");
}
void ShibbolethCredentials::disposeBrowser()
{
qDebug() << Q_FUNC_INFO;
disconnect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotBrowserHidden()));
disconnect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie, Account*)),
@@ -237,6 +255,7 @@ void ShibbolethCredentials::onShibbolethCookieReceived(const QNetworkCookie& coo
{
disposeBrowser();
_ready = true;
_stillValid = true;
_shibCookie = cookie;
storeShibCookie(_shibCookie, account);
Q_EMIT newCookie(_shibCookie);
@@ -254,6 +273,20 @@ void ShibbolethCredentials::slotBrowserHidden()
void ShibbolethCredentials::invalidateAndFetch(Account* account)
{
_ready = false;
// delete the credentials, then in the slot fetch them again (which will trigger browser)
DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
job->setProperty("account", QVariant::fromValue(account));
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotInvalidateAndFetchInvalidateDone(QKeychain::Job*)));
job->setKey(keychainKey(account->url().toString(), "shibAssertion"));
job->start();
}
void ShibbolethCredentials::slotInvalidateAndFetchInvalidateDone(QKeychain::Job* job)
{
Account *account = qvariant_cast<Account*>(job->property("account"));
connect (this, SIGNAL(fetched()),
this, SLOT(onFetched()));
// small hack to support the ShibbolethRefresher hack
@@ -276,6 +309,7 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job)
if (job->error() == QKeychain::NoError) {
ReadPasswordJob *readJob = static_cast<ReadPasswordJob*>(job);
delete readJob->settings();
qDebug() << Q_FUNC_INFO;
QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(readJob->textData().toUtf8());
if (cookies.count() > 0) {
_shibCookie = cookies.first();
@@ -283,20 +317,34 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job)
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
_ready = true;
_stillValid = true;
Q_EMIT newCookie(_shibCookie);
Q_EMIT fetched();
} else {
ShibbolethConfigFile cfg;
_browser = new ShibbolethWebView(account, cfg.createCookieJar());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie, Account*)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie, Account*)));
connect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotBrowserHidden()));
_browser->show();
showLoginWindow(account);
}
}
void ShibbolethCredentials::showLoginWindow(Account* account)
{
if (_browser) {
_browser->activateWindow();
_browser->raise();
// FIXME On OS X this does not raise properly
return;
}
ShibbolethConfigFile cfg;
_browser = new ShibbolethWebView(account, cfg.createCookieJar());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie, Account*)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie, Account*)));
connect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotBrowserHidden()));
// FIXME If the browser was hidden (e.g. user closed it) without us logging in, the logic gets stuck
// and can only be unstuck by restarting the app or pressing "Sign in" (we should switch to offline but we don't)
_browser->show();
}
void ShibbolethCredentials::storeShibCookie(const QNetworkCookie &cookie, Account *account)
{
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
+5
Ver Arquivo
@@ -52,6 +52,8 @@ public:
QNetworkCookie cookie() const;
void showLoginWindow(Account*);
public Q_SLOTS:
void invalidateAndFetch(Account *account);
@@ -60,6 +62,8 @@ private Q_SLOTS:
void slotBrowserHidden();
void onFetched();
void slotReadJobDone(QKeychain::Job*);
void slotInvalidateAndFetchInvalidateDone(QKeychain::Job*);
void slotReplyFinished(QNetworkReply*);
Q_SIGNALS:
void newCookie(const QNetworkCookie& cookie);
@@ -73,6 +77,7 @@ private:
QNetworkCookie _shibCookie;
bool _ready;
bool _stillValid;
ShibbolethWebView* _browser;
QMap<QUrl, QList<QNetworkCookie> > _otherCookies;
};
+13 -1
Ver Arquivo
@@ -15,6 +15,7 @@
#include "mirall/theme.h"
#include "mirall/networkjobs.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/quotainfo.h"
#include "creds/abstractcredentials.h"
#include "creds/credentialsfactory.h"
@@ -62,11 +63,13 @@ Account::Account(AbstractSslErrorHandler *sslErrorHandler, QObject *parent)
: QObject(parent)
, _url(Theme::instance()->overrideServerUrl())
, _sslErrorHandler(sslErrorHandler)
, _quotaInfo(new QuotaInfo(this))
, _am(0)
, _credentials(0)
, _treatSslErrorsAsFailure(false)
, _state(Account::Disconnected)
{
qRegisterMetaType<Account*>("Account*");
}
Account::~Account()
@@ -156,11 +159,15 @@ AbstractCredentials *Account::credentials() const
void Account::setCredentials(AbstractCredentials *cred)
{
_credentials = cred;
// set active credential manager
if (_am) {
_am->deleteLater();
}
if (_credentials) {
credentials()->deleteLater();
}
_credentials = cred;
_am = _credentials->getQNAM();
connect(_am, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(slotHandleErrors(QNetworkReply*,QList<QSslError>)));
@@ -298,6 +305,11 @@ void Account::setState(int state)
}
}
QuotaInfo *Account::quotaInfo()
{
return _quotaInfo;
}
void Account::slotHandleErrors(QNetworkReply *reply , QList<QSslError> errors)
{
NetworkJobTimeoutPauser pauser(reply);
+4
Ver Arquivo
@@ -32,6 +32,7 @@ namespace Mirall {
class AbstractCredentials;
class Account;
class QuotaInfo;
class AccountManager : public QObject {
Q_OBJECT
@@ -142,6 +143,8 @@ public:
int state() const;
void setState(int state);
QuotaInfo *quotaInfo();
signals:
void stateChanged(int state);
@@ -154,6 +157,7 @@ private:
QList<QSslCertificate> _approvedCerts;
QSslConfiguration _sslConfiguration;
QScopedPointer<AbstractSslErrorHandler> _sslErrorHandler;
QuotaInfo *_quotaInfo;
QNetworkAccessManager *_am;
AbstractCredentials* _credentials;
bool _treatSslErrorsAsFailure;
+8 -1
Ver Arquivo
@@ -25,6 +25,7 @@
#include "mirall/mirallconfigfile.h"
#include "mirall/ignorelisteditor.h"
#include "mirall/account.h"
#include "mirall/quotainfo.h"
#include "creds/abstractcredentials.h"
#include <math.h>
@@ -106,6 +107,11 @@ AccountSettings::AccountSettings(QWidget *parent) :
slotAccountStateChanged(_account->state());
}
QuotaInfo *quotaInfo = _account->quotaInfo();
connect( quotaInfo, SIGNAL(quotaUpdated(qint64,qint64)),
this, SLOT(slotUpdateQuota(qint64,qint64)));
slotUpdateQuota(quotaInfo->lastQuotaTotalBytes(), quotaInfo->lastQuotaUsedBytes());
setFolderList(FolderMan::instance()->map());
}
@@ -133,6 +139,7 @@ void AccountSettings::slotFolderActivated( const QModelIndex& indx )
} else {
ui->_buttonEnable->setText( tr( "Resume" ) );
}
ui->_buttonEnable->setEnabled(_account && _account->state() == Account::Connected);
}
}
@@ -752,7 +759,7 @@ void AccountSettings::slotAccountStateChanged(int state)
/*, tr("Version: %1 (%2)").arg(versionStr).arg(version) */ );
}
} else {
showConnectionLabel( tr("No connection to %1 at <a href=\"%1\">%2</a>.")
showConnectionLabel( tr("No connection to %1 at <a href=\"%2\">%3</a>.")
.arg(Theme::instance()->appNameGUI(),
_account->url().toString(),
safeUrl.toString()) );
+28 -2
Ver Arquivo
@@ -135,7 +135,7 @@ Application::Application(int &argc, char **argv) :
}
if (account) {
connect(account, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
slotAccountChanged(account);
}
connect(AccountManager::instance(), SIGNAL(accountChanged(Account*,Account*)),
this, SLOT(slotAccountChanged(Account*,Account*)));
@@ -189,8 +189,16 @@ void Application::slotLogout()
void Application::slotAccountChanged(Account *newAccount, Account *oldAccount)
{
disconnect(oldAccount, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
if (oldAccount) {
disconnect(oldAccount, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
disconnect(oldAccount, SIGNAL(stateChanged(int)), this, SLOT(slotToggleFolderman(int)));
connect(oldAccount->quotaInfo(), SIGNAL(quotaUpdated(qint64,qint64)),
_gui, SLOT(slotRefreshQuotaDisplay(qint64,qint64)));
}
connect(newAccount, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
connect(newAccount, SIGNAL(stateChanged(int)), this, SLOT(slotToggleFolderman(int)));
connect(newAccount->quotaInfo(), SIGNAL(quotaUpdated(qint64,qint64)),
_gui, SLOT(slotRefreshQuotaDisplay(qint64,qint64)));
}
@@ -262,6 +270,24 @@ void Application::slotCredentialsFetched()
_conValidator->checkConnection();
}
void Application::slotToggleFolderman(int state)
{
FolderMan* folderMan = FolderMan::instance();
switch (state) {
case Account::Connected:
folderMan->setSyncEnabled(true);
folderMan->slotScheduleAllFolders();
break;
case Account::Disconnected:
case Account::SignedOut:
case Account::InvalidCredidential:
folderMan->setSyncEnabled(false);
folderMan->terminateSyncProcess();
break;
}
}
void Application::slotConnectionValidatorResult(ConnectionValidator::Status status)
{
qDebug() << "Connection Validator Result: " << _conValidator->statusString(status);
+2 -1
Ver Arquivo
@@ -76,8 +76,9 @@ protected slots:
void slotLogin();
void slotLogout();
void slotCleanup();
void slotAccountChanged(Account *newAccount, Account *oldAccount);
void slotAccountChanged(Account *newAccount, Account *oldAccount = 0);
void slotCredentialsFetched();
void slotToggleFolderman(int state);
private:
void setHelp();
+4 -1
Ver Arquivo
@@ -291,7 +291,10 @@ void Folder::etagRetreived(const QString& etag)
void Folder::slotNetworkUnavailable()
{
AccountManager::instance()->account()->setState(Account::Disconnected);
Account *account = AccountManager::instance()->account();
if (account && account->state() == Account::Connected) {
account->setState(Account::Disconnected);
}
_syncResult.setStatus(SyncResult::Unavailable);
emit syncStateChange();
}
+1 -1
Ver Arquivo
@@ -69,7 +69,7 @@ void FolderWatcherPrivate::startWatching()
pathsToWatch,
kFSEventStreamEventIdSinceNow,
0, // latency
kFSEventStreamCreateFlagNone
kFSEventStreamCreateFlagNone+kFSEventStreamCreateFlagIgnoreSelf
);
FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
-1
Ver Arquivo
@@ -402,7 +402,6 @@ QVariant MirallConfigFile::getValue(const QString& param, const QString& group,
const QVariant& defaultValue) const
{
QVariant systemSetting;
qDebug() << Q_FUNC_INFO;
if (Utility::isMac()) {
QSettings systemSettings(QLatin1String("/Library/Preferences/" APPLICATION_REV_DOMAIN ".plist"), QSettings::NativeFormat);
if (!group.isEmpty()) {
+5 -5
Ver Arquivo
@@ -34,6 +34,7 @@
#include "creds/credentialsfactory.h"
#include "creds/abstractcredentials.h"
#include "creds/shibbolethcredentials.h"
Q_DECLARE_METATYPE(QTimer*)
@@ -144,15 +145,13 @@ void AbstractNetworkJob::slotFinished()
AbstractCredentials *creds = _account->credentials();
if (!creds->stillValid(_reply) &&! _ignoreCredentialFailure
&& _account->state() != Account::InvalidCredidential) {
// invalidate & forget token/password
_account->credentials()->invalidateToken(_account);
_account->setState(Account::InvalidCredidential);
// invalidate & forget token/password
// but try to re-sign in.
connect( creds, SIGNAL(fetched()),
qApp, SLOT(slotCredentialsFetched()), Qt::UniqueConnection);
creds->fetch(_account); // this triggers Application::runValidator when the credidentials are fetched
creds->invalidateAndFetch(_account); // this triggers Application::runValidator when the credidentials are fetched
}
deleteLater();
}
@@ -458,7 +457,8 @@ void PropfindJob::finished()
}
emit result(items);
} else {
qDebug() << "Quota request *not* successful, http result code is " << http_result_code;
qDebug() << "Quota request *not* successful, http result code is" << http_result_code
<< (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString() : QLatin1String(""));
}
}
-8
Ver Arquivo
@@ -38,7 +38,6 @@ ownCloudGui::ownCloudGui(Application *parent) :
_logBrowser(0),
_contextMenu(0),
_recentActionsMenu(0),
_quotaInfo(0),
_folderOpenActionMapper(new QSignalMapper(this)),
_recentItemsMapper(new QSignalMapper(this)),
_app(parent)
@@ -98,11 +97,6 @@ void ownCloudGui::slotOpenSettingsDialog( bool openSettings )
}
}
QuotaInfo *ownCloudGui::quotaInfo() const
{
return _quotaInfo;
}
void ownCloudGui::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
{
// A click on the tray icon should only open the status window on Win and
@@ -363,8 +357,6 @@ void ownCloudGui::setupActions()
_actionLogout = new QAction(tr("Sign out"), this);
connect(_actionLogout, SIGNAL(triggered()), _app, SLOT(slotLogout()));
_quotaInfo = new QuotaInfo(this);
connect(_quotaInfo, SIGNAL(quotaUpdated(qint64,qint64)), SLOT(slotRefreshQuotaDisplay(qint64,qint64)));
}
void ownCloudGui::slotRefreshQuotaDisplay( qint64 total, qint64 used )
-4
Ver Arquivo
@@ -42,8 +42,6 @@ public:
bool checkAccountExists(bool openSettings);
QuotaInfo *quotaInfo() const;
signals:
void setupProxy();
@@ -94,8 +92,6 @@ private:
QAction *_actionHelp;
QAction *_actionQuit;
QuotaInfo *_quotaInfo;
QSignalMapper *_folderOpenActionMapper;
QSignalMapper *_recentItemsMapper;
+52 -20
Ver Arquivo
@@ -106,33 +106,46 @@ void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorStr
*
* Return true if the problem is handled.
*/
bool PropagateItemJob::checkForProblemsWithShared()
bool PropagateItemJob::checkForProblemsWithShared(const QString& msg)
{
QString errorString = QString::fromUtf8(ne_get_error(_propagator->_session));
int httpStatusCode = errorString.mid(0, errorString.indexOf(QChar(' '))).toInt();
PropagateItemJob *newJob = NULL;
if( httpStatusCode == 403 && _propagator->isInSharedDirectory(_item._file )) {
if( _item._type != SyncFileItem::Directory ) {
// the file was removed locally from a read only Shared sync
// the file is gone locally and it should be recovered.
SyncFileItem downloadItem(_item);
downloadItem._instruction = CSYNC_INSTRUCTION_SYNC;
if (downloadItem._instruction == CSYNC_INSTRUCTION_NEW) {
// don't try to recover pushing new files
return false;
} else if (downloadItem._instruction == CSYNC_INSTRUCTION_SYNC) {
// we modified the file locally, jsut create a conflict then
downloadItem._instruction = CSYNC_INSTRUCTION_CONFLICT;
} else {
// the file was removed or renamed, just recover the old one
downloadItem._instruction = CSYNC_INSTRUCTION_SYNC;
}
downloadItem._dir = SyncFileItem::Down;
_restoreJob.reset(new PropagateDownloadFile(_propagator, downloadItem));
newJob = new PropagateDownloadFile(_propagator, downloadItem);
} else {
// Directories are harder to recover.
// But just re-create the directory, next sync will be able to recover the files
SyncFileItem mkdirItem(_item);
mkdirItem._instruction = CSYNC_INSTRUCTION_SYNC;
mkdirItem._dir = SyncFileItem::Down;
_restoreJob.reset(new PropagateLocalMkdir(_propagator, mkdirItem));
newJob = new PropagateLocalMkdir(_propagator, mkdirItem);
// Also remove the inodes and fileid from the db so no further renames are tried for
// this item.
_propagator->_journal->avoidRenamesOnNextSync(_item._file);
}
connect(_restoreJob.data(), SIGNAL(completed(SyncFileItem)),
this, SLOT(slotRestoreJobCompleted(SyncFileItem)));
_restoreJob->start();
if( newJob ) {
newJob->setRestoreJobMsg(msg);
_restoreJob.reset(newJob);
connect(_restoreJob.data(), SIGNAL(completed(SyncFileItem)),
this, SLOT(slotRestoreJobCompleted(SyncFileItem)));
_restoreJob->start();
}
return true;
}
return false;
@@ -140,14 +153,30 @@ bool PropagateItemJob::checkForProblemsWithShared()
void PropagateItemJob::slotRestoreJobCompleted(const SyncFileItem& item )
{
if( item._status == SyncFileItem::Success ) {
done( SyncFileItem::SoftError, tr("The file was removed from a read only share. The file has been restored."));
QString msg;
if(_restoreJob) {
msg = _restoreJob->restoreJobMsg();
_restoreJob->setRestoreJobMsg();
}
if( item._status == SyncFileItem::Success || item._status == SyncFileItem::Conflict) {
done( SyncFileItem::SoftError, msg);
} else {
done( item._status, tr("A file was removed from a read only share, but restoring failed: %1").arg(item._errorString) );
done( item._status, tr("A file or directory was removed from a read only share, but restoring failed: %1").arg(item._errorString) );
}
}
QString PropagateItemJob::restoreJobMsg()
{
return _restoreJobMsg;
}
void PropagateItemJob::setRestoreJobMsg( const QString& msg )
{
_restoreJobMsg = msg;
}
// compare two files with given filename and return true if they have the same content
static bool fileEquals(const QString &fn1, const QString &fn2) {
QFile f1(fn1);
@@ -241,7 +270,7 @@ void PropagateRemoteRemove::start()
qDebug() << "** DELETE " << uri.data();
int rc = ne_delete(_propagator->_session, uri.data());
if( checkForProblemsWithShared() ) {
if( checkForProblemsWithShared(tr("The file has been removed from a read only share. It was restored.")) ) {
return;
}
@@ -387,8 +416,9 @@ void PropagateUploadFile::start()
done( SyncFileItem::SoftError, errMsg );
} else {
// Other HBF error conditions.
// FIXME: find out the error class.
_item._httpErrorCode = hbf_fail_http_code(trans.data());
if(checkForProblemsWithShared(tr("The file was edited locally but is part of a read only share. "
"It is restored and your edit is in the conflict file.")))
return;
done(SyncFileItem::NormalError, hbf_error_string(trans.data(), state));
}
return;
@@ -895,6 +925,8 @@ void PropagateLocalRename::start()
void PropagateRemoteRename::start()
{
qDebug() << Q_FUNC_INFO << _item._file << "-->"<< _item._renameTarget;
if (_item._file == _item._renameTarget) {
if (!_item._isDirectory) {
// The parents has been renamed already so there is nothing more to do.
@@ -923,7 +955,7 @@ void PropagateRemoteRename::start()
int rc = ne_move(_propagator->_session, 1, uri1.data(), uri2.data());
if( checkForProblemsWithShared()) {
if( checkForProblemsWithShared(tr("The file was renamed but is part of a read only share. The original file was restored."))) {
return;
}
@@ -1061,7 +1093,7 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
continue;
}
while (!item._file.startsWith(directories.top().first)) {
while (!item.destination().startsWith(directories.top().first)) {
directories.pop();
}
@@ -1075,7 +1107,7 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
} else {
directories.top().second->append(dir);
}
directories.push(qMakePair(item._file + "/" , dir));
directories.push(qMakePair(item.destination() + "/" , dir));
} else if (PropagateItemJob* current = createJob(item)) {
directories.top().second->append(current);
}
@@ -1105,7 +1137,7 @@ bool OwncloudPropagator::isInSharedDirectory(const QString& file)
// The Shared directory is synced as its own sync connection
re = true;
} else {
if( file.startsWith("Shared/") ) {
if( file.startsWith("Shared/") || file == "Shared" ) {
// The whole ownCloud is synced and Shared is always a top dir
re = true;
}
@@ -1126,7 +1158,7 @@ void PropagateDirectory::start()
void PropagateDirectory::proceedNext(SyncFileItem::Status status)
{
if (status == SyncFileItem::FatalError) {
if (status == SyncFileItem::FatalError || (_current == -1 && status != SyncFileItem::Success)) {
emit finished(status);
return;
} else if (status == SyncFileItem::NormalError || status == SyncFileItem::SoftError) {
+9 -1
Ver Arquivo
@@ -119,12 +119,20 @@ protected:
*/
void limitBandwidth(qint64 progress, qint64 limit);
bool checkForProblemsWithShared();
bool checkForProblemsWithShared(const QString& msg);
/*
* set a custom restore job message that is used if the restore job succeeded.
* It is displayed in the activity view.
*/
QString restoreJobMsg();
void setRestoreJobMsg( const QString& msg = QString() );
QElapsedTimer _lastTime;
qint64 _lastProgress;
int _httpStatusCode;
SyncFileItem _item;
QString _restoreJobMsg;
protected slots:
void slotRestoreJobCompleted(const SyncFileItem& );
+29 -20
Ver Arquivo
@@ -27,18 +27,17 @@ static const int failIntervalT = 5*1000;
static const int initialTimeT = 1*1000;
}
QuotaInfo::QuotaInfo(QObject *parent)
: QObject(parent)
, _account(AccountManager::instance()->account())
QuotaInfo::QuotaInfo(Account *account)
: QObject(account)
, _account(account)
, _lastQuotaTotalBytes(0)
, _lastQuotaUsedBytes(0)
, _refreshTimer(new QTimer(this))
, _jobRestartTimer(new QTimer(this))
{
connect(AccountManager::instance(), SIGNAL(accountChanged(Account*,Account*)),
SLOT(slotAccountChanged(Account*,Account*)));
connect(_refreshTimer, SIGNAL(timeout()), SLOT(slotCheckQuota()));
_refreshTimer->setSingleShot(true);
_refreshTimer->start(initialTimeT);
connect(_account, SIGNAL(stateChanged(int)), SLOT(slotAccountStateChanged(int)));
connect(_jobRestartTimer, SIGNAL(timeout()), SLOT(slotCheckQuota()));
_jobRestartTimer->setSingleShot(true);
_jobRestartTimer->start(initialTimeT);
}
void QuotaInfo::slotAccountChanged(Account *newAccount, Account *oldAccount)
@@ -50,39 +49,49 @@ void QuotaInfo::slotAccountChanged(Account *newAccount, Account *oldAccount)
void QuotaInfo::slotAccountStateChanged(int state)
{
if (state == Account::Connected) {
switch (state) {
case Account::SignedOut: // fall through
case Account::InvalidCredidential:
_jobRestartTimer->stop();
break;
case Account::Connected: // fall through
case Account::Disconnected:
slotCheckQuota();
} else {
_refreshTimer->stop();
}
}
void QuotaInfo::slotRequestFailed()
{
_refreshTimer->start(failIntervalT);
if (!_account.isNull() && _account->state() == Account::Connected) {
_account->setState(Account::Disconnected);
}
_lastQuotaTotalBytes = 0;
_lastQuotaUsedBytes = 0;
_jobRestartTimer->start(failIntervalT);
_jobRestartTimer->start(failIntervalT);
}
void QuotaInfo::slotCheckQuota()
{
if (!_account.isNull() && _account->credentials() && _account->credentials()->ready()
&& _account->state() == Account::Connected) {
if (!_account.isNull() && _account->credentials() && _account->credentials()->ready()) {
CheckQuotaJob *job = new CheckQuotaJob(_account, "/", this);
connect(job, SIGNAL(quotaRetrieved(qint64,qint64)), SLOT(slotUpdateLastQuota(qint64,qint64)));
connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotRequestFailed()));
job->start();
} else {
_lastQuotaTotalBytes = 0;
_lastQuotaUsedBytes = 0;
_refreshTimer->start(failIntervalT);
}
}
void QuotaInfo::slotUpdateLastQuota(qint64 total, qint64 used)
{
if(_account->state() == Account::Disconnected) {
_account->setState(Account::Connected);
}
_lastQuotaTotalBytes = total;
_lastQuotaUsedBytes = used;
emit quotaUpdated(total, used);
_refreshTimer->start(defaultIntervalT);
_jobRestartTimer->start(defaultIntervalT);
}
}
+7 -2
Ver Arquivo
@@ -11,6 +11,9 @@
* for more details.
*/
#ifndef QUOTAINFO_H
#define QUOTAINFO_H
#include <QObject>
#include <QPointer>
@@ -23,7 +26,7 @@ class Account;
class QuotaInfo : public QObject {
Q_OBJECT
public:
QuotaInfo(QObject *parent);
QuotaInfo(Account *account);
qint64 lastQuotaTotalBytes() const { return _lastQuotaTotalBytes; }
qint64 lastQuotaUsedBytes() const { return _lastQuotaUsedBytes; }
@@ -44,9 +47,11 @@ private:
QPointer<Account> _account;
qint64 _lastQuotaTotalBytes;
qint64 _lastQuotaUsedBytes;
QTimer *_refreshTimer;
QTimer *_jobRestartTimer;
};
} // namespace Mirall
#endif //QUOTAINFO_H
+7 -8
Ver Arquivo
@@ -78,10 +78,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) :
connect( folderMan, SIGNAL(folderSyncStateChange(QString)),
this, SLOT(slotSyncStateChange(QString)));
QuotaInfo *quotaInfo = gui->quotaInfo();
connect( quotaInfo, SIGNAL(quotaUpdated(qint64,qint64)),
_accountSettings, SLOT(slotUpdateQuota(qint64,qint64)));
_accountSettings->slotUpdateQuota(quotaInfo->lastQuotaTotalBytes(), quotaInfo->lastQuotaUsedBytes());
connect( _accountSettings, SIGNAL(folderChanged()), gui, SLOT(slotFoldersChanged()));
connect( _accountSettings, SIGNAL(openFolderAlias(const QString&)),
gui, SLOT(slotFolderOpenAction(QString)));
@@ -132,10 +128,11 @@ SettingsDialog::~SettingsDialog()
void SettingsDialog::addAccount(const QString &title, QWidget *widget)
{
_accountItem = new QListWidgetItem(Theme::instance()->syncStateIcon(SyncResult::Undefined, true), title);
_accountItem = new QListWidgetItem(title);
_accountItem->setSizeHint(QSize(0, 32));
_ui->labelWidget->addItem(_accountItem);
_ui->stack->addWidget(widget);
slotSyncStateChange();
}
@@ -145,9 +142,11 @@ void SettingsDialog::slotSyncStateChange(const QString& alias)
SyncResult state = folderMan->accountStatus(folderMan->map().values());
_accountItem->setIcon(Theme::instance()->syncStateIcon(state.status()));
Folder *folder = folderMan->folder(alias);
if( folder ) {
_accountSettings->slotUpdateFolderState(folder);
if (!alias.isEmpty()) {
Folder *folder = folderMan->folder(alias);
if( folder ) {
_accountSettings->slotUpdateFolderState(folder);
}
}
}
+1 -1
Ver Arquivo
@@ -45,7 +45,7 @@ public:
void setGeneralErrors( const QStringList& errors );
public slots:
void slotSyncStateChange(const QString& alias);
void slotSyncStateChange(const QString& alias = QString());
void slotRefreshResultList();
void showActivityPage();
+15 -10
Ver Arquivo
@@ -69,7 +69,6 @@ static bool isSelfSigned(const QSslCertificate &certificate)
certificate.issuerInfo(QSslCertificate::OrganizationalUnitName) == certificate.subjectInfo(QSslCertificate::OrganizationalUnitName);
}
QMenu* SslButton::buildCertMenu(QMenu *parent, const QSslCertificate& cert,
const QList<QSslCertificate>& userApproved, int pos)
{
@@ -79,6 +78,8 @@ QMenu* SslButton::buildCertMenu(QMenu *parent, const QSslCertificate& cert,
QString country = QStringList(cert.subjectInfo(QSslCertificate::CountryName)).join(QChar(';'));
QString state = QStringList(cert.subjectInfo(QSslCertificate::StateOrProvinceName)).join(QChar(';'));
QString issuer = QStringList(cert.issuerInfo(QSslCertificate::CommonName)).join(QChar(';'));
if (issuer.isEmpty())
issuer = QStringList(cert.issuerInfo(QSslCertificate::OrganizationalUnitName)).join(QChar(';'));
QString md5 = Utility::formatFingerprint(cert.digest(QCryptographicHash::Md5).toHex());
QString sha1 = Utility::formatFingerprint(cert.digest(QCryptographicHash::Sha1).toHex());
QString serial = QString::fromUtf8(cert.serialNumber(), true);
@@ -136,8 +137,8 @@ QMenu* SslButton::buildCertMenu(QMenu *parent, const QSslCertificate& cert,
QString certId = cn.isEmpty() ? ou : cn;
if (QSslSocket::systemCaCertificates().contains(cert) && pos == 0) {
txt += tr("%1 (in Root CA store)").arg(certId);
if (QSslSocket::systemCaCertificates().contains(cert)) {
txt += certId;
} else {
if (isSelfSigned(cert)) {
txt += tr("%1 (self-signed)").arg(certId);
@@ -178,15 +179,19 @@ void SslButton::updateAccountInfo(Account *account)
QList<QSslCertificate> chain = account->sslConfiguration().peerCertificateChain();
menu->addAction(tr("Certificate information:"))->setEnabled(false);
QListIterator<QSslCertificate> caIt(QSslSocket::systemCaCertificates());
caIt.toBack();
QList<QSslCertificate> tmpChain;
foreach(QSslCertificate cert, chain) {
tmpChain << cert;
if (QSslSocket::systemCaCertificates().contains(cert))
break;
}
chain = tmpChain;
// find trust anchor (informational only, verification is done by QSslSocket!)
while (caIt.hasPrevious()) {
QSslCertificate rootCA = caIt.previous();
foreach(QSslCertificate rootCA, QSslSocket::systemCaCertificates()) {
if (rootCA.issuerInfo(QSslCertificate::CommonName) == chain.last().issuerInfo(QSslCertificate::CommonName) &&
rootCA.issuerInfo(QSslCertificate::Organization) == chain.last().issuerInfo(QSslCertificate::Organization)
&& !isSelfSigned(rootCA)) {
chain << rootCA;
rootCA.issuerInfo(QSslCertificate::Organization) == chain.last().issuerInfo(QSslCertificate::Organization)) {
chain.append(rootCA);
break;
}
}
+2 -1
Ver Arquivo
@@ -785,8 +785,9 @@ void SyncJournalDb::avoidRenamesOnNextSync(const QString& path)
}
QSqlQuery query(_db);
query.prepare("UPDATE metadata SET fileid = '', inode = '0' WHERE path LIKE(?||'/%')");
query.prepare("UPDATE metadata SET fileid = '', inode = '0' WHERE path == ? OR path LIKE(?||'/%')");
query.bindValue(0, path);
query.bindValue(1, path);
if( !query.exec() ) {
qDebug() << "SQL error in avoidRenamesOnNextSync: "<< query.lastError().text();
} else {
+1 -1
Ver Arquivo
@@ -204,7 +204,7 @@ QString Theme::about() const
{
return tr("<p>Version %1 For more information please visit <a href='%2'>%3</a>.</p>"
"<p>Copyright ownCloud, Inc.<p>"
"<p>Distributed by %4 and licensed under the GNU Public License (GPL) Version 2.0.<br>"
"<p>Distributed by %4 and licensed under the GNU General Public License (GPL) Version 2.0.<br>"
"%5 and the %5 logo are registered trademarks of %4 in the<br>"
"United States, other countries, or both.</p>")
.arg(MIRALL_VERSION_STRING).arg("http://"MIRALL_STRINGIFY(APPLICATION_DOMAIN))
+34
Ver Arquivo
@@ -0,0 +1,34 @@
/*
* Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program 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 General Public License
* for more details.
*/
#include "creds/abstractcredentials.h"
#include "creds/credentialsfactory.h"
#include "mirall/account.h"
#include "wizard/owncloudwizard.h"
#include "wizard/abstractcredswizardpage.h"
namespace Mirall {
void AbstractCredentialsWizardPage::cleanupPage()
{
Account *account = static_cast<OwncloudWizard*>(wizard())->account();
AbstractCredentials *creds = account->credentials();
if (creds) {
if (!creds->inherits("DummyCredentials")) {
account->setCredentials(CredentialsFactory::create("dummy"));
}
}
}
}
+2 -1
Ver Arquivo
@@ -24,7 +24,8 @@ class AbstractCredentials;
class AbstractCredentialsWizardPage : public QWizardPage
{
public:
virtual AbstractCredentials* getCredentials() const = 0;
void cleanupPage();
virtual AbstractCredentials* getCredentials() const = 0;
};
} // ns Mirall
+2 -2
Ver Arquivo
@@ -38,8 +38,8 @@ void OwncloudShibbolethCredsPage::setupBrowser()
}
OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard*>(wizard());
_browser = new ShibbolethWebView(ocWizard->account());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)),
this, SLOT(slotShibbolethCookieReceived(QNetworkCookie)));
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie, Account*)),
this, SLOT(slotShibbolethCookieReceived(QNetworkCookie, Account*)));
connect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotViewHidden()));
connect(_browser, SIGNAL(otherCookiesReceived(QList<QNetworkCookie>, QUrl)),
+12
Ver Arquivo
@@ -1,3 +1,15 @@
/*
* Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program 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 General Public License
* for more details.
*/
#include "../../../src/mirall/utility.h"
#include <QDir>
+13
Ver Arquivo
@@ -1,4 +1,17 @@
#!/usr/bin/env perl
#
# Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program 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 General Public License
# for more details.
#
use strict;
use File::Path qw(make_path);
use File::Basename qw(dirname);
+13
Ver Arquivo
@@ -1,4 +1,17 @@
#!/usr/bin/env perl
#
# Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program 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 General Public License
# for more details.
#
use strict;
use Data::Random::WordList;
+3 -3
Ver Arquivo
@@ -1661,7 +1661,7 @@ Bitte stellen Sie sicher, dass Ihre Netzwerkverbindung funktioniert.</translatio
<message>
<location filename="../src/mirall/sslbutton.cpp" line="104"/>
<source>Serial:</source>
<translation>Schlüssel:</translation>
<translation>Seriennummer:</translation>
</message>
<message>
<location filename="../src/mirall/sslbutton.cpp" line="107"/>
@@ -1676,7 +1676,7 @@ Bitte stellen Sie sicher, dass Ihre Netzwerkverbindung funktioniert.</translatio
<message>
<location filename="../src/mirall/sslbutton.cpp" line="111"/>
<source>Issued on:</source>
<translation>Ausgestellt auf:</translation>
<translation>Ausgestellt am:</translation>
</message>
<message>
<location filename="../src/mirall/sslbutton.cpp" line="112"/>
@@ -2362,4 +2362,4 @@ Bitte stellen Sie sicher, dass Ihre Netzwerkverbindung funktioniert.</translatio
<translation>Synchronisation wurde angehalten</translation>
</message>
</context>
</TS>
</TS>