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

@ -1,6 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<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
<span style="font-weight: bold;">build_uploadAccounts()</span>
has a new parameter
<span style="font-weight: bold;">$selectedModules</span>
.<br>
<span style="font-weight: bold;">$selectedModules</span>.<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>

View File

@ -3,7 +3,7 @@
$Id$
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
it under the terms of the GNU General Public License as published by
@ -94,7 +94,15 @@ class baseType {
public function getListAttributeDescriptions() {
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;
}
$types = $_SESSION['config']->get_ActiveTypes();
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
if (isset($_POST['type'])) {
// get selected type