smeserver-pydio/root/etc/e-smith/templates/etc/pydio/bootstrap_repositories.php/050repo

119 lines
3.4 KiB
Plaintext

/*********************************************************/
/* BASIC REPOSITORY CONFIGURATION.
/* To add a repository, create a new shared-folders and choose
/* the access with web-based management interface
/*********************************************************/
{
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open_ro();
my $homedir = $ajaxplorer{'HomeDir'} || 'none';
if (($homedir eq 'enabled') || ($homedir eq 'users')){
$OUT .=<<"EOF";
\$REPOSITORIES["home"] = array(
"DISPLAY" => "Perso",
"AJXP_SLUG" => "home",
"DRIVER" => "fs",
"DRIVER_OPTIONS" => array(
"PATH" => "/home/e-smith/files/users/AJXP_USER/home",
"CREATE" => false,
"RECYCLE_BIN" => '',
"CHMOD_VALUE" => '0660',
"DEFAULT_RIGHTS" => "",
"PAGINATION_THRESHOLD" => 500,
"PAGINATION_NUMBER" => 200,
"META_SOURCES" => array(
)
),
);
EOF
}
foreach my $share ($a->get_all_by_prop(type=>'share')){
my $name = $share->key;
my $access = $share->prop('Ajaxplorer') || 'disabled';
next unless ($access eq 'enabled');
my $desc = $share->prop('Name') || $name;
my $recycledir = (($share->prop('RecycleBin') || 'disabled') eq 'disabled') ?
'' : $share->prop('RecycleBinDir') || 'Recycle Bin';
$OUT .=<<"EOF";
\$REPOSITORIES["$name"] = array(
"DISPLAY" => "$name",
"AJXP_SLUG" => "$name",
"DRIVER" => "fs",
"DRIVER_OPTIONS" => array(
"PATH" => "/home/e-smith/files/shares/$name/files/",
"USER_DESCRIPTION" => "$desc",
"CREATE" => false,
"RECYCLE_BIN" => '$recycledir',
"CHMOD_VALUE" => '0660',
"DEFAULT_RIGHTS" => "",
"PAGINATION_THRESHOLD" => 500,
"PAGINATION_NUMBER" => 200,
"META_SOURCES" => array(
"metastore.serial" => array(
"METADATA_FILE_LOCATION" => "outside",
),
"meta.user" => array (
"meta_fields" => "tags,stars_rate,css_label,anything_area",
"meta_labels" => "Tags,Rate,Type,Note",
),
"meta.filehasher" => array(),
"meta.watch" => array(),
"index.lucene" => array(
"index_content" => true,
"index_meta_fields" => 'tags,anything_area'
)
)
),
);
EOF
}
if (($ajaxplorer{'PublicShares'} || 'enabled') eq 'enabled'){
$OUT .=<<'EOF';
$REPOSITORIES["ajxp_shared"] = array(
"DISPLAY" => "Shared Elements",
"DISPLAY_ID" => "363",
"DRIVER" => "ajxp_shared",
"DRIVER_OPTIONS"=> array(
"DEFAULT_RIGHTS" => ""
)
);
EOF
}
$OUT .=<<'EOF';
// ADMIN REPOSITORY
/*
Settings interface is disabled because the configuration
is managed by the SME Server templates system
New repositories can be added using the smeserver-shared-folders
contrib
$REPOSITORIES["ajxp_conf"] = array(
"DISPLAY" => "Settings",
"DISPLAY_ID" => "165",
"DRIVER" => "ajxp_conf",
"DRIVER_OPTIONS"=> array()
);
*/
EOF
}