Rename and adjust events scripts (Ajaxplorer -> Pydio)

This commit is contained in:
Daniel Berteaud 2013-10-17 17:36:58 +02:00
parent 741270d1bb
commit 2fc152b87d
1 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 2011-2012 Firewall Services
# copyright (C) 2011-2013 Firewall Services
# Daniel Berteaud <daniel@firewall-services.com>
#
# This program is free software; you can redistribute it and/or modify
@ -32,22 +32,22 @@ my $a = esmith::AccountsDB->open_ro;
my $domain = $c->get('DomainName')->value;
# Remove active sessions
unlink(</var/lib/ajaxplorer/tmp/sess_*>);
unlink(</var/lib/pydio/tmp/sess_*>);
# Remove plugin and i18n cache
unlink(</var/cache/ajaxplorer/plugin*.ser>);
unlink(</var/cache/ajaxplorer/i18n/*.ser>);
unlink(</var/cache/pydio/plugin*.ser>);
unlink(</var/cache/pydio/i18n/*.ser>);
foreach my $user (($a->users),$a->get('admin')){
my $name = $user->key;
my $first = $user->prop('FirstName') || '';
my $last = $user->prop('LastName') || $name;
my $data;
mkpath('/var/lib/ajaxplorer/plugins/auth.serial/' . $name);
chmod 0770, "/var/lib/ajaxplorer/plugins/auth.serial/$name";
chown '0', '102', "/var/lib/ajaxplorer/plugins/auth.serial/$name";
if (-s "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser"){
open RROLE, "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser";
mkpath('/var/lib/pydio/plugins/auth.serial/' . $name);
chmod 0770, "/var/lib/pydio/plugins/auth.serial/$name";
chown '0', '102', "/var/lib/pydio/plugins/auth.serial/$name";
if (-s "/var/lib/pydio/plugins/auth.serial/$name/role.ser"){
open RROLE, "/var/lib/pydio/plugins/auth.serial/$name/role.ser";
$data = <RROLE>;
close RROLE;
$data = unserialize($data);
@ -94,7 +94,7 @@ foreach my $user (($a->users),$a->get('admin')){
$data->{"\0*\0parameters"}->{'AJXP_REPO_SCOPE_ALL'}->{'core.conf'}->{'email'} = "$name\@$domain";
$data->{"\0*\0parameters"}->{'AJXP_REPO_SCOPE_ALL'}->{'core.conf'}->{'USER_DISPLAY_NAME'} = "$first $last";
open WROLE, '+>', "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser";
open WROLE, '+>', "/var/lib/pydio/plugins/auth.serial/$name/role.ser";
print WROLE serialize($data);
close WROLE;
}