Comparar commits

...

8 Commits

Autor SHA1 Mensagem Data
Daniel Molkentin 1c92d68fe1 Merge branch '1.6' of https://github.com/owncloud/mirall into 1.6 2014-12-02 15:14:04 +01:00
Olivier Goffart d983f45eab compile 2014-11-27 16:19:36 +01:00
Olivier Goffart 944de6a3d5 Shibboleth: Fix our implemtnation of CookieJar::deleteCookie
It was deleting too many cookies.
That function is virtual in Qt5 and is used when adding cookie.
But some Shibboleth have several cookies with the same name, and we need to keep them.

Our implementaiton was meant to delete all the shiboleth cookies when we want to log out

(cherry picked from commit 1f9d02e7fa)

Conflicts:
	src/mirall/cookiejar.h
2014-11-27 13:00:00 +01:00
Klaas Freitag ebb9cc786f tests: exit t5.pl if running against ownCloud 6
t5.pl checks the environment variable SERVER_VERSION and if that equals
"owncloud6" it bails out after a check of the sharing ocs api.

Conflicts:
	csync/tests/ownCloud/t5.pl
2014-11-21 17:10:34 +01:00
Klaas Freitag f01788ae78 tests: Never stumble over an already existing test share dir.
Conflicts:
	csync/tests/ownCloud/t5.pl
2014-11-21 17:10:34 +01:00
Klaas Freitag 4de09e85e3 Add call to removeRemoteDir 2014-11-21 17:10:34 +01:00
Klaas Freitag cc11833d8d tests: only do the sharing test with ownCloud6
set the environment variable SERVER_VERION=owncloud6 to have the full
test running. Fix required to make Jenkins go green.
2014-10-29 15:59:43 +01:00
Daniel Molkentin 0f58431746 Make sign_dmg.sh script fix frameworks correctly, resize disk image 2014-10-09 18:38:25 +02:00
5 arquivos alterados com 68 adições e 34 exclusões
+28 -2
Ver Arquivo
@@ -61,7 +61,7 @@ our $infoCnt = 1;
our %config;
@ISA = qw(Exporter);
@EXPORT = qw( initTesting createRemoteDir createLocalDir cleanup csync
@EXPORT = qw( initTesting createRemoteDir removeRemoteDir createLocalDir cleanup csync
assertLocalDirs assertLocalAndRemoteDir glob_put put_to_dir
putToDirLWP localDir remoteDir localCleanup createLocalFile md5OfFile
remoteCleanup server initLocalDir initRemoteDir moveRemoteFile
@@ -181,6 +181,32 @@ sub initLocalDir
mkdir ($localDir, 0777 );
}
sub removeRemoteDir($;$)
{
my ($dir, $optionsRef) = @_;
my $url = testDirUrl() . $dir;
if( $optionsRef && $optionsRef->{user} && $optionsRef->{passwd} ) {
$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
-user=> $optionsRef->{user},
-pass=> $optionsRef->{passwd} );
if( $optionsRef->{url} ) {
$url = $optionsRef->{url} . $dir;
}
}
$d->open( $owncloud );
print $d->message . "\n";
my $re = $d->delete( $url );
if( $re == 0 ) {
print "Failed to remove directory <$url>:" . $d->message() ."\n";
}
return $re;
}
sub createRemoteDir(;$$)
{
my ($dir, $optionsRef) = @_;
@@ -201,7 +227,7 @@ sub createRemoteDir(;$$)
my $re = $d->mkcol( $url );
if( $re == 0 ) {
print "Failed to create directory <$url>: $d->message() \n";
print "Failed to create directory <$url>: " . $d->message() ."\n";
exit 1;
}
$d->open( $url );
+24 -14
Ver Arquivo
@@ -35,6 +35,13 @@ print "Hello, this is t5, a tester for syncing of files in Shares\n";
initTesting();
my $share_dir = "share_source";
my $sharee = { user => configValue('share_user'),
passwd => configValue('share_passwd'),
url => server() };
# first remove a possibly left over share dir.
printInfo( "Remove possibly left over share dir" );
removeRemoteDir( $share_dir, $sharee );
printInfo( "Create a share." );
my $shareId = createShare( $share_dir, 31 );
@@ -42,25 +49,28 @@ print "Created share with id <$shareId>\n";
assert( $shareId > 0 );
my $sharee = { user => configValue('share_user'),
passwd => configValue('share_passwd'),
url => server() };
if( $ENV{SERVER_VERSION} eq "owncloud7" ) {
print "This test does not make sense for ownCloud7, leaving for good!\n\n";
exit;
}
# put a couple of files into the shared directory in the sharer account
glob_put( 'sharing/*', $share_dir, $sharee);
# now user kf has a new directory in shared.
if( $ENV{SERVER_VERSION} eq "owncloud6" ) {
# now user kf has a new directory in shared.
# call csync, sync local t1 to remote t1
printInfo("Initial sync, sync stuff down.");
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
# Local file to a read/write share should be synced up
printInfo("Put a file into the share.");
createLocalFile( localDir(). $share_dir . "/foobar.txt", 8094 );
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
# call csync, sync local t1 to remote t1
printInfo("Initial sync, sync stuff down.");
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
# Local file to a read/write share should be synced up
printInfo("Put a file into the share.");
createLocalFile( localDir(). $share_dir . "/foobar.txt", 8094 );
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
}
printInfo("Remove a Share.");
removeShare($shareId, $share_dir);
+13 -1
Ver Arquivo
@@ -241,7 +241,19 @@ void ShibbolethCredentials::persist(Account* account)
void ShibbolethCredentials::invalidateToken(Account *account)
{
CookieJar *jar = static_cast<CookieJar*>(account->networkAccessManager()->cookieJar());
jar->deleteCookie(_shibCookie);
// Remove the _shibCookie
QList<QNetworkCookie> cookies = jar->allCookies();
for (QList<QNetworkCookie>::iterator it = cookies.begin(); it != cookies.end(); ) {
if (it->name() == _shibCookie.name()) {
it = cookies.erase(it);
} else {
++it;
}
}
jar->setAllCookies(cookies);
// Clear all other temporary cookies
jar->clearSessionCookies();
removeShibCookie(account);
_shibCookie = QNetworkCookie();
-16
Ver Arquivo
@@ -91,27 +91,11 @@ QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl &url) const
return cookies;
}
bool CookieJar::deleteCookie(const QNetworkCookie &delCookie)
{
QList<QNetworkCookie> cookies = allCookies();
bool removeSucceeded = false;
foreach(const QNetworkCookie &cookie, cookies) {
// ### cookies are not identical in attriutes, why?
if (cookie.name() == delCookie.name()) {
cookies.removeOne(cookie);
removeSucceeded = true;
}
}
setAllCookies(cookies);
return removeSucceeded;
}
void CookieJar::clearSessionCookies()
{
setAllCookies(removeExpired(allCookies()));
}
void CookieJar::save()
{
QFile file;
+3 -1
Ver Arquivo
@@ -29,9 +29,11 @@ public:
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
virtual bool deleteCookie(const QNetworkCookie & cookie);
void clearSessionCookies();
using QNetworkCookieJar::setAllCookies;
using QNetworkCookieJar::allCookies;
signals:
void newCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
private: