allow to disable file uploads for account types
This commit is contained in:
parent
15d37c9178
commit
6f9b2af112
|
@ -1,6 +1,7 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<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>
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
@ -94,7 +94,15 @@ class baseType {
|
||||||
public function getListAttributeDescriptions() {
|
public function getListAttributeDescriptions() {
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue