allow to disable file uploads for account types

This commit is contained in:
Roland Gruber 2010-02-27 19:14:15 +00:00
parent 15d37c9178
commit 6f9b2af112
3 changed files with 25 additions and 6 deletions

View File

@ -2,6 +2,7 @@
<html><head> <html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15"><title>Upgrade notes</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15"><title>Upgrade notes</title>
@ -29,9 +30,11 @@ There is a new log level LOG_DEBUG available for logNewMessage().
The function The function
<span style="font-weight: bold;">build_uploadAccounts()</span> <span style="font-weight: bold;">build_uploadAccounts()</span>
has a new parameter has a new parameter
<span style="font-weight: bold;">$selectedModules</span> <span style="font-weight: bold;">$selectedModules</span>.<br>
.<br> <h3>Type interface:</h3>
The new function <span style="font-weight: bold;">supportsFileUpload()</span> specifies if file uploads are supported (default true).<br>
<br> <br>
<br> <br>

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2005 - 2006 Roland Gruber Copyright (C) 2005 - 2010 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -95,6 +95,14 @@ class baseType {
return array(); return array();
} }
/**
* Returns if entries of this type may be created via file upload.
*
* @return boolean true, if file upload is supported
*/
public function supportsFileUpload() {
return true;
}
} }

View File

@ -67,10 +67,18 @@ if (isset($_GET['getCSV'])) {
exit; exit;
} }
$types = $_SESSION['config']->get_ActiveTypes();
include 'main_header.php'; include 'main_header.php';
// get possible types and remove those which do not support file upload
$types = $_SESSION['config']->get_ActiveTypes();
for ($i = 0; $i < sizeof($types); $i++) {
$myType = new $types[$i]();
if (!$myType->supportsFileUpload()) {
unset($types[$i]);
}
}
$types = array_values($types);
// check if account specific page should be shown // check if account specific page should be shown
if (isset($_POST['type'])) { if (isset($_POST['type'])) {
// get selected type // get selected type